MultiSet
Developer Portal
  • MultiSet Developer Docs
  • Getting Started
    • Changelog
    • VPS SDK : Unity Guide
    • FAQ
  • Basics
    • Maps
      • Mapping Instruction
      • Mapping Planning
      • Mapping Equipment
    • MapSet : Multiple Maps
      • Merging Maps without Overlap
        • Extend a MapSet
      • Merging Maps with Overlap
      • Adjust Map Transformation
    • App Localization
    • Credentials
    • Analytics and Usage
    • Downloads
    • REST API Docs
    • WebXR Integration
    • Third Party Scans
      • Matterport
    • MapFoundry
    • Georeferencing Maps
  • Unity-SDK
    • MultiSet package import
      • Universal 3D (Core) support
    • Sample Scenes
    • On-Cloud Localization
      • Individual Map
      • MapSet (Multiple maps)
        • Hint MapCodes
      • Pose Prior : HintPosition
    • Occlusion
    • NavMesh Navigation
  • Support
  • Native Support
    • iOS Native
Powered by GitBook
On this page
  • Add MapSet Mesh in Unity to visualize your Mesh
  • Update Map Set Code in Runtime

Was this helpful?

  1. Unity-SDK
  2. On-Cloud Localization

MapSet (Multiple maps)

Localization explanation in MapSet

PreviousIndividual MapNextHint MapCodes

Last updated 5 months ago

Was this helpful?

To localize a user on a specific mapSet, provide the Map Set Code where the user is located. Retrieve the mapSetID by logging into the Developer Portal or using our REST API

In the Map Localization Manager in Unity SDK, select Localization Type as "Mapset" and then past your mapSetID

Add MapSet Mesh in Unity to visualize your Mesh

Download the combined Mesh from the developer portal and add it in Unity SDK to visualize your maps

Update Map Set Code in Runtime

To dynamically change the mapOrMapsetCode at runtime in your existing script, you can create a UI input field or a method that updates the mapOrMapsetCode in the MapLocalizationManager. Below is an example script showcasing how to do this via a simple button press or direct method call.

using MultiSet;
using UnityEngine;
using UnityEngine.UI;

public class MapSetCodeUpdater : MonoBehaviour
{
    // Reference to the Map Localization Manager
    private MapLocalizationManager mapLocalizationManager;

    // Input field to get the new Map ID from the user
    [SerializeField]
    private InputField mapCodeInputField;

    void Start()
    {
        // Find the Map Localization Manager component in the scene
        mapLocalizationManager = FindObjectOfType<MapLocalizationManager>();

        if (mapLocalizationManager == null)
        {
            Debug.LogError("MapLocalizationManager not found! Please ensure it is added to the scene.");
        }

        if (mapCodeInputField == null)
        {
            Debug.LogError("InputField reference is missing! Please assign it in the inspector.");
        }
        
        mapLocalizationManager.localizationType = LocalizationType.Mapset;
    }

    // Method to update the Map ID
    public void UpdateMapId()
    {
        if (mapLocalizationManager != null && mapCodeInputField != null)
        {
            string newMapCode = mapCodeInputField.text;

            if (!string.IsNullOrWhiteSpace(newMapCode))
            {
                mapLocalizationManager.mapOrMapsetCode = newMapCode;
                Debug.Log($"Map Code updated to: {newMapCode}");
            }
            else
            {
                Debug.LogWarning("Map Code cannot be empty! Please enter a valid Code.");
            }
        }
    }
}