This function doesn't update any existing marker.
- function updateMarker(feature) {
+ function addCreatedNoteMarker(feature) {
var marker = L.marker(feature.geometry.coordinates.reverse(), {
icon: noteIcons[feature.properties.status],
opacity: 0.9,
var marker = L.marker(feature.geometry.coordinates.reverse(), {
icon: noteIcons[feature.properties.status],
opacity: 0.9,
createNote(location, text, (feature) => {
content.find("textarea").val("");
createNote(location, text, (feature) => {
content.find("textarea").val("");
+ addCreatedNoteMarker(feature);
noteLayer.removeLayer(newNoteMarker);
newNoteMarker = null;
addNoteButton.removeClass("active");
noteLayer.removeLayer(newNoteMarker);
newNoteMarker = null;
addNoteButton.removeClass("active");