]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.extend.js.erb
Fix search
[rails.git] / app / assets / javascripts / leaflet.extend.js.erb
index 966d0276b33c6827553dbcaaa9b1366bf4a77584..e0fb3c461bad4caf61c1dfe1d6e0346b3edc7543 100644 (file)
@@ -122,7 +122,13 @@ L.extend(L.Map.prototype, {
           styles: {
             node: options.style,
             way: options.style,
           styles: {
             node: options.style,
             way: options.style,
-            area: options.style
+            area: options.style,
+            changeset: {
+              weight: 1,
+              color: '#FF9500',
+              opacity: 1,
+              fillOpacity: 0
+            }
           }
         });
 
           }
         });
 
@@ -140,8 +146,10 @@ L.extend(L.Map.prototype, {
 
         map._objectLayer.addData(xml);
 
 
         map._objectLayer.addData(xml);
 
-        if (options.zoom) map.fitBounds(map._objectLayer.getBounds());
-        if (options.callback) options.callback(map._objectLayer.getBounds());
+        var bounds = map._objectLayer.getBounds();
+
+        if (options.zoom && bounds.isValid()) map.fitBounds(bounds);
+        if (options.callback) options.callback(bounds);
 
         map._objectLayer.addTo(map);
       }
 
         map._objectLayer.addTo(map);
       }