Allow layer command of none to remove base layer
This commit is contained in:
parent
4c7a0dd2c3
commit
a2bdd32364
@ -323,6 +323,10 @@ style server by adding a property `wms: true`. (see overlay example below)
|
||||
"opt":{ "maxZoom":19, "attribution":"© OpenStreetMap" }
|
||||
};
|
||||
|
||||
Note: you can use the name "none" to completely remove the base layer for example.
|
||||
|
||||
msg.payload = {"command":{"layer":"none"}};
|
||||
|
||||
#### To add a WMS overlay layer - eg US weather radar
|
||||
|
||||
To add an overlay instead of a base layer - specify the `overlay` property instead of the `name`.
|
||||
|
@ -1379,7 +1379,7 @@ function setMarker(data) {
|
||||
marker.bindPopup(words, {closeButton:false, closeOnClick:false, keepInView:true, minWidth:250});
|
||||
marker._popup.dname = data.name;
|
||||
marker.lay = lay; // and the layer it is on
|
||||
|
||||
|
||||
var rightmenuMarker = L.popup({offset:[0,-12]}).setContent("<b>"+data.name+"</b><br/><button id='delbutton' onclick='delMarker(\""+data.name+"\",true);'>Delete</button>");
|
||||
marker.on('contextmenu', function(e) {
|
||||
if (hiderightclick !== true) {
|
||||
@ -1756,6 +1756,10 @@ function doCommand(cmd) {
|
||||
baselayername = cmd.layer;
|
||||
basemaps[baselayername].addTo(map);
|
||||
}
|
||||
if (cmd.layer && (cmd.layer === "none")) {
|
||||
map.removeLayer(basemaps[baselayername]);
|
||||
baselayername = cmd.layer;
|
||||
}
|
||||
// Add search command
|
||||
if (cmd.hasOwnProperty("search") && (typeof cmd.search === "string")) {
|
||||
document.getElementById('search').value = cmd.search;
|
||||
|
@ -1,5 +1,5 @@
|
||||
CACHE MANIFEST
|
||||
# date: Mar 2nd 2019 - v1.5.29c
|
||||
# date: Mar 2nd 2019 - v1.5.29d
|
||||
|
||||
CACHE:
|
||||
index.html
|
||||
|
Loading…
Reference in New Issue
Block a user