Tile Basemaps¶
TileLayer downloads XYZ raster tiles, warps them from
EPSG:3857 to the map CRS, and embeds them as base64 PNG <image>
elements.
Requires: pip install mappyng[tile]
from mappyng import Map, TileLayer
m = Map(gdf, width=800, height="auto")
m.add(TileLayer())
m.add(TileLayer(source="satellite"))
m.add(TileLayer(source="terrain", opacity=0.7, zoom_offset=-1))
m.add(TileLayer(source="https://tile.openstreetmap.org/{z}/{x}/{y}.png"))
All parameters¶
These are passed as keyword arguments to TileLayer(...).
Key |
Default |
Description |
|---|---|---|
|
|
Provider alias or URL template with |
|
|
Zoom level (int) or |
|
0 |
Integer added to the auto-calculated zoom
( |
|
1.0 |
Tile layer opacity 0-1. |
|
|
Cache downloaded tiles on disk. |
|
|
Cache directory path. Defaults to |
|
10.0 |
HTTP request timeout in seconds. |
|
|
Render tiles on cartouche viewports. |
|
|
Render tiles on the zoom viewport. |
|
64 |
Maximum tiles downloaded per viewport (safety cap). |
|
1.5 |
Output image resolution relative to the SVG content area (1.0 = screen pixels, 1.5 = 50 % denser for crispness). |
|
0 |
Also fetch this many coarser zoom levels and composite them (coarse to fine, finer tiles overwrite coarser where available). Useful to fill gaps when fine tiles fail to download. |
Built-in providers¶
Alias |
Provider |
|---|---|
|
OpenStreetMap standard |
|
OpenStreetMap Humanitarian |
|
CartoDB Positron (light, no labels) |
|
CartoDB DarkMatter (dark) |
|
CartoDB Voyager (color) |
|
Stadia / Stamen Terrain |
|
Stadia / Stamen Toner (black & white) |
|
Stadia / Stamen Toner Lite |
|
Stadia / Stamen Watercolor |
|
ESRI World Imagery (satellite) |
|
ESRI World Terrain Base |
|
ESRI World Street Map |
|
ESRI National Geographic |
|
ESRI World Ocean Base |
|
OpenTopoMap (topographic) |