全駅地図表示に対応
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { FC } from "react";
|
||||
import { Marker } from "react-native-maps";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { useStationList } from "@/stateBox/useStationList";
|
||||
type Props = {
|
||||
index: number;
|
||||
indexBase: number;
|
||||
@@ -13,7 +14,8 @@ type Props = {
|
||||
|
||||
export const MapPin: FC<Props> = (props) => {
|
||||
const { index, indexBase, latlng, D, d, navigate, webview } = props;
|
||||
const {goBack} = useNavigation();
|
||||
const { goBack } = useNavigation();
|
||||
const { getInjectJavascriptAddress } = useStationList();
|
||||
return (
|
||||
<Marker
|
||||
key={index + indexBase}
|
||||
@@ -22,10 +24,9 @@ export const MapPin: FC<Props> = (props) => {
|
||||
longitude: parseFloat(latlng[1]),
|
||||
}}
|
||||
onPress={() => {
|
||||
webview.current?.injectJavaScript(
|
||||
`MoveDisplayStation('${d}_${D.MyStation}_${D.Station_JP}');
|
||||
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`
|
||||
);
|
||||
const address = getInjectJavascriptAddress(D.StationNumber);
|
||||
if (!address) return;
|
||||
webview.current?.injectJavaScript(address);
|
||||
if (navigate) goBack();
|
||||
}}
|
||||
image={require("../../assets/reccha-small.png")}
|
||||
|
Reference in New Issue
Block a user