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

Microsoft.Maps.Unity

Brian Kircher edited this page Aug 29, 2019 · 27 revisions

ClusterMapPin

Represents a cluster of MapPins at the specified level of detail.

public class Microsoft.Maps.Unity.ClusterMapPin
    : Pinnable

Properties

Type Name Summary
Int16 LevelOfDetail The level of detail represented by this cluster.
LatLon Location The location of the MapPin.
Int32 Size The number of pins in this cluster.

FontStyle

The style of the font.

public enum Microsoft.Maps.Unity.FontStyle
    : Enum, IComparable, IFormattable, IConvertible

Enum

Value Name Summary
0 Normal Default font style.
1 Italic Slanted font style.

FontWeight

The weight of the font.

public enum Microsoft.Maps.Unity.FontWeight
    : Enum, IComparable, IFormattable, IConvertible

Enum

Value Name Summary
0 Normal Default weight.
1 Bold Thick stroked font weight.

IMapSceneAnimationController

Animates a MapRenderer to the specified MapScene.

public interface Microsoft.Maps.Unity.IMapSceneAnimationController

Properties

Type Name Summary
WaitForMapSceneAnimation YieldInstruction Returns a yieldable object that can be used to wait for animation to complete.

Methods

Type Name Summary
void Initialize(MapRenderer mapRenderer, MapScene mapScene, Single animationTimeScale, MapSceneAnimationKind mapSceneAnimationKind) Initializes the controller to animate the specified MapScene.
Boolean UpdateAnimation(Single currentZoomLevel, LatLon currentLocation, Single& zoomLevel, LatLon& location) Updates the zoom level and location for this frame of the animation.

Intersection

Helpers to do intersection tests.

public static class Microsoft.Maps.Unity.Intersection

Static Methods

Type Name Summary
Boolean Intersect(Ray& ray, Vector3& v0, Vector3& v1, Vector3& v2, Single& distanceAlongRayToIntersection) Intersects a ray and triangle.
Boolean Intersect(Vector3& linePoint, Vector3& lineDirection, Vector3& planeNormal, Vector3& planePoint, Vector3& intersection, Single& length) Intersects a ray and triangle.

LatLonWrapper

Serializable wrapper class for a LatLon.

public struct Microsoft.Maps.Unity.LatLonWrapper

Fields

Type Name Summary
Double Latitude Gets the latitude in degrees.
Double Longitude Gets the longitude in degrees.

Methods

Type Name Summary
LatLon ToLatLon() Converts to a LatLon. Wraps longitude so that values always are between -180 and +180.
String ToString() String representation of the LatLonWrapper.

MapConstants

Utility map constant values.

public class Microsoft.Maps.Unity.MapConstants

Static Fields

Type Name Summary
Int32 MaximumZoomLevel Highest zoom level for the map.
Int32 MinimumZoomLevel Lowest zoom level for the map.

MapCopyrightLayer

Handles rendering and positioning of copyright text associated with the MapRenderer. This layer is automatically added when the MapRenderer component is added to a GameObject.

public class Microsoft.Maps.Unity.MapCopyrightLayer
    : MapLayer

MapLabel

This component is used to transfer labeling information to a GameObject.

public class Microsoft.Maps.Unity.MapLabel
    : Pinnable

Fields

Type Name Summary
Style Style Gets or sets the recommended styling information for this label.
String Text Gets or sets the test of the label.

MapLabelLayer

This MapLayer can be added to a MapRenderer GameObject to enable labeling of the map. Only one MapLabelLayer is allowed on a given GameObject. Also, in order for the MapLabelLayer to function properly, a LabelPrefab must be set before the first Update().

public class Microsoft.Maps.Unity.MapLabelLayer
    : MapLayer

Properties

Type Name Summary
MapLabel MapLabelPrefab The GameObject used to replicate labels into the map.

MapLayer

Base class for any type of MapLayer. A MapLayer instance can only be associated with a single MapRenderer.

public abstract class Microsoft.Maps.Unity.MapLayer
    : MonoBehaviour

Properties

Type Name Summary
String LayerName The name of the MapLayer. This may be useful for disambiguating multiple layers on the same GameObject.
MapRenderer MapRenderer The MapRenderer that this layer has been attached to.

MapPin

A MapPin can be used to pin a GameObject to the map at a specified coordinate.

public class Microsoft.Maps.Unity.MapPin
    : Pinnable

Fields

Type Name Summary
Double Altitude The altitude above the specified Microsoft.Maps.Unity.MapPin.AltitudeReference.
AltitudeReference AltitudeReference The altitude reference to use for the location. By default, uses a Surface altitude reference. If unsure what altitude reference to use, stick with the default. If data is known to be in a specific reference system, e.g. Ellipsoid, then this value must be updated accordingly.
Action<MapPin, LatLon> LocationChanged Action that is invoked when the Location of the MapPin is changed.

Properties

Type Name Summary
LatLon Location The location of the MapPin.

MapPinLayer

Maintains a collection of MapPins. Supports clustering. This layer is queried by the associated MapRenderer to get the MapPins or clusters in the map's current view. All associated MapPins are parented to a child GameObject with the same name as this MapPinLayer.

public class Microsoft.Maps.Unity.MapPinLayer
    : MapLayer

Properties

Type Name Summary
IReadOnlyCollection<ClusterMapPin> ActiveClusterMapPins The ClusterMapPins which are active.
IReadOnlyCollection<MapPin> ActiveMapPins The MapPins which are active.
ClusterMapPin ClusterMapPinPrefab The prefab to use for clusters.
Int32 ClusterThreshold If the number of pins in a spatial region exceed the ClusterThreshold, a single cluster MapPin will be rendered instead.
Boolean IsClusteringEnabled True if the MapPins in this data source should be clustered. Note, if this is set to true, it is expected that a prefab has been provided to ClusterMapPinPrefab.
ObservableList<MapPin> MapPins All MapPins associated with this MapPinLayer.

MapRenderer

Includes RayCasting specific logic for the MapRenderer.

public class Microsoft.Maps.Unity.MapRenderer
    : MonoBehaviour

Fields

Type Name Summary
Vector2 LocalMapDimension The width and length of the map object in its local coordinate system before any transforms are applied.

Properties

Type Name Summary
String BingMapsKey The key used to enable Bing maps services. Must be set to a valid key before the MapRenderer is usable.
GeoBoundingBox Bounds The LatLon bounds of the current map view.
LatLon Center Center of the map.
String Copyright The copyrights and attribution text, which may change based on the current view of the MapRenderer. This string must be displayed near the associated MapRenderer.
Single DetailOffset Increases or decreases the detail of the map. Lower values are less detailed. Higher values are more detailed. Default is 0.
Double ElevationBaseline The altitude in WGS84 meters in which the map's terrain surface has been negatively offset.
Single LocalMapHeight The height of the map object in its local coordinate system before any transforms are applied.
Vector2 MapDimension The width and length of the map object with global scale applied.
Color MapEdgeColor The color of the map edge.
Single MapEdgeColorFadeDistance Starting at the map edge, this value is the distance normalized from the map dimension over which the edge color is faded.
Single MapHeight The height of the map with global scale applied, i.e. LocalMapHeight * transform.lossyScale.y.
IReadOnlyList<MapLayer> MapLayers The MapLayers associated with this MapRenderer.
MapTerrainType MapTerrainType The type of terrain used for rendering the map.
Single MaximumZoomLevel The maximum zoom level to enforce on the map. 1.0 is the smallest possible zoom level value, and 20.0 is the largest.
Single MinimumZoomLevel The minimum zoom level to enforce on the map. 1.0 is the smallest possible zoom level value, and 20.0 is the largest.
Boolean ShowMapDataInEditor If true, during edit mode shows map data. Data usage in the editor will apply to the specified Bing maps key.
Single ZoomLevel Zoom level. Lower values are more zoomed out. Higher values are more zoomed in.

Methods

Type Name Summary
Boolean Raycast(Ray ray, MapRendererRaycastHit& hitInfo) Casts a ray against the map and returns detailed information about the hitpoint.
Boolean Raycast(Ray ray, MapRendererRaycastHit& hitInfo, Single maxDistance) Casts a ray against the map and returns detailed information about the hitpoint.
Boolean Raycast(Vector3 origin, Vector3 rayDirection, MapRendererRaycastHit& hitInfo) Casts a ray against the map and returns detailed information about the hitpoint.
Boolean Raycast(Vector3 origin, Vector3 rayDirection, MapRendererRaycastHit& hitInfo, Single maxDistance) Casts a ray against the map and returns detailed information about the hitpoint.
WaitForMapSceneAnimation SetMapScene(MapScene mapScene, IMapSceneAnimationController mapSceneAnimationController, MapSceneAnimationKind mapSceneAnimationKind = Bow, Single animationTimeScale = 1) Sets the MapRenderer's view to reflect the new MapScene using the specified IMapSceneAnimationController.

MapRendererRaycastHit

Structure used to get information back form a raycast of a MapRenderer.

public struct Microsoft.Maps.Unity.MapRendererRaycastHit

Fields

Type Name Summary
Single Distance Distance to the hit point from the origin of the raycast.
LatLonAlt Location The geographic location where the ray hit the MapRenderer.
Vector3 Normal The normal vector of the triangle that was hit.
Vector3 Point The impact point in world space where the ray hit the MapRenderer.

MapScene

MapScene is used for changing and animating the map view.

public abstract class Microsoft.Maps.Unity.MapScene

Methods

Type Name Summary
void GetLocationAndZoomLevel(LatLon& location, Double& zoomLevel) Returns the location and zoom level for the MapScene.

MapSceneAnimationKind

Specifies the animation to use when setting a MapScene.

public enum Microsoft.Maps.Unity.MapSceneAnimationKind
    : Enum, IComparable, IFormattable, IConvertible

Enum

Value Name Summary
0 None No animation.
1 Linear A linear animation.
2 Bow A parabolic animation.

MapSceneOfLabelAndZoomLevel

MapScene positioned on a MapLabel and a zoom level.

public class Microsoft.Maps.Unity.MapSceneOfLabelAndZoomLevel
    : MapScene

Properties

Type Name Summary
MapLabel MapLabel The MapLabel.
Single ZoomLevel The final zoom level.

Methods

Type Name Summary
void GetLocationAndZoomLevel(LatLon& location, Double& zoomLevel)

MapTerrainType

The type of terrain used for rendering the map.

public enum Microsoft.Maps.Unity.MapTerrainType
    : Enum, IComparable, IFormattable, IConvertible

Enum

Value Name Summary
0 Default The map terrain consists of either elevation data or high resolution 3D models.
1 Elevated The map terrain consists only of elevation data. No high resolution 3D models are used.
2 Flat Both elevation and high resolution 3D models are disabled. The map terrain surface will be flat.

OberservableMapPinList

List of MapPins with callbacks for item addition and removal. Also, this list can be serialized.

public class Microsoft.Maps.Unity.OberservableMapPinList
    : ObservableList<MapPin>, IList<MapPin>, ICollection<MapPin>, IEnumerable<MapPin>, IEnumerable

ObservableList<T>

A list implementation with notifications for add and remove.

public class Microsoft.Maps.Unity.ObservableList<T>
    : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable

Properties

Type Name Summary
Int32 Count Gets the number of elements in the list.
Boolean IsReadOnly Gets a value indicating whether the ObservableList is readonly.
T Item Gets or sets the element at the specified index.
Action<T> OnItemAdded Action that handles a single item being added to the last.
Action<T> OnItemRemoved Action that handles a single item being removed from the list.
Action<IEnumerable<T>> OnRangeAdded Action that handles a range of items being added to the list.
Action<IEnumerable<T>> OnRangeRemoved Action that handles a range of items being removed from the list.

Methods

Type Name Summary
void Add(T item) Adds an item to the ObservableCollection.
void AddRange(IEnumerable<T> items) Adds a range of items to the ObservableCollection.
void Clear() Removes all items from the ObservableCollection.
Boolean Contains(T item) Determines whether the ObservableCollection contains a specific value.
void CopyTo(T[] array, Int32 arrayIndex) Copies the elements of the ObservableCollection to an Array, starting at a particular Array index.
IEnumerator<T> GetEnumerator() Returns an enumerator that iterates through a collection.
Int32 IndexOf(T item) Determines the index of a specific item in the ObservableCollection.
void Insert(Int32 index, T item) Inserts an item to the ObservableCollection at the specified index.
Boolean Remove(T item) Removes the first occurrence of a specific object from the ObservableCollection.
void RemoveAt(Int32 index) Removes the item at the specified index.

Pinnable

Encapsulates a Unity component that can be positioned on a map. This should not be derived from directly. Use MapPin instead.

public abstract class Microsoft.Maps.Unity.Pinnable
    : MonoBehaviour

Fields

Type Name Summary
AnimationCurve ScaleCurve The scale of the Pinnable relative to ZoomLevel.
Boolean UseRealWorldScale If true, the ScaleCurve is relative to the real-world scale at a given zoom level. As the map zooms out, size falls off exponentially. If false, the ScaleCurve represents the direct scale of the MapPin at a given zoom level.

Style

Encapsulate recommended styling information about a label.

public class Microsoft.Maps.Unity.Style

Properties

Type Name Summary
Color Color Gets the recommended color of the label.
FontStyle FontStyle Gets the recommended style of the the label.
FontWeight FontWeight Gets the recommended weight of the label.
Int32 Rank Gets the recommended ranking of the label which can be used to determine label size.

UnityWebRequestAwaiter

Enables UnityWebRequest operations to be awaited from within an async method.

public class Microsoft.Maps.Unity.UnityWebRequestAwaiter
    : INotifyCompletion

Properties

Type Name Summary
Boolean IsCompleted True if the underlying async operation is completed.

Methods

Type Name Summary
void GetResult() Returns the result. Void in this case.
void OnCompleted(Action continuation) Schedules the continuation action that's invoked when the instance completes.

WaitForMapSceneAnimation

Used to suspend coroutine execution once the associated MapScene animation has been completed or cancelled.

public class Microsoft.Maps.Unity.WaitForMapSceneAnimation
    : CustomYieldInstruction, IEnumerator

Properties

Type Name Summary
Boolean keepWaiting Returns false once the animation has been completed or cancelled.

Methods

Type Name Summary
void SetComplete() Completes the yield instruction.

Clone this wiki locally