changeset 126:3798cd438c3c

geohub: Add point IDs to GPX data
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 06 Mar 2021 13:21:28 +0100
parents 08caf18bd9ef
children 07984965bbb7
files assets/livemap.html src/types.rs
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/assets/livemap.html	Fri Jan 01 01:22:48 2021 +0100
+++ b/assets/livemap.html	Sat Mar 06 13:21:28 2021 +0100
@@ -192,7 +192,7 @@
         }
         let speedField = document.getElementById('outputSpeed');
         if (locProperties && locProperties.speed) {
-            speedField.textContent = locProperties.speed.toPrecision(1);
+            speedField.textContent = locProperties.speed.toFixed(1);
         } else {
             speedField.textContent = '0';
         }
--- a/src/types.rs	Fri Jan 01 01:22:48 2021 +0100
+++ b/src/types.rs	Sat Mar 06 13:21:28 2021 +0100
@@ -17,6 +17,7 @@
 impl GeoPoint {
     fn to_gpx_waypoint(self) -> gpx::Waypoint {
         let mut wp = gpx::Waypoint::new(Point::new(self.long, self.lat));
+        wp.description = Some(format!("{}", self.id.unwrap_or(-1)));
         wp.elevation = self.ele;
         wp.speed = self.spd;
         wp.time = Some(self.time);