forked from upstream-mirrors/OpenTracks
Hide the first stats waypoint.
This commit is contained in:
@@ -201,7 +201,10 @@ public class MyTracksMap extends MapActivity
|
|||||||
MyTracksConstants.MAX_DISPLAYED_WAYPOINTS_POINTS);
|
MyTracksConstants.MAX_DISPLAYED_WAYPOINTS_POINTS);
|
||||||
if (cursor != null && cursor.moveToFirst()) {
|
if (cursor != null && cursor.moveToFirst()) {
|
||||||
do {
|
do {
|
||||||
mapOverlay.addWaypoint(providerUtils.createWaypoint(cursor));
|
Waypoint waypoint = providerUtils.createWaypoint(cursor);
|
||||||
|
if (MyTracksUtils.isValidLocation(waypoint.getLocation())) {
|
||||||
|
mapOverlay.addWaypoint(waypoint);
|
||||||
|
}
|
||||||
} while (cursor.moveToNext());
|
} while (cursor.moveToNext());
|
||||||
}
|
}
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
|||||||
@@ -897,7 +897,14 @@ public class TrackRecordingService extends Service implements LocationListener {
|
|||||||
}
|
}
|
||||||
wpt.setTrackId(recordingTrackId);
|
wpt.setTrackId(recordingTrackId);
|
||||||
wpt.setLength(length);
|
wpt.setLength(length);
|
||||||
if (lastValidLocation != null) {
|
if (lastValidLocation == null) {
|
||||||
|
// A null location is ok, and expected on track start.
|
||||||
|
// Make it an impossible location.
|
||||||
|
Location l = new Location("");
|
||||||
|
l.setLatitude(100);
|
||||||
|
l.setLongitude(200);
|
||||||
|
wpt.setLocation(l);
|
||||||
|
} else {
|
||||||
// A null location is ok, and expected on track start.
|
// A null location is ok, and expected on track start.
|
||||||
wpt.setLocation(lastLocation);
|
wpt.setLocation(lastLocation);
|
||||||
wpt.setDuration(lastLocation.getTime()
|
wpt.setDuration(lastLocation.getTime()
|
||||||
|
|||||||
Reference in New Issue
Block a user