Skip to content

Commit

Permalink
fixed KML recording bug with altitude
Browse files Browse the repository at this point in the history
  • Loading branch information
apps4av committed Aug 18, 2024
1 parent d7ee0b8 commit a2462d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/gps_recorder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GpsRecorder {
void add(Position position) {

double speed = position.speed * Storage().units.mpsTo;
double altitude = position.altitude * Storage().units.mToF;
double altitude = position.altitude;
double heading = position.heading;
bool recordPoint = false;
LatLng coordinate = Gps.toLatLng(position);
Expand All @@ -51,8 +51,8 @@ class GpsRecorder {
recordPoint = true;
}

// If the altitude is 100' or greater different
if((altitude - last.altitude) > 100) {
// If the altitude is 30 meters or greater different
if((altitude - last.altitude) > 30) {
recordPoint = true;
}

Expand All @@ -78,7 +78,7 @@ class GpsRecorder {

_last = TrackPosition(Gps.toLatLng(position), altitude, speed, heading, DateTime.now());

gpx.wpts.add(Wpt(lat: last.coordinate.latitude, lon: last.coordinate.longitude, ele: last.altitude, time: DateTime.now()));
gpx.wpts.add(Wpt(lat: last.coordinate.latitude, lon: last.coordinate.longitude, ele: last.altitude, desc: "speed=${last.speed.round()}", time: DateTime.now()));
}

void reset() {
Expand Down

0 comments on commit a2462d4

Please sign in to comment.