zhihao-ui 1.3.33 → 1.3.35
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/dist/es/{Map-DGFTTIAd.js → Map-Dc1jainC.js} +348 -339
- package/dist/es/index.js +1 -1
- package/dist/umd/index.umd.cjs +23 -23
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as Ye, openBlock as Be, createElementBlock as qe, createElementVNode as
|
|
2
|
-
import { S as $t, M as Ue, T as me, X as we, p as ee, V as zt, q as Ot, t as Rt, h as lt, r as He, s as Zt, u as ge, F as
|
|
1
|
+
import { defineComponent as Ye, openBlock as Be, createElementBlock as qe, createElementVNode as Ge, ref as I, computed as Te, h as ne, createVNode as Ae, render as Pt, reactive as St, onMounted as Nt, onUnmounted as Vt } from "vue";
|
|
2
|
+
import { S as $t, M as Ue, T as me, X as we, p as ee, V as zt, q as Ot, t as Rt, h as lt, r as He, s as Zt, u as ge, F as Q, v as X, O as ce, P as le, w as ke, x as Ne, L as Pe, y as Dt, z as Ie, A as ie, B as ye, C as de, D as ve, i as Gt, G as Ve, H as At, I as Oe, J as Wt, K as Yt, N as st, Q as Se, R as We, U as et, W as Bt, Y as qt, Z as Ht } from "./vendor-D2mv9LHk.js";
|
|
3
3
|
import { _ as Xe } from "./Button-CGndQwez.js";
|
|
4
4
|
import { w as Xt } from "./utils-D2wHR1YB.js";
|
|
5
5
|
const jt = { id: "scale-line-container" }, Qt = /* @__PURE__ */ Ye({
|
|
@@ -39,17 +39,17 @@ const jt = { id: "scale-line-container" }, Qt = /* @__PURE__ */ Ye({
|
|
|
39
39
|
t && a(t - 1);
|
|
40
40
|
};
|
|
41
41
|
return (a, o) => (Be(), qe("div", Kt, [
|
|
42
|
-
|
|
42
|
+
Ge("div", {
|
|
43
43
|
class: "button big-button",
|
|
44
44
|
onClick: l
|
|
45
45
|
}, " + "),
|
|
46
|
-
|
|
46
|
+
Ge("div", {
|
|
47
47
|
class: "button small-button",
|
|
48
48
|
onClick: s
|
|
49
49
|
}, " - ")
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
|
-
}), Ut = /* @__PURE__ */ Xe(_t, [["__scopeId", "data-v-c39c3075"]]),
|
|
52
|
+
}), Ut = /* @__PURE__ */ Xe(_t, [["__scopeId", "data-v-c39c3075"]]), Fe = "a6e8f78974f2581f2ca00485b40c948f", te = {
|
|
53
53
|
// 地图默认层级
|
|
54
54
|
default: 13,
|
|
55
55
|
// 地图缩放最小层级
|
|
@@ -70,29 +70,29 @@ const jt = { id: "scale-line-container" }, Qt = /* @__PURE__ */ Ye({
|
|
|
70
70
|
// 墨卡托投影坐标 渲染坐标
|
|
71
71
|
mercator: "EPSG:3857"
|
|
72
72
|
}, It = [114.84, 30.52], it = "https://static.zhihaoscm.cn/", $e = 2003750834e-2;
|
|
73
|
-
var ue = ((e) => (e.vectorTile = `https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${
|
|
73
|
+
var ue = ((e) => (e.vectorTile = `https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.vectorTileMark = `https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.satelliteImgTile = `https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.satelliteImgTileMark = `https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.greenTile = `${it}/map/tile/{z}/{x}/{y}.png`, e))(ue || {}), xe = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(xe || {});
|
|
74
74
|
function eo() {
|
|
75
75
|
const e = I(), r = () => e.value, l = () => r().getView(), s = () => {
|
|
76
76
|
var v;
|
|
77
77
|
return (v = l()) == null ? void 0 : v.getZoom();
|
|
78
78
|
}, a = (v) => {
|
|
79
|
-
var
|
|
80
|
-
(
|
|
81
|
-
}, o = (v,
|
|
79
|
+
var N;
|
|
80
|
+
(N = l()) == null || N.setZoom(v);
|
|
81
|
+
}, o = (v, N) => {
|
|
82
82
|
var M;
|
|
83
|
-
(M = l()) == null || M.setCenter(ee([v,
|
|
83
|
+
(M = l()) == null || M.setCenter(ee([v, N]));
|
|
84
84
|
}, u = () => {
|
|
85
|
-
var
|
|
86
|
-
const v = (
|
|
85
|
+
var N;
|
|
86
|
+
const v = (N = l()) == null ? void 0 : N.getCenter();
|
|
87
87
|
return Rt(v);
|
|
88
88
|
}, y = () => {
|
|
89
89
|
var v;
|
|
90
90
|
return (v = r()) == null ? void 0 : v.getSize();
|
|
91
|
-
}, t = new Ue(), n = (v,
|
|
92
|
-
m(
|
|
91
|
+
}, t = new Ue(), n = (v, N) => {
|
|
92
|
+
m(N);
|
|
93
93
|
const M = {
|
|
94
|
-
zoom:
|
|
95
|
-
center: ee(
|
|
94
|
+
zoom: N.zoom,
|
|
95
|
+
center: ee(N.center),
|
|
96
96
|
minZoom: te.min,
|
|
97
97
|
maxZoom: te.max,
|
|
98
98
|
constrainResolution: !0,
|
|
@@ -206,7 +206,7 @@ const tt = (e) => {
|
|
|
206
206
|
const r = new ge({
|
|
207
207
|
font: "Normal 14px map-iconfont",
|
|
208
208
|
text: fe(e),
|
|
209
|
-
fill: new
|
|
209
|
+
fill: new Q({ color: "#fff" }),
|
|
210
210
|
offsetY: -14
|
|
211
211
|
});
|
|
212
212
|
return new X({
|
|
@@ -227,10 +227,10 @@ const tt = (e) => {
|
|
|
227
227
|
if (!e || (console.log("vehicleInfo", m), !(m != null && m.lon && (m != null && m.lat)))) return;
|
|
228
228
|
const v = Math.abs(Number(m.lon)) > 180 ? je(m.lon, m.lat) : [m.lon, m.lat];
|
|
229
229
|
a(m, ee(v));
|
|
230
|
-
const
|
|
231
|
-
|
|
230
|
+
const N = e == null ? void 0 : e.getView(), M = new le(v);
|
|
231
|
+
N.setCenter(ke(M.getCoordinates(), K.data, K.mercator));
|
|
232
232
|
}, a = (m, v) => {
|
|
233
|
-
const
|
|
233
|
+
const N = `${it}map/car-icon.gif`;
|
|
234
234
|
l || (l = new ce({
|
|
235
235
|
element: document.createElement("div"),
|
|
236
236
|
positioning: "center-center",
|
|
@@ -238,7 +238,7 @@ const tt = (e) => {
|
|
|
238
238
|
// 允许交互事件穿透
|
|
239
239
|
}), e.addOverlay(l));
|
|
240
240
|
const M = l.getElement();
|
|
241
|
-
M.style.backgroundImage = `url(${
|
|
241
|
+
M.style.backgroundImage = `url(${N})`, M.style.width = "80px", M.style.height = "80px";
|
|
242
242
|
const h = (m == null ? void 0 : m.drc) || "";
|
|
243
243
|
M.style.transform = `rotate(${h}deg)`, M.style.backgroundSize = "cover", l == null || l.setPosition(v);
|
|
244
244
|
};
|
|
@@ -248,8 +248,8 @@ const tt = (e) => {
|
|
|
248
248
|
const m = l == null ? void 0 : l.getElement();
|
|
249
249
|
m && (m.innerHTML = "");
|
|
250
250
|
},
|
|
251
|
-
renderTrack: (m, v,
|
|
252
|
-
r.render(m, v,
|
|
251
|
+
renderTrack: (m, v, N) => {
|
|
252
|
+
r.render(m, v, N, "truck", 1e3);
|
|
253
253
|
},
|
|
254
254
|
setCenter: (m) => {
|
|
255
255
|
r.setCenter(m);
|
|
@@ -273,40 +273,40 @@ const so = (e) => {
|
|
|
273
273
|
positioning: "top-left",
|
|
274
274
|
className: "track-label-popup"
|
|
275
275
|
});
|
|
276
|
-
let t, n, m, v,
|
|
277
|
-
const
|
|
276
|
+
let t, n, m, v, N, M = !1, h = Date.now(), w, L = 0, C = null, b = 20;
|
|
277
|
+
const B = 8, G = [], q = (i) => {
|
|
278
278
|
var d;
|
|
279
|
-
for (
|
|
280
|
-
const f =
|
|
279
|
+
for (G.unshift(i); G.length > B; ) {
|
|
280
|
+
const f = G.pop(), p = r.get(f);
|
|
281
281
|
p && ((d = p.getSource()) == null || d.clear(), e == null || e.removeLayer(p), r.delete(f), delete l[f]);
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
|
-
let
|
|
284
|
+
let Y = "";
|
|
285
285
|
const R = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], Z = Ne(() => {
|
|
286
286
|
if (s && l[s] && r.get(s).getVisible()) {
|
|
287
287
|
console.log("reRenderTrackLine------------");
|
|
288
|
-
const i =
|
|
288
|
+
const i = Gt(S(s, l[s]));
|
|
289
289
|
re(s, i);
|
|
290
290
|
}
|
|
291
|
-
}, 300),
|
|
291
|
+
}, 300), S = (i, d) => {
|
|
292
292
|
let f = [];
|
|
293
293
|
const p = Math.max(1, Math.floor(d.length / b));
|
|
294
|
-
return f = d.filter((
|
|
295
|
-
if (Number(
|
|
296
|
-
const [$,
|
|
297
|
-
|
|
294
|
+
return f = d.filter((T, O) => O % p === 0).map((T, O) => {
|
|
295
|
+
if (Number(T.lon) > 180 || Number(T.lat) > 180) {
|
|
296
|
+
const [$, A] = je(T.lon, T.lat);
|
|
297
|
+
T.lon = $, T.lat = A;
|
|
298
298
|
}
|
|
299
|
-
return
|
|
299
|
+
return T.center = [T.lon, T.lat], T.centerPoint = ro(T.center), T.time = lt(T.createdAt).format("YYYY-MM-DD HH:mm:ss"), T.id = i, T.index = O, T;
|
|
300
300
|
}), f;
|
|
301
|
-
}, c = async (i, d, f, p = "ship",
|
|
301
|
+
}, c = async (i, d, f, p = "ship", E = 200) => {
|
|
302
302
|
if (!e || JSON.stringify(l[i]) === JSON.stringify(d) && s === i || (d = d == null ? void 0 : d.reverse(), y && p === "ship" && (e != null && e.getOverlays().getArray().includes(y) || e.addOverlay(y)), (d == null ? void 0 : d.length) < 2))
|
|
303
303
|
return;
|
|
304
|
-
q(i), s = i, l[i] = d, b =
|
|
305
|
-
const
|
|
306
|
-
|
|
304
|
+
q(i), s = i, l[i] = d, b = E;
|
|
305
|
+
const T = Object.keys(l).findIndex((O) => O === i) || 0;
|
|
306
|
+
Y = f || R[T > 10 ? 10 : T], await k(), await Je(s);
|
|
307
307
|
}, x = (i) => {
|
|
308
308
|
const d = new de();
|
|
309
|
-
return new
|
|
309
|
+
return new ye({
|
|
310
310
|
source: d,
|
|
311
311
|
visible: !1,
|
|
312
312
|
// 默认隐藏
|
|
@@ -316,30 +316,30 @@ const so = (e) => {
|
|
|
316
316
|
});
|
|
317
317
|
}, g = (i) => {
|
|
318
318
|
r.forEach((d, f) => {
|
|
319
|
-
var
|
|
319
|
+
var E;
|
|
320
320
|
const p = f === i;
|
|
321
|
-
d.getVisible() !== p && (d.setVisible(p), e.getLayers().getArray().includes(d) || e.addLayer(d), p || (
|
|
321
|
+
d.getVisible() !== p && (d.setVisible(p), e.getLayers().getArray().includes(d) || e.addLayer(d), p || (E = d.getSource()) == null || E.clear());
|
|
322
322
|
}), s = i;
|
|
323
323
|
}, k = async () => {
|
|
324
324
|
const i = s;
|
|
325
325
|
if (!r.has(i)) {
|
|
326
|
-
const
|
|
327
|
-
r.set(i,
|
|
326
|
+
const T = x(i);
|
|
327
|
+
r.set(i, T);
|
|
328
328
|
}
|
|
329
329
|
await g(i);
|
|
330
|
-
const d =
|
|
330
|
+
const d = Y || "", f = l[i] || [];
|
|
331
331
|
if (!(f && f.length > 1)) return [];
|
|
332
332
|
let p = [];
|
|
333
|
-
p =
|
|
334
|
-
const
|
|
335
|
-
p.length >= 2 && await
|
|
336
|
-
},
|
|
337
|
-
const p = new
|
|
338
|
-
if (
|
|
339
|
-
|
|
333
|
+
p = S(i, f);
|
|
334
|
+
const E = p.map((T) => T.centerPoint);
|
|
335
|
+
p.length >= 2 && await F(i, E, d);
|
|
336
|
+
}, F = (i, d, f) => {
|
|
337
|
+
const p = new Pe(d), E = r.get(i).getSource(), T = E.getFeatureById(i);
|
|
338
|
+
if (T)
|
|
339
|
+
T.setGeometry(p), T.setId(i), T.setStyle(V(f)), C = T;
|
|
340
340
|
else {
|
|
341
341
|
const O = new ie({ geometry: p });
|
|
342
|
-
O.setId(i), O.set("type", "line"), O.setStyle(V(f)),
|
|
342
|
+
O.setId(i), O.set("type", "line"), O.setStyle(V(f)), E.addFeature(O), C = O;
|
|
343
343
|
}
|
|
344
344
|
return C;
|
|
345
345
|
}, V = (i) => new X({
|
|
@@ -347,12 +347,12 @@ const so = (e) => {
|
|
|
347
347
|
color: i,
|
|
348
348
|
width: 2
|
|
349
349
|
})
|
|
350
|
-
}),
|
|
350
|
+
}), D = (i, d, f) => {
|
|
351
351
|
const p = i == null ? void 0 : i.get("trackId");
|
|
352
352
|
if (i && p && d === "hover") {
|
|
353
353
|
e.getTargetElement().style.cursor = p ? "pointer" : "";
|
|
354
|
-
const
|
|
355
|
-
O && (u.querySelector(".popup-content"), u.innerHTML =
|
|
354
|
+
const E = i.get("data"), T = j(E), O = f == null ? void 0 : f.coordinate;
|
|
355
|
+
O && (u.querySelector(".popup-content"), u.innerHTML = T, y == null || y.setPosition(O));
|
|
356
356
|
} else
|
|
357
357
|
y && y.setPosition(void 0);
|
|
358
358
|
}, j = (i) => {
|
|
@@ -397,11 +397,11 @@ const so = (e) => {
|
|
|
397
397
|
</div>`;
|
|
398
398
|
}, z = (i) => {
|
|
399
399
|
const f = i.map(($) => {
|
|
400
|
-
const
|
|
400
|
+
const A = e.getPixelFromCoordinate(ee($.center));
|
|
401
401
|
return {
|
|
402
402
|
...$,
|
|
403
403
|
original: $,
|
|
404
|
-
pixel:
|
|
404
|
+
pixel: A,
|
|
405
405
|
distance: 0
|
|
406
406
|
// 先初始化,后续计算
|
|
407
407
|
};
|
|
@@ -409,29 +409,29 @@ const so = (e) => {
|
|
|
409
409
|
let p = 0;
|
|
410
410
|
f[0].distance = 0;
|
|
411
411
|
for (let $ = 1; $ < f.length; $++) {
|
|
412
|
-
const
|
|
412
|
+
const A = f[$ - 1].pixel, H = f[$].pixel, _ = H[0] - A[0], P = H[1] - A[1];
|
|
413
413
|
p += Math.sqrt(_ * _ + P * P), f[$].distance = p;
|
|
414
414
|
}
|
|
415
|
-
const
|
|
416
|
-
($,
|
|
417
|
-
),
|
|
418
|
-
for (let $ = 0; $ <
|
|
419
|
-
const
|
|
420
|
-
if (
|
|
421
|
-
const H =
|
|
415
|
+
const E = f.filter(
|
|
416
|
+
($, A) => A === 0 || A === f.length - 1
|
|
417
|
+
), T = [];
|
|
418
|
+
for (let $ = 0; $ < E.length; $++) {
|
|
419
|
+
const A = E[$];
|
|
420
|
+
if (T.push(A), $ < E.length - 1) {
|
|
421
|
+
const H = E[$ + 1], _ = H.distance - A.distance, P = Math.floor(_ / 100);
|
|
422
422
|
for (let W = 1; W <= P; W++) {
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
423
|
+
const J = A.distance + W * 100;
|
|
424
|
+
if (J >= H.distance) break;
|
|
425
425
|
const U = ae(
|
|
426
426
|
f,
|
|
427
|
-
|
|
427
|
+
J
|
|
428
428
|
);
|
|
429
|
-
U &&
|
|
429
|
+
U && T.push(U);
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
return Array.from(
|
|
434
|
-
new Map(
|
|
434
|
+
new Map(T.map(($) => [$.distance.toFixed(2), $])).values()
|
|
435
435
|
).map(($) => ({
|
|
436
436
|
...$.original,
|
|
437
437
|
// 优先保留原始数据
|
|
@@ -445,13 +445,13 @@ const so = (e) => {
|
|
|
445
445
|
};
|
|
446
446
|
function ae(i, d) {
|
|
447
447
|
for (let f = 1; f < i.length; f++) {
|
|
448
|
-
const p = i[f - 1],
|
|
449
|
-
if (d >= p.distance && d <=
|
|
450
|
-
const
|
|
448
|
+
const p = i[f - 1], E = i[f];
|
|
449
|
+
if (d >= p.distance && d <= E.distance) {
|
|
450
|
+
const T = (d - p.distance) / (E.distance - p.distance), O = p.pixel[0] + T * (E.pixel[0] - p.pixel[0]), $ = p.pixel[1] + T * (E.pixel[1] - p.pixel[1]), A = e == null ? void 0 : e.getCoordinateFromPixel([O, $]);
|
|
451
451
|
return {
|
|
452
452
|
...p,
|
|
453
453
|
// 继承前一个点的属性(可调整)
|
|
454
|
-
coord:
|
|
454
|
+
coord: A,
|
|
455
455
|
pixel: [O, $],
|
|
456
456
|
distance: d,
|
|
457
457
|
original: void 0
|
|
@@ -463,9 +463,9 @@ const so = (e) => {
|
|
|
463
463
|
}
|
|
464
464
|
const re = async (i, d) => {
|
|
465
465
|
await be(), await pe(i);
|
|
466
|
-
const f = z(d), p = f.map((
|
|
467
|
-
r.get(i).getSource().addFeatures(p),
|
|
468
|
-
const O = Re(i,
|
|
466
|
+
const f = z(d), p = f.map((T) => se(T));
|
|
467
|
+
r.get(i).getSource().addFeatures(p), yt(i, f, d, Y), f.forEach((T) => {
|
|
468
|
+
const O = Re(i, Y, T);
|
|
469
469
|
e.addOverlay(O);
|
|
470
470
|
});
|
|
471
471
|
}, se = (i) => {
|
|
@@ -475,9 +475,9 @@ const so = (e) => {
|
|
|
475
475
|
});
|
|
476
476
|
d.set("type", "track_point"), d.set("trackId", i.id), d.set("data", i);
|
|
477
477
|
let f = [
|
|
478
|
-
...ft(i,
|
|
478
|
+
...ft(i, Y)
|
|
479
479
|
];
|
|
480
|
-
return (i.index === 0 || i.index === l[i.id].length - 1) && (f = [...
|
|
480
|
+
return (i.index === 0 || i.index === l[i.id].length - 1) && (f = [...ht(i)], d.set("type", "track_begin")), i.state !== void 0 && i.state !== null && (f = [...vt(i)], d.set("type", "track_icon")), d.setStyle(f), d;
|
|
481
481
|
}, Re = (i, d, f) => {
|
|
482
482
|
const p = document.createElement("div");
|
|
483
483
|
p.className = "track-overlay-label", p.style.position = "relative", p.style.backgroundColor = "rgba(255,255,255,0.8)", p.style.border = `1px solid ${d}`, p.style.fontSize = "12px", p.innerHTML = `
|
|
@@ -493,7 +493,7 @@ const so = (e) => {
|
|
|
493
493
|
stroke="${d}"
|
|
494
494
|
stroke-width="1" />
|
|
495
495
|
`;
|
|
496
|
-
const
|
|
496
|
+
const E = new ce({
|
|
497
497
|
element: p,
|
|
498
498
|
position: ee(f.center),
|
|
499
499
|
positioning: "top-right",
|
|
@@ -501,7 +501,7 @@ const so = (e) => {
|
|
|
501
501
|
stopEvent: !1,
|
|
502
502
|
className: "track-label-time-overlay"
|
|
503
503
|
});
|
|
504
|
-
return
|
|
504
|
+
return E.set("class", "track-label-overlay"), E.set("trackId", i), E;
|
|
505
505
|
}, be = () => {
|
|
506
506
|
const i = e == null ? void 0 : e.getOverlays().getArray(), d = i == null ? void 0 : i.filter((f) => f.get("class") === "track-label-overlay");
|
|
507
507
|
d && d.length > 0 && d.forEach((f) => {
|
|
@@ -523,38 +523,38 @@ const so = (e) => {
|
|
|
523
523
|
// 轨迹点样式
|
|
524
524
|
new X({
|
|
525
525
|
image: new Ve({
|
|
526
|
-
fill: new
|
|
526
|
+
fill: new Q({ color: d }),
|
|
527
527
|
stroke: new ve({ color: "#fff", width: 2 }),
|
|
528
528
|
radius: 3
|
|
529
529
|
})
|
|
530
530
|
})
|
|
531
531
|
// textStyle,
|
|
532
532
|
]), vt = (i) => {
|
|
533
|
-
const d = "#E31818", f = "#1890FF", p = "",
|
|
533
|
+
const d = "#E31818", f = "#1890FF", p = "", E = new X({
|
|
534
534
|
text: new ge({
|
|
535
535
|
font: "Normal 22px map-iconfont",
|
|
536
536
|
text: fe(p),
|
|
537
537
|
offsetY: -10,
|
|
538
|
-
fill: new
|
|
538
|
+
fill: new Q({
|
|
539
539
|
color: Number(i.state) === 0 ? d : Number(i.state) === 1 ? f : ""
|
|
540
540
|
})
|
|
541
541
|
}),
|
|
542
542
|
zIndex: 99
|
|
543
|
-
}), O = tt(""),
|
|
544
|
-
return Number(i.state) === 0 ? H.push(O) : Number(i.state) === 1 && H.push(
|
|
545
|
-
},
|
|
546
|
-
const
|
|
547
|
-
|
|
543
|
+
}), O = tt(""), A = tt(""), H = [];
|
|
544
|
+
return Number(i.state) === 0 ? H.push(O) : Number(i.state) === 1 && H.push(A), H.push(E), H;
|
|
545
|
+
}, yt = (i, d, f, p) => {
|
|
546
|
+
const E = d || [], T = d.length;
|
|
547
|
+
T || (E.push(f[0]), E.push(f[f.length - 1]));
|
|
548
548
|
const O = [];
|
|
549
|
-
for (let
|
|
549
|
+
for (let A = 0; A < T - 1; A++) {
|
|
550
550
|
let H;
|
|
551
|
-
const _ = d[
|
|
551
|
+
const _ = d[A], P = (d[A + 1].index + _.index) / 2;
|
|
552
552
|
if (P % 2 === 0)
|
|
553
553
|
H = f[P].centerPoint;
|
|
554
554
|
else {
|
|
555
|
-
const W = f[Math.floor(P)],
|
|
556
|
-
if (W &&
|
|
557
|
-
const [U, Ce] = W.centerPoint, [Le, Ee] =
|
|
555
|
+
const W = f[Math.floor(P)], J = f[Math.ceil(P)];
|
|
556
|
+
if (W && J) {
|
|
557
|
+
const [U, Ce] = W.centerPoint, [Le, Ee] = J.centerPoint;
|
|
558
558
|
H = [(U + Le) / 2, (Ce + Ee) / 2];
|
|
559
559
|
}
|
|
560
560
|
}
|
|
@@ -567,11 +567,11 @@ const so = (e) => {
|
|
|
567
567
|
text: new ge({
|
|
568
568
|
font: "700 12px map-iconfont",
|
|
569
569
|
text: fe(""),
|
|
570
|
-
fill: new
|
|
570
|
+
fill: new Q({ color: p }),
|
|
571
571
|
// 设置箭头旋转 角度转为弧度
|
|
572
572
|
rotation: Ke(
|
|
573
|
-
d[
|
|
574
|
-
d[
|
|
573
|
+
d[A].center,
|
|
574
|
+
d[A + 1].center
|
|
575
575
|
) * (Math.PI / 180)
|
|
576
576
|
})
|
|
577
577
|
})
|
|
@@ -581,24 +581,24 @@ const so = (e) => {
|
|
|
581
581
|
const $ = r.get(i).getSource();
|
|
582
582
|
$ == null || $.addFeatures(O);
|
|
583
583
|
}, Je = (i) => {
|
|
584
|
-
var
|
|
585
|
-
const d = e.getView(), f = (
|
|
584
|
+
var T, O;
|
|
585
|
+
const d = e.getView(), f = (T = r == null ? void 0 : r.get(i)) == null ? void 0 : T.getSource(), p = C || (i ? f == null ? void 0 : f.getFeatureById(i) : null);
|
|
586
586
|
if (!p) return;
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
587
|
+
const E = (O = p == null ? void 0 : p.getGeometry()) == null ? void 0 : O.getExtent();
|
|
588
|
+
if (E != null && E.length)
|
|
589
589
|
try {
|
|
590
|
-
const $ =
|
|
590
|
+
const $ = Dt(E, Math.max(E[2] - E[0], E[3] - E[1]) * 0.02);
|
|
591
591
|
d.fit($);
|
|
592
592
|
} catch ($) {
|
|
593
593
|
console.log($);
|
|
594
594
|
}
|
|
595
|
-
},
|
|
596
|
-
const d = "",
|
|
595
|
+
}, ht = (i) => {
|
|
596
|
+
const d = "", E = i.index === 0 ? "#fcdc3f" : "#ff0000";
|
|
597
597
|
return [new X({
|
|
598
598
|
text: new ge({
|
|
599
599
|
font: "Normal 14px map-iconfont",
|
|
600
600
|
text: fe(d),
|
|
601
|
-
fill: new
|
|
601
|
+
fill: new Q({ color: E })
|
|
602
602
|
}),
|
|
603
603
|
zIndex: 101
|
|
604
604
|
})];
|
|
@@ -614,60 +614,60 @@ const so = (e) => {
|
|
|
614
614
|
d == null || d.setVisible(!1);
|
|
615
615
|
const f = e.getOverlays().getArray();
|
|
616
616
|
for (let p = 0; p < f.length; ) {
|
|
617
|
-
const
|
|
618
|
-
|
|
617
|
+
const E = f[p];
|
|
618
|
+
E.get("class") === "track-label-overlay" ? (E.setPosition(void 0), e.removeOverlay(E)) : p++;
|
|
619
619
|
}
|
|
620
620
|
Me();
|
|
621
621
|
}, xt = (i, d = xe.NM) => {
|
|
622
622
|
const f = {
|
|
623
623
|
id: i,
|
|
624
624
|
length: "--"
|
|
625
|
-
},
|
|
625
|
+
}, E = (l[i] || []).map(
|
|
626
626
|
(O) => ke([O.lon, O.lat], K.data, K.mercator)
|
|
627
|
-
),
|
|
628
|
-
return f.length = oo(
|
|
627
|
+
), T = new Pe(E);
|
|
628
|
+
return f.length = oo(T, d) || "--", f;
|
|
629
629
|
}, bt = (i, d) => {
|
|
630
630
|
kt(String(i), d);
|
|
631
631
|
}, kt = (i, d) => {
|
|
632
|
-
const f = l[String(i)], p = f == null ? void 0 : f.map((
|
|
632
|
+
const f = l[String(i)], p = f == null ? void 0 : f.map((E) => [E.lon, E.lat]);
|
|
633
633
|
p && Ct(p, d);
|
|
634
634
|
}, Ze = new X({
|
|
635
635
|
text: new ge({
|
|
636
636
|
font: "700 20px map-iconfont",
|
|
637
637
|
text: fe(""),
|
|
638
|
-
fill: new
|
|
638
|
+
fill: new Q({ color: "#ff0000" }),
|
|
639
639
|
rotation: 0
|
|
640
640
|
// 初始旋转角度
|
|
641
641
|
})
|
|
642
642
|
}), pt = (i, d) => {
|
|
643
643
|
var P, W;
|
|
644
|
-
const f = Number(50 * d), p = ((P = i.frameState) == null ? void 0 : P.time) ?? Date.now(),
|
|
645
|
-
if (
|
|
644
|
+
const f = Number(50 * d), p = ((P = i.frameState) == null ? void 0 : P.time) ?? Date.now(), E = p - h;
|
|
645
|
+
if (L = (L + f * E / 1e6) % 2, h = p, L >= 1) {
|
|
646
646
|
Me();
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
const
|
|
650
|
-
|
|
649
|
+
const T = n.getCoordinateAt(
|
|
650
|
+
L > 1 ? 2 - L : L
|
|
651
651
|
), O = n.getCoordinateAt(
|
|
652
|
-
|
|
652
|
+
L > 1 ? L - 0.01 : L
|
|
653
653
|
), $ = n.getCoordinateAt(
|
|
654
|
-
|
|
654
|
+
L > 1 ? 2 - L : L + 0.01
|
|
655
655
|
), H = Ke(
|
|
656
656
|
ot(O, "array"),
|
|
657
657
|
ot($, "array")
|
|
658
658
|
) * Math.PI / 180;
|
|
659
|
-
(W = Ze.getText()) == null || W.setRotation(H), v.setCoordinates(
|
|
660
|
-
const _ =
|
|
659
|
+
(W = Ze.getText()) == null || W.setRotation(H), v.setCoordinates(T);
|
|
660
|
+
const _ = At(i);
|
|
661
661
|
_.setStyle(Ze), _.drawGeometry(v), e == null || e.render();
|
|
662
662
|
}, Mt = () => {
|
|
663
663
|
var i;
|
|
664
|
-
M = !0, h = Date.now(),
|
|
664
|
+
M = !0, h = Date.now(), L = 0, v = ((i = m.getGeometry()) == null ? void 0 : i.clone()) || new le([0, 0]), o && (w == null || w.on("postrender", o)), N == null || N.setGeometry(void 0);
|
|
665
665
|
}, Me = () => {
|
|
666
|
-
M && (M = !1,
|
|
666
|
+
M && (M = !1, N == null || N.setGeometry(void 0), o && w && w.un("postrender", o), w && (e == null || e.removeLayer(w)), w = null, N = null);
|
|
667
667
|
}, Ct = (i, d) => {
|
|
668
668
|
M && Me(), t = new Ie({
|
|
669
669
|
factor: 1e6
|
|
670
|
-
}).writeGeometry(new
|
|
670
|
+
}).writeGeometry(new Pe(i)), n = new Ie({
|
|
671
671
|
factor: 1e6
|
|
672
672
|
}).readGeometry(t, {
|
|
673
673
|
dataProjection: K.data,
|
|
@@ -677,23 +677,23 @@ const so = (e) => {
|
|
|
677
677
|
geometry: new le(n.getFirstCoordinate())
|
|
678
678
|
});
|
|
679
679
|
const f = m.getGeometry();
|
|
680
|
-
v = f ? f.clone() : new le([0, 0]),
|
|
680
|
+
v = f ? f.clone() : new le([0, 0]), N = new ie({
|
|
681
681
|
type: "geoMarker",
|
|
682
682
|
style: Ze,
|
|
683
683
|
geometry: v
|
|
684
|
-
}), w = new
|
|
684
|
+
}), w = new ye({
|
|
685
685
|
source: new de({
|
|
686
|
-
features: [
|
|
686
|
+
features: [N]
|
|
687
687
|
})
|
|
688
688
|
}), e == null || e.addLayer(w), o = (p) => pt(p, d), Mt();
|
|
689
689
|
}, Ke = (i, d, f) => {
|
|
690
690
|
function p(P) {
|
|
691
691
|
return 180 * (P % (2 * Math.PI)) / Math.PI;
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function E(P) {
|
|
694
694
|
return P % 360 * Math.PI / 180;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function T(P) {
|
|
697
697
|
var W;
|
|
698
698
|
if (!P) throw new Error("Coordinate is required");
|
|
699
699
|
if (!Array.isArray(P)) {
|
|
@@ -707,21 +707,21 @@ const so = (e) => {
|
|
|
707
707
|
"Coordinate must be GeoJSON Point or an Array of numbers"
|
|
708
708
|
);
|
|
709
709
|
}
|
|
710
|
-
function O(P, W,
|
|
711
|
-
if (
|
|
712
|
-
return function(Tt,
|
|
713
|
-
return (O(
|
|
710
|
+
function O(P, W, J = {}) {
|
|
711
|
+
if (J.final)
|
|
712
|
+
return function(Tt, Ft) {
|
|
713
|
+
return (O(Ft, Tt) + 180) % 360;
|
|
714
714
|
}(P, W);
|
|
715
|
-
const U =
|
|
715
|
+
const U = T(P), Ce = T(W), Le = E(U[0]), Ee = E(Ce[0]), _e = E(U[1]), De = E(Ce[1]), Lt = Math.sin(Ee - Le) * Math.cos(De), Et = Math.cos(_e) * Math.sin(De) - Math.sin(_e) * Math.cos(De) * Math.cos(Ee - Le);
|
|
716
716
|
return p(Math.atan2(Lt, Et));
|
|
717
717
|
}
|
|
718
718
|
function $(P) {
|
|
719
719
|
return !isNaN(P) && P !== null && !Array.isArray(P);
|
|
720
720
|
}
|
|
721
|
-
function
|
|
722
|
-
return P || console.log("Coordinates are required"), Array.isArray(P) || console.log("Coordinates must be an Array"), P.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!$(P[0]) || !$(P[1])) && console.log("Coordinates must contain numbers"), H({ type: "Point", coordinates: P }, W,
|
|
721
|
+
function A(P, W = {}, J = {}) {
|
|
722
|
+
return P || console.log("Coordinates are required"), Array.isArray(P) || console.log("Coordinates must be an Array"), P.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!$(P[0]) || !$(P[1])) && console.log("Coordinates must contain numbers"), H({ type: "Point", coordinates: P }, W, J);
|
|
723
723
|
}
|
|
724
|
-
function H(P, W = {},
|
|
724
|
+
function H(P, W = {}, J = {}) {
|
|
725
725
|
const U = {
|
|
726
726
|
type: "Feature",
|
|
727
727
|
id: "",
|
|
@@ -729,9 +729,9 @@ const so = (e) => {
|
|
|
729
729
|
bbox: {},
|
|
730
730
|
geometry: {}
|
|
731
731
|
};
|
|
732
|
-
return
|
|
732
|
+
return J.id !== void 0 && (U.id = J.id), J.bbox && (U.bbox = J.bbox), U.properties = W, U.geometry = P, U;
|
|
733
733
|
}
|
|
734
|
-
const _ = O(
|
|
734
|
+
const _ = O(A(i), A(d), f);
|
|
735
735
|
return _ < 0 ? 360 + _ : _;
|
|
736
736
|
};
|
|
737
737
|
return {
|
|
@@ -741,7 +741,7 @@ const so = (e) => {
|
|
|
741
741
|
setCenter: Je,
|
|
742
742
|
close: wt,
|
|
743
743
|
getLength: xt,
|
|
744
|
-
handleTrackMapEvent:
|
|
744
|
+
handleTrackMapEvent: D,
|
|
745
745
|
reRenderTrackLine: Z
|
|
746
746
|
};
|
|
747
747
|
};
|
|
@@ -878,7 +878,7 @@ function co(e, r, l, s) {
|
|
|
878
878
|
const ao = (e) => {
|
|
879
879
|
const { spd: r, hdg: l, cog: s } = e;
|
|
880
880
|
return r ? l !== null && +l != 511 && s !== null ? s - +l >= 3 ? oe.right : s - +l <= -3 ? oe.left : oe.front : oe.front : "";
|
|
881
|
-
},
|
|
881
|
+
}, he = (e, r) => {
|
|
882
882
|
const { shipData: l } = r.getProperties(), s = at(e), a = Qe(e, l, s);
|
|
883
883
|
return uo(r, a, s);
|
|
884
884
|
}, at = (e) => {
|
|
@@ -955,7 +955,7 @@ const ao = (e) => {
|
|
|
955
955
|
}, ut = (e) => {
|
|
956
956
|
const r = document.createElement("div");
|
|
957
957
|
r.className = "ship-overlay-box", r.style.position = "relative";
|
|
958
|
-
const { lon: l, lat: s, blinking: a, blinkingColors: o, name: u } = e, y =
|
|
958
|
+
const { lon: l, lat: s, blinking: a, blinkingColors: o, name: u } = e, y = Ae({
|
|
959
959
|
setup() {
|
|
960
960
|
return io({
|
|
961
961
|
position: [l + 2e-3, s + 2e-3],
|
|
@@ -968,7 +968,7 @@ const ao = (e) => {
|
|
|
968
968
|
});
|
|
969
969
|
}
|
|
970
970
|
});
|
|
971
|
-
return
|
|
971
|
+
return Pt(y, r), r;
|
|
972
972
|
}, rt = (e) => {
|
|
973
973
|
const r = [];
|
|
974
974
|
return e.existDevice && r.push(""), e.existMobile && r.push(""), e.existWaterGauge && r.push(""), r;
|
|
@@ -984,47 +984,47 @@ function vo() {
|
|
|
984
984
|
];
|
|
985
985
|
return e[Math.floor(Math.random() * e.length)];
|
|
986
986
|
}
|
|
987
|
-
const
|
|
988
|
-
function
|
|
987
|
+
const yo = window.devicePixelRatio || 1;
|
|
988
|
+
function ho(e, r, l = "left-bottom", s = 2) {
|
|
989
989
|
const a = document.createElement("canvas"), o = a.getContext("2d");
|
|
990
990
|
if (!o) return "";
|
|
991
991
|
const u = 2, y = 8, t = 16, n = window.devicePixelRatio || 1, m = "500 12px Arial", v = "14px map-iconfont";
|
|
992
992
|
o.font = m;
|
|
993
993
|
const M = o.measureText(e).width;
|
|
994
994
|
o.font = v;
|
|
995
|
-
const h = r.map((k) => ({ width: o.measureText(fe(k)).width, height: 14 })), w = h.reduce((k,
|
|
996
|
-
let
|
|
997
|
-
switch (
|
|
995
|
+
const h = r.map((k) => ({ width: o.measureText(fe(k)).width, height: 14 })), w = h.reduce((k, F) => k + F.width, 0), L = (r.length - 1) * s, C = y + M + w + L + y, b = u + 14 + u;
|
|
996
|
+
let B, G, q = 0, Y = 0, R = 0, Z = 0, S = 0, c = 0;
|
|
997
|
+
switch (B = t + C, l) {
|
|
998
998
|
case "right-top":
|
|
999
|
-
|
|
999
|
+
G = t + b, q = 0, Y = t + b, R = t, Z = 0, S = t, c = 0;
|
|
1000
1000
|
break;
|
|
1001
1001
|
case "right-middle":
|
|
1002
|
-
|
|
1002
|
+
G = b, q = 0, Y = b / 2, R = t, Z = b / 2, S = t, c = 0;
|
|
1003
1003
|
break;
|
|
1004
1004
|
case "right-bottom":
|
|
1005
|
-
|
|
1005
|
+
G = t + b, q = 0, Y = 0, R = t, Z = t, S = t, c = t;
|
|
1006
1006
|
break;
|
|
1007
1007
|
case "left-top":
|
|
1008
|
-
|
|
1008
|
+
G = t + b, q = C, Y = t, R = C + t, Z = b + t, S = 0, c = 0;
|
|
1009
1009
|
break;
|
|
1010
1010
|
case "left-middle":
|
|
1011
|
-
|
|
1011
|
+
G = b, q = C, Y = b / 2, R = C + t, Z = b / 2, S = 0, c = 0;
|
|
1012
1012
|
break;
|
|
1013
1013
|
case "left-bottom":
|
|
1014
|
-
|
|
1014
|
+
G = t + b, q = C, Y = b, R = C + t, Z = 0, S = 0, c = t;
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
|
-
|
|
1017
|
+
G = G + u, a.width = Math.round(B * n), a.height = Math.round(G * n), o.scale(n, n), o.clearRect(0, 0, B, G), o.beginPath(), o.moveTo(q, Y), o.lineTo(R, Z), o.strokeStyle = "#FFF", o.lineWidth = 1, o.stroke(), o.fillStyle = "#FFF", o.fillRect(S, c, C, b), o.font = m, o.textBaseline = "middle";
|
|
1018
1018
|
const x = c + u + b / 2;
|
|
1019
|
-
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e,
|
|
1020
|
-
let g =
|
|
1021
|
-
return r.length > 0 && r.forEach((k,
|
|
1019
|
+
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, S + y, x), o.fillStyle = "#000000", o.fillText(e, S + y, x), o.font = v, o.fillStyle = "#3370ff";
|
|
1020
|
+
let g = S + y + M + s;
|
|
1021
|
+
return r.length > 0 && r.forEach((k, F) => {
|
|
1022
1022
|
const V = c + u + b / 2;
|
|
1023
|
-
o.fillText(fe(k), g, V), g += h[
|
|
1023
|
+
o.fillText(fe(k), g, V), g += h[F].width + s;
|
|
1024
1024
|
}), a.toDataURL("image/png");
|
|
1025
1025
|
}
|
|
1026
1026
|
const nt = (e, r) => {
|
|
1027
|
-
const { name: l, rightIcons: s, selected: a } = e.getProperties(), o = r !== 1 ? vo() : "right-top", u =
|
|
1027
|
+
const { name: l, rightIcons: s, selected: a } = e.getProperties(), o = r !== 1 ? vo() : "right-top", u = ho(l, s, o);
|
|
1028
1028
|
let y = [0, 0];
|
|
1029
1029
|
switch (o) {
|
|
1030
1030
|
case "right-top":
|
|
@@ -1051,7 +1051,7 @@ const nt = (e, r) => {
|
|
|
1051
1051
|
src: u,
|
|
1052
1052
|
anchor: y,
|
|
1053
1053
|
displacement: [0, 0],
|
|
1054
|
-
scale: 1 /
|
|
1054
|
+
scale: 1 / yo,
|
|
1055
1055
|
anchorXUnits: "fraction",
|
|
1056
1056
|
anchorYUnits: "fraction"
|
|
1057
1057
|
}),
|
|
@@ -1065,7 +1065,7 @@ const nt = (e, r) => {
|
|
|
1065
1065
|
renderBuffer: 300,
|
|
1066
1066
|
zIndex: 101,
|
|
1067
1067
|
hitTolerance: 10
|
|
1068
|
-
}), o = new de(), u = new
|
|
1068
|
+
}), o = new de(), u = new ye({
|
|
1069
1069
|
source: o,
|
|
1070
1070
|
className: "zh-map--ship-label-layer",
|
|
1071
1071
|
zIndex: 102,
|
|
@@ -1082,10 +1082,10 @@ const nt = (e, r) => {
|
|
|
1082
1082
|
const g = c.filter((k) => k.id === x);
|
|
1083
1083
|
g.length === 0 ? c.push(l) : l = g[0];
|
|
1084
1084
|
}
|
|
1085
|
-
|
|
1086
|
-
},
|
|
1085
|
+
L(), C(!0), S(c), M();
|
|
1086
|
+
}, N = (c) => {
|
|
1087
1087
|
var z;
|
|
1088
|
-
const x = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id")), g = ee([c == null ? void 0 : c.lon, c == null ? void 0 : c.lat]), k = ((z = m[c.id]) == null ? void 0 : z.blinkColors) || [], V = k[k.length - 1] || c.fill || "#04C900",
|
|
1088
|
+
const x = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id")), g = ee([c == null ? void 0 : c.lon, c == null ? void 0 : c.lat]), k = ((z = m[c.id]) == null ? void 0 : z.blinkColors) || [], V = k[k.length - 1] || c.fill || "#04C900", D = ao(c), j = new ie({
|
|
1089
1089
|
geometry: new le(g),
|
|
1090
1090
|
// 船舶数据
|
|
1091
1091
|
shipData: c,
|
|
@@ -1101,7 +1101,7 @@ const nt = (e, r) => {
|
|
|
1101
1101
|
// 船舶颜色
|
|
1102
1102
|
color: V,
|
|
1103
1103
|
// 船艏向的方向
|
|
1104
|
-
direct:
|
|
1104
|
+
direct: D,
|
|
1105
1105
|
// 高亮
|
|
1106
1106
|
isHighlight: !1
|
|
1107
1107
|
});
|
|
@@ -1122,7 +1122,7 @@ const nt = (e, r) => {
|
|
|
1122
1122
|
if (c === "start") {
|
|
1123
1123
|
const x = () => {
|
|
1124
1124
|
s.getFeatures().forEach((g) => {
|
|
1125
|
-
g.setStyle(
|
|
1125
|
+
g.setStyle(he(e, g));
|
|
1126
1126
|
}), y = requestAnimationFrame(x);
|
|
1127
1127
|
};
|
|
1128
1128
|
x();
|
|
@@ -1131,10 +1131,10 @@ const nt = (e, r) => {
|
|
|
1131
1131
|
}, w = () => {
|
|
1132
1132
|
const x = (e == null ? void 0 : e.getOverlays().getArray()).find((g) => g.get("class") == "ship-overlay-selected");
|
|
1133
1133
|
if (x) {
|
|
1134
|
-
const g = x.getElement(), k = Qe(e, l, "ship"),
|
|
1135
|
-
console.log(
|
|
1134
|
+
const g = x.getElement(), k = Qe(e, l, "ship"), F = g.querySelector("svg");
|
|
1135
|
+
console.log(F), F && (F.style.transform = `scale(${k})`);
|
|
1136
1136
|
}
|
|
1137
|
-
},
|
|
1137
|
+
}, L = () => {
|
|
1138
1138
|
e && s && (s.clear(), o.clear(), C(), h("end"));
|
|
1139
1139
|
}, C = (c) => {
|
|
1140
1140
|
const x = e.getOverlays().getArray().filter((g) => g.get("class") == "zh-map-ship-overlay");
|
|
@@ -1148,47 +1148,47 @@ const nt = (e, r) => {
|
|
|
1148
1148
|
}, b = (c, x) => {
|
|
1149
1149
|
n = c, m = x;
|
|
1150
1150
|
const g = e.getOverlays().getArray(), k = s.getFeatures();
|
|
1151
|
-
for (const
|
|
1152
|
-
const V = n[
|
|
1153
|
-
if (
|
|
1154
|
-
const z = x[
|
|
1155
|
-
j.set("blinking", V), z[(z == null ? void 0 : z.length) - 1] && se !== z[(z == null ? void 0 : z.length) - 1] && (j.set("color", z[(z == null ? void 0 : z.length) - 1] || ""), j.setStyle(
|
|
1151
|
+
for (const F in n) {
|
|
1152
|
+
const V = n[F], D = g.find((z) => z.getId() === "label-" + F), j = k.find((z) => F === z.get("id"));
|
|
1153
|
+
if (D && j) {
|
|
1154
|
+
const z = x[F].blinkColors || [], { shipData: ae, name: re, color: se } = j.getProperties();
|
|
1155
|
+
j.set("blinking", V), z[(z == null ? void 0 : z.length) - 1] && se !== z[(z == null ? void 0 : z.length) - 1] && (j.set("color", z[(z == null ? void 0 : z.length) - 1] || ""), j.setStyle(he(e, j)));
|
|
1156
1156
|
const Re = {
|
|
1157
1157
|
...ae,
|
|
1158
1158
|
blinking: V,
|
|
1159
1159
|
blinkingColors: z || [],
|
|
1160
|
-
name: re + "(" + x[
|
|
1161
|
-
}, be =
|
|
1162
|
-
be && be !== pe &&
|
|
1160
|
+
name: re + "(" + x[F].shipState + ")"
|
|
1161
|
+
}, be = D.getElement(), pe = ut(Re);
|
|
1162
|
+
be && be !== pe && D.setElement(pe);
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
|
-
},
|
|
1165
|
+
}, B = (c) => {
|
|
1166
1166
|
if (!e) return;
|
|
1167
|
-
const x = s.getFeatures(), g = o.getFeatures(), k = r ? r.get("id") : "",
|
|
1167
|
+
const x = s.getFeatures(), g = o.getFeatures(), k = r ? r.get("id") : "", F = x.filter((z) => z.get("id") !== k), V = g == null ? void 0 : g.filter((z) => z.get("id") !== k), D = /* @__PURE__ */ new Map();
|
|
1168
1168
|
c.forEach((z) => {
|
|
1169
|
-
|
|
1169
|
+
D.set(z.id, !0);
|
|
1170
1170
|
});
|
|
1171
1171
|
const j = e.getOverlays().getArray();
|
|
1172
|
-
|
|
1172
|
+
F.forEach((z) => {
|
|
1173
1173
|
const ae = z.get("id");
|
|
1174
|
-
if (!
|
|
1174
|
+
if (!D.has(ae))
|
|
1175
1175
|
z.setStyle([]);
|
|
1176
1176
|
else {
|
|
1177
1177
|
const se = z.getStyle();
|
|
1178
|
-
(se == null ? void 0 : se.length) == 0 && z.setStyle(
|
|
1178
|
+
(se == null ? void 0 : se.length) == 0 && z.setStyle(he(e, z));
|
|
1179
1179
|
}
|
|
1180
1180
|
const re = j.find((se) => se.getId() === "label-" + ae);
|
|
1181
1181
|
re && re.setPosition(void 0);
|
|
1182
1182
|
}), console.log(V), V.forEach((z) => {
|
|
1183
1183
|
const ae = z.get("id");
|
|
1184
|
-
if (!
|
|
1184
|
+
if (!D.has(ae))
|
|
1185
1185
|
z.setStyle([]);
|
|
1186
1186
|
else {
|
|
1187
1187
|
const re = z.getStyle();
|
|
1188
1188
|
(re == null ? void 0 : re.length) == 0 && z.setStyle(nt(z));
|
|
1189
1189
|
}
|
|
1190
1190
|
});
|
|
1191
|
-
},
|
|
1191
|
+
}, G = (c) => {
|
|
1192
1192
|
if (c) {
|
|
1193
1193
|
console.log("选中", c);
|
|
1194
1194
|
const x = s.getFeatures().find((k) => k.get("id") === c.id), g = o.getFeatures().find((k) => k.get("id") === c.id);
|
|
@@ -1198,20 +1198,20 @@ const nt = (e, r) => {
|
|
|
1198
1198
|
}, q = Ne((c, x, g) => {
|
|
1199
1199
|
try {
|
|
1200
1200
|
if (c) {
|
|
1201
|
-
const k = c.get("shipData"),
|
|
1202
|
-
if (e.getTargetElement().style.cursor =
|
|
1203
|
-
t && t !==
|
|
1204
|
-
const V = s.getFeatures().find((
|
|
1205
|
-
V == null || V.set("isHighlight", !0), V == null || V.setStyle(
|
|
1201
|
+
const k = c.get("shipData"), F = c.get("id");
|
|
1202
|
+
if (e.getTargetElement().style.cursor = F ? "pointer" : "", x === "click" && (G(k), g && g(F)), x === "hover") {
|
|
1203
|
+
t && t !== F && Y(), t = F;
|
|
1204
|
+
const V = s.getFeatures().find((D) => D.get("id") === t);
|
|
1205
|
+
V == null || V.set("isHighlight", !0), V == null || V.setStyle(he(e, V));
|
|
1206
1206
|
}
|
|
1207
1207
|
} else
|
|
1208
|
-
e.getTargetElement().style.cursor = "",
|
|
1208
|
+
e.getTargetElement().style.cursor = "", Y();
|
|
1209
1209
|
} catch (k) {
|
|
1210
1210
|
console.log("handleShipMapEvent", k);
|
|
1211
1211
|
}
|
|
1212
|
-
}, 10),
|
|
1212
|
+
}, 10), Y = () => {
|
|
1213
1213
|
const c = t ? s.getFeatures().find((x) => x.get("id") === t) : null;
|
|
1214
|
-
t = null, c == null || c.set("isHighlight", !1), c == null || c.setStyle(
|
|
1214
|
+
t = null, c == null || c.set("isHighlight", !1), c == null || c.setStyle(he(e, c));
|
|
1215
1215
|
}, R = () => {
|
|
1216
1216
|
try {
|
|
1217
1217
|
const x = e.getOverlays().getArray().find((g) => g.get("class") == "ship-overlay-selected");
|
|
@@ -1229,16 +1229,16 @@ const nt = (e, r) => {
|
|
|
1229
1229
|
shipData: c
|
|
1230
1230
|
});
|
|
1231
1231
|
k.set("id", c.id);
|
|
1232
|
-
const
|
|
1233
|
-
return k.setStyle(
|
|
1234
|
-
},
|
|
1232
|
+
const F = nt(k, x);
|
|
1233
|
+
return k.setStyle(F), k;
|
|
1234
|
+
}, S = (c) => {
|
|
1235
1235
|
const x = e.getView().getZoom();
|
|
1236
1236
|
c.forEach((g) => {
|
|
1237
|
-
const k =
|
|
1238
|
-
if (k.setStyle(
|
|
1237
|
+
const k = N(g);
|
|
1238
|
+
if (k.setStyle(he(e, k)), s.addFeature(k), (l == null ? void 0 : l.id) == g.id || x >= te.shipModelMin)
|
|
1239
1239
|
if (n[g.id]) {
|
|
1240
1240
|
if (g.id && m[g == null ? void 0 : g.id]) {
|
|
1241
|
-
const
|
|
1241
|
+
const F = m[g == null ? void 0 : g.id] || {}, V = (F == null ? void 0 : F.blinkColors) || [], D = (F == null ? void 0 : F.shipState) || "", j = (g.cnname || g.enname || g.name || g.id || "未命名船舶") + "(" + D + ")", z = {
|
|
1242
1242
|
...g,
|
|
1243
1243
|
name: j,
|
|
1244
1244
|
blinking: n[g.id],
|
|
@@ -1247,17 +1247,17 @@ const nt = (e, r) => {
|
|
|
1247
1247
|
fo(e, z);
|
|
1248
1248
|
}
|
|
1249
1249
|
} else {
|
|
1250
|
-
const
|
|
1251
|
-
o.addFeature(
|
|
1250
|
+
const F = Z(g, c.length);
|
|
1251
|
+
o.addFeature(F);
|
|
1252
1252
|
}
|
|
1253
1253
|
});
|
|
1254
1254
|
};
|
|
1255
1255
|
return {
|
|
1256
1256
|
render: v,
|
|
1257
|
-
selected:
|
|
1258
|
-
filter:
|
|
1257
|
+
selected: G,
|
|
1258
|
+
filter: B,
|
|
1259
1259
|
blinking: b,
|
|
1260
|
-
clear:
|
|
1260
|
+
clear: L,
|
|
1261
1261
|
handleShipMapEvent: q,
|
|
1262
1262
|
changeShipScale: h,
|
|
1263
1263
|
changeSelectedScale: w
|
|
@@ -1310,36 +1310,36 @@ const nt = (e, r) => {
|
|
|
1310
1310
|
const u = (h) => {
|
|
1311
1311
|
if (!(!h || h.length === 0)) {
|
|
1312
1312
|
if (s || (s = new de()), s.clear(), o) {
|
|
1313
|
-
const w = h.find((
|
|
1313
|
+
const w = h.find((L) => L.id === o.id);
|
|
1314
1314
|
w ? o = w : h.push(o);
|
|
1315
1315
|
}
|
|
1316
1316
|
h.forEach((w) => {
|
|
1317
1317
|
y(w);
|
|
1318
|
-
}), l || (l = new
|
|
1318
|
+
}), l || (l = new ye({
|
|
1319
1319
|
className: r,
|
|
1320
1320
|
source: s,
|
|
1321
1321
|
zIndex: 100
|
|
1322
1322
|
}), e == null || e.addLayer(l));
|
|
1323
1323
|
}
|
|
1324
1324
|
}, y = (h) => {
|
|
1325
|
-
const w = e == null ? void 0 : e.getView().getZoom(), [
|
|
1326
|
-
geometry: new le(ee([Number(
|
|
1325
|
+
const w = e == null ? void 0 : e.getView().getZoom(), [L, C] = h.latLon.split(","), b = new ie({
|
|
1326
|
+
geometry: new le(ee([Number(L), Number(C)]))
|
|
1327
1327
|
});
|
|
1328
1328
|
b.setStyle(t(h, w, h.id === (o == null ? void 0 : o.id))), b.set("loactionData", h), s.addFeature(b);
|
|
1329
|
-
}, t = (h, w,
|
|
1329
|
+
}, t = (h, w, L) => {
|
|
1330
1330
|
const C = {
|
|
1331
1331
|
image: new Oe({
|
|
1332
|
-
src:
|
|
1332
|
+
src: L && h.selectedPath || h.defaultPath,
|
|
1333
1333
|
scale: 0.5 * w / 10
|
|
1334
1334
|
})
|
|
1335
1335
|
};
|
|
1336
1336
|
return h.name && (C.text = new ge({
|
|
1337
1337
|
text: h.name,
|
|
1338
1338
|
font: "12px sans-serif",
|
|
1339
|
-
fill: new
|
|
1339
|
+
fill: new Q({
|
|
1340
1340
|
color: "#000000"
|
|
1341
1341
|
}),
|
|
1342
|
-
backgroundFill: new
|
|
1342
|
+
backgroundFill: new Q({
|
|
1343
1343
|
color: "#FFFFFF"
|
|
1344
1344
|
}),
|
|
1345
1345
|
offsetY: 30
|
|
@@ -1359,16 +1359,16 @@ const nt = (e, r) => {
|
|
|
1359
1359
|
b.get("loactionData").id === h.id && (b == null || b.setStyle(t(h, w, !1)));
|
|
1360
1360
|
}), o = null, a = null;
|
|
1361
1361
|
}, v = (h) => {
|
|
1362
|
-
h ? (
|
|
1363
|
-
},
|
|
1362
|
+
h ? (N(), M(h)) : clearSelectedPort();
|
|
1363
|
+
}, N = () => {
|
|
1364
1364
|
var h;
|
|
1365
1365
|
if (a) {
|
|
1366
|
-
const w = a.get("loactionData"),
|
|
1367
|
-
a.setStyle(t(w,
|
|
1366
|
+
const w = a.get("loactionData"), L = (h = e == null ? void 0 : e.getView()) == null ? void 0 : h.getZoom();
|
|
1367
|
+
a.setStyle(t(w, L, !1));
|
|
1368
1368
|
}
|
|
1369
1369
|
}, M = (h) => {
|
|
1370
1370
|
const w = s.getFeatures();
|
|
1371
|
-
o = h, a = w.find((
|
|
1371
|
+
o = h, a = w.find((L) => L.get("loactionData").id === h.id);
|
|
1372
1372
|
};
|
|
1373
1373
|
return {
|
|
1374
1374
|
render: u,
|
|
@@ -1388,8 +1388,8 @@ const nt = (e, r) => {
|
|
|
1388
1388
|
const l = e.getViewport();
|
|
1389
1389
|
l && (l.style.cursor = r);
|
|
1390
1390
|
}, Mo = (e, r) => {
|
|
1391
|
-
const l = I([]), s = I("km"), a = (
|
|
1392
|
-
s.value =
|
|
1391
|
+
const l = I([]), s = I("km"), a = (S) => {
|
|
1392
|
+
s.value = S;
|
|
1393
1393
|
};
|
|
1394
1394
|
let o;
|
|
1395
1395
|
const u = I(!1), y = () => {
|
|
@@ -1399,7 +1399,7 @@ const nt = (e, r) => {
|
|
|
1399
1399
|
};
|
|
1400
1400
|
let t, n;
|
|
1401
1401
|
const m = () => {
|
|
1402
|
-
t = new de(), n = new
|
|
1402
|
+
t = new de(), n = new ye({
|
|
1403
1403
|
source: t,
|
|
1404
1404
|
zIndex: 1e3,
|
|
1405
1405
|
style: {
|
|
@@ -1411,12 +1411,12 @@ const nt = (e, r) => {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
}), e == null || e.addLayer(n);
|
|
1413
1413
|
};
|
|
1414
|
-
let v,
|
|
1415
|
-
const M = (
|
|
1416
|
-
if (
|
|
1414
|
+
let v, N;
|
|
1415
|
+
const M = (S) => {
|
|
1416
|
+
if (S.dragging)
|
|
1417
1417
|
return;
|
|
1418
1418
|
let c = "点击选择起点";
|
|
1419
|
-
v && (c = "单击继续,双击结束"), o && (o.innerHTML = c,
|
|
1419
|
+
v && (c = "单击继续,双击结束"), o && (o.innerHTML = c, N.setPosition(S.coordinate), o.classList.remove("hidden"));
|
|
1420
1420
|
};
|
|
1421
1421
|
let h;
|
|
1422
1422
|
const w = () => {
|
|
@@ -1424,7 +1424,7 @@ const nt = (e, r) => {
|
|
|
1424
1424
|
source: t,
|
|
1425
1425
|
type: "LineString",
|
|
1426
1426
|
style: new X({
|
|
1427
|
-
fill: new
|
|
1427
|
+
fill: new Q({
|
|
1428
1428
|
color: "rgba(255, 255, 255, 0.2)"
|
|
1429
1429
|
}),
|
|
1430
1430
|
stroke: new ve({
|
|
@@ -1437,39 +1437,39 @@ const nt = (e, r) => {
|
|
|
1437
1437
|
stroke: new ve({
|
|
1438
1438
|
color: "rgba(0, 0, 0, 0.7)"
|
|
1439
1439
|
}),
|
|
1440
|
-
fill: new
|
|
1440
|
+
fill: new Q({
|
|
1441
1441
|
color: "rgba(255, 255, 255, 0.2)"
|
|
1442
1442
|
})
|
|
1443
1443
|
})
|
|
1444
1444
|
}),
|
|
1445
1445
|
// 添加条件函数,判断是否应该出发点绘制
|
|
1446
1446
|
condition: (c) => c.originalEvent.target.tagName !== "DIV"
|
|
1447
|
-
}), e == null || e.addInteraction(h),
|
|
1448
|
-
let
|
|
1447
|
+
}), e == null || e.addInteraction(h), B(), G();
|
|
1448
|
+
let S;
|
|
1449
1449
|
h.on("drawstart", function(c) {
|
|
1450
1450
|
var g;
|
|
1451
|
-
v = c.feature, v.set("randomId",
|
|
1451
|
+
v = c.feature, v.set("randomId", L());
|
|
1452
1452
|
let x;
|
|
1453
|
-
|
|
1454
|
-
const
|
|
1455
|
-
x =
|
|
1453
|
+
S = (g = v.getGeometry()) == null ? void 0 : g.on("change", function(k) {
|
|
1454
|
+
const F = k.target, V = gt(F, s.value);
|
|
1455
|
+
x = F.getLastCoordinate(), C && V && (C.innerHTML = V), b.setPosition(x);
|
|
1456
1456
|
});
|
|
1457
1457
|
}), h.on("drawend", function() {
|
|
1458
1458
|
var c, x, g;
|
|
1459
1459
|
if (C && (C.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), C != null && C.innerHTML) {
|
|
1460
|
-
const k = (v == null ? void 0 : v.get("randomId")) ||
|
|
1460
|
+
const k = (v == null ? void 0 : v.get("randomId")) || L();
|
|
1461
1461
|
l.value.push({ id: k, value: C == null ? void 0 : C.innerHTML }), C.innerHTML = `${C.innerHTML}<div class="ol-tooltip-delete-button" data-id="${k}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
1462
1462
|
}
|
|
1463
1463
|
(c = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || c.addEventListener("click", (k) => {
|
|
1464
1464
|
var V;
|
|
1465
1465
|
k.preventDefault(), k.stopPropagation();
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1468
|
-
}), b.setOffset([0, -7]), v = null, C = null,
|
|
1466
|
+
const F = (V = k.target) == null ? void 0 : V.getAttribute("data-id");
|
|
1467
|
+
F && Y(F);
|
|
1468
|
+
}), b.setOffset([0, -7]), v = null, C = null, B(), S && We(S), (g = (x = r.getProps()) == null ? void 0 : x.lineDrawEnd) == null || g.call(x, l.value);
|
|
1469
1469
|
});
|
|
1470
|
-
},
|
|
1470
|
+
}, L = () => Math.random().toString(36).substring(2, 9);
|
|
1471
1471
|
let C, b;
|
|
1472
|
-
const
|
|
1472
|
+
const B = () => {
|
|
1473
1473
|
C != null && C.parentNode && C.parentNode.removeChild(C), C = document.createElement("div"), C.className = "ol-tooltip ol-tooltip-measure", b = new ce({
|
|
1474
1474
|
element: C,
|
|
1475
1475
|
offset: [0, -15],
|
|
@@ -1477,45 +1477,45 @@ const nt = (e, r) => {
|
|
|
1477
1477
|
stopEvent: !1,
|
|
1478
1478
|
insertFirst: !1
|
|
1479
1479
|
}), e == null || e.addOverlay(b);
|
|
1480
|
-
},
|
|
1481
|
-
o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden",
|
|
1480
|
+
}, G = () => {
|
|
1481
|
+
o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", N = new ce({
|
|
1482
1482
|
element: o,
|
|
1483
1483
|
offset: [15, 0],
|
|
1484
1484
|
positioning: "center-left"
|
|
1485
|
-
}), e == null || e.addOverlay(
|
|
1485
|
+
}), e == null || e.addOverlay(N);
|
|
1486
1486
|
}, q = () => {
|
|
1487
|
-
l.value.forEach((
|
|
1488
|
-
var k,
|
|
1487
|
+
l.value.forEach((S, c) => {
|
|
1488
|
+
var k, F;
|
|
1489
1489
|
const x = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1490
|
-
x[c] && ((
|
|
1490
|
+
x[c] && ((F = (k = x[c]) == null ? void 0 : k.parentNode) == null || F.removeChild(x[c]));
|
|
1491
1491
|
const g = t.getFeatures();
|
|
1492
1492
|
g[c] && t.removeFeature(g[c]);
|
|
1493
1493
|
}), R(), po(e), u.value = !1, ze(e, "pointer");
|
|
1494
|
-
},
|
|
1495
|
-
var x, g, k,
|
|
1496
|
-
const c = l.value.findIndex((V) => V.id ===
|
|
1494
|
+
}, Y = (S) => {
|
|
1495
|
+
var x, g, k, F;
|
|
1496
|
+
const c = l.value.findIndex((V) => V.id === S);
|
|
1497
1497
|
if (c !== -1) {
|
|
1498
1498
|
l.value.splice(c, 1);
|
|
1499
1499
|
const V = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1500
1500
|
V[c] && ((g = (x = V[c]) == null ? void 0 : x.parentNode) == null || g.removeChild(V[c]));
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1501
|
+
const D = t.getFeatures();
|
|
1502
|
+
D[c] && t.removeFeature(D[c]);
|
|
1503
1503
|
}
|
|
1504
|
-
(
|
|
1504
|
+
(F = (k = r.getProps()) == null ? void 0 : k.lineDrawEnd) == null || F.call(k, l.value);
|
|
1505
1505
|
}, R = () => {
|
|
1506
|
-
if (l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((
|
|
1506
|
+
if (l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((S) => {
|
|
1507
1507
|
var c;
|
|
1508
|
-
(c =
|
|
1508
|
+
(c = S == null ? void 0 : S.parentNode) == null || c.removeChild(S);
|
|
1509
1509
|
}), t == null || t.clear(), h) {
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1510
|
+
const S = e.getInteractions().getArray().find((c) => et(c) === et(h));
|
|
1511
|
+
S && e.removeInteraction(S);
|
|
1512
1512
|
}
|
|
1513
1513
|
e.removeLayer(n), o != null && o.parentNode && o.parentNode.removeChild(o), C != null && C.parentNode && C.parentNode.removeChild(C);
|
|
1514
1514
|
};
|
|
1515
1515
|
return {
|
|
1516
1516
|
open: y,
|
|
1517
1517
|
close: q,
|
|
1518
|
-
deleteLine:
|
|
1518
|
+
deleteLine: Y,
|
|
1519
1519
|
setUnit: a,
|
|
1520
1520
|
getState: () => u.value
|
|
1521
1521
|
};
|
|
@@ -1539,12 +1539,12 @@ const nt = (e, r) => {
|
|
|
1539
1539
|
const a = () => {
|
|
1540
1540
|
o(), ze(e, "crosshair");
|
|
1541
1541
|
}, o = () => {
|
|
1542
|
-
t(), C(),
|
|
1542
|
+
t(), C(), G(), M();
|
|
1543
1543
|
};
|
|
1544
1544
|
let u = null, y = null;
|
|
1545
1545
|
const t = () => {
|
|
1546
1546
|
if (u && y) return;
|
|
1547
|
-
const R = new de(), Z = new
|
|
1547
|
+
const R = new de(), Z = new ye({
|
|
1548
1548
|
source: R,
|
|
1549
1549
|
style: new X({
|
|
1550
1550
|
stroke: new ve({
|
|
@@ -1553,17 +1553,17 @@ const nt = (e, r) => {
|
|
|
1553
1553
|
})
|
|
1554
1554
|
})
|
|
1555
1555
|
});
|
|
1556
|
-
u = Z, y = R, e.on("pointermove", m), e.addLayer(Z), e.on(["dblclick"], function(
|
|
1557
|
-
v && (
|
|
1556
|
+
u = Z, y = R, e.on("pointermove", m), e.addLayer(Z), e.on(["dblclick"], function(S) {
|
|
1557
|
+
v && (S.stopPropagation(), S.preventDefault());
|
|
1558
1558
|
});
|
|
1559
1559
|
};
|
|
1560
1560
|
let n;
|
|
1561
1561
|
const m = (R) => {
|
|
1562
1562
|
if (R.dragging) return;
|
|
1563
1563
|
const Z = n ? "单击继续,双击结束" : "点击选择起点";
|
|
1564
|
-
b && (b.innerHTML = Z,
|
|
1564
|
+
b && (b.innerHTML = Z, B.setPosition(R.coordinate));
|
|
1565
1565
|
};
|
|
1566
|
-
let v,
|
|
1566
|
+
let v, N = !1;
|
|
1567
1567
|
const M = () => {
|
|
1568
1568
|
if (l) {
|
|
1569
1569
|
b != null && b.parentNode && b.parentNode.removeChild(b);
|
|
@@ -1571,18 +1571,18 @@ const nt = (e, r) => {
|
|
|
1571
1571
|
if (!R) return;
|
|
1572
1572
|
const Z = h(R, "nm");
|
|
1573
1573
|
w && (w.innerHTML = `
|
|
1574
|
-
<span class="text">面积:${Z}${
|
|
1574
|
+
<span class="text">面积:${Z}${N ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1575
1575
|
`), w && (w.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
|
|
1576
|
-
const
|
|
1577
|
-
if (
|
|
1576
|
+
const S = R.getCoordinates(), c = S[0][S[0].length - 2];
|
|
1577
|
+
if (L.setPosition(c), u) {
|
|
1578
1578
|
const g = u.getSource();
|
|
1579
1579
|
g && l && (g.clear(), g.addFeature(l));
|
|
1580
1580
|
}
|
|
1581
1581
|
setTimeout(() => {
|
|
1582
1582
|
var g;
|
|
1583
1583
|
(g = document.querySelector(".delete-icon")) == null || g.addEventListener("click", () => {
|
|
1584
|
-
var k,
|
|
1585
|
-
console.log("delete"), q(), (
|
|
1584
|
+
var k, F;
|
|
1585
|
+
console.log("delete"), q(), (F = (k = r.getProps()) == null ? void 0 : k.areaDrawEnd) == null || F.call(k, []);
|
|
1586
1586
|
});
|
|
1587
1587
|
}, 0);
|
|
1588
1588
|
const x = qt(l.getGeometry().getExtent());
|
|
@@ -1599,13 +1599,13 @@ const nt = (e, r) => {
|
|
|
1599
1599
|
width: 1.5,
|
|
1600
1600
|
lineDash: [10, 10]
|
|
1601
1601
|
}),
|
|
1602
|
-
fill: new
|
|
1602
|
+
fill: new Q({
|
|
1603
1603
|
color: "rgba(255, 255, 255, 0.25)"
|
|
1604
1604
|
})
|
|
1605
1605
|
}), new X({
|
|
1606
1606
|
image: new Ve({
|
|
1607
1607
|
radius: 5,
|
|
1608
|
-
fill: new
|
|
1608
|
+
fill: new Q({
|
|
1609
1609
|
color: "rgb(51,112,255, 1)"
|
|
1610
1610
|
})
|
|
1611
1611
|
}),
|
|
@@ -1616,22 +1616,22 @@ const nt = (e, r) => {
|
|
|
1616
1616
|
})]
|
|
1617
1617
|
}), e == null || e.addInteraction(v), v.on("drawstart", (R) => {
|
|
1618
1618
|
var Z;
|
|
1619
|
-
n = R.feature, s = (Z = n.getGeometry()) == null ? void 0 : Z.on("change", (
|
|
1620
|
-
const c =
|
|
1621
|
-
if (
|
|
1622
|
-
const
|
|
1619
|
+
n = R.feature, s = (Z = n.getGeometry()) == null ? void 0 : Z.on("change", (S) => {
|
|
1620
|
+
const c = S.target, x = h(c, "nm"), k = c.getCoordinates()[0], F = new Pe([k[k.length - 2], k[k.length - 1]]), V = gt(F, "nm");
|
|
1621
|
+
if (N = Number(He(F) / 1e3) > 150, !x) return;
|
|
1622
|
+
const D = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1623
1623
|
w && (w.innerHTML = `
|
|
1624
1624
|
<div class="text">
|
|
1625
1625
|
面积:${x}
|
|
1626
|
-
${
|
|
1626
|
+
${N ? D : ""}
|
|
1627
1627
|
</div>
|
|
1628
1628
|
`), b && (b.innerHTML = `
|
|
1629
1629
|
<div class="text">
|
|
1630
1630
|
面积:${x}
|
|
1631
1631
|
</div>
|
|
1632
|
-
<div class="text ${
|
|
1632
|
+
<div class="text ${N ? "error" : ""}">
|
|
1633
1633
|
线段 ${k.length - 2}: ${V}
|
|
1634
|
-
${
|
|
1634
|
+
${N ? D : ""}
|
|
1635
1635
|
|
|
1636
1636
|
</div>
|
|
1637
1637
|
<div>
|
|
@@ -1640,61 +1640,61 @@ const nt = (e, r) => {
|
|
|
1640
1640
|
`);
|
|
1641
1641
|
});
|
|
1642
1642
|
}), v.on("drawend", (R) => {
|
|
1643
|
-
var x, g, k,
|
|
1643
|
+
var x, g, k, F;
|
|
1644
1644
|
if (!R.feature.getGeometry()) return;
|
|
1645
|
-
w && !l && (w.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), l = R.feature,
|
|
1646
|
-
const
|
|
1647
|
-
if (
|
|
1648
|
-
const V =
|
|
1645
|
+
w && !l && (w.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), l = R.feature, L.setOffset([10, 0]);
|
|
1646
|
+
const S = R.feature.getGeometry().getCoordinates(), c = S[0][S[0].length - 2];
|
|
1647
|
+
if (L.setPosition(c), b != null && b.parentNode && b.parentNode.removeChild(b), (x = r.getProps()) != null && x.areaDrawEnd) {
|
|
1648
|
+
const V = S[0].map((D) => ke(D, K.mercator, K.data));
|
|
1649
1649
|
(k = (g = r.getProps()) == null ? void 0 : g.areaDrawEnd) == null || k.call(g, V);
|
|
1650
1650
|
}
|
|
1651
|
-
v && (v.setActive(!1), e == null || e.removeInteraction(v), (e == null ? void 0 : e.getInteractions()).forEach((
|
|
1652
|
-
|
|
1653
|
-
})), s && We(s), (
|
|
1654
|
-
var V,
|
|
1655
|
-
q(), (
|
|
1651
|
+
v && (v.setActive(!1), e == null || e.removeInteraction(v), (e == null ? void 0 : e.getInteractions()).forEach((D) => {
|
|
1652
|
+
D instanceof Se && (D.setActive(!1), e == null || e.removeInteraction(D));
|
|
1653
|
+
})), s && We(s), (F = document.querySelector(".delete-icon")) == null || F.addEventListener("click", () => {
|
|
1654
|
+
var V, D;
|
|
1655
|
+
q(), (D = (V = r.getProps()) == null ? void 0 : V.areaDrawEnd) == null || D.call(V, []);
|
|
1656
1656
|
});
|
|
1657
1657
|
});
|
|
1658
1658
|
}, h = (R, Z) => {
|
|
1659
|
-
const
|
|
1659
|
+
const S = Bt(R);
|
|
1660
1660
|
switch (Z) {
|
|
1661
1661
|
case "km":
|
|
1662
|
-
return
|
|
1662
|
+
return S > 1e4 ? Math.round(S / 1e6 * 100) / 100 + " km<sup>2</sup>" : Math.round(S * 100) / 100 + " m<sup>2</sup>";
|
|
1663
1663
|
case "nm":
|
|
1664
|
-
return
|
|
1664
|
+
return S > 1e4 ? Math.round(S / 1e6 / Math.pow(1.852, 2) * 100) / 100 + " nm<sup>2</sup>" : Math.round(S * 100) / 100 + " m<sup>2</sup>";
|
|
1665
1665
|
}
|
|
1666
1666
|
};
|
|
1667
|
-
let w,
|
|
1667
|
+
let w, L;
|
|
1668
1668
|
const C = () => {
|
|
1669
|
-
w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.style.display = "flex", w.className = "ol-tooltip ol-tooltip-draw-polygon",
|
|
1669
|
+
w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.style.display = "flex", w.className = "ol-tooltip ol-tooltip-draw-polygon", L = new ce({
|
|
1670
1670
|
element: w,
|
|
1671
1671
|
offset: [0, -15],
|
|
1672
1672
|
positioning: "bottom-center",
|
|
1673
1673
|
stopEvent: !1,
|
|
1674
1674
|
insertFirst: !1
|
|
1675
|
-
}), e == null || e.addOverlay(
|
|
1675
|
+
}), e == null || e.addOverlay(L);
|
|
1676
1676
|
};
|
|
1677
|
-
let b,
|
|
1678
|
-
const
|
|
1679
|
-
b != null && b.parentNode && b.parentNode.removeChild(b), b = document.createElement("div"), b.className = "ol-tooltip ol-help-tooltip",
|
|
1677
|
+
let b, B;
|
|
1678
|
+
const G = () => {
|
|
1679
|
+
b != null && b.parentNode && b.parentNode.removeChild(b), b = document.createElement("div"), b.className = "ol-tooltip ol-help-tooltip", B = new ce({
|
|
1680
1680
|
element: b,
|
|
1681
1681
|
offset: [15, 0],
|
|
1682
1682
|
positioning: "center-left"
|
|
1683
|
-
}), e == null || e.addOverlay(
|
|
1683
|
+
}), e == null || e.addOverlay(B);
|
|
1684
1684
|
}, q = () => {
|
|
1685
|
-
y == null || y.clear(), l = null, C(),
|
|
1685
|
+
y == null || y.clear(), l = null, C(), G(), M();
|
|
1686
1686
|
};
|
|
1687
1687
|
return {
|
|
1688
1688
|
open: a,
|
|
1689
1689
|
close: () => {
|
|
1690
1690
|
y == null || y.clear(), y = null, u && (e.removeLayer(u), u = null), n = null, v && (v.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((Z) => {
|
|
1691
1691
|
Z instanceof Se && (Z.setActive(!1), e == null || e.removeInteraction(Z));
|
|
1692
|
-
}), v = null), s && We(s), b != null && b.parentElement && b.parentElement.removeChild(b), w != null && w.parentElement && w.parentElement.removeChild(w),
|
|
1692
|
+
}), v = null), s && We(s), b != null && b.parentElement && b.parentElement.removeChild(b), w != null && w.parentElement && w.parentElement.removeChild(w), B && e.removeOverlay(B), L && e.removeOverlay(L), ze(e, "pointer");
|
|
1693
1693
|
},
|
|
1694
1694
|
reset: q
|
|
1695
1695
|
};
|
|
1696
1696
|
}, Lo = "zh-map-port-layer", Eo = (e) => {
|
|
1697
|
-
const r = new de(), l = new
|
|
1697
|
+
const r = new de(), l = new ye({
|
|
1698
1698
|
className: Lo,
|
|
1699
1699
|
source: r,
|
|
1700
1700
|
zIndex: 100,
|
|
@@ -1706,7 +1706,7 @@ const nt = (e, r) => {
|
|
|
1706
1706
|
const o = (M, h = !0) => {
|
|
1707
1707
|
if (!(!M || M.length === 0)) {
|
|
1708
1708
|
if (r.clear(), a) {
|
|
1709
|
-
const w = M.find((
|
|
1709
|
+
const w = M.find((L) => L.id === a.id);
|
|
1710
1710
|
w ? a = w : M.push(a);
|
|
1711
1711
|
}
|
|
1712
1712
|
M.forEach((w) => {
|
|
@@ -1714,16 +1714,16 @@ const nt = (e, r) => {
|
|
|
1714
1714
|
});
|
|
1715
1715
|
}
|
|
1716
1716
|
}, u = (M, h = !0) => {
|
|
1717
|
-
const [w,
|
|
1718
|
-
geometry: new le(ee([Number(w), Number(
|
|
1717
|
+
const [w, L] = M.latLon.split(","), C = new ie({
|
|
1718
|
+
geometry: new le(ee([Number(w), Number(L)])),
|
|
1719
1719
|
portData: M,
|
|
1720
1720
|
select: M.id === (a == null ? void 0 : a.id),
|
|
1721
1721
|
showTitle: M.id === (a == null ? void 0 : a.id) || h
|
|
1722
1722
|
}), b = y(C);
|
|
1723
1723
|
console.log("point-styles--------", b), C.setStyle(b), r.addFeature(C);
|
|
1724
1724
|
}, y = (M) => {
|
|
1725
|
-
const { select: h, showTitle: w } = M.getProperties(),
|
|
1726
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.6563 44.9304C22.5453 44.8844 22.4445 44.817 22.3595 44.7321C22.3595 44.7321 9.36986 31.7424 9.32952 31.6913C7.09059 29.0791 5.64794 25.8802 5.17255 22.4736C4.69716 19.0671 5.20896 15.5957 6.64728 12.471C8.08561 9.34625 10.3902 6.69909 13.2878 4.84325C16.1855 2.98741 19.5548 2.00068 22.9965 2C26.4381 1.99932 29.8078 2.98473 32.7062 4.83943C35.6046 6.69414 37.9102 9.34039 39.3498 12.4646C40.7893 15.5888 41.3025 19.0599 40.8284 22.4666C40.3544 25.8734 38.913 29.0729 36.6751 31.686C36.6401 31.737 23.6531 44.7321 23.6531 44.7321C23.5682 44.817 23.4674 44.8844 23.3564 44.9304C23.2454 44.9763 23.1265 45 23.0063 45C22.8862 45 22.7673 44.9763 22.6563 44.9304Z" fill="${
|
|
1725
|
+
const { select: h, showTitle: w } = M.getProperties(), L = (Y) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1726
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.6563 44.9304C22.5453 44.8844 22.4445 44.817 22.3595 44.7321C22.3595 44.7321 9.36986 31.7424 9.32952 31.6913C7.09059 29.0791 5.64794 25.8802 5.17255 22.4736C4.69716 19.0671 5.20896 15.5957 6.64728 12.471C8.08561 9.34625 10.3902 6.69909 13.2878 4.84325C16.1855 2.98741 19.5548 2.00068 22.9965 2C26.4381 1.99932 29.8078 2.98473 32.7062 4.83943C35.6046 6.69414 37.9102 9.34039 39.3498 12.4646C40.7893 15.5888 41.3025 19.0599 40.8284 22.4666C40.3544 25.8734 38.913 29.0729 36.6751 31.686C36.6401 31.737 23.6531 44.7321 23.6531 44.7321C23.5682 44.817 23.4674 44.8844 23.3564 44.9304C23.2454 44.9763 23.1265 45 23.0063 45C22.8862 45 22.7673 44.9763 22.6563 44.9304Z" fill="${Y}"/>
|
|
1727
1727
|
<g clip-path="url(#clip0_10059_122082)">
|
|
1728
1728
|
<path d="M34.8624 22.8687L32.5874 25.6313L33.4812 25.7125C33.4812 25.7125 30.5562 28.0687 27.9562 28.2312C25.3562 28.3937 24.1374 24.9 24.1374 24.9V19.1312H27.6312V17.425H24.2999V15.15C25.7624 14.6625 26.7374 13.2812 26.7374 11.6562C26.7374 9.625 25.1124 8 23.0812 8H22.9999C20.9687 8 19.3437 9.625 19.3437 11.6562C19.3437 13.2812 20.3999 14.6625 21.7812 15.15V17.425H18.4499V19.1312H21.9437V24.9C21.9437 24.9 20.6437 28.3125 18.0437 28.2312C15.4437 28.0687 12.5187 25.7125 12.5187 25.7125L13.4124 25.6313L11.0562 22.8687L10.2437 26.2812L11.2187 26.0375C11.2187 26.0375 13.1687 29.5313 16.1749 30.8313C19.1812 32.2125 22.1874 33.9187 22.8374 34C23.4874 33.9187 26.4937 32.2125 29.4187 30.8313C32.3437 29.45 34.3749 26.0375 34.3749 26.0375L35.3499 26.2812L34.8624 22.8687ZM23.0812 13.6875C21.9437 13.6875 21.0499 12.7937 21.0499 11.6562C21.0499 10.6 21.9437 9.70625 22.9999 9.70625H23.0812C24.1374 9.70625 25.0312 10.6 25.0312 11.6562C25.1124 12.7937 24.1374 13.6875 23.0812 13.6875Z" fill="white"/>
|
|
1729
1729
|
</g>
|
|
@@ -1733,31 +1733,31 @@ const nt = (e, r) => {
|
|
|
1733
1733
|
</clipPath>
|
|
1734
1734
|
</defs>
|
|
1735
1735
|
</svg>
|
|
1736
|
-
`, C = () => `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
1736
|
+
`, C = () => `data:image/svg+xml;utf8,${encodeURIComponent(L(h ? "#FF5733" : "#3370FF"))}`, b = e.getView().getZoom(), B = M.get("portData"), G = {
|
|
1737
1737
|
image: new Oe({
|
|
1738
1738
|
src: C(),
|
|
1739
1739
|
scale: 0.5 * b / 10
|
|
1740
1740
|
}),
|
|
1741
1741
|
zIndex: h ? 110 : 100
|
|
1742
|
-
}
|
|
1743
|
-
if (!w && !h)
|
|
1744
|
-
return A;
|
|
1745
|
-
console.log("showTitle", w, Y.shortName, "选中", h, b);
|
|
1746
|
-
const q = new X({
|
|
1742
|
+
}, q = {
|
|
1747
1743
|
text: new ge({
|
|
1748
|
-
text:
|
|
1744
|
+
text: B.shortName,
|
|
1749
1745
|
font: "12px sans-serif",
|
|
1750
|
-
fill: new
|
|
1746
|
+
fill: new Q({
|
|
1751
1747
|
color: h ? "#ffffff" : "#000000"
|
|
1752
1748
|
}),
|
|
1753
|
-
backgroundFill: new
|
|
1754
|
-
color: "
|
|
1749
|
+
backgroundFill: new Q({
|
|
1750
|
+
color: "#FFF"
|
|
1755
1751
|
}),
|
|
1756
1752
|
offsetY: 30
|
|
1757
|
-
})
|
|
1758
|
-
|
|
1753
|
+
})
|
|
1754
|
+
};
|
|
1755
|
+
return !w && !h ? new X({
|
|
1756
|
+
...G
|
|
1757
|
+
}) : new X({
|
|
1758
|
+
...G,
|
|
1759
|
+
...q
|
|
1759
1760
|
});
|
|
1760
|
-
return [A, q];
|
|
1761
1761
|
}, t = () => {
|
|
1762
1762
|
if (r)
|
|
1763
1763
|
if (s) {
|
|
@@ -1775,16 +1775,25 @@ const nt = (e, r) => {
|
|
|
1775
1775
|
(s == null ? void 0 : s.get("portData").id) !== M.id && (m(), v(M));
|
|
1776
1776
|
}
|
|
1777
1777
|
}, m = () => {
|
|
1778
|
+
var M;
|
|
1778
1779
|
if (s) {
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1780
|
+
const h = s == null ? void 0 : s.get("portData"), w = (M = r.getFeatures()) == null ? void 0 : M.find((L) => L.get("portData").id === h.id);
|
|
1781
|
+
if (w) {
|
|
1782
|
+
const L = y(w);
|
|
1783
|
+
w.set("select", !1), w.setStyle(L), s = null, a = null;
|
|
1784
|
+
}
|
|
1783
1785
|
}
|
|
1784
1786
|
}, v = (M) => {
|
|
1787
|
+
var w;
|
|
1785
1788
|
if (!r) return;
|
|
1786
1789
|
const h = r.getFeatures();
|
|
1787
|
-
a = M, s = h.find((
|
|
1790
|
+
if (a = M, s = h.find((L) => L.get("portData").id === M.id), s) {
|
|
1791
|
+
s.set("select", !0);
|
|
1792
|
+
const L = y(s);
|
|
1793
|
+
L && ((w = L == null ? void 0 : L.getText()) == null || w.setBackgroundFill(new Q({
|
|
1794
|
+
color: "#FF5733"
|
|
1795
|
+
}))), s.setStyle(L);
|
|
1796
|
+
}
|
|
1788
1797
|
};
|
|
1789
1798
|
return {
|
|
1790
1799
|
render: o,
|
|
@@ -1830,11 +1839,11 @@ const nt = (e, r) => {
|
|
|
1830
1839
|
const v = u.getFeaturesAtPixel(y.pixel);
|
|
1831
1840
|
if (!v && v.length === 0) return;
|
|
1832
1841
|
console.log("features------------", v);
|
|
1833
|
-
let
|
|
1842
|
+
let N = null, M = null;
|
|
1834
1843
|
if (v == null || v.forEach((h) => {
|
|
1835
|
-
h.get("shipData") && (
|
|
1836
|
-
}),
|
|
1837
|
-
s.handleShipMapEvent(
|
|
1844
|
+
h.get("shipData") && (N = h), h.get("portData") && (M = h);
|
|
1845
|
+
}), N)
|
|
1846
|
+
s.handleShipMapEvent(N, "click", (t = r.getProps()) == null ? void 0 : t.selectShip);
|
|
1838
1847
|
else if (M) {
|
|
1839
1848
|
const h = M.get("portData");
|
|
1840
1849
|
a.selected(h), (m = (n = r.getProps()) == null ? void 0 : n.selectPort) == null || m.call(n, h);
|
|
@@ -1847,7 +1856,7 @@ const nt = (e, r) => {
|
|
|
1847
1856
|
const y = u == null ? void 0 : u.getView().getZoom();
|
|
1848
1857
|
y && y <= te.shipModelMax && y >= te.shipTriggleMin && s.changeSelectedScale("start");
|
|
1849
1858
|
}, 10));
|
|
1850
|
-
},
|
|
1859
|
+
}, Fo = () => {
|
|
1851
1860
|
const e = St([]);
|
|
1852
1861
|
return {
|
|
1853
1862
|
createInstance: (s, a) => {
|
|
@@ -1855,11 +1864,11 @@ const nt = (e, r) => {
|
|
|
1855
1864
|
o.initMap(s, a);
|
|
1856
1865
|
const u = o.getInstall(), y = wo(u), t = xo();
|
|
1857
1866
|
t.setProps(a), y.setShowLayerType(a.layerType), y.setGreenTileVisible(a.showGreenLayer);
|
|
1858
|
-
const n = so(u), m = lo(u, n), v = mo(u),
|
|
1867
|
+
const n = so(u), m = lo(u, n), v = mo(u), N = bo(u), M = Mo(u, t), h = Co(u, t), w = Eo(u);
|
|
1859
1868
|
To(o, t, n, v, w, M);
|
|
1860
|
-
const
|
|
1861
|
-
const b = u.getView().calculateExtent(o.getSize()),
|
|
1862
|
-
return [
|
|
1869
|
+
const L = () => {
|
|
1870
|
+
const b = u.getView().calculateExtent(o.getSize()), B = ke([b[0], b[1]], K.mercator, K.data), G = ke([b[2], b[3]], K.mercator, K.data);
|
|
1871
|
+
return [B[0], B[1], G[0], G[1]];
|
|
1863
1872
|
}, C = {
|
|
1864
1873
|
id: Symbol("map-instance"),
|
|
1865
1874
|
innerMap: null,
|
|
@@ -1878,12 +1887,12 @@ const nt = (e, r) => {
|
|
|
1878
1887
|
clear: w.clear,
|
|
1879
1888
|
selected: w.selected
|
|
1880
1889
|
},
|
|
1881
|
-
position:
|
|
1890
|
+
position: N,
|
|
1882
1891
|
drawLine: M,
|
|
1883
1892
|
drawPolygon: h,
|
|
1884
1893
|
// 子模块
|
|
1885
1894
|
utils: {
|
|
1886
|
-
getCalculateExtent:
|
|
1895
|
+
getCalculateExtent: L,
|
|
1887
1896
|
convertSixHundredThousandToLatLng: je,
|
|
1888
1897
|
calculateCirclePoints: to
|
|
1889
1898
|
}
|
|
@@ -1900,7 +1909,7 @@ const nt = (e, r) => {
|
|
|
1900
1909
|
},
|
|
1901
1910
|
getAllInstances: () => [...e]
|
|
1902
1911
|
};
|
|
1903
|
-
},
|
|
1912
|
+
}, Po = { class: "zh-map-box" }, So = /* @__PURE__ */ Ye({
|
|
1904
1913
|
__name: "Map",
|
|
1905
1914
|
props: {
|
|
1906
1915
|
zoom: { default: te.default },
|
|
@@ -1920,7 +1929,7 @@ const nt = (e, r) => {
|
|
|
1920
1929
|
} }
|
|
1921
1930
|
},
|
|
1922
1931
|
setup(e, { expose: r }) {
|
|
1923
|
-
const l = I(), s = I(), a =
|
|
1932
|
+
const l = I(), s = I(), a = Fo(), o = I(), u = e, y = I({
|
|
1924
1933
|
getInstall() {
|
|
1925
1934
|
}
|
|
1926
1935
|
});
|
|
@@ -2134,18 +2143,18 @@ const nt = (e, r) => {
|
|
|
2134
2143
|
return (m = o.value) == null ? void 0 : m.methods.utils.calculateCirclePoints(t, n);
|
|
2135
2144
|
}
|
|
2136
2145
|
}
|
|
2137
|
-
}), (t, n) => (Be(), qe("div",
|
|
2138
|
-
|
|
2146
|
+
}), (t, n) => (Be(), qe("div", Po, [
|
|
2147
|
+
Ge("div", {
|
|
2139
2148
|
id: "map",
|
|
2140
2149
|
ref_key: "zhMapRef",
|
|
2141
2150
|
ref: l,
|
|
2142
2151
|
class: "zh-map"
|
|
2143
2152
|
}, null, 512),
|
|
2144
|
-
|
|
2153
|
+
Ae(Jt, {
|
|
2145
2154
|
ref_key: "scaleLineRef",
|
|
2146
2155
|
ref: s
|
|
2147
2156
|
}, null, 512),
|
|
2148
|
-
|
|
2157
|
+
Ae(Ut, {
|
|
2149
2158
|
ref: "zoomControlRef",
|
|
2150
2159
|
"map-instance": o.value
|
|
2151
2160
|
}, null, 8, ["map-instance"])
|