效果
通视分析是指以某一点为观察点,研究某一区域通视情况的地形分析。
通过cesium提供的碰撞检测api获取障碍点实现同时分析
通视分析代码
import PointDrawer from '../../BaseTool/Draw/DrawPoint';
import LineDrawer from '../../BaseTool/Draw/DrawLine';
import Coordinate from '../../BaseTool/Coordinate';
import Cesium from 'Cesium'
export default class InterAnalysis {
// viewer: any;
// interAnalysis_map: Map<Symbol, any>;
// lineEntities: any = [];
// pointEntities: any[] = [];
constructor(viewer) {
this.viewer = viewer;
this.interAnalysis_map = new Map();
this.pointEntities = [];
this.lineEntities = [];
}
create(sPoint, ePoint, objId) {
debugger
if (ePoint.x === sPoint.x && ePoint.y === sPoint.y && ePoint.z === sPoint.z) {
this.pointEntities.push(PointDrawer.draw(this.viewer, sPoint, 10, Cesium.Color.AQUAMARINE));
console.warn('通视起点与终点重叠');
return;