jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.48k stars 363 forks source link

Is it possible to not have a basemap when creating a map? #1073

Closed Hato1 closed 1 year ago

Hato1 commented 1 year ago

When creating a map, a default basemap is used. In my use case, I wish to use my own png image using ImageOverlay without having the default basemap in the background, leading me to this workaround:

from ipyleaflet import Map
m = Map(zoom=4)
m.clear_layers()
m

Is there a better way?

martinRenou commented 1 year ago

You can maybe have one less line in your sample:

from ipyleaflet import Map
m = Map(zoom=4, layers=[])
m
Hato1 commented 1 year ago

Thanks, that looks much better.