]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.map.js
Remove query result geometry when unloading the page
[rails.git] / app / assets / javascripts / leaflet.map.js
index 75396fd73013fefd67d63f634d7aad34ae8c9b9b..44aa530d9b39e2dd4aa8399dba5cedbca42b4500 100644 (file)
@@ -258,15 +258,17 @@ L.OSM.Map = L.Map.extend({
 
       this._object = object;
       this._objectLayer = L.featureGroup().addTo(this);
-      
+
       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
       var map = this;