@xingm/vmap-cesium-toolbar 0.0.3-alpha.5 → 0.0.4-alpha.1
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 +7 -0
- package/dist/hooks/useOverlayHelper.d.ts +2 -2
- package/dist/i18n/en-US.d.ts +5 -0
- package/dist/i18n/zh-CN.d.ts +5 -0
- package/dist/index.es.js +1140 -933
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +45 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/libs/CesiumMapLoader.d.ts +1 -0
- package/dist/libs/CesiumMapModel.d.ts +6 -0
- package/dist/libs/CesiumOverlayService.d.ts +9 -0
- package/dist/libs/CesiumPointClusterLayer.d.ts +2 -0
- package/dist/libs/i18n/en-US.d.ts +3 -0
- package/dist/libs/i18n/zh-CN.d.ts +3 -0
- package/dist/libs/overlay/MapCircle.d.ts +2 -0
- package/dist/libs/overlay/MapPolygon.d.ts +2 -0
- package/dist/libs/overlay/MapPolyline.d.ts +3 -0
- package/dist/libs/overlay/MapRectangle.d.ts +2 -0
- package/dist/libs/overlay/MapRing.d.ts +3 -1
- package/dist/libs/overlay/types.d.ts +2 -0
- package/dist/libs/toolBar/MapLayersService.d.ts +18 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ interface InitOptions {
|
|
|
8
8
|
terrain?: Terrain;
|
|
9
9
|
terrainProvider?: TerrainProvider;
|
|
10
10
|
mapType?: string;
|
|
11
|
+
tdtMapTypeId?: string;
|
|
11
12
|
imageryProvider?: Cesium.UrlTemplateImageryProvider;
|
|
12
13
|
imageryLayers?: Cesium.ImageryLayerCollection;
|
|
13
14
|
terrainShadows?: Cesium.ShadowMode;
|
|
@@ -80,6 +80,12 @@ export interface MapType {
|
|
|
80
80
|
id: string;
|
|
81
81
|
name: string;
|
|
82
82
|
nameKey?: string;
|
|
83
|
+
/** 选中态左上角“地名”文案(可选,未配置时走 i18n 默认 key) */
|
|
84
|
+
placeNameLabel?: string;
|
|
85
|
+
/** 选中态左上角“地名”文案 i18n key(可选) */
|
|
86
|
+
placeNameLabelKey?: string;
|
|
87
|
+
/** 是否强制始终显示地名层(不受 placeName 开关影响) */
|
|
88
|
+
forcePlaceName?: boolean;
|
|
83
89
|
thumbnail: string;
|
|
84
90
|
provider: (token: string) => Cesium.ImageryProvider[];
|
|
85
91
|
terrainProvider?: (token: string) => Cesium.TerrainProvider | null;
|
|
@@ -23,6 +23,12 @@ export interface CesiumOverlayServiceOptions {
|
|
|
23
23
|
* 参数为“已回写后的覆盖物 entity”。
|
|
24
24
|
*/
|
|
25
25
|
onOverlayEditChange?: (entity: DrawEntity & OverlayEntity) => void;
|
|
26
|
+
/**
|
|
27
|
+
* 点击 pick 节流间隔(毫秒)。
|
|
28
|
+
* 用于降低 “贴地几何 + pick + ground pipeline” 的偶发 DataCloneError 风险。
|
|
29
|
+
* @default 120
|
|
30
|
+
*/
|
|
31
|
+
clickPickMinIntervalMs?: number;
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
28
34
|
* Cesium 覆盖物服务类
|
|
@@ -45,9 +51,12 @@ export declare class CesiumOverlayService {
|
|
|
45
51
|
private lastHoverPickTime;
|
|
46
52
|
private lastHoverPickPos;
|
|
47
53
|
private bulkUpdateDepth;
|
|
54
|
+
private lastClickPickTime;
|
|
55
|
+
private readonly clickPickMinIntervalMs;
|
|
48
56
|
private static readonly HOVER_PICK_MIN_INTERVAL_MS;
|
|
49
57
|
private static readonly HOVER_PICK_MIN_MOVE_PX;
|
|
50
58
|
private static readonly HOVER_SUSPEND_AFTER_MUTATION_MS;
|
|
59
|
+
private static readonly CLICK_PICK_MIN_INTERVAL_MS;
|
|
51
60
|
private markOverlayMutated;
|
|
52
61
|
/**
|
|
53
62
|
* 显式开始一次批量更新:在 begin/end 期间暂停 hover pick。
|
|
@@ -66,6 +66,7 @@ export interface PointClusterLayerOptions {
|
|
|
66
66
|
}
|
|
67
67
|
export default class CesiumPointClusterLayer {
|
|
68
68
|
private static readonly CLUSTER_STYLE_MIN_INTERVAL_MS;
|
|
69
|
+
private static readonly CLICK_PICK_MIN_INTERVAL_MS;
|
|
69
70
|
private viewer;
|
|
70
71
|
private readonly options;
|
|
71
72
|
private dataSource;
|
|
@@ -76,6 +77,7 @@ export default class CesiumPointClusterLayer {
|
|
|
76
77
|
private clusterStyleRAF;
|
|
77
78
|
private clusterStyleTimer;
|
|
78
79
|
private lastClusterStyleFlushTime;
|
|
80
|
+
private lastClickPickTime;
|
|
79
81
|
constructor(viewer: Viewer, options?: PointClusterLayerOptions);
|
|
80
82
|
/** 设置/替换点数据(经纬度单位:度) */
|
|
81
83
|
setData(points: ClusterPoint[]): void;
|
|
@@ -29,6 +29,8 @@ export interface CircleOptions {
|
|
|
29
29
|
* - false:填充与边框都使用 position 高度悬空。
|
|
30
30
|
*/
|
|
31
31
|
clampToGround?: boolean;
|
|
32
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
33
|
+
groundHeightEpsilon?: number;
|
|
32
34
|
heightReference?: HeightReference;
|
|
33
35
|
extrudedHeight?: number;
|
|
34
36
|
heightEpsilon?: number;
|
|
@@ -23,6 +23,8 @@ export interface PolygonOptions {
|
|
|
23
23
|
* - false:填充与边框都在统一的 baseHeight 上悬空。
|
|
24
24
|
*/
|
|
25
25
|
clampToGround?: boolean;
|
|
26
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
27
|
+
groundHeightEpsilon?: number;
|
|
26
28
|
heightReference?: HeightReference;
|
|
27
29
|
extrudedHeight?: number;
|
|
28
30
|
/** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
|
|
@@ -9,6 +9,8 @@ export interface PolylineOptions {
|
|
|
9
9
|
width?: number;
|
|
10
10
|
material?: Cesium.MaterialProperty | Color | string;
|
|
11
11
|
clampToGround?: boolean;
|
|
12
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
13
|
+
groundHeightEpsilon?: number;
|
|
12
14
|
/** 点击该覆盖物时是否高亮显示(默认 false)。支持传入自定义颜色等参数 */
|
|
13
15
|
clickHighlight?: boolean | {
|
|
14
16
|
color?: Color | string;
|
|
@@ -41,6 +43,7 @@ export declare class MapPolyline {
|
|
|
41
43
|
* 解析材质
|
|
42
44
|
*/
|
|
43
45
|
private resolveMaterial;
|
|
46
|
+
private elevatePositions;
|
|
44
47
|
/**
|
|
45
48
|
* 添加 Polyline(折线)
|
|
46
49
|
*/
|
|
@@ -19,6 +19,8 @@ export interface RectangleOptions {
|
|
|
19
19
|
outlineWidth?: number;
|
|
20
20
|
/** 是否贴地(默认:在粗边框模式下为 true) */
|
|
21
21
|
clampToGround?: boolean;
|
|
22
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
23
|
+
groundHeightEpsilon?: number;
|
|
22
24
|
/** 悬空时的基准高度(米,clampToGround=false 时有效) */
|
|
23
25
|
height?: number;
|
|
24
26
|
heightReference?: HeightReference;
|
|
@@ -36,6 +36,8 @@ export interface RingOptions {
|
|
|
36
36
|
glowPower?: number;
|
|
37
37
|
/** 是否贴地(默认 true) */
|
|
38
38
|
clampToGround?: boolean;
|
|
39
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
40
|
+
groundHeightEpsilon?: number;
|
|
39
41
|
/** 圆环分段数(默认 128),越大越圆滑 */
|
|
40
42
|
segments?: number;
|
|
41
43
|
/** 覆盖物点击回调 */
|
|
@@ -93,7 +95,7 @@ export declare class MapRing {
|
|
|
93
95
|
/**
|
|
94
96
|
* 更新 Ring 样式
|
|
95
97
|
*/
|
|
96
|
-
updateStyle(entity: Entity, options: Partial<Pick<RingOptions, "color" | "showInnerLine" | "lineColor" | "lineStyle" | "lineMaterialMode" | "stripeRepeat" | "dashLength" | "dashPattern" | "gapColor" | "width" | "glowWidth" | "lineWidth" | "glowPower" | "clampToGround" | "segments">>): void;
|
|
98
|
+
updateStyle(entity: Entity, options: Partial<Pick<RingOptions, "color" | "showInnerLine" | "lineColor" | "lineStyle" | "lineMaterialMode" | "stripeRepeat" | "dashLength" | "dashPattern" | "gapColor" | "width" | "glowWidth" | "lineWidth" | "glowPower" | "clampToGround" | "segments" | "groundHeightEpsilon">>): void;
|
|
97
99
|
/**
|
|
98
100
|
* 显示/隐藏 Ring
|
|
99
101
|
*/
|
|
@@ -87,6 +87,8 @@ export interface OverlayEntity extends Entity {
|
|
|
87
87
|
_clampToGround?: boolean;
|
|
88
88
|
/** 复合形状的基准高度(米,clampToGround=false 时有效) */
|
|
89
89
|
_baseHeight?: number;
|
|
90
|
+
/** 贴地抬高量(米,clampToGround=true 时有效) */
|
|
91
|
+
_groundHeightEpsilon?: number;
|
|
90
92
|
_isThickOutline?: boolean;
|
|
91
93
|
_outlineWidth?: number;
|
|
92
94
|
_isRing?: boolean;
|
|
@@ -13,21 +13,31 @@ export interface MapLayersServiceConfig {
|
|
|
13
13
|
i18n?: I18nLike;
|
|
14
14
|
useI18n?: boolean;
|
|
15
15
|
onMapTypeChange?: (mapTypeId: string) => void;
|
|
16
|
-
onNoFlyZoneToggle?: (isChecked: boolean) => void;
|
|
17
16
|
onShowNoFlyZones?: () => Promise<void> | void;
|
|
17
|
+
onNoFlyZoneToggle?: (isChecked: boolean) => void;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* 图层服务类
|
|
21
21
|
* 负责处理地图图层切换相关的所有逻辑
|
|
22
22
|
*/
|
|
23
23
|
export declare class MapLayersService {
|
|
24
|
+
private static readonly PLACE_NAME_LAYER_TAG;
|
|
24
25
|
private viewer;
|
|
25
26
|
private toolbarElement;
|
|
26
27
|
private config;
|
|
27
28
|
private currentGeoWTFS;
|
|
29
|
+
private currentMapTypeConfig;
|
|
30
|
+
private currentMapLayers;
|
|
31
|
+
private currentPlaceNameProvider;
|
|
32
|
+
private currentPlaceNameLayer;
|
|
33
|
+
private isPlaceNameChecked;
|
|
28
34
|
private i18n;
|
|
29
35
|
private useI18n;
|
|
30
36
|
constructor(viewer: Viewer, toolbarElement: HTMLElement, config: MapLayersServiceConfig);
|
|
37
|
+
/**
|
|
38
|
+
* 初始化当前地图上下文:用于“初始底图不是通过 switchMapType 加载”时的地名层识别。
|
|
39
|
+
*/
|
|
40
|
+
private bootstrapCurrentMapContext;
|
|
31
41
|
/**
|
|
32
42
|
* 更新配置
|
|
33
43
|
*/
|
|
@@ -61,6 +71,13 @@ export declare class MapLayersService {
|
|
|
61
71
|
* 获取当前地图类型
|
|
62
72
|
*/
|
|
63
73
|
getCurrentMapType(): string;
|
|
74
|
+
private setPlaceNameChecked;
|
|
75
|
+
private shouldEnablePlaceName;
|
|
76
|
+
private isSameProvider;
|
|
77
|
+
private resolveExistingPlaceNameLayer;
|
|
78
|
+
private ensurePlaceNameProvider;
|
|
79
|
+
private addPlaceNameLayer;
|
|
80
|
+
private removePlaceNameLayer;
|
|
64
81
|
/**
|
|
65
82
|
* 关闭图层菜单
|
|
66
83
|
*/
|
package/package.json
CHANGED