Skip to main content

Minimap

Minimap provides a UI that allows users confirm a physical location on a map, reducing delivery errors in both shipping and local dispatching contexts.

This page includes reference documentation for Minimap components and types in the Mapbox Search JS React framework.

Components

AddressMinimap

AddressMinimap is a React component that displays a marker for confirmation purposes.

Optionally, this marker is editable. When editable, the marker can be moved around the map and the updated location is sent back to the Mapbox Contribute workflow.

The goal of AddressMinimap is to reduce delivery or geolocation error in shipping and local dispatching contexts.

AddressMinimap expands to fill its container, and is hidden unless AddressMinimapProps#feature and AddressMinimapProps#show are truthy.

Internally, this wraps the <mapbox-address-minimap> element.

new AddressMinimap(canAdjustMarker: boolean, keepMarkerCentered: boolean, markerAnchor: Anchor, onSaveMarkerLocation: function (coordinate: [number, number]): void, show: boolean, accessToken: string, feature: GeoJSON.Feature<GeoJSON.Point>, satelliteToggle: boolean, theme: Theme, mapStyleMode: MapStyleMode, defaultMapStyle: [string, string], footer: (boolean | string), adjustBtnText: string, cancelBtnText: string, saveBtnText: string)

Props

NameDescription
If true , the marker can be moved around the map. Defaults to false .

When editable, the marker can be moved around the map and the updated location can be referenced from the AddressMinimapProps#onSaveMarkerLocation callback.

If true , the map when panned moves around the marker, keeping the marker centered. Defaults to false .
The anchor of the marker, relative to center of the expanded size. Defaults to 'bottom' .

onSaveMarkerLocation

function (coordinate: [number, number]): void
A client-defined callback that is triggered when the "Save" button is clicked in the editing interface, and gives access to the adjusted marker coordinate.
Must be true for the minimap to be shown, in addition to AddressMinimapProps#feature being present.
The Mapbox access token to use for all requests.

If not explicitly set on the component, this will reference the value in the global config object.

feature

GeoJSON.Feature<GeoJSON.Point>
A GeoJSON Feature representing a Point geometry.

The minimap is hidden unless AddressMinimapProps#feature is truthy.

If true , the map will have an image toggle between Map and Satellite styles.
The Theme to use for styling interface buttons.

mapStyleMode

MapStyleMode
The map style to use, either 'default' or 'satellite' . The default map style is configurable with AddressMinimapProps#defaultMapStyle .
The map style to use for the default map style. Defaults to ['mapbox', 'streets-v11'] .
Custom footer text appearing below the map, when marker adjustment is enabled. If true or left undefined, the default footer text will be used. If false , the footer will not be shown.
Custom adjust button text appearing on the map. If not provided, the default text will be used.
Custom cancel button text appearing on the map, when marker adjustment is enabled. If not provided, the default text will be used.
Custom save button text appearing on the map, when marker adjustment is enabled. If not provided, the default text will be used.

Example

export function Component() {
return (
<AddressMinimap accessToken={'YOUR_MAPBOX_ACCESS_TOKEN'}>
</AddressMinimap>
);
}
Was this section on AddressMinimap helpful?
Was this page helpful?