import type { LatLng } from '../../types/location'; export interface LeafletMapMarker { lat: number; lng: number; title?: string; type?: 'origin' | 'destination' | 'pickup' | 'default'; } export interface LeafletMapPolyline { points: LatLng[]; color?: string; weight?: number; } export interface LeafletMapOptions { centerLat: number; centerLng: number; zoom?: number; markers?: LeafletMapMarker[]; polylines?: LeafletMapPolyline[]; showCurrentLocation?: boolean; interactive?: boolean; showRoute?: boolean; } /** * Returns a self-contained HTML string that renders a Leaflet.js map * inside a WebView. Includes CDN links for Leaflet CSS / JS and * communicates with the parent via `window.ReactNativeWebView.postMessage`. */ export function getLeafletMapHtml(options: LeafletMapOptions): string { const { centerLat, centerLng, zoom = 14, markers = [], polylines = [], showCurrentLocation = false, interactive = true, } = options; const markersJson = JSON.stringify(markers); const polylinesJson = JSON.stringify(polylines); return `
`; }