]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/router.js
Update map state when following a client side route
[rails.git] / app / assets / javascripts / router.js
index 9657549b1abdb893c304049b76ec894038a21402..ab206410703e81a4db32cecf914551d539b9e535 100644 (file)
@@ -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);