ym-giswidget-2d 1.0.82 → 1.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/draw/Draw.vue.d.ts +13 -3
- package/components/draw/Draw.vue.js +19 -5
- package/components/draw/index.d.ts +12 -4
- package/components/heatmap/Heatmap.vue.js +1 -1
- package/components/heatmap/Heatmap.vue2.js +9 -5
- package/components/heatmap/index.css +5 -9
- package/components/legend/Legend.vue.js +1 -1
- package/components/legend/index.css +2 -2
- package/package.json +2 -2
|
@@ -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?:
|
|
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
|
-
|
|
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
|
-
|
|
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, (
|
|
14
|
+
watch(() => props.geometryType, () => {
|
|
15
15
|
init();
|
|
16
16
|
});
|
|
17
|
-
watch(() => props.map.currentEditLayer, (
|
|
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?:
|
|
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
|
-
|
|
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?:
|
|
13
|
+
geometryType?: import('ym-gis-2d/interaction/Draw').DrawGeometryType;
|
|
10
14
|
style?: import('ym-gis-2d/entity/style/IStyle').default;
|
|
11
15
|
}> & Readonly<{
|
|
12
|
-
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Heatmap.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const _Heatmap = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const _Heatmap = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-86446aae"]]);
|
|
5
5
|
export {
|
|
6
6
|
_Heatmap as default
|
|
7
7
|
};
|
|
@@ -10,7 +10,7 @@ import DraggablePanel from "../../panel/DraggablePanel.vue.js";
|
|
|
10
10
|
import { Heatmap } from "ol/layer";
|
|
11
11
|
import { Vector } from "ol/source";
|
|
12
12
|
import { Feature } from "ol";
|
|
13
|
-
import { Point } from "ol/geom";
|
|
13
|
+
import { Point, MultiPoint } from "ol/geom";
|
|
14
14
|
const _hoisted_1 = { class: "heatmap-widget-host" };
|
|
15
15
|
const _hoisted_2 = { class: "control-panel" };
|
|
16
16
|
const _hoisted_3 = { class: "panel-section" };
|
|
@@ -74,21 +74,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
emit("activeInteraction", { success: false, message: "" });
|
|
75
75
|
}
|
|
76
76
|
function changeSourceData() {
|
|
77
|
-
var _a, _b;
|
|
77
|
+
var _a, _b, _c;
|
|
78
78
|
const heatLayer = getHeatLayer();
|
|
79
79
|
heatLayer.title = (_a = reactiveValue.sourceData) == null ? void 0 : _a.title;
|
|
80
80
|
(_b = heatLayer.getSource()) == null ? void 0 : _b.clear();
|
|
81
81
|
const selectedData = reactiveValue.sourceData;
|
|
82
|
-
if (selectedData) {
|
|
82
|
+
if ((_c = selectedData == null ? void 0 : selectedData.points) == null ? void 0 : _c.length) {
|
|
83
83
|
const vectorSource = heatLayer.getSource();
|
|
84
|
+
const coords = [];
|
|
84
85
|
selectedData.points.forEach((pt) => {
|
|
86
|
+
const coordinate = [pt.x, pt.y];
|
|
87
|
+
coords.push(coordinate);
|
|
85
88
|
const feature = new Feature({
|
|
86
|
-
geometry: new Point(
|
|
89
|
+
geometry: new Point(coordinate),
|
|
87
90
|
weight: pt.weight
|
|
88
91
|
});
|
|
89
92
|
vectorSource == null ? void 0 : vectorSource.addFeature(feature);
|
|
90
93
|
});
|
|
91
94
|
heatLayer.setSource(vectorSource);
|
|
95
|
+
props.map.locationGeometry(new MultiPoint(coords), void 0, 1.2, false);
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
function getHeatLayer() {
|
|
@@ -124,7 +128,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
124
128
|
ref: "locationRef",
|
|
125
129
|
class: "el-current",
|
|
126
130
|
title: "热力图控制",
|
|
127
|
-
drag:
|
|
131
|
+
drag: true,
|
|
128
132
|
width: 320,
|
|
129
133
|
height: props.data.length > 1 ? 458 : 408,
|
|
130
134
|
showMaximize: false,
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
.heatmap-widget-host[data-v-
|
|
1
|
+
.heatmap-widget-host[data-v-86446aae] {
|
|
2
2
|
position: absolute;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10;
|
|
5
5
|
pointer-events: none;
|
|
6
6
|
}
|
|
7
|
-
.heatmap-widget-host[data-v-
|
|
8
|
-
position: absolute !important;
|
|
9
|
-
left: 12px;
|
|
10
|
-
top: 12px;
|
|
11
|
-
transform: none !important;
|
|
7
|
+
.heatmap-widget-host[data-v-86446aae] .el-current.draggable-panel {
|
|
12
8
|
pointer-events: auto;
|
|
13
9
|
max-height: calc(100% - 24px);
|
|
14
10
|
}
|
|
15
|
-
.control-panel[data-v-
|
|
11
|
+
.control-panel[data-v-86446aae] {
|
|
16
12
|
padding: 0px 10px;
|
|
17
13
|
}
|
|
18
|
-
.control-panel .gradient-preview[data-v-
|
|
14
|
+
.control-panel .gradient-preview[data-v-86446aae] {
|
|
19
15
|
height: 25px;
|
|
20
16
|
border-radius: 5px;
|
|
21
17
|
margin-bottom: 10px;
|
|
22
18
|
border: 1px solid #ddd;
|
|
23
19
|
}
|
|
24
|
-
.control-panel .legend[data-v-
|
|
20
|
+
.control-panel .legend[data-v-86446aae] {
|
|
25
21
|
display: flex;
|
|
26
22
|
justify-content: space-between;
|
|
27
23
|
font-size: 0.85rem;
|
|
@@ -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-
|
|
4
|
+
const _Legend = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8a0f0076"]]);
|
|
5
5
|
export {
|
|
6
6
|
_Legend as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.legend-container[data-v-
|
|
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-
|
|
8
|
+
.legend-container[data-v-8a0f0076] .legend {
|
|
9
9
|
color: var(--system-primary-text-color);
|
|
10
10
|
margin: 9px;
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ym-giswidget-2d",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.84",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"element-plus": "^2.9.0",
|
|
11
11
|
"jszip": "^3.10.1",
|
|
12
12
|
"ol": "^9.2.4",
|
|
13
|
-
"ym-gis-2d": "1.0.
|
|
13
|
+
"ym-gis-2d": "1.0.53"
|
|
14
14
|
}
|
|
15
15
|
}
|