Notes: show first comment as marker tooltip
authorSimon Legner <Simon.Legner@gmail.com>
Tue, 14 Apr 2015 21:32:58 +0000 (23:32 +0200)
committerSimon Legner <Simon.Legner@gmail.com>
Wed, 26 Aug 2015 18:44:04 +0000 (20:44 +0200)
app/assets/javascripts/index/notes.js

index d5ffbead13d849704b81d413e7445d818cb25819..61067adba8ed9b2f2948482d306be64985a86d03 100644 (file)
@@ -45,6 +45,8 @@ OSM.initializeNotes = function (map) {
     } else {
       marker = L.marker(feature.geometry.coordinates.reverse(), {
         icon: noteIcons[feature.properties.status],
+        title: feature.properties.comments && feature.properties.comments[0] ?
+          feature.properties.comments[0].text : undefined,
         opacity: 0.8,
         clickable: true
       });