The Mapbox Map component for Retool Apps
A content area to embed a map with custom locations.
An embedded map using MapBox to display latitude and longitude coordinates as points of interest. It supports custom markers using Emoji and symbols, default coordinates and zoom level, and GeoJSON to render custom shapes for highlighting locations.
Mapbox Map can trigger queries when panning or zooming the map, and on hover start or end for points.
Refer to the Mapbox guide for more information about using this component.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
fitBoundsToGeoJson
Whether to fit the map bounds to the GeoJSON data.
Type | boolean | ||||
Mutability |
|
geoJson
GeoJSON objects to display on the map, such as polygons.
Type | object | ||||
Mutability |
|
geoJsonLayerStyle
Mapbox GeoJSON layer styles that override any other applied styling.
Type | object | ||||
Mutability |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
latitude
The latitudinal position.
Type | number | ||||||
Mutability |
|
latitudeColumnName
The key for latitude values if different from latitude
.
Type | string | ||||
Mutability |
|
longitude
The longitudinal position.
Type | number | ||||||
Mutability |
|
longitudeColumnName
The key for longitude values if different from longitude
.
Type | string | ||||
Mutability |
|
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
onPointHoveredOver
The event handler to run when a point is hovered over.
Type | string |
Mutability | Read-only |
onPointHoveredOverEnd
The event handler to run when a point is no longer hovered over.
Type | string |
Mutability | Read-only |
points
A list of map points to display.
Type | array | ||||
Array values | object | ||||
Mutability |
|
Array Object Properties
showCurrentLngLat
Whether to show the latitude and longitude coordinates.
Type | boolean | ||||
Mutability |
|
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
style
Custom style options.
Type | object | ||||
Mutability |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
mapboxMap.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
mapboxMap.scrollIntoView(options)
Parameters
Examples
mapboxMap.selectPoint(latitude, longitude)
Parameters
mapboxMap.setMapCenter(options)
Parameters
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
On Point Hovered Over | A point of interest is hovered over. |
On Point Hovered Over End | A point of interest is no longer hovered over. |
On Point Selected | A point of interest is selected. |
On Viewport Change | The viewport is changed. |