altosdroid: Don't set target location if lat/lon is MISSING
authorKeith Packard <keithp@keithp.com>
Wed, 20 Apr 2016 03:15:26 +0000 (23:15 -0400)
committerKeith Packard <keithp@keithp.com>
Wed, 20 Apr 2016 03:21:30 +0000 (23:21 -0400)
Otherwise, we get a nice pointer to some random location on the planet.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java

index 1032709168fb8689706efa6b5ba870dccb89c107..47113fab80cb6fc3580bc1683dcbafcf18336fbb 100644 (file)
@@ -281,7 +281,7 @@ public class AltosMapOnline implements AltosDroidMapInterface, GoogleMap.OnMarke
                                        mPadMarker.setVisible(true);
                                }
                        }
-                       if (state.gps != null) {
+                       if (state.gps != null && state.gps.lat != AltosLib.MISSING) {
 
                                target_position = new AltosLatLon(state.gps.lat, state.gps.lon);
                                if (state.gps.locked && state.gps.nsat >= 4)