@summeruse/ol 0.1.0 → 0.1.1-beta.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 +10 -4
- package/dist/index.js +312 -327
- package/es/components/ol-map/index.test.d.ts +1 -0
- package/es/composables/useGraticule/index.d.ts +10 -2
- package/es/composables/useGraticule/index.mjs +25 -32
- package/es/utils/calculate/index.test.d.ts +1 -0
- package/lib/components/ol-map/index.test.d.ts +1 -0
- package/lib/composables/useGraticule/index.d.ts +10 -2
- package/lib/composables/useGraticule/index.js +1 -1
- package/lib/utils/calculate/index.test.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
# @summeruse/ol
|
|
2
2
|
|
|
3
|
-
## 0.1.
|
|
3
|
+
## 0.1.1-beta.1
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- e651b52: 添加经纬度标签样式支持
|
|
8
8
|
|
|
9
|
-
## 0.
|
|
9
|
+
## 0.1.1-beta.0
|
|
10
10
|
|
|
11
11
|
### Patch Changes
|
|
12
12
|
|
|
13
|
+
- c26ae5a: 重构 useGraticule 以支持更灵活的样式配置
|
|
14
|
+
|
|
15
|
+
## 0.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
13
19
|
- 8e34a3f: 添加 useDrawLineString useDrawPolygon
|
|
14
20
|
- b6b95dc: 添加创建几何要素的实用函数
|
|
15
21
|
- 58c1e99: 添加坐标系相关函数的注释
|
package/dist/index.js
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NDropdown as Re, NPopover as
|
|
3
|
-
import { RenderVNode as
|
|
4
|
-
import { Map as Ge, View as Be, Feature as
|
|
5
|
-
import { Zoom as
|
|
6
|
-
import { DragPan as
|
|
7
|
-
import { Point as De, LineString as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { destination as $e, lineString as
|
|
11
|
-
import { Circle as qe, Stroke as
|
|
12
|
-
import { Tile as
|
|
13
|
-
import { XYZ as
|
|
14
|
-
import { transform as
|
|
15
|
-
const Rt = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as U, ref as g, onMounted as N, createBlock as pe, openBlock as H, unref as Z, shallowRef as Ce, withCtx as ke, createVNode as Fe, watch as d, provide as Me, createElementBlock as Te, renderSlot as Ae, computed as Se, render as z, onUnmounted as he, toValue as _e } from "vue";
|
|
2
|
+
import { NDropdown as Re, NPopover as Ze } from "naive-ui";
|
|
3
|
+
import { RenderVNode as ze } from "@summeruse/common";
|
|
4
|
+
import { Map as Ge, View as Be, Feature as Q, Overlay as G } from "ol";
|
|
5
|
+
import { Zoom as oe, Attribution as re, Rotate as ie, FullScreen as ae, OverviewMap as ce, ScaleLine as le } from "ol/control";
|
|
6
|
+
import { DragPan as se, MouseWheelZoom as ue, DoubleClickZoom as fe, PinchRotate as de, PinchZoom as me, DragRotate as ye, KeyboardPan as ve, KeyboardZoom as we, Draw as Oe, Modify as Ee } from "ol/interaction";
|
|
7
|
+
import { Point as De, LineString as $, Polygon as K, Circle as Ne, MultiPoint as je, MultiLineString as Ve, MultiPolygon as We } from "ol/geom";
|
|
8
|
+
import q from "ol/layer/Vector";
|
|
9
|
+
import J from "ol/source/Vector";
|
|
10
|
+
import { destination as $e, lineString as Ke, length as Xe, area as Ye, polygon as Ue, bearing as He, midpoint as Qe } from "@turf/turf";
|
|
11
|
+
import { Circle as qe, Stroke as T, Fill as B, Text as Je, Icon as et, Style as tt } from "ol/style";
|
|
12
|
+
import { Tile as ee, Graticule as nt } from "ol/layer";
|
|
13
|
+
import { XYZ as ot, BingMaps as rt, OSM as it } from "ol/source";
|
|
14
|
+
import { transform as be, transformExtent as xe } from "ol/proj";
|
|
15
|
+
const Rt = /* @__PURE__ */ U({
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: {
|
|
18
18
|
olMap: {},
|
|
19
19
|
createOptions: { type: Function }
|
|
20
20
|
},
|
|
21
21
|
setup(t) {
|
|
22
|
-
const e = t, { olMap: n } = e,
|
|
22
|
+
const e = t, { olMap: n } = e, a = g({
|
|
23
23
|
visible: !1,
|
|
24
24
|
x: 0,
|
|
25
25
|
y: 0
|
|
26
26
|
});
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function r() {
|
|
28
|
+
a.value.visible = !1;
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
30
|
+
const i = g();
|
|
31
|
+
N(() => {
|
|
32
|
+
const f = n.getViewport();
|
|
33
|
+
f && (f.oncontextmenu = (s) => {
|
|
34
34
|
s.preventDefault();
|
|
35
|
-
const l = n.getEventPixel(s),
|
|
36
|
-
|
|
35
|
+
const l = n.getEventPixel(s), w = n.getEventCoordinate(s), y = n.getFeaturesAtPixel(l);
|
|
36
|
+
i.value = e.createOptions({ event: s, pixel: l, coordinate: w, features: y }), a.value = {
|
|
37
37
|
visible: !0,
|
|
38
38
|
x: s.clientX,
|
|
39
39
|
y: s.clientY
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
|
-
function c(
|
|
43
|
+
function c(f, s) {
|
|
44
44
|
const { onClick: l } = s;
|
|
45
|
-
l && l(),
|
|
45
|
+
l && l(), a.value.visible = !1;
|
|
46
46
|
}
|
|
47
|
-
return (
|
|
47
|
+
return (f, s) => (H(), pe(Z(Re), {
|
|
48
48
|
placement: "bottom-start",
|
|
49
49
|
trigger: "manual",
|
|
50
|
-
show:
|
|
51
|
-
x:
|
|
52
|
-
y:
|
|
53
|
-
options:
|
|
54
|
-
"on-clickoutside":
|
|
50
|
+
show: i.value && i.value.length > 0 && a.value.visible,
|
|
51
|
+
x: a.value.x,
|
|
52
|
+
y: a.value.y,
|
|
53
|
+
options: i.value,
|
|
54
|
+
"on-clickoutside": r,
|
|
55
55
|
onSelect: c
|
|
56
56
|
}, null, 8, ["show", "x", "y", "options"]));
|
|
57
57
|
}
|
|
58
|
-
}),
|
|
58
|
+
}), Zt = /* @__PURE__ */ U({
|
|
59
59
|
__name: "index",
|
|
60
60
|
props: {
|
|
61
61
|
olMap: {},
|
|
62
62
|
createOptions: { type: Function }
|
|
63
63
|
},
|
|
64
64
|
setup(t) {
|
|
65
|
-
const e = t, n =
|
|
65
|
+
const e = t, n = g({
|
|
66
66
|
visible: !1,
|
|
67
67
|
x: 0,
|
|
68
68
|
y: 0
|
|
69
|
-
}),
|
|
70
|
-
return
|
|
71
|
-
var
|
|
72
|
-
(
|
|
73
|
-
const l = e.olMap.getFeaturesAtPixel(s.pixel), { clientX:
|
|
69
|
+
}), a = Ce(), r = g("bottom-start"), i = g(!1), c = g(!1);
|
|
70
|
+
return N(() => {
|
|
71
|
+
var f;
|
|
72
|
+
(f = e.olMap) == null || f.on("pointermove", (s) => {
|
|
73
|
+
const l = e.olMap.getFeaturesAtPixel(s.pixel), { clientX: w, clientY: y } = s.originalEvent;
|
|
74
74
|
n.value.visible = !1;
|
|
75
75
|
const m = e.createOptions({
|
|
76
76
|
pixel: s.pixel,
|
|
77
77
|
coordinate: s.coordinate,
|
|
78
78
|
features: l
|
|
79
79
|
});
|
|
80
|
-
m && (
|
|
80
|
+
m && (a.value = m.content, r.value = m.placement || "bottom-start", c.value = m.showArrow || !1, i.value = m.raw || !1, n.value.visible = !0, n.value.x = w, n.value.y = y);
|
|
81
81
|
});
|
|
82
|
-
}), (
|
|
82
|
+
}), (f, s) => (H(), pe(Z(Ze), {
|
|
83
83
|
"show-arrow": c.value,
|
|
84
|
-
raw:
|
|
85
|
-
placement:
|
|
84
|
+
raw: i.value,
|
|
85
|
+
placement: r.value,
|
|
86
86
|
show: n.value.visible,
|
|
87
87
|
x: n.value.x,
|
|
88
88
|
y: n.value.y,
|
|
@@ -93,12 +93,12 @@ const Rt = /* @__PURE__ */ Y({
|
|
|
93
93
|
}
|
|
94
94
|
}, {
|
|
95
95
|
default: ke(() => [
|
|
96
|
-
Fe(
|
|
96
|
+
Fe(Z(ze), { "dynamic-v-node": a.value }, null, 8, ["dynamic-v-node"])
|
|
97
97
|
]),
|
|
98
98
|
_: 1
|
|
99
99
|
}, 8, ["show-arrow", "raw", "placement", "show", "x", "y"]));
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), at = Symbol("olMapInjectionKey"), zt = /* @__PURE__ */ U({
|
|
102
102
|
__name: "index",
|
|
103
103
|
props: {
|
|
104
104
|
olMap: { default: () => new Ge() },
|
|
@@ -123,93 +123,93 @@ const Rt = /* @__PURE__ */ Y({
|
|
|
123
123
|
altShiftDragRotate: { type: Boolean }
|
|
124
124
|
},
|
|
125
125
|
setup(t, { expose: e }) {
|
|
126
|
-
const n = t,
|
|
126
|
+
const n = t, a = g(), r = n.olMap, i = new Be({
|
|
127
127
|
projection: n.projection,
|
|
128
128
|
extent: n.extent
|
|
129
129
|
});
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
r.setView(i), d(() => n.zoom, (o) => {
|
|
131
|
+
i.setZoom(o);
|
|
132
132
|
}, {
|
|
133
133
|
immediate: !0
|
|
134
|
-
}),
|
|
135
|
-
|
|
134
|
+
}), d(() => n.center, (o) => {
|
|
135
|
+
i.setCenter(o);
|
|
136
136
|
}, {
|
|
137
137
|
immediate: !0
|
|
138
|
-
}),
|
|
139
|
-
|
|
138
|
+
}), d(() => n.constrainResolution, (o) => {
|
|
139
|
+
i.setConstrainResolution(o);
|
|
140
140
|
}, {
|
|
141
141
|
immediate: !0
|
|
142
|
-
}),
|
|
143
|
-
|
|
142
|
+
}), d(() => n.minZoom, (o) => {
|
|
143
|
+
o && i.setMinZoom(o);
|
|
144
144
|
}, {
|
|
145
145
|
immediate: !0
|
|
146
|
-
}),
|
|
147
|
-
|
|
146
|
+
}), d(() => n.maxZoom, (o) => {
|
|
147
|
+
o && i.setMaxZoom(o);
|
|
148
148
|
}, {
|
|
149
149
|
immediate: !0
|
|
150
|
-
}),
|
|
151
|
-
|
|
150
|
+
}), d(a, (o) => {
|
|
151
|
+
o && r.setTarget(o);
|
|
152
152
|
}), e({
|
|
153
|
-
olMap:
|
|
154
|
-
}), Me(
|
|
155
|
-
const c =
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
olMap: r
|
|
154
|
+
}), Me(at, r);
|
|
155
|
+
const c = r.getControls().getArray(), f = c.find((o) => o instanceof oe) || new oe(), s = c.find((o) => o instanceof re) || new re(), l = c.find((o) => o instanceof ie) || new ie(), w = c.find((o) => o instanceof ae) || new ae(), y = c.find((o) => o instanceof ce) || new ce(), m = c.find((o) => o instanceof le) || new le();
|
|
156
|
+
d(() => n.showZoom, (o) => {
|
|
157
|
+
f.setMap(o ? r : null);
|
|
158
158
|
}, {
|
|
159
159
|
immediate: !0
|
|
160
|
-
}),
|
|
161
|
-
s.setMap(
|
|
160
|
+
}), d(() => n.showAttribution, (o) => {
|
|
161
|
+
s.setMap(o ? r : null);
|
|
162
162
|
}, {
|
|
163
163
|
immediate: !0
|
|
164
|
-
}),
|
|
165
|
-
l.setMap(
|
|
164
|
+
}), d(() => n.showRotate, (o) => {
|
|
165
|
+
l.setMap(o ? r : null);
|
|
166
166
|
}, {
|
|
167
167
|
immediate: !0
|
|
168
|
-
}),
|
|
169
|
-
|
|
168
|
+
}), d(() => n.showFullScreen, (o) => {
|
|
169
|
+
w.setMap(o ? r : null);
|
|
170
170
|
}, {
|
|
171
171
|
immediate: !0
|
|
172
|
-
}),
|
|
173
|
-
|
|
172
|
+
}), d(() => n.showOverview, (o) => {
|
|
173
|
+
y.setMap(o ? r : null);
|
|
174
174
|
}, {
|
|
175
175
|
immediate: !0
|
|
176
|
-
}),
|
|
177
|
-
m.setMap(
|
|
176
|
+
}), d(() => n.showScale, (o) => {
|
|
177
|
+
m.setMap(o ? r : null);
|
|
178
178
|
}, {
|
|
179
179
|
immediate: !0
|
|
180
180
|
});
|
|
181
|
-
const
|
|
182
|
-
return
|
|
183
|
-
|
|
181
|
+
const v = r.getInteractions().getArray(), p = v.find((o) => o instanceof se) || new se(), E = v.find((o) => o instanceof ue) || new ue(), S = v.find((o) => o instanceof fe) || new fe(), b = v.find((o) => o instanceof de) || new de(), x = v.find((o) => o instanceof me) || new me(), I = v.find((o) => o instanceof ye) || new ye(), u = v.find((o) => o instanceof ve) || new ve(), h = v.find((o) => o instanceof we) || new we();
|
|
182
|
+
return r.removeInteraction(p), r.addInteraction(p), r.removeInteraction(E), r.addInteraction(E), r.removeInteraction(S), r.addInteraction(S), r.removeInteraction(b), r.addInteraction(b), r.removeInteraction(x), r.addInteraction(x), r.removeInteraction(I), r.addInteraction(I), r.removeInteraction(u), r.removeInteraction(h), d(() => n.dragPan, (o) => {
|
|
183
|
+
p.setActive(o);
|
|
184
184
|
}, {
|
|
185
185
|
immediate: !0
|
|
186
|
-
}),
|
|
187
|
-
|
|
186
|
+
}), d(() => n.mouseWheelZoom, (o) => {
|
|
187
|
+
E.setActive(o);
|
|
188
188
|
}, {
|
|
189
189
|
immediate: !0
|
|
190
|
-
}),
|
|
191
|
-
|
|
190
|
+
}), d(() => n.doubleClickZoom, (o) => {
|
|
191
|
+
S.setActive(o);
|
|
192
192
|
}, {
|
|
193
193
|
immediate: !0
|
|
194
|
-
}),
|
|
195
|
-
|
|
194
|
+
}), d(() => n.pinchRotate, (o) => {
|
|
195
|
+
b.setActive(o);
|
|
196
196
|
}, {
|
|
197
197
|
immediate: !0
|
|
198
|
-
}),
|
|
199
|
-
x.setActive(
|
|
198
|
+
}), d(() => n.pinchZoom, (o) => {
|
|
199
|
+
x.setActive(o);
|
|
200
200
|
}, {
|
|
201
201
|
immediate: !0
|
|
202
|
-
}),
|
|
203
|
-
I.setActive(
|
|
202
|
+
}), d(() => n.altShiftDragRotate, (o) => {
|
|
203
|
+
I.setActive(o);
|
|
204
204
|
}, {
|
|
205
205
|
immediate: !0
|
|
206
|
-
}), (
|
|
206
|
+
}), (o, O) => (H(), Te("div", {
|
|
207
207
|
ref_key: "mapRef",
|
|
208
|
-
ref:
|
|
208
|
+
ref: a
|
|
209
209
|
}, [
|
|
210
|
-
|
|
211
|
-
olMap:
|
|
212
|
-
mapRef:
|
|
210
|
+
Ae(o.$slots, "default", {
|
|
211
|
+
olMap: Z(r),
|
|
212
|
+
mapRef: a.value
|
|
213
213
|
})
|
|
214
214
|
], 512));
|
|
215
215
|
}
|
|
@@ -217,15 +217,15 @@ const Rt = /* @__PURE__ */ Y({
|
|
|
217
217
|
function X(t) {
|
|
218
218
|
return t < 0 ? X(t + 360) : t > 360 ? X(t - 360) : t;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return t < -180 ?
|
|
220
|
+
function Y(t) {
|
|
221
|
+
return t < -180 ? Y(t + 360) : t > 180 ? Y(t - 360) : t;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return $e(t, e,
|
|
223
|
+
function ct(t, e, n) {
|
|
224
|
+
return $e(t, e, Y(n), { units: "meters" }).geometry.coordinates;
|
|
225
225
|
}
|
|
226
226
|
function Gt(t) {
|
|
227
|
-
const e =
|
|
228
|
-
return
|
|
227
|
+
const e = Ke(t);
|
|
228
|
+
return Xe(e, { units: "meters" });
|
|
229
229
|
}
|
|
230
230
|
function Bt(t) {
|
|
231
231
|
return Ye(Ue(t));
|
|
@@ -233,73 +233,73 @@ function Bt(t) {
|
|
|
233
233
|
function Dt(t, e) {
|
|
234
234
|
return X(He(t, e));
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function lt(t, e) {
|
|
237
237
|
return Qe(t, e).geometry.coordinates;
|
|
238
238
|
}
|
|
239
239
|
function Le(t) {
|
|
240
|
-
return
|
|
240
|
+
return lt([t[0], t[1]], [t[2], t[3]]);
|
|
241
241
|
}
|
|
242
|
-
const Pe = 1852,
|
|
242
|
+
const Pe = 1852, A = "EPSG:3857", _ = "EPSG:4326", ge = A, st = _;
|
|
243
243
|
function Nt(t) {
|
|
244
244
|
return t * 1e3 / Pe;
|
|
245
245
|
}
|
|
246
246
|
function jt(t) {
|
|
247
247
|
return t * Pe / 1e3;
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
const { fillOptions: e, strokeOptions: n, ...
|
|
249
|
+
function ut(t) {
|
|
250
|
+
const { fillOptions: e, strokeOptions: n, ...a } = t;
|
|
251
251
|
return new qe({
|
|
252
|
-
...
|
|
253
|
-
fill: e ? new
|
|
254
|
-
stroke: n ? new
|
|
252
|
+
...a,
|
|
253
|
+
fill: e ? new B(e) : void 0,
|
|
254
|
+
stroke: n ? new T(n) : void 0
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
const { fillOptions: e, strokeOptions: n, backgroundFillOptions:
|
|
257
|
+
function R(t) {
|
|
258
|
+
const { fillOptions: e, strokeOptions: n, backgroundFillOptions: a, backgroundStrokeOptions: r, ...i } = t;
|
|
259
259
|
return new Je({
|
|
260
|
-
...
|
|
261
|
-
fill: e ? new
|
|
262
|
-
stroke: n ? new
|
|
263
|
-
backgroundFill:
|
|
264
|
-
backgroundStroke:
|
|
260
|
+
...i,
|
|
261
|
+
fill: e ? new B(e) : void 0,
|
|
262
|
+
stroke: n ? new T(n) : void 0,
|
|
263
|
+
backgroundFill: a ? new B(a) : void 0,
|
|
264
|
+
backgroundStroke: r ? new T(r) : void 0
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
-
function
|
|
268
|
-
const { fillOptions: e, strokeOptions: n, iconOptions:
|
|
267
|
+
function P(t) {
|
|
268
|
+
const { fillOptions: e, strokeOptions: n, iconOptions: a, circleOptions: r, textOptions: i, ...c } = t, f = e ? new B(e) : void 0, s = n ? new T(n) : void 0, l = a ? new et(a) : void 0, w = r ? ut(r) : void 0, y = i ? R(i) : void 0;
|
|
269
269
|
return new tt({
|
|
270
270
|
...c,
|
|
271
|
-
fill:
|
|
271
|
+
fill: f,
|
|
272
272
|
stroke: s,
|
|
273
|
-
image: l ||
|
|
274
|
-
text:
|
|
273
|
+
image: l || w,
|
|
274
|
+
text: y
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
function ft(t) {
|
|
278
278
|
return new De(t);
|
|
279
279
|
}
|
|
280
280
|
function dt(t) {
|
|
281
|
-
return new
|
|
281
|
+
return new $(t);
|
|
282
282
|
}
|
|
283
283
|
function mt(t) {
|
|
284
|
-
return new
|
|
284
|
+
return new K(t);
|
|
285
285
|
}
|
|
286
286
|
function yt(t, e) {
|
|
287
287
|
return new Ne(t, e);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function vt(t) {
|
|
290
290
|
return new je(t);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function wt(t) {
|
|
293
293
|
return new Ve(t);
|
|
294
294
|
}
|
|
295
295
|
function gt(t) {
|
|
296
296
|
return new We(t);
|
|
297
297
|
}
|
|
298
298
|
function k(t) {
|
|
299
|
-
const { styleOptions: e, ...n } = t ?? {},
|
|
300
|
-
return new
|
|
299
|
+
const { styleOptions: e, ...n } = t ?? {}, a = e ? P(e) : n.style;
|
|
300
|
+
return new Q({
|
|
301
301
|
...n,
|
|
302
|
-
style:
|
|
302
|
+
style: a
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
305
|
function Vt(t, e) {
|
|
@@ -323,22 +323,22 @@ function $t(t, e) {
|
|
|
323
323
|
geometry: n
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
const
|
|
326
|
+
function Kt(t, e, n) {
|
|
327
|
+
const a = yt(t, e);
|
|
328
328
|
return k({
|
|
329
329
|
...n,
|
|
330
|
-
geometry:
|
|
330
|
+
geometry: a
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const n =
|
|
333
|
+
function Xt(t, e) {
|
|
334
|
+
const n = vt(t);
|
|
335
335
|
return k({
|
|
336
336
|
...e,
|
|
337
337
|
geometry: n
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
function Yt(t, e) {
|
|
341
|
-
const n =
|
|
341
|
+
const n = wt(t);
|
|
342
342
|
return k({
|
|
343
343
|
...e,
|
|
344
344
|
geometry: n
|
|
@@ -351,16 +351,16 @@ function Ut(t, e) {
|
|
|
351
351
|
geometry: n
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
const { type: e = "img", projection: n = ge, key:
|
|
356
|
-
return `${
|
|
354
|
+
function pt(t) {
|
|
355
|
+
const { type: e = "img", projection: n = ge, key: a } = t, r = t.url || "https://t{0-4}.tianditu.gov.cn", i = `&tk=${a}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}`;
|
|
356
|
+
return `${r}/${e}_${n === st ? "c" : n === ge ? "w" : "c"}/wmts?LAYER=${e}${i}`;
|
|
357
357
|
}
|
|
358
358
|
function Ht(t) {
|
|
359
|
-
const { zIndex: e, projection: n, className:
|
|
360
|
-
return new
|
|
361
|
-
className:
|
|
362
|
-
source: new
|
|
363
|
-
url:
|
|
359
|
+
const { zIndex: e, projection: n, className: a } = t;
|
|
360
|
+
return new ee({
|
|
361
|
+
className: a,
|
|
362
|
+
source: new ot({
|
|
363
|
+
url: pt(t),
|
|
364
364
|
projection: n,
|
|
365
365
|
crossOrigin: "Anonymous"
|
|
366
366
|
}),
|
|
@@ -371,10 +371,10 @@ function Qt({
|
|
|
371
371
|
name: t,
|
|
372
372
|
zIndex: e,
|
|
373
373
|
key: n,
|
|
374
|
-
className:
|
|
374
|
+
className: a
|
|
375
375
|
}) {
|
|
376
|
-
return new
|
|
377
|
-
className:
|
|
376
|
+
return new ee({
|
|
377
|
+
className: a,
|
|
378
378
|
source: new rt({
|
|
379
379
|
key: n,
|
|
380
380
|
imagerySet: t,
|
|
@@ -384,278 +384,263 @@ function Qt({
|
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
386
|
function qt(t) {
|
|
387
|
-
return new
|
|
387
|
+
return new ee({
|
|
388
388
|
className: t == null ? void 0 : t.className,
|
|
389
|
-
source: new
|
|
389
|
+
source: new it({
|
|
390
390
|
crossOrigin: "Anonymous"
|
|
391
391
|
}),
|
|
392
392
|
zIndex: t == null ? void 0 : t.zIndex
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
395
|
function Jt(t) {
|
|
396
|
-
const { styleOptions: e, ...n } = t || {},
|
|
397
|
-
source:
|
|
396
|
+
const { styleOptions: e, ...n } = t || {}, a = e ? P(e) : void 0, r = new J(), i = new q({
|
|
397
|
+
source: r,
|
|
398
398
|
...n,
|
|
399
|
-
style:
|
|
399
|
+
style: a || n.style
|
|
400
400
|
});
|
|
401
401
|
return {
|
|
402
|
-
source:
|
|
403
|
-
layer:
|
|
402
|
+
source: r,
|
|
403
|
+
layer: i
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
return
|
|
408
|
-
}
|
|
409
|
-
const en = ee;
|
|
410
|
-
function pt(t) {
|
|
411
|
-
return xe(t, T, _);
|
|
406
|
+
function te(t) {
|
|
407
|
+
return be(t, _, A);
|
|
412
408
|
}
|
|
413
|
-
const
|
|
409
|
+
const en = te;
|
|
414
410
|
function St(t) {
|
|
415
|
-
return be(t,
|
|
411
|
+
return be(t, A, _);
|
|
416
412
|
}
|
|
417
|
-
const
|
|
418
|
-
function
|
|
419
|
-
return
|
|
413
|
+
const tn = St;
|
|
414
|
+
function ht(t) {
|
|
415
|
+
return xe(t, _, A);
|
|
420
416
|
}
|
|
421
|
-
const
|
|
422
|
-
function
|
|
423
|
-
|
|
424
|
-
for (let a = -180; a < 180; a = a + o)
|
|
425
|
-
i.push(at(t, e, a));
|
|
426
|
-
return [i];
|
|
417
|
+
const nn = ht;
|
|
418
|
+
function ne(t) {
|
|
419
|
+
return xe(t, A, _);
|
|
427
420
|
}
|
|
428
|
-
|
|
421
|
+
const on = ne;
|
|
422
|
+
function rn(t, e, n = 60) {
|
|
423
|
+
const a = [], r = 360 / n;
|
|
424
|
+
for (let i = -180; i < 180; i = i + r)
|
|
425
|
+
a.push(ct(t, e, i));
|
|
426
|
+
return [a];
|
|
427
|
+
}
|
|
428
|
+
function D(t) {
|
|
429
429
|
const e = document.createElement("div");
|
|
430
430
|
return e.innerHTML = t, e.style.cursor = "pointer", e.style.userSelect = "none", e.style.backgroundColor = "red", e.style.color = "white", e.style.borderRadius = "5px", e.style.padding = "0 5px", e.style.fontSize = "12px", e.style.border = "2px solid white", e;
|
|
431
431
|
}
|
|
432
432
|
function an(t, e) {
|
|
433
|
-
const n =
|
|
434
|
-
source:
|
|
433
|
+
const n = g(!0), a = g([]), r = Se(() => a.value.map((u) => u.getGeometry().getCoordinates())), i = new J(), c = e.styleOptions ? P(e.styleOptions) : e == null ? void 0 : e.style, f = new q({
|
|
434
|
+
source: i,
|
|
435
435
|
style: c,
|
|
436
436
|
zIndex: e == null ? void 0 : e.zIndex
|
|
437
437
|
});
|
|
438
|
-
t.addLayer(
|
|
439
|
-
const s = e.drawStyleOptions ?
|
|
440
|
-
source:
|
|
438
|
+
t.addLayer(f);
|
|
439
|
+
const s = e.drawStyleOptions ? P(e.drawStyleOptions) : e == null ? void 0 : e.drawStyle, l = new Oe({
|
|
440
|
+
source: i,
|
|
441
441
|
style: s || c,
|
|
442
442
|
type: "LineString"
|
|
443
443
|
});
|
|
444
444
|
l.setActive(!1);
|
|
445
|
-
const
|
|
446
|
-
source:
|
|
447
|
-
style:
|
|
445
|
+
const w = e.modifyStyleOptions ? P(e.modifyStyleOptions) : e == null ? void 0 : e.modifyStyle, y = new Ee({
|
|
446
|
+
source: i,
|
|
447
|
+
style: w || c
|
|
448
448
|
}), m = /* @__PURE__ */ new Set();
|
|
449
|
-
t.addInteraction(l),
|
|
450
|
-
t.addInteraction(
|
|
451
|
-
}),
|
|
452
|
-
e.size &&
|
|
453
|
-
}),
|
|
454
|
-
e.size &&
|
|
449
|
+
t.addInteraction(l), N(() => {
|
|
450
|
+
t.addInteraction(y);
|
|
451
|
+
}), i.on("addfeature", () => {
|
|
452
|
+
e.size && i.getFeatures().length >= e.size && l.setActive(!1);
|
|
453
|
+
}), i.on("removefeature", () => {
|
|
454
|
+
e.size && i.getFeatures().length < e.size && l.setActive(!0);
|
|
455
455
|
});
|
|
456
|
-
const
|
|
456
|
+
const v = () => {
|
|
457
457
|
m.forEach((u) => {
|
|
458
458
|
t.removeOverlay(u);
|
|
459
459
|
}), m.clear();
|
|
460
460
|
};
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
let
|
|
465
|
-
e.deleteFeatureLabel ? z(e.deleteFeatureLabel,
|
|
466
|
-
|
|
461
|
+
i.on("change", () => {
|
|
462
|
+
v(), i.getFeatures().forEach((u) => {
|
|
463
|
+
const h = u.getGeometry(), o = Le(ne(h.getExtent()));
|
|
464
|
+
let O = document.createElement("div");
|
|
465
|
+
e.deleteFeatureLabel ? z(e.deleteFeatureLabel, O) : O = D("删除线"), O.addEventListener("click", () => {
|
|
466
|
+
i.removeFeature(u);
|
|
467
467
|
});
|
|
468
|
-
const
|
|
469
|
-
position:
|
|
468
|
+
const F = new G({
|
|
469
|
+
position: te(o),
|
|
470
470
|
positioning: "center-center",
|
|
471
|
-
element:
|
|
471
|
+
element: O
|
|
472
472
|
});
|
|
473
|
-
m.add(
|
|
474
|
-
const C =
|
|
475
|
-
C.length < 3 || C.forEach((
|
|
476
|
-
let
|
|
477
|
-
e.deletePointLabel ? z(e.deletePointLabel,
|
|
478
|
-
u.setGeometry(new
|
|
473
|
+
m.add(F), t.addOverlay(F);
|
|
474
|
+
const C = h.getCoordinates();
|
|
475
|
+
C.length < 3 || C.forEach((j, V) => {
|
|
476
|
+
let L = document.createElement("div");
|
|
477
|
+
e.deletePointLabel ? z(e.deletePointLabel, L) : L = D("删除点"), L.addEventListener("click", () => {
|
|
478
|
+
u.setGeometry(new $(C.filter((Ie, W) => W !== V)));
|
|
479
479
|
});
|
|
480
|
-
const
|
|
481
|
-
position:
|
|
480
|
+
const M = new G({
|
|
481
|
+
position: j,
|
|
482
482
|
positioning: "top-center",
|
|
483
483
|
offset: [0, -30],
|
|
484
|
-
element:
|
|
484
|
+
element: L
|
|
485
485
|
});
|
|
486
|
-
m.add(
|
|
486
|
+
m.add(M), t.addOverlay(M);
|
|
487
487
|
});
|
|
488
488
|
});
|
|
489
489
|
}), l.on("change:active", () => {
|
|
490
490
|
n.value = l.getActive();
|
|
491
|
-
}),
|
|
492
|
-
|
|
491
|
+
}), i.on("change", () => {
|
|
492
|
+
a.value = i.getFeatures();
|
|
493
493
|
});
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
-
}, P = () => {
|
|
497
|
-
e.size && i.value.length >= e.size || l.setActive(!0);
|
|
494
|
+
const p = () => {
|
|
495
|
+
v(), t.removeLayer(f), t.removeInteraction(l), t.removeInteraction(y);
|
|
498
496
|
}, E = () => {
|
|
497
|
+
e.size && a.value.length >= e.size || l.setActive(!0);
|
|
498
|
+
}, S = () => {
|
|
499
499
|
l.setActive(!1);
|
|
500
|
-
},
|
|
501
|
-
|
|
502
|
-
if (
|
|
500
|
+
}, b = (u) => {
|
|
501
|
+
i.clear(), u.forEach((h) => {
|
|
502
|
+
if (h.length < 2)
|
|
503
503
|
return;
|
|
504
|
-
const
|
|
505
|
-
geometry: new
|
|
504
|
+
const o = new Q({
|
|
505
|
+
geometry: new $(h)
|
|
506
506
|
});
|
|
507
|
-
|
|
507
|
+
i.addFeature(o);
|
|
508
508
|
});
|
|
509
509
|
}, x = () => {
|
|
510
|
-
|
|
510
|
+
b(e.defaultCoordinates || []);
|
|
511
511
|
};
|
|
512
512
|
x();
|
|
513
513
|
const I = () => {
|
|
514
|
-
|
|
514
|
+
i.clear(), S();
|
|
515
515
|
};
|
|
516
|
-
return
|
|
517
|
-
|
|
516
|
+
return he(() => {
|
|
517
|
+
p();
|
|
518
518
|
}), {
|
|
519
519
|
inDraw: n,
|
|
520
|
-
start:
|
|
521
|
-
stop:
|
|
520
|
+
start: E,
|
|
521
|
+
stop: S,
|
|
522
522
|
clear: I,
|
|
523
|
-
setFeatures:
|
|
523
|
+
setFeatures: b,
|
|
524
524
|
reset: x,
|
|
525
|
-
features:
|
|
526
|
-
coordinates:
|
|
527
|
-
destroy:
|
|
525
|
+
features: a,
|
|
526
|
+
coordinates: r,
|
|
527
|
+
destroy: p
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
function cn(t, e) {
|
|
531
|
-
const n =
|
|
531
|
+
const n = g(!0), a = g([]), r = Se(() => a.value.map((u) => u.getGeometry().getCoordinates())), i = e.styleOptions ? P(e.styleOptions) : e == null ? void 0 : e.style, c = new J(), f = new q({
|
|
532
532
|
source: c,
|
|
533
|
-
style:
|
|
533
|
+
style: i,
|
|
534
534
|
zIndex: e == null ? void 0 : e.zIndex
|
|
535
535
|
});
|
|
536
|
-
t.addLayer(
|
|
537
|
-
const s = e.drawStyleOptions ?
|
|
536
|
+
t.addLayer(f);
|
|
537
|
+
const s = e.drawStyleOptions ? P(e.drawStyleOptions) : e == null ? void 0 : e.drawStyle, l = new Oe({
|
|
538
538
|
source: c,
|
|
539
|
-
style: s ||
|
|
539
|
+
style: s || i,
|
|
540
540
|
type: "Polygon"
|
|
541
541
|
});
|
|
542
542
|
l.setActive(!1);
|
|
543
|
-
const
|
|
543
|
+
const w = e.modifyStyleOptions ? P(e.modifyStyleOptions) : e == null ? void 0 : e.modifyStyle, y = new Ee({
|
|
544
544
|
source: c,
|
|
545
|
-
style:
|
|
545
|
+
style: w || i
|
|
546
546
|
}), m = /* @__PURE__ */ new Set();
|
|
547
|
-
t.addInteraction(l),
|
|
548
|
-
t.addInteraction(
|
|
547
|
+
t.addInteraction(l), N(() => {
|
|
548
|
+
t.addInteraction(y);
|
|
549
549
|
}), c.on("addfeature", () => {
|
|
550
550
|
e.size && c.getFeatures().length >= e.size && l.setActive(!1);
|
|
551
551
|
}), c.on("removefeature", () => {
|
|
552
552
|
e.size && c.getFeatures().length < e.size && l.setActive(!0);
|
|
553
553
|
});
|
|
554
|
-
const
|
|
554
|
+
const v = () => {
|
|
555
555
|
m.forEach((u) => {
|
|
556
556
|
t.removeOverlay(u);
|
|
557
557
|
}), m.clear();
|
|
558
558
|
};
|
|
559
559
|
c.on("change", () => {
|
|
560
|
-
|
|
561
|
-
const
|
|
562
|
-
let
|
|
563
|
-
e.deleteFeatureLabel ? z(e.deleteFeatureLabel,
|
|
560
|
+
v(), c.getFeatures().forEach((u) => {
|
|
561
|
+
const h = u.getGeometry(), o = Le(ne(h.getExtent()));
|
|
562
|
+
let O = document.createElement("div");
|
|
563
|
+
e.deleteFeatureLabel ? z(e.deleteFeatureLabel, O) : O = D("删除区域"), O.addEventListener("click", () => {
|
|
564
564
|
c.removeFeature(u);
|
|
565
565
|
});
|
|
566
|
-
const
|
|
567
|
-
position:
|
|
566
|
+
const F = new G({
|
|
567
|
+
position: te(o),
|
|
568
568
|
positioning: "center-center",
|
|
569
|
-
element:
|
|
569
|
+
element: O
|
|
570
570
|
});
|
|
571
|
-
m.add(
|
|
572
|
-
const C =
|
|
573
|
-
C.length < 3 || C.forEach((
|
|
574
|
-
let
|
|
575
|
-
e.deletePointLabel ? z(e.deletePointLabel,
|
|
576
|
-
u.setGeometry(new
|
|
571
|
+
m.add(F), t.addOverlay(F);
|
|
572
|
+
const C = h.getCoordinates()[0];
|
|
573
|
+
C.length < 3 || C.forEach((j, V) => {
|
|
574
|
+
let L = document.createElement("div");
|
|
575
|
+
e.deletePointLabel ? z(e.deletePointLabel, L) : L = D("删除点"), L.addEventListener("click", () => {
|
|
576
|
+
u.setGeometry(new K([C.filter((Ie, W) => W !== V)]));
|
|
577
577
|
});
|
|
578
|
-
const
|
|
579
|
-
position:
|
|
578
|
+
const M = new G({
|
|
579
|
+
position: j,
|
|
580
580
|
positioning: "top-center",
|
|
581
581
|
offset: [0, -30],
|
|
582
|
-
element:
|
|
582
|
+
element: L
|
|
583
583
|
});
|
|
584
|
-
m.add(
|
|
584
|
+
m.add(M), t.addOverlay(M);
|
|
585
585
|
});
|
|
586
586
|
});
|
|
587
587
|
}), l.on("change:active", () => {
|
|
588
588
|
n.value = l.getActive();
|
|
589
589
|
}), c.on("change", () => {
|
|
590
|
-
|
|
590
|
+
a.value = c.getFeatures();
|
|
591
591
|
});
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
}, P = () => {
|
|
595
|
-
e.size && i.value.length >= e.size || l.setActive(!0);
|
|
592
|
+
const p = () => {
|
|
593
|
+
v(), t.removeLayer(f), t.removeInteraction(l), t.removeInteraction(y);
|
|
596
594
|
}, E = () => {
|
|
595
|
+
e.size && a.value.length >= e.size || l.setActive(!0);
|
|
596
|
+
}, S = () => {
|
|
597
597
|
l.setActive(!1);
|
|
598
|
-
},
|
|
599
|
-
c.clear(), u == null || u.forEach((
|
|
600
|
-
|
|
601
|
-
if (
|
|
598
|
+
}, b = (u) => {
|
|
599
|
+
c.clear(), u == null || u.forEach((h) => {
|
|
600
|
+
h.forEach((o) => {
|
|
601
|
+
if (o.length < 2)
|
|
602
602
|
return;
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
geometry: new
|
|
603
|
+
o[0] !== o[o.length - 1] && o.push(o[0]);
|
|
604
|
+
const O = new Q({
|
|
605
|
+
geometry: new K([o])
|
|
606
606
|
});
|
|
607
|
-
c.addFeature(
|
|
607
|
+
c.addFeature(O);
|
|
608
608
|
});
|
|
609
609
|
});
|
|
610
610
|
}, x = () => {
|
|
611
|
-
|
|
611
|
+
b(e.defaultCoordinates);
|
|
612
612
|
};
|
|
613
613
|
x();
|
|
614
614
|
const I = () => {
|
|
615
|
-
c.clear(),
|
|
615
|
+
c.clear(), S();
|
|
616
616
|
};
|
|
617
|
-
return
|
|
618
|
-
|
|
617
|
+
return he(() => {
|
|
618
|
+
p();
|
|
619
619
|
}), {
|
|
620
620
|
inDraw: n,
|
|
621
|
-
start:
|
|
622
|
-
stop:
|
|
621
|
+
start: E,
|
|
622
|
+
stop: S,
|
|
623
623
|
clear: I,
|
|
624
|
-
setFeatures:
|
|
624
|
+
setFeatures: b,
|
|
625
625
|
reset: x,
|
|
626
|
-
features:
|
|
627
|
-
coordinates:
|
|
628
|
-
destroy:
|
|
626
|
+
features: a,
|
|
627
|
+
coordinates: r,
|
|
628
|
+
destroy: p
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
631
|
function ln(t) {
|
|
632
|
-
const e =
|
|
633
|
-
|
|
634
|
-
strokeStyle:
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
lineDash: [4, 4]
|
|
638
|
-
}),
|
|
639
|
-
showLabels: !0,
|
|
640
|
-
wrapX: !1,
|
|
641
|
-
zIndex: 1
|
|
632
|
+
const e = g(t.defaultShow || !1), { strokeStyleOption: n, strokeStyle: a, labelStyleOption: r, latLabelStyleOption: i, lonLabelStyleOption: c, latLabelStyle: f, lonLabelStyle: s, ...l } = t.graticuleOptions || {}, w = n ? new T(n) : a, y = r ? R(r) : void 0, m = (i ? R(i) : f) || y, v = (c ? R(c) : s) || y, p = new nt({
|
|
633
|
+
...l,
|
|
634
|
+
strokeStyle: w,
|
|
635
|
+
latLabelStyle: m,
|
|
636
|
+
lonLabelStyle: v
|
|
642
637
|
});
|
|
643
|
-
return
|
|
638
|
+
return d(
|
|
644
639
|
e,
|
|
645
|
-
(
|
|
646
|
-
if (
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
color: "#555",
|
|
650
|
-
width: 1.5,
|
|
651
|
-
lineDash: [4, 4]
|
|
652
|
-
}),
|
|
653
|
-
showLabels: !0,
|
|
654
|
-
wrapX: !1,
|
|
655
|
-
zIndex: 1
|
|
656
|
-
});
|
|
657
|
-
const o = _e(t.olMap);
|
|
658
|
-
o && n.setMap(o);
|
|
640
|
+
(E) => {
|
|
641
|
+
if (p.setMap(null), E) {
|
|
642
|
+
const S = _e(t.olMap);
|
|
643
|
+
S && p.setMap(S);
|
|
659
644
|
}
|
|
660
645
|
},
|
|
661
646
|
{
|
|
@@ -667,18 +652,18 @@ function ln(t) {
|
|
|
667
652
|
};
|
|
668
653
|
}
|
|
669
654
|
function sn(t) {
|
|
670
|
-
const e =
|
|
655
|
+
const e = g(t.defaultLayerName || Object.keys(t.layers)[0]);
|
|
671
656
|
return Object.values(t.layers).forEach((n) => {
|
|
672
|
-
n.forEach((
|
|
673
|
-
t.olMap.addLayer(
|
|
657
|
+
n.forEach((a) => {
|
|
658
|
+
t.olMap.addLayer(a);
|
|
674
659
|
});
|
|
675
|
-
}),
|
|
660
|
+
}), d(
|
|
676
661
|
e,
|
|
677
662
|
() => {
|
|
678
|
-
Object.entries(t.layers).forEach(([n,
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
663
|
+
Object.entries(t.layers).forEach(([n, a]) => {
|
|
664
|
+
const r = n === e.value;
|
|
665
|
+
a.forEach((i) => {
|
|
666
|
+
i.setVisible(r);
|
|
682
667
|
});
|
|
683
668
|
});
|
|
684
669
|
},
|
|
@@ -688,59 +673,59 @@ function sn(t) {
|
|
|
688
673
|
), { visibleLayerName: e };
|
|
689
674
|
}
|
|
690
675
|
export {
|
|
691
|
-
|
|
692
|
-
|
|
676
|
+
A as EPSG_3857,
|
|
677
|
+
on as EPSG_3857ExtentToEPSG_4326,
|
|
693
678
|
tn as EPSG_3857ToEPSG_4326,
|
|
694
679
|
_ as EPSG_4326,
|
|
695
680
|
nn as EPSG_4326ExtentToEPSG_3857,
|
|
696
681
|
en as EPSG_4326ToEPSG_3857,
|
|
697
682
|
Rt as NOlContextmenu,
|
|
698
|
-
|
|
683
|
+
Zt as NOlPointermove,
|
|
699
684
|
Pe as ONE_NM,
|
|
700
|
-
|
|
701
|
-
|
|
685
|
+
zt as OlMap,
|
|
686
|
+
st as WGS84Projection,
|
|
702
687
|
ge as WebMercatorProjection,
|
|
703
688
|
yt as createCircle,
|
|
704
|
-
|
|
705
|
-
|
|
689
|
+
Kt as createCircleFeature,
|
|
690
|
+
ut as createCircleStyle,
|
|
706
691
|
k as createFeature,
|
|
707
692
|
dt as createLineString,
|
|
708
693
|
Wt as createLineStringFeature,
|
|
709
|
-
|
|
694
|
+
wt as createMultiLineString,
|
|
710
695
|
Yt as createMultiLineStringFeature,
|
|
711
|
-
|
|
712
|
-
|
|
696
|
+
vt as createMultiPoint,
|
|
697
|
+
Xt as createMultiPointFeature,
|
|
713
698
|
gt as createMultiPolygon,
|
|
714
699
|
Ut as createMultiPolygonFeature,
|
|
715
700
|
ft as createPoint,
|
|
716
701
|
Vt as createPointFeature,
|
|
717
702
|
mt as createPolygon,
|
|
718
703
|
$t as createPolygonFeature,
|
|
719
|
-
|
|
720
|
-
|
|
704
|
+
P as createStyle,
|
|
705
|
+
R as createTextStyle,
|
|
721
706
|
Jt as createVectorLayer,
|
|
722
707
|
Dt as getAngle,
|
|
723
708
|
Bt as getArea,
|
|
724
709
|
Qt as getBingLayer,
|
|
725
|
-
|
|
726
|
-
|
|
710
|
+
lt as getCenter,
|
|
711
|
+
ct as getDestinationPoint,
|
|
727
712
|
Le as getExtentCenter,
|
|
728
713
|
Gt as getLineLength,
|
|
729
714
|
qt as getOSMLayer,
|
|
730
|
-
|
|
715
|
+
rn as getRealCircleCoordinates,
|
|
731
716
|
Ht as getTianDiTuLayer,
|
|
732
|
-
|
|
717
|
+
pt as getTianDiTuUrl,
|
|
733
718
|
Nt as kmToNauticalMiles,
|
|
734
|
-
|
|
735
|
-
|
|
719
|
+
ne as mercatorExtentToWgs84,
|
|
720
|
+
St as mercatorToWgs84,
|
|
736
721
|
jt as nauticalMilesToKm,
|
|
737
|
-
|
|
722
|
+
at as olMapInjectionKey,
|
|
738
723
|
X as toOlAngle,
|
|
739
|
-
|
|
724
|
+
Y as toTurfAngle,
|
|
740
725
|
an as useDrawLineString,
|
|
741
726
|
cn as useDrawPolygon,
|
|
742
727
|
ln as useGraticule,
|
|
743
728
|
sn as useSwitchBaseLayer,
|
|
744
|
-
|
|
745
|
-
|
|
729
|
+
ht as wgs84ExtentToMercator,
|
|
730
|
+
te as wgs84ToMercator
|
|
746
731
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Map as OLMap } from 'ol';
|
|
2
2
|
import { MaybeRef, Ref } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { StrokeOptions, TextOptions } from '../../utils';
|
|
4
|
+
import { Graticule } from 'ol/layer';
|
|
5
|
+
export type _GraticuleOptions = ConstructorParameters<typeof Graticule>[0];
|
|
6
|
+
export type GraticuleOptions = _GraticuleOptions & {
|
|
7
|
+
strokeStyleOption?: StrokeOptions;
|
|
8
|
+
labelStyleOption?: TextOptions;
|
|
9
|
+
latLabelStyleOption?: TextOptions;
|
|
10
|
+
lonLabelStyleOption?: TextOptions;
|
|
11
|
+
};
|
|
4
12
|
export interface UseGraticuleOptions {
|
|
5
13
|
olMap: MaybeRef<OLMap | null | undefined>;
|
|
6
|
-
|
|
14
|
+
graticuleOptions?: GraticuleOptions;
|
|
7
15
|
defaultShow?: boolean;
|
|
8
16
|
}
|
|
9
17
|
export declare function useGraticule(options: UseGraticuleOptions): {
|
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
import { Graticule as
|
|
2
|
-
import { Stroke as
|
|
3
|
-
import { ref as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { Graticule as O } from "ol/layer";
|
|
2
|
+
import { Stroke as w } from "ol/style";
|
|
3
|
+
import { ref as x, watch as d, toValue as k } from "vue";
|
|
4
|
+
import "@turf/turf";
|
|
5
|
+
import "ol";
|
|
6
|
+
import "ol/geom";
|
|
7
|
+
import { createTextStyle as e } from "../../utils/style/index.mjs";
|
|
8
|
+
import "ol/layer/Vector";
|
|
9
|
+
import "ol/source";
|
|
10
|
+
import "ol/source/Vector";
|
|
11
|
+
import "ol/proj";
|
|
12
|
+
function B(t) {
|
|
13
|
+
const l = x(t.defaultShow || !1), { strokeStyleOption: o, strokeStyle: m, labelStyleOption: r, latLabelStyleOption: a, lonLabelStyleOption: i, latLabelStyle: s, lonLabelStyle: u, ...S } = t.graticuleOptions || {}, y = o ? new w(o) : m, n = r ? e(r) : void 0, b = (a ? e(a) : s) || n, f = (i ? e(i) : u) || n, p = new O({
|
|
14
|
+
...S,
|
|
15
|
+
strokeStyle: y,
|
|
16
|
+
latLabelStyle: b,
|
|
17
|
+
lonLabelStyle: f
|
|
15
18
|
});
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
(
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
color: "#555",
|
|
23
|
-
width: 1.5,
|
|
24
|
-
lineDash: [4, 4]
|
|
25
|
-
}),
|
|
26
|
-
showLabels: !0,
|
|
27
|
-
wrapX: !1,
|
|
28
|
-
zIndex: 1
|
|
29
|
-
});
|
|
30
|
-
const l = w(e.olMap);
|
|
31
|
-
l && t.setMap(l);
|
|
19
|
+
return d(
|
|
20
|
+
l,
|
|
21
|
+
(L) => {
|
|
22
|
+
if (p.setMap(null), L) {
|
|
23
|
+
const c = k(t.olMap);
|
|
24
|
+
c && p.setMap(c);
|
|
32
25
|
}
|
|
33
26
|
},
|
|
34
27
|
{
|
|
@@ -36,9 +29,9 @@ function h(e) {
|
|
|
36
29
|
deep: !0
|
|
37
30
|
}
|
|
38
31
|
), {
|
|
39
|
-
showGraticule:
|
|
32
|
+
showGraticule: l
|
|
40
33
|
};
|
|
41
34
|
}
|
|
42
35
|
export {
|
|
43
|
-
|
|
36
|
+
B as useGraticule
|
|
44
37
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Map as OLMap } from 'ol';
|
|
2
2
|
import { MaybeRef, Ref } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { StrokeOptions, TextOptions } from '../../utils';
|
|
4
|
+
import { Graticule } from 'ol/layer';
|
|
5
|
+
export type _GraticuleOptions = ConstructorParameters<typeof Graticule>[0];
|
|
6
|
+
export type GraticuleOptions = _GraticuleOptions & {
|
|
7
|
+
strokeStyleOption?: StrokeOptions;
|
|
8
|
+
labelStyleOption?: TextOptions;
|
|
9
|
+
latLabelStyleOption?: TextOptions;
|
|
10
|
+
lonLabelStyleOption?: TextOptions;
|
|
11
|
+
};
|
|
4
12
|
export interface UseGraticuleOptions {
|
|
5
13
|
olMap: MaybeRef<OLMap | null | undefined>;
|
|
6
|
-
|
|
14
|
+
graticuleOptions?: GraticuleOptions;
|
|
7
15
|
defaultShow?: boolean;
|
|
8
16
|
}
|
|
9
17
|
export declare function useGraticule(options: UseGraticuleOptions): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("ol/layer"),O=require("ol/style"),t=require("vue");require("@turf/turf");require("ol");require("ol/geom");const l=require("../../utils/style/index.js");require("ol/layer/Vector");require("ol/source");require("ol/source/Vector");require("ol/proj");function T(e){const r=t.ref(e.defaultShow||!1),{strokeStyleOption:a,strokeStyle:y,labelStyleOption:o,latLabelStyleOption:i,lonLabelStyleOption:u,latLabelStyle:S,lonLabelStyle:b,...q}=e.graticuleOptions||{},p=a?new O.Stroke(a):y,n=o?l.createTextStyle(o):void 0,L=(i?l.createTextStyle(i):S)||n,d=(u?l.createTextStyle(u):b)||n,c=new x.Graticule({...q,strokeStyle:p,latLabelStyle:L,lonLabelStyle:d});return t.watch(r,f=>{if(c.setMap(null),f){const s=t.toValue(e.olMap);s&&c.setMap(s)}},{immediate:!0,deep:!0}),{showGraticule:r}}exports.useGraticule=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|