How do I adjust opacity in leaflet without calling "removeLayer"? I have already used "map.addLayer(myLayer)" to my map. I see that there is a setParams() method, but it appears to have no effect when I call "myLayer.setParams({opacity:0.1})" and there is no refresh button for the WMS. Is this even possible in Leaflet? If so, how? Is there even someway to call something along the lines of "map.getLayers()" or something to be able to retrieve already added layers to the map?
Use setOpacity
like layer.setOpacity(0.5)
API Docs - http://leafletjs.com/reference.html#tilelayer-opacity (scroll down a bit)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With