Skip to content

Commit

Permalink
Fix overlays restore (regression from opoto#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddy-geek committed Dec 25, 2021
1 parent f0fceb9 commit 7ef120c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getParameterByName(name, defaultValue) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? (isUnset(defaultValue) ? defaultValue : "") : decodeURIComponent(results[1].replace(/\+/g, " "));
return results === null ? defaultValue : decodeURIComponent(results[1].replace(/\+/g, " "));
}

function jsonClone(obj) {
Expand Down
6 changes: 3 additions & 3 deletions js/wtracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2064,10 +2064,10 @@ $(function(){
var baseLayers = {};
var overlays = {};
var baseLayer = getVal("wt.baseLayer", config.display.map);
var requestedMap = getParameterByName("map")
var requestedOverlays = (getParameterByName("overlays") || "").split(',')
var requestedMap = getParameterByName("map");
var requestedOverlays = getParameterByName("overlays")?.split(',');
mapsForEach(function(name, props) {
if (props.on || name == baseLayer || name === requestedMap || requestedOverlays.includes(name)) {
if (props.on || name == baseLayer || name === requestedMap || requestedOverlays?.includes(name)) {
var inList = props.in == MAP_MY ? mymaps : config.maps;
var tile = getProvider(inList[name]);
if (tile) {
Expand Down

0 comments on commit 7ef120c

Please sign in to comment.