Constconst mapLoadResult = useMap("your-map-id");
const mapViewRef = useRef<MapViewHandle>(null);
if (mapLoadResult.status === "success") {
return (
<MapView ref={mapViewRef} style={styles.map} map={mapLoadResult.map}>
<UserLocationMarker />
<CoordinateAnnotationLayer>
<LabeledAnnotationIcon coordinates={...} />
</CoordinateAnnotationLayer>
</MapView>
);
}
The main map view component that displays a MapLayr map.