@gis_victory/gismap 2.0.25 → 2.0.26
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/gismap.css +1 -1
- package/dist/index.d.ts +153 -39
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -0
- package/package.json +1 -1
- package/dist/App.vue.d.ts +0 -2
- package/dist/adapters/index.d.ts +0 -13
- package/dist/adapters/mapbox/MapboxAdapter.d.ts +0 -44
- package/dist/adapters/types.d.ts +0 -216
- package/dist/api/BaseController.d.ts +0 -6
- package/dist/api/CommonController.d.ts +0 -51
- package/dist/components/MapCompass/index.vue.d.ts +0 -2
- package/dist/components/MapContainer/index.d.ts +0 -2
- package/dist/components/MapContainer/index.vue.d.ts +0 -344
- package/dist/components/MapLayer/components/CustomLayerDialog.vue.d.ts +0 -22
- package/dist/components/MapLayer/components/LayerTab.vue.d.ts +0 -2179
- package/dist/components/MapLayer/index.d.ts +0 -2
- package/dist/components/MapLayer/index.vue.d.ts +0 -2287
- package/dist/components/MapLegend/index.d.ts +0 -2
- package/dist/components/MapLegend/index.vue.d.ts +0 -14
- package/dist/components/MapMeasure/index.vue.d.ts +0 -2
- package/dist/components/MapPrint/MapPrintPanel.vue.d.ts +0 -21
- package/dist/components/MapPrint/MapPrintService.d.ts +0 -155
- package/dist/components/MapPrint/index.vue.d.ts +0 -37
- package/dist/components/MapQueryResult/index.vue.d.ts +0 -29
- package/dist/components/MapQueryResult/popup.vue.d.ts +0 -16
- package/dist/components/MapSearch/index.d.ts +0 -2
- package/dist/components/MapSearch/index.vue.d.ts +0 -56
- package/dist/components/MapSwitch/index.d.ts +0 -2
- package/dist/components/MapSwitch/index.vue.d.ts +0 -37
- package/dist/components/MapTools/index.d.ts +0 -2
- package/dist/components/MapTools/index.vue.d.ts +0 -40
- package/dist/components/MobileMapLayer/BaseLayerSwitch.vue.d.ts +0 -16
- package/dist/components/MobileMapLayer/index.vue.d.ts +0 -9
- package/dist/components/Widgets/PopupBar/BarItem.vue.d.ts +0 -75
- package/dist/components/Widgets/PopupBar/index.vue.d.ts +0 -21
- package/dist/composables/index.d.ts +0 -13
- package/dist/composables/useControl.d.ts +0 -39
- package/dist/composables/useDraw.d.ts +0 -49
- package/dist/composables/useLayer.d.ts +0 -57
- package/dist/composables/useMap.d.ts +0 -111
- package/dist/composables/useMarker.d.ts +0 -55
- package/dist/composables/useMeasure.d.ts +0 -49
- package/dist/composables/useSearch.d.ts +0 -20
- package/dist/config/api.config.d.ts +0 -40
- package/dist/config/gismap.config.d.ts +0 -156
- package/dist/core/ManagerRegistry.d.ts +0 -75
- package/dist/core/PluginSystem.d.ts +0 -71
- package/dist/core/StateStore.d.ts +0 -96
- package/dist/core/TypedEventEmitter.d.ts +0 -67
- package/dist/core/di/Container.d.ts +0 -61
- package/dist/core/di/decorators.d.ts +0 -32
- package/dist/core/di/index.d.ts +0 -7
- package/dist/core/di/types.d.ts +0 -59
- package/dist/core/event/EventBus.d.ts +0 -101
- package/dist/core/event/index.d.ts +0 -5
- package/dist/core/event/types.d.ts +0 -215
- package/dist/core/index.d.ts +0 -6
- package/dist/core/state/Store.d.ts +0 -145
- package/dist/core/state/index.d.ts +0 -6
- package/dist/core/state/types.d.ts +0 -134
- package/dist/domain/index.d.ts +0 -8
- package/dist/domain/layer/LayerEntity.d.ts +0 -90
- package/dist/domain/layer/LayerService.d.ts +0 -128
- package/dist/domain/marker/MarkerEntity.d.ts +0 -77
- package/dist/domain/marker/MarkerService.d.ts +0 -105
- package/dist/domain/types.d.ts +0 -66
- package/dist/examples/DrawDemo.vue.d.ts +0 -2
- package/dist/examples/DrawPanel.vue.d.ts +0 -2
- package/dist/examples/Map.vue.d.ts +0 -74
- package/dist/examples/MapDemoExample.vue.d.ts +0 -2
- package/dist/examples/MeasureDemo.vue.d.ts +0 -2
- package/dist/examples/MeasurePanel.vue.d.ts +0 -2
- package/dist/examples/SplitScreenDrawDemo.vue.d.ts +0 -7
- package/dist/examples/SplitScreenDrawPanel.vue.d.ts +0 -12
- package/dist/examples/SplitScreenPanel.vue.d.ts +0 -12
- package/dist/examples/TdtControlPanel.vue.d.ts +0 -2
- package/dist/examples/TiandituDemo.vue.d.ts +0 -2
- package/dist/main.d.ts +0 -0
- package/dist/manager/IconManager.d.ts +0 -18
- package/dist/manager/LayerManager.d.ts +0 -50
- package/dist/manager/MaskManager.d.ts +0 -52
- package/dist/manager/PlaceholderManager.d.ts +0 -28
- package/dist/manager/PopupManager.d.ts +0 -13
- package/dist/manager/QuickSearchManager.d.ts +0 -24
- package/dist/manager/RadarManager.d.ts +0 -46
- package/dist/manager/SplitScreenDrawManager.d.ts +0 -75
- package/dist/manager/SplitScreenManager.d.ts +0 -81
- package/dist/manager/TDTManager.d.ts +0 -33
- package/dist/manager/TemplateManager.d.ts +0 -52
- package/dist/manager/TerrainManager.d.ts +0 -39
- package/dist/manager/layer/MarkerLayer.d.ts +0 -89
- package/dist/manager/layer/VectorLayer.d.ts +0 -30
- package/dist/manager/mapbox/DrawManager.d.ts +0 -153
- package/dist/manager/mapbox/MeasureManager.d.ts +0 -158
- package/dist/router/index.d.ts +0 -2
- package/dist/services/MapContext.d.ts +0 -171
- package/dist/services/index.d.ts +0 -5
- package/dist/types/IEvents.d.ts +0 -178
- package/dist/types/IGISMap.d.ts +0 -234
- package/dist/types/IManager.d.ts +0 -113
- package/dist/types/IMapSearch.d.ts +0 -28
- package/dist/types/IState.d.ts +0 -259
- package/dist/types/ITemplate.d.ts +0 -35
- package/dist/types/index.d.ts +0 -7
- package/dist/utils/hooks/layout.d.ts +0 -4
- package/dist/utils/http/axios.d.ts +0 -3
- package/dist/utils/http/config.d.ts +0 -3
- package/dist/utils/http/request.d.ts +0 -46
- package/dist/utils/index.d.ts +0 -49
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { TemplateItem } from '../types/ITemplate';
|
|
2
|
-
export default class TemplateManager {
|
|
3
|
-
private templates;
|
|
4
|
-
/**
|
|
5
|
-
* 初始化模板数据
|
|
6
|
-
* @param templateItems 模板数据数组
|
|
7
|
-
*/
|
|
8
|
-
initialize(templateItems: TemplateItem[]): void;
|
|
9
|
-
/**
|
|
10
|
-
* 根据模板id查询配置
|
|
11
|
-
* @param templateId 模板id
|
|
12
|
-
* @returns 模板配置,如果不存在则返回 undefined
|
|
13
|
-
*/
|
|
14
|
-
getTemplate(templateId: string): TemplateItem | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* 添加模板
|
|
17
|
-
* @param templateId 模板id
|
|
18
|
-
* @param template 模板配置
|
|
19
|
-
*/
|
|
20
|
-
addTemplate(templateId: string, template: TemplateItem): void;
|
|
21
|
-
/**
|
|
22
|
-
* 删除模板
|
|
23
|
-
* @param templateId 模板id
|
|
24
|
-
*/
|
|
25
|
-
removeTemplate(templateId: string): void;
|
|
26
|
-
/**
|
|
27
|
-
* 更新模板
|
|
28
|
-
* @param templateId 模板id
|
|
29
|
-
* @param template 模板配置
|
|
30
|
-
*/
|
|
31
|
-
updateTemplate(templateId: string, template: TemplateItem): void;
|
|
32
|
-
/**
|
|
33
|
-
* 获取所有模板
|
|
34
|
-
* @returns 所有模板的映射
|
|
35
|
-
*/
|
|
36
|
-
getAllTemplates(): Map<string, TemplateItem>;
|
|
37
|
-
/**
|
|
38
|
-
* 获取所有模板id
|
|
39
|
-
* @returns 所有模板id的数组
|
|
40
|
-
*/
|
|
41
|
-
getTemplateIds(): string[];
|
|
42
|
-
/**
|
|
43
|
-
* 检查模板是否存在
|
|
44
|
-
* @param templateId 模板id
|
|
45
|
-
* @returns 是否存在
|
|
46
|
-
*/
|
|
47
|
-
hasTemplate(templateId: string): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* 清除所有模板
|
|
50
|
-
*/
|
|
51
|
-
clear(): void;
|
|
52
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { VectorTileAdapter } from '../adapters/types';
|
|
2
|
-
export default class TerrainManager {
|
|
3
|
-
private adapter;
|
|
4
|
-
constructor(adapter: VectorTileAdapter);
|
|
5
|
-
/**
|
|
6
|
-
* 添加 raster-dem 数据源。
|
|
7
|
-
* @param options 必须包含 tiles: string[] 瓦片地址
|
|
8
|
-
*/
|
|
9
|
-
addSource(options: {
|
|
10
|
-
tiles: string[];
|
|
11
|
-
minzoom?: number;
|
|
12
|
-
maxzoom?: number;
|
|
13
|
-
tileSize?: number;
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}): this;
|
|
16
|
-
/**
|
|
17
|
-
* 添加地形(setTerrain)。
|
|
18
|
-
* 若 raster-dem 数据源不存在,会先调用 addSource 创建。
|
|
19
|
-
* @param options.source 数据源配置(需包含 tiles)
|
|
20
|
-
* @param options.layer 地形配置(exaggeration 等)
|
|
21
|
-
*/
|
|
22
|
-
add(options?: {
|
|
23
|
-
source?: any;
|
|
24
|
-
layer?: {
|
|
25
|
-
exaggeration?: number;
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
};
|
|
28
|
-
}): this;
|
|
29
|
-
/** 移除地形 */
|
|
30
|
-
remove(): this;
|
|
31
|
-
/** 添加山体阴影图层(需先添加 raster-dem 数据源) */
|
|
32
|
-
addHillshade(): this;
|
|
33
|
-
/** 移除山体阴影图层 */
|
|
34
|
-
removeHillshade(): this;
|
|
35
|
-
/** 显示地形(添加地形 + 山体阴影) */
|
|
36
|
-
show(options?: Parameters<TerrainManager['add']>[0]): this;
|
|
37
|
-
/** 隐藏地形(移除地形 + 山体阴影) */
|
|
38
|
-
hide(): this;
|
|
39
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { VectorTileAdapter, MarkerOptions } from '../../adapters/types';
|
|
2
|
-
import { Marker, LngLatLike } from '@gis_victory/mapbox-gl';
|
|
3
|
-
/**
|
|
4
|
-
* 标记图层配置
|
|
5
|
-
*/
|
|
6
|
-
export interface MarkerConfig {
|
|
7
|
-
/** 标记ID */
|
|
8
|
-
id: string;
|
|
9
|
-
/** 标记位置 [lng, lat] */
|
|
10
|
-
lngLat: LngLatLike;
|
|
11
|
-
/** 标记选项 */
|
|
12
|
-
options?: MarkerOptions;
|
|
13
|
-
/** 自定义DOM元素 */
|
|
14
|
-
element?: HTMLElement;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* 标记图层组配置
|
|
18
|
-
*/
|
|
19
|
-
export interface MarkerGroupConfig {
|
|
20
|
-
/** 标记数据数组 */
|
|
21
|
-
data: Array<{
|
|
22
|
-
/** 标记ID */
|
|
23
|
-
id: string;
|
|
24
|
-
/** 标记位置 [lng, lat] */
|
|
25
|
-
lngLat: LngLatLike;
|
|
26
|
-
/** 标记选项 */
|
|
27
|
-
options?: MarkerOptions;
|
|
28
|
-
/** 自定义DOM元素 */
|
|
29
|
-
element?: HTMLElement;
|
|
30
|
-
}>;
|
|
31
|
-
}
|
|
32
|
-
export default class MarkerLayer {
|
|
33
|
-
private adapter;
|
|
34
|
-
private markers;
|
|
35
|
-
private customLayers;
|
|
36
|
-
constructor(adapter: VectorTileAdapter);
|
|
37
|
-
/**
|
|
38
|
-
* 添加单个标记
|
|
39
|
-
* @param config 标记配置
|
|
40
|
-
*/
|
|
41
|
-
add(config: MarkerConfig): void;
|
|
42
|
-
/**
|
|
43
|
-
* 批量添加标记
|
|
44
|
-
* @param config 标记组配置
|
|
45
|
-
*/
|
|
46
|
-
addGroup(config: MarkerGroupConfig): void;
|
|
47
|
-
/**
|
|
48
|
-
* 移除标记
|
|
49
|
-
* @param id 标记ID
|
|
50
|
-
*/
|
|
51
|
-
remove(id: string): void;
|
|
52
|
-
/**
|
|
53
|
-
* 清除所有标记
|
|
54
|
-
*/
|
|
55
|
-
clear(): void;
|
|
56
|
-
/**
|
|
57
|
-
* 添加自定义图层
|
|
58
|
-
* @param id 图层ID
|
|
59
|
-
* @param layerConfig 图层配置
|
|
60
|
-
*/
|
|
61
|
-
addCustomLayer(id: string, layerConfig: any): void;
|
|
62
|
-
/**
|
|
63
|
-
* 移除自定义图层
|
|
64
|
-
* @param id 图层ID
|
|
65
|
-
*/
|
|
66
|
-
removeCustomLayer(id: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* 清除所有自定义图层
|
|
69
|
-
*/
|
|
70
|
-
clearCustomLayers(): void;
|
|
71
|
-
/**
|
|
72
|
-
* 获取所有标记
|
|
73
|
-
*/
|
|
74
|
-
getMarkers(): Marker[];
|
|
75
|
-
/**
|
|
76
|
-
* 获取指定标记
|
|
77
|
-
* @param id 标记ID
|
|
78
|
-
*/
|
|
79
|
-
getMarker(id: string): Marker | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* 获取所有自定义图层
|
|
82
|
-
*/
|
|
83
|
-
getCustomLayers(): any[];
|
|
84
|
-
/**
|
|
85
|
-
* 获取指定自定义图层
|
|
86
|
-
* @param id 图层ID
|
|
87
|
-
*/
|
|
88
|
-
getCustomLayer(id: string): any;
|
|
89
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { VectorTileAdapter } from '../../adapters/types';
|
|
2
|
-
import { IEventBus, CoreMapEvents } from '../../core/event';
|
|
3
|
-
import { LayerQueryClickPayload } from '../../core/event/types';
|
|
4
|
-
/**
|
|
5
|
-
* 矢量图层封装
|
|
6
|
-
* 依赖 VectorTileAdapter 而非 GSMap,可与 Mapbox GL / MapLibre 等引擎配合使用。
|
|
7
|
-
*/
|
|
8
|
-
export default class VectorLayer {
|
|
9
|
-
private map;
|
|
10
|
-
/** 事件总线(由 LayerManager 注入) */
|
|
11
|
-
eventBus?: IEventBus<CoreMapEvents>;
|
|
12
|
-
layerId: string;
|
|
13
|
-
layerFilter: any;
|
|
14
|
-
isQuery: boolean;
|
|
15
|
-
dataExtension: any;
|
|
16
|
-
tooltipTemplate: string;
|
|
17
|
-
templateId: string | undefined;
|
|
18
|
-
isShowTooltip: boolean;
|
|
19
|
-
isCommonPopup: boolean;
|
|
20
|
-
private feature;
|
|
21
|
-
/** 图层点击回调(由 LayerManager 注入) */
|
|
22
|
-
onLayerClick?: (payload: LayerQueryClickPayload) => void;
|
|
23
|
-
get id(): string;
|
|
24
|
-
constructor(map: VectorTileAdapter, eventBus?: IEventBus<CoreMapEvents>);
|
|
25
|
-
private addSource;
|
|
26
|
-
add(layerConfig: any, beforeLayerId?: string): void;
|
|
27
|
-
remove(): void;
|
|
28
|
-
addInteraction(): void;
|
|
29
|
-
removeInteraction(): void;
|
|
30
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/** 绘制类型 */
|
|
2
|
-
export type DrawType = 'point' | 'line' | 'polygon';
|
|
3
|
-
/** GeoJSON Feature 属性 */
|
|
4
|
-
export interface DrawFeatureProperties {
|
|
5
|
-
id: string;
|
|
6
|
-
type: DrawType;
|
|
7
|
-
createdAt: number;
|
|
8
|
-
}
|
|
9
|
-
/** 绘制完成回调 */
|
|
10
|
-
export type DrawCallback = (type: DrawType, geoJson: GeoJSON.Feature, wkt: string, feature: DrawFeature) => void;
|
|
11
|
-
/** 选中回调 */
|
|
12
|
-
export type SelectCallback = (feature: DrawFeature | null) => void;
|
|
13
|
-
/** 绘制图形 */
|
|
14
|
-
export interface DrawFeature {
|
|
15
|
-
coordinates: any;
|
|
16
|
-
id: string;
|
|
17
|
-
type: DrawType;
|
|
18
|
-
geoJson: GeoJSON.Feature;
|
|
19
|
-
wkt: string;
|
|
20
|
-
createdAt: number;
|
|
21
|
-
}
|
|
22
|
-
/** DrawManager 配置 */
|
|
23
|
-
export interface DrawManagerOptions {
|
|
24
|
-
/** 绘制图层 ID */
|
|
25
|
-
sourceId?: string;
|
|
26
|
-
/** 绘制点样式 */
|
|
27
|
-
pointColor?: string;
|
|
28
|
-
/** 绘制线样式 */
|
|
29
|
-
lineColor?: string;
|
|
30
|
-
/** 绘制面样式 */
|
|
31
|
-
polygonColor?: string;
|
|
32
|
-
/** 选中高亮颜色 */
|
|
33
|
-
selectedColor?: string;
|
|
34
|
-
}
|
|
35
|
-
export default class DrawManager {
|
|
36
|
-
private map;
|
|
37
|
-
private options;
|
|
38
|
-
private sourceId;
|
|
39
|
-
private drawLayerId;
|
|
40
|
-
private drawLineLayerId;
|
|
41
|
-
private drawPointLayerId;
|
|
42
|
-
private vertexLayerId;
|
|
43
|
-
private featureCollection;
|
|
44
|
-
private features;
|
|
45
|
-
private drawType;
|
|
46
|
-
private drawCoordinates;
|
|
47
|
-
private isDrawing;
|
|
48
|
-
private selectedFeatureId;
|
|
49
|
-
private drawCallback;
|
|
50
|
-
private selectCallback;
|
|
51
|
-
private boundHandleMapClick;
|
|
52
|
-
private boundHandleMapMouseMove;
|
|
53
|
-
private boundHandleMapDoubleClick;
|
|
54
|
-
private boundHandleFeatureClick;
|
|
55
|
-
private boundHandleMapRightClick;
|
|
56
|
-
private tooltipElement;
|
|
57
|
-
constructor(map: any, options?: DrawManagerOptions);
|
|
58
|
-
private initDrawSource;
|
|
59
|
-
private setupDrawLayers;
|
|
60
|
-
private setupSelectLayer;
|
|
61
|
-
/**
|
|
62
|
-
* 开始绘制
|
|
63
|
-
* @param type 绘制类型:point | line | polygon
|
|
64
|
-
* @param callback 绘制完成回调
|
|
65
|
-
*/
|
|
66
|
-
startDraw(type: DrawType, callback?: DrawCallback): void;
|
|
67
|
-
/**
|
|
68
|
-
* 停止绘制
|
|
69
|
-
*/
|
|
70
|
-
stopDraw(): void;
|
|
71
|
-
/**
|
|
72
|
-
* 清除当前正在绘制的图形(不删除已保存的图形)
|
|
73
|
-
*/
|
|
74
|
-
clearDrawing(): void;
|
|
75
|
-
/**
|
|
76
|
-
* 获取所有已绘制的图形
|
|
77
|
-
*/
|
|
78
|
-
getAllFeatures(): DrawFeature[];
|
|
79
|
-
/**
|
|
80
|
-
* 获取所有图形的 GeoJSON FeatureCollection
|
|
81
|
-
*/
|
|
82
|
-
getGeoJSON(): GeoJSON.FeatureCollection;
|
|
83
|
-
/**
|
|
84
|
-
* 获取指定图形
|
|
85
|
-
*/
|
|
86
|
-
getFeature(id: string): DrawFeature | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* 删除指定图形
|
|
89
|
-
*/
|
|
90
|
-
deleteFeature(id: string): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* 删除所有图形
|
|
93
|
-
*/
|
|
94
|
-
deleteAllFeatures(): void;
|
|
95
|
-
/**
|
|
96
|
-
* 获取图形数量
|
|
97
|
-
*/
|
|
98
|
-
getFeatureCount(): number;
|
|
99
|
-
/**
|
|
100
|
-
* 选中指定图形
|
|
101
|
-
*/
|
|
102
|
-
selectFeature(id: string): DrawFeature | null;
|
|
103
|
-
/**
|
|
104
|
-
* 清除选中
|
|
105
|
-
*/
|
|
106
|
-
clearSelection(): void;
|
|
107
|
-
/**
|
|
108
|
-
* 获取当前选中的图形
|
|
109
|
-
*/
|
|
110
|
-
getSelectedFeature(): DrawFeature | null;
|
|
111
|
-
/**
|
|
112
|
-
* 获取当前选中图形 ID
|
|
113
|
-
*/
|
|
114
|
-
getSelectedId(): string | null;
|
|
115
|
-
/**
|
|
116
|
-
* 判断是否有选中
|
|
117
|
-
*/
|
|
118
|
-
hasSelection(): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* 是否正在绘制
|
|
121
|
-
*/
|
|
122
|
-
getIsDrawing(): boolean;
|
|
123
|
-
/**
|
|
124
|
-
* 获取当前绘制类型
|
|
125
|
-
*/
|
|
126
|
-
getDrawType(): DrawType | 'none';
|
|
127
|
-
/**
|
|
128
|
-
* 设置绘制完成回调
|
|
129
|
-
*/
|
|
130
|
-
onDraw(callback: DrawCallback): void;
|
|
131
|
-
/**
|
|
132
|
-
* 设置选中回调
|
|
133
|
-
*/
|
|
134
|
-
onSelect(callback: SelectCallback): void;
|
|
135
|
-
private bindDrawEvents;
|
|
136
|
-
private unbindDrawEvents;
|
|
137
|
-
private handleMapClick;
|
|
138
|
-
private handleMapMouseMove;
|
|
139
|
-
private handleMapDoubleClick;
|
|
140
|
-
private handleFeatureClick;
|
|
141
|
-
private handleMapRightClick;
|
|
142
|
-
private createTooltip;
|
|
143
|
-
private showTooltip;
|
|
144
|
-
private hideTooltip;
|
|
145
|
-
private updateTooltipPosition;
|
|
146
|
-
private removeTooltip;
|
|
147
|
-
private finishDraw;
|
|
148
|
-
private updateDrawFeature;
|
|
149
|
-
private updateDrawSource;
|
|
150
|
-
private updateFeatureProperty;
|
|
151
|
-
private removeDrawLayers;
|
|
152
|
-
destroy(): void;
|
|
153
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/** 测量类型 */
|
|
2
|
-
export type MeasureType = 'point' | 'line' | 'polygon' | 'none';
|
|
3
|
-
/** 测量结果 */
|
|
4
|
-
export interface MeasureResult {
|
|
5
|
-
id: string;
|
|
6
|
-
type: MeasureType;
|
|
7
|
-
geoJson: GeoJSON.Feature;
|
|
8
|
-
wkt: string;
|
|
9
|
-
value: string;
|
|
10
|
-
rawValue: number;
|
|
11
|
-
unit: string;
|
|
12
|
-
coordinates: number[][];
|
|
13
|
-
createdAt: number;
|
|
14
|
-
}
|
|
15
|
-
/** 坐标类型 */
|
|
16
|
-
export type CoordinateType = 'lnglat' | 'mercator';
|
|
17
|
-
/** 距离单位 */
|
|
18
|
-
export type DistanceUnit = 'meter' | 'kilometer';
|
|
19
|
-
/** 面积单位 */
|
|
20
|
-
export type AreaUnit = 'squareMeter' | 'squareKilometer' | 'mu';
|
|
21
|
-
/** 测量完成回调 */
|
|
22
|
-
export type MeasureCallback = (result: MeasureResult) => void;
|
|
23
|
-
/** MeasureManager 配置 */
|
|
24
|
-
export interface MeasureManagerOptions {
|
|
25
|
-
/** 测量图层 ID */
|
|
26
|
-
sourceId?: string;
|
|
27
|
-
/** 测量点样式颜色 */
|
|
28
|
-
pointColor?: string;
|
|
29
|
-
/** 测量线样式颜色 */
|
|
30
|
-
lineColor?: string;
|
|
31
|
-
/** 测量面样式颜色 */
|
|
32
|
-
polygonColor?: string;
|
|
33
|
-
/** 文字标签颜色 */
|
|
34
|
-
textColor?: string;
|
|
35
|
-
/** 坐标类型:经纬度或墨卡托投影 */
|
|
36
|
-
coordinateType?: CoordinateType;
|
|
37
|
-
/** 经纬度小数位数,默认6位 */
|
|
38
|
-
lnglatDecimal?: number;
|
|
39
|
-
/** 墨卡托投影小数位数,默认2位 */
|
|
40
|
-
mercatorDecimal?: number;
|
|
41
|
-
/** 距离单位,默认自动 */
|
|
42
|
-
distanceUnit?: DistanceUnit;
|
|
43
|
-
/** 面积单位,默认自动 */
|
|
44
|
-
areaUnit?: AreaUnit;
|
|
45
|
-
}
|
|
46
|
-
export default class MeasureManager {
|
|
47
|
-
private map;
|
|
48
|
-
private options;
|
|
49
|
-
private sourceId;
|
|
50
|
-
private measureLayerId;
|
|
51
|
-
private measureLineLayerId;
|
|
52
|
-
private measurePointLayerId;
|
|
53
|
-
private vertexLayerId;
|
|
54
|
-
private labelLayerId;
|
|
55
|
-
private featureCollection;
|
|
56
|
-
private results;
|
|
57
|
-
private measureType;
|
|
58
|
-
private measureCoordinates;
|
|
59
|
-
private isMeasuring;
|
|
60
|
-
private measureCallback;
|
|
61
|
-
private boundHandleMapClick;
|
|
62
|
-
private boundHandleMapMouseMove;
|
|
63
|
-
private boundHandleMapRightClick;
|
|
64
|
-
private tooltipElement;
|
|
65
|
-
constructor(map: any, options?: MeasureManagerOptions);
|
|
66
|
-
private initMeasureSource;
|
|
67
|
-
private setupMeasureLayers;
|
|
68
|
-
/**
|
|
69
|
-
* 开始测量
|
|
70
|
-
* @param type 测量类型:point | line | polygon
|
|
71
|
-
* @param callback 测量完成回调
|
|
72
|
-
*/
|
|
73
|
-
startMeasure(type: MeasureType, callback?: MeasureCallback): void;
|
|
74
|
-
/**
|
|
75
|
-
* 停止测量
|
|
76
|
-
*/
|
|
77
|
-
stopMeasure(): void;
|
|
78
|
-
/**
|
|
79
|
-
* 清除当前正在测量的图形
|
|
80
|
-
*/
|
|
81
|
-
clearMeasuring(): void;
|
|
82
|
-
/**
|
|
83
|
-
* 获取所有测量结果
|
|
84
|
-
*/
|
|
85
|
-
getAllResults(): MeasureResult[];
|
|
86
|
-
/**
|
|
87
|
-
* 获取指定测量结果
|
|
88
|
-
*/
|
|
89
|
-
getResult(id: string): MeasureResult | undefined;
|
|
90
|
-
/**
|
|
91
|
-
* 删除指定测量结果
|
|
92
|
-
*/
|
|
93
|
-
deleteResult(id: string): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* 删除所有测量结果
|
|
96
|
-
*/
|
|
97
|
-
clearAllResults(): void;
|
|
98
|
-
/**
|
|
99
|
-
* 获取测量结果数量
|
|
100
|
-
*/
|
|
101
|
-
getResultCount(): number;
|
|
102
|
-
/**
|
|
103
|
-
* 是否正在测量
|
|
104
|
-
*/
|
|
105
|
-
getIsMeasuring(): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* 获取当前测量类型
|
|
108
|
-
*/
|
|
109
|
-
getMeasureType(): MeasureType;
|
|
110
|
-
/**
|
|
111
|
-
* 更新配置
|
|
112
|
-
*/
|
|
113
|
-
updateOptions(options: Partial<MeasureManagerOptions>): void;
|
|
114
|
-
private bindMeasureEvents;
|
|
115
|
-
private unbindMeasureEvents;
|
|
116
|
-
private handleMapClick;
|
|
117
|
-
private handleMapMouseMove;
|
|
118
|
-
private handleMapRightClick;
|
|
119
|
-
private createTooltip;
|
|
120
|
-
private showTooltip;
|
|
121
|
-
private hideTooltip;
|
|
122
|
-
private removeTooltip;
|
|
123
|
-
private finishMeasure;
|
|
124
|
-
/**
|
|
125
|
-
* 计算线段距离(使用 Haversine 公式,单位:米)
|
|
126
|
-
*/
|
|
127
|
-
private calculateDistance;
|
|
128
|
-
/**
|
|
129
|
-
* Haversine 距离计算(单位:米)
|
|
130
|
-
*/
|
|
131
|
-
private haversineDistance;
|
|
132
|
-
private toRadians;
|
|
133
|
-
/**
|
|
134
|
-
* 将经纬度坐标转换为平面坐标(墨卡托投影)
|
|
135
|
-
* @param lng 经度
|
|
136
|
-
* @param lat 纬度
|
|
137
|
-
* @returns [x, y] 平面坐标(单位:米)
|
|
138
|
-
*/
|
|
139
|
-
private lonLatToMercator;
|
|
140
|
-
/**
|
|
141
|
-
* 格式化距离显示
|
|
142
|
-
*/
|
|
143
|
-
private formatDistance;
|
|
144
|
-
/**
|
|
145
|
-
* 计算多边形面积(使用 Shoelace 公式,单位:平方米)
|
|
146
|
-
*/
|
|
147
|
-
private calculateArea;
|
|
148
|
-
private lngToMeters;
|
|
149
|
-
private latToMeters;
|
|
150
|
-
/**
|
|
151
|
-
* 格式化面积显示
|
|
152
|
-
*/
|
|
153
|
-
private formatArea;
|
|
154
|
-
private updateMeasureFeature;
|
|
155
|
-
private updateMeasureSource;
|
|
156
|
-
private removeMeasureLayers;
|
|
157
|
-
destroy(): void;
|
|
158
|
-
}
|
package/dist/router/index.d.ts
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { IEventBus, IStateStore, IContainer } from '../core';
|
|
2
|
-
import { CoreMapEvents } from '../core/event';
|
|
3
|
-
import { MapState } from '../core/state';
|
|
4
|
-
import { LayerService, MarkerService } from '../domain';
|
|
5
|
-
import { MapAdapter } from '../adapters/types';
|
|
6
|
-
import { default as TDTManager } from '../manager/TDTManager';
|
|
7
|
-
import { default as TerrainManager } from '../manager/TerrainManager';
|
|
8
|
-
import { default as PlaceholderManager } from '../manager/PlaceholderManager';
|
|
9
|
-
import { default as LayerManager } from '../manager/LayerManager';
|
|
10
|
-
import { default as RadarManager } from '../manager/RadarManager';
|
|
11
|
-
import { default as IconManager } from '../manager/IconManager';
|
|
12
|
-
import { default as TemplateManager } from '../manager/TemplateManager';
|
|
13
|
-
import { default as DrawManager } from '../manager/mapbox/DrawManager';
|
|
14
|
-
import { default as MeasureManager, MeasureManagerOptions } from '../manager/mapbox/MeasureManager';
|
|
15
|
-
/** 地图上下文配置 */
|
|
16
|
-
export interface MapContextConfig {
|
|
17
|
-
/** 地图适配器 */
|
|
18
|
-
adapter: MapAdapter;
|
|
19
|
-
/** 事件总线 */
|
|
20
|
-
eventBus: IEventBus<CoreMapEvents>;
|
|
21
|
-
/** 状态存储 */
|
|
22
|
-
stateStore: IStateStore<MapState>;
|
|
23
|
-
/** 依赖注入容器 */
|
|
24
|
-
container?: IContainer;
|
|
25
|
-
/** 天地图 Token */
|
|
26
|
-
tdtToken?: string;
|
|
27
|
-
/** 初始化图标配置 */
|
|
28
|
-
initIcons?: Array<{
|
|
29
|
-
name: string;
|
|
30
|
-
url: string;
|
|
31
|
-
}>;
|
|
32
|
-
/** 测量管理器配置 */
|
|
33
|
-
measureOptions?: MeasureManagerOptions;
|
|
34
|
-
}
|
|
35
|
-
/** 地图上下文
|
|
36
|
-
* 协调地图所有子系统,提供对地图能力的统一访问入口
|
|
37
|
-
*/
|
|
38
|
-
export declare class MapContext {
|
|
39
|
-
readonly adapter: MapAdapter;
|
|
40
|
-
readonly events: IEventBus<CoreMapEvents>;
|
|
41
|
-
readonly state: IStateStore<MapState>;
|
|
42
|
-
readonly container?: IContainer;
|
|
43
|
-
readonly tdtToken?: string;
|
|
44
|
-
readonly initIcons?: Array<{
|
|
45
|
-
name: string;
|
|
46
|
-
url: string;
|
|
47
|
-
}>;
|
|
48
|
-
readonly measureOptions?: MeasureManagerOptions;
|
|
49
|
-
private _layerService?;
|
|
50
|
-
private _markerService?;
|
|
51
|
-
private _tdtManager?;
|
|
52
|
-
private _terrainManager?;
|
|
53
|
-
private _placeholderManager?;
|
|
54
|
-
private _layerManager?;
|
|
55
|
-
private _radarManager?;
|
|
56
|
-
private _iconManager?;
|
|
57
|
-
private _templateManager?;
|
|
58
|
-
private _drawManager?;
|
|
59
|
-
private _measureManager?;
|
|
60
|
-
constructor(config: MapContextConfig);
|
|
61
|
-
/**
|
|
62
|
-
* 图层服务
|
|
63
|
-
*/
|
|
64
|
-
get layers(): LayerService;
|
|
65
|
-
/**
|
|
66
|
-
* 标记服务
|
|
67
|
-
*/
|
|
68
|
-
get markers(): MarkerService;
|
|
69
|
-
/**
|
|
70
|
-
* 获取天地图管理器
|
|
71
|
-
*/
|
|
72
|
-
get tdtManager(): TDTManager | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* 获取地形管理器
|
|
75
|
-
*/
|
|
76
|
-
get terrainManager(): TerrainManager | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* 获取雷达管理器
|
|
79
|
-
*/
|
|
80
|
-
get radarManager(): RadarManager | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* 获取图标管理器
|
|
83
|
-
*/
|
|
84
|
-
get iconManager(): IconManager | undefined;
|
|
85
|
-
/**
|
|
86
|
-
* 获取占位符管理器
|
|
87
|
-
*/
|
|
88
|
-
get placeholderManager(): PlaceholderManager | undefined;
|
|
89
|
-
/**
|
|
90
|
-
* 获取绘制管理器
|
|
91
|
-
*/
|
|
92
|
-
get drawManager(): DrawManager | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* 获取测量管理器
|
|
95
|
-
*/
|
|
96
|
-
get measureManager(): MeasureManager | undefined;
|
|
97
|
-
/**
|
|
98
|
-
* 获取图层管理器
|
|
99
|
-
*/
|
|
100
|
-
get layerManager(): LayerManager | undefined;
|
|
101
|
-
/**
|
|
102
|
-
* 获取模板管理器
|
|
103
|
-
*/
|
|
104
|
-
get templateManager(): TemplateManager | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* 初始化上下文
|
|
107
|
-
*/
|
|
108
|
-
initialize(services: {
|
|
109
|
-
layerService: LayerService;
|
|
110
|
-
markerService: MarkerService;
|
|
111
|
-
}): void;
|
|
112
|
-
/**
|
|
113
|
-
* 加载初始化图标
|
|
114
|
-
*/
|
|
115
|
-
private loadInitIcons;
|
|
116
|
-
/**
|
|
117
|
-
* 初始化管理器
|
|
118
|
-
*/
|
|
119
|
-
private initManagers;
|
|
120
|
-
/**
|
|
121
|
-
* 初始化矢量瓦片相关的管理器
|
|
122
|
-
* 包括:占位符管理器、天地图管理器、地形管理器
|
|
123
|
-
*/
|
|
124
|
-
private initMapboxGLManagers;
|
|
125
|
-
/**
|
|
126
|
-
* 销毁上下文
|
|
127
|
-
*/
|
|
128
|
-
dispose(): void;
|
|
129
|
-
/**
|
|
130
|
-
* 获取地图实例
|
|
131
|
-
*/
|
|
132
|
-
getMap(): any;
|
|
133
|
-
/**
|
|
134
|
-
* 设置视图
|
|
135
|
-
*/
|
|
136
|
-
setView(center: [number, number], zoom: number, options?: {
|
|
137
|
-
bearing?: number;
|
|
138
|
-
pitch?: number;
|
|
139
|
-
animate?: boolean;
|
|
140
|
-
}): void;
|
|
141
|
-
/**
|
|
142
|
-
* 飞转到位置
|
|
143
|
-
*/
|
|
144
|
-
flyTo(center: [number, number], options?: {
|
|
145
|
-
zoom?: number;
|
|
146
|
-
duration?: number;
|
|
147
|
-
}): void;
|
|
148
|
-
/**
|
|
149
|
-
* 适应边界
|
|
150
|
-
*/
|
|
151
|
-
fitBounds(bounds: [[number, number], [number, number]], options?: {
|
|
152
|
-
padding?: number;
|
|
153
|
-
}): void;
|
|
154
|
-
/**
|
|
155
|
-
* 获取当前视图状态
|
|
156
|
-
*/
|
|
157
|
-
getViewState(): import('../core').ViewState;
|
|
158
|
-
/**
|
|
159
|
-
* 获取地图是否就绪
|
|
160
|
-
*/
|
|
161
|
-
get isReady(): boolean;
|
|
162
|
-
/**
|
|
163
|
-
* 订阅事件
|
|
164
|
-
*/
|
|
165
|
-
on<K extends keyof CoreMapEvents>(event: K, handler: (payload: CoreMapEvents[K]) => void): () => void;
|
|
166
|
-
/**
|
|
167
|
-
* 订阅一次性事件
|
|
168
|
-
*/
|
|
169
|
-
once<K extends keyof CoreMapEvents>(event: K, handler: (payload: CoreMapEvents[K]) => void): () => void;
|
|
170
|
-
private bindMapEvents;
|
|
171
|
-
}
|