var path = url.replace(/#.*/, ''),
route = routes.recognize(path);
if (!route) return false;
- window.history.pushState(OSM.parseHash(url), document.title, url);
currentRoute.run('unload');
+ window.history.pushState(OSM.parseHash(url), document.title, url);
currentPath = path;
currentRoute = route;
currentRoute.run('pushstate', currentPath);
router.stateChange(loadState || {});
};
+ router.setCurrentPath = function (path) {
+ currentPath = path;
+ currentRoute = routes.recognize(currentPath);
+ };
+
map.on('moveend baselayerchange overlaylayerchange', router.updateHash);
$(window).on('hashchange', router.hashUpdated);