How can I make the background of the Leaflet map transparent. I see opacity controls from the layers, but not the map background. Should the be changed just with plain CSS?


Hey plain CSS did the trick:

.leaflet-container {
| improve this answer | |

Try using the leaflet.extras package -- you can make the background white or transparent!



setMapWidgetStyle(list(background= "white"))
| improve this answer | |
  • This question is about Javascript Leaflet. – Stefan Jan 16 '19 at 18:37
  • @Jessie this is for leaflet on Javascript not R – csheth Apr 9 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.