Skip to content

Sample project

kircher1 edited this page Aug 30, 2019 · 6 revisions

Setup

The sample project is included in the repo, which can be cloned or downloaded, then opened in Unity. Alternatively, a Unity package that contains the sample scenes is available at the Release page.

Once the sample has been downloaded or imported into Unity, make sure to sign up for a Bing maps developer key to enable the mapping functionality.

UWP specific setup

If you wish to build the example project with Unity using UWP platform, you must install Windows 10 SDK version 18362+. It can be downloaded here.

Unity configuration

The sample project uses Unity 2018.3.

Scripting runtime version is set to .NET 4.X.

The project is compatible with Standalone and UWP platforms and uses the IL2CPP scripting backend, although it is also compatible with .NET/Mono scripting backends as well.

The stereo rendering mode is set to Single Pass Instanced.

Example scenes

MapPinExample.scene

This scene demonstrates how to use the MapPin system to pin GameObjects to the map.

The MRTK input system is configured for panning, zooming, and rotating the map. For Windows Mixed Reality touch controllers, these actions are mapped to the right-hand controller.

CityTourExample.scene

This scene continually animates the map to various locations around Seattle to demonstrate how the map can dynamically stream 3D data.

The MapScene-related APIs are used to chain the animations together.

WeatherCubeExample.scene

A scene intended for use with HoloLens/HoloLens 2.

Displays the Space Needle with pre-canned weather information.

MRTK's BoundingBox script is used to scale and rotate the map.

MapServiceExample.scene

Demonstrates how to use the MapLocationFinder to reverse geocode locations and display the results on a MapRenderer.

This scene uses MRTK's input system to interact with the MapRenderer via motion controllers or hand controls. As locations are selected on the MapRenderer via these sorts of input, the selected location is reverse geocoded and the resulting address is displayed via a MapPin.

Mixed Reality Toolkit

The project includes a drop of the Mixed Reality Toolkit to handle various tasks like controller tracking, rendering, and input management.

Custom profiles are provided that can route touch-controller input to map interactions like panning and zooming.

TextMeshPro

TextMeshPro is used for MapLabels and various UI text.

TextMeshPro text rendering is very high quality. In mixed reality scenarios, where readability of text is sometimes challenging, TextMeshPro works quite well.

You can’t perform that action at this time.