]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.map.js
Display icon for current note only if this icon is defined
[rails.git] / app / assets / javascripts / leaflet.map.js
index b2d4abcb72719fd4b93f4bd218c29e48ebaee441..44aa530d9b39e2dd4aa8399dba5cedbca42b4500 100644 (file)
@@ -261,11 +261,13 @@ L.OSM.Map = L.Map.extend({
 
       L.circleMarker(object.latLng, haloStyle).addTo(this._objectLayer);
 
-      L.marker(object.latLng, {
-        icon: object.icon,
-        opacity: 1,
-        interactive: true
-      }).addTo(this._objectLayer);
+      if (object.icon) {
+        L.marker(object.latLng, {
+          icon: object.icon,
+          opacity: 1,
+          interactive: true
+        }).addTo(this._objectLayer);
+      }
 
       if (callback) callback(this._objectLayer.getBounds());
     } else { // element or changeset handled by L.OSM.DataLayer