調整
This commit is contained in:
parent
e04cfb9a8b
commit
1a1e9c417b
@ -9,6 +9,7 @@ import {
|
|||||||
import ActionSheet, { SheetManager } from "react-native-actions-sheet";
|
import ActionSheet, { SheetManager } from "react-native-actions-sheet";
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||||
|
import { useCurrentTrain } from "../../stateBox/useCurrentTrain";
|
||||||
import lineColorList from "../../assets/originData/lineColorList";
|
import lineColorList from "../../assets/originData/lineColorList";
|
||||||
import { stationIDPair } from "../../lib/getStationList2";
|
import { stationIDPair } from "../../lib/getStationList2";
|
||||||
import { lineListPair } from "../../lib/getStationList";
|
import { lineListPair } from "../../lib/getStationList";
|
||||||
@ -19,6 +20,7 @@ export const TrainMenuLineSelector = () => {
|
|||||||
setSelectedLine,
|
setSelectedLine,
|
||||||
mapsStationData: stationData,
|
mapsStationData: stationData,
|
||||||
} = useTrainMenu();
|
} = useTrainMenu();
|
||||||
|
const { webview } = useCurrentTrain();
|
||||||
const actionSheetRef = useRef(null);
|
const actionSheetRef = useRef(null);
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const platformIs = Platform.OS == "android";
|
const platformIs = Platform.OS == "android";
|
||||||
@ -52,7 +54,25 @@ export const TrainMenuLineSelector = () => {
|
|||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
SheetManager.hide("TrainMenuLineSelector");
|
SheetManager.hide("TrainMenuLineSelector");
|
||||||
setSelectedLine(selectedLine == d ? undefined : d);
|
const s = selectedLine == d ? undefined : d;
|
||||||
|
if(!s) return;
|
||||||
|
setSelectedLine(s);
|
||||||
|
Object.keys(stationData).forEach((data, indexBase) => {
|
||||||
|
stationData[data].forEach((D, index) => {
|
||||||
|
if (!D.StationMap) return null;
|
||||||
|
if (s && s != data) return;
|
||||||
|
const latlng = D.StationMap.replace(
|
||||||
|
"https://www.google.co.jp/maps/place/",
|
||||||
|
""
|
||||||
|
).split(",");
|
||||||
|
if (latlng.length == 0) return null;
|
||||||
|
if (index == 0 ) {
|
||||||
|
webview.current
|
||||||
|
?.injectJavaScript(`MoveDisplayStation('${data}_${D.MyStation}_${D.Station_JP}');
|
||||||
|
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
|
@ -147,6 +147,7 @@ export default function TrainMenu({ style }) {
|
|||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
const s = selectedLine == d ? undefined : d;
|
const s = selectedLine == d ? undefined : d;
|
||||||
|
if(!s) return;
|
||||||
setSelectedLine(s);
|
setSelectedLine(s);
|
||||||
Object.keys(stationData).forEach((data, indexBase) => {
|
Object.keys(stationData).forEach((data, indexBase) => {
|
||||||
stationData[data].forEach((D, index) => {
|
stationData[data].forEach((D, index) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user