wx548-26fXAy
wx548-26fXAy
这家伙很懒,什么也没写!

注册于 1月前

回答
1
文章
0
关注者
0

// 更新圆形预览
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的代码

发布
问题