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);
map.on('moveend baselayerchange overlaylayerchange', router.updateHash);
$(window).on('hashchange', router.hashUpdated);
+ $(window).on('unload', function(e) {
+ $(".query_wrapper.routing input").val("");
+ });
return router;
};