徳島線の徳島駅、阿波池田駅の地点情報が無かった問題をデータソース側の改変で対処
This commit is contained in:
parent
36ac66df3e
commit
fdea8be0b4
@ -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": "徳島線",
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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 (
|
||||
<View style={{ height: "100%", backgroundColor: "#0099CC", ...style }}>
|
||||
<MapView
|
||||
@ -70,7 +70,7 @@ export default function TrainMenu({ style }) {
|
||||
d={d}
|
||||
navigate={navigate}
|
||||
webview={webview}
|
||||
key={D.StationNumber + d}
|
||||
key={D.Station_JP + D.StationNumber + d}
|
||||
/>
|
||||
))}
|
||||
</MapView>
|
||||
|
@ -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]"] = [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user