From: Tom Hughes Date: Thu, 13 Mar 2014 13:37:45 +0000 (+0000) Subject: Update map state when following a client side route X-Git-Tag: live~4418 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/9b35270d0be2984a4100e412518255aeb50068bf?ds=sidebyside Update map state when following a client side route --- diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 9657549b1..ab2064107 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -114,7 +114,9 @@ OSM.Router = function(map, rts) { route = routes.recognize(path); if (!route) return false; currentRoute.run('unload'); - window.history.pushState(OSM.parseHash(url), document.title, url); + var state = OSM.parseHash(url); + map.setState(state); + window.history.pushState(state, document.title, url); currentPath = path; currentRoute = route; currentRoute.run('pushstate', currentPath);