Exemplo n.º 1
0
 public void OnExitClick()
 {
     LibPlacenote.Instance.StopSession();
     FeaturesVisualizer.clearPointcloud();
     initialized       = false;
     haveMapName       = false;
     mapping           = false;
     localizeFirstTime = false;
     mInitButtonPanel.SetActive(true);
     mExitButton.SetActive(false);
     mExtendedPanel.SetActive(false);
     mActivateDesButton.SetActive(false);
     mMappingButtonPanel.SetActive(false);
     DropdownList.gameObject.SetActive(false);
     scanPopup.SetActive(false);
     selectDesPopUp.SetActive(false);
     waitPopUp.SetActive(false);
     destination = null;
     destinationList.Clear();
     DropdownList.value = 0;
     DropdownList.options.Clear();
     DropdownList.RefreshShownValue();
     shapeManager.ClearShapes();
     navController.ReSetParameter();
     infoManager.Close();
     StopAllCoroutines();
     StartCoroutine(UIcheck());
 }
Exemplo n.º 2
0
    //Called when user has selected a route and clicked Load
    public void OnLoadRouteClicked()
    {
        ConfigureSession();                     //Sets ARKit configuration for session
        FeaturesVisualizer.DisablePointcloud(); //Ensure feature points dont show to user
        FeaturesVisualizer.clearPointcloud();   //Clear any already visible features
        notificationPanelText.text = "Loading Route ID: " + selectedRouteId;

        LibPlacenote.Instance.LoadMap(selectedRouteId,
                                      (completed, faulted, percentage) => {
            if (completed)                       //Mapping of route download finished
            {
                routeSelectedPanel.SetActive(false);
                routeListPanel.SetActive(false);
                initialPanel.SetActive(false);
                mappingPanel.SetActive(false);
                exitButton.SetActive(true);
                LibPlacenote.Instance.StartSession();                          //Start Placenote Session when route has successfully downloaded
                notificationPanelText.text = "Loaded Route ID: " + selectedRouteId;
            }
            else if (faulted)                         //route failed to load
            {
                notificationPanelText.text = "Failed to load Route ID: " + selectedRouteId;
            }
            else                         //Route downloading
            {
                notificationPanelText.text = "Route Download: " + percentage.ToString("F2") + "/1.0";
            }
        }
                                      );
    }
        public void OnSaveMapClick()
        {
            if (!LibPlacenote.Instance.Initialized())
            {
                Debug.Log("SDK not yet initialized");

                return;
            }

            bool         useLocation  = Input.location.status == LocationServiceStatus.Running;
            LocationInfo locationInfo = Input.location.lastData;

            mLabelText.text = "Saving...";
            LibPlacenote.Instance.SaveMap(
                (mapId) =>
            {
                LibPlacenote.Instance.StopSession();
                FeaturesVisualizer.DisablePointcloud();
                FeaturesVisualizer.clearPointcloud();

                mLabelText.text = "Saved Map ID: " + mapId;
                mInitButtonPanel.SetActive(true);
                mMappingButtonPanel.SetActive(false);

                LibPlacenote.MapMetadataSettable metadata = CreateMetaDataObject();

                LibPlacenote.Instance.SetMetadata(mapId, metadata, (success) =>
                {
                    if (success)
                    {
                        mLabelText.text = "Meta data successfully saved";
                    }
                    else
                    {
                        mLabelText.text = "Meta data failed to save";
                    }
                });

                SaveMapIDToFile(mapId);
            },
                (completed, faulted, percentage) =>
            {
                if (completed)
                {
                    mLabelText.text = "Upload Complete:";

                    // delete the planes.
                    ConfigureSession(false, true);
                }
                else if (faulted)
                {
                    mLabelText.text = "Upload of Map failed";
                }
                else
                {
                    mLabelText.text = "Upload Progress: " + percentage.ToString("F2") + "/1.0)";
                }
            }
                );
        }
Exemplo n.º 4
0
        // Save a map and upload it to Placenote cloud
        public void OnSaveMapClick()
        {
            mappingPanel.SetActive(false);
            initPanel.SetActive(true);
            localizedPanel.SetActive(false);

            FeaturesVisualizer.clearPointcloud();

            if (!LibPlacenote.Instance.Initialized())
            {
                notifications.text = "SDK not yet initialized";
                return;
            }

            // save and upload the map
            LibPlacenote.Instance.SaveMap(
                (mapId) =>
            {
                /*
                 * savedMapID = mapId;
                 * LibPlacenote.Instance.StopSession();
                 * WriteMapIDToFile(mapId);
                 */

                savedMapID = mapId;
                LibPlacenote.Instance.StopSession();
            },
                (completed, faulted, percentage) =>
            {
                if (completed)
                {
                    notifications.text = "Upload Complete:" + savedMapID;

                    // upload meta data
                    LibPlacenote.MapMetadataSettable metadata = CreateMetaDataObject();

                    LibPlacenote.Instance.SetMetadata(savedMapID, metadata, (success) => {
                        if (success)
                        {
                            notifications.text = "Meta data successfully saved";
                        }
                        else
                        {
                            notifications.text = "Meta data failed to save";
                        }
                    });

                    GetComponent <ModelManager>().ClearModels();
                }
                else if (faulted)
                {
                    notifications.text = "Upload of Map: " + savedMapID + " failed";
                }
                else
                {
                    notifications.text = "Upload Progress: " + percentage.ToString("F2") + "/1.0)";
                }
            }
                );
        }
Exemplo n.º 5
0
 public void OnSelectCancel()
 {
     //Debug.Log("Cancelling. Moving to MainList Mode.");
     LibPlacenote.Instance.StopSession();
     FeaturesVisualizer.clearPointcloud();
     AM.instance.ClearAudioCues();
     MM.instance.SwitchModes(mapListMode);
 }
Exemplo n.º 6
0
    /**
     * Saves the current map.
     */
    public void SaveMap(string name)
    {
        if (!LibPlacenote.Instance.Initialized())
        {
            OutputPlacenoteText("SDK not yet initialized");
            return;
        }

        bool         useLocation  = Input.location.status == LocationServiceStatus.Running;
        LocationInfo locationInfo = Input.location.lastData;

        OutputPlacenoteText("Saving scan.");
        LibPlacenote.Instance.SaveMap(
            (mapId) => {
            LibPlacenote.Instance.StopSession();
            FeaturesVisualizer.clearPointcloud();

            // Create metadata
            LibPlacenote.MapMetadataSettable metadata = new LibPlacenote.MapMetadataSettable();
            metadata.name                    = name;
            JObject userdata                 = new JObject();
            metadata.userdata                = userdata;
            JObject audioCueList             = AM.instance.AudioCuesToJSON();
            userdata[AM.AUDIO_CUE_LIST_NAME] = audioCueList;
            AM.instance.ClearAudioCues();
            if (useLocation)
            {
                metadata.location           = new LibPlacenote.MapLocation();
                metadata.location.latitude  = locationInfo.latitude;
                metadata.location.longitude = locationInfo.longitude;
                metadata.location.altitude  = locationInfo.altitude;
            }

            LibPlacenote.Instance.SetMetadata(mapId, metadata, (success) => {
                if (success)
                {
                    Debug.Log("Meta data successfully saved");
                }
                else
                {
                    Debug.Log("Meta data failed to save");
                }
            });
            storedMapMetadata = metadata;
        },
            (completed, faulted, percentage) => {
            if (completed)
            {
                OutputPlacenoteText("Upload Complete:" + storedMapMetadata.name);
            }
            else if (faulted)
            {
                OutputPlacenoteText("Upload of Map Named: " + storedMapMetadata.name + "faulted");
            }
        }
            );
    }
        public void OnExitClicked()
        {
            LibPlacenote.Instance.StopSession();
            FeaturesVisualizer.clearPointcloud();
            GetComponent <MarkerManager>().ClearModels();

            initPanel.SetActive(true);
            mappingPanel.SetActive(false);
            localizedPanel.SetActive(false);
        }
Exemplo n.º 8
0
    public void OnExitClick()
    {
        mInitButtonPanel.SetActive(true);
        mExitButton.SetActive(false);
        mMappingButtonPanel.SetActive(false);

        LibPlacenote.Instance.StopSession();
        FeaturesVisualizer.clearPointcloud();
        mAudioCueManager.ClearAudioCues(); // CHANGED
    }
    public void OnExitClick()
    {
        mInitButtonPanel.SetActive(true);
        mExitButton.SetActive(false);
        mMappingButtonPanel.SetActive(false);

        LibPlacenote.Instance.StopSession();
        FeaturesVisualizer.clearPointcloud();
        GetComponent <ShapeManager>().ClearShapes();
    }
Exemplo n.º 10
0
        private void EnvironmentMappingComplete(bool scanningRes)
        {
            GameUI.HelperText.text = "Saving " + (scanningRes ? "success!" : "Error!");

            if (PhotonNetwork.connected)
            {
                GetComponent <PhotonView> ().RPC("EnvironmentMappingCompleteRPC", PhotonTargets.Others);
            }
            FeaturesVisualizer.DisablePointcloud();
            FeaturesVisualizer.clearPointcloud();
            StartLoadingMap();
        }
Exemplo n.º 11
0
    void Start()
    {
        shapeManager = GetComponent <CustomShapeManager>();

        Input.location.Start();

        mSession = UnityARSessionNativeInterface.GetARSessionNativeInterface();
        StartARKit();
        FeaturesVisualizer.clearPointcloud();
        FeaturesVisualizer.EnablePointcloud();
        LibPlacenote.Instance.RegisterListener(this);
    }
Exemplo n.º 12
0
    //Called when back button is clicked when in a mapping session for either create or load route
    public void OnExitClick()
    {
        initialPanel.SetActive(true);
        initialButtonsPanel.SetActive(true);
        enterRouteNamePanel.SetActive(false);
        exitButton.SetActive(false);
        mappingPanel.SetActive(false);

        LibPlacenote.Instance.StopSession();         //Stop running Placenote Session
        FeaturesVisualizer.DisablePointcloud();      //Stop detecting feature points
        FeaturesVisualizer.clearPointcloud();        //Clear all feature points currently on screen
        GetComponent <ShapeManager>().ClearShapes(); //Calls Shape Manager Class to clear shapes from screen
    }
        public void OnExitClick()
        {
            mInitButtonPanel.SetActive(true);
            localizedPanel.SetActive(false);
            LibPlacenote.Instance.StopSession();
            FeaturesVisualizer.DisablePointcloud();
            FeaturesVisualizer.clearPointcloud();

            ConfigureSession(false, true); // stop detection and delete existing planes

            localizedFirstTime = false;
            mLabelText.text    = "Exited: Click New Map or Load Map";
        }
Exemplo n.º 14
0
    public void OnResetConfirmClick()
    {
        //
        if (currentStage == Stage.START)
        {
            resetAlert.SetActive(false);
        }
        else if (currentStage == Stage.MAPPING)
        {
            resetAlert.SetActive(false);
        }
        else if (currentStage == Stage.PATHING)
        {
            resetAlert.SetActive(false);
            startNodeButton.SetActive(true);
            undoButton.SetActive(true);
            pathing.SetActive(false);
            shouldHit = false;
            process1.GetComponent <Image>().color = ORANGE_COLOR;
            process1.transform.localScale         = new Vector3(1.175f, 1.175f, 1.175f);
            process2.GetComponent <Image>().color = WHITE_COLOR;
            process2.transform.localScale         = new Vector3(1, 1, 1);
            process1.transform.SetAsLastSibling();
        }
        else if (currentStage == Stage.SAVING)
        {
            homeButton.SetActive(false);
            saving.SetActive(false);
            process1.GetComponent <Image>().color = ORANGE_COLOR;
            process1.transform.localScale         = new Vector3(1.175f, 1.175f, 1.175f);
            process2.GetComponent <Image>().color = WHITE_COLOR;
            process2.transform.localScale         = new Vector3(1, 1, 1);
            process3.GetComponent <Image>().color = WHITE_COLOR;
            process3.transform.localScale         = new Vector3(1, 1, 1);
            process1.transform.SetAsLastSibling();
        }

        destName           = "";
        mapName            = "";
        destNameField.text = "";
        mapNameField.text  = "";

        LibPlacenote.Instance.StopSession();
        FeaturesVisualizer.clearPointcloud();
        GetComponent <CustomShapeManager>().ClearShapes();
        ConfigureSession();
        mARKitInit = false;
    }
Exemplo n.º 15
0
    public void OnResetConfirmClick()
    {
        resetButton.SetActive(true);
        resetAlert.SetActive(false);

        if (currentStage == Stage.NAVI)
        {
            navigationButton.SetActive(false);
        }
        statusText.text = "เลือกแผนที่";

        mapList.SetActive(true);
        LibPlacenote.Instance.StopSession();
        FeaturesVisualizer.clearPointcloud();
        GetComponent <CustomShapeManager>().ClearShapes();
        ConfigureSession();
        mARKitInit       = false;
        mapListUpdated   = false;
        destListUpdated  = false;
        isLocalize       = false;
        mSelectedMapInfo = null;
    }
Exemplo n.º 16
0
 public void OnExitClick()
 {
     Destroy(sign);
     localizeFirstTime = false;
     mInitButtonPanel.SetActive(true);
     mExitButton.SetActive(false);
     mMappingButtonPanel.SetActive(false);
     DropdownList.gameObject.SetActive(false);
     scanPopup.SetActive(false);
     selectDesPopUp.SetActive(false);
     waitPopUp.SetActive(false);
     starSpawner.StopSpawning();
     LibPlacenote.Instance.StopSession();
     FeaturesVisualizer.clearPointcloud();
     destination = null;
     destinationList.Clear();
     DropdownList.value = 0;
     DropdownList.options.Clear();
     shapeManager.ClearShapes();
     navController.ReSetParameter();
     StartCoroutine(UIcheck());
 }
        /// <summary>
        /// Stops the current mapping session. Only the host needs to stop because
        /// they are the only player mapping.
        /// Calls OnMappingCompleteEvent.
        /// </summary>
        public void StopMapping()
        {
            // Disable visable point cloud
            if (!mDebug)
            {
                FeaturesVisualizer.DisablePointcloud();
                FeaturesVisualizer.clearPointcloud();
            }

            // Saves map and gives feedback via EnvironmentMappingProgress() and EnvironmentMappingComplete()
            LibPlacenote.Instance.SaveMap((mapId) =>
            {
                LatestMapId = mapId;
            }, (completed, faulted, percentage) =>
            {
                if (!completed && !faulted)
                {
                    Debug.Log("Saving Progress..." + (percentage * 100f) + "%");
                    OnMapSavingProgressUpdateEvent(percentage);
                }
                else
                {
                    // Stop the mapping session
                    LibPlacenote.Instance.StopSession();
                    bool savingSuccess = !faulted;
                    Debug.Log("Saving " + (savingSuccess ? "success!" : "Error!"));
                    OnMapSavingStatusUpdateEvent(savingSuccess);
                    if (savingSuccess)
                    {
                        // When mapping is complete all current players should begin loading the map
                        mPhotonView.RPC("LoadMapRPC", PhotonTargets.All);
                        OnMappingCompleteEvent();
                    }
                }
            });
        }
 /// <summary>
 /// Stops Placenote session.
 /// </summary>
 private void StopUsingMap()
 {
     FeaturesVisualizer.DisablePointcloud();
     FeaturesVisualizer.clearPointcloud();
     LibPlacenote.Instance.StopSession();
 }
Exemplo n.º 19
0
    //Called when save button is clicked after route has been finished mapping out
    public void OnSaveRouteClick()
    {
        bool         useLocation  = Input.location.status == LocationServiceStatus.Running; //checks if location was used
        LocationInfo locationInfo = Input.location.lastData;

        notificationPanelText.text = "Saving...";
        //Stores route and metadata to placenote
        LibPlacenote.Instance.SaveMap(
            (routeId) => {
            LibPlacenote.Instance.StopSession();      //Stops the Placenote session
            FeaturesVisualizer.DisablePointcloud();   //Stop detecting feature points
            FeaturesVisualizer.clearPointcloud();     //Clear all feature points currently on screen
            saveRouteId = routeId;

            initialPanel.SetActive(true);
            initialButtonsPanel.SetActive(true);
            enterRouteNamePanel.SetActive(false);
            mappingPanel.SetActive(false);
            exitButton.SetActive(false);

            //Create instance of metadata
            LibPlacenote.MapMetadataSettable metadata = new LibPlacenote.MapMetadataSettable();
            metadata.name = routeName;     //set metadata route name
            notificationPanelText.text = "Saved Route Name: " + metadata.name;

            //Calls the Shape Manager class to get the objects from the route and return them in a JSON format to store in metadata
            JObject userdata      = new JObject();
            metadata.userdata     = userdata;
            JObject shapeList     = GetComponent <ShapeManager>().Shapes2JSON();
            userdata["shapeList"] = shapeList;
            GetComponent <ShapeManager>().ClearShapes();

            //Store location with the route
            if (useLocation)
            {
                metadata.location           = new LibPlacenote.MapLocation();
                metadata.location.latitude  = locationInfo.latitude;
                metadata.location.longitude = locationInfo.longitude;
                metadata.location.altitude  = locationInfo.altitude;
            }

            //set the metadata to the corresponding route id
            LibPlacenote.Instance.SetMetadata(routeId, metadata, (success) => {
                if (success)
                {
                    Debug.Log("Meta data successfully saved");
                }
                else
                {
                    Debug.Log("Meta data failed to save");
                }
            });
            currentRouteDetails = metadata;
        },
            (completed, faulted, percentage) => {
            if (completed)                       //route upload finished
            {
                notificationPanelText.text = "Upload Complete:" + currentRouteDetails.name;
            }
            else if (faulted)                       //route upload failed
            {
                notificationPanelText.text = "Upload of Route Named: " + currentRouteDetails.name + "faulted";
            }
            else                       //route uploading
            {
                notificationPanelText.text = "Uploading Route Named: " + currentRouteDetails.name + "(" + percentage.ToString("F2") + "/1.0)";
            }
        }
            );
    }
    public void OnSaveMapClick()
    {
        if (!LibPlacenote.Instance.Initialized())
        {
            Debug.Log("SDK not yet initialized");
            return;
        }

        bool         useLocation  = Input.location.status == LocationServiceStatus.Running;
        LocationInfo locationInfo = Input.location.lastData;

        mLabelText.text = "Saving...";
        LibPlacenote.Instance.SaveMap(
            (mapId) => {
            LibPlacenote.Instance.StopSession();
            FeaturesVisualizer.clearPointcloud();

            mSaveMapId = mapId;
            mInitButtonPanel.SetActive(true);
            mMappingButtonPanel.SetActive(false);
            mExitButton.SetActive(false);

            LibPlacenote.MapMetadataSettable metadata = new LibPlacenote.MapMetadataSettable();
            metadata.name   = RandomName.Get();
            mLabelText.text = "Saved Map Name: " + metadata.name;

            JObject userdata  = new JObject();
            metadata.userdata = userdata;

            JObject shapeList = GetComponent <ShapeManager>().Shapes2JSON();

            userdata["shapeList"] = shapeList;
            GetComponent <ShapeManager>().ClearShapes();

            if (useLocation)
            {
                metadata.location           = new LibPlacenote.MapLocation();
                metadata.location.latitude  = locationInfo.latitude;
                metadata.location.longitude = locationInfo.longitude;
                metadata.location.altitude  = locationInfo.altitude;
            }
            LibPlacenote.Instance.SetMetadata(mapId, metadata, (success) => {
                if (success)
                {
                    Debug.Log("Meta data successfully saved");
                }
                else
                {
                    Debug.Log("Meta data failed to save");
                }
            });
            mCurrMapDetails = metadata;
        },
            (completed, faulted, percentage) => {
            if (completed)
            {
                mLabelText.text = "Upload Complete:" + mCurrMapDetails.name;
            }
            else if (faulted)
            {
                mLabelText.text = "Upload of Map Named: " + mCurrMapDetails.name + "faulted";
            }
            else
            {
                mLabelText.text = "Uploading Map Named: " + mCurrMapDetails.name + "(" + percentage.ToString("F2") + "/1.0)";
            }
        }
            );
    }
Exemplo n.º 21
0
    void SaveCurrentMap()
    {
        if (shouldSaveMap)
        {
            shouldSaveMap = false;

            if (!LibPlacenote.Instance.Initialized())
            {
                statusText.text = "SDK ยังไม่ถูกติดตั้ง";
                return;
            }

            currentStage = Stage.SAVING;
            process2.GetComponent <Image>().color = GRAY_COLOR;
            process2.transform.localScale         = new Vector3(1, 1, 1);
            process3.GetComponent <Image>().color = ORANGE_COLOR;
            process3.transform.localScale         = new Vector3(1.175f, 1.175f, 1.175f);
            process3.transform.SetAsLastSibling();

            bool         useLocation  = Input.location.status == LocationServiceStatus.Running;
            LocationInfo locationInfo = Input.location.lastData;

            statusText.text = "กำลังอัพโหลด..";
            LibPlacenote.Instance.SaveMap(
                (mapId) =>
            {
                LibPlacenote.Instance.StopSession();
                FeaturesVisualizer.clearPointcloud();

                LibPlacenote.MapMetadataSettable metadata = new LibPlacenote.MapMetadataSettable();
                metadata.name   = mapName;
                statusText.text = metadata.name;
                Debug.Log(metadata.name);

                JObject userdata  = new JObject();
                metadata.userdata = userdata;

                JObject data     = GetComponent <CustomShapeManager>().Shapes2JSON();
                userdata["data"] = data;

                if (useLocation)
                {
                    metadata.location           = new LibPlacenote.MapLocation();
                    metadata.location.latitude  = locationInfo.latitude;
                    metadata.location.longitude = locationInfo.longitude;
                    metadata.location.altitude  = locationInfo.altitude;
                }

                LibPlacenote.Instance.SetMetadata(mapId, metadata);
                mCurrMapDetails = metadata;
            },
                (completed, faulted, percentage) =>
            {
                if (completed)
                {
                    statusText.text = "อัพโหลดเสร็จสิ้น";
                    homeButton.SetActive(true);
                }
                else if (faulted)
                {
                    statusText.text = "เกิดข้อผิดพลาด โปรดลองใหม่อีกครั้ง";
                    resetButton.SetActive(true);
                }
                else
                {
                    statusText.text = "กำลังอัพโหลด " + ((int)(percentage * 100)).ToString() + "%";
                }
            }
                );
        }
    }
Exemplo n.º 22
0
    IEnumerator SaveMap()
    {
        bool useLocation = Input.location.status == LocationServiceStatus.Running;

        mapping = false;
        LocationInfo locationInfo = Input.location.lastData;

        MapnameInputPopUp.SetActive(true);
        statusText.text = "Wait for map name input....";

        yield return(new WaitUntil(() => haveMapName == true));

        statusText.text = "Saving...";
        LibPlacenote.Instance.SaveMap(
            (mapId) => {
            LibPlacenote.Instance.StopSession();
            FeaturesVisualizer.clearPointcloud();

            mSaveMapId = mapId;
            mInitButtonPanel.SetActive(true);
            mMappingButtonPanel.SetActive(false);
            mExitButton.SetActive(false);

            LibPlacenote.MapMetadataSettable metadata = new LibPlacenote.MapMetadataSettable();

            metadata.name = inputManager.MapName;                     // set name here

            statusText.text = "Saved Map Name: " + metadata.name;

            JObject userdata  = new JObject();
            metadata.userdata = userdata;

            JObject shapeList = shapeManager.Shapes2JSON();

            userdata["shapeList"] = shapeList;
            //can add userdata of trigger later
            shapeManager.ClearShapes();

            if (useLocation)
            {
                metadata.location           = new LibPlacenote.MapLocation();
                metadata.location.latitude  = locationInfo.latitude;
                metadata.location.longitude = locationInfo.longitude;
                metadata.location.altitude  = locationInfo.altitude;
            }
            LibPlacenote.Instance.SetMetadata(mapId, metadata, (success) => {
                if (success)
                {
                    Debug.Log("Meta data successfully saved");
                }
                else
                {
                    Debug.Log("Meta data failed to save");
                }
            });
            mCurrMapDetails = metadata;
        },
            (completed, faulted, percentage) => {
            if (completed)
            {
                statusText.text = "Upload Complete:" + mCurrMapDetails.name;
                OnExitClick();
            }
            else if (faulted)
            {
                statusText.text = "Upload of Map Named: " + mCurrMapDetails.name + "faulted";
            }
            else
            {
                statusText.text = "Uploading Map Named: " + mCurrMapDetails.name + "(" + percentage.ToString("F2") + "/1.0)";
            }
        }
            );
    }
        /// <summary>
        /// Handles loading of the Placenote map from the Placenote Cloud, and relocalizing
        /// </summary>
        public override void LoadMap()
        {
            if (!LibPlacenote.Instance.Initialized())
            {
                notificationText.text = "SDK has not initialized yet!";
                return;
            }

            // Read saved map Id from file
            // m_SavedMapId = ReadMapIDFromFile();
            m_SavedMapId = mapListView.CurrentMapId;

            if (m_SavedMapId == null)
            {
                notificationText.text = "You haven't saved a map yet!";
                return;
            }

            notificationText.text = "Loading map...";

            // Disable node placement
            _nodePlacer.CanPlaceNodes = false;

            // Manage UI
            ActivateNewButton(false);
            ActivateSaveButton(false);
            ActivateMapList(false);

            LibPlacenote.Instance.LoadMap(
                m_SavedMapId,
                (completed, faulted, percentage) =>
            {
                if (completed)
                {
                    // Download meta data
                    LibPlacenote.Instance.GetMetadata(m_SavedMapId,
                                                      (LibPlacenote.MapMetadata result) =>
                    {
                        if (result != null)
                        {
                            // Store result to downloadedMetaData variable, and use in
                            // OnStatusChange() callback in MainController
                            m_DownloadedMetadata = result;

                            // Try to localize the map
                            LibPlacenote.Instance.StartSession();

                            notificationText.text = "Trying to Localize Map: " + m_SavedMapId;

                            // Manage UI
                            ActivateLoadButton(false);
                            locationDropdown.ClearOptions();

                            isLoaded = true;

                            FeaturesVisualizer.clearPointcloud();
                        }
                        else
                        {
                            notificationText.text = "Failed to download meta data";
                            return;
                        }
                    }
                                                      );
                }
                else if (faulted)
                {
                    notificationText.text = "Failed to load Map ID: " + m_SavedMapId;
                }
                else
                {
                    notificationText.text = "Download Progress: " + percentage.ToString("F2") + "/1.0)";
                }
            }
                );
        }