new ModelExcavation(map [, options])
模型开挖分析构造函数
Parameters:
| Name | Type | Argument | Default | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
map |
Glodon.CIMCube | CIMCube实例 | ||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
{} | 开挖分析配置参数
Properties
|
Example
// 创建开挖分析
const excavation = new ModelExcavation(map, {
positions: [
{lon: 116.1, lat: 39.5, height: 100},
{lon: 116.2, lat: 39.5, height: 100},
{lon: 116.2, lat: 39.6, height: 100}
],
depth: 50,
bottomTextureUrl: "./textures/ground.jpg"
});
Members
-
bottomTextureUrl :String
-
底面纹理路径
Type:
- String
-
depth :Number
-
开挖深度,单位为米
Type:
- Number
-
facadeTextureUrl :String
-
立面纹理路径
Type:
- String
-
<readonly> isActive :Boolean
-
开挖分析是否激活状态
Type:
- Boolean
-
layers :Array.<(Glodon.CIMCube.Layer.Tiles3DLayer|Glodon.CIMCube.Layer.GltfLayer)>
-
开挖图层数组
Type:
-
positions :Array.<Glodon.CIMCube.Graphic.GeoPoint>
-
开挖区域点数组,点由经纬度表示{lon:123.4,lat:45.6,height:100.0}
Type:
- Array.<Glodon.CIMCube.Graphic.GeoPoint>
-
<readonly> region :Array.<Array.<Glodon.CIMCube.Graphic.GeoPoint>>
-
开挖区域
Type:
- Array.<Array.<Glodon.CIMCube.Graphic.GeoPoint>>
Methods
-
clear()
-
清除开挖分析结果,释放相关资源
Returns:
- Type
- void
Example
// 清除分析结果 excavation.clear();
-
dispose()
-
销毁开挖分析实例,释放所有资源
Example
// 销毁开挖分析实例 excavation.dispose();
-
doAnalysis()
-
执行开挖分析
Returns:
- Type
- void
Example
// 开始分析 excavation.doAnalysis();
-
setBottomTexture(url)
-
设置底面纹理
Parameters:
Name Type Description urlString 底面纹理资源路径 Example
// 设置底面纹理 excavation.setBottomTexture("./textures/ground.jpg"); -
setDepth(depth)
-
设置开挖深度
Parameters:
Name Type Description depthNumber 深度,范围0-10000米 Example
// 设置开挖深度为50米 excavation.setDepth(50);
-
setFacadeTexture(url)
-
设置立面纹理
Parameters:
Name Type Description urlString 立面纹理资源路径 Example
// 设置立面纹理 excavation.setFacadeTexture("./textures/wall.jpg"); -
setPositions(positions)
-
设置开挖区域点数组
Parameters:
Name Type Description positionsArray.<Glodon.CIMCube.Graphic.GeoPoint> 开挖区域点数组,点由经纬度表示{lon:123.4,lat:45.6,height:100.0} Example
// 设置开挖区域 excavation.setPositions([ {lon: 116.1, lat: 39.5, height: 100}, {lon: 116.2, lat: 39.5, height: 100}, {lon: 116.2, lat: 39.6, height: 100} ]);