@xingm/vmap-cesium-toolbar 0.0.2-alpha.7 → 0.0.2-alpha.9

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.
@@ -8,11 +8,12 @@ import * as Cesium from "cesium";
8
8
  export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, message: Ref<string>): {
9
9
  drawHelper: Ref<{
10
10
  handleSceneModeChanged: () => void;
11
- startDrawingLine: (options?: import('..').DrawOptions) => void;
12
- startDrawingPolygon: (options?: import('..').DrawOptions) => void;
13
- startDrawingRectangle: (options?: import('..').DrawOptions) => void;
14
- startDrawingCircle: (options?: import('..').DrawOptions) => void;
11
+ startDrawingLine: (options?: import('../libs/drawHelper').DrawOptions) => void;
12
+ startDrawingPolygon: (options?: import('../libs/drawHelper').DrawOptions) => void;
13
+ startDrawingRectangle: (options?: import('../libs/drawHelper').DrawOptions) => void;
14
+ startDrawingCircle: (options?: import('../libs/drawHelper').DrawOptions) => void;
15
15
  endDrawing: () => void;
16
+ cancelDrawing: () => void;
16
17
  clearAll: () => void;
17
18
  clearAllEntities: () => void;
18
19
  clearAllPoints: () => void;
@@ -30,11 +31,12 @@ export declare function useDrawHelper(viewer: Ref<Cesium.Viewer | undefined>, me
30
31
  destroy: () => void;
31
32
  } | null, DrawHelper | {
32
33
  handleSceneModeChanged: () => void;
33
- startDrawingLine: (options?: import('..').DrawOptions) => void;
34
- startDrawingPolygon: (options?: import('..').DrawOptions) => void;
35
- startDrawingRectangle: (options?: import('..').DrawOptions) => void;
36
- startDrawingCircle: (options?: import('..').DrawOptions) => void;
34
+ startDrawingLine: (options?: import('../libs/drawHelper').DrawOptions) => void;
35
+ startDrawingPolygon: (options?: import('../libs/drawHelper').DrawOptions) => void;
36
+ startDrawingRectangle: (options?: import('../libs/drawHelper').DrawOptions) => void;
37
+ startDrawingCircle: (options?: import('../libs/drawHelper').DrawOptions) => void;
37
38
  endDrawing: () => void;
39
+ cancelDrawing: () => void;
38
40
  clearAll: () => void;
39
41
  clearAllEntities: () => void;
40
42
  clearAllPoints: () => void;
@@ -0,0 +1,28 @@
1
+ import { Ref } from 'vue';
2
+ import { default as CesiumHeatmapLayer, HeatPoint, HeatmapOptions, HeatmapGradient } from '../libs/CesiumHeatmapLayer';
3
+ import * as Cesium from "cesium";
4
+ /**
5
+ * 热力图相关的辅助逻辑
6
+ */
7
+ export declare function useHeatmapHelper(viewer: Ref<Cesium.Viewer | undefined>): {
8
+ heatmapLayer: Ref<{
9
+ setData: (points: HeatPoint[]) => void;
10
+ setGradient: (gradient: HeatmapGradient) => void;
11
+ setOpacity: (opacity: number) => void;
12
+ setVisible: (visible: boolean) => void;
13
+ destroy: () => void;
14
+ } | null, CesiumHeatmapLayer | {
15
+ setData: (points: HeatPoint[]) => void;
16
+ setGradient: (gradient: HeatmapGradient) => void;
17
+ setOpacity: (opacity: number) => void;
18
+ setVisible: (visible: boolean) => void;
19
+ destroy: () => void;
20
+ } | null>;
21
+ visible: Ref<boolean, boolean>;
22
+ initHeatmap: (options?: HeatmapOptions) => void;
23
+ updateHeatmapData: (points: HeatPoint[]) => void;
24
+ setHeatmapVisible: (v: boolean) => void;
25
+ setHeatmapOpacity: (alpha: number) => void;
26
+ setHeatmapGradient: (gradient: HeatmapGradient) => void;
27
+ destroyHeatmap: () => void;
28
+ };
@@ -74,6 +74,14 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
74
74
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').CircleOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
75
75
  remove: (entityOrId: Entity | string) => boolean;
76
76
  };
77
+ readonly ring: {
78
+ add: (options: import('../libs/overlay').RingOptions) => Entity;
79
+ updatePosition: (entity: Entity, position: import('../libs/overlay').OverlayPosition) => void;
80
+ updateRadius: (entity: Entity, radius: number) => void;
81
+ updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').RingOptions, "color" | "showInnerLine" | "lineColor" | "lineStyle" | "lineMaterialMode" | "stripeRepeat" | "dashLength" | "dashPattern" | "gapColor" | "width" | "glowWidth" | "lineWidth" | "glowPower" | "clampToGround" | "segments">>) => void;
82
+ setVisible: (entity: Entity, visible: boolean) => void;
83
+ remove: (entityOrId: Entity | string) => boolean;
84
+ };
77
85
  addMarker: (options: import('../libs/overlay').MarkerOptions) => Entity;
78
86
  addLabel: (options: import('../libs/overlay').LabelOptions) => Entity;
79
87
  addIcon: (options: import('../libs/overlay').IconOptions) => Entity;
@@ -83,6 +91,7 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
83
91
  addPolygon: (options: import('../libs/overlay').PolygonOptions) => Entity;
84
92
  addRectangle: (options: import('../libs/overlay').RectangleOptions) => Entity;
85
93
  addCircle: (options: import('../libs/overlay').CircleOptions) => Entity;
94
+ addRing: (options: import('../libs/overlay').RingOptions) => Entity;
86
95
  getOverlay: (id: string) => Entity | undefined;
87
96
  removeOverlay: (id: string) => boolean;
88
97
  removeAllOverlays: () => void;
@@ -157,6 +166,14 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
157
166
  updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').CircleOptions, "material" | "outline" | "outlineColor" | "outlineWidth">>) => void;
158
167
  remove: (entityOrId: Entity | string) => boolean;
159
168
  };
169
+ readonly ring: {
170
+ add: (options: import('../libs/overlay').RingOptions) => Entity;
171
+ updatePosition: (entity: Entity, position: import('../libs/overlay').OverlayPosition) => void;
172
+ updateRadius: (entity: Entity, radius: number) => void;
173
+ updateStyle: (entity: Entity, options: Partial<Pick<import('../libs/overlay').RingOptions, "color" | "showInnerLine" | "lineColor" | "lineStyle" | "lineMaterialMode" | "stripeRepeat" | "dashLength" | "dashPattern" | "gapColor" | "width" | "glowWidth" | "lineWidth" | "glowPower" | "clampToGround" | "segments">>) => void;
174
+ setVisible: (entity: Entity, visible: boolean) => void;
175
+ remove: (entityOrId: Entity | string) => boolean;
176
+ };
160
177
  addMarker: (options: import('../libs/overlay').MarkerOptions) => Entity;
161
178
  addLabel: (options: import('../libs/overlay').LabelOptions) => Entity;
162
179
  addIcon: (options: import('../libs/overlay').IconOptions) => Entity;
@@ -166,6 +183,7 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
166
183
  addPolygon: (options: import('../libs/overlay').PolygonOptions) => Entity;
167
184
  addRectangle: (options: import('../libs/overlay').RectangleOptions) => Entity;
168
185
  addCircle: (options: import('../libs/overlay').CircleOptions) => Entity;
186
+ addRing: (options: import('../libs/overlay').RingOptions) => Entity;
169
187
  getOverlay: (id: string) => Entity | undefined;
170
188
  removeOverlay: (id: string) => boolean;
171
189
  removeAllOverlays: () => void;
@@ -185,6 +203,7 @@ export declare function useOverlayHelper(viewer: Ref<Cesium.Viewer | undefined>,
185
203
  addLine: () => void;
186
204
  addArea: () => void;
187
205
  addCircle: () => void;
206
+ addRing: () => void;
188
207
  addPolygon: () => void;
189
208
  addRectangle: () => void;
190
209
  addInfoWindow: () => void;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // VMap Cesium Toolbar Plugin Type Definitions
2
2
 
3
3
  import type * as Cesium from 'cesium';
4
- import type { Viewer, Cartesian3, Cartographic, Entity, Cartesian2, Color } from 'cesium';
4
+ import type { Viewer, Cartesian3, Entity, Color } from 'cesium';
5
5
 
6
6
  // 工具栏配置接口(与 CesiumMapModel.ts 保持一致)
7
7
  export interface ToolbarConfig {
@@ -195,6 +195,7 @@ export interface InitOptions {
195
195
  terrainExaggeration?: number;
196
196
  maximumScreenSpaceError?: number;
197
197
  maximumNumberOfLoadedTiles?: number;
198
+ requestRenderMode?: boolean;
198
199
  token?: string;
199
200
  cesiumToken?: string;
200
201
  success?: () => void;
@@ -261,6 +262,35 @@ export declare class CesiumMapToolbar {
261
262
  // 覆盖物位置类型(与 overlay/types.ts 保持一致)
262
263
  export type OverlayPosition = Cartesian3 | [number, number] | [number, number, number];
263
264
 
265
+ // 覆盖物扩展实体类型(与 libs/overlay/types.ts 保持一致)
266
+ export interface OverlayEntity extends Entity {
267
+ _onClick?: (entity: Entity) => void;
268
+ _overlayType?: string;
269
+ _infoWindow?: HTMLElement;
270
+ _borderEntity?: Entity;
271
+ _innerEntity?: Entity;
272
+ _isThickOutline?: boolean;
273
+ _outlineWidth?: number;
274
+ _isRing?: boolean;
275
+ _ringThickness?: number;
276
+ _ringSegments?: number;
277
+ _ringGlowPower?: number;
278
+ _ringLineColor?: Color | string;
279
+ _ringLineStyle?: 'solid' | 'dashed';
280
+ _ringLineMaterialMode?: 'stripe' | 'dash';
281
+ _ringStripeRepeat?: number;
282
+ _ringDashLength?: number;
283
+ _ringDashPattern?: number;
284
+ _ringGapColor?: Color | string;
285
+ _ringShowInnerLine?: boolean;
286
+ _fillMaterial?: Cesium.MaterialProperty | Color | string;
287
+ _ringHeightEpsilon?: number;
288
+ _centerCartographic?: Cesium.Cartographic;
289
+ _outerRadius?: number;
290
+ _innerRadius?: number;
291
+ _outerRectangle?: Cesium.Rectangle;
292
+ }
293
+
264
294
  export type PositionOffset =
265
295
  | 'top'
266
296
  | 'bottom'
@@ -420,6 +450,46 @@ export interface CircleOptions {
420
450
  id?: string;
421
451
  }
422
452
 
453
+ export interface RingOptions {
454
+ /** 中心点(经纬度/高度 或 Cartesian3) */
455
+ position: OverlayPosition;
456
+ /** 半径(米) */
457
+ radius: number;
458
+ /** 边缘发光颜色 */
459
+ color?: any | string;
460
+ /** 是否绘制内层线(默认 true)。关闭可去掉“白色芯子” */
461
+ showInnerLine?: boolean;
462
+ /** 内层线颜色 */
463
+ lineColor?: any | string;
464
+ /** 内层线型:实线/虚线(默认 solid) */
465
+ lineStyle?: 'solid' | 'dashed';
466
+ /** 虚线材质方案:stripe(默认) / dash */
467
+ lineMaterialMode?: 'stripe' | 'dash';
468
+ /** stripe 模式:条纹重复次数(默认 32) */
469
+ stripeRepeat?: number;
470
+ /** 虚线长度(像素,默认 16) */
471
+ dashLength?: number;
472
+ /** 虚线模式(16bit pattern,可选) */
473
+ dashPattern?: number;
474
+ /** 虚线间隙颜色(默认透明) */
475
+ gapColor?: any | string;
476
+ /** 线宽(像素) */
477
+ width?: number;
478
+ /** 外层发光线宽(像素)。优先于 width */
479
+ glowWidth?: number;
480
+ /** 内层线宽(像素)。不传则使用自动计算 */
481
+ lineWidth?: number;
482
+ /** 发光强度(0-1),越大越“亮/粗” */
483
+ glowPower?: number;
484
+ /** 是否贴地(默认 true) */
485
+ clampToGround?: boolean;
486
+ /** 圆环分段数(默认 128),越大越圆滑 */
487
+ segments?: number;
488
+ /** 覆盖物点击回调 */
489
+ onClick?: (entity: Entity) => void;
490
+ id?: string;
491
+ }
492
+
423
493
  export declare class CesiumOverlayService {
424
494
  constructor(viewer: Viewer);
425
495
  addMarker(options: any): any; // 返回 Cesium.Entity
@@ -431,6 +501,7 @@ export declare class CesiumOverlayService {
431
501
  addPolygon(options: any): any; // 返回 Cesium.Entity
432
502
  addRectangle(options: any): any; // 返回 Cesium.Entity
433
503
  addCircle(options: any): any; // 返回 Cesium.Entity
504
+ addRing(options: RingOptions): any; // 返回 Cesium.Entity
434
505
  getOverlay(id: string): any | undefined; // 返回 Cesium.Entity | undefined
435
506
  removeOverlay(id: string): boolean;
436
507
  removeAllOverlays(): void;
@@ -513,6 +584,38 @@ export declare class MapCircle {
513
584
  updateStyle(entity: Entity, options: Partial<Pick<CircleOptions, 'material' | 'outline' | 'outlineColor' | 'outlineWidth'>>): void;
514
585
  }
515
586
 
587
+ export declare class MapRing {
588
+ constructor(viewer: Viewer);
589
+ add(options: RingOptions): Entity;
590
+ updatePosition(entity: Entity, position: OverlayPosition): void;
591
+ updateRadius(entity: Entity, radius: number): void;
592
+ updateStyle(
593
+ entity: Entity,
594
+ options: Partial<
595
+ Pick<
596
+ RingOptions,
597
+ | 'color'
598
+ | 'showInnerLine'
599
+ | 'lineColor'
600
+ | 'lineStyle'
601
+ | 'lineMaterialMode'
602
+ | 'stripeRepeat'
603
+ | 'dashLength'
604
+ | 'dashPattern'
605
+ | 'gapColor'
606
+ | 'width'
607
+ | 'glowWidth'
608
+ | 'lineWidth'
609
+ | 'glowPower'
610
+ | 'clampToGround'
611
+ | 'segments'
612
+ >
613
+ >
614
+ ): void;
615
+ setVisible(entity: Entity, visible: boolean): void;
616
+ remove(entityOrId: Entity | string): boolean;
617
+ }
618
+
516
619
  // toolbar: 相机控制器及服务(与工具栏相关类保持一致)
517
620
  export interface MapInitialCenter {
518
621
  longitude: number;
@@ -607,7 +710,7 @@ export interface DrawResult {
607
710
 
608
711
  export interface DrawCallbacks {
609
712
  onDrawStart?: () => void;
610
- onDrawEnd?: (entity: Entity | null) => void;
713
+ onDrawEnd?: (entity: Entity | null, result: DrawResult) => void;
611
714
  onEntityRemoved?: (entity: Entity) => void;
612
715
  onMeasureComplete?: (result: DrawResult) => void;
613
716
  }