Skip to content

3d style

image image image

Construct 3D style maps with MapTiler

Uncomment the following line to install leafmap if needed.

1
# %pip install "leafmap[maplibre]"
1
import leafmap.maplibregl as leafmap

To run this notebook, you will need an API key from MapTiler. Once you have the API key, you can uncomment the following code block and replace YOUR_API_KEY with your actual API key. Then, run the code block code to set the API key as an environment variable.

1
2
# import os
# os.environ["MAPTILER_KEY"] = "YOUR_API_KEY"

MapTiler provides a variety of basemaps and styles that can be used to create 3D maps. You can use any styles from the MapTiler basemap gallery and prefix the style name with 3d-. For example, 3d-hybrid, 3d-satellite, or 3d-topo. To use the hillshade only, you can use the 3d-hillshade style.

1
2
3
m = leafmap.Map(style="3d-hybrid")
m.add_layer_control(bg_layers=True)
m

1
2
3
m = leafmap.Map(style="3d-satellite")
m.add_layer_control(bg_layers=True)
m

1
2
3
m = leafmap.Map(style="3d-topo", exaggeration=1.5, hillshade=False)
m.add_layer_control(bg_layers=True)
m