MapMarker represents a specific location or point of interest on a map.
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>
);
}
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);
});
The accessibility label of the marker.
The block size of the icon. This property is only used when the `icon` property is set.
Set to `true` to allow grouping the marker in clusters when zoomed out.
The URL of the icon to use for the marker.
The inline size of the icon. This property is only used when the `icon` property is set.
The latitude of the marker.
The longitude of the marker.
Callback that is run when the marker is pressed.
An overlay component to render when the user interacts with the component.