I would like to set my overlayimage off when reload the map.
According to the link:
https://stackoverflow.com/questions/46043995/set-leaflet-overlay-off-in-the-layer-control
I tried sth like this:
var overlayMaps = (null,{
"Geographic names": positronLabels,
"City fibre": cityfibre
});
but there is no reaction on my map
In turn this example:
https://stackoverflow.com/questions/45333282/remove-leaflet-overlaymaps-layer-programmatically
Esri leaflet layers turned off by default in map layer control box
shows how to remove some layer instead of switch it off at the initial stage.
When I put null
into my code, my overlay layers are gone:
L.control.layers(baseMaps, null, overlayMaps).addTo(map);
I couldn't find a good solution on the Leaflet.js reference:
https://leafletjs.com/examples/layers-control/
Is there any option to make them switched off at the initial stages?
No comments:
Post a Comment