-
Notifications
You must be signed in to change notification settings - Fork 128
Configuring the MapRenderer
A valid Bing Maps Key is required for the MapRenderer
to stream and render data.
See Getting started for information on how to sign-up for a key.
Once a valid key has been provided, the map will render in the editor as well, unless the Show Map Data in Editor
option has been disabled.
The view of the map can be configured in the Location foldout.
The Center
is the geolocation where the map is currently focused, represented as a latitude and longitude in degrees.
The ZoomLevel
is the area of the map that is visible. Lower zoom levels correspond to zooming out, higher zoom levels correspond to zooming in.
The map uses a web Mercator projection.
The shape, dimension and collider type of the map can be configured in the layout section.
The shape of the map can be a block or a cylinder. The default is block.
Block | Cylinder |
Dimensions are specified in local space. For convenience, the sizes scaled to Unity's world space are displayed in the editor as well.
The map collider can be modified by MapColliderType
.
- No Collider: No map collider.
- Base Only: Collider covering the base of the map.
- Full Extents: Collider covering the full extents of the map.
No collider | Base Only | Full Extents |
Larger map dimensions will require more data to be downloaded and rendered. This will affect the overall performance of the app. It is recommended to stay with the default settings or smaller, or only increase the map dimensions on devices that are capable. Regardless, the map dimensions are clamped to a maximum size.
The visuals of the map can be configured in the render settings.
Like a MeshRenderer
, the MapRenderer
can be configured to cast and/or receive shadows.
The side of the map, referred to as the clipping volume wall, will be visible by default. If this visual is not necessary for your scenario, it can be disabled to prevent the additional rendering overhead.
The color of the map edge can also be customized in the render settings.
Shadows and clipping volume wall enabled | Shadows and clipping volume wall disabled. |
The type of terrain rendered by the map can be modified with the MapTerrainType
.
- Default: The map terrain consists of either elevation data or high resolution 3D models.
- Elevated: The map terrain consists only of elevation data. No high resolution 3D models are used.
- Flat: Both elevation and high resolution 3D models are disabled. The map terrain surface will be flat.
Default | Elevated | Flat |
If the scenario does not require the higher resolution data, disabling it can improve performance. Likewise, the Flat
type requires the least amount of performance overhead.
The material and shader used for rendering the terrain or the clipping volume wall can be replaced to achieve more advanced and customized effects.
For creating a custom shader, the default shaders can be used as a starting point. These shaders are part of the package under Runtime\Shaders. The shaders are also checked in here.
Importantly, the ENABLE_ELEVATION_TEXTURE
keyword used by the shaders will need to be maintained. Certain draw calls for the terrain require an elevation texture while others do not.
A TextureTileLayer specifies which texture source to use for map tiles. The MapRenderer will automatically be instantiated with the DefaultTextureTileLayer.
The DefaultTextureTileLayer specifically uses Bing Maps imagery and can be configured to use different styles and variations of this imagery. The default setting is to use aerial imagery.
Aerial, Roads & Labels | Symbolic Light | Symbolic Dark |
The quality, i.e. the level of detail, rendered by the map for a given zoom level can be modified in the quality settings. Similarly, the maximum size reserved for caching data can be configured here as well.
It is important to note that the level of detail offset can have a large impact on performance. The trade-off being higher quality will come with a higher performance impact where the cache size will grow more quickly. Lowering the quality may be beneficial on devices that are performance constrained.
- 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