@xingm/vmap-cesium-toolbar 0.0.3 → 0.0.4-alpha.2
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/useDrawHelper.d.ts +1 -49
- package/dist/hooks/useHeatmapHelper.d.ts +1 -17
- package/dist/hooks/useOverlayHelper.d.ts +1 -221
- package/dist/hooks/usePointClusterHelper.d.ts +1 -11
- package/dist/i18n/en-US.d.ts +5 -0
- package/dist/i18n/zh-CN.d.ts +5 -0
- package/dist/index.es.js +2125 -1571
- 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/CesiumMapDraw.d.ts +20 -31
- package/dist/libs/CesiumMapLoader.d.ts +1 -0
- package/dist/libs/CesiumMapModel.d.ts +6 -0
- package/dist/libs/CesiumOverlayService.d.ts +16 -24
- package/dist/libs/CesiumPointClusterLayer.d.ts +21 -1
- package/dist/libs/PickGovernor.d.ts +23 -0
- package/dist/libs/drawHelper/DrawCircle.d.ts +1 -0
- package/dist/libs/drawHelper/DrawHint.d.ts +32 -0
- package/dist/libs/drawHelper/DrawLine.d.ts +1 -0
- package/dist/libs/drawHelper/index.d.ts +1 -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 +4 -0
- package/dist/libs/overlay/MapRectangle.d.ts +2 -0
- package/dist/libs/overlay/MapRing.d.ts +3 -1
- package/dist/libs/overlay/OverlayEditController.d.ts +18 -20
- package/dist/libs/overlay/OverlayEditHandles.d.ts +63 -0
- package/dist/libs/overlay/OverlayHighlight.d.ts +40 -0
- package/dist/libs/overlay/primitives/CirclePrimitiveBatch.d.ts +1 -0
- package/dist/libs/overlay/primitives/PolygonPrimitiveBatch.d.ts +1 -0
- package/dist/libs/overlay/primitives/RectanglePrimitiveBatch.d.ts +1 -0
- package/dist/libs/overlay/types.d.ts +2 -0
- package/dist/libs/toolBar/MapLayersService.d.ts +18 -1
- package/dist/package.json +46 -0
- package/dist/style.css +162 -0
- package/dist/utils/selfIntersection.d.ts +2 -0
- package/package.json +1 -1
|
@@ -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
|
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xingm/vmap-cesium-toolbar",
|
|
3
|
+
"version": "0.0.4-alpha.1",
|
|
4
|
+
"description": "A powerful Cesium map toolbar plugin with drawing, measurement, and interaction features",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.es.js",
|
|
7
|
+
"module": "index.es.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"index.es.js",
|
|
11
|
+
"index.umd.js",
|
|
12
|
+
"index.d.ts",
|
|
13
|
+
"style.css",
|
|
14
|
+
"README.md",
|
|
15
|
+
"geojson"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./index.es.js",
|
|
20
|
+
"default": "./index.es.js"
|
|
21
|
+
},
|
|
22
|
+
"./style": "./style.css"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"vue": "^3.0.0"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"cesium",
|
|
29
|
+
"map",
|
|
30
|
+
"toolbar",
|
|
31
|
+
"drawing",
|
|
32
|
+
"measurement",
|
|
33
|
+
"vue3",
|
|
34
|
+
"typescript"
|
|
35
|
+
],
|
|
36
|
+
"author": "pengxueyou",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/BenXueYou/vmap-cesium-tool.git"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/BenXueYou/vmap-cesium-tool/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/BenXueYou/vmap-cesium-tool#readme"
|
|
46
|
+
}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/* VMap Cesium Toolbar Plugin Styles */
|
|
2
|
+
|
|
3
|
+
/* 工具栏基础样式 */
|
|
4
|
+
.cesium-map-toolbar {
|
|
5
|
+
position: absolute;
|
|
6
|
+
background: rgba(255, 255, 255, 0.95);
|
|
7
|
+
border: 1px solid #e0e0e0;
|
|
8
|
+
border-radius: 6px;
|
|
9
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
10
|
+
padding: 8px;
|
|
11
|
+
z-index: 1000;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* 工具栏按钮样式 */
|
|
18
|
+
.cesium-toolbar-button {
|
|
19
|
+
width: 40px;
|
|
20
|
+
height: 40px;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
background: rgba(66, 133, 244, 0.4);
|
|
25
|
+
color: white;
|
|
26
|
+
border: none;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
transition: all 0.2s ease;
|
|
32
|
+
user-select: none;
|
|
33
|
+
position: relative;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cesium-toolbar-button:hover {
|
|
37
|
+
background: rgba(51, 103, 214, 0.9);
|
|
38
|
+
transform: scale(1.05);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* 搜索容器样式 */
|
|
42
|
+
.search-container {
|
|
43
|
+
position: absolute;
|
|
44
|
+
background: white;
|
|
45
|
+
border: 1px solid #e0e0e0;
|
|
46
|
+
border-radius: 4px;
|
|
47
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
48
|
+
padding: 8px;
|
|
49
|
+
min-width: 200px;
|
|
50
|
+
z-index: 1001;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.search-container input {
|
|
54
|
+
padding: 6px 8px;
|
|
55
|
+
border: 1px solid #ddd;
|
|
56
|
+
border-radius: 3px;
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
outline: none;
|
|
59
|
+
width: 100%;
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.search-results {
|
|
64
|
+
margin-top: 8px;
|
|
65
|
+
max-height: 200px;
|
|
66
|
+
overflow-y: auto;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.search-results > div {
|
|
70
|
+
padding: 8px;
|
|
71
|
+
border-bottom: 1px solid #f0f0f0;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
transition: background-color 0.2s;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.search-results > div:hover {
|
|
77
|
+
background-color: #f5f5f5;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* 测量菜单样式 */
|
|
81
|
+
.measurement-menu,
|
|
82
|
+
.layers-menu {
|
|
83
|
+
position: absolute;
|
|
84
|
+
background: white;
|
|
85
|
+
border: 1px solid #e0e0e0;
|
|
86
|
+
border-radius: 4px;
|
|
87
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
88
|
+
padding: 4px 0;
|
|
89
|
+
min-width: 120px;
|
|
90
|
+
z-index: 1001;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.layers-menu {
|
|
94
|
+
padding: 8px;
|
|
95
|
+
min-width: 200px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.measurement-menu > div,
|
|
99
|
+
.layers-menu > div {
|
|
100
|
+
padding: 8px 12px;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 8px;
|
|
105
|
+
transition: background-color 0.2s;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.measurement-menu > div:hover,
|
|
109
|
+
.layers-menu > div:hover {
|
|
110
|
+
background-color: #f5f5f5;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* 图层菜单项样式 */
|
|
114
|
+
.layers-menu .map-type-item {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: 8px;
|
|
118
|
+
padding: 6px;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
border-radius: 3px;
|
|
121
|
+
transition: background-color 0.2s;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.layers-menu .map-type-item:hover {
|
|
125
|
+
background-color: #f5f5f5;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.layers-menu .map-type-item.selected {
|
|
129
|
+
background-color: #e3f2fd;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.layers-menu .map-type-thumbnail {
|
|
133
|
+
width: 20px;
|
|
134
|
+
height: 20px;
|
|
135
|
+
border-radius: 2px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.layers-menu .map-type-checkmark {
|
|
139
|
+
color: #1976d2;
|
|
140
|
+
font-weight: bold;
|
|
141
|
+
margin-left: auto;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* 响应式设计 */
|
|
145
|
+
@media (max-width: 768px) {
|
|
146
|
+
.cesium-map-toolbar {
|
|
147
|
+
padding: 6px;
|
|
148
|
+
gap: 6px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.cesium-toolbar-button {
|
|
152
|
+
width: 36px;
|
|
153
|
+
height: 36px;
|
|
154
|
+
font-size: 12px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.search-container,
|
|
158
|
+
.measurement-menu,
|
|
159
|
+
.layers-menu {
|
|
160
|
+
min-width: 180px;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Cartesian3 } from '../../node_modules/cesium';
|
|
2
|
+
export type IntersectionKind = "none" | "touch" | "cross" | "overlap";
|
|
2
3
|
/**
|
|
3
4
|
* Returns true if adding `nextPoint` to an open polygon polyline would create a self-intersection.
|
|
4
5
|
*/
|
|
5
6
|
export declare function wouldCreatePolygonSelfIntersection(existingPoints: Cartesian3[], nextPoint: Cartesian3, opts?: {
|
|
6
7
|
allowTouch?: boolean;
|
|
7
8
|
}): boolean;
|
|
9
|
+
export declare function wouldCreatePolygonSelfIntersectionKind(existingPoints: Cartesian3[], nextPoint: Cartesian3): IntersectionKind;
|
|
8
10
|
/**
|
|
9
11
|
* Returns true if the closed polygon described by `points` is self-intersecting.
|
|
10
12
|
*/
|
package/package.json
CHANGED