Bitmap Layer Example¶
Display raster images as map overlays using deck.gl BitmapLayer.
In [ ]:
Copied!
# %pip install anymap-ts
# %pip install anymap-ts
In [ ]:
Copied!
from anymap_ts import DeckGLMap
from anymap_ts import DeckGLMap
Create a map with a bitmap overlay¶
In [ ]:
Copied!
m = DeckGLMap(center=[-122.4, 37.8], zoom=10)
m.add_basemap("CartoDB.DarkMatter")
# Add a bitmap layer with a sample image
m.add_bitmap_layer(
image="https://tile.openstreetmap.org/10/163/395.png",
bounds=[-122.6, 37.6, -122.2, 38.0],
opacity=0.8,
)
m
m = DeckGLMap(center=[-122.4, 37.8], zoom=10)
m.add_basemap("CartoDB.DarkMatter")
# Add a bitmap layer with a sample image
m.add_bitmap_layer(
image="https://tile.openstreetmap.org/10/163/395.png",
bounds=[-122.6, 37.6, -122.2, 38.0],
opacity=0.8,
)
m
Export to HTML¶
In [ ]:
Copied!
m.to_html("bitmap_layer_example.html")
m.to_html("bitmap_layer_example.html")