]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/layers/notes.js
Show only description as a marker tooltip in note layer
[rails.git] / app / assets / javascripts / index / layers / notes.js
index c0ba35d7e1b0d6f7c2e3819af78f1a7aada91f6f..1068472d5171bd0ab48c5ada2944be454ad79013 100644 (file)
@@ -40,9 +40,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
       });