import { Itinerary, TravelMode } from "@wemap/routers"; import { CameraRef, MapView, MapViewRef, UserLocationRef, Location } from "@maplibre/maplibre-react-native"; /** * Props for the WemapMapView component, extending MapLibre's MapView props */ export type MapViewProps = React.ComponentProps & { /** * Unique identifier for the map */ emmid: number; /** * Callback fired when all map refs (mapView, camera, userLocation) are ready * @param refs Object containing the map view references */ onRefsReady?: (refs: WemapMapViewRef) => void; /** * Callback fired when the user's location is updated * @param location The updated user location */ onUserLocationUpdate?: (location: Location) => void; /** * Callback fired when the visible POIs in the map viewport change * @param pois Array of POIs currently visible in the viewport */ onPOIsUpdate?: (pois: POI[]) => void; /** * Callback fired when a POI is opened/selected * @param poi The POI that was opened */ onPOIOpen?: (poi: POI) => void; }; /** * References to the core map components used by MapView */ export interface WemapMapViewRef { /** * Reference to the MapLibre MapView component, providing access to map methods */ mapView: MapViewRef; /** * Reference to the MapLibre camera */ camera: CameraRef; /** * Reference to the user location component, providing access to location tracking */ userLocation: UserLocationRef; } /** * @hidden */ export interface MultiRouterRequest { origin: Coords; destination: Coords; travelMode: TravelMode; mapId?: number; } /** * @hidden */ export interface MultiRouterResponse { itineraries: Array[0]>; } export interface Coords { lat: number; lng: number; } export interface PolylineOptions { color?: string; opacity?: number; width?: number; id?: string; } export interface Polyline { coordinates: Coords[]; options: PolylineOptions; id: string; } export interface POI { id: number; name: string; description: string; latitude: number; longitude: number; category: number; tags: string[]; image_url: string; phone: string | null; link_url: string | null; created: string; updated: string; author: { name: string; photo_url: string; }; state: number; status: number; like_count: number; external_data: Record | null; extra_media_urls: string[]; level: number | null; altitude: number | null; address: string; country: string | null; media_credits: string | null; media_thumbnail_url: string | null; media_type: string | null; media_url: string | null; timezone: string; type: number; user: number; } /** * @hidden */ export interface MapParameters { author: { name: string; photo_url: string; }; contribution_list: null; count: number; description: string; external_id: null; height: string; id: number; is_empty: boolean; is_template: boolean; introcard_background_url: string; introcard_avatar_url: string; landing_area: number; language: string; latitude: number; latitude_delta: number; longitude: number; longitude_delta: number; preview_url: string; name: string; snippet: Record & { maxzoom: number; minzoom: number; tilesstyle: string; }; snippet_version: number; tags: string[]; user: number; updated: string; width: string; };