@xingm/vmap-cesium-toolbar 0.0.2-alpha.1 → 0.0.2-alpha.2

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.
@@ -51,4 +51,8 @@ export declare class MapCircle {
51
51
  * 更新 Circle 样式
52
52
  */
53
53
  updateStyle(entity: Entity, options: Partial<Pick<CircleOptions, 'material' | 'outline' | 'outlineColor' | 'outlineWidth'>>): void;
54
+ /**
55
+ * 移除 Circle(通过实体或实体 id)
56
+ */
57
+ remove(entityOrId: Entity | string): boolean;
54
58
  }
@@ -52,4 +52,8 @@ export declare class MapIcon {
52
52
  * 更新 Icon 样式
53
53
  */
54
54
  updateStyle(entity: Entity, options: Partial<Pick<IconOptions, 'scale' | 'rotation' | 'color'>>): void;
55
+ /**
56
+ * 移除 Icon(通过实体或实体 id)
57
+ */
58
+ remove(entityOrId: Entity | string): boolean;
55
59
  }
@@ -15,7 +15,16 @@ export interface InfoWindowOptions {
15
15
  backgroundColor?: string;
16
16
  color?: string;
17
17
  font?: string;
18
+ className?: string;
19
+ style?: Partial<CSSStyleDeclaration>;
20
+ showArrow?: boolean;
21
+ arrowSize?: number;
22
+ positionOffset?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom';
18
23
  hideWhenOutOfView?: boolean;
24
+ anchorHeight?: number;
25
+ anchorPixel?: number;
26
+ tailGap?: number;
27
+ updateInterval?: number;
19
28
  }
20
29
  /**
21
30
  * 面向 Cesium 的 HTML 信息窗口管理器
@@ -26,7 +35,25 @@ export declare class MapInfoWindow {
26
35
  private container;
27
36
  private entityMap;
28
37
  private currentTopZIndex;
38
+ private defaultUpdateInterval;
39
+ private isCameraMoving;
40
+ private cameraMoveStartListener?;
41
+ private cameraMoveEndListener?;
42
+ /**
43
+ * 合并用户传入的 InfoWindowOptions 与默认值,提升入参灵活性。
44
+ * 注意:必填项 position / content 由调用方提供,不在默认值内。
45
+ */
46
+ private mergeOptions;
29
47
  constructor(viewer: Viewer, container: HTMLElement);
48
+ /**
49
+ * Set default update interval (ms) for position updates when an InfoWindow doesn't specify `updateInterval`.
50
+ * 0 means update every frame.
51
+ */
52
+ setDefaultUpdateInterval(ms: number): void;
53
+ /**
54
+ * Force immediate update (recompute positions) of all managed info windows.
55
+ */
56
+ forceUpdateAll(): void;
30
57
  private convertPosition;
31
58
  /**
32
59
  * 将世界坐标转换为相对于 container 的 CSS 像素坐标
@@ -56,4 +56,8 @@ export declare class MapLabel {
56
56
  * 更新 Label 样式
57
57
  */
58
58
  updateStyle(entity: Entity, options: Partial<Pick<LabelOptions, 'fillColor' | 'outlineColor' | 'outlineWidth' | 'font' | 'scale'>>): void;
59
+ /**
60
+ * 移除 Label(通过实体或实体 id)
61
+ */
62
+ remove(entityOrId: Entity | string): boolean;
59
63
  }
@@ -43,4 +43,8 @@ export declare class MapMarker {
43
43
  * 更新 Marker 样式
44
44
  */
45
45
  updateStyle(entity: Entity, options: Partial<Pick<MarkerOptions, 'color' | 'outlineColor' | 'outlineWidth' | 'pixelSize'>>): void;
46
+ /**
47
+ * 移除 Marker(通过实体或实体 id)
48
+ */
49
+ remove(entityOrId: Entity | string): boolean;
46
50
  }
@@ -46,4 +46,8 @@ export declare class MapPolygon {
46
46
  * 更新 Polygon 样式
47
47
  */
48
48
  updateStyle(entity: Entity, options: Partial<Pick<PolygonOptions, 'material' | 'outline' | 'outlineColor' | 'outlineWidth'>>): void;
49
+ /**
50
+ * 移除 Polygon(通过实体或实体 id)
51
+ */
52
+ remove(entityOrId: Entity | string): boolean;
49
53
  }
@@ -43,4 +43,8 @@ export declare class MapPolyline {
43
43
  * 更新 Polyline 样式
44
44
  */
45
45
  updateStyle(entity: Entity, options: Partial<Pick<PolylineOptions, 'width' | 'material'>>): void;
46
+ /**
47
+ * 移除 Polyline(通过实体或实体 id)
48
+ */
49
+ remove(entityOrId: Entity | string): boolean;
46
50
  }
@@ -41,4 +41,8 @@ export declare class MapRectangle {
41
41
  * 更新 Rectangle 样式
42
42
  */
43
43
  updateStyle(entity: Entity, options: Partial<Pick<RectangleOptions, 'material' | 'outline' | 'outlineColor' | 'outlineWidth'>>): void;
44
+ /**
45
+ * 移除 Rectangle(通过实体或实体 id)
46
+ */
47
+ remove(entityOrId: Entity | string): boolean;
44
48
  }
@@ -56,4 +56,8 @@ export declare class MapSVG {
56
56
  * 更新 SVG 样式
57
57
  */
58
58
  updateStyle(entity: Entity, options: Partial<Pick<SvgOptions, 'scale' | 'rotation' | 'color'>>): void;
59
+ /**
60
+ * 移除 SVG(通过实体或实体 id)
61
+ */
62
+ remove(entityOrId: Entity | string): boolean;
59
63
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.1-alpha.11",
3
+ "version": "0.0.2-alpha.1",
4
4
  "description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.2-alpha.1",
3
+ "version": "0.0.2-alpha.2",
4
4
  "description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",