X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fec9dc84c05a496141d4e7fedd21765ddcceba06..d920d94f69de0e6f5d354f58933290fcdf0345de:/app/assets/javascripts/leaflet.map.js.erb?ds=sidebyside diff --git a/app/assets/javascripts/leaflet.map.js.erb b/app/assets/javascripts/leaflet.map.js.erb index dec544d33..69fd1f3e3 100644 --- a/app/assets/javascripts/leaflet.map.js.erb +++ b/app/assets/javascripts/leaflet.map.js.erb @@ -218,12 +218,13 @@ L.OSM.Map = L.Map.extend({ map._objectLayer.addData(xml); map._objectLayer.addTo(map); - var bounds = map._objectLayer.getBounds(); - if (bounds.isValid()) { - OSM.route.moveListenerOff(); - map.once('moveend', OSM.route.moveListenerOn); - - map.fitBounds(bounds); + if (!window.location.hash) { + var bounds = map._objectLayer.getBounds(); + if (bounds.isValid()) { + OSM.route.moveListenerOff(); + map.once('moveend', OSM.route.moveListenerOn); + map.fitBounds(bounds); + } } } });