X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/42fa563e01493fd7a6e28d8053f84558e50d5322..3ebad9ec2f59f2ba5716952f6169cdbb4972f931:/app/assets/javascripts/leaflet.extend.js.erb diff --git a/app/assets/javascripts/leaflet.extend.js.erb b/app/assets/javascripts/leaflet.extend.js.erb index 966d0276b..cec25081b 100644 --- a/app/assets/javascripts/leaflet.extend.js.erb +++ b/app/assets/javascripts/leaflet.extend.js.erb @@ -122,7 +122,12 @@ L.extend(L.Map.prototype, { styles: { node: options.style, way: options.style, - area: options.style + area: options.style, + changeset: { + weight: 2, + color: '#e90', + fillOpacity: 0 + } } }); @@ -140,8 +145,10 @@ L.extend(L.Map.prototype, { 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); }