update route preview

This commit is contained in:
2025-04-14 01:03:58 +03:00
parent 607012bd47
commit b6449b02c0
178 changed files with 8999 additions and 86 deletions

View File

@ -0,0 +1,19 @@
import { Track } from '@mt/common-types';
import { StationOnMap } from '@mt/components';
export function mapStationsFromApi(stations: StationOnMap[], track: Track): StationOnMap[] {
return stations.map<StationOnMap>((station) => {
const { pointOnMap } = station;
const trackIndex = track.findIndex(
(trackPoint) => pointOnMap.lat === trackPoint.lat && pointOnMap.lon === trackPoint.lon
);
return {
...station,
pointOnMap: {
...pointOnMap,
trackIndex,
},
};
});
}