From b742e8e7e8ed7c370235bf0037ea6f3361ff4c96 Mon Sep 17 00:00:00 2001 From: EdwardO Date: Wed, 22 Dec 2021 19:08:27 +0100 Subject: [PATCH] Show hidden map if it's requested by URL `wtracks?map=...` It is only shown transiently: * since right now map is remembered, it will still be shown on next refresh (could be changed) * but as soon as user changes it, it will be hidden again --- js/wtracks.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/wtracks.js b/js/wtracks.js index 964cfa6..610f308 100644 --- a/js/wtracks.js +++ b/js/wtracks.js @@ -2059,8 +2059,10 @@ $(function(){ // Add maps and overlays var baseLayers = {}; var overlays = {}; + var baseLayer = getVal("wt.baseLayer", config.display.map); + var requested_map = getParameterByName('map') mapsForEach(function(name, props) { - if (props.on) { + if (props.on || name === requested_map || name == baseLayer) { var inList = props.in == MAP_MY ? mymaps : config.maps; var tile = getProvider(inList[name]); if (tile) { @@ -2080,7 +2082,6 @@ $(function(){ // ---------------------- - var baseLayer = getVal("wt.baseLayer", config.display.map); var initialLayer = baseLayers[baseLayer] || baseLayers[config.display.map]; if (!initialLayer) { //var availableLayerNames = "";