From: Keith Packard Date: Fri, 22 Apr 2016 22:52:42 +0000 (-0400) Subject: altosdroid: Redraw offline map when my location changes X-Git-Tag: 1.6.3~2^2~28 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=ea89feedd4185a5f583fa8ddf33a2ec0906e0dc0 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 --- 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(); + } } }