/** * This file is part of Zwii. * * For full copyright and license information, please see the LICENSE * file that was distributed with this source code. * * @author Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean * @author Frédéric Tempez * @copyright Copyright (C) 2018-2024, Frédéric Tempez * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International * @link http://zwiicms.fr/ */ // Centrage de la carte et niveau de zoom const jsonOptions = ''; const objOptions = JSON.parse(jsonOptions); // Initialisation de la carte var map = L.map('map').setView([objOptions.lat, objOptions.long], objOptions.zoom - 1); // Ajouter une couche de tuiles OpenStreetMap L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); // Les données PHP converties en JSON pour JavaScript const json = ''; const obj = JSON.parse(json); // Ajouter les marqueurs à la carte obj.forEach(function(location) { var marker = L.marker([location.lat, location.long], {title: location.label}); marker.addTo(map); marker.bindPopup('Thumbnail'); });