示例#1
0
 def on_stop_mock(self):
     """ 
     Stop button is pressed
     """
     if is_android:
         Globals.mock_thread.send_message("stop")
     else:
         # Set a random location on Windows or Linux
         Debug.randomize_latlng()
         self.mockmapview.update_current_locmarker(Debug.latitude, Debug.longitude, False)
     self.mockmapview.remove_target_marker()
示例#2
0
    def on_start(self):
        # Capture the Escape key
        EventLoop.window.bind(on_keyboard=self.on_keyboard_press)
        # init basic dialogs
        Dialogs.generate_dialogs(self)
        # Obtain a reference to the Container Layout object
        self.container = self.root.ids.id_map_screen_container
        if is_android:
            # Get ACCESS_FINE_LOCATION Permission from user
            require_location_permissions(self._on_permissions_result)
            # start the mock location thread
            Globals.mock_thread.start()
        else:
            # Set a random location on Windows or Linux
            Debug.randomize_latlng()
            self.container.mockmapview.update_current_locmarker(
                Debug.latitude, Debug.longitude, False)

        # Set the zoom level from last time
        settings = load_Settings()
        self.container.mockmapview.zoom = settings["last_zoom_level"]