Skip to main content

Map

Rocket 2.0

The Map component plots rows with coordinates as pins on a map, such as delivery stops, store locations or field visits. It can also draw route lines, zones and a heat layer, and let the user pick a location or search for an address.

Properties​

Property
Description
Expected Value
Data (rows with coordinates)Rows to plot. Each row needs a latitude and a longitude; rows without valid coordinates are skipped and counted in a note.Array
Latitude fieldField in each row that holds the latitude.Text. Default: lat
Longitude fieldField in each row that holds the longitude.Text. Default: lng
Title fieldField shown as the pin's title in its tooltip and popup.Text. Default: name
Second line fieldField shown as a second line under the title in the popup.Text. Default: address
Status field (pin colour, toned by its words)Field whose value colors the pin. Common words such as Delivered or Delayed get a matching tone, and the legend lists each status.Text. Default: status
Status colours ({ Open: "#2563eb" } or tone names)A color or tone name for each status value, for example { "Open": "#2563eb" }. Overrides the automatic tone.Object
Id fieldField that identifies each row. Select marker looks pins up by this value, and it fills selectedMarkerId.Text. Default: id
Pin label field (a stop number, a price)Field shown as short text inside the pin, such as a stop number or a price.Text
Pin icon field (a lucide icon name)Field that holds a Lucide icon name to show inside each pin.Text
Icon for every pin (a lucide icon name)A Lucide icon shown inside every pin that has no icon of its own.Text
Heading field (degrees, 0 is north; turns the icon)Field with a direction in degrees, where 0 is north. Rotates the pin's icon, for example to show which way a vehicle is heading.Text
Marker image field (an image URL in place of the pin)Field with an image URL to show in place of the pin, such as a photo or a logo.Text
Marker sizeSize of the pins.small, medium, large. Default: medium
Popup fields (comma list; 'eta:ETA {}', 'total|currency')Comma-separated fields to list in the popup. Add a label after a colon (eta:ETA {}, where {} marks the value) or a format after a pipe (total|currency).Text. Default: eta:ETA {}, driver
Currency (ISO code, e.g. USD)Currency code used for popup fields formatted as currency, such as USD or EUR.Text. Default: USD
LocaleLocale used to format numbers, currency and dates in the popup, such as en-US. Leave empty to follow the currency.Text
Show a popup on marker clickOpens a popup with the row's details when the user clicks a pin.On or off. Default: On
Show a legend of the coloursShows a legend of the status, route and area colors in the corner of the map.On or off. Default: On
Group nearby markersGroups pins that sit close together into a single count. Clicking a group zooms in on it.On or off. Default: On
Connect the markers as routesDraws lines through the pins in order, one line for each value of Route field.On or off. Default: Off
Route field (one line per value)Field that splits connected pins into separate routes, such as a driver or a vehicle. Leave empty for one line through every pin.Text
Route order fieldField that sets the order of the pins along each route, such as a stop number.Text
Routes start at ({ lat, lng })A point { lat, lng } where every connected route begins, such as a depot.Text
Route lines (rows with a path)Extra lines to draw, one row per line. Each row has a name and a path of points, and can set a color or a status.Array
Route colours ({ "Van 1": "#4f46e5" })A color for each route name, for example { "Van 1": "#4f46e5" }.Object
Areas (zones, territories, geofences)Zones to shade on the map, such as territories or geofences. Each row has an outline of points, or a lat, lng and radius for a circle.Array
Area outline fieldField in each area row that holds its outline as a list of points or GeoJSON.Text. Default: outline
Area title fieldField shown as the area's label.Text. Default: name
Area status field (fill colour)Field whose value sets the area's fill color, the same way Status field colors pins.Text. Default: status
Area radius field (metres, with lat and lng)Field with a radius in meters. An area row with lat, lng and a radius is drawn as a circle.Text. Default: radius
ShowWhat to draw for the rows: pins, a heat layer showing where rows are dense, or both.markers, heat, both. Default: markers
Heat weight field (empty: each row counts once)Field that weights each row in the heat layer, such as an order count. Leave empty to count each row once.Text
Heat radius (px)Size in pixels of each point's glow in the heat layer.Number. Default: 28
Let the user pick a locationLets the user drop a pin by clicking the map and drag it to adjust. The chosen point fills pickedLocation, with its address when one is found.On or off. Default: Off
Picked location to start with ({ lat, lng })A point { lat, lng } to place the picked pin at when the map opens.Text
Show an address search boxShows a search box where the user can look up an address and jump to it. With Let the user pick a location on, choosing a result also picks it.On or off. Default: Off
Search placeholderHint text shown in the empty search box.Text. Default: Search for an address
Geocoder URL ({query}; empty for OpenStreetMap Nominatim)Address search service to use, with {query} where the search text goes. Leave empty to use OpenStreetMap, which searches when the user presses Enter.Text
Reverse geocoder URL ({lat}, {lng})Service used to find the address of a picked point, with {lat} and {lng} in the URL. Leave empty to use OpenStreetMap.Text
Fit the view to what is drawnZooms and pans so every pin, route and area is in view whenever the data changes.On or off. Default: On
Default center ({ lat, lng })A point { lat, lng } to center on when the view isn't fitted to the data.Text
Default zoom (1 to 18)Zoom level to use with Default center, from 1 (the whole world) to 18 (street level).Number. Default: 12
Map styleLook of the base map.Streets, Satellite, Light, Dark. Default: Streets
Show a Map | Satellite switchShows a Map and Satellite switch on the map so the user can change the style.On or off. Default: Off
Show a fullscreen buttonShows a button that expands the map to full screen.On or off. Default: On
Zoom with the mouse wheelZooms the map with the mouse wheel. When off, the page scrolls past the map and the user holds Ctrl or Cmd to zoom.On or off. Default: Off
Empty textMessage shown when there is nothing to plot.Text. Default: No locations to show
Tile URL (empty for the default basemap)URL template of a custom tile server for the base map. Leave empty for the default map.Text
Tile attributionCredit text shown in the corner for the custom tiles.Text

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On marker clickTriggers when the user clicks a pin.
On map clickedTriggers when the user clicks an empty spot on the map.
On shape clickedTriggers when the user clicks a route line or an area.
On location pickedTriggers when the user picks a location by clicking the map, dragging the pin or choosing a search result.
On bounds changeTriggers when the user pans or zooms the map.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set centerMoves the map to the given Latitude and Longitude, and to Zoom when one is given.components.map1.setCenter("{{37.7749}}", "{{-122.4194}}", "")
Set zoomSets the map's zoom level.components.map1.setZoom("{{14}}")
Fit to markersZooms and pans so every pin, route and area is in view.components.map1.fitBounds()
Select markerSelects the pin whose id matches Marker id, brings it into view and opens its popup.components.map1.selectMarker("")
Clear selectionClears the selected pin, route or area and closes the popup.components.map1.clearSelection()
Set picked locationPlaces the picked pin at the given Latitude and Longitude without firing On location picked.components.map1.setPickedLocation("{{37.7749}}", "{{-122.4194}}")
Clear picked locationRemoves the picked pin and clears pickedLocation.components.map1.clearPickedLocation()
Set map styleChanges the base map style to streets, satellite, light or dark.components.map1.setMapStyle("satellite")
Set visibilityShows the component when true, hides it when false.components.map1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.map1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.map1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataRows to plot. Each row needs a latitude and a longitude; rows without valid coordinates are skipped and counted in a note.{{components.map1.data}}
latFieldField in each row that holds the latitude.{{components.map1.latField}}
lngFieldField in each row that holds the longitude.{{components.map1.lngField}}
titleFieldField shown as the pin's title in its tooltip and popup.{{components.map1.titleField}}
subtitleFieldField shown as a second line under the title in the popup.{{components.map1.subtitleField}}
statusFieldField whose value colors the pin. Common words such as Delivered or Delayed get a matching tone, and the legend lists each status.{{components.map1.statusField}}
statusColorsA color or tone name for each status value, for example { "Open": "#2563eb" }. Overrides the automatic tone.{{components.map1.statusColors}}
idFieldField that identifies each row. Select marker looks pins up by this value, and it fills selectedMarkerId.{{components.map1.idField}}
labelFieldField shown as short text inside the pin, such as a stop number or a price.{{components.map1.labelField}}
iconFieldField that holds a Lucide icon name to show inside each pin.{{components.map1.iconField}}
markerIconA Lucide icon shown inside every pin that has no icon of its own.{{components.map1.markerIcon}}
headingFieldField with a direction in degrees, where 0 is north. Rotates the pin's icon, for example to show which way a vehicle is heading.{{components.map1.headingField}}
imageFieldField with an image URL to show in place of the pin, such as a photo or a logo.{{components.map1.imageField}}
markerSizeSize of the pins.{{components.map1.markerSize}}
popupFieldsComma-separated fields to list in the popup. Add a label after a colon (eta:ETA {}, where {} marks the value) or a format after a pipe (total|currency).{{components.map1.popupFields}}
currencyCurrency code used for popup fields formatted as currency, such as USD or EUR.{{components.map1.currency}}
localeLocale used to format numbers, currency and dates in the popup, such as en-US. Leave empty to follow the currency.{{components.map1.locale}}
showPopupOpens a popup with the row's details when the user clicks a pin.{{components.map1.showPopup}}
showLegendShows a legend of the status, route and area colors in the corner of the map.{{components.map1.showLegend}}
clusterMarkersGroups pins that sit close together into a single count. Clicking a group zooms in on it.{{components.map1.clusterMarkers}}
connectMarkersDraws lines through the pins in order, one line for each value of Route field.{{components.map1.connectMarkers}}
routeFieldField that splits connected pins into separate routes, such as a driver or a vehicle. Leave empty for one line through every pin.{{components.map1.routeField}}
routeOrderFieldField that sets the order of the pins along each route, such as a stop number.{{components.map1.routeOrderField}}
routeStartA point { lat, lng } where every connected route begins, such as a depot.{{components.map1.routeStart}}
routesExtra lines to draw, one row per line. Each row has a name and a path of points, and can set a color or a status.{{components.map1.routes}}
routeColorsA color for each route name, for example { "Van 1": "#4f46e5" }.{{components.map1.routeColors}}
areasZones to shade on the map, such as territories or geofences. Each row has an outline of points, or a lat, lng and radius for a circle.{{components.map1.areas}}
areaShapeFieldField in each area row that holds its outline as a list of points or GeoJSON.{{components.map1.areaShapeField}}
areaTitleFieldField shown as the area's label.{{components.map1.areaTitleField}}
areaStatusFieldField whose value sets the area's fill color, the same way Status field colors pins.{{components.map1.areaStatusField}}
areaRadiusFieldField with a radius in meters. An area row with lat, lng and a radius is drawn as a circle.{{components.map1.areaRadiusField}}
displayWhat to draw for the rows: pins, a heat layer showing where rows are dense, or both.{{components.map1.display}}
heatFieldField that weights each row in the heat layer, such as an order count. Leave empty to count each row once.{{components.map1.heatField}}
heatRadiusSize in pixels of each point's glow in the heat layer.{{components.map1.heatRadius}}
pickLocationLets the user drop a pin by clicking the map and drag it to adjust. The chosen point fills pickedLocation, with its address when one is found.{{components.map1.pickLocation}}
defaultPickedLocationA point { lat, lng } to place the picked pin at when the map opens.{{components.map1.defaultPickedLocation}}
showSearchShows a search box where the user can look up an address and jump to it. With Let the user pick a location on, choosing a result also picks it.{{components.map1.showSearch}}
searchPlaceholderHint text shown in the empty search box.{{components.map1.searchPlaceholder}}
geocoderUrlAddress search service to use, with {query} where the search text goes. Leave empty to use OpenStreetMap, which searches when the user presses Enter.{{components.map1.geocoderUrl}}
reverseGeocoderUrlService used to find the address of a picked point, with {lat} and {lng} in the URL. Leave empty to use OpenStreetMap.{{components.map1.reverseGeocoderUrl}}
fitToMarkersZooms and pans so every pin, route and area is in view whenever the data changes.{{components.map1.fitToMarkers}}
defaultCenterA point { lat, lng } to center on when the view isn't fitted to the data.{{components.map1.defaultCenter}}
defaultZoomZoom level to use with Default center, from 1 (the whole world) to 18 (street level).{{components.map1.defaultZoom}}
mapStyleLook of the base map.{{components.map1.mapStyle}}
showStyleSwitchShows a Map and Satellite switch on the map so the user can change the style.{{components.map1.showStyleSwitch}}
showFullscreenShows a button that expands the map to full screen.{{components.map1.showFullscreen}}
scrollWheelZoomZooms the map with the mouse wheel. When off, the page scrolls past the map and the user holds Ctrl or Cmd to zoom.{{components.map1.scrollWheelZoom}}
emptyTextMessage shown when there is nothing to plot.{{components.map1.emptyText}}
tileUrlURL template of a custom tile server for the base map. Leave empty for the default map.{{components.map1.tileUrl}}
tileAttributionCredit text shown in the corner for the custom tiles.{{components.map1.tileAttribution}}
selectedMarkerThe row of the selected pin, or an empty object when none is selected.{{components.map1.selectedMarker}}
selectedMarkerIdThe id of the selected pin, from Id field.{{components.map1.selectedMarkerId}}
selectedShapeThe row of the route or area the user clicked last.{{components.map1.selectedShape}}
selectedShapeTypeWhether the selected shape is a route or an area.{{components.map1.selectedShapeType}}
clickedLocationThe lat and lng of the last spot the user clicked on the map.{{components.map1.clickedLocation}}
pickedLocationThe picked point's lat and lng, and its address once it is found.{{components.map1.pickedLocation}}
centerThe lat and lng at the center of the current view.{{components.map1.center}}
zoomThe current zoom level.{{components.map1.zoom}}
boundsThe edges of the current view: north, south, east and west, plus northEast and southWest points.{{components.map1.bounds}}
isVisibleWhether the component is visible.{{components.map1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.map1.isLoading}}
isDisabledWhether the component is disabled.{{components.map1.isDisabled}}

Styles​

Style
Default
Background (behind the tiles)Theme: Surface 3
Border colorTheme: Default border
Accent (pins without a status, the selection)Theme: Brand primary
Group count colorTheme: Primary text
Radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.