Log failures to match a route for the initial path

This commit is contained in:
Tom Hughes 2013-12-03 17:51:01 +00:00
parent b04339f699
commit e18c3fd58d

View file

@ -169,8 +169,12 @@ OSM.Router = function(map, rts) {
};
router.load = function() {
var loadState = currentRoute.run('load', currentPath);
router.stateChange(loadState || {});
if (currentRoute) {
var loadState = currentRoute.run('load', currentPath);
router.stateChange(loadState || {});
} else {
console.log("Unable to match route for: " + currentPath);
}
};
map.on('moveend baselayerchange overlaylayerchange', router.updateHash);