Show / Hide Table of Contents

Interface ITerrainLayer

Inherited Members
ILayer.LayerType
ILayer.IsLayerActive
ILayer.LayerSourceId
ILayer.SetLayerSource(String)
ILayer.Initialize()
ILayer.Initialize(LayerProperties)
ILayer.Update(LayerProperties)
ILayer.Remove()
Namespace:Mapbox.Unity.Map
Assembly:cs.temp.dll.dll
Syntax
public interface ITerrainLayer : ILayer

Properties

ElevationType

Gets the Elevation Layer Type for the TERRAIN section.

Declaration
ElevationLayerType ElevationType { get; set; }
Property Value
Type Description
ElevationLayerType

ExaggerationFactor

Gets the Exaggeration Factor for the TERRAIN section.

Declaration
float ExaggerationFactor { get; set; }
Property Value
Type Description
System.Single

LayerSource

Gets the Data Source for the TERRAIN section.

Declaration
ElevationSourceType LayerSource { get; }
Property Value
Type Description
ElevationSourceType

Methods

AddToUnityLayer(Int32)

Adds the terrain mesh GameObject to a Unity layer.

Declaration
void AddToUnityLayer(int layerId)
Parameters
Type Name Description
System.Int32 layerId

Layer identifier. You may need to add the layer in the Tags and Layers manager.

DisableSideWalls()

Disables the settings for Show Sidewalls.

Declaration
void DisableSideWalls()

EnableCollider(Boolean)

Enables or disables the Add Collider settings for adding a collider to the terrain. The collider type is a mesh collider.

Declaration
void EnableCollider(bool enable)
Parameters
Type Name Description
System.Boolean enable

Boolean for toggling Add Collider.

EnableSideWalls(Single, Material)

Enables the settings for Show Sidewalls.

Declaration
void EnableSideWalls(float wallHeight, Material wallMaterial)
Parameters
Type Name Description
System.Single wallHeight

Wall height.

Material wallMaterial

Wall material.

RemoveFromUnityLayer(Int32)

Removes the terrain GameObject from a Unity layer.

Declaration
void RemoveFromUnityLayer(int layerId)
Parameters
Type Name Description
System.Int32 layerId

Layer identifier.

SetElevationType(ElevationLayerType)

Sets the Elevation Layer Type which is the main strategy for terrain mesh generation. Flat Terrain doesn't pull data from servers, it uses a quad as the terrain.

Declaration
void SetElevationType(ElevationLayerType elevationType)
Parameters
Type Name Description
ElevationLayerType elevationType

Type of the elevation. Can be set to Terrain with Elevation, Flat Terrain, Globe, or Low Polygon Terrain. Note: low poly doesn't improve performance.

SetExaggerationFactor(Single)

Sets the Exaggeration Factor for the terrain. This acts as a multiplier for elevation. Use this setting to better highlight elevation in your scene. Each elevation point will be multiplied by the float value.

Declaration
void SetExaggerationFactor(float factor)
Parameters
Type Name Description
System.Single factor

Elevation multiplier for Exaggeration Factor settings.

SetLayerSource(ElevationSourceType)

Sets the Data Source for TERRAIN. By default this is set to Mapbox Terrain. Currenly, only terrain-rgb is supported. Use terrainSource = None, to disable the terrain.

Declaration
void SetLayerSource(ElevationSourceType terrainSource = ElevationSourceType.MapboxTerrain)
Parameters
Type Name Description
ElevationSourceType terrainSource

Data Source for TERRAIN

SetProperties(ElevationSourceType, ElevationLayerType, Boolean, Single, Int32)

Change the TERRAIN layer settings.

Declaration
void SetProperties(ElevationSourceType dataSource = ElevationSourceType.MapboxTerrain, ElevationLayerType elevationType = ElevationLayerType.TerrainWithElevation, bool enableCollider = false, float factor = 1F, int layerId = 0)
Parameters
Type Name Description
ElevationSourceType dataSource

The Data Source for the terrain.

ElevationLayerType elevationType

Elevation Layer Type setting to define elevation strategy.

System.Boolean enableCollider

Enables or disables Use Collider settings for a mesh collider on the terrain.

System.Single factor

Exaggertion Factor for a multiplier of the height data.

System.Int32 layerId

Add to Unity Layer settings which adds terrrain to a layer.

Back to top © 2017 Mapbox