HeightLimit 限高分析
简介
限高分析用于检测指定区域内建筑或模型是否超出设定的高度限制。在 Cesium 中,该功能可直观标识超高区域,辅助城市规划、航空航道保护、文物保护区控制等需要高度约束的场景,确保建设活动符合法规或安全要求。
演练场
引入
ts
import { HeightLimit } from "@m-tech/gis-core";
new HeightLimit(viewer, options);参数
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
viewer | Viewer | 是 | - | 容器 |
options | Object | 是 | {} | 限高分析配置 |
options.positions | Position[] | 是 | [] | 限高区域的位置 |
options.baseHeight | number | 否 | 0 | 限高区域的基础高度 |
options.height | number | 否 | 0 | 限高区域的高度 |
options.color | Color | 否 | rgba(255,0,0,0.5) | 限高区域的颜色 |
属性
| 属性名 | 类型 | 读/写 | 描述 |
|---|---|---|---|
baseHeight | number | 读写 | 基准面高度 |
height | number | 读写 | 限制高度 |
color | Color | 读写 | 限制区域颜色 |
方法
clear()
清除限高分析。
示例
ts
import { HeightLimit, Position } from "@m-tech/gis-core";
// 创建限高分析
const heightLimit = new HeightLimit(viewer, {
positions: [new Position(114.218, 30.579, 100)],
});
// 调整基准面高度
heightLimit.baseHeight = 10;
// 调整限制高度
heightLimit.height = 20;
// 调整限制区域颜色
heightLimit.color = new Color(0, 0, 255, 0.5);
// 清除限高分析
heightLimit.clear();