import React, { FC } from "react"; import { Image, StyleSheet, View, Platform } from "react-native"; import { Marker } from "react-native-maps"; import { useNavigation } from "@react-navigation/native"; import { useStationList } from "@/stateBox/useStationList"; import { StationProps } from "@/lib/CommonTypes"; type Props = { index: number; indexBase: number; latlng: string[]; D: StationProps; d: string; navigate: (screen: string) => void; webview: React.RefObject; }; export const MapPin: FC = (props) => { const { index, indexBase, latlng, D, d, navigate, webview } = props; const { goBack } = useNavigation(); const { getInjectJavascriptAddress } = useStationList(); return ( { const address = getInjectJavascriptAddress(D.StationNumber); if (!address) return; webview.current?.injectJavaScript(address); if (navigate) goBack(); }} > ); }; const MAP_PIN_SIZE = Platform.OS === "android" ? 32 : 36; const styles = StyleSheet.create({ markerWrap: { width: MAP_PIN_SIZE, height: MAP_PIN_SIZE, alignItems: "center", justifyContent: "center", }, markerImage: { width: MAP_PIN_SIZE, height: MAP_PIN_SIZE, }, });