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

Microsoft.Maps.Unity

Brian Kircher edited this page Jun 8, 2020 · 27 revisions

ClippingVolumeDistanceTextureResolution

Texture resolution used to render clipping volume walls. Higher resolution will have the best quality in terms of how closely the wall edge matches the terrain.

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

Enum

Value Name Summary
0 Low Low resolution texture.
1 Medium Medium resolution texture.
2 High High resolution texture.

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.

DefaultElevationTileLayer

The Microsoft.Maps.Unity.DefaultElevationTileLayer is used to display Bing Maps 3D elevation data, which has world-wide coverage.

public class Microsoft.Maps.Unity.DefaultElevationTileLayer
    : ElevationTileLayer

Methods

Type Name Summary
Task<ElevationTile> GetElevationTileData(TileId tileId, CancellationToken cancellationToken = null)
Task<Boolean> HasElevationTile(TileId tileId, CancellationToken cancellationToken = null)

DefaultTextureTileLayer

Encapsulates a Microsoft.Maps.Unity.TextureTileLayer that displays Bing Maps imagery.

public class Microsoft.Maps.Unity.DefaultTextureTileLayer
    : TextureTileLayer

Properties

Type Name Summary
Boolean AreLabelsEnabled True if labels are included in the texture.
Boolean AreRoadsEnabled True if roads, borders, and other lines are included in the texture.
MapImageryStyle ImageryStyle The style to use for the imagery.
MapImageryType ImageryType The base imagery to use for the Microsoft.Maps.Unity.TextureTileLayer, aerial or symbolic.
Boolean IsHillShadingEnabled True if hill shading is enabled. Does not apply to Microsoft.Maps.Unity.MapImageryType.Aerial.

Methods

Type Name Summary
Task<Nullable<TextureTile>> GetTexture(TileId tileId, CancellationToken cancellationToken = null) This method can only be used by Microsoft.Maps.Unity.MapRenderer.TextureTileLayers and will fail if called.
String ToString()

ElevationTile

An Microsoft.Maps.Unity.ElevationTile contains the elevation data used for rendering, ray casting, and pin placement. The data is provided in some form of a height map where each pixel or entry represents an elevation value in meters relative to the WGS84 ellipsoid. The extents of the tile are defined in Mercator space by the Microsoft.Maps.Unity.ElevationTile.TileId.

public class Microsoft.Maps.Unity.ElevationTile

Properties

Type Name Summary
Int32 Height The width of the tile, i.e. number of elevation samples along lines of longitude.
TileLevelOfDetail LevelOfDetail The level of detail corresponding to the Microsoft.Maps.Unity.ElevationTile.TileId.
TileId TileId The Microsoft.Maps.Unity.ElevationTile.TileId which defines the extents of this tile.
Int32 Width The width of the tile, i.e. number of elevation samples along lines of latitude.

Static Methods

Type Name Summary
ElevationTile FromDataInMeters(TileId tileId, Int32 width, Int32 height, Single[] dataInMeters) Creates an Microsoft.Maps.Unity.ElevationTile from elevation data in meters. Data should be row-major with origin in the northwest corner.
ElevationTile FromDataInMeters(TileId tileId, Int32 width, Int32 height, Byte[] dataInMetersAsBytes, Int32 dataOffset = 0) Creates an Microsoft.Maps.Unity.ElevationTile from elevation data in meters. Data should be row-major with origin in the northwest corner.
ElevationTile FromNormalizedData(TileId tileId, Int32 width, Int32 height, Single minElevationInMeters, Single elevationRangeInMeters, UInt16[] normalizedData) Creates an Microsoft.Maps.Unity.ElevationTile from elevation data normalized into fxied point 16-bit values encoded as ushorts. The original elevation in meters can be reconstructed from the minElevationInMeters, the elevationRangeInMeters, and the normalized data. Data should be row-major with origin in the northwest corner.
ElevationTile FromNormalizedData(TileId tileId, Int32 width, Int32 height, Single minElevationInMeters, Single elevationRangeInMeters, Byte[] normalizedDataAsBytes, Int32 dataOffset = 0) Creates an Microsoft.Maps.Unity.ElevationTile from elevation data normalized into fxied point 16-bit values encoded as ushorts. The original elevation in meters can be reconstructed from the minElevationInMeters, the elevationRangeInMeters, and the normalized data. Data should be row-major with origin in the northwest corner.
Task<ElevationTile> FromNull() Used for an Microsoft.Maps.Unity.ElevationTile that is not present. This is equivalent to returning a task result from null. It is more efficient to use this however as the return value is cached in order to reduce GC allocations.

ElevationTileLayer

The ElevationTileLayer provides elevation data spatially organized in Mercator tiles (EPSG:3857). The elevation data is used by the Microsoft.Maps.Unity.MapRenderer to display 3D terrain.

public abstract class Microsoft.Maps.Unity.ElevationTileLayer
    : TileLayer

Methods

Type Name Summary
Task<ElevationTile> GetElevationTileData(TileId tileId, CancellationToken cancellationToken = null) Gets the data for the specified Microsoft.Geospatial.TileId. Data is organized as a NxN array of floats. Each float represents an elevation value, or altitude, in meters relative to the WGS84 ellipsoid. The array is organized as row-major, with origin at the north-west corner of the tile.
Task<Boolean> HasElevationTile(TileId tileId, CancellationToken cancellationToken = null) Returns a bool for the specified Microsoft.Geospatial.TileId for the avaliability of the data.

ElevationTileLayerList

A serlizable list of Microsoft.Maps.Unity.ElevationTileLayers.

public class Microsoft.Maps.Unity.ElevationTileLayerList
    : TileLayerList<ElevationTileLayer>, IReadOnlyList<ElevationTileLayer>, IReadOnlyCollection<ElevationTileLayer>, IEnumerable<ElevationTileLayer>, IEnumerable

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.

HttpTextureTileLayer

Provides tiles for a Microsoft.Maps.Unity.TextureTileLayer. The tiles are fetched by using the HTTP or HTTPS protocol. Results are assumed to be JPEG or PNG, i.e. anything decodable by UnityEngine.ImageConversion.LoadImage(UnityEngine.Texture2D,System.Byte[]).

public class Microsoft.Maps.Unity.HttpTextureTileLayer
    : TextureTileLayer

Properties

Type Name Summary
String UrlFormatString The UriFormat property accepts the following case-insensitive replacement strings: {x}, {y}, {zoomLevel}, and {quadKey}. For more info about these replacement strings, see Bing Maps Tile System. https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system

Methods

Type Name Summary
Task<Nullable<TextureTile>> GetTexture(TileId tileId, CancellationToken cancellationToken = null) Retrieves the texture data that will be rendered for the specified Microsoft.Geospatial.TileId.

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 IntersectLinePlane(Vector3& linePoint, Vector3& lineDirection, Vector3& planeNormal, Vector3& planePoint, Vector3& intersection, Single& length) Intersects a line and a plane.
Boolean IntersectRayCylinder(Single cylinderHeight, Single cylinderRadius, Ray ray, Single& distance, Boolean& isCapHit) Intersects a ray and a cylinder that sits on origin.
Boolean IntersectRayTriangle(Ray& ray, Vector3& v0, Vector3& v1, Vector3& v2, Single& distanceAlongRayToIntersection) Intersects a ray and a triangle.
IntersectionType IntersectSquareCircle(Vector2 squareCenter, Single squareSideLength, Vector2 circleCenter, Single circleRadius, Single circleRadiusSquared) Test for intersection between a square AABB and a circle.

IntersectionType

This enum can be used to determine if primitives partially overlap.

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

Enum

Value Name Summary
0 None Does not intersect at all.
1 Overlaps There is a partial overlap of the primitives.
2 Inside One primitive is contained completely within or inside the other.

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.

MapColliderType

The type of collider that the map is using.

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

Enum

Value Name Summary
0 None No collider.
1 BaseOnly Collider covering the base of the map.
2 FullExtents Collider covering the full extents of the map.

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.

MapContourLineLayer

Enables contour rendering on the map to show lines of constant elevation relative to the WGS84 ellipsoid. The interval, line width, and line color of the contour is configurable.

public class Microsoft.Maps.Unity.MapContourLineLayer
    : MapLayer

Properties

Type Name Summary
Color MajorColor The color used for the major contour lines.
Single MajorIntervalAltitudeInMeters The altitude interval between major contour lines. This will automatically adjust to the current zoom level of the MapRenderer. This value specifies the interval used at zoom level 20.
Single MajorLinePixelSize The pixel size of the major contour lines.
Color MinorColor The color used for the minor contour lines.
Single MinorLinePixelSize The pixel size of the minor contour lines.
Int32 NumMinorIntervalSections The number of minor sections between major contour lines.

MapCopyrightAlignment

Alignment options for Microsoft.Maps.Unity.MapCopyrightLayer.

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

Enum

Value Name Summary
0 Bottom Default alignment. Copyright text is rendered at the bottom of the map.
1 Top Copyright text is rendered at the top of the map.

MapCopyrightLayer

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

public class Microsoft.Maps.Unity.MapCopyrightLayer
    : MapLayer

MapImageryStyle

The style to apply to the imagery. This does not apply to Microsoft.Maps.Unity.MapImageryType.Aerial.

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

Enum

Value Name Summary
0 Light The default symbolic imagery style.
1 Dark A dark version of the default Microsoft.Maps.Unity.MapImageryStyle.Light style.
2 CanvasLight A simplified version of the map which also has some of the details such as hill shading disabled.
3 CanvasDark A dark version of the Microsoft.Maps.Unity.MapImageryStyle.CanvasLight style.
4 CanvasGray A grayscale version of the Microsoft.Maps.Unity.MapImageryStyle.CanvasLight style.
5 HighContrastLight A high contrast style.
6 HighContrastDark A dark version of the Microsoft.Maps.Unity.MapImageryStyle.HighContrastLight style.
7 Vibrant The vibrant style.

MapImageryType

The type of imagery to use for the Microsoft.Maps.Unity.DefaultTextureTileLayer.

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

Enum

Value Name Summary
0 Symbolic Symbolic imagery.
1 Aerial Aerial imagery.

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 text of the label.

MapLabelLayer

This Microsoft.Maps.Unity.MapLayer can be added to a UnityEngine.GameObject that has a Microsoft.Maps.Unity.MapRenderer to enable labeling. Only one MapLabelLayer is allowed on a UnityEngine.GameObject. In order for the MapLabelLayer to function properly, a prefab containing a Microsoft.Maps.Unity.MapLabel component must be set on this layer.

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.

MapNavigation

This component provides a wrapper on top of a MapRenderer to help with common interactions like panning, zooming, and rotating.

public class Microsoft.Maps.Unity.MapNavigation
    : MonoBehaviour

Methods

Type Name Summary
void Pan(Vector2 direction, Boolean orientWithMap) Pans the map by the specified direction.
void PanEast() Pans the map east.
void PanNorth() Pans the map north.
void PanSouth() Pans the map south.
void PanWest() Pans the map west.
void RotateMap(Boolean isClockwise) Begins a rotation that animates the map by 45 degrees.
void Zoom(Single zoomLevelSpeed, Vector3 gazeOrigin, Vector3 gazeDirection) Adjusts the map's zoom level by the specified magnitude per second. Zooms the map towards the specified gaze ray.
void Zoom(Single zoomLevelSpeed, Ray gazeRay) Adjusts the map's zoom level by the specified magnitude per second. Zooms the map towards the specified gaze ray.
void Zoom(Single zoomLevelSpeed) Adjusts the map's zoom level by the specified magnitude per second. Zooms the map towards the specified gaze ray.

MapPin

A MapPin can be used to pin a UnityEngine.GameObject to a Microsoft.Maps.Unity.MapRenderer at a specified Microsoft.Geospatial.LatLon and altitude.

public class Microsoft.Maps.Unity.MapPin
    : Pinnable

Fields

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

Properties

Type Name Summary
LatLon Location The location of the Microsoft.Maps.Unity.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

Manages streaming and rendering of map data.

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.
Single LocalMapRadius The radius 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 ElevationScale The scale to apply to the vertical dimension of the map. This can be used to exaggerate the terrain's elevation. Microsoft.Maps.Unity.MapPin positions and other features that depend on true elevation values will take the scale into account.
ElevationTileLayerList ElevationTileLayers The collection of active Microsoft.Maps.Unity.ElevationTileLayers.
SystemLanguage Language The language determines the text used to display names of map content like city names, country names, etc.

Unless this property has been set, the language is auto detected from the UnityEngine.Application.systemLanguage. Changing the language value after the Microsoft.Maps.Unity.MapRenderer has been enabled will have no affect.
Single LocalMapHeight The height of the map object in its local coordinate system before any transforms are applied.
Collider MapCollider The UnityEngine.Collider used for the map. The dimensions are synchronized to match the map's layout. Null value if no UnityEngine.Collider is active.
MapColliderType MapColliderType The type of collider that the map is using.
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.
MapShape MapShape The shape of the map we are rendering on.
MapTerrainType MapTerrainType The type of terrain used for rendering the map.
Int64 MaxCacheSizeInBytes The maximum possible cache size used by Microsoft.Maps.Unity.MapRenderers. Modifications to this value have no effect once the Microsoft.Maps.Unity.MapRenderer has been enabled.
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.
TextureTileLayerList TextureTileLayers The collection of active Microsoft.Maps.Unity.TextureTileLayers. Only the first Microsoft.Maps.Unity.MapRenderer.MaxTextureTileLayerCount entries will be used.
Single ZoomLevel Zoom level. Lower values are more zoomed out. Higher values are more zoomed in.

Methods

Type Name Summary
void DisableMaterialKeyword(String keyword) Disables the specified keyword on the active terrain and clipping volume materials.
void EnableMaterialKeyword(String keyword) Enables the specified keyword on the active terrain and clipping volume materials.
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.

Static Fields

Type Name Summary
Int32 MaxTextureTileLayerCount Gets the maximum number of Microsoft.Maps.Unity.TextureTileLayer instances that can be put into Microsoft.Maps.Unity.MapRenderer.TextureTileLayers. This is dictated by the slots set up in the shader.

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.

MapRendererSetMapSceneExtensions

Extension method that allows for setting MapScene using the default MapSceneAnimationController.

public static class Microsoft.Maps.Unity.MapRendererSetMapSceneExtensions

Static Methods

Type Name Summary
WaitForMapSceneAnimation SetMapScene(this MapRenderer mapRenderer, MapScene mapScene, MapSceneAnimationKind mapSceneAnimationKind = Bow, Single animationTimeScale = 1) Sets the MapRenderer's view to reflect the new MapScene using the default IMapSceneAnimationController.

MapRendererTransformExtensions

Helpers to transform between Unity's world and local spaces to the geographic coordinate system of the Microsoft.Maps.Unity.MapRenderer.

public static class Microsoft.Maps.Unity.MapRendererTransformExtensions

Static Fields

Type Name Summary
Double EquatorialCircumferenceInWgs84Meters The WGS84 ellipsoid circumference measured in meters.
Double TwoPi Constat for 2 * Math.PI.

Static Methods

Type Name Summary
Vector3 TransformLatLonAltToWorldPoint(this MapRenderer mapRenderer, LatLonAlt location) Transforms an XYZ point in world space to a Microsoft.Geospatial.LatLonAlt.
Vector2D TransformLocalDirectionToMercator(this MapRenderer mapRenderer, Vector3 directionInLocalSpace) Transforms an XYZ direction in the Microsoft.Maps.Unity.MapRenderer's local space to a direction in Mercator space.
Vector2D TransformLocalDirectionToMercator(Vector3 directionInLocalSpace, Double zoomLevel) Transforms an XYZ direction in the Microsoft.Maps.Unity.MapRenderer's local space to a direction in Mercator space.
Vector2D TransformLocalPointToMercator(this MapRenderer mapRenderer, Vector3 pointInLocalSpace) Transforms an XYZ point in the Microsoft.Maps.Unity.MapRenderer's local space to a Mercator position.
Vector2D TransformLocalPointToMercatorWithAltitude(this MapRenderer mapRenderer, Vector3 pointInLocalSpace, Double& altitudeInMeters, Double& mercatorScale) Transforms an XYZ point in the Microsoft.Maps.Unity.MapRenderer's local space to a Mercator position. Includes the altitude measured as meters from the WGS84 ellipsoid.
Vector2D TransformWorldDirectionToMercator(this MapRenderer mapRenderer, Vector3 directionInWorldSpace) Transforms an XYZ direction in the Microsoft.Maps.Unity.MapRenderer's local space to a direction in Mercator space.
Vector2D TransformWorldDirectionToMercator(this MapRenderer mapRenderer, Vector3 directionInWorldSpace, Double zoomLevel) Transforms an XYZ direction in the Microsoft.Maps.Unity.MapRenderer's local space to a direction in Mercator space.
LatLon TransformWorldPointToLatLon(this MapRenderer mapRenderer, Vector3 pointInWorldSpace) Transforms an XYZ point in world space to a Microsoft.Geospatial.LatLon.
LatLonAlt TransformWorldPointToLatLonAlt(this MapRenderer mapRenderer, Vector3 pointInWorldSpace) Transforms an XYZ point in world space to a Microsoft.Geospatial.LatLonAlt.
Vector2D TransformWorldPointToMercator(this MapRenderer mapRenderer, Vector3 pointInWorldSpace) Transforms an XYZ point in world space to a Mercator position.
Vector2D TransformWorldPointToMercatorWithAltitude(this MapRenderer mapRenderer, Vector3 pointInWorldSpace, Double& altitudeInMeters, Double& mercatorScale) Transforms an XYZ point in world space to a Mercator position.

MapScaleRatioExtensions

Helpers to provide a map scale relative to Unity's world space.

public static class Microsoft.Maps.Unity.MapScaleRatioExtensions

Static Methods

Type Name Summary
Double ComputeUnityToMapScaleRatio(this MapRenderer mapRenderer) Computes approximate scale of the map relative to Unity's world space, i.e. the number of real-world meters in the map per a single unit in Unity's world space. Uses the MapRenderer's center as the reference location.
Double ComputeUnityToMapScaleRatio(this MapRenderer mapRenderer, LatLon referenceLocation) Computes approximate scale of the map relative to Unity's world space, i.e. the number of real-world meters in the map per a single unit in Unity's world space. Uses the MapRenderer's center as the reference location.

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.

MapSceneAnimationController

Animates a MapRenderer to the specified MapScene. Derives the animation duration and preforms a preceptually smooth animation, based on the work of van Wijk and Nuij, "Smooth and Efficient Zooming and Panning". https://www.win.tue.nl/~vanwijk/zoompan.pdf

public class Microsoft.Maps.Unity.MapSceneAnimationController
    : IMapSceneAnimationController

Properties

Type Name Summary
WaitForMapSceneAnimation YieldInstruction

Methods

Type Name Summary
void Initialize(MapRenderer mapRenderer, MapScene mapScene, Single animationTimeScale, MapSceneAnimationKind mapSceneAnimationKind)
Boolean UpdateAnimation(Single currentZoomLevel, LatLon currentLocation, Single& zoomLevel, LatLon& location)

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)

MapSceneOfLocationAndZoomLevel

The most basic MapScene that can be used to change the map's location and zoom level.

public class Microsoft.Maps.Unity.MapSceneOfLocationAndZoomLevel
    : MapScene

Properties

Type Name Summary
LatLon Location The final location.
Single ZoomLevel The final zoom level.

Methods

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

MapShape

The shape of the Microsoft.Maps.Unity.MapRenderer.

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

Enum

Value Name Summary
0 Block Default shape. The map is rendered on a rectangular block.
1 Cylinder Map is rendered on a cylinder.

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 will be flat.

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.

Events

Type Name Summary
ItemChangedEventHandler<T> ItemAdded
ItemChangedEventHandler<T> ItemRemoved
RangeChangedEventHandler<T> RangeAdded
RangeChangedEventHandler<T> RangeRemoved

Methods

Type Name Summary
void Add(T item) Adds an item to this list.
void AddRange(IEnumerable<T> items) Adds a range of items to this list.
void Clear() Removes all items from this list.
Boolean Contains(T item) Determines whether this list contains a specific value.
void CopyTo(T[] array, Int32 arrayIndex) Copies the elements of this list 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 this list.
void Insert(Int32 index, T item) Inserts an item to this list at the specified index.
Boolean Remove(T item) Removes the first occurrence of a specific object from this list.
void RemoveAt(Int32 index) Removes the item at the specified index.

ObservableMapPinList

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

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

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
Boolean IsLayerSynchronized If true, synchronizes this UnityEngine.GameObject's and it's childrens' layers to the same value as the associated Microsoft.Maps.Unity.MapRenderer's layer.
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.

SystemLangaugeConverter

Handles conversion of UnityEngine.SystemLanguage values to LCIDs and culture codes.

public static class Microsoft.Maps.Unity.SystemLangaugeConverter

Static Methods

Type Name Summary
String ToCultureCode(SystemLanguage systemLanguage, String region = ) Returns the best match of a Bing Maps language code for the specified UnityEngine.SystemLanguage. Then if specified, appends the region string to the language code.
Int32 ToLcid(SystemLanguage systemLanguage) Converts the language to best matching LCID.

TextureTile

A Microsoft.Maps.Unity.TextureTile contains the data used to render a given tile in a Microsoft.Maps.Unity.TextureTileLayer.

public struct Microsoft.Maps.Unity.TextureTile
    : IEquatable<TextureTile>

Methods

Type Name Summary
Boolean Equals(TextureTile o) Check if 2 TextureTiles contains the same underlying data.
Boolean Equals(Object obj) Check if 2 TextureTiles contains the same underlying data.
Int32 GetHashCode() Returns the hash code the this TextureTile.
String ToString() Returns the default ToString() method of this TextureTile

Static Methods

Type Name Summary
TextureTile FromImageData(Byte[] data) Creates a Microsoft.Maps.Unity.TextureTile from PNG or JPEG byte data, or any other data type consumable by UnityEngine.ImageConversion.LoadImage(UnityEngine.Texture2D,System.Byte[]).
Task<Nullable<TextureTile>> FromNull() Used for a Microsoft.Maps.Unity.TextureTile that is not present. This is equivalent to returning a nullable type with no value. It is more efficient to use this however as the return value is cached in order to reduce GC allocation.
TextureTile FromRawData(TextureFormat textureFormat, Int32 width, Int32 height, Byte[] data, Boolean mipChain) Creates a Microsoft.Maps.Unity.TextureTile from raw texture data directly consumable by the GPU.
TextureTile FromTexture2D(Texture2D texture) Creates a Microsoft.Maps.Unity.TextureTile from a UnityEngine.Texture2D. No conversion is needed here, and the Microsoft.Maps.Unity.TextureTile will use the specified UnityEngine.Texture2D directly.
TextureTile FromUrl(Uri uri) Creates a Microsoft.Maps.Unity.TextureTile from a System.Uri referencing a PNG or JPEG image.

TextureTileLayer

The TextureTileLayer provides texture data spatially organized in Mercator tiles (EPSG:3857). The textures are used by the Microsoft.Maps.Unity.MapRenderer to display the map and can be composited with other TextureTileLayers.

public abstract class Microsoft.Maps.Unity.TextureTileLayer
    : TileLayer

Methods

Type Name Summary
Task<Nullable<TextureTile>> GetTexture(TileId tileId, CancellationToken cancellationToken = null) Retrieves the texture data that will be rendered for the specified Microsoft.Geospatial.TileId.

TextureTileLayerList

A serializable list of Microsoft.Maps.Unity.TextureTileLayers.

public class Microsoft.Maps.Unity.TextureTileLayerList
    : TileLayerList<TextureTileLayer>, IReadOnlyList<TextureTileLayer>, IReadOnlyCollection<TextureTileLayer>, IEnumerable<TextureTileLayer>, IEnumerable

TileLayer

Common base class for Microsoft.Maps.Unity.TileLayers. These are specially handled components that must be associated with a Microsoft.Maps.Unity.MapRenderer.

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

Methods

Type Name Summary
void SetDirty() Marks the Microsoft.Maps.Unity.TileLayer as dirty to trigger a refresh of the Microsoft.Maps.Unity.TileLayer's data.

TileLayerList<T>

A read-only list of Microsoft.Maps.Unity.TileLayers associated with the Microsoft.Maps.Unity.MapRenderer. This list maintains a specific ordering of Microsoft.Maps.Unity.TileLayers which reflects their priority. Because Microsoft.Maps.Unity.TileLayers are UnityEngine.MonoBehaviours, their lifetime is managed through Unity (not this list).

public class Microsoft.Maps.Unity.TileLayerList<T>
    : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable

Properties

Type Name Summary
Int32 Count Gets the number of items in the list.
T Item Gets or sets the item at the specified index.

Methods

Type Name Summary
Boolean Contains(T item) Determines whether this list contains a specific value.
IEnumerator<T> GetEnumerator() Returns an enumerator that iterates through a collection.
Int32 IndexOf(T item) Determines the index of a specific item in this list.

UnityTaskFactory

Runs Tasks on Unity's main thread.

public class Microsoft.Maps.Unity.UnityTaskFactory

Static Properties

Type Name Summary
Int32 UnityMainThreadId The Unity main thread ID.

Static Methods

Type Name Summary
void AssertNotOnMainThread() Asserts that the current thread is not the Unity main thread.
void AssertOnMainThread() Asserts that the current thread is the Unity main thread.
Task StartNew(Func<Task> func, CancellationToken cancellationToken = null) Starts a new task. The task will be executed on Unity's main thread.
Task<T> StartNew(Func<Task<T>> func, CancellationToken cancellationToken = null) Starts a new task. The task will be executed on Unity's main thread.

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.

UnityWebRequestAwaiterExtensionMethods

Provides the ability to use await keyword with UnityEngine.Networking.UnityWebRequestAsyncOperation.

public static class Microsoft.Maps.Unity.UnityWebRequestAwaiterExtensionMethods

Static Methods

Type Name Summary
UnityWebRequestAwaiter GetAwaiter(this UnityWebRequestAsyncOperation webRequestAsyncOperation) Provides the ability to use await keyword with UnityEngine.Networking.UnityWebRequestAsyncOperation.

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