@summeruse/ol 0.2.0-alpha.0 → 0.2.0-alpha.1
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/CHANGELOG.md +8 -0
- package/dist/index.js +689 -816
- package/es/components/index.mjs +3 -0
- package/es/components/ol-map/index.mjs +3 -0
- package/es/components/ol-map/index.vue_vue_type_script_setup_true_lang.mjs +114 -0
- package/es/components/ol-map/index2.mjs +2 -0
- package/es/components/ol-map/props.mjs +5 -8
- package/es/composables/common/index.mjs +4 -6
- package/es/composables/index.mjs +6 -0
- package/es/composables/useContextmenu/index.mjs +70 -76
- package/es/composables/useDrawLineString/index.mjs +104 -112
- package/es/composables/useDrawPolygon/index.mjs +105 -115
- package/es/composables/useGraticule/index.mjs +22 -36
- package/es/composables/usePointermove/index.mjs +100 -99
- package/es/composables/useSwitchBaseLayer/index.mjs +16 -24
- package/es/constants/distance.mjs +2 -4
- package/es/constants/projection.mjs +2 -7
- package/es/index.mjs +19 -76
- package/es/utils/distance/index.mjs +6 -9
- package/es/utils/feature/index.mjs +66 -82
- package/es/utils/index.d.ts +0 -3
- package/es/utils/index.mjs +5 -0
- package/es/utils/layer/index.d.ts +1 -1
- package/es/utils/layer/index.mjs +47 -60
- package/es/utils/projection/index.mjs +15 -24
- package/es/utils/style/index.mjs +27 -31
- package/lib/_virtual/rolldown_runtime.js +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/ol-map/index.js +1 -0
- package/lib/components/ol-map/index.vue_vue_type_script_setup_true_lang.js +1 -0
- package/lib/components/ol-map/index2.js +1 -0
- package/lib/components/ol-map/props.js +1 -1
- package/lib/composables/common/index.js +1 -1
- package/lib/composables/index.js +1 -0
- package/lib/composables/useContextmenu/index.js +1 -1
- package/lib/composables/useDrawLineString/index.js +1 -1
- package/lib/composables/useDrawPolygon/index.js +1 -1
- package/lib/composables/useGraticule/index.js +1 -1
- package/lib/composables/usePointermove/index.js +1 -1
- package/lib/composables/useSwitchBaseLayer/index.js +1 -1
- package/lib/constants/distance.js +1 -1
- package/lib/constants/projection.js +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/distance/index.js +1 -1
- package/lib/utils/feature/index.js +1 -1
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/index.js +1 -0
- package/lib/utils/layer/index.d.ts +1 -1
- package/lib/utils/layer/index.js +1 -1
- package/lib/utils/projection/index.js +1 -1
- package/lib/utils/style/index.js +1 -1
- package/package.json +4 -11
- package/es/components/ol-map/index.vue.mjs +0 -124
- package/es/components/ol-map/index.vue2.mjs +0 -4
- package/es/utils/calculate/index.d.ts +0 -24
- package/es/utils/calculate/index.mjs +0 -29
- package/es/utils/calculate/index.test.d.ts +0 -1
- package/es/utils/format/index.d.ts +0 -4
- package/es/utils/format/index.mjs +0 -10
- package/es/utils/realCircle/index.d.ts +0 -9
- package/es/utils/realCircle/index.mjs +0 -10
- package/lib/components/ol-map/index.vue.js +0 -1
- package/lib/components/ol-map/index.vue2.js +0 -1
- package/lib/utils/calculate/index.d.ts +0 -24
- package/lib/utils/calculate/index.js +0 -1
- package/lib/utils/calculate/index.test.d.ts +0 -1
- package/lib/utils/format/index.d.ts +0 -4
- package/lib/utils/format/index.js +0 -1
- package/lib/utils/realCircle/index.d.ts +0 -9
- package/lib/utils/realCircle/index.js +0 -1
|
@@ -1,116 +1,106 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "ol/layer";
|
|
10
|
-
import "ol/source";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
stop: E,
|
|
106
|
-
clear: G,
|
|
107
|
-
setFeatures: S,
|
|
108
|
-
reset: O,
|
|
109
|
-
features: m,
|
|
110
|
-
coordinates: b,
|
|
111
|
-
destroy: h
|
|
112
|
-
};
|
|
1
|
+
import { createStyle } from "../../utils/style/index.mjs";
|
|
2
|
+
import "../../utils/index.mjs";
|
|
3
|
+
import { createToolTipElement } from "../common/index.mjs";
|
|
4
|
+
import { computed, onMounted, onUnmounted, ref, render } from "vue";
|
|
5
|
+
import { Feature, Overlay } from "ol";
|
|
6
|
+
import { Draw, Modify } from "ol/interaction";
|
|
7
|
+
import { getCenter } from "ol/extent";
|
|
8
|
+
import { Polygon } from "ol/geom";
|
|
9
|
+
import VectorLayer from "ol/layer/Vector";
|
|
10
|
+
import VectorSource from "ol/source/Vector";
|
|
11
|
+
function useDrawPolygon(h, g) {
|
|
12
|
+
let _ = ref(!0), v = ref([]), y = computed(() => v.value.map((e) => e.getGeometry().getCoordinates())), b = g.styleOptions ? createStyle(g.styleOptions) : g?.style, x = new VectorSource(), S = new VectorLayer({
|
|
13
|
+
source: x,
|
|
14
|
+
style: b,
|
|
15
|
+
zIndex: g?.zIndex
|
|
16
|
+
});
|
|
17
|
+
h.addLayer(S);
|
|
18
|
+
let C = new Draw({
|
|
19
|
+
source: x,
|
|
20
|
+
style: (g.drawStyleOptions ? createStyle(g.drawStyleOptions) : g?.drawStyle) || b,
|
|
21
|
+
type: "Polygon"
|
|
22
|
+
});
|
|
23
|
+
C.setActive(!1);
|
|
24
|
+
let w = new Modify({
|
|
25
|
+
source: x,
|
|
26
|
+
style: (g.modifyStyleOptions ? createStyle(g.modifyStyleOptions) : g?.modifyStyle) || b
|
|
27
|
+
}), T = /* @__PURE__ */ new Set();
|
|
28
|
+
h.addInteraction(C), onMounted(() => {
|
|
29
|
+
h.addInteraction(w);
|
|
30
|
+
}), x.on("addfeature", () => {
|
|
31
|
+
g.size && x.getFeatures().length >= g.size && C.setActive(!1);
|
|
32
|
+
}), x.on("removefeature", () => {
|
|
33
|
+
g.size && x.getFeatures().length < g.size && C.setActive(!0);
|
|
34
|
+
});
|
|
35
|
+
let E = () => {
|
|
36
|
+
T.forEach((e) => {
|
|
37
|
+
h.removeOverlay(e);
|
|
38
|
+
}), T.clear();
|
|
39
|
+
};
|
|
40
|
+
x.on("change", () => {
|
|
41
|
+
E(), x.getFeatures().forEach((e) => {
|
|
42
|
+
let u = e.getGeometry(), d = getCenter(u.getExtent()), f = document.createElement("div");
|
|
43
|
+
g.deleteFeatureLabel ? render(g.deleteFeatureLabel, f) : f = createToolTipElement("删除区域"), f.addEventListener("click", () => {
|
|
44
|
+
x.removeFeature(e);
|
|
45
|
+
});
|
|
46
|
+
let p = new Overlay({
|
|
47
|
+
position: d,
|
|
48
|
+
positioning: "center-center",
|
|
49
|
+
element: f
|
|
50
|
+
});
|
|
51
|
+
T.add(p), h.addOverlay(p);
|
|
52
|
+
let m = u.getCoordinates()[0];
|
|
53
|
+
m.length < 3 || m.forEach((u, d) => {
|
|
54
|
+
let f = document.createElement("div");
|
|
55
|
+
g.deletePointLabel ? render(g.deletePointLabel, f) : f = createToolTipElement("删除点"), f.addEventListener("click", () => {
|
|
56
|
+
e.setGeometry(new Polygon([m.filter((e, l) => l !== d)]));
|
|
57
|
+
});
|
|
58
|
+
let p = new Overlay({
|
|
59
|
+
position: u,
|
|
60
|
+
positioning: "top-center",
|
|
61
|
+
offset: [0, -30],
|
|
62
|
+
element: f
|
|
63
|
+
});
|
|
64
|
+
T.add(p), h.addOverlay(p);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}), C.on("change:active", () => {
|
|
68
|
+
_.value = C.getActive();
|
|
69
|
+
}), x.on("change", () => {
|
|
70
|
+
v.value = x.getFeatures();
|
|
71
|
+
});
|
|
72
|
+
let D = () => {
|
|
73
|
+
E(), h.removeLayer(S), h.removeInteraction(C), h.removeInteraction(w);
|
|
74
|
+
}, O = () => {
|
|
75
|
+
g.size && v.value.length >= g.size || C.setActive(!0);
|
|
76
|
+
}, k = () => {
|
|
77
|
+
C.setActive(!1);
|
|
78
|
+
}, A = (e) => {
|
|
79
|
+
x.clear(), e?.forEach((e) => {
|
|
80
|
+
e.forEach((e) => {
|
|
81
|
+
if (e.length < 2) return;
|
|
82
|
+
e[0] !== e[e.length - 1] && e.push(e[0]);
|
|
83
|
+
let l = new Feature({ geometry: new Polygon([e]) });
|
|
84
|
+
x.addFeature(l);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}, j = () => {
|
|
88
|
+
A(g.defaultCoordinates);
|
|
89
|
+
};
|
|
90
|
+
return j(), onUnmounted(() => {
|
|
91
|
+
D();
|
|
92
|
+
}), {
|
|
93
|
+
inDraw: _,
|
|
94
|
+
start: O,
|
|
95
|
+
stop: k,
|
|
96
|
+
clear: () => {
|
|
97
|
+
x.clear(), k();
|
|
98
|
+
},
|
|
99
|
+
setFeatures: A,
|
|
100
|
+
reset: j,
|
|
101
|
+
features: v,
|
|
102
|
+
coordinates: y,
|
|
103
|
+
destroy: D
|
|
104
|
+
};
|
|
113
105
|
}
|
|
114
|
-
export {
|
|
115
|
-
me as useDrawPolygon
|
|
116
|
-
};
|
|
106
|
+
export { useDrawPolygon };
|
|
@@ -1,37 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { ref
|
|
4
|
-
import "
|
|
5
|
-
import "ol";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (p.setMap(null), L) {
|
|
23
|
-
const c = k(t.olMap);
|
|
24
|
-
c && p.setMap(c);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
immediate: !0,
|
|
29
|
-
deep: !0
|
|
30
|
-
}
|
|
31
|
-
), {
|
|
32
|
-
showGraticule: l
|
|
33
|
-
};
|
|
1
|
+
import { createTextStyle } from "../../utils/style/index.mjs";
|
|
2
|
+
import "../../utils/index.mjs";
|
|
3
|
+
import { ref, toValue, watch } from "vue";
|
|
4
|
+
import { Stroke } from "ol/style";
|
|
5
|
+
import { Graticule } from "ol/layer";
|
|
6
|
+
function useGraticule(o) {
|
|
7
|
+
let s = ref(o.defaultShow || !1), { strokeStyleOption: c, strokeStyle: l, labelStyleOption: u, latLabelStyleOption: d, lonLabelStyleOption: f, latLabelStyle: p, lonLabelStyle: m,...h } = o.graticuleOptions || {}, g = c ? new Stroke(c) : l, _ = u ? createTextStyle(u) : void 0, v = (d ? createTextStyle(d) : p) || _, y = (f ? createTextStyle(f) : m) || _, b = new Graticule({
|
|
8
|
+
...h,
|
|
9
|
+
strokeStyle: g,
|
|
10
|
+
latLabelStyle: v,
|
|
11
|
+
lonLabelStyle: y
|
|
12
|
+
});
|
|
13
|
+
return watch(s, (e) => {
|
|
14
|
+
if (b.setMap(null), e) {
|
|
15
|
+
let e = toValue(o.olMap);
|
|
16
|
+
e && b.setMap(e);
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
immediate: !0,
|
|
20
|
+
deep: !0
|
|
21
|
+
}), { showGraticule: s };
|
|
34
22
|
}
|
|
35
|
-
export {
|
|
36
|
-
B as useGraticule
|
|
37
|
-
};
|
|
23
|
+
export { useGraticule };
|
|
@@ -1,100 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
import { computed, onBeforeUnmount, ref, toValue, watch } from "vue";
|
|
2
|
+
import { getCenter } from "ol/extent";
|
|
3
|
+
function usePointermove(o, s) {
|
|
4
|
+
let c = ref(!1), l = ref({
|
|
5
|
+
x: 0,
|
|
6
|
+
y: 0
|
|
7
|
+
}), u = ref(), d = ref(), f = ref({
|
|
8
|
+
x: 0,
|
|
9
|
+
y: 0
|
|
10
|
+
}), p = ref(), m = ref(), h = computed(() => ({
|
|
11
|
+
x: l.value.x + f.value.x,
|
|
12
|
+
y: l.value.y + f.value.y
|
|
13
|
+
})), g, _ = "";
|
|
14
|
+
function v(e) {
|
|
15
|
+
let t = toValue(s).filter((t) => {
|
|
16
|
+
let n = t.visible;
|
|
17
|
+
return typeof n == "function" ? n(e) : n ?? !0;
|
|
18
|
+
});
|
|
19
|
+
return t.length === 0 ? null : t.sort((e, t) => (t.priority ?? 0) - (e.priority ?? 0))[0];
|
|
20
|
+
}
|
|
21
|
+
function y(e) {
|
|
22
|
+
if (!g) return;
|
|
23
|
+
let t = g.getEventCoordinate(e);
|
|
24
|
+
p.value = t;
|
|
25
|
+
let n = g.getEventPixel(e), r, i;
|
|
26
|
+
if (g.forEachFeatureAtPixel(n, (e, t) => (r = e, i = t, !0)), !r) {
|
|
27
|
+
b();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
u.value = r;
|
|
31
|
+
let o = {
|
|
32
|
+
map: g,
|
|
33
|
+
position: {
|
|
34
|
+
x: e.clientX,
|
|
35
|
+
y: e.clientY
|
|
36
|
+
},
|
|
37
|
+
coordinate: t,
|
|
38
|
+
feature: r,
|
|
39
|
+
layer: i
|
|
40
|
+
}, s = v(o);
|
|
41
|
+
if (s) {
|
|
42
|
+
let { content: e, cursor: t, visible: n, fixedFeatureCenter: r, offset: i, priority: a,...o } = s;
|
|
43
|
+
m.value = { ...o };
|
|
44
|
+
}
|
|
45
|
+
if (!s) {
|
|
46
|
+
b();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
f.value = {
|
|
50
|
+
x: s.offset?.x ?? 0,
|
|
51
|
+
y: s.offset?.y ?? 0
|
|
52
|
+
};
|
|
53
|
+
let h = s.fixedFeatureCenter ?? !0, y = r.getGeometry();
|
|
54
|
+
if (h && y) {
|
|
55
|
+
let e = getCenter(y.getExtent()), t = g.getPixelFromCoordinate(e), { top: n, left: r } = g.getViewport().getBoundingClientRect();
|
|
56
|
+
l.value.x = t[0] + r, l.value.y = t[1] + n;
|
|
57
|
+
} else l.value = {
|
|
58
|
+
x: e.clientX,
|
|
59
|
+
y: e.clientY
|
|
60
|
+
};
|
|
61
|
+
let x = s.content;
|
|
62
|
+
d.value = typeof x == "function" ? () => x(o) : x;
|
|
63
|
+
let S = s.cursor, C = typeof S == "function" ? S(o) : S;
|
|
64
|
+
if (C && g) {
|
|
65
|
+
let e = g.getViewport();
|
|
66
|
+
_ ||= e.style.cursor, e.style.cursor = C;
|
|
67
|
+
}
|
|
68
|
+
c.value = !0;
|
|
69
|
+
}
|
|
70
|
+
function b() {
|
|
71
|
+
if (c.value = !1, u.value = void 0, g && _ !== void 0) {
|
|
72
|
+
let e = g.getViewport();
|
|
73
|
+
e.style.cursor = _, _ = "";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function x(e) {
|
|
77
|
+
if (!e) return;
|
|
78
|
+
let t = e.getViewport();
|
|
79
|
+
t.addEventListener("pointermove", y), t.addEventListener("pointerout", b);
|
|
80
|
+
}
|
|
81
|
+
function S(e) {
|
|
82
|
+
if (!e) return;
|
|
83
|
+
let t = e.getViewport();
|
|
84
|
+
t.removeEventListener("pointermove", y), t.removeEventListener("pointerout", b);
|
|
85
|
+
}
|
|
86
|
+
return watch(() => toValue(o), (e, t) => {
|
|
87
|
+
t !== e && (S(t), x(e), g = e);
|
|
88
|
+
}, { immediate: !0 }), onBeforeUnmount(() => {
|
|
89
|
+
S(g);
|
|
90
|
+
}), {
|
|
91
|
+
visible: computed(() => c.value),
|
|
92
|
+
position: computed(() => h.value),
|
|
93
|
+
originalPosition: computed(() => l.value),
|
|
94
|
+
feature: computed(() => u.value),
|
|
95
|
+
content: computed(() => d.value),
|
|
96
|
+
coordinate: computed(() => p.value),
|
|
97
|
+
option: computed(() => m.value),
|
|
98
|
+
hide: b
|
|
99
|
+
};
|
|
97
100
|
}
|
|
98
|
-
export {
|
|
99
|
-
O as usePointermove
|
|
100
|
-
};
|
|
101
|
+
export { usePointermove };
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
immediate: !0
|
|
20
|
-
}
|
|
21
|
-
), { visibleLayerName: r };
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
function useSwitchBaseLayer(n) {
|
|
3
|
+
let r = ref(n.defaultLayerName || Object.keys(n.layers)[0]);
|
|
4
|
+
return Object.values(n.layers).forEach((e) => {
|
|
5
|
+
e.forEach((e) => {
|
|
6
|
+
n.olMap.addLayer(e);
|
|
7
|
+
});
|
|
8
|
+
}), watch(r, () => {
|
|
9
|
+
Object.entries(n.layers).forEach(([e, t]) => {
|
|
10
|
+
let n = e === r.value;
|
|
11
|
+
t.forEach((e) => {
|
|
12
|
+
e.setVisible(n);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}, { immediate: !0 }), { visibleLayerName: r };
|
|
22
16
|
}
|
|
23
|
-
export {
|
|
24
|
-
f as useSwitchBaseLayer
|
|
25
|
-
};
|
|
17
|
+
export { useSwitchBaseLayer };
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
const
|
|
2
|
-
export {
|
|
3
|
-
o as EPSG_3857,
|
|
4
|
-
t as EPSG_4326,
|
|
5
|
-
n as WGS84Projection,
|
|
6
|
-
c as WebMercatorProjection
|
|
7
|
-
};
|
|
1
|
+
const EPSG_3857 = "EPSG:3857", EPSG_4326 = "EPSG:4326", WebMercatorProjection = EPSG_3857, WGS84Projection = EPSG_4326;
|
|
2
|
+
export { EPSG_3857, EPSG_4326, WGS84Projection, WebMercatorProjection };
|