:fix: push on dev site, rename function, files and folder, and fix some bug

This commit is contained in:
florian.llimos 2024-11-15 16:33:50 +01:00
parent ffcf6fb8f2
commit 9dd3d4b39c
16 changed files with 395 additions and 146 deletions

View File

@ -1,3 +1,3 @@
# cartographie_bbe
Composant pour la cartographie de bbe
https://bois-bocage-energie.agence-appaloosa.fr/carte-interactive-bois-bocage-energie/

View File

@ -9,10 +9,6 @@
padding: 0;
}
.red {
color: red;
}
.bold {
font-family: Inter;
font-size: 14px;
@ -30,28 +26,6 @@
border-radius: 10px;
}
/* #reset-button::before {
content: "";
position: absolute;
width: 20px;
height: 20px;
margin-left: -25px;
background-image: url("https://cdn-icons-png.flaticon.com/128/9497/9497023.png");
background-size: cover;
}
#reset-button {
grid-row: b / c;
grid-column: d / e;
border-radius: 15px;
width: 220px;
padding-right: 0px;
margin-top: 10px;
}
#reset-button:hover {
cursor: pointer;
} */
.button-active {
background-color: #95C11F !important;
border : 2px solid #95C11F !important;
@ -72,16 +46,26 @@
/* MAP & ZOOM */
/* MAP & ZOOM */
#map {
width: 100%;
height: 60vh;
margin-top: 0;
box-shadow: 1px 1px 27px -5px rgba(0,0,0,0.75);
-webkit-box-shadow: 1px 1px 27px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 1px 1px 27px -5px rgba(0,0,0,0.75);
.map-full-screen {
height: 100vh !important;
width: 100% !important;
position: fixed !important;
top: 0 !important;
left: 0 !important;
border: none !important;
border-radius: 0 !important;
}
.leaflet-verticalcenter.leaflet-left {
.map-container {
width: 100%;
border-radius: 0 0 80px 80px;
border: 2px solid black;
border-top: none;
height: 60vh;
margin-top: 0;
}
.leaflet-left {
position: absolute;
left: 10px;
top: 50%;
@ -107,6 +91,10 @@
width: 250px !important;
}
.leaflet-popup-tip-container {
display: none;
}
.modal-images {
display: grid;
grid-template-columns: repeat(2, auto);
@ -136,15 +124,18 @@
}
.leaflet-popup-content-wrapper {
background-color: lightgray;
background-color: none;
transition: 500ms;
overflow: hidden;
width: 250px !important;
border-radius: 28px;
padding: 0;
}
.leaflet-popup {
position: fixed;
bottom: 7px !important;
left: 50px !important;
top: -180px !important;
}
.modal-adress {
@ -158,11 +149,6 @@
padding-left: 14px !important;
}
.leaflet-popup-content-wrapper {
border-radius: 25px;
background: #ffffff;
}
.modal-green {
border: 3px solid #95c11f !important;
}
@ -220,29 +206,29 @@
}
.modal-border-green {
border: 5px solid #95C11F !important;
border-radius: 25px;
border: 3px solid #95C11F !important;
border-radius: 28px;
}
.modal-border-yellow {
border: 5px solid #ffc800 !important;
border-radius: 25px;
border: 3px solid #ffc800 !important;
border-radius: 28px;
}
.modal-border-blue {
border: 5px solid #91a2ff !important;
border-radius: 25px;
border: 3px solid #91a2ff !important;
border-radius: 28px;
}
.modal-border-red {
border: 5px solid #ff792d !important;
border-radius: 25px;
border: 3px solid #ff792d !important;
border-radius: 28px;
}
.modal-border-black {
border: 5px solid #634e42 !important;
border-radius: 25px;
border: 3px solid #634e42 !important;
border-radius: 28px;
}
.modal-associe, .modal-annee, .modal-etat {
@ -259,6 +245,7 @@
.modal-container {
padding-bottom: 10px;
background: white;
}
.modal-name {
@ -301,6 +288,35 @@
/* EOF MODAL & CONTENT */
/* EOF MODAL & CONTENT */
/* FULL-SCREEN */
/* FULL-SCREEN */
/* FULL-SCREEN */
#full-screen {
position: absolute;
margin-top: 20px;
margin-left: 20px;
background-color: #95c11f;
border-radius: 50px;
width: 50px;
height: 50px;
z-index: 99999;
}
#full-screen:hover {
cursor: pointer;
box-shadow: 0 0 15px white;
transition: 500ms;
}
#full-screen > img {
padding: 10px;
}
/* EOF FULL-SCREEN */
/* EOF FULL-SCREEN */
/* EOF FULL-SCREEN */
/* FILTER */
/* FILTER */
/* FILTER */
@ -308,14 +324,13 @@
#container-filter {
display: grid;
grid-template-columns: [a] 1fr [b] 1fr [c] 1fr [d];
grid-template-rows: [a] 200px [b] 100px [c];
grid-template-rows: [a] 200px [b] auto [c];
background-color: white;
height: fit-content;
box-shadow: 1px 1px 27px -5px rgba(0,0,0,0.75);
-webkit-box-shadow: 1px 1px 27px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 1px 1px 27px -5px rgba(0,0,0,0.75);
border-radius: 80px 80px 0 0;
padding: 30px;
border-radius: 15px 15px 0 0;
border: 2px solid black;
border-bottom: none;
}
/* TOGGLE */
@ -345,6 +360,10 @@
background: none !important;
}
#toggle-associe:hover {
cursor: pointer;
}
.toggle-to-anim-enfant {
animation-name: toActifEnfant;
animation-duration: 1000ms;
@ -415,6 +434,12 @@
/* EOF TOGGLE */
/* EOF TOGGLE */
@media screen and (max-width: 991px) {
#container-filter {
display: none;
}
}
#container-filter-label-1 {
grid-row: b / c;
grid-column: b / c;
@ -446,7 +471,7 @@
justify-self: center;
align-self: center;
width: 100%;
margin-top: 50px;
margin-top: 80px;
}
h5 {
@ -482,6 +507,7 @@ h5 {
font-size : 14px;
line-height : 18px;
color: #000000;
margin-bottom: 15px !important;
}
#domaine-button {

View File

@ -2,24 +2,24 @@
/**
* Hello World
*
* @package HelloWorld
* @author Florian Llimos
* @copyright 2024 Florian Llimos
* @package Cartographie
* @author Digitanie
* @copyright 2024 Digitanie
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: Hello World
* Plugin Name: Cartographie
* Plugin URI: https://mehdinazari.com/how-to-create-hello-world-plugin-for-wordpress
* Description: This plugin prints "Hello World" inside an admin page.
* Description: Plugin pour la cartographie.
* Version: 1.0.0
* Author: Florian Llimos
* Author URI: https://florianllimos.fr
* Text Domain: hello-world
* Author: Digitanie
* Author URI: https://digitanie.org
* Text Domain: cartographie
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
add_shortcode('hello_world_map', 'display_hello_world_page');
add_shortcode('cartographie', 'display_hello_world_page');
function display_hello_world_page() {
ob_start();
@ -45,7 +45,7 @@ function display_hello_world_page() {
<hr class="separator">
<div id="container-filter-associe">
<div class="container-title-filter">
<h5 id="associe-button" class="h2-low">Associé-e BBE</h5>
<h5 id="associe-button">Associé-e BBE</h5>
</div>
<div class="container-toggle" id="toggle-associe" value="all">
<div></div>
@ -67,35 +67,39 @@ function display_hello_world_page() {
<div id="container-filter-domaine">
<h5 id="domaine-button">Type de projet</h5>
<div id="lieux-de-plantation">
<img src="https://sbw1.dgtn.dev/wp-content/uploads/2024/11/lieux_de_plantation.svg">
<img src="/wp-content/plugins/cartographie/media/lieux_de_plantation.svg">
<p>Lieux de plantation</p>
</div>
<div id="exploitations-productrices-de-bois-pour-BBE">
<img src="https://sbw1.dgtn.dev/wp-content/uploads/2024/11/producteur_de_bois.svg">
<img src="/wp-content/plugins/cartographie/media/producteur_de_bois.svg">
<p>Producteur de bois</p>
</div>
<div id="chaufferies-bois-clients">
<img src="https://sbw1.dgtn.dev/wp-content/uploads/2024/11/chaufferie_bois_clients.svg">
<img src="/wp-content/plugins/cartographie/media/chaufferie_bois_clients.svg">
<p>Acheteur de bois</p>
</div>
<div id="chaufferies-vente-de-chaleur">
<img src="https://sbw1.dgtn.dev/wp-content/uploads/2024/11/chaufferie_vente_chaleur.svg">
<img src="/wp-content/plugins/cartographie/media/chaufferie_vente_chaleur.svg">
<p>Acheteur de chaleur</p>
</div>
<div id="plateformes-logistiques">
<img src="https://sbw1.dgtn.dev/wp-content/uploads/2024/11/plateformes_logistiques.svg">
<img src="/wp-content/plugins/cartographie/media/plateformes_logistiques.svg">
<p>Plateforme logistique</p>
</div>
</div>
<div id=""><p id="modal-title"></p></div>
</div>
<div id='map'></div>
<div id='map' class='map-container'>
<div id="full-screen">
<img src="https://cdn-icons-png.flaticon.com/128/3413/3413667.png">
</div>
<?php
return ob_get_clean();
}
add_action('wp_enqueue_scripts', 'hello_world_enqueue_assets');
function hello_world_enqueue_assets() {
if (has_shortcode(get_post()->post_content, 'hello_world_map')) {
if (has_shortcode(get_post()->post_content, 'cartographie')) {
wp_enqueue_style(
'leaflet-css',
'https://unpkg.com/leaflet@1.9.3/dist/leaflet.css',
@ -153,34 +157,58 @@ function get_cartographie_markers() {
$table_name = $wpdb->prefix . 'posts';
$results = $wpdb->get_results("
SELECT u3yd_posts.ID, u3yd_posts.post_name, u3yd_term_taxonomy.taxonomy,
GROUP_CONCAT(u3yd_terms.term_id ORDER BY u3yd_terms.term_id) AS term_ids,
GROUP_CONCAT(u3yd_terms.name ORDER BY u3yd_terms.term_id) AS term_names
FROM u3yd_posts
INNER JOIN u3yd_term_relationships ON u3yd_posts.ID = u3yd_term_relationships.object_id
INNER JOIN u3yd_term_taxonomy ON u3yd_term_relationships.term_taxonomy_id = u3yd_term_taxonomy.term_taxonomy_id
INNER JOIN u3yd_terms ON u3yd_term_taxonomy.term_id = u3yd_terms.term_id
WHERE u3yd_posts.post_status = 'publish'
AND u3yd_posts.post_type = 'markercartographie'
GROUP BY u3yd_posts.ID, u3yd_term_taxonomy.taxonomy;
");
SELECT wp_posts.ID, wp_posts.post_title, wp_term_taxonomy.taxonomy,
GROUP_CONCAT(wp_terms.term_id ORDER BY wp_terms.term_id) AS term_ids,
GROUP_CONCAT(wp_terms.name ORDER BY wp_terms.term_id) AS term_names
FROM wp_posts
INNER JOIN wp_term_relationships ON wp_posts.ID = wp_term_relationships.object_id
INNER JOIN wp_term_taxonomy ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
INNER JOIN wp_terms ON wp_term_taxonomy.term_id = wp_terms.term_id
WHERE wp_posts.post_status = 'publish'
AND wp_posts.post_type = 'markercartographie'
GROUP BY wp_posts.ID, wp_term_taxonomy.taxonomy;
");
$structured_data = [];
$structured_data = [];
foreach ($results as $row) {
if(!isset($structured_data[$row->ID])){
$structured_data[$row->ID] = [
'name' => $row->post_name,
];
}
if ($row->taxonomy == "categorielabel") {
$structured_data[$row->ID][$row->taxonomy] = explode(",", $row->term_names);
} else {
$structured_data[$row->ID][$row->taxonomy] = $row->term_names;
}
$image_results = $wpdb->get_results("
SELECT wp_posts.ID, wp_postmeta.meta_value AS image_id, image_posts.guid AS image_url
FROM wp_posts
LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = '_thumbnail_id'
LEFT JOIN wp_posts AS image_posts ON wp_postmeta.meta_value = image_posts.ID
WHERE wp_posts.post_status = 'publish'
AND wp_posts.post_type = 'markercartographie';
");
$image_data = [];
foreach ($image_results as $image_row) {
$image_data[$image_row->ID] = [
'image_id' => $image_row->image_id,
'image_url' => $image_row->image_url,
];
}
foreach ($results as $row) {
if (!isset($structured_data[$row->ID])) {
$structured_data[$row->ID] = [
'name' => $row->post_title,
];
}
// Ajouter les termes (taxonomies)
if ($row->taxonomy == "categorielabel") {
$structured_data[$row->ID][$row->taxonomy] = explode(",", $row->term_names);
} else {
$structured_data[$row->ID][$row->taxonomy] = $row->term_names;
}
// Ajouter l'image mise en avant si elle existe
if (isset($image_data[$row->ID])) {
$structured_data[$row->ID]['image'] = $image_data[$row->ID];
}
}
return $structured_data;
}

View File

@ -1,20 +1,37 @@
jQuery(document).ready(function($) {
var map = L.map('map').setView([48.9000, 0.1000], 9);
L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'ArcGIS'
var map = L.map('map', {
center: [48.577742, 0.060471],
zoom: 8,
maxZoom: 18,
minZoom: 8
});
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
let markersCluster = L.markerClusterGroup();
var markersCluster = L.markerClusterGroup({
spiderfyOnMaxZoom: false,
showCoverageOnHover: false,
iconCreateFunction: function(cluster) {
return L.divIcon({
html: '<div style="background-color: #95c11f; padding: 10px; text-align: center; border-radius: 100%; box-shadow: 0 0 15px #e5c732; font-weight: bold;"><span>' + cluster.getChildCount() + '</span></div>',
className: 'mycluster',
iconSize: L.point(40, 40)
});
}
});
let allMarkers = [];
let initialMarkerData = [];
function addMarkers(data) {
markersCluster.clearLayers();
allMarkers = [];
const values = Object.values(data);
for (const item of values) {
console.log(item);
let itemNom = item.name;
let itemDomaine = item.categoriesseries ?? null;
var itemDomaine = item.categoriesseries ?? null;
let itemCodePostal = item.codepstl ?? null;
let itemAvancement = item.avancementduprojet ?? null;
let itemAnnee = item.annees ?? null;
@ -22,26 +39,28 @@ jQuery(document).ready(function($) {
let itemVille = item.ville ?? null;
let itemLatitude = item.latitude ?? null;
let itemAssocie = item.associe ?? null;
let itemLabel = item.categorielabel;
console.log(itemLatitude + " " + itemLongitude);
console.log(itemLabel);
let itemLabel = item.categorielabel ?? null;
let itemPhoto = item.image.image_url ?? null;
if (itemLongitude === null || itemLatitude === null) {
continue;
}
var markerIcon;
const iconBaseUrl = 'https://sbw1.dgtn.dev/wp-content/uploads/2024/11/';
const iconSize = [40, 40];
const iconBaseUrl = '/wp-content/plugins/cartographie/media/';
const iconSize = [50, 50];
const iconAnchor = [16, 32];
const popupAnchor = [0, -32];
const domaineIcons = {
"Lieux de plantation": "lieux_de_plantation.svg",
"Producteur de bois": "producteur_de_bois.svg",
"Acheteur de bois": "chaufferie_bois_clients.svg",
"Acheteur de chaleur": "chaufferie_vente_chaleur.svg",
"Plateformes logistiques": "plateformes_logistiques.svg"
"Plateforme logistique": "plateformes_logistiques.svg"
};
const iconUrl = domaineIcons[itemDomaine] ? `${iconBaseUrl}${domaineIcons[itemDomaine]}` : null;
markerIcon = iconUrl
let iconUrl = domaineIcons[itemDomaine] ? `${iconBaseUrl}${domaineIcons[itemDomaine]}` : null;
let defaultIcon = iconUrl
? new L.Icon({
iconUrl,
iconSize,
@ -49,29 +68,27 @@ jQuery(document).ready(function($) {
popupAnchor
})
: new L.Icon.Default();
let imageUrl = '';
let imageUrls = [];
if (Array.isArray(itemLabel)) {
if (itemLabel.includes("Label haie") && itemLabel.includes("Label végétal local")) {
imageUrls.push('https://sbw1.dgtn.dev/wp-content/plugins/hello-world/media/logo.png');
imageUrls.push('https://sbw1.dgtn.dev/wp-content/plugins/hello-world/media/baseline-dark.svg');
imageUrls.push('/wp-content/plugins/cartographie/media/logo.png');
imageUrls.push('/wp-content/plugins/cartographie/media/baseline-dark.svg');
} else if (itemLabel.includes("Label haie")) {
imageUrls.push('https://sbw1.dgtn.dev/wp-content/plugins/hello-world/media/baseline-dark.svg');
imageUrls.push('/wp-content/plugins/cartographie/media/baseline-dark.svg');
} else if (itemLabel.includes("Label végétal local")) {
imageUrls.push('https://sbw1.dgtn.dev/wp-content/plugins/hello-world/media/logo.png');
imageUrls.push('/wp-content/plugins/cartographie/media/logo.png');
}
}
let popupContent = `
<div class='modal-container ${itemDomaine === "Lieux de plantation" ? "modal-border-green" : ""} ${itemDomaine === "Acheteur de chaleur" ? "modal-border-yellow" : ""} ${itemDomaine === "Producteur de bois" ? "modal-border-black" : ""} ${itemDomaine === "Plateformes logistiques" ? "modal-border-blue" : ""} ${itemDomaine === "Acheteur de bois" ? "modal-border-red" : ""}'>
${item.photo ? `<img src="${item.photo}" alt="${itemNom}" style="max-width:100%; height:auto;">` : ''}
<div class='modal-container ${itemDomaine === "Lieux de plantation" ? "modal-border-green" : ""} ${itemDomaine === "Acheteur de chaleur" ? "modal-border-yellow" : ""} ${itemDomaine === "Producteur de bois" ? "modal-border-black" : ""} ${itemDomaine === "Plateforme logistique" ? "modal-border-blue" : ""} ${itemDomaine === "Acheteur de bois" ? "modal-border-red" : ""}'>
<div class="modal-container-header">
<img src="https://images.pexels.com/photos/27880483/pexels-photo-27880483/free-photo-of-clairiere-terrain-fleurs-voiture.jpeg?auto=compress&cs=tinysrgb&w=400&lazy=load" style="height: 200px; width: 100%; object-fit: cover;">
<p class='modal-domaine color-white ${itemDomaine === "Lieux de plantation" ? "modal-domaine-green" : ""} ${itemDomaine === "Acheteur de chaleur" ? "modal-domaine-yellow" : ""} ${itemDomaine === "Producteur de bois" ? "modal-domaine-black" : ""} ${itemDomaine === "Plateformes logistiques" ? "modal-domaine-blue" : ""} ${itemDomaine === "Acheteur de bois" ? "modal-domaine-red" : ""}'>${itemDomaine}</p>
<img src="${itemPhoto}" style="height: 200px; width: 100%; object-fit: cover;">
<p class='modal-domaine color-white ${itemDomaine === "Lieux de plantation" ? "modal-domaine-green" : ""} ${itemDomaine === "Acheteur de chaleur" ? "modal-domaine-yellow" : ""} ${itemDomaine === "Producteur de bois" ? "modal-domaine-black" : ""} ${itemDomaine === "Plateforme logistique" ? "modal-domaine-blue" : ""} ${itemDomaine === "Acheteur de bois" ? "modal-domaine-red" : ""}'>${itemDomaine}</p>
</div>
<div class='modal-container ${itemDomaine === "Lieux de plantation" ? "modal-container-green" : ""} ${itemDomaine === "Acheteur de chaleur" ? "modal-container-yellow" : ""} ${itemDomaine === "Producteur de bois" ? "modal-container-black" : ""} ${itemDomaine === "Plateformes logistiques" ? "modal-container-blue" : ""} ${itemDomaine === "Acheteur de bois" ? "modal-container-red" : ""}' style='padding-top: 10px;'>
<div class='modal-container ${itemDomaine === "Lieux de plantation" ? "modal-container-green" : ""} ${itemDomaine === "Acheteur de chaleur" ? "modal-container-yellow" : ""} ${itemDomaine === "Producteur de bois" ? "modal-container-black" : ""} ${itemDomaine === "Plateforme logistique" ? "modal-container-blue" : ""} ${itemDomaine === "Acheteur de bois" ? "modal-container-red" : ""}' style='padding-top: 10px;'>
<h2 class='modal-name'>${itemNom}</h2>
<h3 class='modal-adress'>${itemCodePostal} ${itemVille}</h3>
</div>
@ -85,29 +102,100 @@ jQuery(document).ready(function($) {
</div>
`;
var marker = L.marker([itemLatitude, itemLongitude], { icon: markerIcon })
.bindPopup(popupContent);
allMarkers.push(marker);
}
let marker = L.marker([itemLatitude, itemLongitude], { icon: defaultIcon })
.bindPopup(popupContent, {
autoPan: true, // Active le recadrage automatique
autoPanPadding: [200, 30], // Définit le padding autour du popup
keepInView: true // Assure que le popup reste visible à l'écran
});
function addControlPlaceholders(map) {
var corners = map._controlCorners,
l = 'leaflet-',
container = map._controlContainer;
// Ajout du comportement dynamique lors de l'ouverture de la popup
marker.on('popupopen', function (e) {
const popup = e.popup;
const mapBounds = map.getBounds();
const popupPosition = popup.getLatLng();
function createCorner(vSide, hSide) {
var className = l + vSide + ' ' + l + hSide;
corners[vSide + hSide] = L.DomUtil.create('div', className, container);
// Ajuste les marges dynamiques
const autoPanPadding = {
top: 100, // 100px depuis le haut
bottom: 50, // 50px depuis le bas
left: 200, // 50px à gauche
right: 200 // 50px à droite
};
// Vérifie si le popup est hors de la vue et recadre la carte
if (!mapBounds.contains(popupPosition)) {
map.panTo(popupPosition, {
paddingTopLeft: [autoPanPadding.left, autoPanPadding.top],
paddingBottomRight: [autoPanPadding.right, autoPanPadding.bottom]
});
}
createCorner('verticalcenter', 'left');
});
// Gestion de l'icône active lors de l'ouverture et de la fermeture de la popup
marker.on('popupopen', function () {
marker.setIcon(activeMarkerIcon);
});
marker.on('popupclose', function () {
marker.setIcon(defaultIcon);
});
// Ajout du marqueur au cluster
allMarkers.push(marker);
markersCluster.addLayer(marker);
let activeIconUrl = '';
if (itemDomaine === "Lieux de plantation") {
activeIconUrl = '/wp-content/plugins/cartographie/media/lieux_de_plantation_actif.svg';
} else if (itemDomaine === "Producteur de bois"){
activeIconUrl = '/wp-content/plugins/cartographie/media/producteur_de_bois_actif.svg';
} else if (itemDomaine === "Acheteur de bois"){
activeIconUrl = '/wp-content/plugins/cartographie/media/chaufferie_bois_clients_actif.svg';
} else if (itemDomaine === "Acheteur de chaleur"){
activeIconUrl = '/wp-content/plugins/cartographie/media/chaufferie_vente_chaleur_actif.svg';
} else if (itemDomaine === "Plateforme logistique"){
activeIconUrl = '/wp-content/plugins/cartographie/media/plateformes_logistiques_actif.svg';
}
let activeMarkerIcon = new L.Icon({
iconUrl: activeIconUrl,
iconSize: [50, 50],
iconAnchor: [16, 32],
popupAnchor: [0, -32]
});
allMarkers.push(marker);
markersCluster.addLayer(marker);
}
addControlPlaceholders(map);
map.zoomControl.setPosition('verticalcenterleft');
L.control.scale({position: 'verticalcenterleft'}).addTo(map);
markersCluster.addLayers(allMarkers);
map.addLayer(markersCluster);
}
let btnFullScreen = document.querySelector("#full-screen");
let theMap = document.querySelector("#map");
function mapFullScreen() {
if (!theMap.classList.contains("map-full-screen")) {
theMap.classList.add("map-full-screen");
document.querySelector("#full-screen > img").src = "https://cdn-icons-png.flaticon.com/128/1828/1828778.png";
document.querySelector("#full-screen > img").style.padding = "15px";
// Redimensionner la carte Leaflet après être passé en plein écran
map.invalidateSize(); // Demande à Leaflet de recalculer la taille de la carte
} else if (theMap.classList.contains("map-full-screen")) {
theMap.classList.remove("map-full-screen");
document.querySelector("#full-screen > img").src = "https://cdn-icons-png.flaticon.com/128/3413/3413667.png";
document.querySelector("#full-screen > img").style.padding = "10px";
// Redimensionner la carte Leaflet après avoir quitté le plein écran
map.invalidateSize();
}
}
btnFullScreen.addEventListener("click", mapFullScreen);
$.ajax({
url: '/wp-json/custom/v1/markers',
method: 'GET',
@ -141,7 +229,7 @@ jQuery(document).ready(function($) {
'Acheteur de bois': $('#chaufferies-bois-clients').hasClass('filter-active'),
'Producteur de bois': $('#exploitations-productrices-de-bois-pour-BBE').hasClass('filter-active'),
'Acheteur de chaleur': $('#chaufferies-vente-de-chaleur').hasClass('filter-active'),
'Plateformes logistiques': $('#plateformes-logistiques').hasClass('filter-active'),
'Plateforme logistique': $('#plateformes-logistiques').hasClass('filter-active'),
};
var filteredMarkers = allMarkers.filter(function(marker) {
@ -223,4 +311,12 @@ jQuery(document).ready(function($) {
handleFilterClick('#chaufferies-vente-de-chaleur', false);
handleFilterClick('#plateformes-logistiques', false);
map.scrollWheelZoom.disable();
map.on('click', () => {
map.scrollWheelZoom.enable();
});
map.on('mouseout', () => {
map.scrollWheelZoom.disable();
});
});

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,19 @@
<svg width="96" height="95" viewBox="0 0 96 95" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_4375_2581)">
<circle cx="46" cy="45.5" r="37.5" fill="white"/>
<circle cx="46" cy="45.5" r="35" stroke="#FF792D" stroke-width="5"/>
</g>
<path d="M53.2961 65H49.308C48.6796 65 48.1718 64.4728 48.1718 63.8246V61.2656C47.6639 61.1481 47.283 60.6779 47.283 60.1171V57.7361H46.1175V60.1171C46.1175 60.6779 45.7366 61.1447 45.2287 61.2656V63.8246C45.2287 64.4728 44.7175 65 44.0892 65H39.9546C39.3262 65 38.8151 64.4728 38.8151 63.8246V61.2656C38.3072 61.1481 37.9263 60.6779 37.9263 60.1171V57.669C35.618 57.2895 34 55.204 34 52.4771V30.259C34 27.3575 36.2855 25 39.0983 25H53.9017C56.7145 25 59 27.3575 59 30.259V52.4805C59 55.2913 57.548 57.2962 55.3244 57.6723V60.1205C55.3244 60.6813 54.9435 61.1481 54.4356 61.269V63.828C54.4356 64.4761 53.9245 65.0034 53.2961 65.0034V65ZM50.4475 62.6492H52.1567V61.2959H50.4475V62.6492ZM41.094 62.6492H42.9497V61.2959H41.094V62.6492ZM49.5587 58.9451H53.0422V57.7395H49.5587V58.9451ZM40.2085 58.9451H43.8385V57.7395H40.2085V58.9451ZM43.9199 55.3887H53.8984C55.4514 55.3887 56.7178 54.0857 56.7178 52.4805V49.3069H36.2822V52.4805C36.2822 54.0857 37.5454 55.3887 39.1016 55.3887H43.9199ZM36.2789 46.9562H56.7178V30.259C56.7178 28.6538 55.4546 27.3508 53.8984 27.3508H39.0983C37.5454 27.3508 36.2789 28.6538 36.2789 30.259V46.9562Z" fill="#FF792D"/>
<defs>
<filter id="filter0_d_4375_2581" x="0.5" y="0" width="95" height="95" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="2" dy="2"/>
<feGaussianBlur stdDeviation="5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4375_2581"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4375_2581" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,19 @@
<svg width="96" height="95" viewBox="0 0 96 95" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_4375_2581)">
<circle cx="46" cy="45.5" r="37.5" fill="white"/>
<circle cx="46" cy="45.5" r="35" stroke="#FFC800" stroke-width="5"/>
</g>
<path d="M45.3557 28C46.1447 28.5829 46.8982 29.0542 47.5806 29.637C49.8766 31.5655 51.348 33.9976 51.7105 37.0486C51.9273 39.0454 51.675 40.9739 51.0281 42.8628C50.4879 44.3883 51.0992 45.9533 52.4995 46.5722C53.5054 47.0075 54.4721 46.8636 55.3358 46.2088C56.1994 45.518 56.5548 44.5718 56.3771 43.4456C56.3771 43.3737 56.3416 43.2657 56.3416 43.1542C56.4127 43.1902 56.4482 43.1902 56.4482 43.2262C57.9907 45.7698 58.9965 48.497 58.9965 51.548C59.0321 55.5812 57.2017 58.6718 54.0776 61.068C53.1819 61.7587 52.2116 62.266 51.1347 62.669C52.6772 61.2155 53.3952 59.5065 53.0718 57.3981C52.8194 55.7287 51.9238 54.4191 50.7367 53.3289C50.63 53.8362 50.5945 54.3831 50.3777 54.8544C49.6953 56.272 47.8649 56.5634 46.7134 55.5093C44.9896 53.9082 44.4529 51.8754 44.6306 49.5836C44.8119 47.4392 46.7489 43.2226 46.7489 43.0786C46.3899 43.1866 36.0864 50.7457 40.8596 60.5966C41.2897 61.5033 41.9366 62.3056 42.69 62.9964C42.4021 62.8885 42.1498 62.8165 41.8655 62.705C39.1359 61.6508 36.8754 59.9814 35.3685 57.3981C34.1209 55.2574 33.8331 52.9332 34.0818 50.4974C34.5474 46.3167 36.4169 42.8664 39.2887 39.8837C41.2257 37.8869 42.9139 35.703 44.2077 33.2349C44.7834 32.1088 45.249 30.9466 45.3557 29.673C45.3948 29.1621 45.3557 28.6548 45.3557 28Z" fill="#FFC800"/>
<defs>
<filter id="filter0_d_4375_2581" x="0.5" y="0" width="95" height="95" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="2" dy="2"/>
<feGaussianBlur stdDeviation="5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4375_2581"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4375_2581" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,19 @@
<svg width="95" height="95" viewBox="0 0 95 95" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_4375_2581)">
<circle cx="45.5" cy="45.5" r="37.5" fill="white"/>
<circle cx="45.5" cy="45.5" r="35" stroke="#95C11F" stroke-width="5"/>
</g>
<path d="M44.2882 45.2058C35.7176 40.1069 38.704 33.1951 44.644 27.3496C45.1173 26.8827 45.8845 26.885 46.3584 27.3496C52.2985 33.1934 55.286 40.1069 46.7142 45.2052V52.0687C47.364 51.8771 48.1232 51.5462 49.1528 51.0737C49.4536 41.0659 57.1848 40.7395 65.1016 42.6024C65.7474 42.7715 66.1313 43.4232 65.9588 44.0563C63.7425 52.1108 59.0625 58.0715 50.2134 53.2069C48.6795 53.9119 47.6212 54.3777 46.7142 54.6046V59.6215H58.0351C59.6309 59.6215 59.6309 62.0001 58.0351 62.0001H32.9673C31.3716 62.0001 31.3716 59.6215 32.9673 59.6215H44.2882V54.6119C43.3755 54.3895 42.308 53.9265 40.757 53.2237C31.9188 58.0625 27.2524 52.0883 25.0425 44.0563C24.8608 43.3883 25.2797 42.7485 25.9569 42.5889C34.115 40.4698 41.5757 41.4855 41.8491 51.1035C42.8793 51.5687 43.6385 51.894 44.2882 52.0799V45.2058ZM51.5662 51.2316C58.2437 54.8058 61.3819 50.6445 63.2773 44.6041C57.1997 43.2412 51.757 43.6507 51.5662 51.2316ZM39.4351 51.2316C39.2495 43.8737 34.1316 43.167 27.724 44.6041C29.6194 50.6445 32.7576 54.8058 39.4351 51.2316ZM45.5012 43.1546C51.9747 39.281 49.9051 34.5501 45.5012 29.8945C41.0973 34.5479 39.026 39.2822 45.5012 43.1546Z" fill="#95C11F"/>
<defs>
<filter id="filter0_d_4375_2581" x="0" y="0" width="95" height="95" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="2" dy="2"/>
<feGaussianBlur stdDeviation="5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4375_2581"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4375_2581" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,23 @@
<svg width="95" height="95" viewBox="0 0 95 95" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_4375_2581)">
<circle cx="45.5" cy="45.5" r="37.5" fill="white"/>
<circle cx="45.5" cy="45.5" r="35" stroke="#91A2FF" stroke-width="5"/>
</g>
<path d="M54.0809 36.5408C53.7868 36.5408 53.5068 36.6608 53.2933 36.8672C53.0846 37.0784 52.9707 37.3664 52.9707 37.664V45.1664C52.9707 45.464 53.0893 45.7472 53.2933 45.9632C53.5021 46.1744 53.7868 46.2896 54.0809 46.2896H60.7897C60.9606 46.2896 61.1314 46.2464 61.2832 46.1696C61.435 46.0928 61.5726 45.9776 61.6722 45.8384C61.7719 45.6992 61.8478 45.5408 61.8763 45.368C61.9047 45.1952 61.9 45.0224 61.8525 44.8544L59.708 37.352C59.6416 37.1168 59.504 36.9104 59.3094 36.7616C59.1149 36.6176 58.8824 36.536 58.6405 36.536H54.0762L54.0809 36.5408ZM55.1959 38.792H57.8054L59.3094 44.0432H55.1912V38.792H55.1959Z" fill="#91A2FF"/>
<path d="M33.2706 51.4976C30.4144 51.4976 28.0801 53.864 28.0801 56.7488C28.0801 59.6336 30.4191 61.9952 33.2706 61.9952C36.1221 61.9952 38.4564 59.6336 38.4564 56.7488C38.4564 53.864 36.1221 51.4976 33.2706 51.4976ZM33.2706 53.7536C34.9217 53.7536 36.2312 55.0832 36.2312 56.7536C36.2312 58.424 34.9217 59.7536 33.2706 59.7536C31.6195 59.7536 30.3053 58.424 30.3053 56.7536C30.3053 55.0832 31.6195 53.7536 33.2706 53.7536Z" fill="#91A2FF"/>
<path d="M55.879 51.4976C53.0228 51.4976 50.6885 53.864 50.6885 56.7488C50.6885 59.6336 53.0228 61.9952 55.879 61.9952C58.7353 61.9952 61.0696 59.6336 61.0696 56.7488C61.0696 53.864 58.7305 51.4976 55.879 51.4976ZM55.879 53.7536C57.5301 53.7536 58.8444 55.0832 58.8444 56.7536C58.8444 58.424 57.5301 59.7536 55.879 59.7536C54.2279 59.7536 52.9137 58.424 52.9137 56.7536C52.9137 55.0832 54.2279 53.7536 55.879 53.7536Z" fill="#91A2FF"/>
<path d="M48.1306 48.5552C47.8364 48.5552 47.5518 48.6752 47.343 48.8864C47.1342 49.0976 47.0156 49.3856 47.0156 49.6784C47.0156 49.8272 47.0441 49.976 47.101 50.1104C47.158 50.2496 47.2386 50.3696 47.343 50.4752C47.4474 50.5808 47.5707 50.6624 47.7036 50.72C47.8364 50.7776 47.9835 50.8064 48.1306 50.8064H51.5325C51.6795 50.8064 51.8266 50.7776 51.9595 50.72C52.0971 50.6624 52.2204 50.5808 52.3248 50.4752C52.4292 50.3696 52.5098 50.2448 52.5668 50.1056C52.6237 49.9664 52.6522 49.8224 52.6522 49.6736C52.6522 49.5296 52.6237 49.3808 52.5668 49.2416C52.5098 49.1072 52.4292 48.9824 52.3248 48.8768C52.2204 48.7712 52.0971 48.6896 51.9595 48.632C51.8219 48.5744 51.6795 48.5456 51.5325 48.5456H48.1306V48.5552Z" fill="#91A2FF"/>
<path d="M47.3053 35.3792V43.952L27.3307 44.0624C25.504 44.0624 24 45.5936 24 47.4416V54.5456C24 56.3984 25.5088 57.9344 27.3497 57.9152L29.1668 57.896C29.7789 57.8912 30.2723 57.3824 30.2676 56.7632C30.2581 56.144 29.7599 55.6448 29.1479 55.6496L27.3307 55.6688C26.7091 55.6736 26.2299 55.1888 26.2299 54.5456V47.4416C26.2299 46.7984 26.7044 46.3184 27.027 46.3184L48.4393 46.1984C49.0513 46.1984 49.5447 45.6944 49.5447 45.0752L49.5353 35.384C49.5353 34.7408 50.0145 34.2608 50.6455 34.2608L60.5474 34.3136L64.7843 45.4544L64.7606 54.2864C64.7463 55.0112 64.2197 55.544 63.6124 55.5488L60.1868 55.5824C59.5748 55.592 59.0813 56.096 59.0861 56.72C59.0956 57.3392 59.5937 57.8384 60.2105 57.8336L63.6361 57.8C65.4912 57.7808 66.9526 56.1968 66.9668 55.256C66.9668 55.2464 67.0047 45.2528 67.0047 45.2528C67.0047 45.1136 66.981 44.9744 66.9336 44.8448L62.3408 32.7776C62.1748 32.3456 61.7667 32.0624 61.3113 32.0576L49.7345 32C48.8188 32 47.3053 33.5264 47.3101 35.3792H47.3053ZM51.7083 55.6016L37.7355 55.6352C37.1187 55.6352 36.6253 56.1392 36.6253 56.7632C36.6253 57.3824 37.1282 57.8864 37.7403 57.8816L51.713 57.848C52.3298 57.848 52.8232 57.3392 52.8232 56.7152C52.8232 56.096 52.3203 55.5968 51.7083 55.5968V55.6016Z" fill="#91A2FF"/>
<defs>
<filter id="filter0_d_4375_2581" x="0" y="0" width="95" height="95" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="2" dy="2"/>
<feGaussianBlur stdDeviation="5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4375_2581"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4375_2581" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,19 @@
<svg width="95" height="95" viewBox="0 0 95 95" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_4375_2581)">
<circle cx="45.5" cy="45.5" r="37.5" fill="white"/>
<circle cx="45.5" cy="45.5" r="35" stroke="#634E42" stroke-width="5"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M49.1193 32C48.5995 32 48.1057 32.2886 47.8978 32.7608L45.5328 37.5352H32.6421C32.6421 37.5352 32.5641 37.5352 32.5121 37.5352C27.2623 37.6401 23 41.9685 23 47.2676C23 52.5666 27.2623 56.9213 32.5121 56.9738C32.5641 56.9738 32.5901 56.9738 32.6421 56.9738H57.3839C57.3839 56.9738 57.4619 56.9738 57.5139 56.9738C62.7637 56.8951 67 52.5666 67.026 47.2676C67.026 41.9423 62.7637 37.6139 57.5139 37.5352C57.4879 37.5352 57.4359 37.5352 57.4099 37.5352H53.9793V33.3903C53.9533 32.6296 53.3296 32 52.5759 32H49.1453H49.1193ZM49.977 34.7807H51.1985V38.9517C51.1985 39.7125 51.8222 40.3421 52.5759 40.3421H57.3839C61.2044 40.3421 64.2451 43.4376 64.2451 47.2938C64.2451 51.1501 61.1784 54.2193 57.3579 54.2193H39.3213C41.1146 52.4617 42.2321 49.9958 42.2321 47.2676C42.2321 44.5393 41.1146 42.0997 39.3213 40.3158H46.3644C46.8842 40.3158 47.352 40.0273 47.5859 39.5551L49.951 34.7807H49.977ZM32.6421 40.3158C36.4625 40.3158 39.5032 43.4113 39.5032 47.2676C39.5032 51.1238 36.4365 54.2193 32.6421 54.2193C28.8476 54.2193 25.7549 51.1238 25.7549 47.2676C25.7549 43.4113 28.8216 40.3158 32.6421 40.3158ZM32.6421 43.0965C30.381 43.0965 28.5097 44.9853 28.5097 47.2676C28.5097 49.5498 30.381 51.4386 32.6421 51.4386C34.9031 51.4386 36.7744 49.5498 36.7744 47.2676C36.7744 44.9853 34.9031 43.0965 32.6421 43.0965ZM56.6822 43.0965C55.9285 43.0965 55.3048 43.7261 55.3048 44.4869C55.3048 45.2476 55.9285 45.8772 56.6822 45.8772H59.4371C60.1908 45.8772 60.8145 45.2476 60.8145 44.4869C60.8145 43.7261 60.1908 43.0965 59.4371 43.0965H56.6822ZM32.6421 45.8772C33.4217 45.8772 34.0195 46.4806 34.0195 47.2676C34.0195 48.0546 33.4217 48.6579 32.6421 48.6579C31.8624 48.6579 31.2646 48.0546 31.2646 47.2676C31.2646 46.4806 31.8624 45.8772 32.6421 45.8772ZM49.1193 48.6579C48.3656 48.6579 47.7419 49.2875 47.7419 50.0483C47.7419 50.809 48.3656 51.4386 49.1193 51.4386H51.8742C52.6279 51.4386 53.2516 50.809 53.2516 50.0483C53.2516 49.2875 52.6279 48.6579 51.8742 48.6579H49.1193Z" fill="#634E42"/>
<defs>
<filter id="filter0_d_4375_2581" x="0" y="0" width="95" height="95" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="2" dy="2"/>
<feGaussianBlur stdDeviation="5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4375_2581"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4375_2581" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB