Indoor maps in the iOS SDK (Preview)

The Azure Maps iOS SDK allows you to render indoor maps created in Azure Maps Creator services.

Note

Azure Maps iOS SDK retirement

The Azure Maps Native SDK for iOS is now deprecated and will be retired on 3/31/25. To avoid service disruptions, migrate to the Azure Maps Web SDK by 3/31/25. For more information, see The Azure Maps iOS SDK migration guide.

Prerequisites

  1. Complete the steps in the Quickstart: Create an iOS app. Code blocks in this article can be inserted into the viewDidLoad function of ViewController.
  2. A Creator resource
  3. Get a tilesetId by completing the Tutorial: Use Creator to create indoor maps. The tileset ID is used to render indoor maps with the Azure Maps iOS SDK.

Instantiate the indoor manager

To load the indoor tilesets and map style of the tiles, you must instantiate an IndoorManager and keep a strong reference to it.

guard let indoor = try? IndoorManager(azureMap: map, options: [.tilesetID({Your-tilesetID})]) else { return }
self.indoorManager = indoor

Important

This guide assumes that your Creator service was created in the United States. If your Creator service was created in Europe, add the following code:

self.indoorManager.setOptions([.geography(.eu)])

Indoor level picker control

The Indoor Level Picker control allows you to change the level of the rendered map. You can optionally initialize an IndoorControl and set to the appropriate option on the IndoorManager as in the following code:

let levelControl = IndoorControl(options: [.controlPosition(.topRight)])
self.indoorManager.setOptions([.levelControl(levelControl)])

Tip

The level picker appears when you tap on a facility.

Indoor events

Add a delegate to the IndoorManager to listen to indoor map events:

self.indoorManager.addDelegate(self)

IndoorManagerDelegate has one method, which is invoked when a facility or floor changes.

func indoorManager(
    _ manager: IndoorManager,
    didSelectFacility selectedFacility: IndoorFacilitySelection,
    previousSelection: IndoorFacilitySelection
) {
    // code that you want to run after a facility or floor has been changed
    print("New selected facility's ID:", selectedFacility.facilityID)
    print("New selected floor:", selectedFacility.levelsOrdinal)
}

Example

The following screenshot shows the above code displaying an indoor map.

A screenshot that displays an indoor map created using the above sample code.

Additional information