cesium-xs-sdk 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9394,6 +9394,7 @@ class MilitarySymbolModule {
9394
9394
  * @param {string} [options.imgUrl] 自定义图标 URL
9395
9395
  * @param {'default'|'custom'|'overlay'} [options.iconMode] 图标模式,默认 'default'
9396
9396
  * @param {number} [options.scale] billboard 缩放,默认 0.6
9397
+ * @param {number} [options.rotation] billboard 旋转角度(度),默认 0
9397
9398
  * @param {boolean} [options.visible] 是否可见,默认 true
9398
9399
  * @returns {{id: string, entity: Cesium.Entity, metadata: object}}
9399
9400
  */
@@ -9406,6 +9407,7 @@ class MilitarySymbolModule {
9406
9407
  const position = options.position || [0, 0, 0];
9407
9408
  const image = this._resolveImage(id, options);
9408
9409
  const scale = options.scale ?? 0.6;
9410
+ const rotation = options.rotation ?? 0;
9409
9411
  const visible = options.visible !== false;
9410
9412
  const name = options.name ?? id;
9411
9413
  const iconMode = options.iconMode || 'default';
@@ -9416,6 +9418,7 @@ class MilitarySymbolModule {
9416
9418
  billboard: {
9417
9419
  image,
9418
9420
  scale,
9421
+ rotation: Cesium$2.Math.toRadians(rotation),
9419
9422
  verticalOrigin: Cesium$2.VerticalOrigin.BOTTOM,
9420
9423
  horizontalOrigin: Cesium$2.HorizontalOrigin.CENTER,
9421
9424
  heightReference: Cesium$2.HeightReference.CLAMP_TO_GROUND,
@@ -9444,6 +9447,7 @@ class MilitarySymbolModule {
9444
9447
  name,
9445
9448
  position: [position[0], position[1], position[2] || 0],
9446
9449
  scale,
9450
+ rotation,
9447
9451
  visible,
9448
9452
  iconMode,
9449
9453
  imgUrl: options.imgUrl || null,
@@ -9488,7 +9492,7 @@ class MilitarySymbolModule {
9488
9492
  /**
9489
9493
  * 更新军标属性
9490
9494
  * @param {string} id 军标ID
9491
- * @param {Object} fields 支持 position / name / scale / imgUrl / visible
9495
+ * @param {Object} fields 支持 position / name / scale / rotation / imgUrl / visible
9492
9496
  * @returns {boolean} 是否更新成功
9493
9497
  */
9494
9498
  update(id, fields = {}) {
@@ -9516,6 +9520,11 @@ class MilitarySymbolModule {
9516
9520
  metadata.scale = fields.scale;
9517
9521
  }
9518
9522
 
9523
+ if (fields.rotation !== undefined) {
9524
+ entity.billboard.rotation = Cesium$2.Math.toRadians(fields.rotation);
9525
+ metadata.rotation = fields.rotation;
9526
+ }
9527
+
9519
9528
  if (fields.imgUrl !== undefined || fields.iconMode !== undefined) {
9520
9529
  const newIconMode = fields.iconMode || metadata.iconMode;
9521
9530
  const newImgUrl = fields.imgUrl !== undefined ? fields.imgUrl : metadata.imgUrl;