Tuesday, 2 August 2016

javascript - Leaflet set the ImageOverlay switched off at the initial stage


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?


Layers gone


Layers unchecked




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...