zhihao-ui 1.3.34 → 1.3.36
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-_N_QIApR.js → Map-bFoPIK8W.js} +193 -196
- package/dist/es/index.js +1 -1
- package/dist/types/components/Map/utils/util.d.ts +42 -0
- package/dist/umd/index.umd.cjs +23 -23
- package/package.json +1 -1
- package/dist/types/components/Map/function/label.d.ts +0 -9
- package/dist/types/components/Map/function/location.d.ts +0 -7
- package/dist/types/components/Map/function/ship.d.ts +0 -34
- package/dist/types/components/Map/function/shipLabel.d.ts +0 -25
- package/dist/types/components/Map/interface/loaction.d.ts +0 -7
|
@@ -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 he, 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,11 +39,11 @@ const jt = { id: "scale-line-container" }, Qt = /* @__PURE__ */ Ye({
|
|
|
39
39
|
t && i(t - 1);
|
|
40
40
|
};
|
|
41
41
|
return (i, 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
|
}, " - ")
|
|
@@ -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({
|
|
@@ -273,24 +273,24 @@ const so = (e) => {
|
|
|
273
273
|
positioning: "top-left",
|
|
274
274
|
className: "track-label-popup"
|
|
275
275
|
});
|
|
276
|
-
let t, n, m, v, N, M = !1, y = Date.now(), w, L = 0, C = null,
|
|
277
|
-
const
|
|
276
|
+
let t, n, m, v, N, M = !1, y = Date.now(), w, L = 0, C = null, b = 20;
|
|
277
|
+
const B = 8, G = [], q = (c) => {
|
|
278
278
|
var d;
|
|
279
|
-
for (
|
|
280
|
-
const f =
|
|
279
|
+
for (G.unshift(c); 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 c =
|
|
288
|
+
const c = Gt(S(s, l[s]));
|
|
289
289
|
re(s, c);
|
|
290
290
|
}
|
|
291
291
|
}, 300), S = (c, d) => {
|
|
292
292
|
let f = [];
|
|
293
|
-
const p = Math.max(1, Math.floor(d.length /
|
|
293
|
+
const p = Math.max(1, Math.floor(d.length / b));
|
|
294
294
|
return f = d.filter((T, O) => O % p === 0).map((T, O) => {
|
|
295
295
|
if (Number(T.lon) > 180 || Number(T.lat) > 180) {
|
|
296
296
|
const [$, A] = je(T.lon, T.lat);
|
|
@@ -301,10 +301,10 @@ const so = (e) => {
|
|
|
301
301
|
}, a = async (c, d, f, p = "ship", E = 200) => {
|
|
302
302
|
if (!e || JSON.stringify(l[c]) === JSON.stringify(d) && s === c || (d = d == null ? void 0 : d.reverse(), h && p === "ship" && (e != null && e.getOverlays().getArray().includes(h) || e.addOverlay(h)), (d == null ? void 0 : d.length) < 2))
|
|
303
303
|
return;
|
|
304
|
-
q(c), s = c, l[c] = d,
|
|
304
|
+
q(c), s = c, l[c] = d, b = E;
|
|
305
305
|
const T = Object.keys(l).findIndex((O) => O === c) || 0;
|
|
306
|
-
|
|
307
|
-
},
|
|
306
|
+
Y = f || R[T > 10 ? 10 : T], await k(), await Je(s);
|
|
307
|
+
}, x = (c) => {
|
|
308
308
|
const d = new de();
|
|
309
309
|
return new he({
|
|
310
310
|
source: d,
|
|
@@ -323,11 +323,11 @@ const so = (e) => {
|
|
|
323
323
|
}, k = async () => {
|
|
324
324
|
const c = s;
|
|
325
325
|
if (!r.has(c)) {
|
|
326
|
-
const T =
|
|
326
|
+
const T = x(c);
|
|
327
327
|
r.set(c, T);
|
|
328
328
|
}
|
|
329
329
|
await g(c);
|
|
330
|
-
const d =
|
|
330
|
+
const d = Y || "", f = l[c] || [];
|
|
331
331
|
if (!(f && f.length > 1)) return [];
|
|
332
332
|
let p = [];
|
|
333
333
|
p = S(c, f);
|
|
@@ -347,15 +347,15 @@ const so = (e) => {
|
|
|
347
347
|
color: c,
|
|
348
348
|
width: 2
|
|
349
349
|
})
|
|
350
|
-
}),
|
|
350
|
+
}), D = (c, d, f) => {
|
|
351
351
|
const p = c == null ? void 0 : c.get("trackId");
|
|
352
352
|
if (c && p && d === "hover") {
|
|
353
353
|
e.getTargetElement().style.cursor = p ? "pointer" : "";
|
|
354
|
-
const E = c.get("data"), T =
|
|
354
|
+
const E = c.get("data"), T = j(E), O = f == null ? void 0 : f.coordinate;
|
|
355
355
|
O && (u.querySelector(".popup-content"), u.innerHTML = T, h == null || h.setPosition(O));
|
|
356
356
|
} else
|
|
357
357
|
h && h.setPosition(void 0);
|
|
358
|
-
},
|
|
358
|
+
}, j = (c) => {
|
|
359
359
|
if (!(c != null && c.time)) return;
|
|
360
360
|
let d = "";
|
|
361
361
|
return c != null && c.stayTime && (d = `
|
|
@@ -419,8 +419,8 @@ const so = (e) => {
|
|
|
419
419
|
const A = E[$];
|
|
420
420
|
if (T.push(A), $ < E.length - 1) {
|
|
421
421
|
const H = E[$ + 1], _ = H.distance - A.distance, P = Math.floor(_ / 100);
|
|
422
|
-
for (let
|
|
423
|
-
const J = A.distance +
|
|
422
|
+
for (let W = 1; W <= P; W++) {
|
|
423
|
+
const J = A.distance + W * 100;
|
|
424
424
|
if (J >= H.distance) break;
|
|
425
425
|
const U = ae(
|
|
426
426
|
f,
|
|
@@ -464,8 +464,8 @@ const so = (e) => {
|
|
|
464
464
|
const re = async (c, d) => {
|
|
465
465
|
await be(), await pe(c);
|
|
466
466
|
const f = z(d), p = f.map((T) => se(T));
|
|
467
|
-
r.get(c).getSource().addFeatures(p), ht(c, f, d,
|
|
468
|
-
const O = Re(c,
|
|
467
|
+
r.get(c).getSource().addFeatures(p), ht(c, f, d, Y), f.forEach((T) => {
|
|
468
|
+
const O = Re(c, Y, T);
|
|
469
469
|
e.addOverlay(O);
|
|
470
470
|
});
|
|
471
471
|
}, se = (c) => {
|
|
@@ -475,7 +475,7 @@ const so = (e) => {
|
|
|
475
475
|
});
|
|
476
476
|
d.set("type", "track_point"), d.set("trackId", c.id), d.set("data", c);
|
|
477
477
|
let f = [
|
|
478
|
-
...ft(c,
|
|
478
|
+
...ft(c, Y)
|
|
479
479
|
];
|
|
480
480
|
return (c.index === 0 || c.index === l[c.id].length - 1) && (f = [...yt(c)], d.set("type", "track_begin")), c.state !== void 0 && c.state !== null && (f = [...vt(c)], d.set("type", "track_icon")), d.setStyle(f), d;
|
|
481
481
|
}, Re = (c, d, f) => {
|
|
@@ -523,7 +523,7 @@ 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
|
})
|
|
@@ -535,7 +535,7 @@ const so = (e) => {
|
|
|
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(c.state) === 0 ? d : Number(c.state) === 1 ? f : ""
|
|
540
540
|
})
|
|
541
541
|
}),
|
|
@@ -552,22 +552,22 @@ const so = (e) => {
|
|
|
552
552
|
if (P % 2 === 0)
|
|
553
553
|
H = f[P].centerPoint;
|
|
554
554
|
else {
|
|
555
|
-
const
|
|
556
|
-
if (
|
|
557
|
-
const [U, Ce] =
|
|
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
|
}
|
|
561
561
|
if (H) {
|
|
562
|
-
const
|
|
562
|
+
const W = new ie({
|
|
563
563
|
geometry: new le(H)
|
|
564
564
|
});
|
|
565
|
-
|
|
565
|
+
W.set("type", "track_arrow"), W.setStyle(
|
|
566
566
|
new X({
|
|
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
573
|
d[A].center,
|
|
@@ -575,7 +575,7 @@ const so = (e) => {
|
|
|
575
575
|
) * (Math.PI / 180)
|
|
576
576
|
})
|
|
577
577
|
})
|
|
578
|
-
), O.push(
|
|
578
|
+
), O.push(W);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
const $ = r.get(c).getSource();
|
|
@@ -587,7 +587,7 @@ const so = (e) => {
|
|
|
587
587
|
const E = (O = p == null ? void 0 : p.getGeometry()) == null ? void 0 : O.getExtent();
|
|
588
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($);
|
|
@@ -598,7 +598,7 @@ const so = (e) => {
|
|
|
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
|
})];
|
|
@@ -635,12 +635,12 @@ const so = (e) => {
|
|
|
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 = (c, d) => {
|
|
643
|
-
var P,
|
|
643
|
+
var P, W;
|
|
644
644
|
const f = Number(50 * d), p = ((P = c.frameState) == null ? void 0 : P.time) ?? Date.now(), E = p - y;
|
|
645
645
|
if (L = (L + f * E / 1e6) % 2, y = p, L >= 1) {
|
|
646
646
|
Me();
|
|
@@ -656,7 +656,7 @@ const so = (e) => {
|
|
|
656
656
|
ot(O, "array"),
|
|
657
657
|
ot($, "array")
|
|
658
658
|
) * Math.PI / 180;
|
|
659
|
-
(
|
|
659
|
+
(W = Ze.getText()) == null || W.setRotation(H), v.setCoordinates(T);
|
|
660
660
|
const _ = At(c);
|
|
661
661
|
_.setStyle(Ze), _.drawGeometry(v), e == null || e.render();
|
|
662
662
|
}, Mt = () => {
|
|
@@ -694,10 +694,10 @@ const so = (e) => {
|
|
|
694
694
|
return P % 360 * Math.PI / 180;
|
|
695
695
|
}
|
|
696
696
|
function T(P) {
|
|
697
|
-
var
|
|
697
|
+
var W;
|
|
698
698
|
if (!P) throw new Error("Coordinate is required");
|
|
699
699
|
if (!Array.isArray(P)) {
|
|
700
|
-
if ((P == null ? void 0 : P.type) === "Feature" && (P == null ? void 0 : P.geometry) !== null && ((
|
|
700
|
+
if ((P == null ? void 0 : P.type) === "Feature" && (P == null ? void 0 : P.geometry) !== null && ((W = P == null ? void 0 : P.geometry) == null ? void 0 : W.type) === "Point")
|
|
701
701
|
return P == null ? void 0 : P.geometry.coordinates;
|
|
702
702
|
if (P.type === "Point") return (P == null ? void 0 : P.coordinates) || [];
|
|
703
703
|
}
|
|
@@ -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,
|
|
710
|
+
function O(P, W, J = {}) {
|
|
711
711
|
if (J.final)
|
|
712
712
|
return function(Tt, Ft) {
|
|
713
713
|
return (O(Ft, Tt) + 180) % 360;
|
|
714
|
-
}(P,
|
|
715
|
-
const U = T(P), Ce = T(
|
|
714
|
+
}(P, W);
|
|
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 A(P,
|
|
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 },
|
|
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,
|
|
724
|
+
function H(P, W = {}, J = {}) {
|
|
725
725
|
const U = {
|
|
726
726
|
type: "Feature",
|
|
727
727
|
id: "",
|
|
@@ -729,7 +729,7 @@ const so = (e) => {
|
|
|
729
729
|
bbox: {},
|
|
730
730
|
geometry: {}
|
|
731
731
|
};
|
|
732
|
-
return J.id !== void 0 && (U.id = J.id), J.bbox && (U.bbox = J.bbox), U.properties =
|
|
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
734
|
const _ = O(A(c), A(d), f);
|
|
735
735
|
return _ < 0 ? 360 + _ : _;
|
|
@@ -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
|
};
|
|
@@ -992,34 +992,34 @@ function yo(e, r, l = "left-bottom", s = 2) {
|
|
|
992
992
|
o.font = m;
|
|
993
993
|
const M = o.measureText(e).width;
|
|
994
994
|
o.font = v;
|
|
995
|
-
const y = r.map((k) => ({ width: o.measureText(fe(k)).width, height: 14 })), w = y.reduce((k, F) => k + F.width, 0), L = (r.length - 1) * s, C = h + M + w + L + h,
|
|
996
|
-
let
|
|
997
|
-
switch (
|
|
995
|
+
const y = r.map((k) => ({ width: o.measureText(fe(k)).width, height: 14 })), w = y.reduce((k, F) => k + F.width, 0), L = (r.length - 1) * s, C = h + M + w + L + h, b = u + 14 + u;
|
|
996
|
+
let B, G, q = 0, Y = 0, R = 0, Z = 0, S = 0, a = 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, a = 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, a = 0;
|
|
1003
1003
|
break;
|
|
1004
1004
|
case "right-bottom":
|
|
1005
|
-
|
|
1005
|
+
G = t + b, q = 0, Y = 0, R = t, Z = t, S = t, a = 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, a = 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, a = 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, a = t;
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
|
-
|
|
1018
|
-
const
|
|
1019
|
-
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, S + h,
|
|
1017
|
+
G = G + u, i.width = Math.round(B * n), i.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, a, C, b), o.font = m, o.textBaseline = "middle";
|
|
1018
|
+
const x = a + u + b / 2;
|
|
1019
|
+
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, S + h, x), o.fillStyle = "#000000", o.fillText(e, S + h, x), o.font = v, o.fillStyle = "#3370ff";
|
|
1020
1020
|
let g = S + h + M + s;
|
|
1021
1021
|
return r.length > 0 && r.forEach((k, F) => {
|
|
1022
|
-
const V = a + u +
|
|
1022
|
+
const V = a + u + b / 2;
|
|
1023
1023
|
o.fillText(fe(k), g, V), g += y[F].width + s;
|
|
1024
1024
|
}), i.toDataURL("image/png");
|
|
1025
1025
|
}
|
|
@@ -1077,21 +1077,21 @@ const nt = (e, r) => {
|
|
|
1077
1077
|
let h = null, t = "", n = {}, m = {};
|
|
1078
1078
|
const v = (a) => {
|
|
1079
1079
|
if (!a || !e) return;
|
|
1080
|
-
const
|
|
1080
|
+
const x = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id"));
|
|
1081
1081
|
if (l) {
|
|
1082
|
-
const g = a.filter((k) => k.id ===
|
|
1082
|
+
const g = a.filter((k) => k.id === x);
|
|
1083
1083
|
g.length === 0 ? a.push(l) : l = g[0];
|
|
1084
1084
|
}
|
|
1085
1085
|
L(), C(!0), S(a), M();
|
|
1086
1086
|
}, N = (a) => {
|
|
1087
1087
|
var z;
|
|
1088
|
-
const
|
|
1088
|
+
const x = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id")), g = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), k = ((z = m[a.id]) == null ? void 0 : z.blinkColors) || [], V = k[k.length - 1] || a.fill || "#04C900", D = ao(a), j = new ie({
|
|
1089
1089
|
geometry: new le(g),
|
|
1090
1090
|
// 船舶数据
|
|
1091
1091
|
shipData: a,
|
|
1092
1092
|
id: a.id,
|
|
1093
1093
|
name: a.cnname || a.enname || a.name || a.id || "未命名船舶",
|
|
1094
|
-
selected: a.id ===
|
|
1094
|
+
selected: a.id === x,
|
|
1095
1095
|
// 图标
|
|
1096
1096
|
rightIcons: rt(a),
|
|
1097
1097
|
// 是否闪烁
|
|
@@ -1101,125 +1101,125 @@ 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
|
});
|
|
1108
|
-
return
|
|
1108
|
+
return j.set("clickGeometry", new Yt(g)), j;
|
|
1109
1109
|
}, M = async () => {
|
|
1110
1110
|
if (!l || !e) return;
|
|
1111
|
-
let
|
|
1112
|
-
if (
|
|
1111
|
+
let x = e.getOverlays().getArray().find((g) => g.get("class") == "ship-overlay-selected");
|
|
1112
|
+
if (x) {
|
|
1113
1113
|
const g = dt(e, l);
|
|
1114
|
-
await
|
|
1114
|
+
await x.setElement(g), await x.setPosition(ee([l.lon, l.lat]));
|
|
1115
1115
|
} else
|
|
1116
|
-
|
|
1116
|
+
x = go(e, l), x && e.addOverlay(x);
|
|
1117
1117
|
setTimeout(() => {
|
|
1118
1118
|
var g;
|
|
1119
|
-
|
|
1119
|
+
x && ((g = x.get("element")) != null && g.parentElement) && (x.get("element").parentElement.style.display = "block");
|
|
1120
1120
|
}, 20);
|
|
1121
1121
|
}, y = (a) => {
|
|
1122
1122
|
if (a === "start") {
|
|
1123
|
-
const
|
|
1123
|
+
const x = () => {
|
|
1124
1124
|
s.getFeatures().forEach((g) => {
|
|
1125
1125
|
g.setStyle(ye(e, g));
|
|
1126
|
-
}), h = requestAnimationFrame(
|
|
1126
|
+
}), h = requestAnimationFrame(x);
|
|
1127
1127
|
};
|
|
1128
|
-
|
|
1128
|
+
x();
|
|
1129
1129
|
}
|
|
1130
1130
|
a === "end" && h && (cancelAnimationFrame(h), h = null);
|
|
1131
1131
|
}, w = () => {
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1134
|
-
const g =
|
|
1132
|
+
const x = (e == null ? void 0 : e.getOverlays().getArray()).find((g) => g.get("class") == "ship-overlay-selected");
|
|
1133
|
+
if (x) {
|
|
1134
|
+
const g = x.getElement(), k = Qe(e, l, "ship"), F = g.querySelector("svg");
|
|
1135
1135
|
console.log(F), F && (F.style.transform = `scale(${k})`);
|
|
1136
1136
|
}
|
|
1137
1137
|
}, L = () => {
|
|
1138
1138
|
e && s && (s.clear(), o.clear(), C(), y("end"));
|
|
1139
1139
|
}, C = (a) => {
|
|
1140
|
-
const
|
|
1141
|
-
if (
|
|
1142
|
-
for (let g = 0; g <
|
|
1143
|
-
if (!a &&
|
|
1144
|
-
const k =
|
|
1140
|
+
const x = e.getOverlays().getArray().filter((g) => g.get("class") == "zh-map-ship-overlay");
|
|
1141
|
+
if (x && x.length > 0) {
|
|
1142
|
+
for (let g = 0; g < x.length; g++)
|
|
1143
|
+
if (!a && x[g].get("class") !== "ship-overlay-selected") {
|
|
1144
|
+
const k = x[g];
|
|
1145
1145
|
k.setPosition(void 0), e.removeOverlay(k), k.dispose();
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
|
-
},
|
|
1149
|
-
n = a, m =
|
|
1148
|
+
}, b = (a, x) => {
|
|
1149
|
+
n = a, m = x;
|
|
1150
1150
|
const g = e.getOverlays().getArray(), k = s.getFeatures();
|
|
1151
1151
|
for (const F in n) {
|
|
1152
|
-
const V = n[F],
|
|
1153
|
-
if (
|
|
1154
|
-
const z =
|
|
1155
|
-
|
|
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(ye(e, j)));
|
|
1156
1156
|
const Re = {
|
|
1157
1157
|
...ae,
|
|
1158
1158
|
blinking: V,
|
|
1159
1159
|
blinkingColors: z || [],
|
|
1160
|
-
name: re + "(" +
|
|
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 = (a) => {
|
|
1166
1166
|
if (!e) return;
|
|
1167
|
-
const
|
|
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
|
a.forEach((z) => {
|
|
1169
|
-
|
|
1169
|
+
D.set(z.id, !0);
|
|
1170
1170
|
});
|
|
1171
|
-
const
|
|
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
1178
|
(se == null ? void 0 : se.length) == 0 && z.setStyle(ye(e, z));
|
|
1179
1179
|
}
|
|
1180
|
-
const re =
|
|
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 = (a) => {
|
|
1192
1192
|
if (a) {
|
|
1193
1193
|
console.log("选中", a);
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1194
|
+
const x = s.getFeatures().find((k) => k.get("id") === a.id), g = o.getFeatures().find((k) => k.get("id") === a.id);
|
|
1195
|
+
x && (r = x), g && g.set("selected", !0), l = a, M();
|
|
1196
1196
|
} else
|
|
1197
1197
|
console.log("取消选中"), l = null, r = null, R();
|
|
1198
|
-
}, q = Ne((a,
|
|
1198
|
+
}, q = Ne((a, x, g) => {
|
|
1199
1199
|
try {
|
|
1200
1200
|
if (a) {
|
|
1201
1201
|
const k = a.get("shipData"), F = a.get("id");
|
|
1202
|
-
if (e.getTargetElement().style.cursor = F ? "pointer" : "",
|
|
1203
|
-
t && t !== F &&
|
|
1204
|
-
const V = s.getFeatures().find((
|
|
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
1205
|
V == null || V.set("isHighlight", !0), V == null || V.setStyle(ye(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),
|
|
1213
|
-
const a = t ? s.getFeatures().find((
|
|
1212
|
+
}, 10), Y = () => {
|
|
1213
|
+
const a = t ? s.getFeatures().find((x) => x.get("id") === t) : null;
|
|
1214
1214
|
t = null, a == null || a.set("isHighlight", !1), a == null || a.setStyle(ye(e, a));
|
|
1215
1215
|
}, R = () => {
|
|
1216
1216
|
try {
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1217
|
+
const x = e.getOverlays().getArray().find((g) => g.get("class") == "ship-overlay-selected");
|
|
1218
|
+
x && x.setPosition(void 0);
|
|
1219
1219
|
} catch (a) {
|
|
1220
1220
|
console.log(a);
|
|
1221
1221
|
}
|
|
1222
|
-
}, Z = (a,
|
|
1222
|
+
}, Z = (a, x) => {
|
|
1223
1223
|
const g = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), k = new ie({
|
|
1224
1224
|
geometry: new le(g),
|
|
1225
1225
|
name: a.cnname || a.enname || a.name || a.id || "未命名船舶",
|
|
@@ -1229,18 +1229,18 @@ const nt = (e, r) => {
|
|
|
1229
1229
|
shipData: a
|
|
1230
1230
|
});
|
|
1231
1231
|
k.set("id", a.id);
|
|
1232
|
-
const F = nt(k,
|
|
1232
|
+
const F = nt(k, x);
|
|
1233
1233
|
return k.setStyle(F), k;
|
|
1234
1234
|
}, S = (a) => {
|
|
1235
|
-
const
|
|
1235
|
+
const x = e.getView().getZoom();
|
|
1236
1236
|
a.forEach((g) => {
|
|
1237
1237
|
const k = N(g);
|
|
1238
|
-
if (k.setStyle(ye(e, k)), s.addFeature(k), (l == null ? void 0 : l.id) == g.id ||
|
|
1238
|
+
if (k.setStyle(ye(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 F = m[g == null ? void 0 : g.id] || {}, V = (F == null ? void 0 : F.blinkColors) || [],
|
|
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
|
-
name:
|
|
1243
|
+
name: j,
|
|
1244
1244
|
blinking: n[g.id],
|
|
1245
1245
|
blinkingColors: V || []
|
|
1246
1246
|
};
|
|
@@ -1254,9 +1254,9 @@ const nt = (e, r) => {
|
|
|
1254
1254
|
};
|
|
1255
1255
|
return {
|
|
1256
1256
|
render: v,
|
|
1257
|
-
selected:
|
|
1258
|
-
filter:
|
|
1259
|
-
blinking:
|
|
1257
|
+
selected: G,
|
|
1258
|
+
filter: B,
|
|
1259
|
+
blinking: b,
|
|
1260
1260
|
clear: L,
|
|
1261
1261
|
handleShipMapEvent: q,
|
|
1262
1262
|
changeShipScale: y,
|
|
@@ -1322,10 +1322,10 @@ const nt = (e, r) => {
|
|
|
1322
1322
|
}), e == null || e.addLayer(l));
|
|
1323
1323
|
}
|
|
1324
1324
|
}, h = (y) => {
|
|
1325
|
-
const w = e == null ? void 0 : e.getView().getZoom(), [L, C] = y.latLon.split(","),
|
|
1325
|
+
const w = e == null ? void 0 : e.getView().getZoom(), [L, C] = y.latLon.split(","), b = new ie({
|
|
1326
1326
|
geometry: new le(ee([Number(L), Number(C)]))
|
|
1327
1327
|
});
|
|
1328
|
-
|
|
1328
|
+
b.setStyle(t(y, w, y.id === (o == null ? void 0 : o.id))), b.set("loactionData", y), s.addFeature(b);
|
|
1329
1329
|
}, t = (y, w, L) => {
|
|
1330
1330
|
const C = {
|
|
1331
1331
|
image: new Oe({
|
|
@@ -1336,10 +1336,10 @@ const nt = (e, r) => {
|
|
|
1336
1336
|
return y.name && (C.text = new ge({
|
|
1337
1337
|
text: y.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
|
|
@@ -1355,8 +1355,8 @@ const nt = (e, r) => {
|
|
|
1355
1355
|
}, m = () => {
|
|
1356
1356
|
var C;
|
|
1357
1357
|
const y = i.get("loactionData"), w = (C = e == null ? void 0 : e.getView()) == null ? void 0 : C.getZoom();
|
|
1358
|
-
s.getFeatures().forEach((
|
|
1359
|
-
|
|
1358
|
+
s.getFeatures().forEach((b) => {
|
|
1359
|
+
b.get("loactionData").id === y.id && (b == null || b.setStyle(t(y, w, !1)));
|
|
1360
1360
|
}), o = null, i = null;
|
|
1361
1361
|
}, v = (y) => {
|
|
1362
1362
|
y ? (N(), M(y)) : clearSelectedPort();
|
|
@@ -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,25 +1437,25 @@ 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: (a) => a.originalEvent.target.tagName !== "DIV"
|
|
1447
|
-
}), e == null || e.addInteraction(y),
|
|
1447
|
+
}), e == null || e.addInteraction(y), B(), G();
|
|
1448
1448
|
let S;
|
|
1449
1449
|
y.on("drawstart", function(a) {
|
|
1450
1450
|
var g;
|
|
1451
1451
|
v = a.feature, v.set("randomId", L());
|
|
1452
|
-
let
|
|
1452
|
+
let x;
|
|
1453
1453
|
S = (g = v.getGeometry()) == null ? void 0 : g.on("change", function(k) {
|
|
1454
1454
|
const F = k.target, V = gt(F, s.value);
|
|
1455
|
-
|
|
1455
|
+
x = F.getLastCoordinate(), C && V && (C.innerHTML = V), b.setPosition(x);
|
|
1456
1456
|
});
|
|
1457
1457
|
}), y.on("drawend", function() {
|
|
1458
|
-
var a,
|
|
1458
|
+
var a, x, g;
|
|
1459
1459
|
if (C && (C.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), C != null && C.innerHTML) {
|
|
1460
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>`;
|
|
@@ -1464,20 +1464,20 @@ const nt = (e, r) => {
|
|
|
1464
1464
|
var V;
|
|
1465
1465
|
k.preventDefault(), k.stopPropagation();
|
|
1466
1466
|
const F = (V = k.target) == null ? void 0 : V.getAttribute("data-id");
|
|
1467
|
-
F &&
|
|
1468
|
-
}),
|
|
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
|
-
let C,
|
|
1472
|
-
const
|
|
1473
|
-
C != null && C.parentNode && C.parentNode.removeChild(C), C = document.createElement("div"), C.className = "ol-tooltip ol-tooltip-measure",
|
|
1471
|
+
let C, b;
|
|
1472
|
+
const B = () => {
|
|
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],
|
|
1476
1476
|
positioning: "bottom-center",
|
|
1477
1477
|
stopEvent: !1,
|
|
1478
1478
|
insertFirst: !1
|
|
1479
|
-
}), e == null || e.addOverlay(
|
|
1480
|
-
},
|
|
1479
|
+
}), e == null || e.addOverlay(b);
|
|
1480
|
+
}, G = () => {
|
|
1481
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],
|
|
@@ -1486,20 +1486,20 @@ const nt = (e, r) => {
|
|
|
1486
1486
|
}, q = () => {
|
|
1487
1487
|
l.value.forEach((S, a) => {
|
|
1488
1488
|
var k, F;
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1489
|
+
const x = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1490
|
+
x[a] && ((F = (k = x[a]) == null ? void 0 : k.parentNode) == null || F.removeChild(x[a]));
|
|
1491
1491
|
const g = t.getFeatures();
|
|
1492
1492
|
g[a] && t.removeFeature(g[a]);
|
|
1493
1493
|
}), R(), po(e), u.value = !1, ze(e, "pointer");
|
|
1494
|
-
},
|
|
1495
|
-
var
|
|
1494
|
+
}, Y = (S) => {
|
|
1495
|
+
var x, g, k, F;
|
|
1496
1496
|
const a = l.value.findIndex((V) => V.id === S);
|
|
1497
1497
|
if (a !== -1) {
|
|
1498
1498
|
l.value.splice(a, 1);
|
|
1499
1499
|
const V = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1500
|
-
V[a] && ((g = (
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1500
|
+
V[a] && ((g = (x = V[a]) == null ? void 0 : x.parentNode) == null || g.removeChild(V[a]));
|
|
1501
|
+
const D = t.getFeatures();
|
|
1502
|
+
D[a] && t.removeFeature(D[a]);
|
|
1503
1503
|
}
|
|
1504
1504
|
(F = (k = r.getProps()) == null ? void 0 : k.lineDrawEnd) == null || F.call(k, l.value);
|
|
1505
1505
|
}, R = () => {
|
|
@@ -1515,7 +1515,7 @@ const nt = (e, r) => {
|
|
|
1515
1515
|
return {
|
|
1516
1516
|
open: h,
|
|
1517
1517
|
close: q,
|
|
1518
|
-
deleteLine:
|
|
1518
|
+
deleteLine: Y,
|
|
1519
1519
|
setUnit: i,
|
|
1520
1520
|
getState: () => u.value
|
|
1521
1521
|
};
|
|
@@ -1539,7 +1539,7 @@ const nt = (e, r) => {
|
|
|
1539
1539
|
const i = () => {
|
|
1540
1540
|
o(), ze(e, "crosshair");
|
|
1541
1541
|
}, o = () => {
|
|
1542
|
-
t(), C(),
|
|
1542
|
+
t(), C(), G(), M();
|
|
1543
1543
|
};
|
|
1544
1544
|
let u = null, h = null;
|
|
1545
1545
|
const t = () => {
|
|
@@ -1561,12 +1561,12 @@ const nt = (e, r) => {
|
|
|
1561
1561
|
const m = (R) => {
|
|
1562
1562
|
if (R.dragging) return;
|
|
1563
1563
|
const Z = n ? "单击继续,双击结束" : "点击选择起点";
|
|
1564
|
-
|
|
1564
|
+
b && (b.innerHTML = Z, B.setPosition(R.coordinate));
|
|
1565
1565
|
};
|
|
1566
1566
|
let v, N = !1;
|
|
1567
1567
|
const M = () => {
|
|
1568
1568
|
if (l) {
|
|
1569
|
-
|
|
1569
|
+
b != null && b.parentNode && b.parentNode.removeChild(b);
|
|
1570
1570
|
const R = l.getGeometry();
|
|
1571
1571
|
if (!R) return;
|
|
1572
1572
|
const Z = y(R, "nm");
|
|
@@ -1585,8 +1585,8 @@ const nt = (e, r) => {
|
|
|
1585
1585
|
console.log("delete"), q(), (F = (k = r.getProps()) == null ? void 0 : k.areaDrawEnd) == null || F.call(k, []);
|
|
1586
1586
|
});
|
|
1587
1587
|
}, 0);
|
|
1588
|
-
const
|
|
1589
|
-
e == null || e.getView().setCenter(
|
|
1588
|
+
const x = qt(l.getGeometry().getExtent());
|
|
1589
|
+
e == null || e.getView().setCenter(x);
|
|
1590
1590
|
return;
|
|
1591
1591
|
}
|
|
1592
1592
|
v = new Se({
|
|
@@ -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
|
}),
|
|
@@ -1617,21 +1617,21 @@ const nt = (e, r) => {
|
|
|
1617
1617
|
}), e == null || e.addInteraction(v), v.on("drawstart", (R) => {
|
|
1618
1618
|
var Z;
|
|
1619
1619
|
n = R.feature, s = (Z = n.getGeometry()) == null ? void 0 : Z.on("change", (S) => {
|
|
1620
|
-
const a = S.target,
|
|
1621
|
-
if (N = Number(He(F) / 1e3) > 150, !
|
|
1622
|
-
const
|
|
1620
|
+
const a = S.target, x = y(a, "nm"), k = a.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
|
-
面积:${
|
|
1626
|
-
${N ?
|
|
1625
|
+
面积:${x}
|
|
1626
|
+
${N ? D : ""}
|
|
1627
1627
|
</div>
|
|
1628
|
-
`),
|
|
1628
|
+
`), b && (b.innerHTML = `
|
|
1629
1629
|
<div class="text">
|
|
1630
|
-
面积:${
|
|
1630
|
+
面积:${x}
|
|
1631
1631
|
</div>
|
|
1632
1632
|
<div class="text ${N ? "error" : ""}">
|
|
1633
1633
|
线段 ${k.length - 2}: ${V}
|
|
1634
|
-
${N ?
|
|
1634
|
+
${N ? D : ""}
|
|
1635
1635
|
|
|
1636
1636
|
</div>
|
|
1637
1637
|
<div>
|
|
@@ -1640,19 +1640,19 @@ const nt = (e, r) => {
|
|
|
1640
1640
|
`);
|
|
1641
1641
|
});
|
|
1642
1642
|
}), v.on("drawend", (R) => {
|
|
1643
|
-
var
|
|
1643
|
+
var x, g, k, F;
|
|
1644
1644
|
if (!R.feature.getGeometry()) return;
|
|
1645
1645
|
w && !l && (w.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), l = R.feature, L.setOffset([10, 0]);
|
|
1646
1646
|
const S = R.feature.getGeometry().getCoordinates(), a = S[0][S[0].length - 2];
|
|
1647
|
-
if (L.setPosition(a),
|
|
1648
|
-
const V = S[0].map((
|
|
1647
|
+
if (L.setPosition(a), 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
|
-
|
|
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
1653
|
})), s && We(s), (F = document.querySelector(".delete-icon")) == null || F.addEventListener("click", () => {
|
|
1654
|
-
var V,
|
|
1655
|
-
q(), (
|
|
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
|
}, y = (R, Z) => {
|
|
@@ -1674,22 +1674,22 @@ const nt = (e, r) => {
|
|
|
1674
1674
|
insertFirst: !1
|
|
1675
1675
|
}), e == null || e.addOverlay(L);
|
|
1676
1676
|
};
|
|
1677
|
-
let
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1680
|
-
element:
|
|
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
|
+
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
|
-
h == null || h.clear(), l = null, C(),
|
|
1685
|
+
h == null || h.clear(), l = null, C(), G(), M();
|
|
1686
1686
|
};
|
|
1687
1687
|
return {
|
|
1688
1688
|
open: i,
|
|
1689
1689
|
close: () => {
|
|
1690
1690
|
h == null || h.clear(), h = 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),
|
|
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
|
};
|
|
@@ -1711,22 +1711,19 @@ const nt = (e, r) => {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
M.forEach((w) => {
|
|
1713
1713
|
u(w, y);
|
|
1714
|
-
});
|
|
1714
|
+
}), i && (console.log("selectedPortData", i), v(i));
|
|
1715
1715
|
}
|
|
1716
1716
|
}, u = (M, y = !0) => {
|
|
1717
|
-
var W;
|
|
1718
1717
|
const [w, L] = M.latLon.split(","), C = new ie({
|
|
1719
1718
|
geometry: new le(ee([Number(w), Number(L)])),
|
|
1720
1719
|
portData: M,
|
|
1721
1720
|
select: M.id === (i == null ? void 0 : i.id),
|
|
1722
1721
|
showTitle: M.id === (i == null ? void 0 : i.id) || y
|
|
1723
|
-
}),
|
|
1724
|
-
|
|
1725
|
-
color: "#FF5733"
|
|
1726
|
-
}))), C.setStyle(x), r.addFeature(C);
|
|
1722
|
+
}), b = h(C);
|
|
1723
|
+
C.setStyle(b), r.addFeature(C);
|
|
1727
1724
|
}, h = (M) => {
|
|
1728
|
-
const { select: y, showTitle: w } = M.getProperties(), L = (
|
|
1729
|
-
<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: y, 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}"/>
|
|
1730
1727
|
<g clip-path="url(#clip0_10059_122082)">
|
|
1731
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"/>
|
|
1732
1729
|
</g>
|
|
@@ -1736,29 +1733,29 @@ const nt = (e, r) => {
|
|
|
1736
1733
|
</clipPath>
|
|
1737
1734
|
</defs>
|
|
1738
1735
|
</svg>
|
|
1739
|
-
`, C = () => `data:image/svg+xml;utf8,${encodeURIComponent(L(y ? "#FF5733" : "#3370FF"))}`,
|
|
1736
|
+
`, C = () => `data:image/svg+xml;utf8,${encodeURIComponent(L(y ? "#FF5733" : "#3370FF"))}`, b = e.getView().getZoom(), B = M.get("portData"), G = {
|
|
1740
1737
|
image: new Oe({
|
|
1741
1738
|
src: C(),
|
|
1742
|
-
scale: 0.5 *
|
|
1739
|
+
scale: 0.5 * b / 10
|
|
1743
1740
|
}),
|
|
1744
1741
|
zIndex: y ? 110 : 100
|
|
1745
1742
|
}, q = {
|
|
1746
1743
|
text: new ge({
|
|
1747
|
-
text:
|
|
1744
|
+
text: B.shortName,
|
|
1748
1745
|
font: "12px sans-serif",
|
|
1749
|
-
fill: new
|
|
1746
|
+
fill: new Q({
|
|
1750
1747
|
color: y ? "#ffffff" : "#000000"
|
|
1751
1748
|
}),
|
|
1752
|
-
backgroundFill: new
|
|
1749
|
+
backgroundFill: new Q({
|
|
1753
1750
|
color: "#FFF"
|
|
1754
1751
|
}),
|
|
1755
1752
|
offsetY: 30
|
|
1756
1753
|
})
|
|
1757
1754
|
};
|
|
1758
1755
|
return !w && !y ? new X({
|
|
1759
|
-
...
|
|
1756
|
+
...G
|
|
1760
1757
|
}) : new X({
|
|
1761
|
-
...
|
|
1758
|
+
...G,
|
|
1762
1759
|
...q
|
|
1763
1760
|
});
|
|
1764
1761
|
}, t = () => {
|
|
@@ -1793,7 +1790,7 @@ const nt = (e, r) => {
|
|
|
1793
1790
|
if (i = M, s = y.find((L) => L.get("portData").id === M.id), s) {
|
|
1794
1791
|
s.set("select", !0);
|
|
1795
1792
|
const L = h(s);
|
|
1796
|
-
L && ((w = L == null ? void 0 : L.getText()) == null || w.setBackgroundFill(new
|
|
1793
|
+
L && ((w = L == null ? void 0 : L.getText()) == null || w.setBackgroundFill(new Q({
|
|
1797
1794
|
color: "#FF5733"
|
|
1798
1795
|
}))), s.setStyle(L);
|
|
1799
1796
|
}
|
|
@@ -1870,8 +1867,8 @@ const nt = (e, r) => {
|
|
|
1870
1867
|
const n = so(u), m = lo(u, n), v = mo(u), N = bo(u), M = Mo(u, t), y = Co(u, t), w = Eo(u);
|
|
1871
1868
|
To(o, t, n, v, w, M);
|
|
1872
1869
|
const L = () => {
|
|
1873
|
-
const
|
|
1874
|
-
return [
|
|
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]];
|
|
1875
1872
|
}, C = {
|
|
1876
1873
|
id: Symbol("map-instance"),
|
|
1877
1874
|
innerMap: null,
|
|
@@ -2147,7 +2144,7 @@ const nt = (e, r) => {
|
|
|
2147
2144
|
}
|
|
2148
2145
|
}
|
|
2149
2146
|
}), (t, n) => (Be(), qe("div", Po, [
|
|
2150
|
-
|
|
2147
|
+
Ge("div", {
|
|
2151
2148
|
id: "map",
|
|
2152
2149
|
ref_key: "zhMapRef",
|
|
2153
2150
|
ref: l,
|