Mapillary

Visualizing Mapillary Vector Tiles
Mapillary provides a global dataset of street-level images, with coverage in many countries. The Mapillary vector tiles provide a way to access the data in a vector format, which can be used to create custom maps and visualizations.
Uncomment the following line to install leafmap if needed.
| # %pip install "leafmap[maplibre]"
|
| import leafmap.common as common
import leafmap.maplibregl as leafmap
|
To run this notebook, you will need an access token from Mapillary. 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.
| # import os
# os.environ["MAPILLARY_API_KEY"] = "YOUR_API_KEY"
|
| m = leafmap.Map(
style="bright", center=[-73.99941, 40.71194], zoom=13, sidebar_visible=True
)
m.add_basemap("Satellite")
m.add_mapillary(minzoom=6, maxzoom=14, add_popup=True, add_to_sidebar=True)
m.add_layer_control()
m
|

| image_ids = common.search_mapillary_images(
lon=-73.99941, lat=40.71194, radius=0.0005, limit=5
)
image_ids
|
| common.get_mapillary_image_url(image_ids[0], resolution="original")
|
| common.download_mapillary_images(image_ids, resolution="original")
|
| common.get_mapillary_image_widget(image_ids[0], style="classic", width=1000)
|
| common.get_mapillary_image_widget(image_ids[0], style="split", width=1000)
|
| common.get_mapillary_image_widget(image_ids[0], style="photo", width=1000)
|
| m = leafmap.Map(style="bright", center=[-73.99941, 40.71194], zoom=13)
m.add_basemap("Satellite")
m.add_mapillary(minzoom=6, maxzoom=14, add_popup=True)
m.add_layer_control()
widget = m.create_mapillary_widget(style="photo", width=500)
widget
|
