X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/42fa563e01493fd7a6e28d8053f84558e50d5322..1ae7872ed89612353cba641a6b77e86f963789d7:/app/assets/javascripts/leaflet.extend.js.erb?ds=inline diff --git a/app/assets/javascripts/leaflet.extend.js.erb b/app/assets/javascripts/leaflet.extend.js.erb index 966d0276b..e0fb3c461 100644 --- a/app/assets/javascripts/leaflet.extend.js.erb +++ b/app/assets/javascripts/leaflet.extend.js.erb @@ -122,7 +122,13 @@ L.extend(L.Map.prototype, { 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); - 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); }