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
});
function success(json) {
var oldNotes = notes;
notes = {};
- json.features.forEach(updateMarkers);
-
- function updateMarkers(feature) {
+ for (const feature of json.features) {
var marker = oldNotes[feature.properties.id];
delete oldNotes[feature.properties.id];
notes[feature.properties.id] = updateMarker(marker, feature);