diff --git a/assets/四国旅客鉄道徳島線.json b/assets/四国旅客鉄道徳島線.json index fa19f06..92e5e7a 100644 --- a/assets/四国旅客鉄道徳島線.json +++ b/assets/四国旅客鉄道徳島線.json @@ -1,6 +1,29 @@ { "type": "FeatureCollection", "features": [ + { + "properties": { + "name": "阿波池田", + "uri": "https://uedayou.net/jrslod/四国旅客鉄道/土讃線/阿波池田", + "color": "E25885" + }, + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [133.80429, 34.02714], + [133.80515, 34.02656] + ] + } + }, + { + "properties": { + "name": "阿波池田", + "uri": "https://uedayou.net/jrslod/四国旅客鉄道/土讃線/阿波池田" + }, + "type": "Feature", + "geometry": { "type": "Point", "coordinates": [133.80429, 34.02714] } + }, { "properties": { "name": "佃", @@ -561,6 +584,29 @@ "type": "Feature", "geometry": { "type": "Point", "coordinates": [134.53819, 34.08082] } }, + { + "properties": { + "name": "徳島", + "uri": "https://uedayou.net/jrslod/四国旅客鉄道/高徳線/徳島", + "color": "9ACD32" + }, + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [134.55251, 34.07404], + [134.55049, 34.07498] + ] + } + }, + { + "properties": { + "name": "徳島", + "uri": "https://uedayou.net/jrslod/四国旅客鉄道/高徳線/徳島" + }, + "type": "Feature", + "geometry": { "type": "Point", "coordinates": [134.55251, 34.07404] } + }, { "properties": { "name": "徳島線", diff --git a/components/Apps/WebView.jsx b/components/Apps/WebView.jsx index 13d0e13..9cd2c11 100644 --- a/components/Apps/WebView.jsx +++ b/components/Apps/WebView.jsx @@ -139,7 +139,7 @@ export const AppsWebView = ({ openStationACFromEachTrainInfo }) => { if (favoriteStation.length < 1) return () => {}; const string = getInjectJavascriptAddress(favoriteStation[0][0].StationNumber); if (!string) return () => {}; - webview.current?.injectJavaScript(string); + webview?.current.injectJavaScript(string); once = true; }; diff --git a/components/trainMenu.js b/components/trainMenu.js index 746084f..80687a3 100644 --- a/components/trainMenu.js +++ b/components/trainMenu.js @@ -24,7 +24,7 @@ export default function TrainMenu({ style }) { const { originalStationList } = useStationList(); useEffect(() => { const stationPinData = []; - Object.keys(originalStationList).forEach((d, indexBase) => { + Object.keys(lineList_LineWebID).forEach((d, indexBase) => { originalStationList[d].forEach((D, index) => { if (selectedLine && selectedLine != lineList_LineWebID[d]) return; const latlng = [D.lat,D.lng]; @@ -35,14 +35,14 @@ export default function TrainMenu({ style }) { setStationPin(stationPinData); }, [originalStationList, selectedLine]); useLayoutEffect(() => { - mapRef.current.fitToCoordinates( + mapRef?.current.fitToCoordinates( stationPin.map(({ latlng }) => ({ latitude: parseFloat(latlng[0]), longitude: parseFloat(latlng[1]), })), { edgePadding: { top: 80, bottom: 120, left: 50, right: 50 } } // Add margin values here ); - }, [stationPin]); + }, [stationPin,mapRef]); return ( ))} diff --git a/lib/getStationList.ts b/lib/getStationList.ts index 02608df..45d3e17 100644 --- a/lib/getStationList.ts +++ b/lib/getStationList.ts @@ -211,15 +211,11 @@ export const getStationList = async () => { 鳴門線, stationList["日英対応表"] ); - const tokushimaCurrent = addStationPosition( + stationList["徳島線(徳島-阿波池田間)[B]"] = addStationPosition( concatBetweenStations(stationList["徳島線(徳島-阿波池田間)[B]"]), 徳島線, stationList["日英対応表"] ); - stationList["徳島線(徳島-阿波池田間)[B]"] = [ - tokushimaCurrent[tokushimaCurrent.length - 1], - ...tokushimaCurrent, - ]; stationList["徳島線(徳島-阿波池田間)[B]"].pop(); stationList["瀬戸大橋線(児島-宇多津間)[M]"] = [ {