@xingm/vmap-cesium-toolbar 0.0.2-alpha.12 → 0.0.2-alpha.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.
@@ -18,6 +18,7 @@ export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, me
18
18
  clearAllEntities: () => void;
19
19
  clearAllPoints: () => void;
20
20
  removeEntity: (entity: Cesium.Entity) => void;
21
+ getEntityLabelEntities: (entity: Cesium.Entity) => Cesium.Entity[];
21
22
  getFinishedEntities: () => Cesium.Entity[];
22
23
  onMeasureComplete: (callback: (result: {
23
24
  type: "line" | "polygon" | "rectangle" | "circle";
@@ -41,6 +42,7 @@ export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, me
41
42
  clearAllEntities: () => void;
42
43
  clearAllPoints: () => void;
43
44
  removeEntity: (entity: Cesium.Entity) => void;
45
+ getEntityLabelEntities: (entity: Cesium.Entity) => Cesium.Entity[];
44
46
  getFinishedEntities: () => Cesium.Entity[];
45
47
  onMeasureComplete: (callback: (result: {
46
48
  type: "line" | "polygon" | "rectangle" | "circle";
@@ -59,7 +61,10 @@ export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, me
59
61
  endDrawing: () => void;
60
62
  addDrawLine: () => void;
61
63
  addDrawArea: () => void;
64
+ addDrawAreaNoLabel: () => void;
62
65
  addDrawCircle: () => void;
66
+ addDrawCircleNoLabel: () => void;
63
67
  addDrawPolygon: () => void;
68
+ addDrawPolygonNoLabel: () => void;
64
69
  destroyDrawHelper: () => void;
65
70
  };
package/dist/index.d.ts CHANGED
@@ -492,15 +492,15 @@ export interface RingOptions {
492
492
 
493
493
  export declare class CesiumOverlayService {
494
494
  constructor(viewer: Viewer);
495
- addMarker(options: any): any; // 返回 Cesium.Entity
496
- addLabel(options: any): any; // 返回 Cesium.Entity
497
- addIcon(options: any): any; // 返回 Cesium.Entity
498
- addSvg(options: any): any; // 返回 Cesium.Entity
495
+ addMarker(options: MarkerOptions): any; // 返回 Cesium.Entity
496
+ addLabel(options: LabelOptions): any; // 返回 Cesium.Entity
497
+ addIcon(options: IconOptions): any; // 返回 Cesium.Entity
498
+ addSvg(options: SvgOptions): any; // 返回 Cesium.Entity
499
499
  addInfoWindow(options: InfoWindowOptions): any; // 返回 Cesium.Entity
500
- addPolyline(options: any): any; // 返回 Cesium.Entity
501
- addPolygon(options: any): any; // 返回 Cesium.Entity
502
- addRectangle(options: any): any; // 返回 Cesium.Entity
503
- addCircle(options: any): any; // 返回 Cesium.Entity
500
+ addPolyline(options: PolylineOptions): any; // 返回 Cesium.Entity
501
+ addPolygon(options: PolygonOptions): any; // 返回 Cesium.Entity
502
+ addRectangle(options: RectangleOptions): any; // 返回 Cesium.Entity
503
+ addCircle(options: CircleOptions): any; // 返回 Cesium.Entity
504
504
  addRing(options: RingOptions): any; // 返回 Cesium.Entity
505
505
  getOverlay(id: string): any | undefined; // 返回 Cesium.Entity | undefined
506
506
  removeOverlay(id: string): boolean;
@@ -728,9 +728,30 @@ export interface DrawOptions {
728
728
  outlineColor?: Cesium.Color | string;
729
729
  outlineWidth?: number;
730
730
  };
731
+ /**
732
+ * 是否显示面积标签(适用于 polygon/rectangle/circle)。
733
+ * 默认 true;设为 false 可禁用绘制完成后自动创建的面积标签。
734
+ */
735
+ showAreaLabel?: boolean;
731
736
  onClick?: (entity: Entity, type?: 'line' | 'polygon' | 'rectangle' | 'circle', positions?: Cartesian3[]) => void;
732
737
  }
733
738
 
739
+ /**
740
+ * 绘制模块扩展实体类型(用于在 Entity 上挂载绘图相关元数据)
741
+ */
742
+ export interface DrawEntity extends Entity {
743
+ _drawType?: 'line' | 'polygon' | 'rectangle' | 'circle';
744
+ _drawOptions?: DrawOptions;
745
+ _groundPositions?: Cartesian3[];
746
+ _groundPosition?: Cartesian3;
747
+ _groundRectangle?: Cesium.Rectangle;
748
+ _radius?: number;
749
+ _borderEntity?: Entity;
750
+ /** 关联的测量/提示标签实体(例如面积标签) */
751
+ _labelEntities?: Entity[];
752
+ _onClick?: (entity: Entity, ...args: any[]) => void;
753
+ }
754
+
734
755
  export declare class DrawHelper {
735
756
  constructor(viewer: Viewer);
736
757
  // 开始绘制(可选样式参数)
@@ -746,6 +767,8 @@ export declare class DrawHelper {
746
767
  clearAllPoints(): void;
747
768
  removeEntity(entity: Entity): void;
748
769
  getFinishedEntities(): Entity[];
770
+ /** 获取绘制实体关联的标签实体(例如面积标签) */
771
+ getEntityLabelEntities(entity: Entity): Entity[];
749
772
  // 事件回调注册
750
773
  onMeasureComplete(callback: (result: DrawResult) => void): void;
751
774
  onDrawStart(callback: () => void): void;