ym-giswidget-2d 1.0.78 → 1.0.79
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/components/draw/Draw.vue.js +14 -5
- 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/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/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, onMounted, onUnmounted } from "vue";
|
|
1
|
+
import { defineComponent, watch, onMounted, onUnmounted } from "vue";
|
|
2
2
|
import Draw from "ym-gis-2d/interaction/Draw";
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "Draw",
|
|
@@ -11,7 +11,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
11
|
setup(__props, { emit: __emit }) {
|
|
12
12
|
const emit = __emit;
|
|
13
13
|
const props = __props;
|
|
14
|
+
watch(() => props.geometryType, (newVal) => {
|
|
15
|
+
init();
|
|
16
|
+
});
|
|
17
|
+
watch(() => props.map.currentEditLayer, (newVal) => {
|
|
18
|
+
init();
|
|
19
|
+
});
|
|
14
20
|
onMounted(() => {
|
|
21
|
+
init();
|
|
22
|
+
});
|
|
23
|
+
onUnmounted(() => {
|
|
24
|
+
props.map.interactionManager.removeInteraction("draw");
|
|
25
|
+
});
|
|
26
|
+
function init() {
|
|
15
27
|
const currentLayerInfo = props.map.currentEditLayer;
|
|
16
28
|
let geometryType = "polygon";
|
|
17
29
|
if (props.geometryType) {
|
|
@@ -49,10 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
61
|
}
|
|
50
62
|
emit("drawEnd", features);
|
|
51
63
|
});
|
|
52
|
-
}
|
|
53
|
-
onUnmounted(() => {
|
|
54
|
-
props.map.interactionManager.removeInteraction("draw");
|
|
55
|
-
});
|
|
64
|
+
}
|
|
56
65
|
function getTempLayerByGeometryType(geometryType) {
|
|
57
66
|
switch (geometryType) {
|
|
58
67
|
case "point":
|
|
@@ -145,7 +145,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
145
145
|
},
|
|
146
146
|
emits: ["loaded"],
|
|
147
147
|
setup(__props, { emit: __emit }) {
|
|
148
|
-
const modules = /* @__PURE__ */ Object.assign({ "../address-search/AddressSearch.vue": () => import("../address-search/AddressSearch.vue.js"), "../address-search/index.ts": () => import("../address-search/index.js"), "../area-measurement/AreaMeasurement.vue": () => import("../area-measurement/AreaMeasurement.vue2.js"), "../area-measurement/index.ts": () => import("../area-measurement/index.js"), "../clear/Clear.vue": () => import("../clear/Clear.vue2.js"), "../clear/index.ts": () => import("../clear/index.js"), "../difference/Difference.vue": () => import("../difference/Difference.vue2.js"), "../difference/index.ts": () => import("../difference/index.js"), "../distance-measurement/DistanceMeasurement.vue": () => import("../distance-measurement/DistanceMeasurement.vue2.js"), "../distance-measurement/index.ts": () => import("../distance-measurement/index.js"), "../draw/Draw.vue": () => import("../draw/Draw.vue2.js"), "../draw/index.ts": () => import("../draw/index.js"), "../export/Export.vue": () => import("../export/Export.vue.js"), "../export/index.ts": () => import("../export/index.js"), "../heatmap/Heatmap.vue": () => import("../heatmap/Heatmap.vue.js"), "../heatmap/index.ts": () => import("../heatmap/index.js"), "./HorizontallyTopToolbar.vue": () => import("./HorizontallyTopToolbar.vue.js"), "./index.ts": () => import("./index.js"), "../identify/Identify.vue": () => import("../identify/Identify.vue2.js"), "../identify/index.ts": () => import("../identify/index.js"), "../import/Import.vue": () => import("../import/Import.vue2.js"), "../import/index.ts": () => import("../import/index.js"), "../layer-switcher/LayerSwitcher.vue": () => import("../layer-switcher/LayerSwitcher.vue.js"), "../layer-switcher/index.ts": () => import("../layer-switcher/index.js"), "../layer-tree/LayerTree.vue": () => import("../layer-tree/LayerTree.vue.js"), "../layer-tree/index.ts": () => import("../layer-tree/index.js"), "../legend/Legend.vue": () => import("../legend/Legend.vue.js"), "../legend/index.ts": () => import("../legend/index.js"), "../location/Location.vue": () => import("../location/Location.vue.js"), "../location/index.ts": () => import("../location/index.js"), "../map-view/MapView.vue": () => import("../map-view/MapView.vue2.js"), "../map-view/index.ts": () => import("../map-view/index.js"), "../modify/Modify.vue": () => import("../modify/Modify.vue2.js"), "../modify/index.ts": () => import("../modify/index.js"), "../mouse-position/MousePositon.vue": () => import("../mouse-position/MousePositon.vue.js"), "../mouse-position/index.ts": () => import("../mouse-position/index.js"), "../multi-screen-panel/PanelMultiScreen.vue": () => import("../multi-screen-panel/PanelMultiScreen.vue.js"), "../multi-screen-panel/index.ts": () => import("../multi-screen-panel/index.js"), "../multi-screen/MultiScreen.vue": () => import("../multi-screen/MultiScreen.vue.js"), "../multi-screen/index.ts": () => import("../multi-screen/index.js"), "../popup/Popup.vue": () => import("../popup/Popup.vue.js"), "../popup/index.ts": () => import("../popup/index.js"), "../scale-line/ScaleLine.vue": () => import("../scale-line/ScaleLine.vue.js"), "../scale-line/index.ts": () => import("../scale-line/index.js"), "../select/Select.vue": () => import("../select/Select.vue2.js"), "../select/index.ts": () => import("../select/index.js"), "../snap/Snap.vue": () => import("../snap/Snap.vue2.js"), "../snap/index.ts": () => import("../snap/index.js"), "../split/Split.vue": () => import("../split/Split.vue2.js"), "../split/index.ts": () => import("../split/index.js"), "../swipe-layer/SwipeLayer.vue": () => import("../swipe-layer/SwipeLayer.vue2.js"), "../swipe-layer/index.ts": () => import("../swipe-layer/index.js"), "../toc-card/TocCard.vue": () => import("../toc-card/TocCard.vue.js"), "../toc-card/index.ts": () => import("../toc-card/index.js") });
|
|
148
|
+
const modules = /* @__PURE__ */ Object.assign({ "../address-search/AddressSearch.vue": () => import("../address-search/AddressSearch.vue.js"), "../address-search/index.ts": () => import("../address-search/index.js"), "../area-measurement/AreaMeasurement.vue": () => import("../area-measurement/AreaMeasurement.vue2.js"), "../area-measurement/index.ts": () => import("../area-measurement/index.js"), "../clear/Clear.vue": () => import("../clear/Clear.vue2.js"), "../clear/index.ts": () => import("../clear/index.js"), "../difference/Difference.vue": () => import("../difference/Difference.vue2.js"), "../difference/index.ts": () => import("../difference/index.js"), "../distance-measurement/DistanceMeasurement.vue": () => import("../distance-measurement/DistanceMeasurement.vue2.js"), "../distance-measurement/index.ts": () => import("../distance-measurement/index.js"), "../draw/Draw.vue": () => import("../draw/Draw.vue2.js"), "../draw/index.ts": () => import("../draw/index.js"), "../export/Export.vue": () => import("../export/Export.vue.js"), "../export/index.ts": () => import("../export/index.js"), "../heatmap/Heatmap.vue": () => import("../heatmap/Heatmap.vue.js"), "../heatmap/index.ts": () => import("../heatmap/index.js"), "./HorizontallyTopToolbar.vue": () => import("./HorizontallyTopToolbar.vue.js"), "./index.ts": () => import("./index.js"), "../identify/Identify.vue": () => import("../identify/Identify.vue2.js"), "../identify/index.ts": () => import("../identify/index.js"), "../import/Import.vue": () => import("../import/Import.vue2.js"), "../import/index.ts": () => import("../import/index.js"), "../layer-switcher/LayerSwitcher.vue": () => import("../layer-switcher/LayerSwitcher.vue.js"), "../layer-switcher/index.ts": () => import("../layer-switcher/index.js"), "../layer-tree/LayerTree.vue": () => import("../layer-tree/LayerTree.vue.js"), "../layer-tree/index.ts": () => import("../layer-tree/index.js"), "../legend/Legend.vue": () => import("../legend/Legend.vue.js"), "../legend/index.ts": () => import("../legend/index.js"), "../location/Location.vue": () => import("../location/Location.vue.js"), "../location/index.ts": () => import("../location/index.js"), "../map-view/MapView.vue": () => import("../map-view/MapView.vue2.js"), "../map-view/index.ts": () => import("../map-view/index.js"), "../modify/Modify.vue": () => import("../modify/Modify.vue2.js"), "../modify/index.ts": () => import("../modify/index.js"), "../mouse-position/MousePositon.vue": () => import("../mouse-position/MousePositon.vue.js"), "../mouse-position/index.ts": () => import("../mouse-position/index.js"), "../multi-screen-panel/PanelMultiScreen.vue": () => import("../multi-screen-panel/PanelMultiScreen.vue.js"), "../multi-screen-panel/index.ts": () => import("../multi-screen-panel/index.js"), "../multi-screen/MultiScreen.vue": () => import("../multi-screen/MultiScreen.vue.js"), "../multi-screen/index.ts": () => import("../multi-screen/index.js"), "../popup/Popup.vue": () => import("../popup/Popup.vue.js"), "../popup/index.ts": () => import("../popup/index.js"), "../repair/Repair.vue": () => import("../repair/Repair.vue2.js"), "../repair/index.ts": () => import("../repair/index.js"), "../scale-line/ScaleLine.vue": () => import("../scale-line/ScaleLine.vue.js"), "../scale-line/index.ts": () => import("../scale-line/index.js"), "../select/Select.vue": () => import("../select/Select.vue2.js"), "../select/index.ts": () => import("../select/index.js"), "../snap/Snap.vue": () => import("../snap/Snap.vue2.js"), "../snap/index.ts": () => import("../snap/index.js"), "../split/Split.vue": () => import("../split/Split.vue2.js"), "../split/index.ts": () => import("../split/index.js"), "../swipe-layer/SwipeLayer.vue": () => import("../swipe-layer/SwipeLayer.vue2.js"), "../swipe-layer/index.ts": () => import("../swipe-layer/index.js"), "../toc-card/TocCard.vue": () => import("../toc-card/TocCard.vue.js"), "../toc-card/index.ts": () => import("../toc-card/index.js") });
|
|
149
149
|
const emit = __emit;
|
|
150
150
|
const props = __props;
|
|
151
151
|
const reactiveValue = reactive({
|
|
@@ -3,7 +3,6 @@ import { default as Geometry } from 'ol/geom/Geometry';
|
|
|
3
3
|
import { default as Feature } from 'ym-gis-2d/entity/Feature';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
map: OLMap;
|
|
6
|
-
showLoading?: boolean;
|
|
7
6
|
fieldName?: string;
|
|
8
7
|
fieldValues?: any[];
|
|
9
8
|
};
|
|
@@ -136,7 +135,5 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
136
135
|
activeInteraction: (...args: any[]) => void;
|
|
137
136
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
138
137
|
onActiveInteraction?: ((...args: any[]) => any) | undefined;
|
|
139
|
-
}>, {
|
|
140
|
-
showLoading: boolean;
|
|
141
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
138
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
142
139
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const Modify: import('../../utils').WithInstall<import('vue').DefineComponent<{
|
|
2
2
|
map: import('ym-gis-2d/mapView/Map').default;
|
|
3
|
-
showLoading?: boolean;
|
|
4
3
|
fieldName?: string;
|
|
5
4
|
fieldValues?: any[];
|
|
6
5
|
}, {
|
|
@@ -131,12 +130,9 @@ export declare const Modify: import('../../utils').WithInstall<import('vue').Def
|
|
|
131
130
|
activeInteraction: (...args: any[]) => void;
|
|
132
131
|
}, string, import('vue').PublicProps, Readonly<{
|
|
133
132
|
map: import('ym-gis-2d/mapView/Map').default;
|
|
134
|
-
showLoading?: boolean;
|
|
135
133
|
fieldName?: string;
|
|
136
134
|
fieldValues?: any[];
|
|
137
135
|
}> & Readonly<{
|
|
138
136
|
onActiveInteraction?: ((...args: any[]) => any) | undefined;
|
|
139
|
-
}>, {
|
|
140
|
-
showLoading: boolean;
|
|
141
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
|
|
137
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
|
|
142
138
|
export default Modify;
|
|
@@ -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
|
});
|
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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ym-giswidget-2d",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.79",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"element-plus": "^2.9.0",
|
|
11
11
|
"jszip": "^3.10.1",
|
|
12
12
|
"ol": "^9.2.4",
|
|
13
|
-
"ym-gis-2d": "1.0.
|
|
13
|
+
"ym-gis-2d": "1.0.49"
|
|
14
14
|
}
|
|
15
15
|
}
|