@gis_victory/gismap 2.0.24 → 2.0.25
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/App.vue.d.ts +2 -0
- package/dist/adapters/index.d.ts +13 -0
- package/dist/adapters/mapbox/MapboxAdapter.d.ts +44 -0
- package/dist/adapters/types.d.ts +216 -0
- package/dist/api/BaseController.d.ts +6 -0
- package/dist/api/CommonController.d.ts +51 -0
- package/dist/components/MapCompass/index.vue.d.ts +2 -0
- package/dist/components/MapContainer/index.d.ts +2 -0
- package/dist/components/MapContainer/index.vue.d.ts +344 -0
- package/dist/components/MapLayer/components/CustomLayerDialog.vue.d.ts +22 -0
- package/dist/components/MapLayer/components/LayerTab.vue.d.ts +2179 -0
- package/dist/components/MapLayer/index.d.ts +2 -0
- package/dist/components/MapLayer/index.vue.d.ts +2287 -0
- package/dist/components/MapLegend/index.d.ts +2 -0
- package/dist/components/MapLegend/index.vue.d.ts +14 -0
- package/dist/components/MapMeasure/index.vue.d.ts +2 -0
- package/dist/components/MapPrint/MapPrintPanel.vue.d.ts +21 -0
- package/dist/components/MapPrint/MapPrintService.d.ts +155 -0
- package/dist/components/MapPrint/index.vue.d.ts +37 -0
- package/dist/components/MapQueryResult/index.vue.d.ts +29 -0
- package/dist/components/MapQueryResult/popup.vue.d.ts +16 -0
- package/dist/components/MapSearch/index.d.ts +2 -0
- package/dist/components/MapSearch/index.vue.d.ts +56 -0
- package/dist/components/MapSwitch/index.d.ts +2 -0
- package/dist/components/MapSwitch/index.vue.d.ts +37 -0
- package/dist/components/MapTools/index.d.ts +2 -0
- package/dist/components/MapTools/index.vue.d.ts +40 -0
- package/dist/components/MobileMapLayer/BaseLayerSwitch.vue.d.ts +16 -0
- package/dist/components/MobileMapLayer/index.vue.d.ts +9 -0
- package/dist/components/Widgets/PopupBar/BarItem.vue.d.ts +75 -0
- package/dist/components/Widgets/PopupBar/index.vue.d.ts +21 -0
- package/dist/composables/index.d.ts +13 -0
- package/dist/composables/useControl.d.ts +39 -0
- package/dist/composables/useDraw.d.ts +49 -0
- package/dist/composables/useLayer.d.ts +57 -0
- package/dist/composables/useMap.d.ts +111 -0
- package/dist/composables/useMarker.d.ts +55 -0
- package/dist/composables/useMeasure.d.ts +49 -0
- package/dist/composables/useSearch.d.ts +20 -0
- package/dist/config/api.config.d.ts +40 -0
- package/dist/config/gismap.config.d.ts +156 -0
- package/dist/core/ManagerRegistry.d.ts +75 -0
- package/dist/core/PluginSystem.d.ts +71 -0
- package/dist/core/StateStore.d.ts +96 -0
- package/dist/core/TypedEventEmitter.d.ts +67 -0
- package/dist/core/di/Container.d.ts +61 -0
- package/dist/core/di/decorators.d.ts +32 -0
- package/dist/core/di/index.d.ts +7 -0
- package/dist/core/di/types.d.ts +59 -0
- package/dist/core/event/EventBus.d.ts +101 -0
- package/dist/core/event/index.d.ts +5 -0
- package/dist/core/event/types.d.ts +215 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/state/Store.d.ts +145 -0
- package/dist/core/state/index.d.ts +6 -0
- package/dist/core/state/types.d.ts +134 -0
- package/dist/domain/index.d.ts +8 -0
- package/dist/domain/layer/LayerEntity.d.ts +90 -0
- package/dist/domain/layer/LayerService.d.ts +128 -0
- package/dist/domain/marker/MarkerEntity.d.ts +77 -0
- package/dist/domain/marker/MarkerService.d.ts +105 -0
- package/dist/domain/types.d.ts +66 -0
- package/dist/examples/DrawDemo.vue.d.ts +2 -0
- package/dist/examples/DrawPanel.vue.d.ts +2 -0
- package/dist/examples/Map.vue.d.ts +74 -0
- package/dist/examples/MapDemoExample.vue.d.ts +2 -0
- package/dist/examples/MeasureDemo.vue.d.ts +2 -0
- package/dist/examples/MeasurePanel.vue.d.ts +2 -0
- package/dist/examples/SplitScreenDrawDemo.vue.d.ts +7 -0
- package/dist/examples/SplitScreenDrawPanel.vue.d.ts +12 -0
- package/dist/examples/SplitScreenPanel.vue.d.ts +12 -0
- package/dist/examples/TdtControlPanel.vue.d.ts +2 -0
- package/dist/examples/TiandituDemo.vue.d.ts +2 -0
- package/dist/gismap.css +1 -1
- package/dist/index.es.js +1 -1
- package/dist/main.d.ts +0 -0
- package/dist/manager/IconManager.d.ts +18 -0
- package/dist/manager/LayerManager.d.ts +50 -0
- package/dist/manager/MaskManager.d.ts +52 -0
- package/dist/manager/PlaceholderManager.d.ts +28 -0
- package/dist/manager/PopupManager.d.ts +13 -0
- package/dist/manager/QuickSearchManager.d.ts +24 -0
- package/dist/manager/RadarManager.d.ts +46 -0
- package/dist/manager/SplitScreenDrawManager.d.ts +75 -0
- package/dist/manager/SplitScreenManager.d.ts +81 -0
- package/dist/manager/TDTManager.d.ts +33 -0
- package/dist/manager/TemplateManager.d.ts +52 -0
- package/dist/manager/TerrainManager.d.ts +39 -0
- package/dist/manager/layer/MarkerLayer.d.ts +89 -0
- package/dist/manager/layer/VectorLayer.d.ts +30 -0
- package/dist/manager/mapbox/DrawManager.d.ts +153 -0
- package/dist/manager/mapbox/MeasureManager.d.ts +158 -0
- package/dist/router/index.d.ts +2 -0
- package/dist/services/MapContext.d.ts +171 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/types/IEvents.d.ts +178 -0
- package/dist/types/IGISMap.d.ts +234 -0
- package/dist/types/IManager.d.ts +113 -0
- package/dist/types/IMapSearch.d.ts +28 -0
- package/dist/types/IState.d.ts +259 -0
- package/dist/types/ITemplate.d.ts +35 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/utils/hooks/layout.d.ts +4 -0
- package/dist/utils/http/axios.d.ts +3 -0
- package/dist/utils/http/config.d.ts +3 -0
- package/dist/utils/http/request.d.ts +46 -0
- package/dist/utils/index.d.ts +49 -0
- package/package.json +1 -1
- package/dist/index.umd.js +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { LayerConfig, LayerEntity, EntityId } from '../domain';
|
|
3
|
+
/** 图层选项 */
|
|
4
|
+
export interface UseLayerOptions {
|
|
5
|
+
/** 初始可见性 */
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
/** 初始透明度 */
|
|
8
|
+
opacity?: number;
|
|
9
|
+
/** 是否自动添加到地图 */
|
|
10
|
+
autoAdd?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** 使用单个图层 */
|
|
13
|
+
export declare function useLayer(layerId: MaybeRefOrGetter<EntityId>): {
|
|
14
|
+
layer: import('vue').ComputedRef<LayerEntity | undefined>;
|
|
15
|
+
state: import('vue').ComputedRef<any>;
|
|
16
|
+
visible: import('vue').WritableComputedRef<any, boolean>;
|
|
17
|
+
opacity: import('vue').WritableComputedRef<any, number>;
|
|
18
|
+
type: import('vue').ComputedRef<import('../domain').LayerType | undefined>;
|
|
19
|
+
metadata: import('vue').ComputedRef<Record<string, any> | undefined>;
|
|
20
|
+
exists: import('vue').ComputedRef<boolean>;
|
|
21
|
+
show: () => void;
|
|
22
|
+
hide: () => void;
|
|
23
|
+
toggle: () => any;
|
|
24
|
+
remove: () => any;
|
|
25
|
+
setOpacity: (value: number) => void;
|
|
26
|
+
};
|
|
27
|
+
/** 使用图层列表 */
|
|
28
|
+
export declare function useLayers(): {
|
|
29
|
+
layers: import('vue').ComputedRef<any>;
|
|
30
|
+
layerStates: any;
|
|
31
|
+
visibleLayers: import('vue').ComputedRef<any>;
|
|
32
|
+
count: import('vue').ComputedRef<any>;
|
|
33
|
+
addLayer: (config: LayerConfig, beforeId?: string) => any;
|
|
34
|
+
removeLayer: (layerId: EntityId) => any;
|
|
35
|
+
removeAll: () => void;
|
|
36
|
+
showAll: () => void;
|
|
37
|
+
hideAll: () => void;
|
|
38
|
+
getLayer: (layerId: EntityId) => any;
|
|
39
|
+
getLayersByType: (type: string) => any;
|
|
40
|
+
};
|
|
41
|
+
/** 使用图层组 */
|
|
42
|
+
export declare function useLayerGroup(groupId: MaybeRefOrGetter<EntityId>): {
|
|
43
|
+
group: import('vue').ComputedRef<any>;
|
|
44
|
+
layers: import('vue').ComputedRef<any>;
|
|
45
|
+
visible: import('vue').WritableComputedRef<any, boolean>;
|
|
46
|
+
expanded: import('vue').WritableComputedRef<any, boolean>;
|
|
47
|
+
exists: import('vue').ComputedRef<boolean>;
|
|
48
|
+
};
|
|
49
|
+
/** 创建并管理图层 */
|
|
50
|
+
export declare function useLayerManager(config: MaybeRefOrGetter<LayerConfig>, options?: UseLayerOptions): {
|
|
51
|
+
layerId: Readonly<import('vue').Ref<string | null, string | null>>;
|
|
52
|
+
isAdded: Readonly<import('vue').Ref<boolean, boolean>>;
|
|
53
|
+
layer: import('vue').ComputedRef<LayerEntity | undefined>;
|
|
54
|
+
visible: import('vue').ComputedRef<import('vue').WritableComputedRef<any, boolean> | undefined>;
|
|
55
|
+
opacity: import('vue').ComputedRef<any>;
|
|
56
|
+
remove: () => void;
|
|
57
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { InjectionKey, App, Ref } from 'vue';
|
|
2
|
+
import { MapContext } from '../services';
|
|
3
|
+
import { CoreMapEvents } from '../core/event';
|
|
4
|
+
/** 地图上下文注入键 - 现在注入的是 Ref */
|
|
5
|
+
export declare const MapContextKey: InjectionKey<Ref<MapContext | null>>;
|
|
6
|
+
/** 地图状态注入键 */
|
|
7
|
+
export declare const MapStateKey: InjectionKey<Ref<ReturnType<typeof createMapState> | null>>;
|
|
8
|
+
/** 创建响应式地图状态(供 MapContainer 内部使用) */
|
|
9
|
+
export declare function createMapState(context: MapContext): {
|
|
10
|
+
view: Readonly<Ref<{
|
|
11
|
+
readonly center: {
|
|
12
|
+
readonly lng: number;
|
|
13
|
+
readonly lat: number;
|
|
14
|
+
readonly wrap: () => import('@gis_victory/mapbox-gl').LngLat;
|
|
15
|
+
readonly toArray: () => [number, number];
|
|
16
|
+
readonly toString: () => string;
|
|
17
|
+
readonly distanceTo: (lngLat: import('@gis_victory/mapbox-gl').LngLat) => number;
|
|
18
|
+
readonly toBounds: (radius?: number) => import('@gis_victory/mapbox-gl').LngLatBounds;
|
|
19
|
+
readonly toEcef: (altitude: number) => [number, number, number];
|
|
20
|
+
};
|
|
21
|
+
readonly zoom: number;
|
|
22
|
+
readonly pitch: number;
|
|
23
|
+
readonly bearing: number;
|
|
24
|
+
readonly padding?: any;
|
|
25
|
+
}, {
|
|
26
|
+
readonly center: {
|
|
27
|
+
readonly lng: number;
|
|
28
|
+
readonly lat: number;
|
|
29
|
+
readonly wrap: () => import('@gis_victory/mapbox-gl').LngLat;
|
|
30
|
+
readonly toArray: () => [number, number];
|
|
31
|
+
readonly toString: () => string;
|
|
32
|
+
readonly distanceTo: (lngLat: import('@gis_victory/mapbox-gl').LngLat) => number;
|
|
33
|
+
readonly toBounds: (radius?: number) => import('@gis_victory/mapbox-gl').LngLatBounds;
|
|
34
|
+
readonly toEcef: (altitude: number) => [number, number, number];
|
|
35
|
+
};
|
|
36
|
+
readonly zoom: number;
|
|
37
|
+
readonly pitch: number;
|
|
38
|
+
readonly bearing: number;
|
|
39
|
+
readonly padding?: any;
|
|
40
|
+
}>>;
|
|
41
|
+
loaded: Readonly<Ref<boolean, boolean>>;
|
|
42
|
+
ready: Readonly<Ref<boolean, boolean>>;
|
|
43
|
+
layers: Readonly<Ref<ReadonlyMap<string, any>, ReadonlyMap<string, any>>>;
|
|
44
|
+
markers: Readonly<Ref<ReadonlyMap<string, any>, ReadonlyMap<string, any>>>;
|
|
45
|
+
dispose: () => void;
|
|
46
|
+
};
|
|
47
|
+
/** 使用地图上下文 - 返回 Ref */
|
|
48
|
+
export declare function useMap(): Ref<MapContext | null>;
|
|
49
|
+
/** 使用地图状态 */
|
|
50
|
+
export declare function useMapState(): Ref<ReturnType<typeof createMapState> | null>;
|
|
51
|
+
/** 使用视图状态 */
|
|
52
|
+
export declare function useViewState(): {
|
|
53
|
+
view: import('vue').ComputedRef<Readonly<Ref<{
|
|
54
|
+
readonly center: {
|
|
55
|
+
readonly lng: number;
|
|
56
|
+
readonly lat: number;
|
|
57
|
+
readonly wrap: () => import('@gis_victory/mapbox-gl').LngLat;
|
|
58
|
+
readonly toArray: () => [number, number];
|
|
59
|
+
readonly toString: () => string;
|
|
60
|
+
readonly distanceTo: (lngLat: import('@gis_victory/mapbox-gl').LngLat) => number;
|
|
61
|
+
readonly toBounds: (radius?: number) => import('@gis_victory/mapbox-gl').LngLatBounds;
|
|
62
|
+
readonly toEcef: (altitude: number) => [number, number, number];
|
|
63
|
+
};
|
|
64
|
+
readonly zoom: number;
|
|
65
|
+
readonly pitch: number;
|
|
66
|
+
readonly bearing: number;
|
|
67
|
+
readonly padding?: any;
|
|
68
|
+
}, {
|
|
69
|
+
readonly center: {
|
|
70
|
+
readonly lng: number;
|
|
71
|
+
readonly lat: number;
|
|
72
|
+
readonly wrap: () => import('@gis_victory/mapbox-gl').LngLat;
|
|
73
|
+
readonly toArray: () => [number, number];
|
|
74
|
+
readonly toString: () => string;
|
|
75
|
+
readonly distanceTo: (lngLat: import('@gis_victory/mapbox-gl').LngLat) => number;
|
|
76
|
+
readonly toBounds: (radius?: number) => import('@gis_victory/mapbox-gl').LngLatBounds;
|
|
77
|
+
readonly toEcef: (altitude: number) => [number, number, number];
|
|
78
|
+
};
|
|
79
|
+
readonly zoom: number;
|
|
80
|
+
readonly pitch: number;
|
|
81
|
+
readonly bearing: number;
|
|
82
|
+
readonly padding?: any;
|
|
83
|
+
}>> | undefined>;
|
|
84
|
+
center: import('vue').ComputedRef<{
|
|
85
|
+
readonly lng: number;
|
|
86
|
+
readonly lat: number;
|
|
87
|
+
readonly wrap: () => import('@gis_victory/mapbox-gl').LngLat;
|
|
88
|
+
readonly toArray: () => [number, number];
|
|
89
|
+
readonly toString: () => string;
|
|
90
|
+
readonly distanceTo: (lngLat: import('@gis_victory/mapbox-gl').LngLat) => number;
|
|
91
|
+
readonly toBounds: (radius?: number) => import('@gis_victory/mapbox-gl').LngLatBounds;
|
|
92
|
+
readonly toEcef: (altitude: number) => [number, number, number];
|
|
93
|
+
} | undefined>;
|
|
94
|
+
zoom: import('vue').ComputedRef<number | undefined>;
|
|
95
|
+
pitch: import('vue').ComputedRef<number | undefined>;
|
|
96
|
+
bearing: import('vue').ComputedRef<number | undefined>;
|
|
97
|
+
};
|
|
98
|
+
/** 使用地图事件 */
|
|
99
|
+
export declare function useMapEvent<K extends keyof CoreMapEvents>(event: K, handler: (payload: CoreMapEvents[K]) => void): () => void;
|
|
100
|
+
/** 使用地图就绪事件 */
|
|
101
|
+
export declare function useMapReady(callback: (context: MapContext) => void): void;
|
|
102
|
+
/** 地图提供者
|
|
103
|
+
* 在应用或组件树的顶层使用
|
|
104
|
+
*/
|
|
105
|
+
export declare function provideMap(context: MapContext): void;
|
|
106
|
+
/** 安装地图插件
|
|
107
|
+
* 用于 Vue app.use()
|
|
108
|
+
*/
|
|
109
|
+
export declare function installMapPlugin(context: MapContext): {
|
|
110
|
+
install(app: App): void;
|
|
111
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { MarkerConfig, MarkerEntity, EntityId, GeoCoordinate } from '../domain';
|
|
3
|
+
/** 标记选项 */
|
|
4
|
+
export interface UseMarkerOptions {
|
|
5
|
+
/** 是否自动添加到地图 */
|
|
6
|
+
autoAdd?: boolean;
|
|
7
|
+
/** 初始可见性 */
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
/** 是否可拖拽 */
|
|
10
|
+
draggable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** 使用单个标记 */
|
|
13
|
+
export declare function useMarker(markerId: MaybeRefOrGetter<EntityId>): {
|
|
14
|
+
marker: import('vue').ComputedRef<MarkerEntity | undefined>;
|
|
15
|
+
state: import('vue').ComputedRef<any>;
|
|
16
|
+
position: import('vue').WritableComputedRef<GeoCoordinate | undefined, GeoCoordinate | undefined>;
|
|
17
|
+
visible: import('vue').WritableComputedRef<any, boolean>;
|
|
18
|
+
draggable: import('vue').ComputedRef<boolean>;
|
|
19
|
+
dragging: import('vue').ComputedRef<boolean>;
|
|
20
|
+
popupVisible: import('vue').ComputedRef<boolean>;
|
|
21
|
+
exists: import('vue').ComputedRef<boolean>;
|
|
22
|
+
show: () => void;
|
|
23
|
+
hide: () => void;
|
|
24
|
+
toggle: () => any;
|
|
25
|
+
remove: () => any;
|
|
26
|
+
setPosition: (lng: number, lat: number) => void;
|
|
27
|
+
moveTo: (lng: number, lat: number, animate?: boolean) => void;
|
|
28
|
+
openPopup: () => void;
|
|
29
|
+
closePopup: () => void;
|
|
30
|
+
togglePopup: () => any;
|
|
31
|
+
};
|
|
32
|
+
/** 使用标记列表 */
|
|
33
|
+
export declare function useMarkers(): {
|
|
34
|
+
markers: import('vue').ComputedRef<any>;
|
|
35
|
+
markerStates: any;
|
|
36
|
+
visibleMarkers: import('vue').ComputedRef<any>;
|
|
37
|
+
count: import('vue').ComputedRef<any>;
|
|
38
|
+
addMarker: (config: MarkerConfig) => any;
|
|
39
|
+
removeMarker: (markerId: EntityId) => any;
|
|
40
|
+
removeAll: () => void;
|
|
41
|
+
showAll: () => void;
|
|
42
|
+
hideAll: () => void;
|
|
43
|
+
getMarker: (markerId: EntityId) => any;
|
|
44
|
+
getMarkersInBounds: (bounds: [[number, number], [number, number]]) => any;
|
|
45
|
+
};
|
|
46
|
+
/** 创建并管理标记 */
|
|
47
|
+
export declare function useMarkerManager(config: MaybeRefOrGetter<MarkerConfig>, options?: UseMarkerOptions): {
|
|
48
|
+
markerId: Readonly<import('vue').Ref<string | null, string | null>>;
|
|
49
|
+
isAdded: Readonly<import('vue').Ref<boolean, boolean>>;
|
|
50
|
+
marker: import('vue').ComputedRef<MarkerEntity | undefined>;
|
|
51
|
+
position: import('vue').ComputedRef<import('vue').WritableComputedRef<GeoCoordinate | undefined, GeoCoordinate | undefined> | undefined>;
|
|
52
|
+
visible: import('vue').ComputedRef<import('vue').WritableComputedRef<any, boolean> | undefined>;
|
|
53
|
+
popupVisible: import('vue').ComputedRef<import('vue').ComputedRef<boolean> | undefined>;
|
|
54
|
+
remove: () => void;
|
|
55
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { MeasureType, MeasureResult, CoordinateType, DistanceUnit, AreaUnit } from '../manager/mapbox/MeasureManager';
|
|
3
|
+
/** 测量选项 */
|
|
4
|
+
export interface UseMeasureOptions {
|
|
5
|
+
/** 测量完成回调 */
|
|
6
|
+
onMeasure?: (result: MeasureResult) => void;
|
|
7
|
+
/** 坐标类型:经纬度或墨卡托投影 */
|
|
8
|
+
coordinateType?: CoordinateType;
|
|
9
|
+
/** 经纬度小数位数,默认6位 */
|
|
10
|
+
lnglatDecimal?: number;
|
|
11
|
+
/** 墨卡托投影小数位数,默认2位 */
|
|
12
|
+
mercatorDecimal?: number;
|
|
13
|
+
/** 距离单位,默认自动 */
|
|
14
|
+
distanceUnit?: DistanceUnit;
|
|
15
|
+
/** 面积单位,默认自动 */
|
|
16
|
+
areaUnit?: AreaUnit;
|
|
17
|
+
}
|
|
18
|
+
/** useMeasure 返回值 */
|
|
19
|
+
export interface UseMeasureReturn {
|
|
20
|
+
/** 是否正在测量 */
|
|
21
|
+
isMeasuring: Ref<boolean>;
|
|
22
|
+
/** 当前测量类型 */
|
|
23
|
+
measureType: Ref<MeasureType | 'none'>;
|
|
24
|
+
/** 测量结果数量 */
|
|
25
|
+
count: Ref<number>;
|
|
26
|
+
/** 开始测量 */
|
|
27
|
+
startMeasure: (type: MeasureType) => void;
|
|
28
|
+
/** 停止测量 */
|
|
29
|
+
stopMeasure: () => void;
|
|
30
|
+
/** 清除当前测量 */
|
|
31
|
+
clearMeasuring: () => void;
|
|
32
|
+
/** 获取所有结果 */
|
|
33
|
+
getAll: () => MeasureResult[];
|
|
34
|
+
/** 获取指定结果 */
|
|
35
|
+
get: (id: string) => MeasureResult | undefined;
|
|
36
|
+
/** 删除指定结果 */
|
|
37
|
+
delete: (id: string) => boolean;
|
|
38
|
+
/** 删除所有结果 */
|
|
39
|
+
clear: () => void;
|
|
40
|
+
/** 更新配置 */
|
|
41
|
+
updateOptions: (options: Partial<UseMeasureOptions>) => void;
|
|
42
|
+
/** 设置测量完成回调 */
|
|
43
|
+
onMeasure: (callback: (result: MeasureResult) => void) => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 使用地图测量功能
|
|
47
|
+
* @param options 回调选项
|
|
48
|
+
*/
|
|
49
|
+
export declare function useMeasure(options?: UseMeasureOptions): UseMeasureReturn;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as QuickSearchManager } from '../manager/QuickSearchManager';
|
|
2
|
+
import { SearchResult, SearchOptions } from '../types/IEvents';
|
|
3
|
+
export interface UseSearchReturn {
|
|
4
|
+
searchManager: QuickSearchManager | null;
|
|
5
|
+
keyword: string;
|
|
6
|
+
searching: boolean;
|
|
7
|
+
results: SearchResult[];
|
|
8
|
+
search: (keyword: string, options?: SearchOptions) => Promise<SearchResult[]>;
|
|
9
|
+
clearSearch: () => void;
|
|
10
|
+
selectResult: (result: SearchResult) => void;
|
|
11
|
+
history: string[];
|
|
12
|
+
addToHistory: (keyword: string) => void;
|
|
13
|
+
clearHistory: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 地图搜索组合式函数
|
|
17
|
+
* 封装 QuickSearchManager 的功能
|
|
18
|
+
*/
|
|
19
|
+
export declare function useSearch(): UseSearchReturn;
|
|
20
|
+
export default useSearch;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API配置 - 集中管理所有API端点
|
|
3
|
+
* 便于部署配置和环境切换
|
|
4
|
+
*/
|
|
5
|
+
export interface ApiEndpoint {
|
|
6
|
+
path: string;
|
|
7
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ApiConfig {
|
|
11
|
+
baseURL: string;
|
|
12
|
+
timeout: number;
|
|
13
|
+
endpoints: Record<string, string | ApiEndpoint>;
|
|
14
|
+
}
|
|
15
|
+
declare const API_CONFIG: ApiConfig;
|
|
16
|
+
/**
|
|
17
|
+
* 获取API端点URL
|
|
18
|
+
*/
|
|
19
|
+
export declare const getEndpoint: (key: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* 获取完整URL
|
|
22
|
+
*/
|
|
23
|
+
export declare const getFullUrl: (key: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* 设置baseURL
|
|
26
|
+
*/
|
|
27
|
+
export declare const setBaseURL: (url: string) => void;
|
|
28
|
+
/**
|
|
29
|
+
* 设置超时时间
|
|
30
|
+
*/
|
|
31
|
+
export declare const setTimeout: (ms: number) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 自定义端点
|
|
34
|
+
*/
|
|
35
|
+
export declare const setEndpoint: (key: string, path: string) => void;
|
|
36
|
+
/**
|
|
37
|
+
* 获取完整配置
|
|
38
|
+
*/
|
|
39
|
+
export declare const getConfig: () => ApiConfig;
|
|
40
|
+
export default API_CONFIG;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { GISMapOptions, GISMapStyleConfig } from '../types/IGISMap';
|
|
2
|
+
import { LayerConfig } from '../types/IState';
|
|
3
|
+
/**
|
|
4
|
+
* 图标配置
|
|
5
|
+
*/
|
|
6
|
+
export interface IconConfig {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
url: string;
|
|
10
|
+
size?: [number, number];
|
|
11
|
+
anchor?: 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 模板配置
|
|
15
|
+
*/
|
|
16
|
+
export interface TemplateConfig {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
header?: string;
|
|
20
|
+
body?: string;
|
|
21
|
+
footer?: string;
|
|
22
|
+
style?: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 控件配置
|
|
26
|
+
*/
|
|
27
|
+
export interface ControlConfig {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
30
|
+
options?: Record<string, any>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* GISMap 完整配置
|
|
34
|
+
*/
|
|
35
|
+
export interface GISMapFullConfig {
|
|
36
|
+
/** 地图基础配置 */
|
|
37
|
+
map: Partial<GISMapOptions>;
|
|
38
|
+
/** 样式配置 */
|
|
39
|
+
styles: GISMapStyleConfig;
|
|
40
|
+
/** 默认图层 */
|
|
41
|
+
defaultLayers: LayerConfig[];
|
|
42
|
+
/** 图标配置 */
|
|
43
|
+
icons: IconConfig[];
|
|
44
|
+
/** 模板配置 */
|
|
45
|
+
templates: TemplateConfig[];
|
|
46
|
+
/** 控件配置 */
|
|
47
|
+
controls: {
|
|
48
|
+
navigation?: ControlConfig;
|
|
49
|
+
scale?: ControlConfig;
|
|
50
|
+
fullscreen?: ControlConfig;
|
|
51
|
+
geolocate?: ControlConfig;
|
|
52
|
+
attribution?: ControlConfig;
|
|
53
|
+
};
|
|
54
|
+
/** TDT 配置 */
|
|
55
|
+
tdt: {
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
token: string;
|
|
58
|
+
defaultLayer: 'vec' | 'img' | 'ter';
|
|
59
|
+
};
|
|
60
|
+
/** 地形配置 */
|
|
61
|
+
terrain: {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
exaggeration: number;
|
|
64
|
+
source?: any;
|
|
65
|
+
};
|
|
66
|
+
/** 交互配置 */
|
|
67
|
+
interaction: {
|
|
68
|
+
doubleClickZoom: boolean;
|
|
69
|
+
dragPan: boolean;
|
|
70
|
+
dragRotate: boolean;
|
|
71
|
+
scrollZoom: boolean;
|
|
72
|
+
touchZoomRotate: boolean;
|
|
73
|
+
keyboard: boolean;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 默认配置
|
|
78
|
+
*/
|
|
79
|
+
export declare const defaultConfig: GISMapFullConfig;
|
|
80
|
+
/**
|
|
81
|
+
* 配置管理器
|
|
82
|
+
*/
|
|
83
|
+
declare class ConfigManager {
|
|
84
|
+
private config;
|
|
85
|
+
private listeners;
|
|
86
|
+
constructor();
|
|
87
|
+
/**
|
|
88
|
+
* 获取完整配置
|
|
89
|
+
*/
|
|
90
|
+
getConfig(): GISMapFullConfig;
|
|
91
|
+
/**
|
|
92
|
+
* 获取地图配置
|
|
93
|
+
*/
|
|
94
|
+
getMapConfig(): Partial<GISMapOptions>;
|
|
95
|
+
/**
|
|
96
|
+
* 获取样式配置
|
|
97
|
+
*/
|
|
98
|
+
getStyleConfig(): GISMapStyleConfig;
|
|
99
|
+
/**
|
|
100
|
+
* 获取图标配置
|
|
101
|
+
*/
|
|
102
|
+
getIconConfig(id: string): IconConfig | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* 获取所有图标
|
|
105
|
+
*/
|
|
106
|
+
getAllIcons(): IconConfig[];
|
|
107
|
+
/**
|
|
108
|
+
* 获取模板配置
|
|
109
|
+
*/
|
|
110
|
+
getTemplateConfig(id: string): TemplateConfig | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* 获取所有模板
|
|
113
|
+
*/
|
|
114
|
+
getAllTemplates(): TemplateConfig[];
|
|
115
|
+
/**
|
|
116
|
+
* 更新配置
|
|
117
|
+
*/
|
|
118
|
+
updateConfig(partial: Partial<GISMapFullConfig>): void;
|
|
119
|
+
/**
|
|
120
|
+
* 设置地图配置
|
|
121
|
+
*/
|
|
122
|
+
setMapConfig(mapConfig: Partial<GISMapOptions>): void;
|
|
123
|
+
/**
|
|
124
|
+
* 添加图标
|
|
125
|
+
*/
|
|
126
|
+
addIcon(icon: IconConfig): void;
|
|
127
|
+
/**
|
|
128
|
+
* 添加模板
|
|
129
|
+
*/
|
|
130
|
+
addTemplate(template: TemplateConfig): void;
|
|
131
|
+
/**
|
|
132
|
+
* 加载配置(从 JSON 文件或对象)
|
|
133
|
+
*/
|
|
134
|
+
loadConfig(config: Partial<GISMapFullConfig> | string): void;
|
|
135
|
+
/**
|
|
136
|
+
* 重置为默认配置
|
|
137
|
+
*/
|
|
138
|
+
reset(): void;
|
|
139
|
+
/**
|
|
140
|
+
* 订阅配置变更
|
|
141
|
+
*/
|
|
142
|
+
subscribe(listener: (config: GISMapFullConfig) => void): () => void;
|
|
143
|
+
/**
|
|
144
|
+
* 通知所有监听器
|
|
145
|
+
*/
|
|
146
|
+
private notifyListeners;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 全局配置管理器实例
|
|
150
|
+
*/
|
|
151
|
+
export declare const configManager: ConfigManager;
|
|
152
|
+
/**
|
|
153
|
+
* 获取配置管理器
|
|
154
|
+
*/
|
|
155
|
+
export declare function useConfig(): ConfigManager;
|
|
156
|
+
export default configManager;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { IManager, ManagerOptions } from '../types/IManager';
|
|
2
|
+
type ManagerFactory = (map: any, ...args: any[]) => any;
|
|
3
|
+
/**
|
|
4
|
+
* Manager 注册中心类
|
|
5
|
+
*/
|
|
6
|
+
export declare class ManagerRegistry {
|
|
7
|
+
private map;
|
|
8
|
+
private instances;
|
|
9
|
+
private initialized;
|
|
10
|
+
private enabledManagers;
|
|
11
|
+
tdtToken?: string;
|
|
12
|
+
constructor(map: any, tdtToken?: string);
|
|
13
|
+
/**
|
|
14
|
+
* 注册 Manager(静态方法,全局注册)
|
|
15
|
+
*/
|
|
16
|
+
static register(name: string, factory: ManagerFactory, options?: ManagerOptions): void;
|
|
17
|
+
/**
|
|
18
|
+
* 获取已注册的 Manager 名称列表
|
|
19
|
+
*/
|
|
20
|
+
static getRegisteredNames(): string[];
|
|
21
|
+
/**
|
|
22
|
+
* 实例方法:注册 Manager(实例级注册)
|
|
23
|
+
*/
|
|
24
|
+
register(name: string, factory: ManagerFactory, options?: ManagerOptions): void;
|
|
25
|
+
/**
|
|
26
|
+
* 获取 Manager
|
|
27
|
+
*/
|
|
28
|
+
get<T extends IManager = any>(name: string): T | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* 获取所有 Manager
|
|
31
|
+
*/
|
|
32
|
+
getAll(): Map<string, IManager>;
|
|
33
|
+
/**
|
|
34
|
+
* 检查 Manager 是否存在
|
|
35
|
+
*/
|
|
36
|
+
has(name: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 移除 Manager
|
|
39
|
+
*/
|
|
40
|
+
unregister(name: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* 初始化所有已注册的 Manager
|
|
43
|
+
* 按依赖顺序和优先级初始化
|
|
44
|
+
*/
|
|
45
|
+
initializeAll(): this;
|
|
46
|
+
/**
|
|
47
|
+
* 销毁所有 Manager
|
|
48
|
+
*/
|
|
49
|
+
disposeAll(): void;
|
|
50
|
+
/**
|
|
51
|
+
* 获取 Manager 名称列表
|
|
52
|
+
*/
|
|
53
|
+
getNames(): string[];
|
|
54
|
+
/**
|
|
55
|
+
* 启用 Manager
|
|
56
|
+
*/
|
|
57
|
+
enable(name: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* 禁用 Manager
|
|
60
|
+
*/
|
|
61
|
+
disable(name: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* 检查 Manager 是否启用
|
|
64
|
+
*/
|
|
65
|
+
isEnabled(name: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 获取启用的 Manager 列表
|
|
68
|
+
*/
|
|
69
|
+
getEnabled(): string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 创建 Manager 注册中心
|
|
73
|
+
*/
|
|
74
|
+
export declare function createManagerRegistry(map: any): ManagerRegistry;
|
|
75
|
+
export default ManagerRegistry;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IPlugin, IPluginRegistry, IGISMap } from '../types/IGISMap';
|
|
2
|
+
import { IManager } from '../types/IManager';
|
|
3
|
+
/**
|
|
4
|
+
* 插件注册表
|
|
5
|
+
*/
|
|
6
|
+
export declare class PluginRegistry implements IPluginRegistry {
|
|
7
|
+
private plugins;
|
|
8
|
+
private dependencies;
|
|
9
|
+
private map;
|
|
10
|
+
constructor(map: IGISMap);
|
|
11
|
+
/**
|
|
12
|
+
* 使用插件
|
|
13
|
+
*/
|
|
14
|
+
use(plugin: IPlugin, options?: any): void;
|
|
15
|
+
/**
|
|
16
|
+
* 卸载插件
|
|
17
|
+
*/
|
|
18
|
+
unuse(name: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* 获取插件
|
|
21
|
+
*/
|
|
22
|
+
get(name: string): IPlugin | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* 检查插件是否已安装
|
|
25
|
+
*/
|
|
26
|
+
has(name: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 获取所有插件
|
|
29
|
+
*/
|
|
30
|
+
getAll(): Map<string, IPlugin>;
|
|
31
|
+
/**
|
|
32
|
+
* 获取插件依赖
|
|
33
|
+
*/
|
|
34
|
+
getDependencies(name: string): string[];
|
|
35
|
+
/**
|
|
36
|
+
* 卸载所有插件
|
|
37
|
+
*/
|
|
38
|
+
unuseAll(): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 基础插件类
|
|
42
|
+
* 提供插件的通用实现
|
|
43
|
+
*/
|
|
44
|
+
export declare abstract class BasePlugin implements IPlugin {
|
|
45
|
+
abstract readonly name: string;
|
|
46
|
+
abstract readonly version: string;
|
|
47
|
+
dependencies: string[];
|
|
48
|
+
abstract install(context: IGISMap, options?: any): void;
|
|
49
|
+
uninstall?(context: IGISMap): void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 创建插件注册表
|
|
53
|
+
*/
|
|
54
|
+
export declare function createPluginRegistry(map: IGISMap): IPluginRegistry;
|
|
55
|
+
/**
|
|
56
|
+
* 插件管理器 - 整合 Manager 和 Plugin
|
|
57
|
+
* Manager 可以作为插件注册
|
|
58
|
+
*/
|
|
59
|
+
export declare class PluginManager {
|
|
60
|
+
private pluginRegistry;
|
|
61
|
+
constructor(map: IGISMap);
|
|
62
|
+
/**
|
|
63
|
+
* 注册 Manager 作为插件
|
|
64
|
+
*/
|
|
65
|
+
registerManagerAsPlugin(managerName: string, managerFactory: () => IManager): void;
|
|
66
|
+
/**
|
|
67
|
+
* 获取插件注册表
|
|
68
|
+
*/
|
|
69
|
+
getPluginRegistry(): IPluginRegistry;
|
|
70
|
+
}
|
|
71
|
+
export default PluginRegistry;
|