@xingm/vmap-cesium-toolbar 0.0.2-alpha.12 → 0.0.2-alpha.14

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.
@@ -23,6 +23,9 @@ declare class DrawHelper {
23
23
  private drawHintEntity;
24
24
  private drawHintText;
25
25
  private drawHintLastPosition;
26
+ private drawHintOverrideText;
27
+ private drawHintOverrideUntil;
28
+ private lastLeftClickDebug;
26
29
  private static activeDrawingHelper;
27
30
  private drawLine;
28
31
  private drawPolygon;
@@ -31,17 +34,51 @@ declare class DrawHelper {
31
34
  private currentDrawer;
32
35
  private screenSpaceEventHandler;
33
36
  private entityClickHandler;
37
+ private terrainRefineQueue;
38
+ private terrainRefineInFlight;
39
+ private terrainRefineLastTick;
40
+ private terrainRefineListener;
41
+ private originalEntityCollectionAdd;
42
+ private entityCollectionAddHookInstalled;
34
43
  private onDrawStartCallback;
35
44
  private onDrawEndCallback;
36
45
  private onEntityRemovedCallback;
37
46
  private onMeasureCompleteCallback;
38
47
  private offsetHeight;
48
+ /** 当前绘制配置(用于调度器侧做快速校验/提示) */
49
+ private currentDrawOptions?;
39
50
  private originalDepthTestAgainstTerrain;
51
+ private isFiniteCartesian3;
52
+ private findEntityById;
53
+ private removeEntityById;
54
+ /**
55
+ * 在绘制/结束绘制的临界时刻短暂屏蔽 scene.pick 等交互,避免同一点击事件链中
56
+ * 其它模块(如覆盖物服务)继续触发 pick,引发 ground/worker 相关异常。
57
+ */
58
+ private setPickCooldown;
59
+ private isPickBlocked;
60
+ /**
61
+ * 在实体被加入场景后、渲染循环更新前做一次快速校验。
62
+ * 避免某些极端情况下(例如 height 为 Infinity 等)构造出 NaN Cartesian3,导致下一帧渲染直接停止。
63
+ */
64
+ private validateEntityPositionsOrRemove;
65
+ /**
66
+ * 防御性清理:移除包含 NaN/Infinity 坐标的实体。
67
+ * 这类实体会在 Cesium 的 GeometryUpdater/TerrainOffsetProperty 更新阶段持续抛错,
68
+ * 即使后续代码已修复输入,也会因旧实体仍存在而反复报错。
69
+ */
70
+ private removeEntitiesWithInvalidPositions;
40
71
  /**
41
72
  * 构造函数
42
73
  * @param viewer Cesium Viewer 实例
43
74
  */
44
75
  constructor(viewer: Cesium.Viewer);
76
+ private dumpPotentialClampingEntities;
77
+ private sanitizeNewEntity;
78
+ private installEntitiesAddHook;
79
+ private uninstallEntitiesAddHook;
80
+ private installGroundGeometryUpdaterDebugHook;
81
+ private logRenderErrorDetails;
45
82
  /**
46
83
  * 外部调用:在场景模式(2D/3D)切换后,更新偏移高度并重算已完成实体
47
84
  */
@@ -54,6 +91,7 @@ declare class DrawHelper {
54
91
  * 计算提示文本(随绘制模式 + 点数量变化)
55
92
  */
56
93
  private getDrawHintText;
94
+ private setDrawHintOverride;
57
95
  /**
58
96
  * 将提示位置转换为显示位置(按当前模式做轻微抬高,避免被地形遮挡)
59
97
  */
@@ -162,6 +200,10 @@ declare class DrawHelper {
162
200
  * @param entity 要删除的实体
163
201
  */
164
202
  removeEntity(entity: Cesium.Entity): void;
203
+ /**
204
+ * 获取某个绘制实体关联的标签实体(例如面积标签)
205
+ */
206
+ getEntityLabelEntities(entity: Cesium.Entity): Cesium.Entity[];
165
207
  /**
166
208
  * 获取所有已完成的实体
167
209
  * @returns 实体数组
@@ -193,6 +235,12 @@ declare class DrawHelper {
193
235
  * 当从2D切换到3D或从3D切换到2D时,需要更新实体的高度参考和位置
194
236
  */
195
237
  private updateFinishedEntitiesForModeChange;
238
+ /**
239
+ * 加入“两阶段地形适配”队列:先 NONE 安全显示,tilesLoaded 后再采样/切换。
240
+ */
241
+ private scheduleTerrainRefine;
242
+ private processTerrainRefineQueue;
243
+ private refineEntityToTerrain;
196
244
  /**
197
245
  * 销毁工具,清理所有事件监听器
198
246
  */
@@ -1,6 +1,9 @@
1
1
  import { Viewer as CesiumViewer, Terrain, TerrainProvider } from '../../node_modules/cesium';
2
2
  import * as Cesium from 'cesium';
3
3
  interface InitOptions {
4
+ orderIndependentTranslucency?: boolean;
5
+ fxaa?: boolean;
6
+ msaaSamples?: number;
4
7
  terrain?: Terrain;
5
8
  terrainProvider?: TerrainProvider;
6
9
  mapType?: string;
@@ -1,4 +1,5 @@
1
1
  import { Viewer, Entity } from '../../node_modules/cesium';
2
+ import { OverlayEntity, OverlayPosition } from './overlay/types';
2
3
  import { MapMarker, MarkerOptions } from './overlay/MapMarker';
3
4
  import { MapLabel, LabelOptions } from './overlay/MapLabel';
4
5
  import { MapIcon, IconOptions } from './overlay/MapIcon';
@@ -9,7 +10,6 @@ import { MapPolygon, PolygonOptions } from './overlay/MapPolygon';
9
10
  import { MapRectangle, RectangleOptions } from './overlay/MapRectangle';
10
11
  import { MapCircle, CircleOptions } from './overlay/MapCircle';
11
12
  import { MapRing, RingOptions } from './overlay/MapRing';
12
- import { OverlayPosition } from './overlay/types';
13
13
  /**
14
14
  * Cesium 覆盖物服务类
15
15
  * 统一管理各种覆盖物工具类
@@ -19,6 +19,11 @@ export declare class CesiumOverlayService {
19
19
  private entities;
20
20
  private overlayMap;
21
21
  private infoWindowContainer;
22
+ private lastHoverTargets;
23
+ private hoverPickRAF;
24
+ private hoverPickPos;
25
+ private static readonly DEFAULT_HIGHLIGHT_COLOR;
26
+ private static readonly DEFAULT_HIGHLIGHT_FILL_ALPHA;
22
27
  readonly marker: MapMarker;
23
28
  readonly label: MapLabel;
24
29
  readonly icon: MapIcon;
@@ -30,6 +35,26 @@ export declare class CesiumOverlayService {
30
35
  readonly circle: MapCircle;
31
36
  readonly ring: MapRing;
32
37
  constructor(viewer: Viewer);
38
+ /**
39
+ * Cesium 默认可能无法 pick 到半透明覆盖物(例如 alpha < 1 的填充面)。
40
+ * 开启 pickTranslucentDepth 后,hover/click 才能稳定命中半透明面。
41
+ */
42
+ private enableTranslucentPicking;
43
+ /**
44
+ * 尝试从屏幕坐标拾取地表/模型位置并转为 Cartographic
45
+ */
46
+ private pickCartographic;
47
+ /**
48
+ * 当 pick/drillPick 未命中时,使用经纬度判断是否落在 Rectangle 覆盖物内
49
+ */
50
+ private findHoverableRectangleByCartographic;
51
+ /**
52
+ * 判断点是否在多边形内(2D)
53
+ */
54
+ private isPointInPolygon2D;
55
+ private resolvePolygonPositions;
56
+ private findHoverablePolygonByCartographic;
57
+ private findHoverableCircleByCartographic;
33
58
  /**
34
59
  * 初始化信息窗口容器
35
60
  */
@@ -38,10 +63,34 @@ export declare class CesiumOverlayService {
38
63
  * 设置实体点击处理器
39
64
  */
40
65
  private setupEntityClickHandler;
66
+ /**
67
+ * 设置实体 hover 高亮处理器(鼠标移入高亮,移出取消)
68
+ */
69
+ private setupEntityHoverHandler;
70
+ private getPropertyValue;
71
+ private getNumberProperty;
72
+ private resolveHighlightOptions;
73
+ private getActiveHighlightOptions;
74
+ private setOverlayHighlightReason;
75
+ private applyOverlayHighlightStyle;
76
+ /**
77
+ * 恢复覆盖物的高亮样式
78
+ * @param entity - 覆盖物实体对象
79
+ * @returns 无返回值
80
+ */
81
+ private restoreOverlayHighlightStyle;
41
82
  /**
42
83
  * 生成唯一ID
43
84
  */
44
85
  private generateId;
86
+ toggleOverlayHighlight(entity: OverlayEntity, reason?: 'click' | 'hover'): void;
87
+ /**
88
+ * 高亮/取消高亮覆盖物(显式设置)
89
+ * @param entityOrId 覆盖物实体或 id
90
+ * @param enabled 是否高亮
91
+ * @param reason 高亮原因(默认 click)
92
+ */
93
+ setOverlayHighlight(entityOrId: OverlayEntity | string, enabled: boolean, reason?: 'click' | 'hover'): boolean;
45
94
  /**
46
95
  * 添加 Marker
47
96
  */
@@ -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,26 @@ export interface DrawOptions {
55
57
  outlineColor?: Cesium.Color | string;
56
58
  outlineWidth?: number;
57
59
  };
60
+ /** 是否显示面积标签(多边形/矩形)。默认 true */
61
+ showAreaLabel?: boolean;
62
+ /**
63
+ * 是否启用多边形自相交校验。
64
+ * - false/未设置:默认允许交叉(不做校验)
65
+ * - true:启用自相交校验(结合 selfIntersectionAllowTouch/AllowContinue 控制行为)
66
+ */
67
+ selfIntersectionEnabled?: boolean;
68
+ /**
69
+ * 多边形自相交校验:是否允许“擦边/顶点落在旧边上”等仅接触(touch)情况。
70
+ * - false/未设置:touch 也视为不合法
71
+ * - true:允许 touch,但仍不允许重叠(overlap)与真正穿越(cross)
72
+ */
73
+ selfIntersectionAllowTouch?: boolean;
74
+ /**
75
+ * 多边形自相交校验:当即将产生自相交时,是否仍允许继续绘制/完成绘制。
76
+ * - false/未设置:检测到自相交则阻止落点/阻止完成
77
+ * - true:检测到自相交不拦截(由业务自行承担后续面积/中心等偏差风险)
78
+ */
79
+ selfIntersectionAllowContinue?: boolean;
58
80
  onClick?: (entity: Entity, type?: "line" | "polygon" | "rectangle" | "circle", positions?: Cartesian3[]) => void;
59
81
  }
60
82
  /**
@@ -26,4 +26,5 @@ export declare class DrawPolygon extends BaseDraw {
26
26
  * 获取绘制类型
27
27
  */
28
28
  getDrawType(): "line" | "polygon" | "rectangle" | "circle";
29
+ addPoint(position: Cartesian3): void;
29
30
  }
@@ -1,5 +1,5 @@
1
1
  import { Viewer, Entity, Color, HeightReference } from '../../../node_modules/cesium';
2
- import { OverlayPosition } from './types';
2
+ import { OverlayPosition, OverlayEntity } from './types';
3
3
  import * as Cesium from "cesium";
4
4
  /**
5
5
  * Circle 选项
@@ -7,13 +7,41 @@ import * as Cesium from "cesium";
7
7
  export interface CircleOptions {
8
8
  position: OverlayPosition;
9
9
  radius: number;
10
+ /**
11
+ * 渲染模式:
12
+ * - auto:自动选择(默认;当前实现等同于 entity)
13
+ * - entity:使用 Cesium Entity
14
+ * - primitive:使用 Cesium Primitive(为大批量静态覆盖物预留)
15
+ */
16
+ renderMode?: 'auto' | 'entity' | 'primitive';
10
17
  material?: Cesium.MaterialProperty | Color | string;
11
18
  outline?: boolean;
12
19
  outlineColor?: Color | string;
13
20
  outlineWidth?: number;
21
+ /**
22
+ * 粗边框(outlineWidth>1)模式下用于近似圆的分段数,越大越圆滑但更耗性能。
23
+ * 默认 256。
24
+ */
25
+ segments?: number;
26
+ /**
27
+ * 是否贴地(默认:在粗边框模式下为 true)。
28
+ * - true:填充与边框都贴地。
29
+ * - false:填充与边框都使用 position 高度悬空。
30
+ */
31
+ clampToGround?: boolean;
14
32
  heightReference?: HeightReference;
15
33
  extrudedHeight?: number;
16
34
  heightEpsilon?: number;
35
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
36
+ clickHighlight?: boolean | {
37
+ color?: Color | string;
38
+ fillAlpha?: number;
39
+ };
40
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
41
+ hoverHighlight?: boolean | {
42
+ color?: Color | string;
43
+ fillAlpha?: number;
44
+ };
17
45
  onClick?: (entity: Entity) => void;
18
46
  id?: string;
19
47
  }
@@ -23,7 +51,13 @@ export interface CircleOptions {
23
51
  export declare class MapCircle {
24
52
  private viewer;
25
53
  private entities;
54
+ private primitiveBatch;
55
+ private static bearingTableCache;
26
56
  constructor(viewer: Viewer);
57
+ private getPrimitiveBatch;
58
+ private resolveMaterialColor;
59
+ private canUsePrimitive;
60
+ private addPrimitiveCircle;
27
61
  /**
28
62
  * 转换位置为 Cartesian3
29
63
  */
@@ -45,6 +79,12 @@ export declare class MapCircle {
45
79
  * 使用大圆航线公式,segments 越大越平滑。
46
80
  */
47
81
  private generateCirclePositions;
82
+ private getBearingTable;
83
+ /**
84
+ * 粗边框模式的默认分段数:平衡“圆滑程度/性能”。
85
+ * 用户如果传了 options.segments,则完全尊重用户设置。
86
+ */
87
+ private getDefaultSegmentsForRadius;
48
88
  /**
49
89
  * 更新 Circle 位置
50
90
  */
@@ -61,4 +101,7 @@ export declare class MapCircle {
61
101
  * 移除 Circle(通过实体或实体 id)
62
102
  */
63
103
  remove(entityOrId: Entity | string): boolean;
104
+ setPrimitiveVisible(entity: Entity, visible: boolean): void;
105
+ applyPrimitiveHighlight(entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number): void;
106
+ restorePrimitiveHighlight(entity: OverlayEntity): void;
64
107
  }
@@ -18,6 +18,16 @@ export interface IconOptions {
18
18
  heightReference?: HeightReference;
19
19
  disableDepthTestDistance?: number;
20
20
  color?: Color | string;
21
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
22
+ clickHighlight?: boolean | {
23
+ color?: Color | string;
24
+ fillAlpha?: number;
25
+ };
26
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
27
+ hoverHighlight?: boolean | {
28
+ color?: Color | string;
29
+ fillAlpha?: number;
30
+ };
21
31
  onClick?: (entity: Entity) => void;
22
32
  id?: string;
23
33
  }
@@ -22,6 +22,16 @@ export interface LabelOptions {
22
22
  backgroundColor?: Color | string;
23
23
  backgroundPadding?: Cesium.Cartesian2;
24
24
  disableDepthTestDistance?: number;
25
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
26
+ clickHighlight?: boolean | {
27
+ color?: Color | string;
28
+ fillAlpha?: number;
29
+ };
30
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
31
+ hoverHighlight?: boolean | {
32
+ color?: Color | string;
33
+ fillAlpha?: number;
34
+ };
25
35
  onClick?: (entity: Entity) => void;
26
36
  id?: string;
27
37
  }
@@ -13,6 +13,16 @@ export interface MarkerOptions {
13
13
  heightReference?: HeightReference;
14
14
  scaleByDistance?: Cesium.NearFarScalar;
15
15
  disableDepthTestDistance?: number;
16
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
17
+ clickHighlight?: boolean | {
18
+ color?: Color | string;
19
+ fillAlpha?: number;
20
+ };
21
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
22
+ hoverHighlight?: boolean | {
23
+ color?: Color | string;
24
+ fillAlpha?: number;
25
+ };
16
26
  onClick?: (entity: Entity) => void;
17
27
  id?: string;
18
28
  }
@@ -1,17 +1,40 @@
1
1
  import { Viewer, Entity, Color, HeightReference } from '../../../node_modules/cesium';
2
- import { OverlayPosition } from './types';
2
+ import { OverlayPosition, OverlayEntity } from './types';
3
3
  import * as Cesium from "cesium";
4
4
  /**
5
5
  * Polygon 选项
6
6
  */
7
7
  export interface PolygonOptions {
8
8
  positions: OverlayPosition[];
9
+ /**
10
+ * 渲染模式:
11
+ * - auto:自动选择(默认;当前仅在“粗边框+贴地+纯色”场景下会切到 primitive)
12
+ * - entity:使用 Cesium Entity
13
+ * - primitive:使用 Cesium GroundPrimitive / GroundPolylinePrimitive(大批量静态贴地场景)
14
+ */
15
+ renderMode?: 'auto' | 'entity' | 'primitive';
9
16
  material?: Cesium.MaterialProperty | Color | string;
10
17
  outline?: boolean;
11
18
  outlineColor?: Color | string;
12
19
  outlineWidth?: number;
20
+ /**
21
+ * 是否贴地(默认:在粗边框模式下为 true)。
22
+ * - true:填充与边框都贴地(避免一贴地一悬空导致缝隙)。
23
+ * - false:填充与边框都在统一的 baseHeight 上悬空。
24
+ */
25
+ clampToGround?: boolean;
13
26
  heightReference?: HeightReference;
14
27
  extrudedHeight?: number;
28
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
29
+ clickHighlight?: boolean | {
30
+ color?: Color | string;
31
+ fillAlpha?: number;
32
+ };
33
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
34
+ hoverHighlight?: boolean | {
35
+ color?: Color | string;
36
+ fillAlpha?: number;
37
+ };
15
38
  onClick?: (entity: Entity) => void;
16
39
  id?: string;
17
40
  }
@@ -21,7 +44,12 @@ export interface PolygonOptions {
21
44
  export declare class MapPolygon {
22
45
  private viewer;
23
46
  private entities;
47
+ private primitiveBatch;
24
48
  constructor(viewer: Viewer);
49
+ private getPrimitiveBatch;
50
+ private resolveMaterialColor;
51
+ private canUsePrimitive;
52
+ private addPrimitivePolygon;
25
53
  /**
26
54
  * 转换位置为 Cartesian3
27
55
  */
@@ -67,4 +95,7 @@ export declare class MapPolygon {
67
95
  * 移除 Polygon(通过实体或实体 id)
68
96
  */
69
97
  remove(entityOrId: Entity | string): boolean;
98
+ setPrimitiveVisible(entity: Entity, visible: boolean): void;
99
+ applyPrimitiveHighlight(entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number): void;
100
+ restorePrimitiveHighlight(entity: OverlayEntity): void;
70
101
  }
@@ -9,6 +9,16 @@ export interface PolylineOptions {
9
9
  width?: number;
10
10
  material?: Cesium.MaterialProperty | Color | string;
11
11
  clampToGround?: boolean;
12
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
13
+ clickHighlight?: boolean | {
14
+ color?: Color | string;
15
+ fillAlpha?: number;
16
+ };
17
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
18
+ hoverHighlight?: boolean | {
19
+ color?: Color | string;
20
+ fillAlpha?: number;
21
+ };
12
22
  onClick?: (entity: Entity) => void;
13
23
  id?: string;
14
24
  }
@@ -1,16 +1,40 @@
1
1
  import { Viewer, Entity, Color, HeightReference } from '../../../node_modules/cesium';
2
+ import { OverlayEntity } from './types';
2
3
  import * as Cesium from "cesium";
3
4
  /**
4
5
  * Rectangle 选项
5
6
  */
6
7
  export interface RectangleOptions {
7
8
  coordinates: Cesium.Rectangle;
9
+ /**
10
+ * 渲染模式:
11
+ * - auto:自动选择(默认;当前仅在“粗边框+贴地+纯色”场景下会切到 primitive)
12
+ * - entity:使用 Cesium Entity
13
+ * - primitive:使用 Cesium GroundPrimitive(大批量静态贴地场景)
14
+ */
15
+ renderMode?: 'auto' | 'entity' | 'primitive';
8
16
  material?: Cesium.MaterialProperty | Color | string;
9
17
  outline?: boolean;
10
18
  outlineColor?: Color | string;
11
19
  outlineWidth?: number;
20
+ /** 是否贴地(默认:在粗边框模式下为 true) */
21
+ clampToGround?: boolean;
22
+ /** 悬空时的基准高度(米,clampToGround=false 时有效) */
23
+ height?: number;
12
24
  heightReference?: HeightReference;
13
25
  extrudedHeight?: number;
26
+ /** 高度容差(米):用于避免共面深度冲突;会同时作用于边框与填充以保证一致 */
27
+ heightEpsilon?: number;
28
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
29
+ clickHighlight?: boolean | {
30
+ color?: Color | string;
31
+ fillAlpha?: number;
32
+ };
33
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
34
+ hoverHighlight?: boolean | {
35
+ color?: Color | string;
36
+ fillAlpha?: number;
37
+ };
14
38
  onClick?: (entity: Entity) => void;
15
39
  id?: string;
16
40
  }
@@ -20,7 +44,12 @@ export interface RectangleOptions {
20
44
  export declare class MapRectangle {
21
45
  private viewer;
22
46
  private entities;
47
+ private primitiveBatch;
23
48
  constructor(viewer: Viewer);
49
+ private getPrimitiveBatch;
50
+ private resolveMaterialColor;
51
+ private canUsePrimitive;
52
+ private addPrimitiveRectangle;
24
53
  /**
25
54
  * 转换颜色
26
55
  */
@@ -53,4 +82,7 @@ export declare class MapRectangle {
53
82
  * 移除 Rectangle(通过实体或实体 id)
54
83
  */
55
84
  remove(entityOrId: Entity | string): boolean;
85
+ setPrimitiveVisible(entity: Entity, visible: boolean): void;
86
+ applyPrimitiveHighlight(entity: OverlayEntity, hlColor: Cesium.Color, fillAlpha: number): void;
87
+ restorePrimitiveHighlight(entity: OverlayEntity): void;
56
88
  }
@@ -40,6 +40,16 @@ export interface RingOptions {
40
40
  segments?: number;
41
41
  /** 覆盖物点击回调 */
42
42
  onClick?: (entity: Entity) => void;
43
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
44
+ clickHighlight?: boolean | {
45
+ color?: Color | string;
46
+ fillAlpha?: number;
47
+ };
48
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
49
+ hoverHighlight?: boolean | {
50
+ color?: Color | string;
51
+ fillAlpha?: number;
52
+ };
43
53
  id?: string;
44
54
  }
45
55
  /**
@@ -18,6 +18,16 @@ export interface SvgOptions {
18
18
  heightReference?: HeightReference;
19
19
  disableDepthTestDistance?: number;
20
20
  color?: Color | string;
21
+ /** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
22
+ clickHighlight?: boolean | {
23
+ color?: Color | string;
24
+ fillAlpha?: number;
25
+ };
26
+ /** 鼠标移入该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
27
+ hoverHighlight?: boolean | {
28
+ color?: Color | string;
29
+ fillAlpha?: number;
30
+ };
21
31
  onClick?: (entity: Entity) => void;
22
32
  id?: string;
23
33
  }
@@ -0,0 +1,35 @@
1
+ import { Viewer, Entity } from '../../../../node_modules/cesium';
2
+ import * as Cesium from 'cesium';
3
+ export interface CirclePrimitiveParts {
4
+ outer: Entity;
5
+ inner: Entity;
6
+ }
7
+ export declare class CirclePrimitiveBatch {
8
+ private viewer;
9
+ private collection;
10
+ private ringPrimitive;
11
+ private fillPrimitive;
12
+ private records;
13
+ private rebuildScheduled;
14
+ private colorApplyScheduled;
15
+ private pendingColorApplyIds;
16
+ constructor(viewer: Viewer);
17
+ destroy(): void;
18
+ has(circleId: string): boolean;
19
+ upsertGeometry(args: {
20
+ circleId: string;
21
+ parts: CirclePrimitiveParts;
22
+ ringPositions: Cesium.Cartesian3[];
23
+ fillPositions: Cesium.Cartesian3[];
24
+ ringColor: Cesium.Color;
25
+ fillColor: Cesium.Color;
26
+ visible: boolean;
27
+ }): void;
28
+ remove(circleId: string): void;
29
+ setVisible(circleId: string, visible: boolean): void;
30
+ setColors(circleId: string, ringColor: Cesium.Color, fillColor: Cesium.Color): void;
31
+ private scheduleApplyColors;
32
+ private scheduleRebuild;
33
+ private rebuild;
34
+ private applyCurrentColors;
35
+ }
@@ -0,0 +1,36 @@
1
+ import { Viewer, Entity } from '../../../../node_modules/cesium';
2
+ import * as Cesium from 'cesium';
3
+ export interface PolygonPrimitiveParts {
4
+ fill: Entity;
5
+ border: Entity;
6
+ }
7
+ export declare class PolygonPrimitiveBatch {
8
+ private viewer;
9
+ private collection;
10
+ private fillPrimitive;
11
+ private borderPrimitive;
12
+ private records;
13
+ private rebuildScheduled;
14
+ private colorApplyScheduled;
15
+ private pendingColorApplyIds;
16
+ constructor(viewer: Viewer);
17
+ destroy(): void;
18
+ upsertGeometry(args: {
19
+ polygonId: string;
20
+ parts: PolygonPrimitiveParts;
21
+ fillPositions: Cesium.Cartesian3[];
22
+ borderPositions: Cesium.Cartesian3[];
23
+ borderWidth: number;
24
+ fillColor: Cesium.Color;
25
+ borderColor: Cesium.Color;
26
+ visible: boolean;
27
+ }): void;
28
+ remove(polygonId: string): void;
29
+ setVisible(polygonId: string, visible: boolean): void;
30
+ setColors(polygonId: string, borderColor: Cesium.Color, fillColor: Cesium.Color): void;
31
+ private scheduleApplyColors;
32
+ setBorderWidth(polygonId: string, borderWidth: number): void;
33
+ private scheduleRebuild;
34
+ private rebuild;
35
+ private applyCurrentColors;
36
+ }
@@ -0,0 +1,34 @@
1
+ import { Viewer, Entity } from '../../../../node_modules/cesium';
2
+ import * as Cesium from 'cesium';
3
+ export interface RectanglePrimitiveParts {
4
+ outer: Entity;
5
+ inner: Entity;
6
+ }
7
+ export declare class RectanglePrimitiveBatch {
8
+ private viewer;
9
+ private collection;
10
+ private ringPrimitive;
11
+ private fillPrimitive;
12
+ private records;
13
+ private rebuildScheduled;
14
+ private colorApplyScheduled;
15
+ private pendingColorApplyIds;
16
+ constructor(viewer: Viewer);
17
+ destroy(): void;
18
+ upsertGeometry(args: {
19
+ rectangleId: string;
20
+ parts: RectanglePrimitiveParts;
21
+ outerPositions: Cesium.Cartesian3[];
22
+ innerPositions: Cesium.Cartesian3[];
23
+ ringColor: Cesium.Color;
24
+ fillColor: Cesium.Color;
25
+ visible: boolean;
26
+ }): void;
27
+ remove(rectangleId: string): void;
28
+ setVisible(rectangleId: string, visible: boolean): void;
29
+ setColors(rectangleId: string, ringColor: Cesium.Color, fillColor: Cesium.Color): void;
30
+ private scheduleApplyColors;
31
+ private scheduleRebuild;
32
+ private rebuild;
33
+ private applyCurrentColors;
34
+ }