From 9b35270d0be2984a4100e412518255aeb50068bf Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 13 Mar 2014 13:37:45 +0000 Subject: [PATCH] Update map state when following a client side route --- app/assets/javascripts/router.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.43.2