Skip to content

Commit

Permalink
Merge pull request #32 from eddy-geek/ovrreg
Browse files Browse the repository at this point in the history
Fix overlays restore (regression from #27)
  • Loading branch information
opoto authored Dec 25, 2021
2 parents f0fceb9 + 7ef120c commit f4356aa
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 f4356aa

Please sign in to comment.