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`.
|
||||
|
@ -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