cesium加载边界线
时间: 2023-09-09 08:11:08 浏览: 172
在Cesium中,可以加载边界线并高亮显示。通过添加polygon实体后,设置outline属性,可以创建一个带有边界线的多边形。但是,如果未设置height属性,边界线将不会显示。为了解决这个问题,可以再绘制一个polyline实体作为边界线。代码示例如下:
```
var positions = entity.polygon.hierarchy._value.positions;
this.viewer.entities.add({
name: 'borderLine',
polyline: {
positions: positions,
width: 2,
material: Color.BLACK.withAlpha(0.5),
clampToGround: true
}
});
```
这段代码将根据polygon实体的位置创建一个polyline实体,并将其添加到viewer.entities中。这样就可以加载边界线并显示在Cesium中了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Cesium,加载面geojson, 鼠标点选高亮显示面边界](https://download.csdn.net/download/ccxbb/10726415)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Cesium11:加载geojson面贴地和显示边界问题](https://blog.csdn.net/bitree1/article/details/131964219)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Cesium 加载发光材质的行政区边界](https://blog.csdn.net/lz5211314121/article/details/131719616)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文