Add a directional icon to the map
The notebook demonstrates how to add a directional icon to the map.
Uncomment the following line to install leafmap if needed.
In [1]:
Copied!
# %pip install "leafmap[maplibre]"
# %pip install "leafmap[maplibre]"
In [2]:
Copied!
import leafmap.maplibregl as leafmap
import leafmap.maplibregl as leafmap
In [3]:
Copied!
# import os
# os.environ["MAPTILER_KEY"] = "YOUR_API_KEY"
# import os
# os.environ["MAPTILER_KEY"] = "YOUR_API_KEY"
In [4]:
Copied!
m = leafmap.Map(style="3d-terrain")
url = "https://github.com/opengeos/datasets/releases/download/hydrology/streams.geojson"
m.add_geojson(url, name="Streams")
m.add_layer_control()
image = "https://i.imgur.com/ZMMvXuT.png"
m.add_symbol(
source="Streams", image=image, icon_size=0.1, symbol_placement="line", minzoom=10
)
m
m = leafmap.Map(style="3d-terrain")
url = "https://github.com/opengeos/datasets/releases/download/hydrology/streams.geojson"
m.add_geojson(url, name="Streams")
m.add_layer_control()
image = "https://i.imgur.com/ZMMvXuT.png"
m.add_symbol(
source="Streams", image=image, icon_size=0.1, symbol_placement="line", minzoom=10
)
m
An API key is required to use the 3D terrain feature.
In [5]:
Copied!
m = leafmap.Map(style="3d-terrain")
url = "https://github.com/opengeos/datasets/releases/download/vector/hike_gps_trace_line.geojson"
m.add_geojson(url, name="Hiking Trail")
m.add_layer_control()
image = "https://i.imgur.com/ZMMvXuT.png"
m.add_symbol(
source="Hiking Trail",
image=image,
icon_size=0.1,
symbol_placement="line",
minzoom=10,
)
m
m = leafmap.Map(style="3d-terrain")
url = "https://github.com/opengeos/datasets/releases/download/vector/hike_gps_trace_line.geojson"
m.add_geojson(url, name="Hiking Trail")
m.add_layer_control()
image = "https://i.imgur.com/ZMMvXuT.png"
m.add_symbol(
source="Hiking Trail",
image=image,
icon_size=0.1,
symbol_placement="line",
minzoom=10,
)
m
An API key is required to use the 3D terrain feature.