This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .
From startups to large organizations, our customers in every industry use mapping and location-aware technology in their mobile solutions and Line-of-Business applications. It can be for mobile workforces, tracking assets (IoT), or as simple as helping a customer find your business (Store locator).
Azure Maps already has support for the Web and Android, but as of today, we are excited to announce the public preview of Azure Maps iOS SDK! With the Azure Maps iOS SDK, we make it easier for developers to integrate immersive mapping solutions in their mobile applications for the Apple ecosystem with the power of the Microsoft Cloud.
The Azure Maps iOS SDK has functional parity of the feature set in the Azure Maps Web SDK and Azure Maps Android SDK for easy cross-platform adoption. Like the Android SDK, our iOS SDK leverages the data-driven style expressions and supports vector tiles to provide the best user experience for customers' business logic and boost the performance of rendering massive data set.
Ease of development and maintenance
When working on a cross-platform solution, it is essential to reuse your Azure Maps knowledge across these different platforms without losing time in relearning. The Azure Maps team is proud to create a consistent developer experience across our Web, Android, and iOS offerings. Developers can easily add rich and performant map visualizations and geospatial experiences to their solutions across different platforms with the benefit of consistent code and low maintenance.
For example, the code below demonstrates adding a heat map layer to an Azure Map in Web, Android, and iOS projects. As a result, developers now can use almost identical code to develop mapping solutions and offer a consistent experience across these platforms.
How to add Azure Maps to an iOS app you can read in the following steps:
- Sign into the Azure portal. If you don't have an Azure subscription, create a free account before you begin.
- Make an Azure Maps account.
- Obtain a primary subscription key, also known as the primary key or the subscription key. For more information on authentication in Azure Maps, see manage authentication in Azure Maps.
- Download Xcode on the Mac App Store for free.
- The Azure Maps iOS SDK is distributed via the Swift Package Manager for this public preview.
Create a project in Xcode
First, create a new iOS App project. Complete these steps to create an Xcode project:
- Under File, select New -> Project.
- On the iOS tab, select App, and then choose Next.
- Enter app name, bundle id, and select Next.
See the Creating an Xcode Project for an App for more help with creating a new project.
Install the Azure Maps iOS SDK
The next step in building your application is to install the Azure Maps iOS SDK. Complete these steps to install the Azure Maps Control:
- Under Project setting’s Package Dependencies, click on + button to add package dependency.
- Inside the appeared dialog, in the search bar in the top right corner, insert https://github.com/Azure/azure-maps-ios-sdk-distribution.git, in Dependency rule version field, fill 1.0.0-pre.1 (We recommended to use Up to Next Major Version in the Dependency Rule)
- Wait until package gets resolved alongside its dependencies. Click on Add Package to complete the dependency setup.
Add the Map Control to the View
Now that we have the Azure Maps Control installed, we can use the Map Control in our project.
- Add custom UIView to the view controller.
- Select MapControl class from AzureMapsControl module
- In the AppDelegate.swift file you'll need to:
- add import for the Azure Maps SDK
- set your Azure Maps authentication information: Setting the authentication information on the AzureMaps class globally using the AzureMaps.configure(subscriptionKey:) or AzureMaps.configure(aadClient:aadAppId:aadTenant:) methods makes it so you won't have to add your authentication information on every view.
- Select the run button, or press CMD + R, to build your application. Xcode will take a few seconds to build the application. After the build is complete, you can test your application on the simulated iOS device.