title | description | author | ms.author | ms.date | ms.topic | ms.service | services |
---|---|---|---|---|---|---|---|
Get started with iOS map control | Microsoft Azure Maps |
Become familiar with the Azure Maps iOS SDK. See how to install the SDK and create an interactive map. |
stevemunk |
v-munksteve |
11/23/2021 |
how-to |
azure-maps |
azure-maps |
The Azure Maps iOS SDK is a vector map library for iOS. This article guides you through the processes of installing the Azure Maps iOS SDK and loading a map.
Be sure to complete the steps in the Quickstart: Create an iOS app article.
The Azure Maps iOS SDK provides three ways of setting the language and regional view of the map. The following code demonstrates the different ways of setting the language to French ("fr-FR") and the regional view to "Auto".
-
Pass the language and regional view information into the
AzureMaps
class using the staticlanguage
andview
properties. This sets the default language and regional view properties in your app.// Alternatively use Azure Active Directory authenticate. AzureMaps.configure(aadClient: "<Your aad clientId>", aadAppId: "<Your aad AppId>", aadTenant: "<Your aad Tenant>") // Set your Azure Maps Key. // AzureMaps.configure(subscriptionKey: "<Your Azure Maps Key>") // Set the language to be used by Azure Maps. AzureMaps.language = "fr-FR" // Set the regional view to be used by Azure Maps. AzureMaps.view = "Auto"
-
You can also pass the language and regional view information to the map control init.
MapControl(options: [ StyleOptions.language("fr-FR"), StyleOptions.view("Auto") ])
-
The final way of programmatically setting the language and regional view properties uses the maps
setStyle
method. Do this any time you need to change the language and regional view of the map.mapControl.getMapAsync { map in map.setStyle([ StyleOptions.language("fr-FR"), StyleOptions.view("Auto") ]) }
Here is an example of an Azure Maps application with the language set to "fr-FR" and regional view set to "Auto".
:::image type="content" source="media/ios-sdk/how-to-use-ios-map-control-library/fr-borderless.png" alt-text="A map image showing labels in French.":::
For a complete list of supported languages and regional views, see Localization support in Azure Maps.
This section details the various ways to navigate when in an Azure Maps program.
- Touch the map with two fingers and pinch together to zoom out or spread the fingers apart to zoom in.
- Double tap the map to zoom in one level.
- Double tap with two fingers to zoom out the map one level.
- Tap twice; on second tap, hold your finger on the map and drag up to zoom in, or down to zoom out.
- Touch the map and drag in any direction.
- Touch the map with two fingers and rotate.
- Touch the map with two fingers and drag them up or down together.
The Azure Maps iOS SDK supports using the Azure Government cloud. You specify using the Azure Maps government cloud domain by adding the following line of code where the Azure Maps authentication details are specified:
AzureMaps.domain = "atlas.azure.us"
Be sure to use Azure Maps authentication details from the Azure Government cloud platform when authenticating the map and services.
See the following articles for additional code examples: