From 57221f056050864abfd85031299721bf3f0152f0 Mon Sep 17 00:00:00 2001 From: MuchQuak Date: Fri, 20 Dec 2024 15:37:42 -0800 Subject: [PATCH] Closes #2009 Moves Macro Strat Layer to an overlay and makes it transparent # Issue #2009 # Summary Move the macro strat layer to an overlay in the tile rendering and adds transparency so it can be put on top of other layers. --- js/symb/leafletMap.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/js/symb/leafletMap.js b/js/symb/leafletMap.js index fcabb4eda3..d2da017d93 100644 --- a/js/symb/leafletMap.js +++ b/js/symb/leafletMap.js @@ -132,7 +132,8 @@ class LeafletMap { var macro_strat = L.tileLayer('https://macrostrat.org/api/v2/maps/burwell/emphasized/{z}/{x}/{y}/tile.png', { displayRetina:true, - attribution: 'Map data: © Macrostrat (CC-BY-4.0)' + opacity: .50, + attribution: 'Map data: © Macrostrat (CC-BY-4.0)', }); const openTopoLayer = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', { @@ -142,14 +143,16 @@ class LeafletMap { }); if(map_options.layer_control !== false) { - L.control.layers({ - "Terrain": terrainLayer, - "Basic": basicLayer, - "Topo": openTopoLayer, - "Satellite": Esri_WorldImagery, - "Macrostrat": macro_strat, - //"Satellite": satelliteLayer, - }).addTo(this.mapLayer); + const layers = { + "Terrain": terrainLayer, + "Basic": basicLayer, + "Topo": openTopoLayer, + "Satellite": Esri_WorldImagery, + }; + const overlays = { + "Macro Strat": L.layerGroup([macro_strat]) + } + L.control.layers(layers, overlays).addTo(this.mapLayer); } if(map_options.scale !== false) {