示例#1
0
 def on_start_mock(self):
     """
     Start button is pressed
     """
     # get the target marker coordinates
     latitude, longitude = self.mockmapview.get_last_target_coords()
     if latitude and longitude:
         # if target marker exists then set the mock location
         if is_android:
             # tell mock location thread to set new coordinates
             Globals.mock_thread.send_message("start", latitude, longitude)
         else:
             # set global debugging coordinates
             Debug.latitude = latitude
             Debug.longitude = longitude
             self.mockmapview.update_current_locmarker(Debug.latitude, Debug.longitude, False)
     else:
         # Let user know nothing was selected
         Dialogs.show_alert("No Target found", "Press on the map to select target location and then press the start button")