We want the new note marker in the same layer with its halo. Also we don't want to put anything in noteLayer because it clears its contents on certain zoom levels.
newHalo(newNoteMarker.getLatLng(), a.type);
});
newHalo(newNoteMarker.getLatLng(), a.type);
});
- newNoteMarker.addTo(noteLayer);
+ newNoteMarker.addTo(map);
newHalo(newNoteMarker.getLatLng());
newNoteMarker.on("remove", function () {
newHalo(newNoteMarker.getLatLng());
newNoteMarker.on("remove", function () {
createNote(location, text, (feature) => {
content.find("textarea").val("");
addCreatedNoteMarker(feature);
createNote(location, text, (feature) => {
content.find("textarea").val("");
addCreatedNoteMarker(feature);
- noteLayer.removeLayer(newNoteMarker);
+ map.removeLayer(newNoteMarker);
newNoteMarker = null;
addNoteButton.removeClass("active");
OSM.router.route("/note/" + feature.properties.id);
newNoteMarker = null;
addNoteButton.removeClass("active");
OSM.router.route("/note/" + feature.properties.id);
};
page.unload = function () {
};
page.unload = function () {
- if (newNoteMarker) noteLayer.removeLayer(newNoteMarker);
+ if (newNoteMarker) map.removeLayer(newNoteMarker);
if (halo) map.removeLayer(halo);
addNoteButton.removeClass("active");
};
if (halo) map.removeLayer(halo);
addNoteButton.removeClass("active");
};