I am rendering a map using mapbox API and would like to enrich the map by displaying additional location info.
Here’s a similar example: Toronto-Fatal-Collisions-Analysis/collision.py at master · patelnisarg61/Toronto-Fatal-Collisions-Analysis · GitHub
mock code below:
MAPBOX_KEY = "xxxxx"
data = []
data.append({
"type": "scattermapbox",
"lat": df["Lat"],
"lon": df["Long"],
"name": "Location",
"hovertext": name,
"showlegend": False,
"hoverinfo": "text",
"mode": "markers",
"clickmode": "event+select",
"marker": {
"symbol": "circle",
"size": 12,
"opacity": 0.7,
"color": "black"
}
}
)
layout = {
"autosize": True,
"hovermode": "closest",
"mapbox": {
"accesstoken": MAPBOX_KEY,
"bearing": 0,
"center": {
"lat": layout_lat,
"lon": layout_lon
},
"pitch": 0,
"zoom": zoom,
"style": "outdoors",
},
"margin": {
"r": 0,
"t": 0,
"l": 0,
"b": 0,
"pad": 0
}
}
How do I add additional location data such as POIs, transit, hospitals, schools and grocery stores using either native mapbox API endpoints or data from other providers?
For reference, this data is available via the OSM Feed: Mapbox Streets v8 | Vector tiles | Mapbox
Plotly scattermapbox docs: Single-Page Reference | Python | Plotly