1. CutFillCalculation

填挖方计算。注意,计算的区域要尽可能小,否则前端页面会长时间处于卡顿状态。

1.1. new CutFillCalculation(geomap, options)

Param Type Default Description
geomap GeoMap

GeoMap的实例对象

options Object

配置选项

[options.isBuildingContained] Boolean false

是否将建筑模型包含在内进行计算填挖方,若不需要建议设为false(对前端硬件性能要求很高)。

Example

let calculation = new BOSGeo.CutFillCalculation(geomap);

1.2. 属性

Param Type Default Description
isBuildingContained Boolean false

是否将建筑模型包含在内进行计算填挖方,若不需要建议设为false

1.3. 方法

1.3.1. cutFillCalculation.open(options) ⇒ Promise

计算填挖方量,请注意若包含建筑物进行计算,计算时绘制区域不要超过屏幕范围

Returns: Promise -

包含填挖方量等计算结果的promise对象,结果中会返回填方量(fillVolume,单位为立方米)、挖方量(cutVolume,单位为立方米)和开挖平面面积(are,单位为平方米)等信息。

Param Type Default Description
options Object

配置选项

options.height Number

填挖方分析的高度

options.positions Array.<Array.<Number>>

经纬度组成的二维数组,注意经纬度闭合(最后一个经纬度与第一个相同)

[options.precisionLevel] Number 0.01

计算填挖方量的精度,值越小,精度越高,时间越长,建议范围[0.001-0.01],太小有可能导致崩溃

[options.wallColor] String '#fff'

范围示意墙的颜色

[options.wallOpacity] Number 0.5

范围示意墙的透明度,取值范围[0,1]

[options.fillColor] String '#ADD8E6'

示意填充面的颜色

[options.fillOpacity] Number 0.5

示意填充面的透明度,取值范围[0,1]

Example

let calculation = new BOSGeo.CutFillCalculation(geomap);
var positions = [[115.2, 40], [115.22, 40], [115.21, 40.02], [115.2, 40]];
var options = {
    height: 1600,
    positions,
}
var res = calculation.open(options);
res.then(data => {
    console.log(data)
});

1.3.2. cutFillCalculation.removeLast()

清除上次绘制效果

Example

let calculation = new BOSGeo.CutFillCalculation(geomap);
calculation.removeLast();

1.3.3. cutFillCalculation.removeAll()

清除所有绘制效果

Example

let calculation = new BOSGeo.CutFillCalculation(geomap);
calculation.removeAll();
版权所有@盈嘉互联(北京)科技有限公司 京ICP备15051988号-9 Copyright © 2022 all right reserved,powered by Gitbook该文件修订时间: 2022-07-19 11:34:25

results matching ""

    No results matching ""