diff --git a/public/views/d.map.html b/public/views/d.map.html
index 443fcda..4aa09eb 100755
--- a/public/views/d.map.html
+++ b/public/views/d.map.html
@@ -41,7 +41,7 @@
?>
"=$k?>": { color: "=$color?>", size: =$size?>, shape: "=$shape?>", icon: "=$icon?>" },
- "default": { color: "#ef2929", size: 16, shape: "square", icon: "=$config['views_url']?>img/default.svg" }
+ "default": { color: "#ef2929", size: 16, shape: "square", icon: "=$config['views_url']?>third/leaflet/images/marker-icon.png" }
};
diff --git a/public/views/d.poi.edit.html b/public/views/d.poi.edit.html
index e590dd9..507984f 100755
--- a/public/views/d.poi.edit.html
+++ b/public/views/d.poi.edit.html
@@ -251,7 +251,7 @@ $( "#name" ).change(function() {
?>
"=$k?>": { color: "=$color?>", size: =$size?>, shape: "=$shape?>", icon: "=$icon?>" },
- "default": { color: "#ef2929", size: 16, shape: "square", icon: "=$config['views_url']?>img/default.svg" }
+ "default": { color: "#ef2929", size: 16, shape: "square", icon: "=$config['views_url']?>third/leaflet/images/marker-icon.png" }
};
diff --git a/public/views/d.poi.view.html b/public/views/d.poi.view.html
index 54b223f..f7f22df 100644
--- a/public/views/d.poi.view.html
+++ b/public/views/d.poi.view.html
@@ -312,7 +312,7 @@
?>
"=$k?>": { color: "=$color?>", size: =$size?>, shape: "=$shape?>", icon: "=$icon?>" },
- "default": { color: "#ef2929", size: 16, shape: "square", icon: "=$config['views_url']?>img/default.svg" }
+ "default": { color: "#ef2929", size: 16, shape: "square", icon: "=$config['views_url']?>third/leaflet/images/marker-icon.png" }
};
diff --git a/public/views/js/d.poi_map.js b/public/views/js/d.poi_map.js
index 423975a..b36bf90 100755
--- a/public/views/js/d.poi_map.js
+++ b/public/views/js/d.poi_map.js
@@ -155,14 +155,10 @@ $(document).ready(function() {
var startLat = (typeof poi_lat !== "undefined" && poi_lat) ? poi_lat : 47;
var startLon = (typeof poi_lon !== "undefined" && poi_lon) ? poi_lon : 3;
- // Icône : si poi_type défini, on l’utilise, sinon icône Leaflet par défaut
- var poiicon = null;
+ // Icône centrale : même règle que les POIs
+ var poiType = (typeof poi_type !== "undefined" && poi_type) ? poi_type : "default";
if (typeof poi_type !== "undefined" && poi_type) {
- poiicon = L.icon({
- iconSize: [24, 24],
- iconAnchor: [12, 12],
- iconUrl: root + "views/img/" + poi_type + ".svg"
- });
+ var poiicon = getMarkerIconFor(poiType, mymap.getZoom());
}
if (poiicon) {
@@ -171,6 +167,13 @@ $(document).ready(function() {
poi_layer = L.marker([startLat, startLon], { draggable: isEdit }).addTo(mymap);
}
+ // Si le zoom change, on recalcule la taille comme pour les POIs
+ mymap.on('zoomend', function() {
+ if (poi_layer) {
+ poi_layer.setIcon(getMarkerIconFor(poiType, mymap.getZoom()));
+ }
+ });
+
if (isEdit) {
poi_layer.bindTooltip("Glissez moi au bon endroit.", { permanent: true, direction: 'auto' }).openTooltip();
}
@@ -204,15 +207,10 @@ $(document).ready(function() {
}
});
- var editPoiIcon = L.icon({
- iconSize: [24, 24],
- iconAnchor: [12, 12]
- });
-
$("#type_selector label").click(function(e) {
poi_layer.unbindTooltip();
- editPoiIcon.options.iconUrl = e.currentTarget.firstChild.currentSrc;
- poi_layer.setIcon(editPoiIcon);
+ poiType = e.currentTarget.getAttribute("for");
+ poi_layer.setIcon(getMarkerIconFor(poiType, mymap.getZoom()));
});
$("#elevation_icon").click(function(e) {