Addinf trkseg start/end points

This commit is contained in:
Eric van der Vlist 2022-11-27 19:17:33 +01:00
parent 6c2573ba8b
commit bbaf1e798b
1 changed files with 20 additions and 0 deletions

View File

@ -31,6 +31,14 @@ export const Trkseg: Component<Props> = ({ vectorSource, trksegId }) => {
let geo: any = { let geo: any = {
type: 'FeatureCollection', type: 'FeatureCollection',
features: [ features: [
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [trkseg().trkpt[0].$.lon, trkseg().trkpt[0].$.lat],
},
properties: { type: 'trkseg-start' },
},
{ {
type: 'Feature', type: 'Feature',
geometry: { geometry: {
@ -40,6 +48,18 @@ export const Trkseg: Component<Props> = ({ vectorSource, trksegId }) => {
trkpt.$.lat, trkpt.$.lat,
]), ]),
}, },
properties: { type: 'trkseg' },
},
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [
trkseg().trkpt.at(-1).$.lon,
trkseg().trkpt.at(-1).$.lat,
],
},
properties: { type: 'trkseg-finish' },
}, },
], ],
}; };