X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9cd8c4006c1c2611bb7cbb4ffb513050d0611fe7..6d8d41b166d59ddb3250d7b8d5b5f275c86bedf1:/app/assets/javascripts/index/layers/notes.js diff --git a/app/assets/javascripts/index/layers/notes.js b/app/assets/javascripts/index/layers/notes.js index 104f6f2f2..00f1fb4e9 100644 --- a/app/assets/javascripts/index/layers/notes.js +++ b/app/assets/javascripts/index/layers/notes.js @@ -3,24 +3,6 @@ OSM.initializeNotesLayer = function (map) { const noteLayer = map.noteLayer; let notes = {}; - const noteIcons = { - "new": L.icon({ - iconUrl: OSM.NEW_NOTE_MARKER, - iconSize: [25, 40], - iconAnchor: [12, 40] - }), - "open": L.icon({ - iconUrl: OSM.OPEN_NOTE_MARKER, - iconSize: [25, 40], - iconAnchor: [12, 40] - }), - "closed": L.icon({ - iconUrl: OSM.CLOSED_NOTE_MARKER, - iconSize: [25, 40], - iconAnchor: [12, 40] - }) - }; - noteLayer.on("add", () => { loadNotes(); map.on("moveend", loadNotes); @@ -41,7 +23,7 @@ OSM.initializeNotesLayer = function (map) { function updateMarker(old_marker, feature) { let marker = old_marker; if (marker) { - marker.setIcon(noteIcons[feature.properties.status]); + marker.setIcon(OSM.getMarker({ icon: `${feature.properties.status}_NOTE_MARKER`, shadow: false, height: 40 })); } else { let title; const description = feature.properties.comments[0]; @@ -51,7 +33,7 @@ OSM.initializeNotesLayer = function (map) { } marker = L.marker(feature.geometry.coordinates.reverse(), { - icon: noteIcons[feature.properties.status], + icon: OSM.getMarker({ icon: `${feature.properties.status}_NOTE_MARKER`, shadow: false, height: 40 }), title, opacity: 0.8, interactive: true