ym-giswidget-2d 1.0.48 → 1.0.50

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 (42) hide show
  1. package/README.md +33 -33
  2. package/assets/font/iconfont.css +39 -39
  3. package/assets/font/iconfont.json +51 -51
  4. package/components/area-measurement/AreaMeasurement.vue.d.ts +20 -1
  5. package/components/area-measurement/AreaMeasurement.vue.js +78 -65
  6. package/components/area-measurement/index.d.ts +30 -2
  7. package/components/draw/Draw.vue.d.ts +3 -0
  8. package/components/draw/Draw.vue.js +8 -3
  9. package/components/draw/index.d.ts +4 -0
  10. package/components/export/Export.vue.js +1 -1
  11. package/components/export/index.css +1 -1
  12. package/components/horizontally-top-toolbar/HorizontallyTopToolbar.vue.js +1 -1
  13. package/components/horizontally-top-toolbar/HorizontallyTopToolbar.vue2.js +3 -1
  14. package/components/horizontally-top-toolbar/index.css +9 -9
  15. package/components/identify/Identify.vue.d.ts +2 -2
  16. package/components/identify/Identify.vue.js +1 -1
  17. package/components/identify/index.d.ts +19 -19
  18. package/components/layer-tree/LayerTree.vue.d.ts +5 -2
  19. package/components/layer-tree/LayerTree.vue.js +1 -1
  20. package/components/layer-tree/LayerTree.vue2.js +27 -8
  21. package/components/layer-tree/index.css +31 -16
  22. package/components/layer-tree/index.d.ts +3 -0
  23. package/components/map-view/MapView.vue.d.ts +22 -3
  24. package/components/map-view/MapView.vue.js +17 -1
  25. package/components/map-view/index.d.ts +17 -1
  26. package/components/multi-screen/MultiScreen.vue.d.ts +15 -1
  27. package/components/multi-screen/index.d.ts +15 -1
  28. package/components/popup/Popup.vue.d.ts +1 -1
  29. package/components/popup/Popup.vue.js +1 -1
  30. package/components/popup/Popup.vue2.js +6 -1
  31. package/components/popup/index.css +10 -10
  32. package/components/popup/index.d.ts +1 -1
  33. package/components/select/Select.vue.d.ts +1 -1
  34. package/components/select/Select.vue.js +1 -1
  35. package/components/select/index.d.ts +1 -1
  36. package/components/toc-card/TocCard.vue.d.ts +2 -0
  37. package/components/toc-card/TocCard.vue.js +1 -1
  38. package/components/toc-card/TocCard.vue2.js +4 -2
  39. package/components/toc-card/index.css +1 -1
  40. package/components/toc-card/index.d.ts +3 -0
  41. package/package.json +2 -2
  42. 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
+ ```
@@ -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
+ }
@@ -1,8 +1,27 @@
1
1
  import { default as OLMap } from 'ym-gis-2d/mapView/Map';
2
+ import { default as IFont } from 'ym-gis-2d/entity/IFont';
2
3
  type __VLS_Props = {
3
4
  map: OLMap;
5
+ color?: Array<number> | string;
6
+ opacity?: number;
7
+ outlineColor?: Array<number> | string;
8
+ outlineOpacity?: number;
9
+ outlineWidth?: number;
10
+ font?: IFont;
11
+ unit?: "square-meters" | "square-kilometers" | "mu" | "hectare";
12
+ precision?: number;
13
+ showLabel?: boolean;
14
+ spheroid?: boolean;
4
15
  };
5
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
16
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ activeInteraction: (...args: any[]) => void;
18
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ onActiveInteraction?: ((...args: any[]) => any) | undefined;
20
+ }>, {
21
+ precision: number;
22
+ showLabel: boolean;
23
+ spheroid: boolean;
24
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
6
25
  areaMeasureDom: ({
7
26
  $: import('vue').ComponentInternalInstance;
8
27
  $data: {};
@@ -4,10 +4,11 @@ import "element-plus/es/components/form/style/css";
4
4
  import "element-plus/es/components/form-item/style/css";
5
5
  import "element-plus/es/components/select/style/css";
6
6
  import "element-plus/es/components/option/style/css";
7
- import { defineComponent, reactive, onMounted, onUnmounted, withDirectives, createBlock, openBlock, withCtx, createVNode, unref, createCommentVNode, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, vShow } from "vue";
7
+ import { defineComponent, reactive, computed, onMounted, toRaw, onUnmounted, withDirectives, createBlock, openBlock, withCtx, createVNode, unref, createCommentVNode, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, vShow } from "vue";
8
8
  import DraggablePanel from "../../panel/DraggablePanel.vue.js";
9
- import Draw from "ym-gis-2d/interaction/Draw";
10
- import { getArea } from "ym-gis-2d/utils/GeometryUtil";
9
+ import AreaMeasure from "ym-gis-2d/interaction/AreaMeasure";
10
+ import measureUnits from "ym-gis-2d/entity/measure/AreaMeasureUnits";
11
+ import { polygonToLines, getLength } from "ym-gis-2d/utils/GeometryUtil";
11
12
  const _hoisted_1 = { class: "el-current-value" };
12
13
  const _hoisted_2 = { class: "el-current-unit" };
13
14
  const _hoisted_3 = { class: "el-current-value" };
@@ -15,82 +16,93 @@ const _hoisted_4 = { class: "el-current-unit" };
15
16
  const _sfc_main = /* @__PURE__ */ defineComponent({
16
17
  __name: "AreaMeasurement",
17
18
  props: {
18
- map: {}
19
+ map: {},
20
+ color: {},
21
+ opacity: {},
22
+ outlineColor: {},
23
+ outlineOpacity: {},
24
+ outlineWidth: {},
25
+ font: {},
26
+ unit: {},
27
+ precision: { default: 2 },
28
+ showLabel: { type: Boolean, default: true },
29
+ spheroid: { type: Boolean, default: false }
19
30
  },
20
- setup(__props) {
31
+ emits: ["activeInteraction"],
32
+ setup(__props, { emit: __emit }) {
33
+ const emit = __emit;
21
34
  const props = __props;
22
35
  let reactiveValue = reactive({
23
36
  visible: true,
24
37
  allArea: 0,
25
38
  allPerimeter: 0,
26
- measureTypes: [
27
- {
28
- type: "square-meters",
29
- label: "平方米",
30
- persimeterLabel: "米"
31
- },
32
- {
33
- type: "square-kilometers",
34
- label: "平方公里",
35
- persimeterLabel: "千米"
36
- },
37
- {
38
- type: "mu",
39
- label: "亩",
40
- persimeterLabel: "米"
41
- },
42
- {
43
- type: "hectare",
44
- label: "公顷",
45
- persimeterLabel: "千米"
46
- }
47
- ]
39
+ hasArea: 0,
40
+ hasPerimeter: 0
48
41
  });
49
- reactiveValue.currentType = reactiveValue.measureTypes[0];
50
- onMounted(() => {
51
- const tempLayer = props.map.getPolygonTempLayer();
52
- let source = void 0;
53
- const layersource = tempLayer == null ? void 0 : tempLayer.getSource();
54
- if (layersource) {
55
- source = layersource;
42
+ reactiveValue.currentType = measureUnits[0];
43
+ const measureData = computed(() => {
44
+ var _a;
45
+ switch ((_a = reactiveValue.currentType) == null ? void 0 : _a.type) {
46
+ case "square-meters":
47
+ return {
48
+ area: `${reactiveValue.allArea.toFixed(props.precision)}`,
49
+ perimeter: `${reactiveValue.allPerimeter.toFixed(props.precision)}`
50
+ };
51
+ case "square-kilometers":
52
+ return {
53
+ area: `${(reactiveValue.allArea * 1e-6).toFixed(props.precision)}`,
54
+ perimeter: `${(reactiveValue.allPerimeter * 1e-3).toFixed(props.precision)}`
55
+ };
56
+ case "mu":
57
+ return {
58
+ area: `${(reactiveValue.allArea * 15e-4).toFixed(props.precision)}`,
59
+ perimeter: `${reactiveValue.allPerimeter.toFixed(props.precision)}`
60
+ };
61
+ case "hectare":
62
+ return {
63
+ area: `${(reactiveValue.allArea * 1e-4).toFixed(props.precision)}`,
64
+ perimeter: `${(reactiveValue.allPerimeter * 1e-3).toFixed(props.precision)}`
65
+ };
66
+ default:
67
+ return {
68
+ area: `${reactiveValue.allArea.toFixed(props.precision)} `,
69
+ perimeter: `${reactiveValue.allPerimeter.toFixed(props.precision)} `
70
+ };
56
71
  }
57
- const draw = new Draw("polygon", {
58
- source,
59
- tipText: "点击开始测量,双击结束测量"
60
- });
61
- props.map.interactionManager.addInteraction("areaMeasure", draw);
62
- draw.on("drawend", (event) => {
63
- const features = event.feature;
64
- if (features) {
65
- features.isSelected = true;
66
- features.tempLayer = tempLayer;
67
- features.fromType = "draw";
68
- }
69
- });
70
- draw.on("drawaddpoint", (event) => {
71
- const features = event.feature;
72
- if (features) {
73
- features.isSelected = true;
74
- features.tempLayer = tempLayer;
75
- features.fromType = "draw";
72
+ });
73
+ onMounted(() => {
74
+ let { map, ...options } = toRaw(props);
75
+ const areaMeasure = new AreaMeasure(options);
76
+ props.map.interactionManager.addInteraction("areaMeasure", areaMeasure);
77
+ areaMeasure.on("measureMoving", (e) => {
78
+ reactiveValue.allArea = reactiveValue.hasArea + e.area;
79
+ const lines = polygonToLines(e.geom);
80
+ if (lines) {
81
+ reactiveValue.allPerimeter = reactiveValue.hasPerimeter + getLength(lines[0], props.map.getView().getProjection());
76
82
  }
77
83
  });
78
- draw.on("drawmoving", (event) => {
79
- var _a;
80
- if (!event.coordinates || event.coordinates.length < 2) {
81
- return;
84
+ areaMeasure.on("measureEnd", (e) => {
85
+ reactiveValue.hasArea += e.area;
86
+ const lines = polygonToLines(e.geom);
87
+ if (lines) {
88
+ reactiveValue.hasPerimeter += getLength(lines[0], props.map.getView().getProjection());
82
89
  }
83
- const geometry = (_a = event.feature) == null ? void 0 : _a.getGeometry();
84
- const area = getArea(geometry, props.map.getView().getProjection());
85
- console.log(area);
86
90
  });
87
91
  });
88
92
  onUnmounted(() => {
89
93
  reactiveValue.visible = false;
94
+ const areaMeasure = props.map.interactionManager.getInteraction("areaMeasure");
95
+ areaMeasure.clearMeasure();
90
96
  props.map.interactionManager.removeInteraction("areaMeasure");
91
97
  });
92
98
  function handleClose() {
93
- reactiveValue.visible = false;
99
+ emit("activeInteraction", { success: false, message: "" });
100
+ }
101
+ function changeUnit() {
102
+ const areaMeasure = props.map.interactionManager.getInteraction("areaMeasure");
103
+ if (reactiveValue.currentType && areaMeasure) {
104
+ areaMeasure.setUnit(reactiveValue.currentType.type);
105
+ }
94
106
  }
95
107
  return (_ctx, _cache) => {
96
108
  const _component_el_option = ElOption;
@@ -132,10 +144,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
132
144
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(reactiveValue).currentType = $event),
133
145
  "value-key": "type",
134
146
  class: "el-current",
135
- "popper-class": "el-current"
147
+ "popper-class": "el-current",
148
+ onChange: changeUnit
136
149
  }, {
137
150
  default: withCtx(() => [
138
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(reactiveValue).measureTypes, (item) => {
151
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(measureUnits), (item) => {
139
152
  return openBlock(), createBlock(_component_el_option, {
140
153
  key: item.type,
141
154
  label: item.label,
@@ -156,7 +169,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
156
169
  default: withCtx(() => {
157
170
  var _a;
158
171
  return [
159
- createElementVNode("span", _hoisted_1, toDisplayString(unref(reactiveValue).allArea), 1),
172
+ createElementVNode("span", _hoisted_1, toDisplayString(measureData.value.area), 1),
160
173
  createElementVNode("span", _hoisted_2, toDisplayString((_a = unref(reactiveValue).currentType) == null ? void 0 : _a.label), 1)
161
174
  ];
162
175
  }),
@@ -170,7 +183,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
170
183
  default: withCtx(() => {
171
184
  var _a;
172
185
  return [
173
- createElementVNode("span", _hoisted_3, toDisplayString(unref(reactiveValue).allPerimeter), 1),
186
+ createElementVNode("span", _hoisted_3, toDisplayString(measureData.value.perimeter), 1),
174
187
  createElementVNode("span", _hoisted_4, toDisplayString((_a = unref(reactiveValue).currentType) == null ? void 0 : _a.persimeterLabel), 1)
175
188
  ];
176
189
  }),
@@ -1,8 +1,36 @@
1
1
  export declare const AreaMeasurement: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
2
  map: import('ym-gis-2d/mapView/Map').default;
3
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
3
+ color?: Array<number> | string;
4
+ opacity?: number;
5
+ outlineColor?: Array<number> | string;
6
+ outlineOpacity?: number;
7
+ outlineWidth?: number;
8
+ font?: import('ym-gis-2d/entity/IFont').default;
9
+ unit?: "square-meters" | "square-kilometers" | "mu" | "hectare";
10
+ precision?: number;
11
+ showLabel?: boolean;
12
+ spheroid?: boolean;
13
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ activeInteraction: (...args: any[]) => void;
15
+ }, string, import('vue').PublicProps, Readonly<{
4
16
  map: import('ym-gis-2d/mapView/Map').default;
5
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
17
+ color?: Array<number> | string;
18
+ opacity?: number;
19
+ outlineColor?: Array<number> | string;
20
+ outlineOpacity?: number;
21
+ outlineWidth?: number;
22
+ font?: import('ym-gis-2d/entity/IFont').default;
23
+ unit?: "square-meters" | "square-kilometers" | "mu" | "hectare";
24
+ precision?: number;
25
+ showLabel?: boolean;
26
+ spheroid?: boolean;
27
+ }> & Readonly<{
28
+ onActiveInteraction?: ((...args: any[]) => any) | undefined;
29
+ }>, {
30
+ precision: number;
31
+ showLabel: boolean;
32
+ spheroid: boolean;
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
6
34
  areaMeasureDom: ({
7
35
  $: import('vue').ComponentInternalInstance;
8
36
  $data: {};
@@ -1,6 +1,9 @@
1
1
  import { default as OLMap } from 'ym-gis-2d/mapView/Map';
2
+ import { default as IStyle } from 'ym-gis-2d/entity/style/IStyle';
2
3
  type __VLS_Props = {
3
4
  map: OLMap;
5
+ geometryType?: "polygon" | "point" | "polyline" | "rectangle" | "circle";
6
+ style?: IStyle;
4
7
  };
5
8
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
9
  export default _default;
@@ -3,14 +3,18 @@ import Draw from "ym-gis-2d/interaction/Draw";
3
3
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
4
  __name: "Draw",
5
5
  props: {
6
- map: {}
6
+ map: {},
7
+ geometryType: {},
8
+ style: {}
7
9
  },
8
10
  setup(__props) {
9
11
  const props = __props;
10
12
  onMounted(() => {
11
13
  const currentLayerInfo = props.map.currentEditLayer;
12
14
  let geometryType = "polygon";
13
- if (currentLayerInfo && currentLayerInfo.geometryType) {
15
+ if (props.geometryType) {
16
+ geometryType = props.geometryType;
17
+ } else if (currentLayerInfo && currentLayerInfo.geometryType) {
14
18
  switch (currentLayerInfo.geometryType) {
15
19
  case 1:
16
20
  geometryType = "point";
@@ -30,7 +34,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
34
  source = layersource;
31
35
  }
32
36
  const draw = new Draw(geometryType, {
33
- source
37
+ source,
38
+ style: props.style
34
39
  });
35
40
  props.map.interactionManager.addInteraction("draw", draw);
36
41
  draw.on("drawend", (event) => {
@@ -1,6 +1,10 @@
1
1
  export declare const Draw: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
2
  map: import('ym-gis-2d/mapView/Map').default;
3
+ geometryType?: "polygon" | "point" | "polyline" | "rectangle" | "circle";
4
+ style?: import('ym-gis-2d/entity/style/IStyle').default;
3
5
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
4
6
  map: import('ym-gis-2d/mapView/Map').default;
7
+ geometryType?: "polygon" | "point" | "polyline" | "rectangle" | "circle";
8
+ style?: import('ym-gis-2d/entity/style/IStyle').default;
5
9
  }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
6
10
  export default Draw;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Export.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _Export = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-11975a70"]]);
4
+ const _Export = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e716c04f"]]);
5
5
  export {
6
6
  _Export as default
7
7
  };
@@ -1,3 +1,3 @@
1
- .panel-content[data-v-11975a70] .el-form-item {
1
+ .panel-content[data-v-e716c04f] .el-form-item {
2
2
  margin-bottom: 10px;
3
3
  }
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./HorizontallyTopToolbar.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _HorizontallyTopToolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f42f3be5"]]);
4
+ const _HorizontallyTopToolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-75b81512"]]);
5
5
  export {
6
6
  _HorizontallyTopToolbar as default
7
7
  };
@@ -192,7 +192,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
192
192
  }
193
193
  function handleActiveInteraction(event, tool) {
194
194
  if (!event.success) {
195
- ElMessage.error(event.message);
195
+ if (event.message) {
196
+ ElMessage.error(event.message);
197
+ }
196
198
  tool.component = void 0;
197
199
  const find = reactiveValue.activeIds.findIndex((t) => t == tool.id);
198
200
  if (find > -1) {