From ea89feedd4185a5f583fa8ddf33a2ec0906e0dc0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 22 Apr 2016 18:52:42 -0400 Subject: [PATCH] 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 --- .../src/org/altusmetrum/AltosDroid/AltosMapOffline.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); + } } } -- 2.30.2