ym-giswidget-2d 1.0.78 → 1.0.80
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/API.md +399 -0
- package/README.md +37 -19
- package/components/address-search/AddressSearch.vue.d.ts +3 -0
- package/components/address-search/AddressSearch.vue.js +1 -1
- package/components/address-search/AddressSearch.vue2.js +62 -25
- package/components/address-search/index.css +17 -17
- package/components/address-search/index.d.ts +3 -0
- package/components/difference/Difference.vue.js +1 -1
- package/components/draw/Draw.vue.js +14 -5
- package/components/export/Export.vue.js +1 -1
- package/components/export/Export.vue2.js +1 -0
- package/components/export/index.css +1 -1
- package/components/heatmap/Heatmap.vue.d.ts +1 -1
- package/components/heatmap/Heatmap.vue.js +1 -1
- package/components/heatmap/Heatmap.vue2.js +135 -132
- package/components/heatmap/index.css +17 -3
- package/components/horizontally-top-toolbar/HorizontallyTopToolbar.vue2.js +1 -1
- package/components/modify/Modify.vue.d.ts +1 -4
- package/components/modify/Modify.vue.js +0 -1
- package/components/modify/index.d.ts +1 -5
- package/components/multi-screen/MultiScreen.vue.js +1 -1
- package/components/multi-screen/index.css +10 -3
- package/components/repair/Repair.vue.d.ts +142 -0
- package/components/repair/Repair.vue.js +76 -0
- package/components/repair/Repair.vue2.js +4 -0
- package/components/repair/index.d.ts +142 -0
- package/components/repair/index.js +7 -0
- package/components/snap/Snap.vue.js +7 -1
- package/components/swipe-layer/SwipeLayer.vue.d.ts +4 -1
- package/components/swipe-layer/SwipeLayer.vue.js +9 -7
- package/components/swipe-layer/index.d.ts +5 -1
- package/config/Config.d.ts +8 -0
- package/config/Config.js +2 -0
- package/http/poi.d.ts +22 -1
- package/http/poi.js +61 -9
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +2 -2
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
.multi-screen-container[data-v-
|
|
1
|
+
.multi-screen-container[data-v-33476129] {
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
5
5
|
}
|
|
6
|
-
.multi-screen-container .multi-screen[data-v-
|
|
6
|
+
.multi-screen-container .multi-screen[data-v-33476129] {
|
|
7
|
+
position: relative;
|
|
7
8
|
border: 1px solid black;
|
|
9
|
+
overflow: hidden;
|
|
8
10
|
}
|
|
9
|
-
.multi-screen-container .multi-screen .multi-screen__map[data-v-
|
|
11
|
+
.multi-screen-container .multi-screen .multi-screen__map[data-v-33476129] {
|
|
10
12
|
width: 100%;
|
|
11
13
|
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
.multi-screen-container .multi-screen[data-v-33476129] .toc-card {
|
|
16
|
+
left: 10px;
|
|
17
|
+
top: 10px;
|
|
18
|
+
z-index: 2;
|
|
12
19
|
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { default as OLMap } from 'ym-gis-2d/mapView/Map';
|
|
2
|
+
import { default as Geometry } from 'ol/geom/Geometry';
|
|
3
|
+
import { default as Feature } from 'ym-gis-2d/entity/Feature';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
map: OLMap;
|
|
6
|
+
showLoading?: boolean;
|
|
7
|
+
fieldName?: string;
|
|
8
|
+
fieldValues?: any[];
|
|
9
|
+
};
|
|
10
|
+
declare function setFeatures(features: Feature[]): void;
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
12
|
+
setFeatures: typeof setFeatures;
|
|
13
|
+
features: {
|
|
14
|
+
isSelected?: boolean | undefined;
|
|
15
|
+
fromType?: "draw" | "import" | "cut" | "copy" | "union" | "identify" | "measure" | undefined;
|
|
16
|
+
layerId?: string | undefined;
|
|
17
|
+
tag?: string | undefined;
|
|
18
|
+
tempLayer?: {
|
|
19
|
+
getRenderBuffer: () => number | undefined;
|
|
20
|
+
getRenderOrder: () => (arg0: import('ol').default, arg1: import('ol').default) => number | null | undefined;
|
|
21
|
+
getStyle: () => import('ol/style/Style').StyleLike | import('ol/style/flat').FlatStyleLike | null | undefined;
|
|
22
|
+
getStyleFunction: () => import('ol/style/Style').StyleFunction | undefined;
|
|
23
|
+
getUpdateWhileAnimating: () => boolean;
|
|
24
|
+
getUpdateWhileInteracting: () => boolean;
|
|
25
|
+
setRenderOrder: (renderOrder: import('ol/render').OrderFunction | null | undefined) => void;
|
|
26
|
+
setStyle: (style?: import('ol/style/Style').StyleLike | import('ol/style/flat').FlatStyleLike | null | undefined) => void;
|
|
27
|
+
on: import('ol/layer/Layer').LayerOnSignature<import('ol/events').EventsKey>;
|
|
28
|
+
once: import('ol/layer/Layer').LayerOnSignature<import('ol/events').EventsKey>;
|
|
29
|
+
un: import('ol/layer/Layer').LayerOnSignature<void>;
|
|
30
|
+
render: (frameState: import('ol/Map').FrameState | null, target: HTMLElement) => HTMLElement | null;
|
|
31
|
+
getSource: () => import('ol/source').Vector<import('ol').Feature<Geometry>> | null;
|
|
32
|
+
getRenderSource: () => import('ol/source').Vector<import('ol').Feature<Geometry>> | null;
|
|
33
|
+
getFeatures: (pixel: import('ol/pixel').Pixel) => Promise<Array<import('ol/Feature').FeatureLike>>;
|
|
34
|
+
getData: (pixel: import('ol/pixel').Pixel) => Uint8ClampedArray | Uint8Array | Float32Array | DataView | null;
|
|
35
|
+
isVisible: (view?: import('ol').View | import('ol/View').ViewStateLayerStateExtent | undefined) => boolean;
|
|
36
|
+
getAttributions: (view?: import('ol').View | import('ol/View').ViewStateLayerStateExtent | undefined) => Array<string>;
|
|
37
|
+
unrender: () => void;
|
|
38
|
+
getDeclutter: () => string;
|
|
39
|
+
renderDeclutter: (frameState: import('ol/Map').FrameState, layerState: import('ol/layer/Layer').State) => void;
|
|
40
|
+
renderDeferred: (frameState: import('ol/Map').FrameState) => void;
|
|
41
|
+
setMapInternal: (map: import('ol').default | null) => void;
|
|
42
|
+
getMapInternal: () => import('ol').default | null;
|
|
43
|
+
setMap: (map: import('ol').default | null) => void;
|
|
44
|
+
setSource: (source: import('ol/source').Vector<import('ol').Feature<Geometry>> | null) => void;
|
|
45
|
+
getRenderer: () => import('ol/renderer/canvas/VectorLayer').default | null;
|
|
46
|
+
hasRenderer: () => boolean;
|
|
47
|
+
getBackground: () => import('ol/layer/Base').BackgroundColor | false;
|
|
48
|
+
getClassName: () => string;
|
|
49
|
+
getLayerState: (managed?: boolean | undefined) => import('ol/layer/Layer').State;
|
|
50
|
+
getLayersArray: (array?: import('ol/layer').default<import('ol/source').default, import('ol/renderer/Layer').default<any>>[] | undefined) => Array<import('ol/layer').default>;
|
|
51
|
+
getLayerStatesArray: (states?: import('ol/layer/Layer').State[] | undefined) => Array<import('ol/layer/Layer').State>;
|
|
52
|
+
getExtent: () => import('ol/extent').Extent | undefined;
|
|
53
|
+
getMaxResolution: () => number;
|
|
54
|
+
getMinResolution: () => number;
|
|
55
|
+
getMinZoom: () => number;
|
|
56
|
+
getMaxZoom: () => number;
|
|
57
|
+
getOpacity: () => number;
|
|
58
|
+
getSourceState: () => import('ol/source/Source').State;
|
|
59
|
+
getVisible: () => boolean;
|
|
60
|
+
getZIndex: () => number | undefined;
|
|
61
|
+
setBackground: (background?: import('ol/layer/Base').BackgroundColor | undefined) => void;
|
|
62
|
+
setExtent: (extent: import('ol/extent').Extent | undefined) => void;
|
|
63
|
+
setMaxResolution: (maxResolution: number) => void;
|
|
64
|
+
setMinResolution: (minResolution: number) => void;
|
|
65
|
+
setMaxZoom: (maxZoom: number) => void;
|
|
66
|
+
setMinZoom: (minZoom: number) => void;
|
|
67
|
+
setOpacity: (opacity: number) => void;
|
|
68
|
+
setVisible: (visible: boolean) => void;
|
|
69
|
+
setZIndex: (zindex: number) => void;
|
|
70
|
+
get: (key: string) => any;
|
|
71
|
+
getKeys: () => Array<string>;
|
|
72
|
+
getProperties: () => {
|
|
73
|
+
[x: string]: any;
|
|
74
|
+
};
|
|
75
|
+
getPropertiesInternal: () => {
|
|
76
|
+
[x: string]: any;
|
|
77
|
+
} | null;
|
|
78
|
+
hasProperties: () => boolean;
|
|
79
|
+
notify: (key: string, oldValue: any) => void;
|
|
80
|
+
addChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
81
|
+
removeChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
82
|
+
set: (key: string, value: any, silent?: boolean | undefined) => void;
|
|
83
|
+
setProperties: (values: {
|
|
84
|
+
[x: string]: any;
|
|
85
|
+
}, silent?: boolean | undefined) => void;
|
|
86
|
+
unset: (key: string, silent?: boolean | undefined) => void;
|
|
87
|
+
changed: () => void;
|
|
88
|
+
getRevision: () => number;
|
|
89
|
+
addEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
90
|
+
dispatchEvent: (event: import('ol/events/Event').default | string) => boolean | undefined;
|
|
91
|
+
getListeners: (type: string) => Array<import('ol/events').Listener> | undefined;
|
|
92
|
+
hasListener: (type?: string | undefined) => boolean;
|
|
93
|
+
removeEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
94
|
+
dispose: () => void;
|
|
95
|
+
} | undefined;
|
|
96
|
+
on: import('ol/Feature').FeatureOnSignature<import('ol/events').EventsKey>;
|
|
97
|
+
once: import('ol/Feature').FeatureOnSignature<import('ol/events').EventsKey>;
|
|
98
|
+
un: import('ol/Feature').FeatureOnSignature<void>;
|
|
99
|
+
clone: () => import('ol').Feature<Geometry>;
|
|
100
|
+
getGeometry: () => Geometry | undefined;
|
|
101
|
+
getId: () => number | string | undefined;
|
|
102
|
+
getGeometryName: () => string;
|
|
103
|
+
getStyle: () => import('ol/style/Style').StyleLike | undefined;
|
|
104
|
+
getStyleFunction: () => import('ol/style/Style').StyleFunction | undefined;
|
|
105
|
+
setGeometry: (geometry: Geometry | undefined) => void;
|
|
106
|
+
setStyle: (style?: import('ol/style/Style').StyleLike | undefined) => void;
|
|
107
|
+
setId: (id: number | string | undefined) => void;
|
|
108
|
+
setGeometryName: (name: string) => void;
|
|
109
|
+
get: (key: string) => any;
|
|
110
|
+
getKeys: () => Array<string>;
|
|
111
|
+
getProperties: () => {
|
|
112
|
+
[x: string]: any;
|
|
113
|
+
};
|
|
114
|
+
getPropertiesInternal: () => {
|
|
115
|
+
[x: string]: any;
|
|
116
|
+
} | null;
|
|
117
|
+
hasProperties: () => boolean;
|
|
118
|
+
notify: (key: string, oldValue: any) => void;
|
|
119
|
+
addChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
120
|
+
removeChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
121
|
+
set: (key: string, value: any, silent?: boolean | undefined) => void;
|
|
122
|
+
setProperties: (values: {
|
|
123
|
+
[x: string]: any;
|
|
124
|
+
}, silent?: boolean | undefined) => void;
|
|
125
|
+
unset: (key: string, silent?: boolean | undefined) => void;
|
|
126
|
+
changed: () => void;
|
|
127
|
+
getRevision: () => number;
|
|
128
|
+
addEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
129
|
+
dispatchEvent: (event: import('ol/events/Event').default | string) => boolean | undefined;
|
|
130
|
+
getListeners: (type: string) => Array<import('ol/events').Listener> | undefined;
|
|
131
|
+
hasListener: (type?: string | undefined) => boolean;
|
|
132
|
+
removeEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
133
|
+
dispose: () => void;
|
|
134
|
+
}[] | undefined;
|
|
135
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
136
|
+
activeInteraction: (...args: any[]) => void;
|
|
137
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
138
|
+
onActiveInteraction?: ((...args: any[]) => any) | undefined;
|
|
139
|
+
}>, {
|
|
140
|
+
showLoading: boolean;
|
|
141
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
142
|
+
export default _default;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent, reactive, onMounted, toRaw, onUnmounted } from "vue";
|
|
2
|
+
import Repair from "ym-gis-2d/interaction/Repair";
|
|
3
|
+
import { ElLoading, ElMessage } from "element-plus";
|
|
4
|
+
import FeatureManager from "ym-gis-2d/feature/FeatureManager";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "Repair",
|
|
7
|
+
props: {
|
|
8
|
+
map: {},
|
|
9
|
+
showLoading: { type: Boolean, default: true },
|
|
10
|
+
fieldName: {},
|
|
11
|
+
fieldValues: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["activeInteraction"],
|
|
14
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const emit = __emit;
|
|
17
|
+
const reactiveData = reactive({
|
|
18
|
+
features: []
|
|
19
|
+
});
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
const featureManager = new FeatureManager(props.map);
|
|
22
|
+
const editFeatures = featureManager.getEditFeatures(props.fieldName, props.fieldValues);
|
|
23
|
+
if (!editFeatures || editFeatures.length === 0) {
|
|
24
|
+
emit("activeInteraction", { success: false, message: "请先选择可编辑的地块" });
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
reactiveData.splitTool = new Repair(editFeatures, {
|
|
28
|
+
tipText: "修补线完全穿过面",
|
|
29
|
+
addTempLayer: true
|
|
30
|
+
//是否添加临时图层
|
|
31
|
+
});
|
|
32
|
+
props.map.interactionManager.addInteraction("repair", toRaw(reactiveData.splitTool));
|
|
33
|
+
let loadingInstance;
|
|
34
|
+
reactiveData.splitTool.on("repairStart", (event) => {
|
|
35
|
+
if (props.showLoading) {
|
|
36
|
+
loadingInstance = ElLoading.service({ text: "正在修补...", background: "rgba(0, 0, 0, 0.5)", target: props.map.getTarget() });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
reactiveData.splitTool.on("repaired", (event) => {
|
|
40
|
+
var _a;
|
|
41
|
+
loadingInstance == null ? void 0 : loadingInstance.close();
|
|
42
|
+
if (event.error) {
|
|
43
|
+
ElMessage.error("修补失败:" + event.error);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const features = event.features;
|
|
47
|
+
if (features && features.length > 0) {
|
|
48
|
+
features.forEach((feature) => {
|
|
49
|
+
feature.isSelected = true;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
let editFeatures2 = featureManager.getEditFeatures(props.fieldName, props.fieldValues);
|
|
53
|
+
if (editFeatures2 && editFeatures2.length > 0) {
|
|
54
|
+
(_a = reactiveData.splitTool) == null ? void 0 : _a.setFeatures(editFeatures2);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
onUnmounted(() => {
|
|
59
|
+
props.map.interactionManager.removeInteraction("repair");
|
|
60
|
+
});
|
|
61
|
+
function setFeatures(features) {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = reactiveData.splitTool) == null ? void 0 : _a.setFeatures(features);
|
|
64
|
+
}
|
|
65
|
+
__expose({
|
|
66
|
+
setFeatures,
|
|
67
|
+
features: reactiveData.features
|
|
68
|
+
});
|
|
69
|
+
return (_ctx, _cache) => {
|
|
70
|
+
return null;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
_sfc_main as default
|
|
76
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export declare const Repair: import('../../utils').WithInstall<import('vue').DefineComponent<{
|
|
2
|
+
map: import('ym-gis-2d/mapView/Map').default;
|
|
3
|
+
showLoading?: boolean;
|
|
4
|
+
fieldName?: string;
|
|
5
|
+
fieldValues?: any[];
|
|
6
|
+
}, {
|
|
7
|
+
setFeatures: (features: import('ym-gis-2d/entity/Feature').default[]) => void;
|
|
8
|
+
features: {
|
|
9
|
+
isSelected?: boolean | undefined;
|
|
10
|
+
fromType?: "draw" | "import" | "cut" | "copy" | "union" | "identify" | "measure" | undefined;
|
|
11
|
+
layerId?: string | undefined;
|
|
12
|
+
tag?: string | undefined;
|
|
13
|
+
tempLayer?: {
|
|
14
|
+
getRenderBuffer: () => number | undefined;
|
|
15
|
+
getRenderOrder: () => (arg0: import('ol').default, arg1: import('ol').default) => number | null | undefined;
|
|
16
|
+
getStyle: () => import('ol/style/Style').StyleLike | import('ol/style/flat').FlatStyleLike | null | undefined;
|
|
17
|
+
getStyleFunction: () => import('ol/style/Style').StyleFunction | undefined;
|
|
18
|
+
getUpdateWhileAnimating: () => boolean;
|
|
19
|
+
getUpdateWhileInteracting: () => boolean;
|
|
20
|
+
setRenderOrder: (renderOrder: import('ol/render').OrderFunction | null | undefined) => void;
|
|
21
|
+
setStyle: (style?: import('ol/style/Style').StyleLike | import('ol/style/flat').FlatStyleLike | null | undefined) => void;
|
|
22
|
+
on: import('ol/layer/Layer').LayerOnSignature<import('ol/events').EventsKey>;
|
|
23
|
+
once: import('ol/layer/Layer').LayerOnSignature<import('ol/events').EventsKey>;
|
|
24
|
+
un: import('ol/layer/Layer').LayerOnSignature<void>;
|
|
25
|
+
render: (frameState: import('ol/Map').FrameState | null, target: HTMLElement) => HTMLElement | null;
|
|
26
|
+
getSource: () => import('ol/source').Vector<import('ol').Feature<import('ol/geom').Geometry>> | null;
|
|
27
|
+
getRenderSource: () => import('ol/source').Vector<import('ol').Feature<import('ol/geom').Geometry>> | null;
|
|
28
|
+
getFeatures: (pixel: import('ol/pixel').Pixel) => Promise<Array<import('ol/Feature').FeatureLike>>;
|
|
29
|
+
getData: (pixel: import('ol/pixel').Pixel) => Uint8ClampedArray | Uint8Array | Float32Array | DataView | null;
|
|
30
|
+
isVisible: (view?: import('ol').View | import('ol/View').ViewStateLayerStateExtent | undefined) => boolean;
|
|
31
|
+
getAttributions: (view?: import('ol').View | import('ol/View').ViewStateLayerStateExtent | undefined) => Array<string>;
|
|
32
|
+
unrender: () => void;
|
|
33
|
+
getDeclutter: () => string;
|
|
34
|
+
renderDeclutter: (frameState: import('ol/Map').FrameState, layerState: import('ol/layer/Layer').State) => void;
|
|
35
|
+
renderDeferred: (frameState: import('ol/Map').FrameState) => void;
|
|
36
|
+
setMapInternal: (map: import('ol').default | null) => void;
|
|
37
|
+
getMapInternal: () => import('ol').default | null;
|
|
38
|
+
setMap: (map: import('ol').default | null) => void;
|
|
39
|
+
setSource: (source: import('ol/source').Vector<import('ol').Feature<import('ol/geom').Geometry>> | null) => void;
|
|
40
|
+
getRenderer: () => import('ol/renderer/canvas/VectorLayer').default | null;
|
|
41
|
+
hasRenderer: () => boolean;
|
|
42
|
+
getBackground: () => import('ol/layer/Base').BackgroundColor | false;
|
|
43
|
+
getClassName: () => string;
|
|
44
|
+
getLayerState: (managed?: boolean | undefined) => import('ol/layer/Layer').State;
|
|
45
|
+
getLayersArray: (array?: import('ol/layer').default<import('ol/source').default, import('ol/renderer/Layer').default<any>>[] | undefined) => Array<import('ol/layer').default>;
|
|
46
|
+
getLayerStatesArray: (states?: import('ol/layer/Layer').State[] | undefined) => Array<import('ol/layer/Layer').State>;
|
|
47
|
+
getExtent: () => import('ol/extent').Extent | undefined;
|
|
48
|
+
getMaxResolution: () => number;
|
|
49
|
+
getMinResolution: () => number;
|
|
50
|
+
getMinZoom: () => number;
|
|
51
|
+
getMaxZoom: () => number;
|
|
52
|
+
getOpacity: () => number;
|
|
53
|
+
getSourceState: () => import('ol/source/Source').State;
|
|
54
|
+
getVisible: () => boolean;
|
|
55
|
+
getZIndex: () => number | undefined;
|
|
56
|
+
setBackground: (background?: import('ol/layer/Base').BackgroundColor | undefined) => void;
|
|
57
|
+
setExtent: (extent: import('ol/extent').Extent | undefined) => void;
|
|
58
|
+
setMaxResolution: (maxResolution: number) => void;
|
|
59
|
+
setMinResolution: (minResolution: number) => void;
|
|
60
|
+
setMaxZoom: (maxZoom: number) => void;
|
|
61
|
+
setMinZoom: (minZoom: number) => void;
|
|
62
|
+
setOpacity: (opacity: number) => void;
|
|
63
|
+
setVisible: (visible: boolean) => void;
|
|
64
|
+
setZIndex: (zindex: number) => void;
|
|
65
|
+
get: (key: string) => any;
|
|
66
|
+
getKeys: () => Array<string>;
|
|
67
|
+
getProperties: () => {
|
|
68
|
+
[x: string]: any;
|
|
69
|
+
};
|
|
70
|
+
getPropertiesInternal: () => {
|
|
71
|
+
[x: string]: any;
|
|
72
|
+
} | null;
|
|
73
|
+
hasProperties: () => boolean;
|
|
74
|
+
notify: (key: string, oldValue: any) => void;
|
|
75
|
+
addChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
76
|
+
removeChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
77
|
+
set: (key: string, value: any, silent?: boolean | undefined) => void;
|
|
78
|
+
setProperties: (values: {
|
|
79
|
+
[x: string]: any;
|
|
80
|
+
}, silent?: boolean | undefined) => void;
|
|
81
|
+
unset: (key: string, silent?: boolean | undefined) => void;
|
|
82
|
+
changed: () => void;
|
|
83
|
+
getRevision: () => number;
|
|
84
|
+
addEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
85
|
+
dispatchEvent: (event: import('ol/events/Event').default | string) => boolean | undefined;
|
|
86
|
+
getListeners: (type: string) => Array<import('ol/events').Listener> | undefined;
|
|
87
|
+
hasListener: (type?: string | undefined) => boolean;
|
|
88
|
+
removeEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
89
|
+
dispose: () => void;
|
|
90
|
+
} | undefined;
|
|
91
|
+
on: import('ol/Feature').FeatureOnSignature<import('ol/events').EventsKey>;
|
|
92
|
+
once: import('ol/Feature').FeatureOnSignature<import('ol/events').EventsKey>;
|
|
93
|
+
un: import('ol/Feature').FeatureOnSignature<void>;
|
|
94
|
+
clone: () => import('ol').Feature<import('ol/geom').Geometry>;
|
|
95
|
+
getGeometry: () => import('ol/geom').Geometry | undefined;
|
|
96
|
+
getId: () => number | string | undefined;
|
|
97
|
+
getGeometryName: () => string;
|
|
98
|
+
getStyle: () => import('ol/style/Style').StyleLike | undefined;
|
|
99
|
+
getStyleFunction: () => import('ol/style/Style').StyleFunction | undefined;
|
|
100
|
+
setGeometry: (geometry: import('ol/geom').Geometry | undefined) => void;
|
|
101
|
+
setStyle: (style?: import('ol/style/Style').StyleLike | undefined) => void;
|
|
102
|
+
setId: (id: number | string | undefined) => void;
|
|
103
|
+
setGeometryName: (name: string) => void;
|
|
104
|
+
get: (key: string) => any;
|
|
105
|
+
getKeys: () => Array<string>;
|
|
106
|
+
getProperties: () => {
|
|
107
|
+
[x: string]: any;
|
|
108
|
+
};
|
|
109
|
+
getPropertiesInternal: () => {
|
|
110
|
+
[x: string]: any;
|
|
111
|
+
} | null;
|
|
112
|
+
hasProperties: () => boolean;
|
|
113
|
+
notify: (key: string, oldValue: any) => void;
|
|
114
|
+
addChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
115
|
+
removeChangeListener: (key: string, listener: import('ol/events').Listener) => void;
|
|
116
|
+
set: (key: string, value: any, silent?: boolean | undefined) => void;
|
|
117
|
+
setProperties: (values: {
|
|
118
|
+
[x: string]: any;
|
|
119
|
+
}, silent?: boolean | undefined) => void;
|
|
120
|
+
unset: (key: string, silent?: boolean | undefined) => void;
|
|
121
|
+
changed: () => void;
|
|
122
|
+
getRevision: () => number;
|
|
123
|
+
addEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
124
|
+
dispatchEvent: (event: import('ol/events/Event').default | string) => boolean | undefined;
|
|
125
|
+
getListeners: (type: string) => Array<import('ol/events').Listener> | undefined;
|
|
126
|
+
hasListener: (type?: string | undefined) => boolean;
|
|
127
|
+
removeEventListener: (type: string, listener: import('ol/events').Listener) => void;
|
|
128
|
+
dispose: () => void;
|
|
129
|
+
}[] | undefined;
|
|
130
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
131
|
+
activeInteraction: (...args: any[]) => void;
|
|
132
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
133
|
+
map: import('ym-gis-2d/mapView/Map').default;
|
|
134
|
+
showLoading?: boolean;
|
|
135
|
+
fieldName?: string;
|
|
136
|
+
fieldValues?: any[];
|
|
137
|
+
}> & Readonly<{
|
|
138
|
+
onActiveInteraction?: ((...args: any[]) => any) | undefined;
|
|
139
|
+
}>, {
|
|
140
|
+
showLoading: boolean;
|
|
141
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
|
|
142
|
+
export default Repair;
|
|
@@ -11,8 +11,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
11
|
onMounted(() => {
|
|
12
12
|
const currentLayerInfo = props.map.currentEditLayer;
|
|
13
13
|
const options = props.options || {};
|
|
14
|
+
let geometryType = "polygon";
|
|
14
15
|
if (!options.source && !options.features && currentLayerInfo && currentLayerInfo.geometryType) {
|
|
15
|
-
let geometryType = "polygon";
|
|
16
16
|
switch (currentLayerInfo.geometryType) {
|
|
17
17
|
case 1:
|
|
18
18
|
geometryType = "point";
|
|
@@ -29,6 +29,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
options.source = tempLayer.getSource();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
if (!options.source && !options.features) {
|
|
33
|
+
const tempLayer = getTempLayerByGeometryType(geometryType);
|
|
34
|
+
if (tempLayer && tempLayer.getSource()) {
|
|
35
|
+
options.source = tempLayer.getSource();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
32
38
|
const snap = new Snap(options);
|
|
33
39
|
props.map.interactionManager.addInteraction("snap", snap);
|
|
34
40
|
});
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { default as OLMap } from 'ym-gis-2d/mapView/Map';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
map: OLMap;
|
|
4
|
+
dockedVisible?: 'Left' | 'Right' | 'Bottom' | 'Top';
|
|
4
5
|
};
|
|
5
6
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
7
|
activeInteraction: (...args: any[]) => void;
|
|
7
8
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
9
|
onActiveInteraction?: ((...args: any[]) => any) | undefined;
|
|
9
|
-
}>, {
|
|
10
|
+
}>, {
|
|
11
|
+
dockedVisible: "Left" | "Right" | "Bottom" | "Top";
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
10
13
|
locationRef: ({
|
|
11
14
|
$: import('vue').ComponentInternalInstance;
|
|
12
15
|
$data: {};
|
|
@@ -11,7 +11,8 @@ import SwipeLayerControl from "ym-gis-2d/controls/SwipeLayerControl";
|
|
|
11
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
12
|
__name: "SwipeLayer",
|
|
13
13
|
props: {
|
|
14
|
-
map: {}
|
|
14
|
+
map: {},
|
|
15
|
+
dockedVisible: { default: "Right" }
|
|
15
16
|
},
|
|
16
17
|
emits: ["activeInteraction"],
|
|
17
18
|
setup(__props, { emit: __emit }) {
|
|
@@ -39,12 +40,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
40
|
ElMessage.error("图层不存在");
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
43
|
+
props.map.controlManager.removeControl("swipe");
|
|
44
|
+
reactiveValue.swipeLayerControl = new SwipeLayerControl({
|
|
45
|
+
swipeLayer: layer,
|
|
46
|
+
dockedVisible: props.dockedVisible,
|
|
47
|
+
target: props.map.getTarget()
|
|
48
|
+
});
|
|
49
|
+
props.map.controlManager.addControl("swipe", reactiveValue.swipeLayerControl);
|
|
48
50
|
}
|
|
49
51
|
return (_ctx, _cache) => {
|
|
50
52
|
const _component_el_option = ElOption;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export declare const SwipeLayer: import('../../utils').WithInstall<import('vue').DefineComponent<{
|
|
2
2
|
map: import('ym-gis-2d/mapView/Map').default;
|
|
3
|
+
dockedVisible?: "Left" | "Right" | "Bottom" | "Top";
|
|
3
4
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
5
|
activeInteraction: (...args: any[]) => void;
|
|
5
6
|
}, string, import('vue').PublicProps, Readonly<{
|
|
6
7
|
map: import('ym-gis-2d/mapView/Map').default;
|
|
8
|
+
dockedVisible?: "Left" | "Right" | "Bottom" | "Top";
|
|
7
9
|
}> & Readonly<{
|
|
8
10
|
onActiveInteraction?: ((...args: any[]) => any) | undefined;
|
|
9
|
-
}>, {
|
|
11
|
+
}>, {
|
|
12
|
+
dockedVisible: "Left" | "Right" | "Bottom" | "Top";
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
10
14
|
locationRef: ({
|
|
11
15
|
$: import('vue').ComponentInternalInstance;
|
|
12
16
|
$data: {};
|
package/config/Config.d.ts
CHANGED
package/config/Config.js
CHANGED
package/http/poi.d.ts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
|
+
export type PoiDataSource = "tdt" | "amap" | "baidu";
|
|
2
|
+
export interface IPoiQueryOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 数据源:tdt(天地图) / amap(高德) / baidu(百度)
|
|
5
|
+
*/
|
|
6
|
+
source?: PoiDataSource;
|
|
7
|
+
/**
|
|
8
|
+
* 页码,从 1 开始
|
|
9
|
+
*/
|
|
10
|
+
page?: number;
|
|
11
|
+
/**
|
|
12
|
+
* 每页数量
|
|
13
|
+
*/
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* POI 查询(支持常用数据源切换)
|
|
18
|
+
* @param input 查询关键字
|
|
19
|
+
* @param options 查询参数,支持 source/page/pageSize
|
|
20
|
+
*/
|
|
21
|
+
export declare const getPOIData: (input: string, options?: IPoiQueryOptions) => Promise<import('axios').AxiosResponse<any, any>>;
|
|
1
22
|
/**
|
|
2
23
|
* 使用天地图的POI搜索
|
|
3
24
|
* @param input
|
|
4
25
|
* @returns
|
|
5
26
|
*/
|
|
6
|
-
export declare const getTDTPOIData: (input: string) => Promise<import('axios').AxiosResponse<any, any>>;
|
|
27
|
+
export declare const getTDTPOIData: (input: string, options?: Omit<IPoiQueryOptions, "source">) => Promise<import('axios').AxiosResponse<any, any>>;
|
package/http/poi.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import Config from "../config/Config.js";
|
|
3
3
|
let http = axios.create();
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
function getSafePage(page) {
|
|
5
|
+
if (!page || page < 1) return 1;
|
|
6
|
+
return page;
|
|
7
|
+
}
|
|
8
|
+
function getSafePageSize(pageSize) {
|
|
9
|
+
if (!pageSize || pageSize < 1) return 10;
|
|
10
|
+
return pageSize;
|
|
11
|
+
}
|
|
12
|
+
function buildTdtRequest(input, page, pageSize) {
|
|
13
|
+
const start = (getSafePage(page) - 1) * getSafePageSize(pageSize);
|
|
14
|
+
const params = {
|
|
15
|
+
keyWord: input,
|
|
16
|
+
level: 3,
|
|
17
|
+
mapBound: "73,3,135,54",
|
|
18
|
+
queryType: 4,
|
|
19
|
+
start,
|
|
20
|
+
count: getSafePageSize(pageSize)
|
|
12
21
|
};
|
|
13
22
|
return http.get("https://api.tianditu.gov.cn/v2/search", {
|
|
14
23
|
params: {
|
|
@@ -17,7 +26,50 @@ const getTDTPOIData = (input) => {
|
|
|
17
26
|
type: "query"
|
|
18
27
|
}
|
|
19
28
|
});
|
|
29
|
+
}
|
|
30
|
+
function buildAmapRequest(input, page, pageSize) {
|
|
31
|
+
if (!Config.amapKey) {
|
|
32
|
+
throw new Error("未配置 Config.amapKey");
|
|
33
|
+
}
|
|
34
|
+
return http.get("https://restapi.amap.com/v5/place/text", {
|
|
35
|
+
params: {
|
|
36
|
+
key: Config.amapKey,
|
|
37
|
+
keywords: input,
|
|
38
|
+
region: "全国",
|
|
39
|
+
page_size: getSafePageSize(pageSize),
|
|
40
|
+
page_num: getSafePage(page),
|
|
41
|
+
show_fields: "business,photos,indoor,navi"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function buildBaiduRequest(input, page, pageSize) {
|
|
46
|
+
if (!Config.baiduAk) {
|
|
47
|
+
throw new Error("未配置 Config.baiduAk");
|
|
48
|
+
}
|
|
49
|
+
return http.get("https://api.map.baidu.com/place/v2/suggestion", {
|
|
50
|
+
params: {
|
|
51
|
+
query: input,
|
|
52
|
+
region: "全国",
|
|
53
|
+
city_limit: false,
|
|
54
|
+
output: "json",
|
|
55
|
+
page_size: getSafePageSize(pageSize),
|
|
56
|
+
page_num: getSafePage(page),
|
|
57
|
+
ak: Config.baiduAk
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const getPOIData = (input, options = {}) => {
|
|
62
|
+
const source = options.source || "tdt";
|
|
63
|
+
switch (source) {
|
|
64
|
+
case "amap":
|
|
65
|
+
return buildAmapRequest(input, options.page, options.pageSize);
|
|
66
|
+
case "baidu":
|
|
67
|
+
return buildBaiduRequest(input, options.page, options.pageSize);
|
|
68
|
+
case "tdt":
|
|
69
|
+
default:
|
|
70
|
+
return buildTdtRequest(input, options.page, options.pageSize);
|
|
71
|
+
}
|
|
20
72
|
};
|
|
21
73
|
export {
|
|
22
|
-
|
|
74
|
+
getPOIData
|
|
23
75
|
};
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import { Modify } from "./components/modify/index.js";
|
|
|
23
23
|
import { Heatmap } from "./components/heatmap/index.js";
|
|
24
24
|
import { Snap } from "./components/snap/index.js";
|
|
25
25
|
import { AddressSearch } from "./components/address-search/index.js";
|
|
26
|
+
import { Repair } from "./components/repair/index.js";
|
|
26
27
|
export {
|
|
27
28
|
AddressSearch,
|
|
28
29
|
AreaMeasurement,
|
|
@@ -42,6 +43,7 @@ export {
|
|
|
42
43
|
Modify,
|
|
43
44
|
MousePositon,
|
|
44
45
|
MultiScreen,
|
|
46
|
+
Repair,
|
|
45
47
|
ScaleLine,
|
|
46
48
|
Select,
|
|
47
49
|
Snap,
|