@xingm/vmap-cesium-toolbar 0.0.1-alpha.5 → 0.0.1-alpha.6

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.
@@ -25,16 +25,26 @@ declare class DrawHelper {
25
25
  private currentSegmentLabels;
26
26
  private currentTotalLabel;
27
27
  private currentLinePositions;
28
+ private isTotalLabelWarmedUp;
28
29
  private screenSpaceEventHandler;
29
30
  private onDrawStartCallback;
30
31
  private onDrawEndCallback;
31
32
  private onEntityRemovedCallback;
32
33
  private offsetHeight;
34
+ private originalDepthTestAgainstTerrain;
33
35
  /**
34
36
  * 构造函数
35
37
  * @param viewer Cesium Viewer 实例
36
38
  */
37
39
  constructor(viewer: Cesium.Viewer);
40
+ /**
41
+ * 判断一个 Cartesian3 是否为有效坐标(x/y/z 都是有限数字)
42
+ */
43
+ private isValidCartesian3;
44
+ /**
45
+ * 外部调用:在场景模式(2D/3D)切换后,更新偏移高度并重算已完成实体
46
+ */
47
+ handleSceneModeChanged(): void;
38
48
  /**
39
49
  * 根据场景模式更新偏移高度
40
50
  */
@@ -147,6 +157,15 @@ declare class DrawHelper {
147
157
  * @param areaKm2 面积(平方公里)
148
158
  */
149
159
  private formatArea;
160
+ /**
161
+ * 使用 Canvas 绘制总长文本,生成用于 billboard 的图片
162
+ */
163
+ private createTotalLengthBillboardImage;
164
+ /**
165
+ * 使用 Canvas 绘制分段长度文本,生成用于 billboard 的图片
166
+ * 样式与总长保持一致,便于统一视觉
167
+ */
168
+ private createSegmentLengthBillboardImage;
150
169
  /**
151
170
  * 设置开始绘制时的回调函数
152
171
  * @param callback 回调函数
@@ -162,6 +181,11 @@ declare class DrawHelper {
162
181
  * @param callback 回调函数,参数为被移除的实体
163
182
  */
164
183
  onEntityRemoved(callback: (entity: Cesium.Entity) => void): void;
184
+ /**
185
+ * 总长标签预热:创建一个隐藏的、与总长标签样式一致的 label
186
+ * 让 Cesium 预先构建字体图集和背景布局,避免首次真正显示时背景与文字错位
187
+ */
188
+ private warmupTotalLengthLabel;
165
189
  /**
166
190
  * 更新所有已完成实体以适应场景模式变化
167
191
  * 当从2D切换到3D或从3D切换到2D时,需要更新实体的高度参考和位置
@@ -23,6 +23,10 @@ export declare class CesiumMapToolbar {
23
23
  private isNoFlyZoneChecked;
24
24
  private readonly noFlyZoneExtrudedHeight;
25
25
  private currentGeoWTFS;
26
+ private currentMeasureMode;
27
+ readonly measurement: {
28
+ getMeasureMode: () => "none" | "distance" | "area";
29
+ };
26
30
  constructor(viewer: Viewer, container: HTMLElement, config?: ToolbarConfig, callbacks?: {
27
31
  search?: SearchCallback;
28
32
  measurement?: MeasurementCallback;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xingm/vmap-cesium-toolbar",
3
- "version": "0.0.1-alpha.5",
3
+ "version": "0.0.1-alpha.6",
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",