UNPKG

multiplanner

Version:

Tool om polydestinale reizen te plannen over het Nederlandse spoornet.

10 lines (9 loc) 672 B
import getConfigValue from '#f/getConfigValue.js'; const spoorkaart = getConfigValue("spoorkaart"); export default (stationa, stationb) => { const rechtefeature = spoorkaart.payload.features.find((feature) => feature.properties.from == stationa.code && feature.properties.to == stationb.code); if (rechtefeature) return rechtefeature.geometry.coordinates; const omgekeerdefeature = spoorkaart.payload.features.find((feature) => feature.properties.to == stationa.code && feature.properties.from == stationb.code); if (omgekeerdefeature) return [...omgekeerdefeature.geometry.coordinates].reverse(); return [stationa.coordinaat, stationb.coordinaat]; };