summaryrefslogtreecommitdiff
path: root/altosdroid
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-04-22 18:52:42 -0400
committerKeith Packard <keithp@keithp.com>2016-04-22 18:52:42 -0400
commitea89feedd4185a5f583fa8ddf33a2ec0906e0dc0 (patch)
tree7d342682249858e1445ca0bee4b69298ef35d8ad /altosdroid
parent39af826ce9032e339929eb7917b1d29c87d03f69 (diff)
altosdroid: Redraw offline map when my location changes
Update the map view even if there isn't any current telemetry data. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosdroid')
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
index ff9d0a77..6edc87a5 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
@@ -441,6 +441,8 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal
}
public void show(TelemetryState telem_state, AltosState state, AltosGreatCircle from_receiver, Location receiver) {
+ boolean changed = false;
+
if (state != null) {
map.show(state, null);
if (state.pad_lat != AltosLib.MISSING && pad == null)
@@ -479,7 +481,12 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal
}
}
if (receiver != null) {
- here = new AltosLatLon(receiver.getLatitude(), receiver.getLongitude());
+ AltosLatLon new_here = new AltosLatLon(receiver.getLatitude(), receiver.getLongitude());
+ if (!new_here.equals(here)) {
+ here = new_here;
+ AltosDebug.debug("Location changed, redraw");
+ repaint();
+ }
}
}