Skip to content

Commit

Permalink
Show hidden map if it's requested by URL wtracks?map=...
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eddy-geek committed Dec 22, 2021
1 parent 563ad52 commit b742e8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/wtracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 = "";
Expand Down

0 comments on commit b742e8e

Please sign in to comment.