From bbaf1e798bccf43d3fc02a3feac5adf9878ab3d3 Mon Sep 17 00:00:00 2001 From: evlist Date: Sun, 27 Nov 2022 19:17:33 +0100 Subject: [PATCH] Addinf trkseg start/end points --- src/components/trkseg/Trkseg.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/components/trkseg/Trkseg.tsx b/src/components/trkseg/Trkseg.tsx index b848668..642fa04 100644 --- a/src/components/trkseg/Trkseg.tsx +++ b/src/components/trkseg/Trkseg.tsx @@ -31,6 +31,14 @@ export const Trkseg: Component = ({ vectorSource, trksegId }) => { let geo: any = { type: 'FeatureCollection', features: [ + { + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [trkseg().trkpt[0].$.lon, trkseg().trkpt[0].$.lat], + }, + properties: { type: 'trkseg-start' }, + }, { type: 'Feature', geometry: { @@ -40,6 +48,18 @@ export const Trkseg: Component = ({ vectorSource, trksegId }) => { 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' }, }, ], };