Class: MapGISTerrainProvider

MapGISTerrainProvider

new MapGISTerrainProvider(options)

engineExtensions/core/MapGISTerrainProvider.js, line 19

支持如下方法:
[1、通过场景服务的url获取MapGISTerrainProvider对象]

MapGIS地形服务接入类

Name Type Description
options Object
Name Type Default Description
url String | Cesium.Resource null 可选

服务基地址, 当仅加载一个DEM地形服务时,使用该初始化参数,当加载多个DEM地形服务时,请使用serviceList初始化参数,
基地址格式为:
IGS1.0: http://{ip}:{port}/igs/rest/g3d/{folder}:{serviceName}/GetTerrain
IGS2.0: http://{ip}:{port}/igs/rest/services/{folder}/{serviceName}/SceneServer/layers/{layerId}/terrains

tilingScheme Cesium.TilingScheme Cesium.GeographicTilingScheme() 可选

地形的平铺方案,详见Cesium.TilingScheme

range Object null 可选

地形二维范围

range3D Object null 可选

地形三维范围

requestVertexNormals Boolean false 可选

是否请求法向量

maxLevel Number 20 可选

地形最大显示级数

terrainColorTblInfo Array null 可选

地形分析-高程赋色功能的色表,格式为['#000000', '#2747E0', '#D33B7D', '#D33038', '#FF9742', '#ffd700', '#FFFFFF']

terrainColorTblMinHeight Number null 可选

地形分析-高程赋色功能的最小高度

terrainColorTblMaxHeight Number null 可选

地形分析-高程赋色功能的最大高度

repeat Cesium.Cartesian2 new Cesium.Cartesian2(1, 1) 可选

坡度箭头重复次数,详见Cesium.Cartesian2

proxy Cesium.Proxy null 可选

请求拦截器,可对最后发出的请求链接进行编辑,详见Cesium.Proxy

serviceList Array.<MapGISTerrainService> [] 可选

当加载多个DEM地形服务时,请使用serviceList初始化参数。 此时传入的格式变为了[{url:'',range:{},range3D:{},requestVertexNormals:true,maxLevel:20}]

credit Cesium.Credit null 可选

A credit for the data source, which is displayed on the canvas,详见Cesium.Credit

Members

该属性记录了MapGISTerrainProvider下的地形图层支持的级数和每一级数支持显示的地形瓦片行列号范围; 当提供了一个地形瓦片的级数、行号和列号时,可通过该对象的isTileAvailable方法知道地形图层是否包含该地形瓦片; 当MapGISTerrainProvider未加载完毕时,不可访问该对象; 当服务元信息中未包含available属性时,该对象为空;
Gets an object that can be used to determine availability of terrain from this provider, such as at points and in rectangles. This function should not be called before MapGISTerrainProvider.ready returns true. This property may be undefined if availability information is not available. Note that this reflects tiles that are known to be available currently. Additional tiles may be discovered to be available in the future, e.g. if availability information exists deeper in the tree rather than it all being discoverable at the root. However, a tile that is available now will not become unavailable in the future.

creditCesium.Credit

Gets the credit to display when this terrain provider is active. Typically this is used to credit the source of the terrain. This function should not be called before Cesium.CesiumTerrainProvider.ready returns true.

errorEventCesium.Event

Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of Cesium.TileProviderError.

hasMetadataBoolean

Gets a value indicating whether or not the requested tiles include metadata. This function should not be called before Cesium.CesiumTerrainProvider.ready returns true.

hasVertexNormalsBoolean

是否应用地形法向量,当所有地形子图层的hasVertexNormals和requestVertexNormals参数都为true时, MapGISTerrainProvider的hasVertexNormals属性为true,否则为false

idString

地形id编号

maxLevelNumber

地形最大显示级数

Default Value:
20

proxyObject

请求拦截器,可对最后发出的请求链接进行编辑

rangeObject

地形二维范围

range3DObject

地形三维范围

readyBoolean

地形是否可用

readyPromisePromise

地形可用后的回调,此时地形数据不一定加载完毕

repeatCesium.Cartesian2

坡度箭头的重复次数

requestVertexNormalsBoolean

是否请求法向量

terrainColorTblInfoArray

地形分析-高程赋色功能的色表,格式为['#000000', '#2747E0', '#D33B7D', '#D33038', '#FF9742', '#ffd700', '#FFFFFF']

terrainColorTblMaxHeightNumber

地形分析-高程赋色功能的最大高度

terrainColorTblMinHeightNumber

地形分析-高程赋色功能的最小高度

tilingSchemeCesium.GeographicTilingScheme

Gets the tiling scheme used by this provider. This function should not be called before Cesium.CesiumTerrainProvider.ready returns true.

urlString

服务基地址

Methods

MapGISTerrainProvider.fromUrl(url, options){MapGISTerrainProvider|undefined}

engineExtensions/core/MapGISTerrainProvider.js, line 198

通过场景服务的url获取MapGISTerrainProvider对象,若场景服务中不包含地形图层则返回undefined

Name Type Description
url String

服务的基地址

options Object

实例化对象时提供的额外配置参数,若该对象中包含构造参数则会覆盖对应的构造参数

Returns:
Type Description
MapGISTerrainProvider | undefined
Example
const url = 'http://10.10.130.72:8089/igs/rest/services/Scene/TwTerrain/SceneServer'
const addTerrainProvider = async (url) => {
  const imageryProvider = await MapGISTerrainProvider.fromUrl(url)
  if (terrainProvider) {
    viewer.terrainProvider = terrainProvider
  }
}
addTerrainProvider(url)

addService(terrainService)

engineExtensions/core/MapGISTerrainProvider.js, line 521

添加一个地形服务

Name Type Description
terrainService MapGISTerrainService

地形服务数据对象

getLayersByRange(range){Array.<Object>}

engineExtensions/core/MapGISTerrainProvider.js, line 697

返回和range相交的地形子图层对象数组

Name Type Description
range Geometry

范围几何对象

Returns:
Type Description
Array.<Object> 相交的地形子图层对象数组

getServiceById(id){MapGISTerrainService|null}

engineExtensions/core/MapGISTerrainProvider.js, line 600

通过service的id获取service对象,没有则返null

Name Type Description
id String

service对象的id

Returns:
Type Description
MapGISTerrainService | null service对象

removeService(terrainService)

engineExtensions/core/MapGISTerrainProvider.js, line 591

删除一个地形服务

Name Type Description
terrainService MapGISTerrainService

地形服务数据对象

removeServices(terrainServices)

engineExtensions/core/MapGISTerrainProvider.js, line 579

删除多个地形服务

Name Type Description
terrainServices Array.<MapGISTerrainService>

地形服务数据对象

updateService(terrainService)

engineExtensions/core/MapGISTerrainProvider.js, line 632

在serviceList中找到id和传入的service对象相同的service进行更新

Name Type Description
terrainService MapGISTerrainService

地形服务对象

updateServiceProperty(id, key, value)

engineExtensions/core/MapGISTerrainProvider.js, line 664

在serviceList中找到id和传入的service对象,单独更新service上的某一个属性

Name Type Description
id String

地形服务对象的Id

key String

属性名

value Any

属性值