Map Marker
MapMarker represents a specific location or point of interest on a map.
Anchor to mapmarkerpropsMapMarkerProps
- Anchor to accessibilityLabelaccessibilityLabelstringrequired
The accessibility label of the marker.
- Anchor to latitudelatitudenumberrequired
The latitude of the marker.
- Anchor to longitudelongitudenumberrequired
The longitude of the marker.
- Anchor to blockSizeblockSizenumber
The block size of the icon. This property is only used when the
icon
property is set.- Anchor to clusterableclusterableboolean
Set to
true
to allow grouping the marker in clusters when zoomed out.- Anchor to iconiconstring
The URL of the icon to use for the marker.
- Anchor to inlineSizeinlineSizenumber
The inline size of the icon. This property is only used when the
icon
property is set.- Anchor to onPressonPress() => void
Callback that is run when the marker is pressed.
- Anchor to overlayoverlayRemoteFragment
An overlay component to render when the user interacts with the component.
Basic MapMarker
Examples
Basic MapMarker
React
import { reactExtension, Map, MapMarker, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => <Extension />, ); function Extension() { return ( <Map apiKey="YOUR_GOOGLE_MAPS_API_KEY" latitude={-28.024} longitude={140.887} zoom={4} accessibilityLabel="Map" > <MapMarker latitude={-28.024} longitude={140.887} accessibilityLabel="Map marker for Innamincka, Australia" /> </Map> ); }
JS
import {extension, Map, MapMarker} from '@shopify/ui-extensions/checkout'; export default extension('purchase.checkout.block.render', (root) => { const map = root.createComponent( Map, { apiKey: 'YOUR_API_KEY', accessibilityLabel: 'Map', latitude: -28.024, longitude: 140.887, zoom: 4, }, [ root.createComponent(MapMarker, { latitude: -28.024, longitude: 140.887, accessibilityLabel: 'Map marker for Innamincka, Australia', }), ], ); root.appendChild(map); });
Preview

Anchor to best-practicesBest Practices
If your markers are interactive, make sure that the selected marker's icon is different from the rest of the non-selected markers.
If there are a large number of markers obscuring important features of the map, set the markers to clusterable to help increase the readability of the map.