altosdroid: Change tracker selection dialog
[fw/altos] / altosdroid / app / src / main / java / org / altusmetrum / AltosDroid / AltosMapOnline.java
index 272744a35c8355b93eef7178f63c935616668321..8361b278f93b8cc65022effc3c3b8dc86ccbce1b 100644 (file)
@@ -203,13 +203,22 @@ public class AltosMapOnline implements AltosDroidMapInterface, GoogleMap.OnMarke
                return true;
        }
 
+       void
+       position_permission() {
+               if (mMap != null)
+                       mMap.setMyLocationEnabled(true);
+       }
+
        @Override
        public void onMapReady(GoogleMap googleMap) {
                final int map_type = AltosPreferences.map_type();
                mMap = googleMap;
                if (mMap != null) {
                        map_type_changed(map_type);
-                       mMap.setMyLocationEnabled(true);
+                       if (altos_droid.have_location_permission)
+                               mMap.setMyLocationEnabled(true);
+                       else
+                               altos_droid.tell_map_permission(this);
                        mMap.getUiSettings().setTiltGesturesEnabled(false);
                        mMap.getUiSettings().setZoomControlsEnabled(false);
                        mMap.setOnMarkerClickListener(this);
@@ -278,12 +287,12 @@ public class AltosMapOnline implements AltosDroidMapInterface, GoogleMap.OnMarke
 
                if (telem_state != null) {
                        for (int serial : rockets.keySet()) {
-                               if (!telem_state.states.containsKey(serial))
+                               if (!telem_state.containsKey(serial))
                                        remove_rocket(serial);
                        }
 
-                       for (int serial : telem_state.states.keySet()) {
-                               set_rocket(serial, telem_state.states.get(serial));
+                       for (int serial : telem_state.keySet()) {
+                               set_rocket(serial, telem_state.get(serial));
                        }
                }