ym-giswidget-2d 1.0.56 → 1.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -33
- package/assets/font/iconfont.css +39 -39
- package/assets/font/iconfont.json +51 -51
- package/components/difference/Difference.vue.d.ts +142 -0
- package/components/difference/Difference.vue.js +73 -1
- package/components/difference/Difference.vue2.js +1 -73
- package/components/difference/index.d.ts +142 -0
- package/components/difference/index.js +1 -1
- package/components/distance-measurement/DistanceMeasurement.vue.d.ts +2 -0
- package/components/distance-measurement/DistanceMeasurement.vue.js +2 -2
- package/components/distance-measurement/index.d.ts +2 -0
- package/components/distance-measurement/index.js +7 -0
- package/components/horizontally-top-toolbar/HorizontallyTopToolbar.vue2.js +1 -1
- package/components/map-view/MapView.vue.d.ts +12 -12
- package/components/map-view/index.d.ts +12 -12
- package/components/modify/Modify.vue.d.ts +142 -0
- package/components/modify/Modify.vue.js +40 -0
- package/components/modify/Modify.vue2.js +4 -0
- package/components/modify/index.d.ts +142 -0
- package/components/modify/index.js +7 -0
- package/components/multi-screen/MultiScreen.vue.d.ts +12 -12
- package/components/multi-screen/index.d.ts +12 -12
- package/components/split/Split.vue.d.ts +142 -0
- package/components/split/Split.vue.js +73 -1
- package/components/split/Split.vue2.js +1 -73
- package/components/split/index.d.ts +142 -0
- package/components/split/index.js +1 -1
- package/index.d.ts +4 -0
- package/index.js +8 -0
- package/package.json +2 -2
- package/panel/index.css +15 -15
package/README.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# olComponents
|
|
2
|
-
|
|
3
|
-
This template should help get you started developing with Vue 3 in Vite.
|
|
4
|
-
|
|
5
|
-
## Recommended IDE Setup
|
|
6
|
-
|
|
7
|
-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
|
8
|
-
|
|
9
|
-
## Type Support for `.vue` Imports in TS
|
|
10
|
-
|
|
11
|
-
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
|
12
|
-
|
|
13
|
-
## Customize configuration
|
|
14
|
-
|
|
15
|
-
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
|
16
|
-
|
|
17
|
-
## Project Setup
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
pnpm install
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Compile and Hot-Reload for Development
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
pnpm dev
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Type-Check, Compile and Minify for Production
|
|
30
|
-
|
|
31
|
-
```sh
|
|
32
|
-
pnpm build
|
|
33
|
-
```
|
|
1
|
+
# olComponents
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
|
8
|
+
|
|
9
|
+
## Type Support for `.vue` Imports in TS
|
|
10
|
+
|
|
11
|
+
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
|
12
|
+
|
|
13
|
+
## Customize configuration
|
|
14
|
+
|
|
15
|
+
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
|
16
|
+
|
|
17
|
+
## Project Setup
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Compile and Hot-Reload for Development
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pnpm dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Type-Check, Compile and Minify for Production
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pnpm build
|
|
33
|
+
```
|
package/assets/font/iconfont.css
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: "iconfont"; /* Project id 4810358 */
|
|
3
|
-
src: url('iconfont.woff2?t=1736821977689') format('woff2'),
|
|
4
|
-
url('iconfont.woff?t=1736821977689') format('woff'),
|
|
5
|
-
url('iconfont.ttf?t=1736821977689') format('truetype');
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.iconfont {
|
|
9
|
-
font-family: "iconfont" !important;
|
|
10
|
-
font-size: 16px;
|
|
11
|
-
font-style: normal;
|
|
12
|
-
-webkit-font-smoothing: antialiased;
|
|
13
|
-
-moz-osx-font-smoothing: grayscale;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.icon-undock:before {
|
|
17
|
-
content: "\e718";
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.icon-dock:before {
|
|
21
|
-
content: "\e601";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.icon-minimize:before {
|
|
25
|
-
content: "\e646";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.icon-restore:before {
|
|
29
|
-
content: "\e600";
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.icon-close:before {
|
|
33
|
-
content: "\e70f";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.icon-maximize:before {
|
|
37
|
-
content: "\e651";
|
|
38
|
-
}
|
|
39
|
-
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "iconfont"; /* Project id 4810358 */
|
|
3
|
+
src: url('iconfont.woff2?t=1736821977689') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1736821977689') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1736821977689') format('truetype');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.iconfont {
|
|
9
|
+
font-family: "iconfont" !important;
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.icon-undock:before {
|
|
17
|
+
content: "\e718";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon-dock:before {
|
|
21
|
+
content: "\e601";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.icon-minimize:before {
|
|
25
|
+
content: "\e646";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-restore:before {
|
|
29
|
+
content: "\e600";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon-close:before {
|
|
33
|
+
content: "\e70f";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon-maximize:before {
|
|
37
|
+
content: "\e651";
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "4810358",
|
|
3
|
-
"name": "print-map",
|
|
4
|
-
"font_family": "iconfont",
|
|
5
|
-
"css_prefix_text": "icon-",
|
|
6
|
-
"description": "",
|
|
7
|
-
"glyphs": [
|
|
8
|
-
{
|
|
9
|
-
"icon_id": "21967058",
|
|
10
|
-
"name": "未停靠",
|
|
11
|
-
"font_class": "undock",
|
|
12
|
-
"unicode": "e718",
|
|
13
|
-
"unicode_decimal": 59160
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"icon_id": "39867073",
|
|
17
|
-
"name": "停靠",
|
|
18
|
-
"font_class": "dock",
|
|
19
|
-
"unicode": "e601",
|
|
20
|
-
"unicode_decimal": 58881
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"icon_id": "659177",
|
|
24
|
-
"name": "最小化",
|
|
25
|
-
"font_class": "minimize",
|
|
26
|
-
"unicode": "e646",
|
|
27
|
-
"unicode_decimal": 58950
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"icon_id": "4485682",
|
|
31
|
-
"name": "还原窗体",
|
|
32
|
-
"font_class": "restore",
|
|
33
|
-
"unicode": "e600",
|
|
34
|
-
"unicode_decimal": 58880
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"icon_id": "6705520",
|
|
38
|
-
"name": "关闭",
|
|
39
|
-
"font_class": "close",
|
|
40
|
-
"unicode": "e70f",
|
|
41
|
-
"unicode_decimal": 59151
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"icon_id": "11490920",
|
|
45
|
-
"name": "最大化",
|
|
46
|
-
"font_class": "maximize",
|
|
47
|
-
"unicode": "e651",
|
|
48
|
-
"unicode_decimal": 58961
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "4810358",
|
|
3
|
+
"name": "print-map",
|
|
4
|
+
"font_family": "iconfont",
|
|
5
|
+
"css_prefix_text": "icon-",
|
|
6
|
+
"description": "",
|
|
7
|
+
"glyphs": [
|
|
8
|
+
{
|
|
9
|
+
"icon_id": "21967058",
|
|
10
|
+
"name": "未停靠",
|
|
11
|
+
"font_class": "undock",
|
|
12
|
+
"unicode": "e718",
|
|
13
|
+
"unicode_decimal": 59160
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"icon_id": "39867073",
|
|
17
|
+
"name": "停靠",
|
|
18
|
+
"font_class": "dock",
|
|
19
|
+
"unicode": "e601",
|
|
20
|
+
"unicode_decimal": 58881
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"icon_id": "659177",
|
|
24
|
+
"name": "最小化",
|
|
25
|
+
"font_class": "minimize",
|
|
26
|
+
"unicode": "e646",
|
|
27
|
+
"unicode_decimal": 58950
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"icon_id": "4485682",
|
|
31
|
+
"name": "还原窗体",
|
|
32
|
+
"font_class": "restore",
|
|
33
|
+
"unicode": "e600",
|
|
34
|
+
"unicode_decimal": 58880
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"icon_id": "6705520",
|
|
38
|
+
"name": "关闭",
|
|
39
|
+
"font_class": "close",
|
|
40
|
+
"unicode": "e70f",
|
|
41
|
+
"unicode_decimal": 59151
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"icon_id": "11490920",
|
|
45
|
+
"name": "最大化",
|
|
46
|
+
"font_class": "maximize",
|
|
47
|
+
"unicode": "e651",
|
|
48
|
+
"unicode_decimal": 58961
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
@@ -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;
|
|
@@ -1,4 +1,76 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent, reactive, onMounted, toRaw, onUnmounted } from "vue";
|
|
2
|
+
import Difference from "ym-gis-2d/interaction/Difference";
|
|
3
|
+
import { ElLoading, ElMessage } from "element-plus";
|
|
4
|
+
import FeatureManager from "ym-gis-2d/feature/FeatureManager";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "Difference",
|
|
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.differenceTool = new Difference(editFeatures, {
|
|
28
|
+
tipText: "绘制面挖除要素",
|
|
29
|
+
addTempLayer: true
|
|
30
|
+
//是否添加临时图层
|
|
31
|
+
});
|
|
32
|
+
props.map.interactionManager.addInteraction("difference", toRaw(reactiveData.differenceTool));
|
|
33
|
+
let loadingInstance;
|
|
34
|
+
reactiveData.differenceTool.on("holeStart", (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.differenceTool.on("holed", (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.differenceTool) == null ? void 0 : _a.setFeatures(editFeatures2);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
onUnmounted(() => {
|
|
59
|
+
props.map.interactionManager.removeInteraction("difference");
|
|
60
|
+
});
|
|
61
|
+
function setFeatures(features) {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = reactiveData.differenceTool) == 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
|
+
});
|
|
2
74
|
export {
|
|
3
75
|
_sfc_main as default
|
|
4
76
|
};
|
|
@@ -1,76 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Difference from "ym-gis-2d/interaction/Difference";
|
|
3
|
-
import { ElLoading, ElMessage } from "element-plus";
|
|
4
|
-
import FeatureManager from "ym-gis-2d/feature/FeatureManager";
|
|
5
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
-
__name: "Difference",
|
|
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.differenceTool = new Difference(editFeatures, {
|
|
28
|
-
tipText: "绘制面挖除要素",
|
|
29
|
-
addTempLayer: true
|
|
30
|
-
//是否添加临时图层
|
|
31
|
-
});
|
|
32
|
-
props.map.interactionManager.addInteraction("difference", toRaw(reactiveData.differenceTool));
|
|
33
|
-
let loadingInstance;
|
|
34
|
-
reactiveData.differenceTool.on("holeStart", (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.differenceTool.on("holed", (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.differenceTool) == null ? void 0 : _a.setFeatures(editFeatures2);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
onUnmounted(() => {
|
|
59
|
-
props.map.interactionManager.removeInteraction("difference");
|
|
60
|
-
});
|
|
61
|
-
function setFeatures(features) {
|
|
62
|
-
var _a;
|
|
63
|
-
(_a = reactiveData.differenceTool) == 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
|
-
});
|
|
1
|
+
import _sfc_main from "./Difference.vue.js";
|
|
74
2
|
export {
|
|
75
3
|
_sfc_main as default
|
|
76
4
|
};
|