设置面材质,颜色,透明度等
for (var i = 0; i < this.range.length / 2; i++) {
this.tableData.push({
number: i + 1,
x: Number(this.range[i * 2]).toFixed(8),
y: Number(this.range[i * 2 + 1]).toFixed(8),
});
this.earthWorkPoints.push(Cesium.Cartesian3.fromDegrees( Number(this.range[i * 2]), Number(this.range[i * 2 + 1])))
}
const positions = Cesium.Cartesian3.fromDegreesArray(this.range);
const geomtry = viewer.entities.add({
polygon: {
// Cesium.PolygonGraphics
hierarchy: {
// Cesium.PolygonHierarchy
positions,
// holes: [hole1, hole2] // Cesium.PolygonHierarchy 数组
},
material: new Cesium.ColorMaterialProperty(
Cesium.Color.RED.withAlpha(0.5)
),
},
});
this.entity = geomtry;
// 定位到图形对象
viewer.zoomTo(geomtry);