};
function newHalo(loc, a) {
- if (a === "dragstart" && map.hasLayer(halo)) {
+ var hasHalo = halo && map.hasLayer(halo)
+
+ if (a === "dragstart" && hasHalo) {
map.removeLayer(halo);
} else {
- if (map.hasLayer(halo)) map.removeLayer(halo);
+ if (hasHalo) map.removeLayer(halo);
halo = L.circleMarker(loc, {
weight: 2.5,
};
page.unload = function () {
- noteLayer.removeLayer(newNote);
- map.removeLayer(halo);
+ if (newNote) noteLayer.removeLayer(newNote);
+ if (halo) map.removeLayer(halo);
addNoteButton.removeClass("active");
};
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,
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,
"bs-custom-file-input": "^1.3.4",
"jquery-simulate": "^1.0.2",
"js-cookie": "^3.0.0",
- "leaflet": "^1.6.0",
- "leaflet.locatecontrol": "^0.75.0",
+ "leaflet": "^1.8.0",
+ "leaflet.locatecontrol": "^0.76.0",
"qs": "^6.9.4"
},
"devDependencies": {
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=
-leaflet.locatecontrol@^0.75.0:
- version "0.75.0"
- resolved "https://registry.yarnpkg.com/leaflet.locatecontrol/-/leaflet.locatecontrol-0.75.0.tgz#8c7996de4425380660431fbfa548d5fe3a3595d8"
- integrity sha512-Mz/+4dgmUoBVxy7BN+Rtf76XcIJw2qK+S41FnejS/AC88Ec5hpaFnI5gYcS+W6zcQ90sAKxqu1rXii+c01ot5g==
-
-leaflet@^1.6.0:
- version "1.7.1"
- resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.7.1.tgz#10d684916edfe1bf41d688a3b97127c0322a2a19"
- integrity sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw==
+leaflet.locatecontrol@^0.76.0:
+ version "0.76.0"
+ resolved "https://registry.yarnpkg.com/leaflet.locatecontrol/-/leaflet.locatecontrol-0.76.0.tgz#afca63a3ccf3161bed0e8bf94a98ddba364e90e1"
+ integrity sha512-Mx8uiihBi8KrrW3LgblsNL/pS8HR0gj60m8VFDFrnhSvDuitChazc095XcMSscf/XqZW+TSqQMCTe+AUy/4/eA==
+
+leaflet@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.8.0.tgz#4615db4a22a304e8e692cae9270b983b38a2055e"
+ integrity sha512-gwhMjFCQiYs3x/Sf+d49f10ERXaEFCPr+nVTryhAW8DWbMGqJqt9G4XuIaHmFW08zYvhgdzqXGr8AlW8v8dQkA==
levn@^0.4.1:
version "0.4.1"