From: Aaron Lidman Date: Fri, 15 Nov 2013 02:16:23 +0000 (-0800) Subject: Obey the hash X-Git-Tag: live~4682^2~65 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/518a51712c7dce533f4e2d72873e01746fbe50e8 Obey the hash --- diff --git a/app/assets/javascripts/index/note.js.erb b/app/assets/javascripts/index/note.js.erb index a98cea307..09044bf0e 100644 --- a/app/assets/javascripts/index/note.js.erb +++ b/app/assets/javascripts/index/note.js.erb @@ -70,7 +70,7 @@ OSM.Note = function (map) { var data = $('.details').data(); if (!noteState) map.addLayer(noteLayer); - if (window.location.hash == "") { + if (!window.location.hash) { var coords = data.coordinates.split(','); OSM.route.moveListenerOff(); map.once('moveend', OSM.route.moveListenerOn); 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); + } } } });