ym-giswidget-2d 1.0.81 → 1.0.83

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.
@@ -1,13 +1,23 @@
1
1
  import { default as OLMap } from 'ym-gis-2d/mapView/Map';
2
+ import { DrawEvent, DrawGeometryType, ShEvent } from 'ym-gis-2d/interaction/Draw';
3
+ import { default as Feature } from 'ym-gis-2d/entity/Feature';
2
4
  import { default as IStyle } from 'ym-gis-2d/entity/style/IStyle';
3
5
  type __VLS_Props = {
4
6
  map: OLMap;
5
- geometryType?: "polygon" | "point" | "polyline" | "rectangle" | "circle";
7
+ geometryType?: DrawGeometryType;
6
8
  style?: IStyle;
7
9
  };
8
10
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- drawEnd: (...args: any[]) => void;
11
+ drawStart: (event: DrawEvent) => any;
12
+ drawEnd: (feature: Feature | undefined) => any;
13
+ drawAbort: (event: DrawEvent) => any;
14
+ drawAddPoint: (event: ShEvent) => any;
15
+ drawMoving: (event: DrawEvent) => any;
10
16
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- onDrawEnd?: ((...args: any[]) => any) | undefined;
17
+ onDrawStart?: ((event: DrawEvent) => any) | undefined;
18
+ onDrawEnd?: ((feature: Feature | undefined) => any) | undefined;
19
+ onDrawAbort?: ((event: DrawEvent) => any) | undefined;
20
+ onDrawAddPoint?: ((event: ShEvent) => any) | undefined;
21
+ onDrawMoving?: ((event: DrawEvent) => any) | undefined;
12
22
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
23
  export default _default;
@@ -7,14 +7,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  geometryType: {},
8
8
  style: {}
9
9
  },
10
- emits: ["drawEnd"],
10
+ emits: ["drawStart", "drawAddPoint", "drawMoving", "drawEnd", "drawAbort"],
11
11
  setup(__props, { emit: __emit }) {
12
12
  const emit = __emit;
13
13
  const props = __props;
14
- watch(() => props.geometryType, (newVal) => {
14
+ watch(() => props.geometryType, () => {
15
15
  init();
16
16
  });
17
- watch(() => props.map.currentEditLayer, (newVal) => {
17
+ watch(() => props.map.currentEditLayer, () => {
18
18
  init();
19
19
  });
20
20
  onMounted(() => {
@@ -52,6 +52,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
52
  style: props.style
53
53
  });
54
54
  props.map.interactionManager.addInteraction("draw", draw);
55
+ draw.on("drawStart", (event) => {
56
+ emit("drawStart", event);
57
+ });
58
+ draw.on("drawAddPoint", (event) => {
59
+ emit("drawAddPoint", event);
60
+ });
61
+ draw.on("drawMoving", (event) => {
62
+ emit("drawMoving", event);
63
+ });
55
64
  draw.on("drawEnd", (event) => {
56
65
  const features = event.feature;
57
66
  if (features) {
@@ -61,18 +70,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
70
  }
62
71
  emit("drawEnd", features);
63
72
  });
73
+ draw.on("drawAbort", (event) => {
74
+ emit("drawAbort", event);
75
+ });
64
76
  }
65
77
  function getTempLayerByGeometryType(geometryType) {
66
78
  switch (geometryType) {
67
79
  case "point":
68
80
  return props.map.getPointTempLayer();
69
81
  case "polyline":
82
+ case "dashline":
83
+ case "arrowline":
84
+ case "straightarrow":
70
85
  return props.map.getLineTempLayer();
71
86
  case "polygon":
72
- return props.map.getPolygonTempLayer();
73
87
  case "rectangle":
74
- return props.map.getPolygonTempLayer();
75
88
  case "circle":
89
+ case "arrow":
76
90
  return props.map.getPolygonTempLayer();
77
91
  default:
78
92
  return void 0;
@@ -1,14 +1,22 @@
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";
3
+ geometryType?: import('ym-gis-2d/interaction/Draw').DrawGeometryType;
4
4
  style?: import('ym-gis-2d/entity/style/IStyle').default;
5
5
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
- drawEnd: (...args: any[]) => void;
6
+ drawStart: (event: import('ym-gis-2d/interaction/Draw').DrawEvent) => any;
7
+ drawEnd: (feature: import('ym-gis-2d/entity/Feature').default | undefined) => any;
8
+ drawAbort: (event: import('ym-gis-2d/interaction/Draw').DrawEvent) => any;
9
+ drawAddPoint: (event: import('ym-gis-2d/interaction/Draw').ShEvent) => any;
10
+ drawMoving: (event: import('ym-gis-2d/interaction/Draw').DrawEvent) => any;
7
11
  }, string, import('vue').PublicProps, Readonly<{
8
12
  map: import('ym-gis-2d/mapView/Map').default;
9
- geometryType?: "polygon" | "point" | "polyline" | "rectangle" | "circle";
13
+ geometryType?: import('ym-gis-2d/interaction/Draw').DrawGeometryType;
10
14
  style?: import('ym-gis-2d/entity/style/IStyle').default;
11
15
  }> & Readonly<{
12
- onDrawEnd?: ((...args: any[]) => any) | undefined;
16
+ onDrawStart?: ((event: import('ym-gis-2d/interaction/Draw').DrawEvent) => any) | undefined;
17
+ onDrawEnd?: ((feature: import('ym-gis-2d/entity/Feature').default | undefined) => any) | undefined;
18
+ onDrawAbort?: ((event: import('ym-gis-2d/interaction/Draw').DrawEvent) => any) | undefined;
19
+ onDrawAddPoint?: ((event: import('ym-gis-2d/interaction/Draw').ShEvent) => any) | undefined;
20
+ onDrawMoving?: ((event: import('ym-gis-2d/interaction/Draw').DrawEvent) => any) | undefined;
13
21
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
14
22
  export default Draw;
@@ -1,14 +1,15 @@
1
+ import { ColorRampType } from 'ym-gis-2d/controls/LegendControl';
1
2
  import { IMapService } from 'ym-gis-2d/entity';
2
3
  import { default as OLMap } from 'ym-gis-2d/mapView/Map';
3
- /**
4
- * showGeodetic 是否显示经纬度坐标,默认为false。如果是true,则显示经纬度坐标,否则根据地图坐标系显示坐标
5
- */
6
4
  type __VLS_Props = {
7
5
  map: OLMap;
8
6
  data: IMapService[];
9
7
  title?: string;
8
+ colorRampType?: ColorRampType;
10
9
  };
11
- 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, {
10
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
+ colorRampType: ColorRampType;
12
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
12
13
  legendRef: HTMLDivElement;
13
14
  }, HTMLDivElement>;
14
15
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Legend.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _Legend = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-51b5f7d7"]]);
4
+ const _Legend = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8a0f0076"]]);
5
5
  export {
6
6
  _Legend as default
7
7
  };
@@ -5,7 +5,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  props: {
6
6
  map: {},
7
7
  data: {},
8
- title: {}
8
+ title: {},
9
+ colorRampType: { default: "segment" }
9
10
  },
10
11
  setup(__props) {
11
12
  const props = __props;
@@ -15,7 +16,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
16
  target: legendRef.value,
16
17
  className: "legend",
17
18
  layerInfos: props.data,
18
- title: props.title
19
+ title: props.title,
20
+ colorRampType: props.colorRampType
19
21
  });
20
22
  props.map.controlManager.addControl("legend", control);
21
23
  });
@@ -1,11 +1,11 @@
1
- .legend-container[data-v-51b5f7d7] {
1
+ .legend-container[data-v-8a0f0076] {
2
2
  position: absolute;
3
3
  left: 10px;
4
4
  top: 10px;
5
5
  background-color: var(--system-primary-color);
6
6
  border: 1px solid var(--system-primary-border-color);
7
7
  }
8
- .legend-container[data-v-51b5f7d7] .legend {
8
+ .legend-container[data-v-8a0f0076] .legend {
9
9
  color: var(--system-primary-text-color);
10
10
  margin: 9px;
11
11
  }
@@ -2,11 +2,15 @@ export declare const Legend: import('../../utils').WithInstall<import('vue').Def
2
2
  map: import('ym-gis-2d/mapView/Map').default;
3
3
  data: import('ym-gis-2d/entity').IMapService[];
4
4
  title?: string;
5
+ colorRampType?: import('ym-gis-2d/controls/LegendControl').ColorRampType;
5
6
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
6
7
  map: import('ym-gis-2d/mapView/Map').default;
7
8
  data: import('ym-gis-2d/entity').IMapService[];
8
9
  title?: string;
9
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
10
+ colorRampType?: import('ym-gis-2d/controls/LegendControl').ColorRampType;
11
+ }> & Readonly<{}>, {
12
+ colorRampType: import('ym-gis-2d/controls/LegendControl').ColorRampType;
13
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
10
14
  legendRef: HTMLDivElement;
11
15
  }, HTMLDivElement>>;
12
16
  export default Legend;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ym-giswidget-2d",
3
- "version": "1.0.81",
3
+ "version": "1.0.83",
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.51"
13
+ "ym-gis-2d": "1.0.53"
14
14
  }
15
15
  }