Skip to content

Commit

Permalink
marqueur central
Browse files Browse the repository at this point in the history
  • Loading branch information
clement2323 committed Oct 24, 2024
1 parent 5df8e7c commit a2cf3ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/departement/[departement].md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ mapDiv.style = "height: 600px; width: 100%; margin: 0 auto;";
// Initialiser la carte avec la position centrale du département
const map = L.map(mapDiv).setView(center, 17);


// Créer un icône personnalisé pour le marqueur
const crossIcon = L.divIcon({
className: 'custom-cross-icon',
html: '<div style="width: 10px; height: 10px; background-color: black; border: 2px solid white; border-radius: 50%;"></div>',
iconSize: [10, 10], // Taille de l'icône
iconAnchor: [5, 5] // Point d'ancrage de l'icône (centre de l'icône)
});

// Ajouter le marqueur à la carte
L.marker(center, { icon: crossIcon }).addTo(map);
// Ajout d'une couche de base OpenStreetMap
const baseLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; OpenStreetMap contributors',
Expand Down

0 comments on commit a2cf3ce

Please sign in to comment.