diff --git a/js/index.js b/js/index.js index 8041867..f743695 100644 --- a/js/index.js +++ b/js/index.js @@ -236,11 +236,7 @@ profile.update(routingOptions.getOptions()); urlHash = new L.Hash(map, mapLayers, function() { - var latLngs = routing.getWaypoints(); - if (latLngs.length > 1) { - return router.getUrl(latLngs, null); - } - return null; + return router.getUrl(routing.getWaypoints(), null); }); routingOptions.on('update', urlHash.updateHash, urlHash); nogos.on('update', urlHash.updateHash, urlHash); diff --git a/js/router/BRouter.js b/js/router/BRouter.js index 6e44699..78af931 100644 --- a/js/router/BRouter.js +++ b/js/router/BRouter.js @@ -79,7 +79,7 @@ L.BRouter = L.Class.extend({ var urlParams = this.getUrlParams(latLngs, format); var args = [] - if (urlParams.lonlats != null) + if (urlParams.lonlats != null && urlParams.lonlats.length > 0) args.push(L.Util.template('lonlats={lonlats}', urlParams)); if (urlParams.nogos != null) args.push(L.Util.template('nogos={nogos}', urlParams));