@xingm/vmap-cesium-toolbar 0.0.2-alpha.14 → 0.0.2-alpha.16
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/README.md +22 -22
- package/dist/index.d.ts +45 -0
- package/dist/index.js +982 -735
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +42 -31
- package/dist/index.umd.js.map +1 -1
- package/dist/libs/CesiumHeatmapLayer.d.ts +5 -0
- package/dist/libs/CesiumMapToolbar.d.ts +44 -5
- package/dist/libs/overlay/MapCircle.d.ts +11 -0
- package/dist/libs/overlay/MapPolygon.d.ts +11 -0
- package/dist/libs/overlay/MapRectangle.d.ts +11 -0
- package/dist/libs/overlay/primitives/CirclePrimitiveBatch.d.ts +8 -2
- package/dist/libs/overlay/primitives/CirclePrimitiveLayerStack.d.ts +24 -0
- package/dist/libs/overlay/primitives/PolygonPrimitiveBatch.d.ts +8 -2
- package/dist/libs/overlay/primitives/PolygonPrimitiveLayerStack.d.ts +24 -0
- package/dist/libs/overlay/primitives/RectanglePrimitiveBatch.d.ts +8 -2
- package/dist/libs/overlay/primitives/RectanglePrimitiveLayerStack.d.ts +24 -0
- package/dist/libs/overlay/types.d.ts +2 -0
- package/dist/libs/toolBar/CesiumMapController.d.ts +6 -0
- package/dist/package.json +1 -1
- package/package.json +5 -1
|
@@ -20,6 +20,10 @@ export interface HeatmapOptions {
|
|
|
20
20
|
height?: number;
|
|
21
21
|
/** 单个点的影响半径(像素) */
|
|
22
22
|
radius?: number;
|
|
23
|
+
/** 低强度提升(伽马矫正),< 1 可增强边缘,默认 0.7 */
|
|
24
|
+
gamma?: number;
|
|
25
|
+
/** 最小可见 alpha(0~1),用于避免外圈完全消失,默认 0.03 */
|
|
26
|
+
minAlpha?: number;
|
|
23
27
|
/** 最小/最大值,用于归一化 value,如果不传则自动根据数据计算 */
|
|
24
28
|
minValue?: number;
|
|
25
29
|
maxValue?: number;
|
|
@@ -47,6 +51,7 @@ export default class CesiumHeatmapLayer {
|
|
|
47
51
|
private viewer;
|
|
48
52
|
private imageryLayer;
|
|
49
53
|
private rectangle;
|
|
54
|
+
private fullDataRectangle;
|
|
50
55
|
private canvas;
|
|
51
56
|
private ctx;
|
|
52
57
|
private options;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Viewer } from '../../node_modules/cesium';
|
|
2
|
+
import { CesiumMapController } from './toolBar/CesiumMapController';
|
|
3
|
+
import { MeasurementService } from './toolBar/MeasurementService';
|
|
4
|
+
import { SearchService } from './toolBar/MapSearchService';
|
|
5
|
+
import { MapLayersService } from './toolBar/MapLayersService';
|
|
6
|
+
import { NotFlyZonesService } from './toolBar/NotFlyZonesService';
|
|
2
7
|
import { MapType, ToolbarConfig, SearchCallback, MeasurementCallback, ZoomCallback, CustomButtonConfig } from './CesiumMapModel';
|
|
3
8
|
/**
|
|
4
9
|
* Cesium地图工具栏类
|
|
@@ -15,6 +20,8 @@ export declare class CesiumMapToolbar {
|
|
|
15
20
|
private notFlyZonesService;
|
|
16
21
|
private measurementCallback?;
|
|
17
22
|
private zoomCallback?;
|
|
23
|
+
private fullscreenCallback?;
|
|
24
|
+
private resetLocationCallback?;
|
|
18
25
|
private initialCenter?;
|
|
19
26
|
private currentMapType;
|
|
20
27
|
TD_Token: string;
|
|
@@ -30,12 +37,42 @@ export declare class CesiumMapToolbar {
|
|
|
30
37
|
search?: SearchCallback;
|
|
31
38
|
measurement?: MeasurementCallback;
|
|
32
39
|
zoom?: ZoomCallback;
|
|
40
|
+
fullscreen?: (isFullscreen: boolean) => void;
|
|
41
|
+
resetLocation?: () => void;
|
|
33
42
|
}, initialCenter?: {
|
|
34
43
|
longitude: number;
|
|
35
44
|
latitude: number;
|
|
36
45
|
height: number;
|
|
37
46
|
});
|
|
47
|
+
/**
|
|
48
|
+
* searchService 对外暴露的获取搜索服务方法
|
|
49
|
+
*/
|
|
50
|
+
getSearchService(): SearchService;
|
|
51
|
+
/**
|
|
52
|
+
* notFlyZonesService 对外暴露的获取禁飞区服务方法
|
|
53
|
+
*/
|
|
54
|
+
getNotFlyZonesService(): NotFlyZonesService;
|
|
55
|
+
/**
|
|
56
|
+
* measurementService 对外暴露的获取测量服务方法
|
|
57
|
+
*/
|
|
58
|
+
getMeasurementService(): MeasurementService;
|
|
59
|
+
/**
|
|
60
|
+
* cesmapController 对外暴露的获取地图控制器方法
|
|
61
|
+
*/
|
|
62
|
+
getCesiumMapCtrl(): CesiumMapController;
|
|
63
|
+
/**
|
|
64
|
+
* mapLayersService 对外暴露的获取图层服务方法
|
|
65
|
+
*/
|
|
66
|
+
getMapLayersService(): MapLayersService;
|
|
67
|
+
/**
|
|
68
|
+
* 设置地图类型配置
|
|
69
|
+
* @param mapTypes
|
|
70
|
+
*/
|
|
38
71
|
setMapTypes(mapTypes: MapType[]): void;
|
|
72
|
+
/**
|
|
73
|
+
* 设置天地图密钥
|
|
74
|
+
* @param TD_Token
|
|
75
|
+
*/
|
|
39
76
|
setTDToken(TD_Token: string): void;
|
|
40
77
|
/**
|
|
41
78
|
* 设置初始中心点
|
|
@@ -69,7 +106,13 @@ export declare class CesiumMapToolbar {
|
|
|
69
106
|
/**
|
|
70
107
|
* 获取所有按钮配置(包括默认按钮和自定义按钮),并添加 sort 值
|
|
71
108
|
*/
|
|
72
|
-
private
|
|
109
|
+
private resolveIcon;
|
|
110
|
+
/**
|
|
111
|
+
* 获取按钮配置(已排序,包含默认按钮兜底)
|
|
112
|
+
* - 未传 buttons:使用默认按钮
|
|
113
|
+
* - 传了 buttons:按传入按钮列表渲染,并用默认按钮补齐缺省字段
|
|
114
|
+
*/
|
|
115
|
+
private getButtonConfigs;
|
|
73
116
|
/**
|
|
74
117
|
* 重新构建工具栏按钮
|
|
75
118
|
*/
|
|
@@ -86,10 +129,6 @@ export declare class CesiumMapToolbar {
|
|
|
86
129
|
* 创建工具栏
|
|
87
130
|
*/
|
|
88
131
|
private createToolbar;
|
|
89
|
-
/**
|
|
90
|
-
* 获取按钮配置(已排序)
|
|
91
|
-
*/
|
|
92
|
-
private getButtonConfigs;
|
|
93
132
|
/**
|
|
94
133
|
* 创建按钮
|
|
95
134
|
*/
|
|
@@ -43,6 +43,13 @@ export interface CircleOptions {
|
|
|
43
43
|
fillAlpha?: number;
|
|
44
44
|
};
|
|
45
45
|
onClick?: (entity: Entity) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Primitive 模式分层渲染 key。
|
|
48
|
+
* - 相同 layerKey 的 circle 会被合并到同一个批次中(更高性能)
|
|
49
|
+
* - 不同 layerKey 会进入不同的“图层空间”,并按首次出现顺序确定上下层
|
|
50
|
+
* - 只对 primitive 生效;entity 模式忽略
|
|
51
|
+
*/
|
|
52
|
+
layerKey?: string;
|
|
46
53
|
id?: string;
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
@@ -52,9 +59,13 @@ export declare class MapCircle {
|
|
|
52
59
|
private viewer;
|
|
53
60
|
private entities;
|
|
54
61
|
private primitiveBatch;
|
|
62
|
+
private primitiveLayerStack;
|
|
63
|
+
private primitiveBatchesByLayer;
|
|
55
64
|
private static bearingTableCache;
|
|
56
65
|
constructor(viewer: Viewer);
|
|
57
66
|
private getPrimitiveBatch;
|
|
67
|
+
private getLayeredPrimitiveBatch;
|
|
68
|
+
private getPrimitiveBatchForOverlay;
|
|
58
69
|
private resolveMaterialColor;
|
|
59
70
|
private canUsePrimitive;
|
|
60
71
|
private addPrimitiveCircle;
|
|
@@ -36,6 +36,13 @@ export interface PolygonOptions {
|
|
|
36
36
|
fillAlpha?: number;
|
|
37
37
|
};
|
|
38
38
|
onClick?: (entity: Entity) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Primitive 模式分层渲染 key。
|
|
41
|
+
* - 相同 layerKey 的 polygon 会被合并到同一个批次中(更高性能)
|
|
42
|
+
* - 不同 layerKey 会进入不同的“图层空间”,并按首次出现顺序确定上下层
|
|
43
|
+
* - 只对 primitive 生效;entity 模式忽略
|
|
44
|
+
*/
|
|
45
|
+
layerKey?: string;
|
|
39
46
|
id?: string;
|
|
40
47
|
}
|
|
41
48
|
/**
|
|
@@ -45,8 +52,12 @@ export declare class MapPolygon {
|
|
|
45
52
|
private viewer;
|
|
46
53
|
private entities;
|
|
47
54
|
private primitiveBatch;
|
|
55
|
+
private primitiveLayerStack;
|
|
56
|
+
private primitiveBatchesByLayer;
|
|
48
57
|
constructor(viewer: Viewer);
|
|
49
58
|
private getPrimitiveBatch;
|
|
59
|
+
private getLayeredPrimitiveBatch;
|
|
60
|
+
private getPrimitiveBatchForOverlay;
|
|
50
61
|
private resolveMaterialColor;
|
|
51
62
|
private canUsePrimitive;
|
|
52
63
|
private addPrimitivePolygon;
|
|
@@ -36,6 +36,13 @@ export interface RectangleOptions {
|
|
|
36
36
|
fillAlpha?: number;
|
|
37
37
|
};
|
|
38
38
|
onClick?: (entity: Entity) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Primitive 模式分层渲染 key。
|
|
41
|
+
* - 相同 layerKey 的 rectangle 会被合并到同一个批次中(更高性能)
|
|
42
|
+
* - 不同 layerKey 会进入不同的“图层空间”,并按首次出现顺序确定上下层
|
|
43
|
+
* - 只对 primitive 生效;entity 模式忽略
|
|
44
|
+
*/
|
|
45
|
+
layerKey?: string;
|
|
39
46
|
id?: string;
|
|
40
47
|
}
|
|
41
48
|
/**
|
|
@@ -45,8 +52,12 @@ export declare class MapRectangle {
|
|
|
45
52
|
private viewer;
|
|
46
53
|
private entities;
|
|
47
54
|
private primitiveBatch;
|
|
55
|
+
private primitiveLayerStack;
|
|
56
|
+
private primitiveBatchesByLayer;
|
|
48
57
|
constructor(viewer: Viewer);
|
|
49
58
|
private getPrimitiveBatch;
|
|
59
|
+
private getLayeredPrimitiveBatch;
|
|
60
|
+
private getPrimitiveBatchForOverlay;
|
|
50
61
|
private resolveMaterialColor;
|
|
51
62
|
private canUsePrimitive;
|
|
52
63
|
private addPrimitiveRectangle;
|
|
@@ -6,14 +6,20 @@ export interface CirclePrimitiveParts {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class CirclePrimitiveBatch {
|
|
8
8
|
private viewer;
|
|
9
|
-
private
|
|
9
|
+
private ringCollection;
|
|
10
|
+
private fillCollection;
|
|
11
|
+
private ownsCollections;
|
|
12
|
+
private ownedRootCollection;
|
|
10
13
|
private ringPrimitive;
|
|
11
14
|
private fillPrimitive;
|
|
12
15
|
private records;
|
|
13
16
|
private rebuildScheduled;
|
|
14
17
|
private colorApplyScheduled;
|
|
15
18
|
private pendingColorApplyIds;
|
|
16
|
-
constructor(viewer: Viewer
|
|
19
|
+
constructor(viewer: Viewer, options?: {
|
|
20
|
+
ringCollection?: Cesium.PrimitiveCollection;
|
|
21
|
+
fillCollection?: Cesium.PrimitiveCollection;
|
|
22
|
+
});
|
|
17
23
|
destroy(): void;
|
|
18
24
|
has(circleId: string): boolean;
|
|
19
25
|
upsertGeometry(args: {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Viewer } from '../../../../node_modules/cesium';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
export interface CirclePrimitiveLayerCollections {
|
|
4
|
+
fillCollection: Cesium.PrimitiveCollection;
|
|
5
|
+
ringCollection: Cesium.PrimitiveCollection;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Maintains a stable, ordered layer stack for Circle primitive rendering.
|
|
9
|
+
*
|
|
10
|
+
* Rendering order:
|
|
11
|
+
* - all fill layers (bottom -> top)
|
|
12
|
+
* - all ring layers (bottom -> top)
|
|
13
|
+
*
|
|
14
|
+
* This ensures boundaries (rings) remain visible even when multiple translucent fills overlap.
|
|
15
|
+
*/
|
|
16
|
+
export declare class CirclePrimitiveLayerStack {
|
|
17
|
+
private viewer;
|
|
18
|
+
private fillsRoot;
|
|
19
|
+
private ringsRoot;
|
|
20
|
+
private layers;
|
|
21
|
+
constructor(viewer: Viewer);
|
|
22
|
+
getLayerCollections(layerKey: string): CirclePrimitiveLayerCollections;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
}
|
|
@@ -6,14 +6,20 @@ export interface PolygonPrimitiveParts {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class PolygonPrimitiveBatch {
|
|
8
8
|
private viewer;
|
|
9
|
-
private
|
|
9
|
+
private fillCollection;
|
|
10
|
+
private borderCollection;
|
|
11
|
+
private ownsCollections;
|
|
12
|
+
private ownedRootCollection;
|
|
10
13
|
private fillPrimitive;
|
|
11
14
|
private borderPrimitive;
|
|
12
15
|
private records;
|
|
13
16
|
private rebuildScheduled;
|
|
14
17
|
private colorApplyScheduled;
|
|
15
18
|
private pendingColorApplyIds;
|
|
16
|
-
constructor(viewer: Viewer
|
|
19
|
+
constructor(viewer: Viewer, options?: {
|
|
20
|
+
fillCollection?: Cesium.PrimitiveCollection;
|
|
21
|
+
borderCollection?: Cesium.PrimitiveCollection;
|
|
22
|
+
});
|
|
17
23
|
destroy(): void;
|
|
18
24
|
upsertGeometry(args: {
|
|
19
25
|
polygonId: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Viewer } from '../../../../node_modules/cesium';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
export interface PolygonPrimitiveLayerCollections {
|
|
4
|
+
fillCollection: Cesium.PrimitiveCollection;
|
|
5
|
+
borderCollection: Cesium.PrimitiveCollection;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Maintains a stable, ordered layer stack for Polygon primitive rendering.
|
|
9
|
+
*
|
|
10
|
+
* Rendering order:
|
|
11
|
+
* - all fill layers (bottom -> top)
|
|
12
|
+
* - all border layers (bottom -> top)
|
|
13
|
+
*
|
|
14
|
+
* This ensures borders remain visible even when multiple translucent fills overlap.
|
|
15
|
+
*/
|
|
16
|
+
export declare class PolygonPrimitiveLayerStack {
|
|
17
|
+
private viewer;
|
|
18
|
+
private fillsRoot;
|
|
19
|
+
private bordersRoot;
|
|
20
|
+
private layers;
|
|
21
|
+
constructor(viewer: Viewer);
|
|
22
|
+
getLayerCollections(layerKey: string): PolygonPrimitiveLayerCollections;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
}
|
|
@@ -6,14 +6,20 @@ export interface RectanglePrimitiveParts {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class RectanglePrimitiveBatch {
|
|
8
8
|
private viewer;
|
|
9
|
-
private
|
|
9
|
+
private ringCollection;
|
|
10
|
+
private fillCollection;
|
|
11
|
+
private ownsCollections;
|
|
12
|
+
private ownedRootCollection;
|
|
10
13
|
private ringPrimitive;
|
|
11
14
|
private fillPrimitive;
|
|
12
15
|
private records;
|
|
13
16
|
private rebuildScheduled;
|
|
14
17
|
private colorApplyScheduled;
|
|
15
18
|
private pendingColorApplyIds;
|
|
16
|
-
constructor(viewer: Viewer
|
|
19
|
+
constructor(viewer: Viewer, options?: {
|
|
20
|
+
ringCollection?: Cesium.PrimitiveCollection;
|
|
21
|
+
fillCollection?: Cesium.PrimitiveCollection;
|
|
22
|
+
});
|
|
17
23
|
destroy(): void;
|
|
18
24
|
upsertGeometry(args: {
|
|
19
25
|
rectangleId: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Viewer } from '../../../../node_modules/cesium';
|
|
2
|
+
import * as Cesium from 'cesium';
|
|
3
|
+
export interface RectanglePrimitiveLayerCollections {
|
|
4
|
+
fillCollection: Cesium.PrimitiveCollection;
|
|
5
|
+
ringCollection: Cesium.PrimitiveCollection;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 为矩形 Primitive 渲染维护一个稳定的有序图层栈。
|
|
9
|
+
*
|
|
10
|
+
* 渲染顺序:
|
|
11
|
+
* - 所有填充图层(从下到上)
|
|
12
|
+
* - 所有描边图层(从下到上)
|
|
13
|
+
*
|
|
14
|
+
* 这样可以确保在存在多个半透明填充重叠时,描边仍然清晰可见。
|
|
15
|
+
*/
|
|
16
|
+
export declare class RectanglePrimitiveLayerStack {
|
|
17
|
+
private viewer;
|
|
18
|
+
private fillsRoot;
|
|
19
|
+
private ringsRoot;
|
|
20
|
+
private layers;
|
|
21
|
+
constructor(viewer: Viewer);
|
|
22
|
+
getLayerCollections(layerKey: string): RectanglePrimitiveLayerCollections;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
}
|
|
@@ -106,6 +106,8 @@ export interface OverlayEntity extends Entity {
|
|
|
106
106
|
_innerRadius?: number;
|
|
107
107
|
_outerRectangle?: Rectangle;
|
|
108
108
|
/** primitive circle: 内部使用的纯色缓存(用于高亮恢复) */
|
|
109
|
+
/** primitive layer key: 用于分层批处理路由 */
|
|
110
|
+
_primitiveLayerKey?: string;
|
|
109
111
|
_primitiveRingBaseColor?: Color;
|
|
110
112
|
_primitiveFillBaseColor?: Color;
|
|
111
113
|
/** primitive polygon/rectangle: 边框纯色缓存(用于高亮恢复) */
|
|
@@ -17,6 +17,10 @@ interface CesiumMapControllerOptions {
|
|
|
17
17
|
zoomCallback?: ZoomCallback;
|
|
18
18
|
/** 场景模式切换后回调(例如通知 DrawHelper 重新计算偏移) */
|
|
19
19
|
onSceneModeChanged?: () => void;
|
|
20
|
+
/** 全屏切换回调 */
|
|
21
|
+
fullscreenCallback?: (isFullscreen: boolean) => void;
|
|
22
|
+
/** 复位位置回调 */
|
|
23
|
+
resetLocationCallback?: () => void;
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
26
|
* 负责地图相机控制、缩放层级和 2D/3D 切换等逻辑的控制器
|
|
@@ -30,6 +34,8 @@ export declare class CesiumMapController {
|
|
|
30
34
|
private getToken?;
|
|
31
35
|
private zoomCallback?;
|
|
32
36
|
private onSceneModeChanged?;
|
|
37
|
+
private fullscreenCallback?;
|
|
38
|
+
private resetLocationCallback?;
|
|
33
39
|
constructor(viewer: Viewer, options?: CesiumMapControllerOptions);
|
|
34
40
|
/**
|
|
35
41
|
* 监听相机缩放,限制层级范围到 [1, 18],并参考当前底图的 maximumLevel
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingm/vmap-cesium-toolbar",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.16",
|
|
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",
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
"build": "vite build --mode lib",
|
|
26
26
|
"build:dts": "vue-tsc -p tsconfig.dts.json",
|
|
27
27
|
"build:plugin": "node scripts/build-plugin.js",
|
|
28
|
+
"docs:dev": "vitepress dev doc",
|
|
29
|
+
"docs:build": "vitepress build doc",
|
|
30
|
+
"docs:preview": "vitepress preview doc",
|
|
28
31
|
"generate:file-list": "node scripts/generate-file-list.js",
|
|
29
32
|
"preview": "vite preview",
|
|
30
33
|
"type-check": "vue-tsc --noEmit"
|
|
@@ -41,6 +44,7 @@
|
|
|
41
44
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
42
45
|
"rollup-plugin-dts": "^6.1.0",
|
|
43
46
|
"vite": "^7.1.2",
|
|
47
|
+
"vitepress": "^1.6.4",
|
|
44
48
|
"vite-plugin-cesium": "^1.2.23",
|
|
45
49
|
"vite-plugin-dts": "^4.5.4",
|
|
46
50
|
"vite-plugin-static-copy": "^3.1.2",
|