var routes = [];
for (var r in rts)
- routes.push(Route(r, rts[r]));
+ routes.push(new Route(r, rts[r]));
routes.recognize = function(path) {
for (var i = 0; i < this.length; i++) {
return true;
};
+ router.replace = function (url) {
+ window.history.replaceState(OSM.parseHash(url), document.title, url);
+ };
+
router.stateChange = function(state) {
if (state.center) {
window.history.replaceState(state, document.title, OSM.formatHash(state));
}
};
} else {
- router.route = function (url) {
+ router.route = router.replace = function (url) {
window.location.assign(url);
};