X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1082d3a6535c5c2a777ae64a3067e9f8657bd32c..22408c3e5bbce14b70b56be3a02122e2db3de896:/app/assets/javascripts/router.js diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index fbad1e28c..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, {animate: false}); - map.updateLayers(state.layers); + if (state.center) { + map.setView(state.center, state.zoom, {animate: false}); + map.updateLayers(state.layers); + } }); return function (url) {