@xingm/vmap-cesium-toolbar 0.0.2-alpha.17 → 0.0.2-alpha.19
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.
- package/dist/hooks/useMapInit.d.ts +14 -0
- package/dist/hooks/useOverlayHelper.d.ts +15 -0
- package/dist/i18n/en-US.d.ts +8 -0
- package/dist/i18n/zh-CN.d.ts +8 -0
- package/dist/index.d.ts +37 -993
- package/dist/{index.js → index.es.js} +2294 -1221
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/libs/CesiumAutoRecover.d.ts +48 -0
- package/dist/libs/CesiumHeatmapLayer.d.ts +29 -0
- package/dist/libs/CesiumMapDraw.d.ts +14 -1
- package/dist/libs/CesiumMapLoader.d.ts +3 -0
- package/dist/libs/CesiumOverlayService.d.ts +103 -1
- package/dist/libs/drawHelper/BaseDraw.d.ts +2 -0
- package/dist/libs/drawHelper/DrawLine.d.ts +4 -0
- package/dist/libs/drawHelper/DrawPolgon.d.ts +5 -0
- package/dist/libs/i18n/index.d.ts +1 -0
- package/dist/libs/overlay/MapCircle.d.ts +10 -0
- package/dist/libs/overlay/MapInfoWindow.d.ts +3 -3
- package/dist/libs/overlay/index.d.ts +1 -0
- package/dist/libs/overlay/primitives/CirclePrimitiveLayerStack.d.ts +5 -5
- package/dist/libs/overlay/primitives/PolygonPrimitiveLayerStack.d.ts +5 -5
- package/dist/libs/overlay/types.d.ts +4 -0
- package/dist/libs/toolBar/MapToolBarConfig.d.ts +8 -1
- package/dist/package.json +10 -9
- package/package.json +9 -8
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Viewer } from '../../node_modules/cesium';
|
|
2
|
+
export interface CesiumAutoRecoverOptions {
|
|
3
|
+
/** 是否启用自动恢复(默认 false) */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
/** 最大恢复次数(默认 3) */
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
/** 两次恢复之间的最小间隔(默认 5000ms) */
|
|
8
|
+
cooldownMs?: number;
|
|
9
|
+
/** 恢复后是否尝试保留相机视角(默认 true) */
|
|
10
|
+
preserveCamera?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 触发恢复的原因与错误信息
|
|
13
|
+
* - reason: renderError/widgetError/watchdog/windowError 等
|
|
14
|
+
*/
|
|
15
|
+
onRecovering?: (ctx: {
|
|
16
|
+
reason: string;
|
|
17
|
+
error?: unknown;
|
|
18
|
+
attempt: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
/** 恢复成功回调:业务侧应在这里替换引用(非常重要) */
|
|
21
|
+
onRecovered?: (ctx: {
|
|
22
|
+
reason: string;
|
|
23
|
+
error?: unknown;
|
|
24
|
+
attempt: number;
|
|
25
|
+
oldViewer: Viewer;
|
|
26
|
+
newViewer: Viewer;
|
|
27
|
+
}) => void;
|
|
28
|
+
/**
|
|
29
|
+
* 渲染“静默停止”监测:有些错误不一定走 renderError,但会导致不再 postRender。
|
|
30
|
+
* 注意:若开启了 requestRenderMode(按需渲染),默认不建议启用 watchdog。
|
|
31
|
+
*/
|
|
32
|
+
watchdog?: {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/** 多久没有 postRender 认为卡死(默认 6000ms) */
|
|
35
|
+
staleMs?: number;
|
|
36
|
+
/** 检查间隔(默认 2000ms) */
|
|
37
|
+
checkIntervalMs?: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
type CreateViewer = () => Promise<Viewer>;
|
|
41
|
+
/**
|
|
42
|
+
* 为已有 Viewer 安装自动恢复:遇到“Rendering has stopped”/NaN render error 等,自动重建 Viewer。
|
|
43
|
+
* 重要:重建会产生新的 Viewer 实例,业务侧必须在 onRecovered 里替换引用。
|
|
44
|
+
*/
|
|
45
|
+
export declare function enableCesiumAutoRecover(viewer: Viewer, createViewer: CreateViewer, options: CesiumAutoRecoverOptions): {
|
|
46
|
+
dispose: () => void;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
@@ -18,6 +18,8 @@ export interface HeatmapOptions {
|
|
|
18
18
|
/** Canvas 分辨率,越大越清晰但开销越大 */
|
|
19
19
|
width?: number;
|
|
20
20
|
height?: number;
|
|
21
|
+
/** 渲染模式:heat 为热力渐变(默认);discrete 为严格分段纯色 */
|
|
22
|
+
mode?: "heat" | "discrete";
|
|
21
23
|
/** 单个点的影响半径(像素) */
|
|
22
24
|
radius?: number;
|
|
23
25
|
/** 低强度提升(伽马矫正),< 1 可增强边缘,默认 0.7 */
|
|
@@ -31,6 +33,20 @@ export interface HeatmapOptions {
|
|
|
31
33
|
opacity?: number;
|
|
32
34
|
/** 颜色梯度 */
|
|
33
35
|
gradient?: HeatmapGradient;
|
|
36
|
+
/**
|
|
37
|
+
* 严格分段(仅 mode=discrete 生效):
|
|
38
|
+
* thresholds.length + 1 必须等于 colors.length。
|
|
39
|
+
* 例如 thresholds=[40,60,90,110] colors=[蓝,青,绿,黄,红]
|
|
40
|
+
* - value < 40 -> colors[0]
|
|
41
|
+
* - 40 <= value < 60 -> colors[1]
|
|
42
|
+
* - 60 <= value < 90 -> colors[2]
|
|
43
|
+
* - 90 <= value < 110 -> colors[3]
|
|
44
|
+
* - value >= 110 -> colors[4]
|
|
45
|
+
*/
|
|
46
|
+
discreteThresholds?: number[];
|
|
47
|
+
discreteColors?: string[];
|
|
48
|
+
/** 重叠像素的决策:max=取更高分段(默认);last=后绘制覆盖 */
|
|
49
|
+
discreteOverlap?: "max" | "last";
|
|
34
50
|
}
|
|
35
51
|
export interface HeatmapAutoUpdateOptions {
|
|
36
52
|
/** 是否启用随视角变化自动重绘(默认 true) */
|
|
@@ -64,7 +80,20 @@ export default class CesiumHeatmapLayer {
|
|
|
64
80
|
private workerReady;
|
|
65
81
|
private pendingUpdate;
|
|
66
82
|
private lastUpdateKey;
|
|
83
|
+
private handleWorkerFault;
|
|
67
84
|
constructor(viewer: Cesium.Viewer, options?: HeatmapOptions);
|
|
85
|
+
private parseColorToRGBA;
|
|
86
|
+
/**
|
|
87
|
+
* 获取离散桶的索引
|
|
88
|
+
* @param value - 需要确定桶索引的数值
|
|
89
|
+
* @return 返回对应的桶索引,如果阈值无效则返回0
|
|
90
|
+
*/
|
|
91
|
+
private getDiscreteBucketIndex;
|
|
92
|
+
/**
|
|
93
|
+
* 渲染离散热力图
|
|
94
|
+
* @param points 热力点数据数组
|
|
95
|
+
*/
|
|
96
|
+
private renderDiscrete;
|
|
68
97
|
/**
|
|
69
98
|
* 设置/替换热力图数据(度为单位)
|
|
70
99
|
*/
|
|
@@ -74,11 +74,19 @@ declare class DrawHelper {
|
|
|
74
74
|
*/
|
|
75
75
|
constructor(viewer: Cesium.Viewer);
|
|
76
76
|
private dumpPotentialClampingEntities;
|
|
77
|
+
/**
|
|
78
|
+
* 对新创建的实体进行净化处理,确保其符合渲染要求
|
|
79
|
+
* @param entity - 需要净化的 Cesium.Entity 对象
|
|
80
|
+
* @param tag - 用于标识来源的标签,会在控制台警告时显示
|
|
81
|
+
*/
|
|
77
82
|
private sanitizeNewEntity;
|
|
78
83
|
private installEntitiesAddHook;
|
|
79
84
|
private uninstallEntitiesAddHook;
|
|
85
|
+
/**
|
|
86
|
+
* 安装地面几何更新器调试钩子
|
|
87
|
+
* 此方法用于在Cesium GroundGeometryUpdater中安装一个调试钩子,用于捕获和处理渲染错误
|
|
88
|
+
*/
|
|
80
89
|
private installGroundGeometryUpdaterDebugHook;
|
|
81
|
-
private logRenderErrorDetails;
|
|
82
90
|
/**
|
|
83
91
|
* 外部调用:在场景模式(2D/3D)切换后,更新偏移高度并重算已完成实体
|
|
84
92
|
*/
|
|
@@ -91,6 +99,11 @@ declare class DrawHelper {
|
|
|
91
99
|
* 计算提示文本(随绘制模式 + 点数量变化)
|
|
92
100
|
*/
|
|
93
101
|
private getDrawHintText;
|
|
102
|
+
/**
|
|
103
|
+
* 设置绘制提示覆盖文本及其持续时间
|
|
104
|
+
* @param text 要显示的提示文本
|
|
105
|
+
* @param ms 提示文本显示的持续时间(毫秒),默认为1200毫秒
|
|
106
|
+
*/
|
|
94
107
|
private setDrawHintOverride;
|
|
95
108
|
/**
|
|
96
109
|
* 将提示位置转换为显示位置(按当前模式做轻微抬高,避免被地形遮挡)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Viewer as CesiumViewer, Terrain, TerrainProvider } from '../../node_modules/cesium';
|
|
2
|
+
import { CesiumAutoRecoverOptions } from './CesiumAutoRecover';
|
|
2
3
|
import * as Cesium from 'cesium';
|
|
3
4
|
interface InitOptions {
|
|
4
5
|
orderIndependentTranslucency?: boolean;
|
|
@@ -50,6 +51,8 @@ interface InitOptions {
|
|
|
50
51
|
success?: () => void;
|
|
51
52
|
cancel?: () => void;
|
|
52
53
|
mapCenter?: MapCenter;
|
|
54
|
+
/** 渲染异常自动恢复(可选):会重建 Viewer,需在回调里替换引用 */
|
|
55
|
+
autoRecover?: CesiumAutoRecoverOptions;
|
|
53
56
|
}
|
|
54
57
|
interface MapCenter {
|
|
55
58
|
latitude: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Viewer, Entity } from '../../node_modules/cesium';
|
|
2
|
+
import { DrawEntity } from './drawHelper';
|
|
2
3
|
import { OverlayEntity, OverlayPosition } from './overlay/types';
|
|
3
4
|
import { MapMarker, MarkerOptions } from './overlay/MapMarker';
|
|
4
5
|
import { MapLabel, LabelOptions } from './overlay/MapLabel';
|
|
@@ -10,6 +11,14 @@ import { MapPolygon, PolygonOptions } from './overlay/MapPolygon';
|
|
|
10
11
|
import { MapRectangle, RectangleOptions } from './overlay/MapRectangle';
|
|
11
12
|
import { MapCircle, CircleOptions } from './overlay/MapCircle';
|
|
12
13
|
import { MapRing, RingOptions } from './overlay/MapRing';
|
|
14
|
+
export interface CesiumOverlayServiceOptions {
|
|
15
|
+
/**
|
|
16
|
+
* 是否启用实体 hover 处理器(MOUSE_MOVE 下会执行 pick/drillPick 并触发 hover 高亮)。
|
|
17
|
+
* 大屏/高负载场景可考虑关闭以规避 Cesium 在 primitive 重建窗口期的边界问题。
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
enableHoverHandler?: boolean;
|
|
21
|
+
}
|
|
13
22
|
/**
|
|
14
23
|
* Cesium 覆盖物服务类
|
|
15
24
|
* 统一管理各种覆盖物工具类
|
|
@@ -19,11 +28,62 @@ export declare class CesiumOverlayService {
|
|
|
19
28
|
private entities;
|
|
20
29
|
private overlayMap;
|
|
21
30
|
private infoWindowContainer;
|
|
31
|
+
/** 构造参数(用于开关 hover handler 等运行时策略) */
|
|
32
|
+
private readonly options;
|
|
33
|
+
private overlayEditModeEnabled;
|
|
34
|
+
private overlayEditHandler;
|
|
35
|
+
private overlayEditingTarget;
|
|
36
|
+
private overlayEditingKind;
|
|
37
|
+
private overlayEditingPositions;
|
|
38
|
+
private overlayEditingCircleCenter;
|
|
39
|
+
private overlayEditingCircleRadiusMeters;
|
|
40
|
+
private overlayEditHandleEntities;
|
|
41
|
+
private overlayEditDragging;
|
|
42
|
+
private overlayEditMoveStartCenter;
|
|
43
|
+
private overlayEditMoveStartPositions;
|
|
44
|
+
private overlayEditCameraBackup;
|
|
22
45
|
private lastHoverTargets;
|
|
23
46
|
private hoverPickRAF;
|
|
24
47
|
private hoverPickPos;
|
|
48
|
+
private overlayMutationRevision;
|
|
49
|
+
private hoverSuspendUntil;
|
|
50
|
+
private lastHoverPickTime;
|
|
51
|
+
private lastHoverPickPos;
|
|
52
|
+
private bulkUpdateDepth;
|
|
25
53
|
private static readonly DEFAULT_HIGHLIGHT_COLOR;
|
|
26
54
|
private static readonly DEFAULT_HIGHLIGHT_FILL_ALPHA;
|
|
55
|
+
private static readonly DEFAULT_HIGHLIGHT_GLOW_POWER;
|
|
56
|
+
private static readonly GLOW_OUTLINE_ROOT_ID_PROP;
|
|
57
|
+
private static readonly HOVER_PICK_MIN_INTERVAL_MS;
|
|
58
|
+
private static readonly HOVER_PICK_MIN_MOVE_PX;
|
|
59
|
+
private static readonly HOVER_SUSPEND_AFTER_MUTATION_MS;
|
|
60
|
+
private markOverlayMutated;
|
|
61
|
+
/**
|
|
62
|
+
* 显式开始一次批量更新:在 begin/end 期间暂停 hover pick。
|
|
63
|
+
* 建议 websocket 批量 add/remove 覆盖物时包裹使用,降低 Cesium GroundPrimitive 异步重建窗口期的 pick/update 压力。
|
|
64
|
+
*/
|
|
65
|
+
beginBulkUpdate(): void;
|
|
66
|
+
/**
|
|
67
|
+
* 结束一次批量更新。
|
|
68
|
+
*/
|
|
69
|
+
endBulkUpdate(): void;
|
|
70
|
+
/**
|
|
71
|
+
* 批量更新包裹器(自动 begin/end)。
|
|
72
|
+
*/
|
|
73
|
+
bulkUpdate<T>(fn: () => T): T;
|
|
74
|
+
/**
|
|
75
|
+
* Primitive 模式下,GeometryInstance.id 会是字符串(structured-cloneable),
|
|
76
|
+
* 需要映射回 overlayMap 内的根覆盖物 id。
|
|
77
|
+
*/
|
|
78
|
+
private normalizeOverlayPickId;
|
|
79
|
+
private getEntityPropertyString;
|
|
80
|
+
private mapGlowOutlineEntityToRoot;
|
|
81
|
+
private getClosedPositions;
|
|
82
|
+
private generateEllipseOutlinePositions;
|
|
83
|
+
private ensureGlowOutline;
|
|
84
|
+
private removeGlowOutline;
|
|
85
|
+
private resolveOverlayByPickId;
|
|
86
|
+
private resolvePickedOverlayEntity;
|
|
27
87
|
readonly marker: MapMarker;
|
|
28
88
|
readonly label: MapLabel;
|
|
29
89
|
readonly icon: MapIcon;
|
|
@@ -34,7 +94,7 @@ export declare class CesiumOverlayService {
|
|
|
34
94
|
readonly rectangle: MapRectangle;
|
|
35
95
|
readonly circle: MapCircle;
|
|
36
96
|
readonly ring: MapRing;
|
|
37
|
-
constructor(viewer: Viewer);
|
|
97
|
+
constructor(viewer: Viewer, options?: CesiumOverlayServiceOptions);
|
|
38
98
|
/**
|
|
39
99
|
* Cesium 默认可能无法 pick 到半透明覆盖物(例如 alpha < 1 的填充面)。
|
|
40
100
|
* 开启 pickTranslucentDepth 后,hover/click 才能稳定命中半透明面。
|
|
@@ -63,6 +123,48 @@ export declare class CesiumOverlayService {
|
|
|
63
123
|
* 设置实体点击处理器
|
|
64
124
|
*/
|
|
65
125
|
private setupEntityClickHandler;
|
|
126
|
+
/**
|
|
127
|
+
* 开启/关闭覆盖物编辑模式。
|
|
128
|
+
* - 开启后:点击覆盖物会进入编辑,并显示可拖拽控制点。
|
|
129
|
+
* - 关闭后:退出编辑并移除控制点。
|
|
130
|
+
*/
|
|
131
|
+
setOverlayEditMode(enabled: boolean): void;
|
|
132
|
+
/** 当前是否处于覆盖物编辑模式(全局开关) */
|
|
133
|
+
getOverlayEditModeEnabled(): boolean;
|
|
134
|
+
/** 停止当前正在编辑的覆盖物(不会关闭全局编辑模式) */
|
|
135
|
+
stopOverlayEdit(): void;
|
|
136
|
+
/**
|
|
137
|
+
* 主动开始编辑某个覆盖物。
|
|
138
|
+
* @returns true 表示成功进入编辑
|
|
139
|
+
*/
|
|
140
|
+
startOverlayEdit(entityOrId: (DrawEntity & OverlayEntity) | string): boolean;
|
|
141
|
+
private detectEditableKind;
|
|
142
|
+
private getEditablePolygonPositions;
|
|
143
|
+
private getEditableRectangle;
|
|
144
|
+
private getEditableCircleInfo;
|
|
145
|
+
private ensureOverlayEditHandler;
|
|
146
|
+
private destroyOverlayEditHandler;
|
|
147
|
+
private lockCameraControllerForOverlayEdit;
|
|
148
|
+
private restoreCameraControllerForOverlayEdit;
|
|
149
|
+
private clearOverlayEditHandles;
|
|
150
|
+
private rebuildEditHandles;
|
|
151
|
+
private createEditHandle;
|
|
152
|
+
private buildPolygonEditHandles;
|
|
153
|
+
private buildRectangleEditHandles;
|
|
154
|
+
private buildCircleEditHandles;
|
|
155
|
+
private updatePolygonHandlePositions;
|
|
156
|
+
private computePolygonCenterCartesian;
|
|
157
|
+
private computePolygonCenterCartographic;
|
|
158
|
+
private updateRectangleHandlePositions;
|
|
159
|
+
private updateCircleHandlePositions;
|
|
160
|
+
private applyEditedPolygon;
|
|
161
|
+
private applyEditedRectangle;
|
|
162
|
+
private applyEditedCircle;
|
|
163
|
+
private pickCartesianOnGlobe;
|
|
164
|
+
private computeSurfaceDistanceMeters;
|
|
165
|
+
private circleRadiusHandlePosition;
|
|
166
|
+
private rectangleToPositions;
|
|
167
|
+
private positionsToRectangle;
|
|
66
168
|
/**
|
|
67
169
|
* 设置实体 hover 高亮处理器(鼠标移入高亮,移出取消)
|
|
68
170
|
*/
|
|
@@ -6,6 +6,11 @@ import { BaseDraw, DrawResult, DrawOptions } from './BaseDraw';
|
|
|
6
6
|
export declare class DrawPolygon extends BaseDraw {
|
|
7
7
|
private currentPolygonEntity;
|
|
8
8
|
private currentBorderEntity;
|
|
9
|
+
/**
|
|
10
|
+
* 结束绘制但未生成最终结果(例如点数不足/自相交被拦截)时的统一清理。
|
|
11
|
+
* 目标:不留下临时实体/状态副作用(尤其是 depthTestAgainstTerrain)。
|
|
12
|
+
*/
|
|
13
|
+
private abortFinishCleanup;
|
|
9
14
|
/**
|
|
10
15
|
* 开始绘制
|
|
11
16
|
*/
|
|
@@ -8,6 +8,7 @@ interface I18nLike {
|
|
|
8
8
|
t(key: string, params?: Record<string, any>, localeOverride?: Locale): string;
|
|
9
9
|
onLocaleChange(cb: (locale: Locale) => void): () => void;
|
|
10
10
|
bindElement(el: HTMLElement, key: string, attr?: "text" | "title" | "placeholder", params?: Record<string, any>): void;
|
|
11
|
+
updateElement(el: HTMLElement): void;
|
|
11
12
|
updateTree(root: HTMLElement): void;
|
|
12
13
|
addMessages?(locale: Locale, dict: I18nDict, options?: {
|
|
13
14
|
merge?: boolean;
|
|
@@ -68,6 +68,11 @@ export declare class MapCircle {
|
|
|
68
68
|
private getPrimitiveBatchForOverlay;
|
|
69
69
|
private resolveMaterialColor;
|
|
70
70
|
private canUsePrimitive;
|
|
71
|
+
/**
|
|
72
|
+
* 添加一个基础的圆形图元
|
|
73
|
+
* @param options 圆形配置选项
|
|
74
|
+
* @returns 返回创建的实体对象
|
|
75
|
+
*/
|
|
71
76
|
private addPrimitiveCircle;
|
|
72
77
|
/**
|
|
73
78
|
* 转换位置为 Cartesian3
|
|
@@ -90,6 +95,11 @@ export declare class MapCircle {
|
|
|
90
95
|
* 使用大圆航线公式,segments 越大越平滑。
|
|
91
96
|
*/
|
|
92
97
|
private generateCirclePositions;
|
|
98
|
+
/**
|
|
99
|
+
* 获取方位角查找表,用于存储正弦和余弦值
|
|
100
|
+
* @param segments 分段数量,用于确定查找表的精度
|
|
101
|
+
* @returns 返回一个包含正弦和余弦数组的对象
|
|
102
|
+
*/
|
|
93
103
|
private getBearingTable;
|
|
94
104
|
/**
|
|
95
105
|
* 粗边框模式的默认分段数:平衡“圆滑程度/性能”。
|
|
@@ -46,12 +46,12 @@ export declare class MapInfoWindow {
|
|
|
46
46
|
private mergeOptions;
|
|
47
47
|
constructor(viewer: Viewer, container: HTMLElement);
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
* 0
|
|
49
|
+
* 设置默认的位置更新间隔(毫秒):当 InfoWindow 未指定 `updateInterval` 时使用。
|
|
50
|
+
* 0 表示每帧更新。
|
|
51
51
|
*/
|
|
52
52
|
setDefaultUpdateInterval(ms: number): void;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* 强制立即更新(重新计算位置)所有已管理的信息窗。
|
|
55
55
|
*/
|
|
56
56
|
forceUpdateAll(): void;
|
|
57
57
|
private convertPosition;
|
|
@@ -5,13 +5,13 @@ export interface CirclePrimitiveLayerCollections {
|
|
|
5
5
|
ringCollection: Cesium.PrimitiveCollection;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 为 Circle(圆)Primitive 渲染维护一个稳定的有序图层栈。
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
10
|
+
* 渲染顺序:
|
|
11
|
+
* - 所有填充图层(从下到上)
|
|
12
|
+
* - 所有外环图层(从下到上)
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* 这样可以确保在存在多个半透明填充重叠时,外环边界仍然清晰可见。
|
|
15
15
|
*/
|
|
16
16
|
export declare class CirclePrimitiveLayerStack {
|
|
17
17
|
private viewer;
|
|
@@ -5,13 +5,13 @@ export interface PolygonPrimitiveLayerCollections {
|
|
|
5
5
|
borderCollection: Cesium.PrimitiveCollection;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 为 Polygon(多边形)Primitive 渲染维护一个稳定的有序图层栈。
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
10
|
+
* 渲染顺序:
|
|
11
|
+
* - 所有填充图层(从下到上)
|
|
12
|
+
* - 所有边框图层(从下到上)
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* 这样可以确保在存在多个半透明填充重叠时,边框仍然清晰可见。
|
|
15
15
|
*/
|
|
16
16
|
export declare class PolygonPrimitiveLayerStack {
|
|
17
17
|
private viewer;
|
|
@@ -73,6 +73,8 @@ export interface OverlayEntity extends Entity {
|
|
|
73
73
|
};
|
|
74
74
|
/** 用于还原高亮前的原始样式 */
|
|
75
75
|
_highlightOriginalStyle?: OverlayHighlightOriginalStyle;
|
|
76
|
+
/** 高亮时临时创建的“发光边框”实体(由 CesiumOverlayService 管理) */
|
|
77
|
+
_highlightGlowEntity?: Entity;
|
|
76
78
|
/** 覆盖物类型标识(用于 CesiumOverlayService 做差异化更新/删除) */
|
|
77
79
|
_overlayType?: string;
|
|
78
80
|
/** 信息窗口根 DOM(由 MapInfoWindow / CesiumOverlayService 使用) */
|
|
@@ -110,6 +112,8 @@ export interface OverlayEntity extends Entity {
|
|
|
110
112
|
_primitiveLayerKey?: string;
|
|
111
113
|
_primitiveRingBaseColor?: Color;
|
|
112
114
|
_primitiveFillBaseColor?: Color;
|
|
115
|
+
/** primitive:用于高亮发光边框的外圈/边界位置(通常为闭合折线) */
|
|
116
|
+
_primitiveOutlinePositions?: Cartesian3[];
|
|
113
117
|
/** primitive polygon/rectangle: 边框纯色缓存(用于高亮恢复) */
|
|
114
118
|
_primitiveBorderBaseColor?: Color;
|
|
115
119
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import { ButtonConfig } from '../CesiumMapModel';
|
|
1
|
+
import { ButtonConfig, ToolbarConfig } from '../CesiumMapModel';
|
|
2
2
|
export declare const defaultButtonSorts: Record<string, number>;
|
|
3
3
|
export declare const defaultButtons: ButtonConfig[];
|
|
4
|
+
export declare const defaultMeasureItems: {
|
|
5
|
+
id: string;
|
|
6
|
+
text: string;
|
|
7
|
+
textKey: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
}[];
|
|
10
|
+
export declare const defaultToolBarStyle: ToolbarConfig;
|
package/dist/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingm/vmap-cesium-toolbar",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.19",
|
|
4
4
|
"description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "index.js",
|
|
7
|
-
"module": "index.js",
|
|
6
|
+
"main": "index.es.js",
|
|
7
|
+
"module": "index.es.js",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"files": [
|
|
10
|
-
"index.js",
|
|
10
|
+
"index.es.js",
|
|
11
|
+
"index.umd.js",
|
|
11
12
|
"index.d.ts",
|
|
12
13
|
"style.css",
|
|
13
14
|
"README.md",
|
|
@@ -15,8 +16,8 @@
|
|
|
15
16
|
],
|
|
16
17
|
"exports": {
|
|
17
18
|
".": {
|
|
18
|
-
"import": "./index.js",
|
|
19
|
-
"
|
|
19
|
+
"import": "./index.es.js",
|
|
20
|
+
"default": "./index.es.js"
|
|
20
21
|
},
|
|
21
22
|
"./style": "./style.css"
|
|
22
23
|
},
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"license": "MIT",
|
|
37
38
|
"repository": {
|
|
38
39
|
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/
|
|
40
|
+
"url": "git+https://github.com/BenXueYou/vmap-cesium-tool.git"
|
|
40
41
|
},
|
|
41
42
|
"bugs": {
|
|
42
|
-
"url": "https://github.com/
|
|
43
|
+
"url": "https://github.com/BenXueYou/vmap-cesium-tool/issues"
|
|
43
44
|
},
|
|
44
|
-
"homepage": "https://github.com/
|
|
45
|
+
"homepage": "https://github.com/BenXueYou/vmap-cesium-tool#readme"
|
|
45
46
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingm/vmap-cesium-toolbar",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.19",
|
|
4
4
|
"description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"module": "dist/index.js",
|
|
6
|
+
"main": "dist/index.es.js",
|
|
7
|
+
"module": "dist/index.es.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"import": "./dist/index.js",
|
|
19
|
-
"
|
|
18
|
+
"import": "./dist/index.es.js",
|
|
19
|
+
"default": "./dist/index.es.js"
|
|
20
20
|
},
|
|
21
21
|
"./style": "./dist/style.css"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "vite --force",
|
|
25
25
|
"build": "vite build --mode lib",
|
|
26
|
+
"dist": "vite build",
|
|
26
27
|
"build:dts": "vue-tsc -p tsconfig.dts.json",
|
|
27
28
|
"build:plugin": "node scripts/build-plugin.js",
|
|
28
29
|
"docs:dev": "vitepress dev doc",
|
|
@@ -63,10 +64,10 @@
|
|
|
63
64
|
"license": "MIT",
|
|
64
65
|
"repository": {
|
|
65
66
|
"type": "git",
|
|
66
|
-
"url": "git+https://github.com/
|
|
67
|
+
"url": "git+https://github.com/BenXueYou/vmap-cesium-tool.git"
|
|
67
68
|
},
|
|
68
69
|
"bugs": {
|
|
69
|
-
"url": "https://github.com/
|
|
70
|
+
"url": "https://github.com/BenXueYou/vmap-cesium-tool/issues"
|
|
70
71
|
},
|
|
71
|
-
"homepage": "https://github.com/
|
|
72
|
+
"homepage": "https://github.com/BenXueYou/vmap-cesium-tool#readme"
|
|
72
73
|
}
|