-
Notifications
You must be signed in to change notification settings - Fork 129
Getting Started
![]() |
![]() |
![]() |
---|---|---|
To develop apps for mixed reality headsets, you need the Windows 10 Fall Creators Update or newer | Check the Unity Support Matrix for a list of supported Unity versions | Visual Studio is used for code editing, deploying and building UWP app packages |
A Bing Maps developer key is required to enable the mapping functionality of the SDK.
-
Sign-in to the Bing Maps Dev Center.
- For new accounts, follow the instructions at Creating a Bing Maps Account.
-
Select My keys under My Account, and select the option to create a new key.
-
Provide the following required information to create a key:
- Application name: The name of the application.
- Key type: Basic or Enterprise. Key types are explained here.
- Application type: Select Other Public Mobile App.
-
Click the Create button. The new key displays in the list of available keys. This key will be used later when setting up the Unity project.
For more information about how developer key usage is accounted, see Understanding Bing Maps Transactions.
This repo contains a Sample Project which can be cloned or downloaded and then opened in Unity.
The sample project provides a good starting point. It is configured to use the latest version of the SDK, a recent snapshot of MRTK, and it contains a collection of sample scenes.
The SDK can also be added to an existing Unity project. This requires modifying Unity's package manifest to include a reference to the SDK package.
-
Locate the Unity project's folder.
In the
Packages
directory, openmanifest.json
.Append the
scopedRegistries
section to the beginning of the manifest and modifydependencies
as follows:{ "scopedRegistries": [ { "name": "Maps SDK for Unity", "url": "https://unity.virtualearth.net/npm/registry/", "scopes": [ "com.microsoft.maps" ] } ], "dependencies": { "com.microsoft.maps.unity": "0.11.1", <Existing dependencies: Do not remove> } }
-
Open the Unity editor for the corresponding project. A dialog should appear showing the progress of importing the new package.
-
If the project targets the universal render pipeline (URP), install the support package.
-
Create a map
-
Add a new GameObject to the Scene.
-
Add a MapRenderer component to the GameObject:
Add component
->Scripts
->Microsoft.Maps.Unity
->MapRenderer
-
In the MapSession component, provide the Bing Maps key.
When the Bing Maps key is set in Editor mode, it's value will be serialized to the Scene or prefab. Alternatively, the key can be set in play mode programmatically via MapSession.DeveloperKey.
Once a valid key is provided, the map will render. See Configuring the MapRenderer for more details.
When new versions of the SDK are published, they will be shown in Package Manager.
To be notified when new versions are available, watch for updates to the Changelog.
Versions before the release of 0.9.0 were provided as a NuGet package and used a NuGet plugin for Unity to manage installation and updates of the SDK.
As of version 0.9.0, the SDK is available as a Unity package which can be installed and updated from within the editor using the Package Manager window.
To migrate from an older version of the SDK to 0.9.0 or newer, follow the steps below.
To migrate from the NuGet package to the NPM package:
- Remove the Microsoft.Maps.Unity NuGet package.
Nuget -> Manage Nuget Packages
- Go to
Installed
tab - Uninstall
Microsoft.Maps.Unity
- If no other NuGet packages are being used in the project, the NuGet plugin can be removed by deleting the following:
-
Assets\Nuget
directory Assets\Nuget.config
-
Assets\Packages
directory Assets\Packages.config
-
- Next, follow the steps here to install the latest version of the SDK via the Package Manager.
Version 0.9.0 introduced various breaking changes due to moving components from the DLL to scripts.
An editor extension has been provided to automate the process of upgrading the GUIDs.
In the editor, go to Assets -> Maps SDK for Unity -> Upgrade Component GUIDs
Other breaking changes to APIs are not automated. If more information is required to resolve other errors in the scripts, refer to the Changelog for description of APIs that were modified.
- Configuring the map
- Attaching GameObjects
- Adding labels
- Animating the map
- Raycasting the map
- Displaying copyrights
- Customizing map data
- Displaying contour lines
- Microsoft.Geospatial
- Microsoft.Geospatial.VectorMath
-
Microsoft.Maps.Unity
- ClippingVolumeDistanceTextureResolution
- ClusterMapPin
- CoordinateClamping
- DefaultElevationTileLayer
- DefaultTextureTileLayer
- DefaultTrafficTextureTileLayer
- ElevationTile
- ElevationTileLayer
- ElevationTileLayerList
- FontStyle
- FontWeight
- HttpTextureTileLayer
- IMapSceneAnimationController
- Intersection
- IntersectionType
- IPinnable
- LanguageChangedEvent
- LatLonAltUnityEvent
- LatLonUnityEvent
- LatLonWrapper
- MapColliderType
- MapConstants
- MapContourLineLayer
- MapCopyrightAlignment
- MapCopyrightLayer
- MapDataCache
- MapDataCacheBase
- MapDeveloperKeySource
- MapImageryStyle
- MapImageryType
- MapInteractionController
- MapInteractionHandler
- MapLabel
- MapLabelLayer
- MapLayer
- MapMouseInteractionHandler
- MapPin
- MapPinLayer
- MapRenderer
- MapRendererBase
- MapRendererRaycastHit
- MapRendererTransformExtensions
- MapScaleRatioExtensions
- MapScene
- MapSceneAnimationController
- MapSceneAnimationKind
- MapSceneOfBoundingBox
- MapSceneOfLabelAndZoomLevel
- MapSceneOfLocationAndZoomLevel
- MapSession
- MapShape
- MapTerrainType
- MapTouchInteractionHandler
- ObservableList
- ObservableMapPinList
- ServiceOptions
- Style
- SystemLangaugeConverter
- TextureTile
- TextureTileLayer
- TextureTileLayerList
- TileLayer
- TileLayerList
- UnityTaskFactory
- UnityWebRequestAwaiter
- UnityWebRequestAwaiterExtensionMethods
- WaitForMapLoaded
- WaitForMapSceneAnimation
- Microsoft.Maps.Unity.Search