// 更新圆形预览
private updateCirclePreview(
center: Cesium.Cartesian3,
tempPosition: Cesium.Cartesian3,
) {
if (this.activeShape && this.activeShape.ellipse) {
const radius = Cesium.Cartesian3.distance(center, tempPosition); // 计算圆的半径
this.activeShape.ellipse.semiMinorAxis = new Cesium.CallbackProperty(
() => radius || 1,
false,
); // 更新椭圆的短轴
this.activeShape.ellipse.semiMajorAxis = new Cesium.CallbackProperty(
() => radius || 1,
false,
); // 更新椭圆的长轴
}
}
// 更新圆形边框预览
private updateCircleBorderPreview(
polyline: Cesium.Entity,
center: Cesium.Cartesian3,
tempPosition: Cesium.Cartesian3,
) {
const radius = Cesium.Cartesian3.distance(center, tempPosition);
const positions = this.calculateCircleBorderPositions(center, radius);
polyline.polyline.positions = new Cesium.CallbackProperty(
() => positions,
false,
);
}这部分是给圆形增加Polyline的代码
问 cesium圆形增加Polyline异常