From 1527a07d0e2fa4bbcd9cc187d75bf64503f31fda Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Wed, 28 May 2014 17:08:44 +0200 Subject: [PATCH] don't permalink to custom profile --- js/plugin/Permalink.Routing.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/plugin/Permalink.Routing.js b/js/plugin/Permalink.Routing.js index ee5ad08..ea2b713 100644 --- a/js/plugin/Permalink.Routing.js +++ b/js/plugin/Permalink.Routing.js @@ -54,14 +54,21 @@ L.Control.Permalink.include({ _update_routing: function (evt) { var router = this.options.router, routing = this.options.routing, - latLngs; + routingOptions = this.options.routingOptions, + latLngs = routing.getWaypoints(), + params = router.getUrlParams(latLngs); if (evt && evt.options) { router.setOptions(evt.options); } - latLngs = routing.getWaypoints(); - this._update(router.getUrlParams(latLngs)); + // don't permalink to custom profile, as these are only stored temporarily + if (params.profile && params.profile === routingOptions.getCustomProfile()) { + params.profile = null; + } + + this._update(params); + //console.log('permalink: ' + this._href.href); }, _set_routing: function (e) {