X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6670de16a1981144869d7132e0bcc94a3b804513..9b35270d0be2984a4100e412518255aeb50068bf:/app/assets/javascripts/router.js diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 2f76f2f18..ab2064107 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -113,8 +113,10 @@ OSM.Router = function(map, rts) { var path = url.replace(/#.*/, ''), route = routes.recognize(path); if (!route) return false; - window.history.pushState(OSM.parseHash(url), document.title, url); currentRoute.run('unload'); + var state = OSM.parseHash(url); + map.setState(state); + window.history.pushState(state, document.title, url); currentPath = path; currentRoute = route; currentRoute.run('pushstate', currentPath);