效果如下:
代码:
let arr = [[120.87140893447473, 31.877030830389447, 128.64],[120.87140872335587, 31.876963534304792, 128.64],[120.87202301763111, 31.87696299560446, 128.63],[120.87202432001283, 31.877030271988385, 128.63]]arr = [].concat.apply([], arr)var orangePolygon = viewer.entities.add({name: 'Orange',polygon: {hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights(arr),extrudedHeight: 0,perPositionHeight: false,material: Cesium.Color.ORANGE.withAlpha(0.5),outline: false,extrudedHeight: 128.5,height: 132.0}})viewer.zoomTo(viewer.entities)
其实就是polygon
,给齐增加距离地面的属性extrudedHeight
,以及高度height