使用cesium进行淹没分析,其实就是绘制一个PolygonGraphics,然后改变高度(extrudedHeight),(高度可以随时间改变)。
/**
* 淹没分析工具
*/
class FloodAnalyze {
/**
* 淹没分析构造函数
* @method constructor
* @param viewer Cesium.Viewer 对象
*
*/
constructor(viewer) {
this._viewer = viewer;
this._scene = viewer.scene;
this._camera = this._scene.camera;
this._color = Cesium.Color.RED.withAlpha(0.4);
this._maxHeight = 3000;
this._minHeight = 0;
this._currentHeight=0;
this._interpolation = 8;
this._tickEvent = ()=>{
this.updateGeometry();
};
this.flayer = null;
this.pList = null;
this.step = 1;
}
/**
* 淹没速度
*
*/
get speed() {
return this.step;
}
set speed(val) {
if(val<=0)
return;
this.step = val;
}
/**
* 颜色设置
*
*/
get color() {
return this._color;
}
set color(val) {
this._