]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/layers/notes.js
Merge branch 'pull/5579'
[rails.git] / app / assets / javascripts / index / layers / notes.js
index 75bd73bcefa7eb4a97878e6223e6277636efee49..24bf969b3380581e9e3b07f35873b36a9fe6a170 100644 (file)
@@ -43,9 +43,16 @@ OSM.initializeNotesLayer = function (map) {
     if (marker) {
       marker.setIcon(noteIcons[feature.properties.status]);
     } else {
+      let title;
+      const description = feature.properties.comments[0];
+
+      if (description?.action === "opened") {
+        title = description.text;
+      }
+
       marker = L.marker(feature.geometry.coordinates.reverse(), {
         icon: noteIcons[feature.properties.status],
-        title: feature.properties.comments[0].text,
+        title,
         opacity: 0.8,
         interactive: true
       });