const 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 data={...} keyExtractor={...} coordinates={...} renderAnnotation={...} />
</MapView>
);
}
The main map view component that displays a MapLayr map.