Add icon changing on type changing in poi editor

This commit is contained in:
leosw
2020-05-18 09:34:26 +04:00
parent 91c9517dac
commit 5034763a18
3 changed files with 13 additions and 1 deletions

View File

@@ -56,4 +56,15 @@ $( document ).ready(function() {
$("#lat").val(e.latlng.lat);
$("#lon").val(e.latlng.lng);
})
var poiicon = L.icon({
iconSize: [24, 24],
iconAnchor: [12, 12]
});
$("#type_selector label").click(function(e) {
console.log(e);
poiicon.options.iconUrl = e.currentTarget.firstChild.currentSrc;
poi_layer.setIcon(poiicon);
})
});