ym-giswidget-2d 1.0.55 → 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.
Files changed (31) hide show
  1. package/components/difference/Difference.vue.d.ts +142 -0
  2. package/components/difference/Difference.vue.js +76 -0
  3. package/components/difference/Difference.vue2.js +4 -0
  4. package/components/difference/index.d.ts +142 -0
  5. package/components/difference/index.js +7 -0
  6. package/components/distance-measurement/DistanceMeasurement.vue.d.ts +2 -0
  7. package/components/distance-measurement/DistanceMeasurement.vue.js +2 -2
  8. package/components/distance-measurement/index.d.ts +2 -0
  9. package/components/distance-measurement/index.js +7 -0
  10. package/components/horizontally-top-toolbar/HorizontallyTopToolbar.vue.js +1 -1
  11. package/components/horizontally-top-toolbar/HorizontallyTopToolbar.vue2.js +10 -2
  12. package/components/horizontally-top-toolbar/index.css +9 -9
  13. package/components/map-view/MapView.vue.d.ts +12 -12
  14. package/components/map-view/index.d.ts +12 -12
  15. package/components/modify/Modify.vue.d.ts +142 -0
  16. package/components/modify/Modify.vue.js +40 -0
  17. package/components/modify/Modify.vue2.js +4 -0
  18. package/components/modify/index.d.ts +142 -0
  19. package/components/modify/index.js +7 -0
  20. package/components/multi-screen/MultiScreen.vue.d.ts +12 -12
  21. package/components/multi-screen/index.d.ts +12 -12
  22. package/components/split/Split.vue.d.ts +142 -0
  23. package/components/split/Split.vue.js +73 -1
  24. package/components/split/Split.vue2.js +1 -75
  25. package/components/split/index.d.ts +142 -0
  26. package/components/split/index.js +1 -1
  27. package/index.d.ts +4 -0
  28. package/index.js +8 -0
  29. package/package.json +2 -2
  30. package/panel/DraggablePanel.vue.js +1 -1
  31. package/panel/index.css +31 -31
@@ -136,7 +136,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
136
136
  unobserve: (target: Element) => void;
137
137
  };
138
138
  addControl: (control: import('ol/control').default) => void;
139
- addInteraction: (interaction: import('ol/interaction/Interaction').default) => void;
139
+ addInteraction: (interaction: import('ol/interaction').default) => void;
140
140
  addLayer: (layer: import('ol/layer/Base').default) => void;
141
141
  addOverlay: (overlay: import('ol').default) => void;
142
142
  forEachFeatureAtPixel: <T>(pixel: import('ol/pixel').Pixel, callback: (arg0: import('ol/Feature').FeatureLike, arg1: import('ol/layer').default<import('ol/source').default>, arg2: import('ol/geom').default) => T, options?: import('ol/Map').AtPixelOptions | undefined) => T | undefined;
@@ -156,7 +156,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
156
156
  getControls: () => import('ol').Collection<import('ol/control').default>;
157
157
  getOverlays: () => import('ol').Collection<import('ol').default>;
158
158
  getOverlayById: (id: string | number) => import('ol').default | null;
159
- getInteractions: () => import('ol').Collection<import('ol/interaction/Interaction').default>;
159
+ getInteractions: () => import('ol').Collection<import('ol/interaction').default>;
160
160
  getLayerGroup: () => import('ol/layer').Group;
161
161
  setLayers: (layers: Array<import('ol/layer/Base').default> | import('ol').Collection<import('ol/layer/Base').default>) => void;
162
162
  getLayers: () => import('ol').Collection<import('ol/layer/Base').default>;
@@ -178,7 +178,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
178
178
  redrawText: () => void;
179
179
  render: () => void;
180
180
  removeControl: (control: import('ol/control').default) => import('ol/control').default | undefined;
181
- removeInteraction: (interaction: import('ol/interaction/Interaction').default) => import('ol/interaction/Interaction').default | undefined;
181
+ removeInteraction: (interaction: import('ol/interaction').default) => import('ol/interaction').default | undefined;
182
182
  removeLayer: (layer: import('ol/layer/Base').default) => import('ol/layer/Base').default | undefined;
183
183
  removeOverlay: (overlay: import('ol').default) => import('ol').default | undefined;
184
184
  setLayerGroup: (layerGroup: import('ol/layer').Group) => void;
@@ -246,11 +246,11 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
246
246
  hasListener: (type?: string | undefined) => boolean;
247
247
  removeEventListener: (type: string, listener: import('ol/events').Listener) => void;
248
248
  dispose: () => void;
249
- }> & Omit<Map<string, import('ol/interaction/Interaction').default>, keyof Map<any, any>>;
250
- addInteraction: (name: string, interaction: import('ol/interaction/Interaction').default) => void;
249
+ }> & Omit<Map<string, import('ol/interaction').Interaction>, keyof Map<any, any>>;
250
+ addInteraction: (name: string, interaction: import('ol/interaction').Interaction) => void;
251
251
  removeInteraction: (name: string) => void;
252
252
  removeAllInteractions: () => void;
253
- getInteraction: (name: string) => import('ol/interaction/Interaction').default | undefined;
253
+ getInteraction: (name: string) => import('ol/interaction').Interaction | undefined;
254
254
  };
255
255
  controlManager: {
256
256
  map: {
@@ -263,7 +263,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
263
263
  unobserve: (target: Element) => void;
264
264
  };
265
265
  addControl: (control: import('ol/control').default) => void;
266
- addInteraction: (interaction: import('ol/interaction/Interaction').default) => void;
266
+ addInteraction: (interaction: import('ol/interaction').default) => void;
267
267
  addLayer: (layer: import('ol/layer/Base').default) => void;
268
268
  addOverlay: (overlay: import('ol').default) => void;
269
269
  forEachFeatureAtPixel: <T>(pixel: import('ol/pixel').Pixel, callback: (arg0: import('ol/Feature').FeatureLike, arg1: import('ol/layer').default<import('ol/source').default>, arg2: import('ol/geom').default) => T, options?: import('ol/Map').AtPixelOptions | undefined) => T | undefined;
@@ -283,7 +283,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
283
283
  getControls: () => import('ol').Collection<import('ol/control').default>;
284
284
  getOverlays: () => import('ol').Collection<import('ol').default>;
285
285
  getOverlayById: (id: string | number) => import('ol').default | null;
286
- getInteractions: () => import('ol').Collection<import('ol/interaction/Interaction').default>;
286
+ getInteractions: () => import('ol').Collection<import('ol/interaction').default>;
287
287
  getLayerGroup: () => import('ol/layer').Group;
288
288
  setLayers: (layers: Array<import('ol/layer/Base').default> | import('ol').Collection<import('ol/layer/Base').default>) => void;
289
289
  getLayers: () => import('ol').Collection<import('ol/layer/Base').default>;
@@ -305,7 +305,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
305
305
  redrawText: () => void;
306
306
  render: () => void;
307
307
  removeControl: (control: import('ol/control').default) => import('ol/control').default | undefined;
308
- removeInteraction: (interaction: import('ol/interaction/Interaction').default) => import('ol/interaction/Interaction').default | undefined;
308
+ removeInteraction: (interaction: import('ol/interaction').default) => import('ol/interaction').default | undefined;
309
309
  removeLayer: (layer: import('ol/layer/Base').default) => import('ol/layer/Base').default | undefined;
310
310
  removeOverlay: (overlay: import('ol').default) => import('ol').default | undefined;
311
311
  setLayerGroup: (layerGroup: import('ol/layer').Group) => void;
@@ -423,7 +423,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
423
423
  unobserve: (target: Element) => void;
424
424
  };
425
425
  addControl: (control: import('ol/control').default) => void;
426
- addInteraction: (interaction: import('ol/interaction/Interaction').default) => void;
426
+ addInteraction: (interaction: import('ol/interaction').default) => void;
427
427
  addOverlay: (overlay: import('ol').default) => void;
428
428
  forEachFeatureAtPixel: <T>(pixel: import('ol/pixel').Pixel, callback: (arg0: import('ol/Feature').FeatureLike, arg1: import('ol/layer').default<import('ol/source').default>, arg2: import('ol/geom').default) => T, options?: import('ol/Map').AtPixelOptions | undefined) => T | undefined;
429
429
  getFeaturesAtPixel: (pixel: import('ol/pixel').Pixel, options?: import('ol/Map').AtPixelOptions | undefined) => Array<import('ol/Feature').FeatureLike>;
@@ -442,7 +442,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
442
442
  getControls: () => import('ol').Collection<import('ol/control').default>;
443
443
  getOverlays: () => import('ol').Collection<import('ol').default>;
444
444
  getOverlayById: (id: string | number) => import('ol').default | null;
445
- getInteractions: () => import('ol').Collection<import('ol/interaction/Interaction').default>;
445
+ getInteractions: () => import('ol').Collection<import('ol/interaction').default>;
446
446
  getLayerGroup: () => import('ol/layer').Group;
447
447
  setLayers: (layers: Array<import('ol/layer/Base').default> | import('ol').Collection<import('ol/layer/Base').default>) => void;
448
448
  getLayers: () => import('ol').Collection<import('ol/layer/Base').default>;
@@ -463,7 +463,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
463
463
  redrawText: () => void;
464
464
  render: () => void;
465
465
  removeControl: (control: import('ol/control').default) => import('ol/control').default | undefined;
466
- removeInteraction: (interaction: import('ol/interaction/Interaction').default) => import('ol/interaction/Interaction').default | undefined;
466
+ removeInteraction: (interaction: import('ol/interaction').default) => import('ol/interaction').default | undefined;
467
467
  removeLayer: (layer: import('ol/layer/Base').default) => import('ol/layer/Base').default | undefined;
468
468
  removeOverlay: (overlay: import('ol').default) => import('ol').default | undefined;
469
469
  setLayerGroup: (layerGroup: import('ol/layer').Group) => void;
@@ -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 _sfc_main from "./Split.vue2.js";
1
+ import { defineComponent, reactive, onMounted, toRaw, onUnmounted } from "vue";
2
+ import Split from "ym-gis-2d/interaction/Split";
3
+ import { ElLoading, ElMessage } from "element-plus";
4
+ import FeatureManager from "ym-gis-2d/feature/FeatureManager";
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "Split",
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 Split(editFeatures, {
28
+ tipText: "分割线完全穿过面",
29
+ addTempLayer: true
30
+ //是否添加临时图层
31
+ });
32
+ props.map.interactionManager.addInteraction("split", toRaw(reactiveData.splitTool));
33
+ let loadingInstance;
34
+ reactiveData.splitTool.on("splitStart", (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("splited", (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("split");
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
+ });
2
74
  export {
3
75
  _sfc_main as default
4
76
  };
@@ -1,78 +1,4 @@
1
- import { defineComponent, reactive, onMounted, toRaw, onUnmounted } from "vue";
2
- import Split from "ym-gis-2d/interaction/Split";
3
- import { ElLoading } from "element-plus";
4
- import FeatureManager from "ym-gis-2d/feature/FeatureManager";
5
- import "ym-gis-2d/utils/GeometryUtil";
6
- import { getStyle, getSelectCancePointStyle, getSelectCancelLineStyle, getSelectCancelPolygonStyle } from "ym-gis-2d/style/StyleManager";
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- __name: "Split",
9
- props: {
10
- map: {},
11
- pointStyle: {},
12
- cancePointStyle: {},
13
- lineStyle: {},
14
- canceLineStyle: {},
15
- polygonStyle: {},
16
- cancePolygonStyle: {},
17
- selectLayers: {},
18
- showLoading: { type: Boolean, default: true },
19
- selectType: { default: "rectangle" }
20
- },
21
- emits: ["activeInteraction"],
22
- setup(__props, { expose: __expose, emit: __emit }) {
23
- const props = __props;
24
- props.cancePointStyle ? getStyle(props.cancePointStyle) : getSelectCancePointStyle();
25
- props.canceLineStyle ? getStyle(props.canceLineStyle) : getSelectCancelLineStyle();
26
- props.cancePolygonStyle ? getStyle(props.cancePolygonStyle) : getSelectCancelPolygonStyle();
27
- const emit = __emit;
28
- const reactiveData = reactive({
29
- features: []
30
- });
31
- onMounted(() => {
32
- const featureManager = new FeatureManager(props.map);
33
- const editFeatures = featureManager.getEditFeatures();
34
- if (!editFeatures || editFeatures.length === 0) {
35
- emit("activeInteraction", { success: false, message: "请先选择分割的地块" });
36
- return;
37
- }
38
- reactiveData.splitTool = new Split(editFeatures, {
39
- tipText: "分割线完全穿过面",
40
- addTempLayer: true
41
- //是否添加临时图层
42
- });
43
- props.map.interactionManager.addInteraction("split", toRaw(reactiveData.splitTool));
44
- let loadingInstance;
45
- reactiveData.splitTool.on("splitStart", (event) => {
46
- if (props.showLoading) {
47
- loadingInstance = ElLoading.service({ text: "正在分割...", background: "rgba(0, 0, 0, 0.5)", target: props.map.getTarget() });
48
- }
49
- });
50
- reactiveData.splitTool.on("splited", (event) => {
51
- loadingInstance == null ? void 0 : loadingInstance.close();
52
- const features = event.polygonFeatures;
53
- if (features && features.length > 0) {
54
- features.forEach((feature) => {
55
- feature.isSelected = true;
56
- });
57
- }
58
- });
59
- });
60
- onUnmounted(() => {
61
- props.map.interactionManager.removeInteraction("select");
62
- });
63
- function setSelectLayers(layers) {
64
- var _a;
65
- (_a = reactiveData.selectTool) == null ? void 0 : _a.setSelectLayers(layers);
66
- }
67
- __expose({
68
- setSelectLayers,
69
- features: reactiveData.features
70
- });
71
- return (_ctx, _cache) => {
72
- return null;
73
- };
74
- }
75
- });
1
+ import _sfc_main from "./Split.vue.js";
76
2
  export {
77
3
  _sfc_main as default
78
4
  };
@@ -0,0 +1,142 @@
1
+ export declare const Split: 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 Split;
@@ -1,5 +1,5 @@
1
1
  import { withInstall } from "../../utils/wthInstall.js";
2
- import _sfc_main from "./Split.vue2.js";
2
+ import _sfc_main from "./Split.vue.js";
3
3
  const Split = withInstall(_sfc_main);
4
4
  export {
5
5
  Split,
package/index.d.ts CHANGED
@@ -14,4 +14,8 @@ export * from './components/map-view';
14
14
  export * from './components/legend';
15
15
  export * from './components/layer-switcher';
16
16
  export * from './components/area-measurement';
17
+ export * from './components/distance-measurement';
17
18
  export * from './components/location';
19
+ export * from './components/split';
20
+ export * from './components/difference';
21
+ export * from './components/modify';
package/index.js CHANGED
@@ -15,10 +15,16 @@ import { MapView } from "./components/map-view/index.js";
15
15
  import { Legend } from "./components/legend/index.js";
16
16
  import { LayerSwitcher } from "./components/layer-switcher/index.js";
17
17
  import { AreaMeasurement } from "./components/area-measurement/index.js";
18
+ import { DistanceMeasurement } from "./components/distance-measurement/index.js";
18
19
  import { Location } from "./components/location/index.js";
20
+ import { Split } from "./components/split/index.js";
21
+ import { Difference } from "./components/difference/index.js";
22
+ import { Modify } from "./components/modify/index.js";
19
23
  export {
20
24
  AreaMeasurement,
21
25
  Clear,
26
+ Difference,
27
+ DistanceMeasurement,
22
28
  Draw,
23
29
  Export,
24
30
  HorizontallyTopToolbar,
@@ -28,10 +34,12 @@ export {
28
34
  Legend,
29
35
  Location,
30
36
  MapView,
37
+ Modify,
31
38
  MousePositon,
32
39
  MultiScreen,
33
40
  ScaleLine,
34
41
  Select,
42
+ Split,
35
43
  SwipeLayer,
36
44
  TocCard
37
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ym-giswidget-2d",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
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.33"
13
+ "ym-gis-2d": "1.0.35"
14
14
  }
15
15
  }
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./DraggablePanel.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const DraggablePanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f6c9d2a3"]]);
4
+ const DraggablePanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-98e8fdca"]]);
5
5
  export {
6
6
  DraggablePanel as default
7
7
  };