示例#1
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"]