Update to leaflet 1.8.0

This commit is contained in:
Tom Hughes 2022-04-18 14:10:06 +01:00
parent 0676bea453
commit 2f6eebcd97
4 changed files with 19 additions and 16 deletions

View file

@ -73,7 +73,7 @@ OSM.Note = function (map) {
var data = $(".details").data(),
latLng = L.latLng(data.coordinates.split(","));
if (!map.hasLayer(halo)) {
if (!halo || !map.hasLayer(halo)) {
halo = L.circleMarker(latLng, {
weight: 2.5,
radius: 20,
@ -83,7 +83,8 @@ OSM.Note = function (map) {
map.addLayer(halo);
}
if (map.hasLayer(currentNote)) map.removeLayer(currentNote);
if (currentNote && map.hasLayer(currentNote)) map.removeLayer(currentNote);
currentNote = L.marker(latLng, {
icon: noteIcons[data.status],
opacity: 1,