Minimap is a custom HTML element providing 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 elements, functions, and types related to Minimap in the Mapbox Search JS Web framework.
MapboxAddressMinimap, also available as the element <mapbox-address-minimap>,
is a 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 MapboxAddressMinimap is to reduce delivery or geolocation error in shipping and
local dispatching contexts.
MapboxAddressMinimap expands to fill its container, and is hidden unless
MapboxAddressMinimap#feature is truthy. Setting MapboxAddressMinimap#feature
to null hides the component.
new MapboxAddressMinimap()
const minimap = new MapboxAddressMinimap();
containerElement.appendChild(minimap);
minimap.feature = {
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [-122.4194, 37.7749]
},
properties: {}
};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 MapboxAddressMinimap#onSaveMarkerLocation callback.
If true, the map when panned moves around the marker, keeping the marker
centered. Defaults to false.
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.
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.
minimap.accessToken = 'pk.my-mapbox-access-token';A GeoJSON Feature representing a Point geometry.
The minimap is hidden unless
MapboxAddressMinimap#feature is truthy. Setting MapboxAddressMinimap#feature
to null hides the component.
Custom adjust button text appearing on the map. 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.
Custom cancel button text appearing on the map, when marker adjustment is enabled. If not provided, the default text will be used.
The map style to use, either 'default' or 'satellite'. The default map
style is configurable with MapboxAddressMinimap#defaultMapStyle.
"default" | "satellite")Hide the minimap.
Valid strings for setting markerAnchor on MapboxAddressMinimap
"center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top" | "bottom" | "left" | "right")