X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a805e0b545a37b19a4162e71850bef9aba9d6628..22408c3e5bbce14b70b56be3a02122e2db3de896:/app/assets/javascripts/router.js diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 606308982..5b9cdad07 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -88,8 +88,10 @@ OSM.Router = function(map, rts) { currentRoute = routes.recognize(currentPath); currentRoute.run('popstate', currentPath); var state = e.originalEvent.state; - map.setView(state.center, state.zoom); - map.updateLayers(state.layers); + if (state.center) { + map.setView(state.center, state.zoom, {animate: false}); + map.updateLayers(state.layers); + } }); return function (url) {