@xingm/vmap-cesium-toolbar 0.0.2-alpha.11 → 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.
@@ -20,6 +20,9 @@ declare class DrawHelper {
20
20
  private publicEntities;
21
21
  private _doubleClickPending;
22
22
  private lastPreviewPosition;
23
+ private drawHintEntity;
24
+ private drawHintText;
25
+ private drawHintLastPosition;
23
26
  private static activeDrawingHelper;
24
27
  private drawLine;
25
28
  private drawPolygon;
@@ -47,6 +50,26 @@ declare class DrawHelper {
47
50
  * 根据场景模式更新偏移高度
48
51
  */
49
52
  private updateOffsetHeight;
53
+ /**
54
+ * 计算提示文本(随绘制模式 + 点数量变化)
55
+ */
56
+ private getDrawHintText;
57
+ /**
58
+ * 将提示位置转换为显示位置(按当前模式做轻微抬高,避免被地形遮挡)
59
+ */
60
+ private toHintDisplayPosition;
61
+ /**
62
+ * 创建或更新提示实体的位置与文本
63
+ */
64
+ private updateDrawHintPosition;
65
+ /**
66
+ * 更新提示文本(不改变位置;通常在点数变化时调用)
67
+ */
68
+ private refreshDrawHintTextOnly;
69
+ /**
70
+ * 清除绘制提示实体
71
+ */
72
+ private clearDrawHint;
50
73
  /**
51
74
  * 开始绘制线条
52
75
  */
@@ -139,6 +162,10 @@ declare class DrawHelper {
139
162
  * @param entity 要删除的实体
140
163
  */
141
164
  removeEntity(entity: Cesium.Entity): void;
165
+ /**
166
+ * 获取某个绘制实体关联的标签实体(例如面积标签)
167
+ */
168
+ getEntityLabelEntities(entity: Cesium.Entity): Cesium.Entity[];
142
169
  /**
143
170
  * 获取所有已完成的实体
144
171
  * @returns 实体数组
@@ -31,6 +31,8 @@ export type DrawEntity = Entity & {
31
31
  _groundRectangle?: Cesium.Rectangle;
32
32
  _radius?: number;
33
33
  _borderEntity?: Entity;
34
+ /** 关联的测量/提示标签实体(例如面积标签) */
35
+ _labelEntities?: Entity[];
34
36
  _onClick?: (entity: Entity, ...args: any[]) => void;
35
37
  _isSelected?: boolean;
36
38
  _originalStyle?: {
@@ -55,6 +57,8 @@ export interface DrawOptions {
55
57
  outlineColor?: Cesium.Color | string;
56
58
  outlineWidth?: number;
57
59
  };
60
+ /** 是否显示面积标签(多边形/矩形)。默认 true */
61
+ showAreaLabel?: boolean;
58
62
  onClick?: (entity: Entity, type?: "line" | "polygon" | "rectangle" | "circle", positions?: Cartesian3[]) => void;
59
63
  }
60
64
  /**
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.2-alpha.11",
3
+ "version": "0.0.2-alpha.13",
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.11",
3
+ "version": "0.0.2-alpha.13",
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",