Embed
Mapbox
A component to embed a Mapbox map. It can be used to display a map with markers.
For this component you need Mapbox access token: https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes
Fields
Name | Type | Description | Options |
---|---|---|---|
Access Token | Text | Access token from Mapbox | |
Map style | Text | Map style URL | |
Zoom | Number | ||
Latitude | Number | ||
Longitude | Number | ||
Markers | Object | ||
Controls visible | Text | Show map controls |
|
Custom CSS classes | Text | CSS classes, separated by spaces. You can define classes in custom stylesheets. |
Events
Low code usage
This component can be declared directly in Python, using backend-driven UI.
ui.Mapbox(content={
"accessToken": "", # str
"mapStyle": "", # str
"zoom": 0.0, # Union[float, str]
"lat": 0.0, # Union[float, str]
"lng": 0.0, # Union[float, str]
"markers": {}, # Union[Dict, str]
"controls": "yes", # str [yes, no]
"cssClasses": "", # str
},
handlers={
"mapbox-marker-click": handle_event,
"mapbox-click": handle_event,
}
)
A function, in this example handle_event
, should be implemented in your code to handle events.
def handle_event(state, payload, context, ui):
pass