forked from upstream-mirrors/OpenTracks
Merge changes.
This commit is contained in:
@@ -1020,6 +1020,7 @@ public class MyTracksMap extends MapActivity
|
|||||||
long lastStoredLocationId =
|
long lastStoredLocationId =
|
||||||
providerUtils.getLastLocationId(selectedTrackId);
|
providerUtils.getLastLocationId(selectedTrackId);
|
||||||
int samplingFrequency = -1;
|
int samplingFrequency = -1;
|
||||||
|
Location location = new Location("");
|
||||||
for (;;) {
|
for (;;) {
|
||||||
Cursor cursor = null;
|
Cursor cursor = null;
|
||||||
try {
|
try {
|
||||||
@@ -1047,7 +1048,7 @@ public class MyTracksMap extends MapActivity
|
|||||||
numTotalPoints / MyTracksConstants.TARGET_DISPLAYED_TRACK_POINTS);
|
numTotalPoints / MyTracksConstants.TARGET_DISPLAYED_TRACK_POINTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
Location location = providerUtils.createLocation(cursor);
|
providerUtils.fillLocation(cursor, location);
|
||||||
|
|
||||||
// Include a point if it fits one of the following criteria:
|
// Include a point if it fits one of the following criteria:
|
||||||
// - Has the mod for the sampling frequency (includes first point).
|
// - Has the mod for the sampling frequency (includes first point).
|
||||||
@@ -1056,7 +1057,8 @@ public class MyTracksMap extends MapActivity
|
|||||||
if (numPoints % samplingFrequency == 0 ||
|
if (numPoints % samplingFrequency == 0 ||
|
||||||
(!isRecordingSelected() && locationId == lastStoredLocationId) ||
|
(!isRecordingSelected() && locationId == lastStoredLocationId) ||
|
||||||
!MyTracksUtils.isValidLocation(location)) {
|
!MyTracksUtils.isValidLocation(location)) {
|
||||||
mapOverlay.addLocation(location);
|
// Only allocate a new location if it is going to be kept around.
|
||||||
|
mapOverlay.addLocation(new Location(location));
|
||||||
}
|
}
|
||||||
|
|
||||||
numPoints++;
|
numPoints++;
|
||||||
|
|||||||
@@ -231,23 +231,7 @@ public class MyTracksOverlay extends Overlay {
|
|||||||
int cx = mapView.getMapCenter().getLongitudeE6();
|
int cx = mapView.getMapCenter().getLongitudeE6();
|
||||||
int cy = mapView.getMapCenter().getLatitudeE6();
|
int cy = mapView.getMapCenter().getLatitudeE6();
|
||||||
Rect rect = new Rect(cx - w, cy - h, cx + w, cy + h);
|
Rect rect = new Rect(cx - w, cy - h, cx + w, cy + h);
|
||||||
Log.i(MyTracksConstants.TAG,
|
|
||||||
"Found bounding box: " + rect);
|
|
||||||
|
|
||||||
Point pt = new Point();
|
Point pt = new Point();
|
||||||
GeoPoint upperLeft = new GeoPoint(rect.top, rect.left);
|
|
||||||
Point pUpperLeft = new Point();
|
|
||||||
mapView.getProjection().toPixels(upperLeft, pUpperLeft);
|
|
||||||
GeoPoint bottomRight = new GeoPoint(rect.bottom, rect.right);
|
|
||||||
Point pBottomRight = new Point();
|
|
||||||
mapView.getProjection().toPixels(upperLeft, pBottomRight);
|
|
||||||
Rect dispRect = new Rect(pUpperLeft.x, pUpperLeft.y,
|
|
||||||
pBottomRight.x, pBottomRight.y);
|
|
||||||
Log.i(MyTracksConstants.TAG,
|
|
||||||
"Found display box: " + rect);
|
|
||||||
canvas.drawRect(dispRect, selectedTrackPaint);
|
|
||||||
|
|
||||||
Rect displayRect;
|
|
||||||
GeoPoint geoPoint;
|
GeoPoint geoPoint;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user