@xingm/vmap-cesium-toolbar 0.0.6 → 1.0.0
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 +126 -230
- package/dist/README.md +172 -0
- package/dist/adapters/DrawHelperAdapter.d.ts +143 -0
- package/dist/adapters/MapLoaderAdapter.d.ts +44 -0
- package/dist/adapters/OverlayServiceAdapter.d.ts +102 -0
- package/dist/adapters/ToolbarAdapter.d.ts +71 -0
- package/dist/adapters/index.d.ts +23 -0
- package/dist/components/BaseComponent.d.ts +116 -0
- package/dist/components/SearchBox.d.ts +136 -0
- package/dist/components/Toolbar.d.ts +115 -0
- package/dist/components/ToolbarButton.d.ts +100 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/core/MapPlugin.d.ts +160 -0
- package/dist/core/constants.d.ts +88 -0
- package/dist/core/entities/BaseOverlay.d.ts +156 -0
- package/dist/core/entities/Circle.d.ts +102 -0
- package/dist/core/entities/Icon.d.ts +86 -0
- package/dist/core/entities/InfoWindow.d.ts +116 -0
- package/dist/core/entities/Label.d.ts +92 -0
- package/dist/core/entities/Marker.d.ts +66 -0
- package/dist/core/entities/Polygon.d.ts +93 -0
- package/dist/core/entities/Polyline.d.ts +72 -0
- package/dist/core/entities/Rectangle.d.ts +99 -0
- package/dist/core/entities/Ring.d.ts +114 -0
- package/dist/core/entities/SVG.d.ts +89 -0
- package/dist/core/entities/index.d.ts +27 -0
- package/dist/core/index.d.ts +25 -0
- package/dist/core/layers/BaiduMapLayer.d.ts +37 -0
- package/dist/core/layers/CustomMapLayer.d.ts +43 -0
- package/dist/core/layers/GaodeMapLayer.d.ts +41 -0
- package/dist/core/layers/HeatmapLayer.d.ts +118 -0
- package/dist/core/layers/MapLayer.d.ts +37 -0
- package/dist/core/layers/OSMMapLayer.d.ts +37 -0
- package/dist/core/layers/PointClusterLayer.d.ts +119 -0
- package/dist/core/layers/TDTMapLayer.d.ts +45 -0
- package/dist/core/layers/index.d.ts +15 -0
- package/dist/core/services/draw/DrawInteractionController.d.ts +16 -0
- package/dist/core/services/draw/DrawService.d.ts +38 -0
- package/dist/core/services/draw/DrawSessionStore.d.ts +28 -0
- package/dist/core/services/draw/drawDefaults.d.ts +16 -0
- package/dist/core/services/draw/entities/drawEntityFactory.d.ts +10 -0
- package/dist/core/services/draw/entities/drawEntityRegistry.d.ts +8 -0
- package/dist/core/services/draw/entities/drawFinalFactory.d.ts +14 -0
- package/dist/core/services/draw/entities/drawPreviewFactory.d.ts +15 -0
- package/dist/core/services/draw/geometry/drawGeometry.d.ts +11 -0
- package/dist/core/services/draw/geometry/drawPosition.d.ts +6 -0
- package/dist/core/services/draw/index.d.ts +7 -0
- package/dist/core/services/draw/labels/drawHint.d.ts +16 -0
- package/dist/core/services/draw/labels/measurementCanvas.d.ts +8 -0
- package/dist/core/services/draw/labels/measurementLabelFactory.d.ts +18 -0
- package/dist/core/services/draw/measurementThemeResolver.d.ts +9 -0
- package/dist/core/services/draw/types/drawState.d.ts +37 -0
- package/dist/core/services/draw/types/drawTypes.d.ts +97 -0
- package/dist/core/services/index.d.ts +10 -0
- package/dist/core/services/overlay/OverlayService.d.ts +188 -0
- package/dist/core/services/overlay/index.d.ts +7 -0
- package/dist/core/services/toolbar/ToolbarService.d.ts +175 -0
- package/dist/core/services/toolbar/buttons/BaseButtonHandler.d.ts +111 -0
- package/dist/core/services/toolbar/buttons/LayersButtonHandler.d.ts +47 -0
- package/dist/core/services/toolbar/buttons/MeasureButtonHandler.d.ts +94 -0
- package/dist/core/services/toolbar/buttons/SearchButtonHandler.d.ts +111 -0
- package/dist/core/services/toolbar/buttons/SimpleButtonHandler.d.ts +79 -0
- package/dist/core/services/toolbar/config.d.ts +7 -0
- package/dist/core/services/toolbar/index.d.ts +30 -0
- package/dist/core/services/toolbar/menus/BaseMenu.d.ts +99 -0
- package/dist/core/services/toolbar/menus/MeasureMenu.d.ts +44 -0
- package/dist/core/services/toolbar/types.d.ts +198 -0
- package/dist/core/types.d.ts +586 -0
- package/dist/i18n/en-US.d.ts +46 -0
- package/dist/i18n/index.d.ts +45 -2
- package/dist/i18n/zh-CN.d.ts +46 -0
- package/dist/index.d.ts +37 -42
- package/dist/index.es.js +6874 -9666
- package/dist/index.es.js.map +1 -1
- package/dist/libs/CesiumMapModel.d.ts +1 -172
- package/dist/libs/CesiumMapToolbar.d.ts +1 -1
- package/dist/libs/CesiumOverlayService.d.ts +9 -222
- package/dist/libs/config/CesiumMapConfig.d.ts +5 -12
- package/dist/libs/drawHelper/DrawHint.d.ts +15 -27
- package/dist/libs/drawHelper/index.d.ts +67 -6
- package/dist/libs/toolBar/CesiumMapController.d.ts +38 -64
- package/dist/libs/toolBar/MapLayersService.d.ts +10 -61
- package/dist/libs/toolBar/MapSearchService.d.ts +8 -29
- package/dist/libs/toolBar/MapToolBarConfig.d.ts +33 -5
- package/dist/libs/toolBar/MeasurementService.d.ts +13 -5
- package/dist/libs/toolBar/NotFlyZonesService.d.ts +6 -41
- package/dist/package.json +19 -6
- package/dist/styles/ComponentStyles.d.ts +82 -0
- package/dist/styles/StyleManager.d.ts +142 -0
- package/dist/styles/index.d.ts +128 -0
- package/dist/utils/common.d.ts +4 -0
- package/package.json +1 -1
- package/dist/hooks/toolBarConfig.d.ts +0 -75
- package/dist/hooks/useDrawHelper.d.ts +0 -24
- package/dist/hooks/useDynamicRing.d.ts +0 -44
- package/dist/hooks/useHeatmapHelper.d.ts +0 -18
- package/dist/hooks/useMap.d.ts +0 -14
- package/dist/hooks/useMapInit.d.ts +0 -14
- package/dist/hooks/useOverlayHelper.d.ts +0 -48
- package/dist/hooks/usePointClusterHelper.d.ts +0 -14
- package/dist/index.umd.js +0 -326
- package/dist/index.umd.js.map +0 -1
- package/dist/libs/drawHelper/BaseDraw.d.ts +0 -194
- package/dist/libs/drawHelper/DrawCircle.d.ts +0 -31
- package/dist/libs/drawHelper/DrawLine.d.ts +0 -49
- package/dist/libs/drawHelper/DrawPolgon.d.ts +0 -35
- package/dist/libs/drawHelper/DrawRectangle.d.ts +0 -24
- package/dist/libs/i18n/en-US.d.ts +0 -69
- package/dist/libs/i18n/index.d.ts +0 -25
- package/dist/libs/i18n/zh-CN.d.ts +0 -69
- package/dist/libs/overlay/MapCircle.d.ts +0 -130
- package/dist/libs/overlay/MapIcon.d.ts +0 -69
- package/dist/libs/overlay/MapInfoWindow.d.ts +0 -100
- package/dist/libs/overlay/MapLabel.d.ts +0 -73
- package/dist/libs/overlay/MapMarker.d.ts +0 -60
- package/dist/libs/overlay/MapPolygon.d.ts +0 -114
- package/dist/libs/overlay/MapPolyline.d.ts +0 -64
- package/dist/libs/overlay/MapRectangle.d.ts +0 -101
- package/dist/libs/overlay/MapRing.d.ts +0 -107
- package/dist/libs/overlay/MapSVG.d.ts +0 -73
- package/dist/libs/overlay/OverlayEditController.d.ts +0 -167
- package/dist/libs/overlay/OverlayEditHandles.d.ts +0 -101
- package/dist/libs/overlay/OverlayHighlight.d.ts +0 -40
- package/dist/libs/overlay/index.d.ts +0 -23
- package/dist/libs/overlay/primitives/CirclePrimitiveBatch.d.ts +0 -42
- package/dist/libs/overlay/primitives/CirclePrimitiveLayerStack.d.ts +0 -24
- package/dist/libs/overlay/primitives/PolygonPrimitiveBatch.d.ts +0 -43
- package/dist/libs/overlay/primitives/PolygonPrimitiveLayerStack.d.ts +0 -24
- package/dist/libs/overlay/primitives/RectanglePrimitiveBatch.d.ts +0 -41
- package/dist/libs/overlay/primitives/RectanglePrimitiveLayerStack.d.ts +0 -24
- package/dist/libs/overlay/types.d.ts +0 -121
- package/dist/z.const.d.ts +0 -24
- /package/dist/{libs → utils}/PickGovernor.d.ts +0 -0
|
@@ -1,172 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { I18nLike } from '../libs/i18n';
|
|
3
|
-
import * as Cesium from 'cesium';
|
|
4
|
-
export interface ToolbarConfig {
|
|
5
|
-
position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
6
|
-
buttonSize?: number;
|
|
7
|
-
buttonSpacing?: number;
|
|
8
|
-
backgroundColor?: string;
|
|
9
|
-
borderColor?: string;
|
|
10
|
-
borderRadius?: number;
|
|
11
|
-
borderWidth?: number;
|
|
12
|
-
boxShadow?: string;
|
|
13
|
-
zIndex?: number;
|
|
14
|
-
buttons?: CustomButtonConfig[];
|
|
15
|
-
useI18n?: boolean;
|
|
16
|
-
i18n?: I18nLike;
|
|
17
|
-
}
|
|
18
|
-
export interface ButtonConfig {
|
|
19
|
-
sort?: number;
|
|
20
|
-
id: string;
|
|
21
|
-
icon: string;
|
|
22
|
-
title: string;
|
|
23
|
-
titleKey?: string;
|
|
24
|
-
size?: number;
|
|
25
|
-
color?: string;
|
|
26
|
-
borderColor?: string;
|
|
27
|
-
borderWidth?: number;
|
|
28
|
-
borderStyle?: string;
|
|
29
|
-
hoverColor?: string;
|
|
30
|
-
activeColor?: string;
|
|
31
|
-
backgroundColor?: string;
|
|
32
|
-
callback?: () => void;
|
|
33
|
-
activeIcon?: string | HTMLElement;
|
|
34
|
-
}
|
|
35
|
-
export interface CustomButtonConfig {
|
|
36
|
-
id: string;
|
|
37
|
-
icon: string | HTMLElement | false;
|
|
38
|
-
title: string;
|
|
39
|
-
titleKey?: string;
|
|
40
|
-
enabled?: boolean;
|
|
41
|
-
visible?: boolean;
|
|
42
|
-
size?: number;
|
|
43
|
-
color?: string;
|
|
44
|
-
borderColor?: string;
|
|
45
|
-
borderWidth?: number;
|
|
46
|
-
borderStyle?: string;
|
|
47
|
-
padding?: string;
|
|
48
|
-
hoverColor?: string;
|
|
49
|
-
activeColor?: string;
|
|
50
|
-
backgroundColor?: string;
|
|
51
|
-
sort?: number;
|
|
52
|
-
activeIcon?: string | HTMLElement | false;
|
|
53
|
-
callback?: () => void;
|
|
54
|
-
onClick?: (buttonId: string, buttonElement: HTMLElement) => void;
|
|
55
|
-
}
|
|
56
|
-
export interface SearchCallback {
|
|
57
|
-
onSearch?: (query: string) => Promise<SearchResult[]>;
|
|
58
|
-
onSelect?: (result: SearchResult) => void;
|
|
59
|
-
onSearchInput?: (query: string, container: HTMLElement) => void;
|
|
60
|
-
onSearchResults?: (results: SearchResult[], container: HTMLElement) => void;
|
|
61
|
-
}
|
|
62
|
-
export interface SearchResult {
|
|
63
|
-
name: string;
|
|
64
|
-
address: string;
|
|
65
|
-
longitude: number;
|
|
66
|
-
latitude: number;
|
|
67
|
-
height?: number;
|
|
68
|
-
}
|
|
69
|
-
export interface MeasurementCallback {
|
|
70
|
-
onMeasurementStart?: (positions?: Cartesian3[]) => void;
|
|
71
|
-
onDistanceComplete?: (positions: Cartesian3[], distance: number) => void;
|
|
72
|
-
onAreaComplete?: (positions: Cartesian3[], area: number) => void;
|
|
73
|
-
onClear?: () => void;
|
|
74
|
-
}
|
|
75
|
-
export interface ZoomCallback {
|
|
76
|
-
onZoomIn?: (beforeHeight: number, afterHeight: number, currentLevel: number) => void;
|
|
77
|
-
onZoomOut?: (beforeHeight: number, afterHeight: number, currentLevel: number) => void;
|
|
78
|
-
}
|
|
79
|
-
export interface MapType {
|
|
80
|
-
id: string;
|
|
81
|
-
name: string;
|
|
82
|
-
nameKey?: string;
|
|
83
|
-
/** 选中态左上角“路网”文案(可选,未配置时走 i18n 默认 key) */
|
|
84
|
-
placeNameLabel?: string;
|
|
85
|
-
/** 选中态左上角“路网”文案 i18n key(可选) */
|
|
86
|
-
placeNameLabelKey?: string;
|
|
87
|
-
/** 是否强制始终显示路网层(不受 placeName 开关影响) */
|
|
88
|
-
forcePlaceName?: boolean;
|
|
89
|
-
thumbnail: string;
|
|
90
|
-
provider: (token: string) => Cesium.ImageryProvider[];
|
|
91
|
-
terrainProvider?: (token: string) => Cesium.TerrainProvider | null;
|
|
92
|
-
geoWTFS?: (token: string, viewer: Cesium.Viewer) => any | null;
|
|
93
|
-
}
|
|
94
|
-
export interface MapToolsConfig {
|
|
95
|
-
containerId: string;
|
|
96
|
-
viewerOptions?: Cesium.Viewer.ConstructorOptions;
|
|
97
|
-
mapCenter?: {
|
|
98
|
-
longitude: number;
|
|
99
|
-
latitude: number;
|
|
100
|
-
height: number;
|
|
101
|
-
pitch?: number;
|
|
102
|
-
heading?: number;
|
|
103
|
-
};
|
|
104
|
-
zoomLevels?: number[];
|
|
105
|
-
defaultZoom?: number;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* 点位绘制选项
|
|
109
|
-
*/
|
|
110
|
-
export interface PointOptions {
|
|
111
|
-
pixelSize?: number;
|
|
112
|
-
color?: Color;
|
|
113
|
-
outlineColor?: Color;
|
|
114
|
-
outlineWidth?: number;
|
|
115
|
-
showLabel?: boolean;
|
|
116
|
-
labelText?: string;
|
|
117
|
-
onClick?: (position: Cartesian3, cartographic: Cartographic) => void;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* 线条绘制选项
|
|
121
|
-
*/
|
|
122
|
-
export interface LineOptions {
|
|
123
|
-
width?: number;
|
|
124
|
-
material?: Cesium.MaterialProperty | Color;
|
|
125
|
-
showDistance?: boolean;
|
|
126
|
-
dashPattern?: number;
|
|
127
|
-
onClick?: (positions: Cartesian3[], distance: number) => void;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* 多边形绘制选项
|
|
131
|
-
*/
|
|
132
|
-
export interface PolygonOptions {
|
|
133
|
-
material?: Cesium.MaterialProperty | Color;
|
|
134
|
-
outline?: boolean;
|
|
135
|
-
outlineColor?: Color;
|
|
136
|
-
outlineWidth?: number;
|
|
137
|
-
showArea?: boolean;
|
|
138
|
-
dashPattern?: number;
|
|
139
|
-
onClick?: (positions: Cartesian3[], area: number) => void;
|
|
140
|
-
}
|
|
141
|
-
export interface OverlayOptions {
|
|
142
|
-
position: Cartesian3;
|
|
143
|
-
type: 'point' | 'label' | 'billboard' | 'model' | 'cylinder';
|
|
144
|
-
point?: {
|
|
145
|
-
pixelSize?: number;
|
|
146
|
-
color?: Color;
|
|
147
|
-
outlineColor?: Color;
|
|
148
|
-
outlineWidth?: number;
|
|
149
|
-
};
|
|
150
|
-
label?: {
|
|
151
|
-
text: string;
|
|
152
|
-
font?: string;
|
|
153
|
-
fillColor?: Color;
|
|
154
|
-
outlineColor?: Color;
|
|
155
|
-
outlineWidth?: number;
|
|
156
|
-
};
|
|
157
|
-
billboard?: {
|
|
158
|
-
image: string;
|
|
159
|
-
scale?: number;
|
|
160
|
-
};
|
|
161
|
-
model?: {
|
|
162
|
-
uri: string;
|
|
163
|
-
scale?: number;
|
|
164
|
-
};
|
|
165
|
-
cylinder?: {
|
|
166
|
-
length: number;
|
|
167
|
-
topRadius: number;
|
|
168
|
-
bottomRadius: number;
|
|
169
|
-
material?: Color;
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
export * as Cesium from '../../node_modules/cesium';
|
|
1
|
+
export type { ToolbarConfig, ButtonConfig, CustomButtonConfig, SearchCallback, SearchResult, MeasurementCallback, ZoomCallback, MapType } from '../core/types';
|
|
@@ -4,7 +4,7 @@ import { MeasurementService } from './toolBar/MeasurementService';
|
|
|
4
4
|
import { SearchService } from './toolBar/MapSearchService';
|
|
5
5
|
import { MapLayersService } from './toolBar/MapLayersService';
|
|
6
6
|
import { NotFlyZonesService } from './toolBar/NotFlyZonesService';
|
|
7
|
-
import { MapType, ToolbarConfig, SearchCallback, MeasurementCallback, ZoomCallback, CustomButtonConfig } from '
|
|
7
|
+
import { MapType, ToolbarConfig, SearchCallback, MeasurementCallback, ZoomCallback, CustomButtonConfig } from '../core/types';
|
|
8
8
|
/**
|
|
9
9
|
* Cesium地图工具栏类
|
|
10
10
|
* 提供搜索、测量、2D/3D切换、图层切换、定位、缩放、全屏等功能
|
|
@@ -1,227 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { OverlayEntity, OverlayPosition } from '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { MapSVG, SvgOptions } from './overlay/MapSVG';
|
|
8
|
-
import { MapInfoWindow, InfoWindowOptions } from './overlay/MapInfoWindow';
|
|
9
|
-
import { MapPolyline, PolylineOptions } from './overlay/MapPolyline';
|
|
10
|
-
import { MapPolygon, PolygonOptions } from './overlay/MapPolygon';
|
|
11
|
-
import { MapRectangle, RectangleOptions } from './overlay/MapRectangle';
|
|
12
|
-
import { MapCircle, CircleOptions } from './overlay/MapCircle';
|
|
13
|
-
import { MapRing, RingOptions } from './overlay/MapRing';
|
|
14
|
-
import { OverlayEditOptions } from './overlay/OverlayEditHandles';
|
|
15
|
-
export interface CesiumOverlayServiceOptions {
|
|
16
|
-
/**
|
|
17
|
-
* 是否启用实体 hover 处理器(MOUSE_MOVE 下会执行 pick/drillPick 并触发 hover 高亮)。
|
|
18
|
-
* 大屏/高负载场景可考虑关闭以规避 Cesium 在 primitive 重建窗口期的边界问题。
|
|
19
|
-
* @default true
|
|
20
|
-
*/
|
|
21
|
-
enableHoverHandler?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* 覆盖物处于编辑模式时:一次拖拽结束(LEFT_UP)且几何发生变化会触发。
|
|
24
|
-
* 参数为“已回写后的覆盖物 entity”。
|
|
25
|
-
*/
|
|
26
|
-
onOverlayEditChange?: (entity: DrawEntity & OverlayEntity) => void;
|
|
27
|
-
/**
|
|
28
|
-
* 点击 pick 节流间隔(毫秒)。
|
|
29
|
-
* 用于降低 “贴地几何 + pick + ground pipeline” 的偶发 DataCloneError 风险。
|
|
30
|
-
* @default 120
|
|
31
|
-
*/
|
|
32
|
-
clickPickMinIntervalMs?: number;
|
|
33
|
-
/** 编辑功能配置项,默认为全开(除 rotate) */
|
|
34
|
-
overlayEditOptions?: OverlayEditOptions;
|
|
1
|
+
import { Entity, Viewer } from '../../node_modules/cesium';
|
|
2
|
+
import { OverlayServiceAdapter, LegacyCesiumOverlayServiceOptions } from '../adapters/OverlayServiceAdapter';
|
|
3
|
+
import { MarkerOptions, LabelOptions, IconOptions, SvgOptions, InfoWindowOptions, PolylineOptions, PolygonOptions, RectangleOptions, CircleOptions, RingOptions, OverlayEntity, OverlayPosition, OverlayClickHighlightOptions, OverlayHoverHighlightOptions } from '../core/entities';
|
|
4
|
+
export type { MarkerOptions, LabelOptions, IconOptions, SvgOptions, InfoWindowOptions, PolylineOptions, PolygonOptions, RectangleOptions, CircleOptions, RingOptions, OverlayEntity, OverlayPosition, OverlayClickHighlightOptions, OverlayHoverHighlightOptions, };
|
|
5
|
+
export interface CesiumOverlayServiceOptions extends LegacyCesiumOverlayServiceOptions {
|
|
6
|
+
onOverlayEditChange?: (entity: Entity & OverlayEntity) => void;
|
|
35
7
|
}
|
|
36
8
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
9
|
+
* 旧版覆盖物服务兼容层。
|
|
10
|
+
* 直接复用新的 OverlayServiceAdapter,并保留旧类名。
|
|
39
11
|
*/
|
|
40
|
-
export declare class CesiumOverlayService {
|
|
41
|
-
private viewer;
|
|
42
|
-
private entities;
|
|
43
|
-
private overlayMap;
|
|
44
|
-
private infoWindowContainer;
|
|
45
|
-
/** 构造参数(用于开关 hover handler 等运行时策略) */
|
|
46
|
-
private readonly options;
|
|
47
|
-
private overlayEditor;
|
|
48
|
-
private overlayHighlight;
|
|
49
|
-
private lastHoverTargets;
|
|
50
|
-
private hoverPickRAF;
|
|
51
|
-
private hoverPickPos;
|
|
52
|
-
private overlayMutationRevision;
|
|
53
|
-
private hoverSuspendUntil;
|
|
54
|
-
private bulkUpdateDepth;
|
|
55
|
-
private readonly clickPickMinIntervalMs;
|
|
56
|
-
private readonly pickGovernor;
|
|
57
|
-
private static readonly HOVER_SUSPEND_AFTER_MUTATION_MS;
|
|
58
|
-
private static readonly CLICK_PICK_MIN_INTERVAL_MS;
|
|
59
|
-
private markOverlayMutated;
|
|
60
|
-
/**
|
|
61
|
-
* 显式开始一次批量更新:在 begin/end 期间暂停 hover pick。
|
|
62
|
-
* 建议 websocket 批量 add/remove 覆盖物时包裹使用,降低 Cesium GroundPrimitive 异步重建窗口期的 pick/update 压力。
|
|
63
|
-
*/
|
|
64
|
-
beginBulkUpdate(): void;
|
|
65
|
-
/**
|
|
66
|
-
* 结束一次批量更新。
|
|
67
|
-
*/
|
|
68
|
-
endBulkUpdate(): void;
|
|
69
|
-
/**
|
|
70
|
-
* 批量更新包裹器(自动 begin/end)。
|
|
71
|
-
*/
|
|
72
|
-
bulkUpdate<T>(fn: () => T): T;
|
|
73
|
-
/**
|
|
74
|
-
* Primitive 模式下,GeometryInstance.id 会是字符串(structured-cloneable),
|
|
75
|
-
* 需要映射回 overlayMap 内的根覆盖物 id。
|
|
76
|
-
*/
|
|
77
|
-
private normalizeOverlayPickId;
|
|
78
|
-
private resolveOverlayByPickId;
|
|
79
|
-
private resolvePickedOverlayEntity;
|
|
80
|
-
readonly marker: MapMarker;
|
|
81
|
-
readonly label: MapLabel;
|
|
82
|
-
readonly icon: MapIcon;
|
|
83
|
-
readonly svg: MapSVG;
|
|
84
|
-
readonly infoWindow: MapInfoWindow;
|
|
85
|
-
readonly polyline: MapPolyline;
|
|
86
|
-
readonly polygon: MapPolygon;
|
|
87
|
-
readonly rectangle: MapRectangle;
|
|
88
|
-
readonly circle: MapCircle;
|
|
89
|
-
readonly ring: MapRing;
|
|
12
|
+
export declare class CesiumOverlayService extends OverlayServiceAdapter {
|
|
90
13
|
constructor(viewer: Viewer, options?: CesiumOverlayServiceOptions);
|
|
91
|
-
/**
|
|
92
|
-
* 尝试从屏幕坐标拾取地表/模型位置并转为 Cartographic
|
|
93
|
-
*/
|
|
94
|
-
private pickCartographic;
|
|
95
|
-
/**
|
|
96
|
-
* 当 pick/drillPick 未命中时,使用经纬度判断是否落在 Rectangle 覆盖物内
|
|
97
|
-
*/
|
|
98
|
-
private findHoverableRectangleByCartographic;
|
|
99
|
-
/**
|
|
100
|
-
* 判断点是否在多边形内(2D)
|
|
101
|
-
*/
|
|
102
|
-
private isPointInPolygon2D;
|
|
103
|
-
private resolvePolygonPositions;
|
|
104
|
-
private findHoverablePolygonByCartographic;
|
|
105
|
-
private findHoverableCircleByCartographic;
|
|
106
|
-
/**
|
|
107
|
-
* 初始化信息窗口容器
|
|
108
|
-
*/
|
|
109
|
-
private initInfoWindowContainer;
|
|
110
|
-
/**
|
|
111
|
-
* 设置实体点击处理器
|
|
112
|
-
*/
|
|
113
|
-
private setupEntityClickHandler;
|
|
114
|
-
/**
|
|
115
|
-
* 开启或是关闭覆盖物的Hover高亮(鼠标移入高亮,移出取消)。
|
|
116
|
-
* - 开启后:覆盖物会触发高亮,且高亮状态会在鼠标移出时取消。
|
|
117
|
-
* - 关闭后:覆盖物不再触发 hover 高亮。
|
|
118
|
-
*/
|
|
119
|
-
toggleOverlayHoverHighlight(enabled: boolean): void;
|
|
120
|
-
/**
|
|
121
|
-
* 开启/关闭覆盖物编辑模式。
|
|
122
|
-
* - 开启后:点击覆盖物会进入编辑,并显示可拖拽控制点。
|
|
123
|
-
* - 关闭后:退出编辑并移除控制点。
|
|
124
|
-
* @param enabled 是否启用编辑模式
|
|
125
|
-
* @param overlayEditOptions 编辑功能配置项,可选。不传时使用构造函数传入的配置或默认配置
|
|
126
|
-
*/
|
|
127
|
-
setOverlayEditMode(enabled: boolean, overlayEditOptions?: OverlayEditOptions): void;
|
|
128
|
-
/** 当前是否处于覆盖物编辑模式(全局开关) */
|
|
129
|
-
getOverlayEditModeEnabled(): boolean;
|
|
130
|
-
/** 停止当前正在编辑的覆盖物(不会关闭全局编辑模式) */
|
|
131
|
-
stopOverlayEdit(): void;
|
|
132
|
-
/**
|
|
133
|
-
* 主动开始编辑某个覆盖物。
|
|
134
|
-
* @returns true 表示成功进入编辑
|
|
135
|
-
*/
|
|
136
|
-
startOverlayEdit(entityOrId: (DrawEntity & OverlayEntity) | string, options?: OverlayEditOptions): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* 设置实体 hover 高亮处理器(鼠标移入高亮,移出取消)
|
|
139
|
-
*/
|
|
140
|
-
private setupEntityHoverHandler;
|
|
141
|
-
private getPropertyValue;
|
|
142
|
-
private getNumberProperty;
|
|
143
|
-
/**
|
|
144
|
-
* 生成唯一ID
|
|
145
|
-
*/
|
|
146
|
-
private generateId;
|
|
147
|
-
toggleOverlayHighlight(entity: OverlayEntity, reason?: 'click' | 'hover'): void;
|
|
148
|
-
/**
|
|
149
|
-
* 高亮/取消高亮覆盖物(显式设置)
|
|
150
|
-
* @param entityOrId 覆盖物实体或 id
|
|
151
|
-
* @param enabled 是否高亮
|
|
152
|
-
* @param reason 高亮原因(默认 click)
|
|
153
|
-
*/
|
|
154
|
-
setOverlayHighlight(entityOrId: OverlayEntity | string, enabled: boolean, reason?: 'click' | 'hover'): boolean;
|
|
155
|
-
/**
|
|
156
|
-
* 添加 Marker
|
|
157
|
-
*/
|
|
158
|
-
addMarker(options: MarkerOptions): Entity;
|
|
159
|
-
/**
|
|
160
|
-
* 添加 Label
|
|
161
|
-
*/
|
|
162
|
-
addLabel(options: LabelOptions): Entity;
|
|
163
|
-
/**
|
|
164
|
-
* 添加 Icon
|
|
165
|
-
*/
|
|
166
|
-
addIcon(options: IconOptions): Entity;
|
|
167
|
-
/**
|
|
168
|
-
* 添加 SVG
|
|
169
|
-
*/
|
|
170
|
-
addSvg(options: SvgOptions): Entity;
|
|
171
|
-
/**
|
|
172
|
-
* 添加 InfoWindow
|
|
173
|
-
*/
|
|
174
|
-
addInfoWindow(options: InfoWindowOptions): Entity;
|
|
175
|
-
/**
|
|
176
|
-
* 添加 Polyline
|
|
177
|
-
*/
|
|
178
|
-
addPolyline(options: PolylineOptions): Entity;
|
|
179
|
-
/**
|
|
180
|
-
* 添加 Polygon
|
|
181
|
-
*/
|
|
182
|
-
addPolygon(options: PolygonOptions): Entity;
|
|
183
|
-
/**
|
|
184
|
-
* 添加 Rectangle
|
|
185
|
-
*/
|
|
186
|
-
addRectangle(options: RectangleOptions): Entity;
|
|
187
|
-
/**
|
|
188
|
-
* 添加 Circle
|
|
189
|
-
*/
|
|
190
|
-
addCircle(options: CircleOptions): Entity;
|
|
191
|
-
/**
|
|
192
|
-
* 添加 Ring
|
|
193
|
-
*/
|
|
194
|
-
addRing(options: RingOptions): Entity;
|
|
195
|
-
/**
|
|
196
|
-
* 根据ID获取覆盖物
|
|
197
|
-
*/
|
|
198
|
-
getOverlay(id: string): Entity | undefined;
|
|
199
|
-
/**
|
|
200
|
-
* 根据ID删除覆盖物
|
|
201
|
-
*/
|
|
202
|
-
removeOverlay(id: string): boolean;
|
|
203
|
-
/**
|
|
204
|
-
* 删除所有覆盖物
|
|
205
|
-
*/
|
|
206
|
-
removeAllOverlays(): void;
|
|
207
|
-
/**
|
|
208
|
-
* 更新覆盖物位置
|
|
209
|
-
*/
|
|
210
|
-
updateOverlayPosition(id: string, position: OverlayPosition): boolean;
|
|
211
|
-
/**
|
|
212
|
-
* 显示/隐藏覆盖物
|
|
213
|
-
*/
|
|
214
|
-
setOverlayVisible(id: string, visible: boolean): boolean;
|
|
215
|
-
/**
|
|
216
|
-
* 获取所有覆盖物ID
|
|
217
|
-
*/
|
|
218
|
-
getAllOverlayIds(): string[];
|
|
219
|
-
/**
|
|
220
|
-
* 获取所有覆盖物
|
|
221
|
-
*/
|
|
222
|
-
getAllOverlays(): Entity[];
|
|
223
|
-
/**
|
|
224
|
-
* 销毁服务,清理所有资源
|
|
225
|
-
*/
|
|
226
|
-
destroy(): void;
|
|
227
14
|
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
drawHelper?: DrawHelper;
|
|
7
|
-
toolbar?: ToolbarConfig;
|
|
8
|
-
search?: SearchCallback;
|
|
9
|
-
measurement?: MeasurementCallback;
|
|
10
|
-
zoom?: ZoomCallback;
|
|
11
|
-
mapTypes?: MapType[];
|
|
12
|
-
}
|
|
1
|
+
import { MapType } from '../CesiumMapModel';
|
|
2
|
+
/**
|
|
3
|
+
* 旧版天地图类型配置。
|
|
4
|
+
* 直接复用 core 常量,保持默认配置单源化。
|
|
5
|
+
*/
|
|
13
6
|
export declare const TDTMapTypes: MapType[];
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
offsetHeight: number;
|
|
8
|
-
};
|
|
1
|
+
import { Color } from '../../../node_modules/cesium';
|
|
2
|
+
interface DrawHintOverrideConfig {
|
|
3
|
+
text?: string | null;
|
|
4
|
+
fillColor?: Color;
|
|
5
|
+
outlineColor?: Color;
|
|
6
|
+
}
|
|
9
7
|
export declare class DrawHintHelper {
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private drawHintLastPosition;
|
|
16
|
-
private drawHintOverrideText;
|
|
17
|
-
private drawHintOverrideUntil;
|
|
18
|
-
constructor(entities: Cesium.EntityCollection, getState: () => DrawHintState, translate: (key: string, params?: Record<string, any>) => string);
|
|
19
|
-
handleSceneModeChanged(): void;
|
|
20
|
-
setOverride(options: Cesium.LabelGraphics | Cesium.LabelGraphics.ConstructorOptions, ms?: number): void;
|
|
21
|
-
updatePosition(position: Cesium.Cartesian3): void;
|
|
22
|
-
refreshTextOnly(): void;
|
|
8
|
+
constructor(...args: any[]);
|
|
9
|
+
private overrideText;
|
|
10
|
+
showHint(text: string): void;
|
|
11
|
+
hideHint(): void;
|
|
12
|
+
updateHint(position: any, text: string): void;
|
|
23
13
|
clear(): void;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/
|
|
14
|
+
refreshTextOnly(): void;
|
|
15
|
+
updatePosition(position: any): void;
|
|
16
|
+
handleSceneModeChanged(): void;
|
|
17
|
+
setOverride(config?: DrawHintOverrideConfig, timeoutMs?: number): void;
|
|
29
18
|
getDrawHintText(): string;
|
|
30
|
-
private toHintDisplayPosition;
|
|
31
19
|
}
|
|
32
20
|
export {};
|
|
@@ -1,6 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Entity } from '../../../node_modules/cesium';
|
|
2
|
+
export declare class BaseDraw {
|
|
3
|
+
constructor(viewer: any, options?: any);
|
|
4
|
+
startDrawing(options?: DrawOptions): void;
|
|
5
|
+
stopDrawing(): void;
|
|
6
|
+
clear(): void;
|
|
7
|
+
addPointForHelper(position: any): void;
|
|
8
|
+
updateDrawingEntity(position: any): void;
|
|
9
|
+
removeLastPointAndRedraw(): void;
|
|
10
|
+
finishDrawing(): DrawResult | null;
|
|
11
|
+
clearTempEntitiesForHelper(): void;
|
|
12
|
+
clearTempPointEntitiesForHelper(): void;
|
|
13
|
+
getTempPositions(): any[];
|
|
14
|
+
getTempEntities(): any[];
|
|
15
|
+
getTempLabelEntities(): any[];
|
|
16
|
+
getFinishedPointEntities(): any[];
|
|
17
|
+
}
|
|
18
|
+
export declare class DrawLine extends BaseDraw {
|
|
19
|
+
}
|
|
20
|
+
export declare class DrawPolygon extends BaseDraw {
|
|
21
|
+
}
|
|
22
|
+
export declare class DrawRectangle extends BaseDraw {
|
|
23
|
+
}
|
|
24
|
+
export declare class DrawCircle extends BaseDraw {
|
|
25
|
+
}
|
|
26
|
+
export interface DrawCallbacks {
|
|
27
|
+
onDrawStart?: () => void;
|
|
28
|
+
onDrawEnd?: (entity: any) => void;
|
|
29
|
+
onDrawComplete?: (result: any) => void;
|
|
30
|
+
onEntityRemoved?: (entity: any) => void;
|
|
31
|
+
onMeasureComplete?: (result: DrawResult) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface DrawOptions {
|
|
34
|
+
material?: any;
|
|
35
|
+
outlineMaterial?: any;
|
|
36
|
+
fillColor?: any;
|
|
37
|
+
strokeColor?: any;
|
|
38
|
+
outlineColor?: any;
|
|
39
|
+
outlineWidth?: number;
|
|
40
|
+
strokeWidth?: number;
|
|
41
|
+
showAreaLabel?: boolean;
|
|
42
|
+
showDistanceLabel?: boolean;
|
|
43
|
+
onClick?: (entity: any) => void;
|
|
44
|
+
selected?: boolean;
|
|
45
|
+
selfIntersectionEnabled?: boolean;
|
|
46
|
+
selfIntersectionAllowTouch?: boolean;
|
|
47
|
+
selfIntersectionAllowContinue?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export type DrawEntity = Entity & {
|
|
50
|
+
id: string;
|
|
51
|
+
type: string;
|
|
52
|
+
positions: any[];
|
|
53
|
+
_drawType?: string;
|
|
54
|
+
_drawOptions?: DrawOptions;
|
|
55
|
+
_onClick?: (entity: any) => void;
|
|
56
|
+
_groundPosition?: any;
|
|
57
|
+
_groundPositions?: any[];
|
|
58
|
+
_labelEntities?: Entity[];
|
|
59
|
+
};
|
|
60
|
+
export interface DrawResult {
|
|
61
|
+
type: 'line' | 'polygon' | 'rectangle' | 'circle';
|
|
62
|
+
positions: any[];
|
|
63
|
+
distance?: number;
|
|
64
|
+
areaKm2?: number;
|
|
65
|
+
entity?: Entity;
|
|
66
|
+
}
|
|
67
|
+
export declare function toggleSelectedStyle(entity: any, selected?: boolean): void;
|
|
@@ -1,84 +1,58 @@
|
|
|
1
1
|
import { Viewer } from '../../../node_modules/cesium';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
initialCenter?: MapInitialCenter;
|
|
10
|
-
/** 当前可用的地图类型列表(由外部维护),用于读取 maximumLevel 等配置 */
|
|
11
|
-
getMapTypes?: () => MapType[];
|
|
12
|
-
/** 获取当前底图类型 id(由外部维护) */
|
|
2
|
+
interface MapControllerConfig {
|
|
3
|
+
initialCenter?: {
|
|
4
|
+
longitude: number;
|
|
5
|
+
latitude: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
getMapTypes?: () => unknown[];
|
|
13
9
|
getCurrentMapTypeId?: () => string;
|
|
14
|
-
/** 获取当前天地图 token(用于从 provider 读取 maximumLevel 时保持行为一致) */
|
|
15
10
|
getToken?: () => string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
zoomCallback?: {
|
|
12
|
+
onZoomIn?: (beforeHeight: number, afterHeight: number, currentLevel: number) => void;
|
|
13
|
+
onZoomOut?: (beforeHeight: number, afterHeight: number, currentLevel: number) => void;
|
|
14
|
+
};
|
|
19
15
|
onSceneModeChanged?: () => void;
|
|
20
|
-
/** 全屏切换回调 */
|
|
21
16
|
fullscreenCallback?: (isFullscreen: boolean) => void;
|
|
22
|
-
/** 复位位置回调 */
|
|
23
17
|
resetLocationCallback?: () => void;
|
|
24
18
|
}
|
|
25
19
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
20
|
+
* 地图控制器 - 存根实现
|
|
21
|
+
* 为了保持向后兼容性
|
|
28
22
|
*/
|
|
29
23
|
export declare class CesiumMapController {
|
|
30
24
|
private viewer;
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
|
|
34
|
-
private getToken?;
|
|
35
|
-
private zoomCallback?;
|
|
36
|
-
private onSceneModeChanged?;
|
|
37
|
-
private fullscreenCallback?;
|
|
38
|
-
private resetLocationCallback?;
|
|
39
|
-
constructor(viewer: Viewer, options?: CesiumMapControllerOptions);
|
|
25
|
+
private config?;
|
|
26
|
+
private initialCenter;
|
|
27
|
+
constructor(viewer: Viewer, config?: MapControllerConfig);
|
|
40
28
|
/**
|
|
41
|
-
*
|
|
29
|
+
* 缩放到指定位置
|
|
42
30
|
*/
|
|
43
|
-
|
|
31
|
+
zoomTo(longitude: number, latitude: number, height: number): void;
|
|
44
32
|
/**
|
|
45
|
-
*
|
|
33
|
+
* 获取当前相机位置
|
|
46
34
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/** 放大 */
|
|
35
|
+
getCurrentPosition(): {
|
|
36
|
+
longitude: number;
|
|
37
|
+
latitude: number;
|
|
38
|
+
height: number;
|
|
39
|
+
} | null;
|
|
40
|
+
toggle2D3D(buttonElement?: HTMLElement): void;
|
|
54
41
|
zoomIn(): void;
|
|
55
|
-
/** 缩小 */
|
|
56
42
|
zoomOut(): void;
|
|
57
|
-
/**
|
|
58
|
-
* 2D/3D 切换
|
|
59
|
-
*/
|
|
60
|
-
toggle2D3D(buttonElement: HTMLElement): void;
|
|
61
|
-
/**
|
|
62
|
-
* 复位到初始位置
|
|
63
|
-
*/
|
|
64
|
-
resetLocation(): void;
|
|
65
|
-
setInitialCenter(center: MapInitialCenter): void;
|
|
66
|
-
getInitialCenter(): MapInitialCenter | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* 切换全屏
|
|
69
|
-
*/
|
|
70
43
|
toggleFullscreen(): void;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
44
|
+
setInitialCenter(center: {
|
|
45
|
+
longitude: number;
|
|
46
|
+
latitude: number;
|
|
47
|
+
height: number;
|
|
48
|
+
}): void;
|
|
49
|
+
getInitialCenter(): {
|
|
50
|
+
longitude: number;
|
|
51
|
+
latitude: number;
|
|
52
|
+
height: number;
|
|
53
|
+
} | undefined;
|
|
54
|
+
resetLocation(): void;
|
|
55
|
+
setupCameraZoomLimitListener(): void;
|
|
56
|
+
private getZoomLevel;
|
|
83
57
|
}
|
|
84
58
|
export {};
|