Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Sample Project

kircher1 edited this page Jun 3, 2021 · 1 revision

Setup

The sample project is included in the repo, which can be cloned or downloaded, then opened in Unity.

Sign up for a Bing maps developer key to enable the mapping functionality in the sample scenes.

Unity configuration

  • The sample project uses Unity 2019.4.
  • The API compatibility level is set to .NET Standard 2.0.
  • For mixed-reality devices, the stereo rendering mode is set to Single Pass Instanced on supported platforms.

Example scenes for mixed reality devices

The following scenes are intended to be used on HoloLens, HoloLens 2, or VR headsets.

These scenes demonstrate how to integrate the map with the Mixed Reality Toolkit (MRTK). Custom profiles and scripts are provided that can translate MRTK-based events to map interactions like panning and zooming.

2DPanelExample.unity

Displays a map using HttpTextureTileLayer to overlay weather radar imagery and using MapScene animations to change the location of the map.

The map is oriented vertically as a flat panel that can be attached to a wall.

CityTourExample.unity

This scene continually animates the map to various landmarks around Seattle, demonstrating how the map can dynamically stream 3D data.

The MapScene related APIs are used to chain these animations together.

CustomElevationExample.unity

This scene uses a custom ElevationTileLayer to display a higher resolution set of tiles for a specific area.

This scene also demonstrates how to use a custom shader for the terrain, which in this case integrates the rendering with Unity's standard shader.

MapPinExample.unity

This scene demonstrates how to use the MapPin system to pin GameObjects to the map. The MapContourLineLayer is used to emphasize elevation.

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

MapServiceExample.unity

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.

WeatherCubeExample.unity

Displays the Space Needle with sample weather information.

MRTK's ObjectManipulator script can be used to translate, scale, and rotate the map.

Example scenes for phone-based AR

The following scene is meant to be built to mobile devices (Android and iOS).

UnityARMapExample.unity

Provides a basic AR table top scenario on mobile devices. Through the touch display the user can rotate and scale the map, go to various locations and change the shape of the map.

Further information on working with mobile devices can be found on MRTK's guide here

Example scenes for desktop and phone

The following scene is not intended for mixed-reality devices, but rather 2D screens, e.g. desktops, laptops, and phones.

2DMapExample.unity

This scene demonstrates a basic use case of a flat, interactable map.

  • Pan or zoom via mouse or touch interactions.
  • Use the search bar can be used to find cities and addresses.
  • Toggle the style to show either symbolic imagery or aerial imagery.
  • Visualize traffic conditions with a traffic flow layer.

Clone this wiki locally