Tile Layer Example¶
Custom tile layer rendering using deck.gl TileLayer.
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 tile layer¶
In [ ]:
Copied!
m = DeckGLMap(center=[-122.4, 37.8], zoom=10)
m.add_basemap("CartoDB.DarkMatter")
# Add OpenStreetMap tiles as a tile layer
m.add_tile_layer(
data="https://tile.openstreetmap.org/{z}/{x}/{y}.png",
min_zoom=0,
max_zoom=19,
tile_size=256,
opacity=0.7,
)
m
m = DeckGLMap(center=[-122.4, 37.8], zoom=10)
m.add_basemap("CartoDB.DarkMatter")
# Add OpenStreetMap tiles as a tile layer
m.add_tile_layer(
data="https://tile.openstreetmap.org/{z}/{x}/{y}.png",
min_zoom=0,
max_zoom=19,
tile_size=256,
opacity=0.7,
)
m
Export to HTML¶
In [ ]:
Copied!
m.to_html("tile_layer_example.html")
m.to_html("tile_layer_example.html")