{"id":99,"date":"2026-04-27T09:03:21","date_gmt":"2026-04-27T09:03:21","guid":{"rendered":"https:\/\/wp.zacube.com\/?page_id=99"},"modified":"2026-04-30T16:58:51","modified_gmt":"2026-04-30T16:58:51","slug":"nouveau-plan-cigoland","status":"publish","type":"page","link":"https:\/\/wp.zacube.com\/index.php\/nouveau-plan-cigoland\/","title":{"rendered":"Nouveau Plan Cigoland"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"99\" class=\"elementor elementor-99\">\n\t\t\t\t<div class=\"elementor-element elementor-element-de23da0 e-flex e-con-boxed e-con e-parent\" data-id=\"de23da0\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-160b21c elementor-widget elementor-widget-heading\" data-id=\"160b21c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Nouveau plan Cigo<\/h2>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-93f7d38 e-flex e-con-boxed e-con e-parent\" data-id=\"93f7d38\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c2f74b4 elementor-widget__width-inherit elementor-widget elementor-widget-html\" data-id=\"c2f74b4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<link rel=\"stylesheet\" href=\"https:\/\/unpkg.com\/leaflet@1.9.4\/dist\/leaflet.css\"\/>\n<script src=\"https:\/\/unpkg.com\/leaflet@1.9.4\/dist\/leaflet.js\"><\/script><div id=\"image-map\"><\/div>\n\n<!-- Boutons de filtrage -->\n<div id=\"map-controls\">\n    <button id=\"btn-toggle-all\">Tout masquer<\/button>\n    <div id=\"map-cats\">\n        <button class=\"map-btn active\" data-cat=\"0\">Restauration<\/button>\n        <button class=\"map-btn active\" data-cat=\"1\">Services<\/button>\n        <button class=\"map-btn active\" data-cat=\"2\">Attractions<\/button>\n        <button class=\"map-btn active\" data-cat=\"3\">Animaux<\/button>\n    <\/div>\n    <!-- Affich\u00e9 uniquement via JS si canEdit = true -->\n    <button id=\"btn-edit-mode\" title=\"Modifier la position des marqueurs &#10;par drag and drop\">\u00c9dition des marqueurs\n    <\/button>\n<\/div>\n\n<style>\n    #map-controls {\n        display: flex;\n        gap: 8px;\n        flex-wrap: wrap; \/* les boutons passent \u00e0 la ligne si besoin *\/\n        margin-top: 12px;\n        width: 100%;\n        box-sizing: border-box;\n    }\n    #map-controls button:hover {\n        background-color: #eee !important;\n        color: inherit;\n    }\n    #map-controls button:focus {\n        background-color: #fff !important;\n        color: inherit;\n    }\n    #map-cats {\n        flex: 1; \/* occupe tout l'espace restant *\/\n        display: flex;\n        justify-content: center; \/* centre les 4 boutons dans cet espace *\/\n        gap: 8px;\n        flex-wrap: wrap;\n    }\n    .map-btn {\n        padding: 8px 18px;\n        border: 2px solid #ccc;\n        border-radius: 20px;\n        background: #fff;\n        cursor: pointer;\n        font-size: 14px;\n        opacity: 0.45;\n        transition: opacity 0.2s, border-color 0.2s;\n        flex-shrink: 1; \/* les boutons peuvent r\u00e9tr\u00e9cir *\/\n        min-width: 0; \/* supprime la largeur minimale native *\/\n        white-space: nowrap; \/* \u00e9vite les retours \u00e0 la ligne dans le libell\u00e9 *\/\n        font-weight: bold;\n    }\n    .map-btn.active {\n        opacity: 1;\n        border-color: var(--cat-color);\n        color: var(--cat-color);\n        font-weight: bold;\n    }\n    #btn-toggle-all {\n        padding: 8px 18px;\n        border: 2px solid #555;\n        border-radius: 20px;\n        background: #fff;\n        cursor: pointer;\n        font-size: 14px;\n        color: #555;\n        transition: opacity 0.2s, background 0.2s;\n        margin-right: auto;\n        flex-shrink: 0;\n        min-width: 0;\n        white-space: nowrap;\n        width: 170px;\n        max-height: 41px;\n    }\n    .leaflet-popup-content {\n        margin: 10px 20px;\n    }\n    .map-popup {\n        width: 190px;\n        text-align: center;\n    }\n    .map-popup img {\n        width: 100%;\n        border-radius: 6px;\n    }\n    .map-popup strong {\n        display: block;\n        margin-bottom: 5px;\n    }\n    .map-popup p {\n        display: none;\n    }\n    .map-popup a {\n        font-size: 12px;\n    }\n    .map-popup a:hover {\n        text-decoration: underline;\n    }\n    \/* Bouton mode \u00e9dition \u2014 cach\u00e9 par d\u00e9faut, JS le r\u00e9v\u00e8le si connect\u00e9 *\/\n    #btn-edit-mode {\n        display: none;\n        padding: 8px 18px;\n        border: 2px solid #9B66C9;\n        border-radius: 8px;\n        background: #fff;\n        color: #9B66C9;\n        cursor: pointer;\n        font-size: 14px;\n        white-space: nowrap;\n        transition: background 0.2s, color 0.2s;\n    }\n    #btn-edit-mode.active {\n        background: #9B66C9;\n        color: #fff;\n    }\n    \/* Curseur \"d\u00e9pla\u00e7able\" sur les marqueurs en mode \u00e9dition *\/\n    .leaflet-marker-draggable {\n        cursor: grab !important;\n    }\n    \/* Feedback visuel : marqueur en cours de d\u00e9placement *\/\n    .leaflet-marker-draggable:active {\n        cursor: grabbing !important;\n    }\n    \/* Toast de confirmation *\/\n    #carte-toast {\n        position: fixed;\n        bottom: 24px;\n        left: 50%;\n        transform: translateX(-50%);\n        background: #2ecc71;\n        color: #fff;\n        padding: 10px 20px;\n        border-radius: 20px;\n        font-size: 14px;\n        opacity: 0;\n        transition: opacity 0.3s;\n        pointer-events: none;\n        z-index: 9999;\n    }\n    #carte-toast.visible {\n        opacity: 1;\n    }\n    #carte-toast.error {\n        background: #e74c3c;\n    }\n<\/style>\n\n<script>\n    (function () {\n        var IMAGE_URL = 'https:\/\/wp.zacube.com\/wp-content\/uploads\/2026\/04\/Fond-plan-interactif-9000px-2026.webp';\n        \/\/ Dimensions r\u00e9elles de l'image en pixels\n        var IMAGE_WIDTH = 9000;\n        var IMAGE_HEIGHT = 4500;\n        var RATIO = IMAGE_HEIGHT \/ IMAGE_WIDTH;\n        \/\/ Bounds = coin haut-gauche [0,0] \u2192 coin bas-droit [hauteur, largeur]\n        \/\/ Attention : Leaflet inverse Y \u2192 [y, x] et non [x, y]\n        var bounds = [[0, 0], [IMAGE_HEIGHT, IMAGE_WIDTH]];\n        var center = [IMAGE_HEIGHT \/ 2, IMAGE_WIDTH \/ 2];\n        var container = document.getElementById('image-map');\n\n        \/\/ \u2500\u2500\u2500 Couleurs par cat\u00e9gorie \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        var CAT_COLORS = ['#d44646', '#44a9cb', '#f39c12', '#6f953d'];\n\n        \/\/ \u2500\u2500\u2500 Ic\u00f4nes PNG par cat\u00e9gorie \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        var CAT_ICONS = {\n            '0': '\/wp-content\/uploads\/2026\/04\/restauration.png',\n            'services-boutique': '\/wp-content\/uploads\/2026\/04\/services-boutique.png',\n            'services-piquenique': '\/wp-content\/uploads\/2026\/04\/services-piquenique.png',\n            'services-secours': '\/wp-content\/uploads\/2026\/04\/services-secours.png',\n            'services-wc': '\/wp-content\/uploads\/2026\/04\/services-wc.png',\n            '2': '\/wp-content\/uploads\/2026\/04\/attractions.png',\n            '3': '\/wp-content\/uploads\/2026\/04\/animaux.png',\n        };\n\n        \/\/ Mapping cat_icons \u2192 cat_layer (les 4 sous-cat\u00e9gories \u2192 layer 1)\n        var CAT_LAYER = {\n            '0': 0,\n            'services-boutique': 1,    \/\/ \u2190 m\u00eame bouton \"Services\"\n            'services-piquenique': 1,  \/\/ \u2190 m\u00eame bouton \"Services\"\n            'services-secours': 1,     \/\/ \u2190 m\u00eame bouton \"Services\"\n            'services-wc': 1,          \/\/ \u2190 m\u00eame bouton \"Services\"\n            '2': 2,\n            '3': 3,\n        };\n\n        \/\/ Applique la couleur CSS sur chaque bouton\n        document.querySelectorAll('.map-btn').forEach(function (btn) {\n            var c = parseInt(btn.dataset.cat);\n            btn.style.setProperty('--cat-color', CAT_COLORS[c]);\n            btn.style.borderColor = CAT_COLORS[c];\n            btn.style.color = CAT_COLORS[c];\n        });\n\n        \/\/ \/\/ \u2500\u2500\u2500  R\u00c9CUP\u00c9RATION DES DONN\u00c9ES \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        \/\/ window.carteMarqueurs est inject\u00e9 par PHP via inject_marqueurs_json()\n        \/\/ Chaque entr\u00e9e ACF attend : { x, y, cat, img, titre, texte, lien }\n        \/\/ x et y sont des pourcentages (0-100) saisis dans ACF\n        var RAW_MARKERS = window.carteMarqueurs || [];\n        \n        \/\/ Conversion % \u2192 pixels pour Leaflet CRS.Simple\n        \/\/ Leaflet attend [lat, lng] = [y_pixels, x_pixels]\n        \/\/ y=0% \u2192 haut de l'image \u2192 lat = IMAGE_HEIGHT (axe Y invers\u00e9 dans CRS.Simple)\n        var MARKERS = RAW_MARKERS.map(function (m) {\n            var cat = String(m.cat); \/\/ \u2190 string '0','services-wc'...\n            return {\n                id: m.id,\n                cat: cat,\n                layer: CAT_LAYER[cat] !== undefined ? CAT_LAYER[cat] : -1, \/\/ \u2190 index 0,1,2,3\n                lat: IMAGE_HEIGHT - ((parseFloat(m.y) || 0) \/ 100) * IMAGE_HEIGHT,\n                lng: ((parseFloat(m.x) || 0) \/ 100) * IMAGE_WIDTH,\n                img: m.image || '',\n                titre: m.titre || 'Sans titre',\n                texte: m.texte || '',\n                lien: m.lien || ''\n            };\n        });\n\n        \/\/ Avertissement console si aucun marqueur re\u00e7u\n        if (MARKERS.length === 0) {\n            console.warn('[Carte] Aucun marqueur trouv\u00e9 dans window.carteMarqueurs. V\u00e9rifier inject_marqueurs_json() dans functions.php.');\n        }\n\n        function makeIcon(cat) {\n            return L.icon({\n                iconUrl: CAT_ICONS[cat],\n                iconSize: [48, 48],\n                iconAnchor: [24, 48],   \/\/ pointe en bas au centre\n                popupAnchor: [0, -50]    \/\/ popup s'ouvre au-dessus de l'ic\u00f4ne\n            });\n        }\n\n        \/\/ \u2500\u2500\u2500 Init carte \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        function setHeight() {\n            container.style.height = Math.round(container.offsetWidth * RATIO) + 'px';\n        }\n\n        function getMinZoom() {\n            var zoomX = Math.log2(map.getSize().x \/ IMAGE_WIDTH);\n            var zoomY = Math.log2(map.getSize().y \/ IMAGE_HEIGHT);\n            return Math.min(zoomX, zoomY);\n        }\n\n        function fitImage() {\n            setHeight();\n            map.invalidateSize();\n            var minZoom = getMinZoom();\n            map.setMinZoom(minZoom);\n            map.setView(center, minZoom);\n            updateDragState(minZoom);\n        }\n\n        function updateDragState(minZoom) {\n            map.off('zoomend').on('zoomend', function () {\n                if (map.getZoom() <= minZoom + 0.01) {\n                    map.dragging.disable();\n                    map.doubleClickZoom.disable();\n                    map.closePopup();\n                } else {\n                    map.dragging.enable();\n                    map.doubleClickZoom.enable();\n                }\n            });\n            if (map.getZoom() <= minZoom + 0.01) {\n                map.dragging.disable();\n                map.doubleClickZoom.disable();\n            }\n        }\n\n        setHeight();\n\n        var map = L.map('image-map', {\n            crs: L.CRS.Simple,\n            zoomSnap: 0,\n            zoomDelta: 0.5,\n            scrollWheelZoom: true,\n            attributionControl: false,\n            maxBounds: bounds,\n            maxBoundsViscosity: 1.0,\n            maxZoom: 0\n\n        });\n\n        L.imageOverlay(IMAGE_URL, bounds).addTo(map);\n\n        \/\/gestion de l'\u00e9tat actif\/inactif des boutons zoomIn et zoomOut\n        map.on('zoom', function () {\n            var zoomOutBtn = document.querySelector('.leaflet-control-zoom-out');\n            var zoomInBtn = document.querySelector('.leaflet-control-zoom-in');\n\n            if (zoomOutBtn) {\n                if (map.getZoom() <= map.getMinZoom()) {\n                    zoomOutBtn.classList.add('leaflet-disabled');\n                    zoomOutBtn.setAttribute('aria-disabled', 'true');\n                } else {\n                    zoomOutBtn.classList.remove('leaflet-disabled');\n                    zoomOutBtn.setAttribute('aria-disabled', 'false');\n                }\n            }\n\n            if (zoomInBtn) {\n                if (map.getZoom() >= map.getMaxZoom()) {\n                    zoomInBtn.classList.add('leaflet-disabled');\n                    zoomInBtn.setAttribute('aria-disabled', 'true');\n                } else {\n                    zoomInBtn.classList.remove('leaflet-disabled');\n                    zoomInBtn.setAttribute('aria-disabled', 'false');\n                }\n            }\n        });\n\n        \/\/ \u2500\u2500\u2500 Coordonn\u00e9es au clic (pixels + pourcentages) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        map.on('click', function (e) {\n            var latPx = Math.round(e.latlng.lat);\n            var lngPx = Math.round(e.latlng.lng);\n\n            \/\/ Conversion pixels \u2192 pourcentages\n            \/\/ Y est invers\u00e9 : lat=0 est en bas, IMAGE_HEIGHT est en haut\n            \/\/ copie de x% et de y% dans le clipboard\n            var xPct = parseFloat(((lngPx \/ IMAGE_WIDTH) * 100).toFixed(2));\n            var yPct = parseFloat((((IMAGE_HEIGHT - latPx) \/ IMAGE_HEIGHT) * 100).toFixed(2));\n            console.log('\u2500\u2500 Marqueur cliqu\u00e9 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500');\n            console.log('Pixels  \u2192 lat: ' + latPx + ', lng: ' + lngPx);\n            console.log('Pourcentage (%) \u2192 x: ' + xPct + ', y: ' + yPct);\n            console.log('Zoom: ' + map.getZoom());\n            xyPct = xPct + ', ' + yPct;\n            navigator.clipboard.writeText(xyPct);\n        });\n\n        \/\/ \u2500\u2500\u2500 Cr\u00e9ation des marqueurs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        var layers = [L.layerGroup(), L.layerGroup(), L.layerGroup(), L.layerGroup()];\n        layers.forEach(function (lg) {\n            lg.addTo(map);\n        });\n        \n        var allMarkerRefs = []; \/\/ \u2190 AJOUT\u00c9 : r\u00e9f\u00e9rence \u00e0 tous les marqueurs\n\n        MARKERS.forEach(function (m) {\n            \/\/ Marqueur ignor\u00e9 si cat\u00e9gorie invalide\n            if (m.layer < 0 || m.layer > 3) {\n                console.warn('[Carte] Marqueur ignor\u00e9 \u2014 cat\u00e9gorie invalide :', m);\n                return;\n            }\n\n            var marker = L.marker([m.lat, m.lng], {\n                icon: makeIcon(m.cat),\n                draggable: false  \/\/ \u2190 d\u00e9sactiv\u00e9 par d\u00e9faut, activ\u00e9 en mode \u00e9dition\n            });\n\n            \/\/ \u2190 AJOUT\u00c9 : m\u00e9morise la r\u00e9f\u00e9rence\n            allMarkerRefs.push({marker: marker, id: m.id});\n            \/\/ \u2190 AJOUT\u00c9 : sauvegarde au rel\u00e2chement\n            marker.on('dragend', function () {\n                var pos = marker.getLatLng();\n                var xPct = parseFloat(((pos.lng \/ IMAGE_WIDTH) * 100).toFixed(2));\n                var yPct = parseFloat((((IMAGE_HEIGHT - pos.lat) \/ IMAGE_HEIGHT) * 100).toFixed(2));\n                saveMarkerPosition(m.id, xPct, yPct);\n            });\n            \n            marker.bindPopup(\n                '<div class=\"map-popup\">'\n                + '<img decoding=\"async\" src=\"' + m.img + '\"\/>'\n                + '<strong>' + m.titre + '<\/strong>'\n                + '<p>' + m.texte + '<\/p>'\n                + '<a href=\"' + m.lien + '\" target=\"_blank\">En savoir plus<\/a>'\n                + '<\/div>',\n                {maxWidth: 190, closeOnClick: true}\n            );\n\n            \/\/ Centrage + zoom avant ouverture du popup\n            marker.on('click', function (e) {\n                if (editMode) return;\n                map.setView(e.target.getLatLng(), -1.5, {animate: true, duration: 0.5});\n            });\n\n            layers[m.layer].addLayer(marker);\n        });\n        \n        \/\/ \u2500\u2500\u2500 Mode \u00e9dition (admin uniquement) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        var config = window.carteConfig || {};\n        var editMode = false;\n\n\/\/ Affiche le bouton uniquement si l'utilisateur peut \u00e9diter\n        if (config.canEdit) {\n            document.getElementById('btn-edit-mode').style.display = 'block';\n        }\n\n\/\/ Toast de confirmation\n        var toastEl = document.createElement('div');\n        toastEl.id = 'carte-toast';\n        document.body.appendChild(toastEl);\n\n        function showToast(message, isError) {\n            toastEl.textContent = message;\n            toastEl.className = 'visible' + (isError ? ' error' : '');\n            clearTimeout(toastEl._timer);\n            toastEl._timer = setTimeout(function () {\n                toastEl.className = '';\n            }, 2500);\n        }\n\n\/\/ Sauvegarde via AJAX\n        function saveMarkerPosition(id, xPct, yPct) {\n            fetch(config.ajaxUrl, {\n                method: 'POST',\n                headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\n                body: [\n                    'action=update_marqueur_position',\n                    'nonce=' + encodeURIComponent(config.nonce),\n                    'id=' + encodeURIComponent(id),\n                    'x=' + encodeURIComponent(xPct.toFixed(2)),\n                    'y=' + encodeURIComponent(yPct.toFixed(2))\n                ].join('&')\n            })\n                .then(function (r) {\n                    return r.json();\n                })\n                .then(function (data) {\n                    if (data.success) {\n                        showToast('\u2713 Position sauvegard\u00e9e (x: ' + xPct.toFixed(2) + '%, y: ' + yPct.toFixed(2) + '%)');\n                    } else {\n                        showToast('Erreur : ' + (data.data || 'inconnue'), true);\n                    }\n                })\n                .catch(function () {\n                    showToast('Erreur r\u00e9seau', true);\n                });\n        }\n\n\/\/ Active \/ d\u00e9sactive le drag sur tous les marqueurs\n        function setEditMode(active) {\n            editMode = active;\n\n            var btn = document.getElementById('btn-edit-mode');\n            btn.textContent = active ? 'Quitter l\\'\u00e9dition' : '\u00c9dition des marqueurs';\n            btn.classList.toggle('active', active);\n\n            \/\/ Ferme tous les popups ouverts\n            map.closePopup();\n\n            \/\/ Active ou d\u00e9sactive le drag sur chaque marqueur\n            allMarkerRefs.forEach(function (ref) {\n                if (active) {\n                    ref.marker.dragging.enable();\n                } else {\n                    ref.marker.dragging.disable();\n                }\n            });\n\n            \/\/ Affiche un message d'aide\n            if (active) {\n                showToast('Glissez les marqueurs pour les repositionner');\n            }\n        }\n\n        document.getElementById('btn-edit-mode').addEventListener('click', function () {\n            this.blur();\n            setEditMode(!editMode);\n        });\n        \n        \/\/ \u2500\u2500\u2500 Logique des boutons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        var activeState = [true, true, true, true]; \/\/ tous actifs au d\u00e9part\n\n        function allActive() {\n            return activeState.every(function (v) {\n                return v;\n            });\n        }\n\n        function applyState() {\n            activeState.forEach(function (active, i) {\n                if (active) {\n                    if (!map.hasLayer(layers[i])) map.addLayer(layers[i]);\n                } else {\n                    if (map.hasLayer(layers[i])) map.removeLayer(layers[i]);\n                }\n                var btn = document.querySelector('.map-btn[data-cat=\"' + i + '\"]');\n                if (active) {\n                    btn.classList.add('active');\n                    btn.style.borderColor = CAT_COLORS[i];\n                    btn.style.color = CAT_COLORS[i];\n                } else {\n                    btn.classList.remove('active');\n                    btn.style.borderColor = '#ccc';\n                    btn.style.color = '#999';\n                }\n            });\n\n            \/\/ Met \u00e0 jour le libell\u00e9 du bouton toggle\n            document.getElementById('btn-toggle-all').textContent =\n                allActive() ? 'Tout masquer' : 'Tout voir';\n        }\n\n        document.querySelectorAll('.map-btn').forEach(function (btn) {\n            btn.addEventListener('click', function () {\n                btn.blur(); \/\/ rel\u00e2che le focus apr\u00e8s le clic\n                var i = parseInt(btn.dataset.cat);\n\n                if (allActive()) {\n                    \/\/ Toutes visibles \u2192 on isole la cat\u00e9gorie cliqu\u00e9e\n                    activeState = [false, false, false, false];\n                    activeState[i] = true;\n                } else {\n                    \/\/ Comportement normal : toggle\n                    activeState[i] = !activeState[i];\n                    \/\/ Si tout est masqu\u00e9 \u2192 on remet tout\n                    if (activeState.every(function (v) {\n                        return !v;\n                    })) {\n                        activeState = [true, true, true, true];\n                    }\n                }\n                applyState();\n            });\n        });\n\n        document.getElementById('btn-toggle-all').addEventListener('click', function () {\n            activeState = allActive() ? [false, false, false, false] : [true, true, true, true];\n            applyState();\n            this.blur(); \/\/ rel\u00e2che le focus apr\u00e8s le clic\n        });\n\n        \/\/ \u2500\u2500\u2500 Responsive \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n        setTimeout(fitImage, 300);\n        window.addEventListener('load', function () {\n            setTimeout(fitImage, 100);\n        });\n        var resizeTimer;\n        window.addEventListener('resize', function () {\n            clearTimeout(resizeTimer);\n            resizeTimer = setTimeout(fitImage, 150);\n        });\n    })();\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Nouveau plan Cigo Tout masquer Restauration Services Attractions Animaux \u00c9dition des marqueurs<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-99","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/pages\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":235,"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/pages\/99\/revisions"}],"predecessor-version":[{"id":510,"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/pages\/99\/revisions\/510"}],"wp:attachment":[{"href":"https:\/\/wp.zacube.com\/index.php\/wp-json\/wp\/v2\/media?parent=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}