import React from "react"; import Maplibre from "@maplibre/maplibre-react-native"; import env from "~/env"; import { Alignments } from "./constants"; import { useColorScheme } from "~/theme"; import { useParamsState, paramsActions } from "~/stores"; export default function MapView({ mapRef, children, contentInset = Alignments.Center, compassViewPosition, compassViewMargin, ...mapViewProps }) { const colorScheme = useColorScheme(); const { mapColorScheme } = useParamsState(["mapColorScheme"]); const scheme = mapColorScheme === "auto" ? colorScheme : mapColorScheme; const mapStyleUrl = scheme === "dark" ? env.MAPVIEW_DARK_STYLE_URL : env.MAPVIEW_STYLE_URL; return ( (mapRef.current = ref)} regionDidChangeDebounceTime={300} regionWillChangeDebounceTime={300} followHeading={compassViewPosition} {...mapViewProps} > {children} ); } const styles = { mapView: { flex: 1, }, };