zhihao-ui 1.3.42-alpha.2 → 1.3.42-alpha.3
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.
|
@@ -76,23 +76,23 @@ function ro() {
|
|
|
76
76
|
var x;
|
|
77
77
|
return (x = s()) == null ? void 0 : x.getZoom();
|
|
78
78
|
}, i = (x) => {
|
|
79
|
-
var
|
|
80
|
-
(
|
|
81
|
-
}, o = (x,
|
|
79
|
+
var E;
|
|
80
|
+
(E = s()) == null || E.setZoom(x);
|
|
81
|
+
}, o = (x, E) => {
|
|
82
82
|
var z;
|
|
83
|
-
(z = s()) == null || z.setCenter(ee([x,
|
|
83
|
+
(z = s()) == null || z.setCenter(ee([x, E]));
|
|
84
84
|
}, f = () => {
|
|
85
|
-
var
|
|
86
|
-
const x = (
|
|
85
|
+
var E;
|
|
86
|
+
const x = (E = s()) == null ? void 0 : E.getCenter();
|
|
87
87
|
return At(x);
|
|
88
88
|
}, v = () => {
|
|
89
89
|
var x;
|
|
90
90
|
return (x = n()) == null ? void 0 : x.getSize();
|
|
91
|
-
}, t = new rt(), r = (x,
|
|
92
|
-
g(
|
|
91
|
+
}, t = new rt(), r = (x, E) => {
|
|
92
|
+
g(E);
|
|
93
93
|
const z = {
|
|
94
|
-
zoom:
|
|
95
|
-
center: ee(
|
|
94
|
+
zoom: E.zoom,
|
|
95
|
+
center: ee(E.center),
|
|
96
96
|
minZoom: re.min,
|
|
97
97
|
maxZoom: re.max,
|
|
98
98
|
constrainResolution: !0,
|
|
@@ -227,10 +227,10 @@ const st = (e) => {
|
|
|
227
227
|
if (!e || (console.log("vehicleInfo", g), !(g != null && g.lon && (g != null && g.lat)))) return;
|
|
228
228
|
const x = Math.abs(Number(g.lon)) > 180 ? Ue(g.lon, g.lat) : [g.lon, g.lat];
|
|
229
229
|
i(g, ee(x));
|
|
230
|
-
const
|
|
231
|
-
|
|
230
|
+
const E = e == null ? void 0 : e.getView(), z = new ce(x);
|
|
231
|
+
E.setCenter(Me(z.getCoordinates(), _.data, _.mercator));
|
|
232
232
|
}, i = (g, x) => {
|
|
233
|
-
const
|
|
233
|
+
const E = `${gt}map/car-icon.gif`;
|
|
234
234
|
s || (s = new de({
|
|
235
235
|
element: document.createElement("div"),
|
|
236
236
|
positioning: "center-center",
|
|
@@ -238,7 +238,7 @@ const st = (e) => {
|
|
|
238
238
|
// 允许交互事件穿透
|
|
239
239
|
}), e.addOverlay(s));
|
|
240
240
|
const z = s.getElement();
|
|
241
|
-
z.style.backgroundImage = `url(${
|
|
241
|
+
z.style.backgroundImage = `url(${E})`, z.style.width = "80px", z.style.height = "80px";
|
|
242
242
|
const M = (g == null ? void 0 : g.drc) || "";
|
|
243
243
|
z.style.transform = `rotate(${M}deg)`, z.style.backgroundSize = "cover", s == null || s.setPosition(x);
|
|
244
244
|
};
|
|
@@ -248,8 +248,8 @@ const st = (e) => {
|
|
|
248
248
|
const g = s == null ? void 0 : s.getElement();
|
|
249
249
|
g && (g.innerHTML = "");
|
|
250
250
|
},
|
|
251
|
-
renderTrack: (g, x,
|
|
252
|
-
n.render(g, x,
|
|
251
|
+
renderTrack: (g, x, E) => {
|
|
252
|
+
n.render(g, x, E, "truck", 1e3);
|
|
253
253
|
},
|
|
254
254
|
setCenter: (g) => {
|
|
255
255
|
n.setCenter(g);
|
|
@@ -273,15 +273,15 @@ const ao = (e) => {
|
|
|
273
273
|
positioning: "top-left",
|
|
274
274
|
className: "track-label-popup"
|
|
275
275
|
});
|
|
276
|
-
let t, r, g, x,
|
|
277
|
-
const L = 8, D = [],
|
|
276
|
+
let t, r, g, x, E, z = !1, M = Date.now(), b, m = 0, k = null, T = 20;
|
|
277
|
+
const L = 8, D = [], W = (c) => {
|
|
278
278
|
var d;
|
|
279
279
|
for (D.unshift(c); D.length > L; ) {
|
|
280
280
|
const h = D.pop(), p = n.get(h);
|
|
281
281
|
p && ((d = p.getSource()) == null || d.clear(), e == null || e.removeLayer(p), n.delete(h), delete s[h]);
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
|
-
let
|
|
284
|
+
let A = "";
|
|
285
285
|
const H = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], j = Re(() => {
|
|
286
286
|
if (l && s[l] && n.get(l).getVisible()) {
|
|
287
287
|
console.log("reRenderTrackLine------------");
|
|
@@ -290,7 +290,7 @@ const ao = (e) => {
|
|
|
290
290
|
}
|
|
291
291
|
}, 300), F = (c, d) => {
|
|
292
292
|
let h = [];
|
|
293
|
-
const p = Math.max(1, Math.floor(d.length /
|
|
293
|
+
const p = Math.max(1, Math.floor(d.length / T));
|
|
294
294
|
return h = d.filter((S, Z) => Z % p === 0).map((S, Z) => {
|
|
295
295
|
if (Number(S.lon) > 180 || Number(S.lat) > 180) {
|
|
296
296
|
const [O, Y] = Ue(S.lon, S.lat);
|
|
@@ -301,9 +301,9 @@ const ao = (e) => {
|
|
|
301
301
|
}, C = async (c, d, h, p = "ship", P = 200) => {
|
|
302
302
|
if (!e || JSON.stringify(s[c]) === JSON.stringify(d) && l === c || (d = d == null ? void 0 : d.reverse(), v && p === "ship" && (e != null && e.getOverlays().getArray().includes(v) || e.addOverlay(v)), (d == null ? void 0 : d.length) < 2))
|
|
303
303
|
return;
|
|
304
|
-
|
|
304
|
+
W(c), l = c, s[c] = d, T = P;
|
|
305
305
|
const S = Object.keys(s).findIndex((Z) => Z === c) || 0;
|
|
306
|
-
|
|
306
|
+
A = h || H[S > 10 ? 10 : S], await y(), await et(l);
|
|
307
307
|
}, $ = (c) => {
|
|
308
308
|
const d = new ge();
|
|
309
309
|
return new ye({
|
|
@@ -327,7 +327,7 @@ const ao = (e) => {
|
|
|
327
327
|
n.set(c, S);
|
|
328
328
|
}
|
|
329
329
|
await a(c);
|
|
330
|
-
const d =
|
|
330
|
+
const d = A || "", h = s[c] || [];
|
|
331
331
|
if (!(h && h.length > 1)) return [];
|
|
332
332
|
let p = [];
|
|
333
333
|
p = F(c, h);
|
|
@@ -352,14 +352,14 @@ const ao = (e) => {
|
|
|
352
352
|
const p = c == null ? void 0 : c.get("data");
|
|
353
353
|
if (console.log("trackId-data", p), c && p && d === "hover") {
|
|
354
354
|
e.getTargetElement().style.cursor = p ? "pointer" : "";
|
|
355
|
-
const P =
|
|
355
|
+
const P = G(p), S = h == null ? void 0 : h.coordinate;
|
|
356
356
|
S && (f.querySelector(".popup-content"), f.innerHTML = P, v == null || v.setPosition(S));
|
|
357
357
|
} else
|
|
358
358
|
v && v.setPosition(void 0);
|
|
359
359
|
} catch (p) {
|
|
360
360
|
console.error("handleTrackMapEvent", p);
|
|
361
361
|
}
|
|
362
|
-
},
|
|
362
|
+
}, G = (c) => {
|
|
363
363
|
if (!(c != null && c.time)) return;
|
|
364
364
|
let d = "";
|
|
365
365
|
return c != null && c.stayTime && (d = `
|
|
@@ -468,8 +468,8 @@ const ao = (e) => {
|
|
|
468
468
|
const R = async (c, d) => {
|
|
469
469
|
await se(), await Ae(c);
|
|
470
470
|
const h = B(d), p = h.map((S) => ue(S));
|
|
471
|
-
n.get(c).getSource().addFeatures(p), wt(c, h, d,
|
|
472
|
-
const Z = le(c,
|
|
471
|
+
n.get(c).getSource().addFeatures(p), wt(c, h, d, A), h.forEach((S) => {
|
|
472
|
+
const Z = le(c, A, S);
|
|
473
473
|
e.addOverlay(Z);
|
|
474
474
|
});
|
|
475
475
|
}, ue = (c) => {
|
|
@@ -479,7 +479,7 @@ const ao = (e) => {
|
|
|
479
479
|
});
|
|
480
480
|
d.set("type", "track_point"), d.set("trackId", c.id), d.set("data", c);
|
|
481
481
|
let h = [
|
|
482
|
-
...Ee(c,
|
|
482
|
+
...Ee(c, A)
|
|
483
483
|
];
|
|
484
484
|
return (c.index === 0 || c.index === s[c.id].length - 1) && (h = [...xt(c)], d.set("type", "track_begin")), c.state !== void 0 && c.state !== null && (h = [...Te(c)], d.set("type", "track_icon")), d.setStyle(h), d;
|
|
485
485
|
}, le = (c, d, h) => {
|
|
@@ -665,9 +665,9 @@ const ao = (e) => {
|
|
|
665
665
|
U.setStyle(Ge), U.drawGeometry(x), e == null || e.render();
|
|
666
666
|
}, Et = () => {
|
|
667
667
|
var c;
|
|
668
|
-
z = !0, M = Date.now(), m = 0, x = ((c = g.getGeometry()) == null ? void 0 : c.clone()) || new ce([0, 0]), o && (b == null || b.on("postrender", o)),
|
|
668
|
+
z = !0, M = Date.now(), m = 0, x = ((c = g.getGeometry()) == null ? void 0 : c.clone()) || new ce([0, 0]), o && (b == null || b.on("postrender", o)), E == null || E.setGeometry(void 0);
|
|
669
669
|
}, Fe = () => {
|
|
670
|
-
z && (z = !1,
|
|
670
|
+
z && (z = !1, E == null || E.setGeometry(void 0), o && b && b.un("postrender", o), b && (e == null || e.removeLayer(b)), b = null, E = null);
|
|
671
671
|
}, Tt = (c, d) => {
|
|
672
672
|
z && Fe(), t = new nt({
|
|
673
673
|
factor: 1e6
|
|
@@ -681,13 +681,13 @@ const ao = (e) => {
|
|
|
681
681
|
geometry: new ce(r.getFirstCoordinate())
|
|
682
682
|
});
|
|
683
683
|
const h = g.getGeometry();
|
|
684
|
-
x = h ? h.clone() : new ce([0, 0]),
|
|
684
|
+
x = h ? h.clone() : new ce([0, 0]), E = new ae({
|
|
685
685
|
type: "geoMarker",
|
|
686
686
|
style: Ge,
|
|
687
687
|
geometry: x
|
|
688
688
|
}), b = new ye({
|
|
689
689
|
source: new ge({
|
|
690
|
-
features: [
|
|
690
|
+
features: [E]
|
|
691
691
|
})
|
|
692
692
|
}), e == null || e.addLayer(b), o = (p) => Lt(p, d), Et();
|
|
693
693
|
}, tt = (c, d, h) => {
|
|
@@ -1007,39 +1007,39 @@ function xo(e, n, s = "left-bottom", l = 2) {
|
|
|
1007
1007
|
const o = pe, f = Be;
|
|
1008
1008
|
if (!f) return "";
|
|
1009
1009
|
o.width = 0, o.height = 0;
|
|
1010
|
-
const v = 2, t = 8, r = 16, g = window.devicePixelRatio || 1, x = "500 12px Arial",
|
|
1010
|
+
const v = 2, t = 8, r = 16, g = window.devicePixelRatio || 1, x = "500 12px Arial", E = "14px map-iconfont";
|
|
1011
1011
|
f.font = x;
|
|
1012
1012
|
const M = f.measureText(e).width;
|
|
1013
|
-
f.font =
|
|
1014
|
-
const b = n.map((w) => ({ width: f.measureText(he(w)).width, height: 14 })), m = b.reduce((w, V) => w + V.width, 0), k = (n.length - 1) * l,
|
|
1015
|
-
let D,
|
|
1016
|
-
switch (D = r +
|
|
1013
|
+
f.font = E;
|
|
1014
|
+
const b = n.map((w) => ({ width: f.measureText(he(w)).width, height: 14 })), m = b.reduce((w, V) => w + V.width, 0), k = (n.length - 1) * l, T = t + M + m + k + t, L = v + 14 + v;
|
|
1015
|
+
let D, W, A = 0, H = 0, j = 0, F = 0, C = 0, $ = 0;
|
|
1016
|
+
switch (D = r + T, s) {
|
|
1017
1017
|
case "right-top":
|
|
1018
|
-
|
|
1018
|
+
W = r + L, A = 0, H = r + L, j = r, F = 0, C = r, $ = 0;
|
|
1019
1019
|
break;
|
|
1020
1020
|
case "right-middle":
|
|
1021
|
-
|
|
1021
|
+
W = L, A = 0, H = L / 2, j = r, F = L / 2, C = r, $ = 0;
|
|
1022
1022
|
break;
|
|
1023
1023
|
case "right-bottom":
|
|
1024
|
-
|
|
1024
|
+
W = r + L, A = 0, H = 0, j = r, F = r, C = r, $ = r;
|
|
1025
1025
|
break;
|
|
1026
1026
|
case "left-top":
|
|
1027
|
-
|
|
1027
|
+
W = r + L, A = T, H = r, j = T + r, F = L + r, C = 0, $ = 0;
|
|
1028
1028
|
break;
|
|
1029
1029
|
case "left-middle":
|
|
1030
|
-
|
|
1030
|
+
W = L, A = T, H = L / 2, j = T + r, F = L / 2, C = 0, $ = 0;
|
|
1031
1031
|
break;
|
|
1032
1032
|
case "left-bottom":
|
|
1033
|
-
|
|
1033
|
+
W = r + L, A = T, H = L, j = T + r, F = 0, C = 0, $ = r;
|
|
1034
1034
|
break;
|
|
1035
1035
|
}
|
|
1036
|
-
|
|
1036
|
+
W = W + v, o.width = Math.round(D * g), o.height = Math.round(W * g), f.scale(g, g), f.clearRect(0, 0, D, W), f.beginPath(), f.moveTo(A, H), f.lineTo(j, F), f.strokeStyle = "#FFF", f.lineWidth = 1, f.stroke(), f.fillStyle = "#FFF", f.fillRect(C, $, T, L), f.font = x, f.textBaseline = "middle";
|
|
1037
1037
|
const a = $ + v + L / 2;
|
|
1038
|
-
f.strokeStyle = "#ffffff", f.lineWidth = 1, f.strokeText(e, C + t, a), f.fillStyle = "#000000", f.fillText(e, C + t, a), f.font =
|
|
1038
|
+
f.strokeStyle = "#ffffff", f.lineWidth = 1, f.strokeText(e, C + t, a), f.fillStyle = "#000000", f.fillText(e, C + t, a), f.font = E, f.fillStyle = "#3370ff";
|
|
1039
1039
|
let y = C + t + M + l;
|
|
1040
1040
|
n.length > 0 && n.forEach((w, V) => {
|
|
1041
|
-
const
|
|
1042
|
-
f.fillText(he(w), y,
|
|
1041
|
+
const G = $ + v + L / 2;
|
|
1042
|
+
f.fillText(he(w), y, G), y += b[V].width + l;
|
|
1043
1043
|
});
|
|
1044
1044
|
const u = o.toDataURL("image/png");
|
|
1045
1045
|
return Ye.set(i, u), u;
|
|
@@ -1108,9 +1108,9 @@ const at = (e, n) => {
|
|
|
1108
1108
|
u.length === 0 ? a.push(s) : s = u[0];
|
|
1109
1109
|
}
|
|
1110
1110
|
m(), $(a), z(), D();
|
|
1111
|
-
},
|
|
1111
|
+
}, E = (a) => {
|
|
1112
1112
|
var R;
|
|
1113
|
-
const y = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id")), u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), w = ((R = g[a.id]) == null ? void 0 : R.blinkColors) || [],
|
|
1113
|
+
const y = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id")), u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), w = ((R = g[a.id]) == null ? void 0 : R.blinkColors) || [], G = w[w.length - 1] || a.fill || "#04C900", B = go(a), J = new ae({
|
|
1114
1114
|
geometry: new ce(u),
|
|
1115
1115
|
// 船舶数据
|
|
1116
1116
|
shipData: a,
|
|
@@ -1120,7 +1120,7 @@ const at = (e, n) => {
|
|
|
1120
1120
|
// 图标
|
|
1121
1121
|
rightIcons: ct(a),
|
|
1122
1122
|
// 船舶颜色
|
|
1123
|
-
color:
|
|
1123
|
+
color: G,
|
|
1124
1124
|
// 船艏向的方向
|
|
1125
1125
|
direct: B,
|
|
1126
1126
|
// 高亮
|
|
@@ -1166,17 +1166,17 @@ const at = (e, n) => {
|
|
|
1166
1166
|
console.log("overlay---", w), w.setPosition(void 0), e.removeOverlay(w), w.dispose();
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
|
-
},
|
|
1169
|
+
}, T = (a, y) => {
|
|
1170
1170
|
r = a, g = y;
|
|
1171
1171
|
const u = e.getOverlays().getArray(), w = l.getFeatures();
|
|
1172
1172
|
for (const V in r) {
|
|
1173
|
-
const
|
|
1173
|
+
const G = r[V], B = u.find((R) => R.getId() === "label-" + V), J = w.find((R) => V === R.get("id"));
|
|
1174
1174
|
if (B && J) {
|
|
1175
1175
|
const R = y[V].blinkColors || [], { shipData: ue, name: le, color: se } = J.getProperties();
|
|
1176
|
-
J.set("blinking",
|
|
1176
|
+
J.set("blinking", G), R[(R == null ? void 0 : R.length) - 1] && se !== R[(R == null ? void 0 : R.length) - 1] && (J.set("color", R[(R == null ? void 0 : R.length) - 1] || ""), J.setStyle(me(e, J)));
|
|
1177
1177
|
const Ae = {
|
|
1178
1178
|
...ue,
|
|
1179
|
-
blinking:
|
|
1179
|
+
blinking: G,
|
|
1180
1180
|
blinkingColors: R || [],
|
|
1181
1181
|
name: le + "(" + y[V].shipState + ")"
|
|
1182
1182
|
}, Ee = B.getElement(), Te = yt(Ae);
|
|
@@ -1203,9 +1203,9 @@ const at = (e, n) => {
|
|
|
1203
1203
|
w && (w.style.opacity = 1);
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
},
|
|
1206
|
+
}, W = (a) => {
|
|
1207
1207
|
if (!e) return;
|
|
1208
|
-
const y = l.getFeatures(), u = o.getFeatures(), w = n ? n.get("id") : "", V = y.filter((R) => R.get("id") !== w),
|
|
1208
|
+
const y = l.getFeatures(), u = o.getFeatures(), w = n ? n.get("id") : "", V = y.filter((R) => R.get("id") !== w), G = u == null ? void 0 : u.filter((R) => R.get("id") !== w), B = /* @__PURE__ */ new Map();
|
|
1209
1209
|
a.forEach((R) => {
|
|
1210
1210
|
B.set(R.id, !0);
|
|
1211
1211
|
});
|
|
@@ -1220,7 +1220,7 @@ const at = (e, n) => {
|
|
|
1220
1220
|
}
|
|
1221
1221
|
const le = J.find((se) => se.getId() === "label-" + ue);
|
|
1222
1222
|
le && le.setPosition(void 0);
|
|
1223
|
-
}),
|
|
1223
|
+
}), G.forEach((R) => {
|
|
1224
1224
|
const ue = R.get("id");
|
|
1225
1225
|
if (!B.has(ue))
|
|
1226
1226
|
R.setStyle([]);
|
|
@@ -1229,7 +1229,7 @@ const at = (e, n) => {
|
|
|
1229
1229
|
(le == null ? void 0 : le.length) == 0 && R.setStyle(at(R));
|
|
1230
1230
|
}
|
|
1231
1231
|
});
|
|
1232
|
-
},
|
|
1232
|
+
}, A = (a) => {
|
|
1233
1233
|
if (a) {
|
|
1234
1234
|
console.log("选中", a);
|
|
1235
1235
|
const y = l.getFeatures().find((w) => w.get("id") === a.id), u = o.getFeatures().find((w) => w.get("id") === a.id);
|
|
@@ -1240,10 +1240,10 @@ const at = (e, n) => {
|
|
|
1240
1240
|
try {
|
|
1241
1241
|
if (a) {
|
|
1242
1242
|
const w = a.get("shipData"), V = a.get("id");
|
|
1243
|
-
if (e.getTargetElement().style.cursor = V ? "pointer" : "", y === "click" && (
|
|
1243
|
+
if (e.getTargetElement().style.cursor = V ? "pointer" : "", y === "click" && (A(w), u && u(V)), y === "hover") {
|
|
1244
1244
|
t && t !== V && j(), t = V;
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1245
|
+
const G = l.getFeatures().find((B) => B.get("id") === t);
|
|
1246
|
+
G == null || G.set("isHighlight", !0), G == null || G.setStyle(me(e, G));
|
|
1247
1247
|
}
|
|
1248
1248
|
} else
|
|
1249
1249
|
e.getTargetElement().style.cursor = "", j();
|
|
@@ -1275,15 +1275,15 @@ const at = (e, n) => {
|
|
|
1275
1275
|
}, $ = (a) => {
|
|
1276
1276
|
const y = e.getView().getZoom();
|
|
1277
1277
|
a.forEach((u) => {
|
|
1278
|
-
const w =
|
|
1278
|
+
const w = E(u);
|
|
1279
1279
|
if (w.setStyle(me(e, w)), l.addFeature(w), (s == null ? void 0 : s.id) == u.id || y >= re.shipModelMin)
|
|
1280
1280
|
if (r[u.id]) {
|
|
1281
1281
|
if (u.id && g[u == null ? void 0 : u.id]) {
|
|
1282
|
-
const V = g[u == null ? void 0 : u.id] || {},
|
|
1282
|
+
const V = g[u == null ? void 0 : u.id] || {}, G = (V == null ? void 0 : V.blinkColors) || [], B = (V == null ? void 0 : V.shipState) || "", J = (u.cnname || u.enname || u.name || u.id || "未命名船舶") + "(" + B + ")", R = {
|
|
1283
1283
|
...u,
|
|
1284
1284
|
name: J,
|
|
1285
1285
|
blinking: r[u.id],
|
|
1286
|
-
blinkingColors:
|
|
1286
|
+
blinkingColors: G || []
|
|
1287
1287
|
};
|
|
1288
1288
|
yo(e, R);
|
|
1289
1289
|
}
|
|
@@ -1295,9 +1295,9 @@ const at = (e, n) => {
|
|
|
1295
1295
|
};
|
|
1296
1296
|
return {
|
|
1297
1297
|
render: x,
|
|
1298
|
-
selected:
|
|
1299
|
-
filter:
|
|
1300
|
-
blinking:
|
|
1298
|
+
selected: A,
|
|
1299
|
+
filter: W,
|
|
1300
|
+
blinking: T,
|
|
1301
1301
|
clear: m,
|
|
1302
1302
|
handleShipMapEvent: H,
|
|
1303
1303
|
changeShipScale: M,
|
|
@@ -1365,10 +1365,10 @@ const at = (e, n) => {
|
|
|
1365
1365
|
}), e == null || e.addLayer(s));
|
|
1366
1366
|
}
|
|
1367
1367
|
}, v = (M) => {
|
|
1368
|
-
const b = e == null ? void 0 : e.getView().getZoom(), [m, k] = M.latLon.split(","),
|
|
1368
|
+
const b = e == null ? void 0 : e.getView().getZoom(), [m, k] = M.latLon.split(","), T = new ae({
|
|
1369
1369
|
geometry: new ce(ee([Number(m), Number(k)]))
|
|
1370
1370
|
});
|
|
1371
|
-
|
|
1371
|
+
T.setStyle(t(M, b, M.id === (o == null ? void 0 : o.id))), T.set("loactionData", M), l.addFeature(T);
|
|
1372
1372
|
}, t = (M, b, m) => {
|
|
1373
1373
|
const k = {
|
|
1374
1374
|
image: new Ce({
|
|
@@ -1398,12 +1398,12 @@ const at = (e, n) => {
|
|
|
1398
1398
|
}, g = () => {
|
|
1399
1399
|
var k;
|
|
1400
1400
|
const M = i.get("loactionData"), b = (k = e == null ? void 0 : e.getView()) == null ? void 0 : k.getZoom();
|
|
1401
|
-
l.getFeatures().forEach((
|
|
1402
|
-
|
|
1401
|
+
l.getFeatures().forEach((T) => {
|
|
1402
|
+
T.get("loactionData").id === M.id && (T == null || T.setStyle(t(M, b, !1)));
|
|
1403
1403
|
}), o = null, i = null;
|
|
1404
1404
|
}, x = (M) => {
|
|
1405
|
-
M ? (
|
|
1406
|
-
},
|
|
1405
|
+
M ? (E(), z(M)) : clearSelectedPort();
|
|
1406
|
+
}, E = () => {
|
|
1407
1407
|
var M;
|
|
1408
1408
|
if (i) {
|
|
1409
1409
|
const b = i.get("loactionData"), m = (M = e == null ? void 0 : e.getView()) == null ? void 0 : M.getZoom();
|
|
@@ -1454,12 +1454,12 @@ const at = (e, n) => {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
}), e == null || e.addLayer(r);
|
|
1456
1456
|
};
|
|
1457
|
-
let x,
|
|
1457
|
+
let x, E;
|
|
1458
1458
|
const z = (F) => {
|
|
1459
1459
|
if (F.dragging)
|
|
1460
1460
|
return;
|
|
1461
1461
|
let C = "点击选择起点";
|
|
1462
|
-
x && (C = "单击继续,双击结束"), o && (o.innerHTML = C,
|
|
1462
|
+
x && (C = "单击继续,双击结束"), o && (o.innerHTML = C, E.setPosition(F.coordinate), o.classList.remove("hidden"));
|
|
1463
1463
|
};
|
|
1464
1464
|
let M;
|
|
1465
1465
|
const b = () => {
|
|
@@ -1495,7 +1495,7 @@ const at = (e, n) => {
|
|
|
1495
1495
|
let $;
|
|
1496
1496
|
F = (a = x.getGeometry()) == null ? void 0 : a.on("change", function(y) {
|
|
1497
1497
|
const u = y.target, w = mt(u, l.value);
|
|
1498
|
-
$ = u.getLastCoordinate(), k && w && (k.innerHTML = w),
|
|
1498
|
+
$ = u.getLastCoordinate(), k && w && (k.innerHTML = w), T.setPosition($);
|
|
1499
1499
|
});
|
|
1500
1500
|
}), M.on("drawend", function() {
|
|
1501
1501
|
var C, $, a;
|
|
@@ -1507,26 +1507,26 @@ const at = (e, n) => {
|
|
|
1507
1507
|
var w;
|
|
1508
1508
|
y.preventDefault(), y.stopPropagation();
|
|
1509
1509
|
const u = (w = y.target) == null ? void 0 : w.getAttribute("data-id");
|
|
1510
|
-
u &&
|
|
1511
|
-
}),
|
|
1510
|
+
u && A(u);
|
|
1511
|
+
}), T.setOffset([0, -7]), x = null, k = null, L(), F && Xe(F), (a = ($ = n.getProps()) == null ? void 0 : $.lineDrawEnd) == null || a.call($, s.value);
|
|
1512
1512
|
});
|
|
1513
1513
|
}, m = () => Math.random().toString(36).substring(2, 9);
|
|
1514
|
-
let k,
|
|
1514
|
+
let k, T;
|
|
1515
1515
|
const L = () => {
|
|
1516
|
-
k != null && k.parentNode && k.parentNode.removeChild(k), k = document.createElement("div"), k.className = "ol-tooltip ol-tooltip-measure",
|
|
1516
|
+
k != null && k.parentNode && k.parentNode.removeChild(k), k = document.createElement("div"), k.className = "ol-tooltip ol-tooltip-measure", T = new de({
|
|
1517
1517
|
element: k,
|
|
1518
1518
|
offset: [0, -15],
|
|
1519
1519
|
positioning: "bottom-center",
|
|
1520
1520
|
stopEvent: !1,
|
|
1521
1521
|
insertFirst: !1
|
|
1522
|
-
}), e == null || e.addOverlay(
|
|
1522
|
+
}), e == null || e.addOverlay(T);
|
|
1523
1523
|
}, D = () => {
|
|
1524
|
-
o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden",
|
|
1524
|
+
o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", E = new de({
|
|
1525
1525
|
element: o,
|
|
1526
1526
|
offset: [15, 0],
|
|
1527
1527
|
positioning: "center-left"
|
|
1528
|
-
}), e == null || e.addOverlay(
|
|
1529
|
-
},
|
|
1528
|
+
}), e == null || e.addOverlay(E);
|
|
1529
|
+
}, W = () => {
|
|
1530
1530
|
s.value.forEach((F, C) => {
|
|
1531
1531
|
var y, u;
|
|
1532
1532
|
const $ = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
@@ -1534,7 +1534,7 @@ const at = (e, n) => {
|
|
|
1534
1534
|
const a = t.getFeatures();
|
|
1535
1535
|
a[C] && t.removeFeature(a[C]);
|
|
1536
1536
|
}), H(), Lo(e), f.value = !1, Le(e, "pointer");
|
|
1537
|
-
},
|
|
1537
|
+
}, A = (F) => {
|
|
1538
1538
|
var $, a, y, u;
|
|
1539
1539
|
const C = s.value.findIndex((w) => w.id === F);
|
|
1540
1540
|
if (C !== -1) {
|
|
@@ -1557,8 +1557,8 @@ const at = (e, n) => {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
return {
|
|
1559
1559
|
open: v,
|
|
1560
|
-
close:
|
|
1561
|
-
deleteLine:
|
|
1560
|
+
close: W,
|
|
1561
|
+
deleteLine: A,
|
|
1562
1562
|
setUnit: i,
|
|
1563
1563
|
getState: () => f.value
|
|
1564
1564
|
};
|
|
@@ -1582,7 +1582,7 @@ const at = (e, n) => {
|
|
|
1582
1582
|
const o = () => {
|
|
1583
1583
|
H(), i = "open", f(), Le(e, "crosshair");
|
|
1584
1584
|
}, f = () => {
|
|
1585
|
-
r(),
|
|
1585
|
+
r(), T(), W(), M();
|
|
1586
1586
|
};
|
|
1587
1587
|
let v = null, t = null;
|
|
1588
1588
|
const r = () => {
|
|
@@ -1598,7 +1598,7 @@ const at = (e, n) => {
|
|
|
1598
1598
|
zIndex: 1e3
|
|
1599
1599
|
});
|
|
1600
1600
|
v = C, t = F, e.on("pointermove", x), e.addLayer(C), e.on(["dblclick"], function($) {
|
|
1601
|
-
|
|
1601
|
+
E && ($.stopPropagation(), $.preventDefault());
|
|
1602
1602
|
});
|
|
1603
1603
|
};
|
|
1604
1604
|
let g;
|
|
@@ -1607,7 +1607,7 @@ const at = (e, n) => {
|
|
|
1607
1607
|
const C = g ? "单击继续,双击结束" : "点击选择起点";
|
|
1608
1608
|
L && (L.innerHTML = C, D.setPosition(F.coordinate));
|
|
1609
1609
|
};
|
|
1610
|
-
let
|
|
1610
|
+
let E, z = !1;
|
|
1611
1611
|
const M = () => {
|
|
1612
1612
|
if (s) {
|
|
1613
1613
|
L != null && L.parentNode && L.parentNode.removeChild(L);
|
|
@@ -1626,14 +1626,14 @@ const at = (e, n) => {
|
|
|
1626
1626
|
var u;
|
|
1627
1627
|
(u = document.querySelector(".delete-icon")) == null || u.addEventListener("click", () => {
|
|
1628
1628
|
var w, V;
|
|
1629
|
-
console.log("delete"),
|
|
1629
|
+
console.log("delete"), A(), (V = (w = n.getProps()) == null ? void 0 : w.areaDrawEnd) == null || V.call(w, []);
|
|
1630
1630
|
});
|
|
1631
1631
|
}, 0);
|
|
1632
1632
|
const y = jt(s.getGeometry().getExtent());
|
|
1633
1633
|
e == null || e.getView().setCenter(y);
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
|
-
|
|
1636
|
+
E = new Oe({
|
|
1637
1637
|
type: "Polygon",
|
|
1638
1638
|
source: t,
|
|
1639
1639
|
trace: !0,
|
|
@@ -1658,10 +1658,10 @@ const at = (e, n) => {
|
|
|
1658
1658
|
return new Qt(C);
|
|
1659
1659
|
}
|
|
1660
1660
|
})]
|
|
1661
|
-
}), e == null || e.addInteraction(
|
|
1661
|
+
}), e == null || e.addInteraction(E), E.on("drawstart", (F) => {
|
|
1662
1662
|
var C;
|
|
1663
1663
|
g = F.feature, l = (C = g.getGeometry()) == null ? void 0 : C.on("change", ($) => {
|
|
1664
|
-
const a = $.target, y = b(a, "nm"), w = a.getCoordinates()[0], V = new ze([w[w.length - 2], w[w.length - 1]]),
|
|
1664
|
+
const a = $.target, y = b(a, "nm"), w = a.getCoordinates()[0], V = new ze([w[w.length - 2], w[w.length - 1]]), G = mt(V, "nm");
|
|
1665
1665
|
if (z = Number(Ke(V) / 1e3) > 150, !y) return;
|
|
1666
1666
|
const B = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1667
1667
|
m && (m.innerHTML = `
|
|
@@ -1674,7 +1674,7 @@ const at = (e, n) => {
|
|
|
1674
1674
|
面积:${y}
|
|
1675
1675
|
</div>
|
|
1676
1676
|
<div class="text ${z ? "error" : ""}">
|
|
1677
|
-
线段 ${w.length - 2}: ${
|
|
1677
|
+
线段 ${w.length - 2}: ${G}
|
|
1678
1678
|
${z ? B : ""}
|
|
1679
1679
|
|
|
1680
1680
|
</div>
|
|
@@ -1683,20 +1683,20 @@ const at = (e, n) => {
|
|
|
1683
1683
|
</div>
|
|
1684
1684
|
`);
|
|
1685
1685
|
});
|
|
1686
|
-
}),
|
|
1686
|
+
}), E.on("drawend", (F) => {
|
|
1687
1687
|
var y, u, w, V;
|
|
1688
1688
|
if (!F.feature.getGeometry()) return;
|
|
1689
1689
|
m && !s && (m.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), s = F.feature, k.setOffset([10, 0]);
|
|
1690
1690
|
const $ = F.feature.getGeometry().getCoordinates(), a = $[0][$[0].length - 2];
|
|
1691
1691
|
if (k.setPosition(a), L != null && L.parentNode && L.parentNode.removeChild(L), (y = n.getProps()) != null && y.areaDrawEnd) {
|
|
1692
|
-
const
|
|
1693
|
-
(w = (u = n.getProps()) == null ? void 0 : u.areaDrawEnd) == null || w.call(u,
|
|
1692
|
+
const G = $[0].map((B) => Me(B, _.mercator, _.data));
|
|
1693
|
+
(w = (u = n.getProps()) == null ? void 0 : u.areaDrawEnd) == null || w.call(u, G);
|
|
1694
1694
|
}
|
|
1695
|
-
|
|
1695
|
+
E && (E.setActive(!1), e == null || e.removeInteraction(E), (e == null ? void 0 : e.getInteractions()).forEach((B) => {
|
|
1696
1696
|
B instanceof Oe && (B.setActive(!1), e == null || e.removeInteraction(B));
|
|
1697
1697
|
})), l && Xe(l), (V = document.querySelector(".delete-icon")) == null || V.addEventListener("click", () => {
|
|
1698
|
-
var
|
|
1699
|
-
|
|
1698
|
+
var G, B;
|
|
1699
|
+
A(), (B = (G = n.getProps()) == null ? void 0 : G.areaDrawEnd) == null || B.call(G, []);
|
|
1700
1700
|
});
|
|
1701
1701
|
});
|
|
1702
1702
|
}, b = (F, C) => {
|
|
@@ -1709,7 +1709,7 @@ const at = (e, n) => {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
};
|
|
1711
1711
|
let m, k;
|
|
1712
|
-
const
|
|
1712
|
+
const T = () => {
|
|
1713
1713
|
m != null && m.parentNode && m.parentNode.removeChild(m), m = document.createElement("div"), m.style.display = "flex", m.className = "ol-tooltip ol-tooltip-draw-polygon", k = new de({
|
|
1714
1714
|
element: m,
|
|
1715
1715
|
offset: [0, -15],
|
|
@@ -1719,23 +1719,23 @@ const at = (e, n) => {
|
|
|
1719
1719
|
}), e == null || e.addOverlay(k);
|
|
1720
1720
|
};
|
|
1721
1721
|
let L, D;
|
|
1722
|
-
const
|
|
1722
|
+
const W = () => {
|
|
1723
1723
|
L != null && L.parentNode && L.parentNode.removeChild(L), L = document.createElement("div"), L.className = "ol-tooltip ol-help-tooltip", D = new de({
|
|
1724
1724
|
element: L,
|
|
1725
1725
|
offset: [15, 0],
|
|
1726
1726
|
positioning: "center-left"
|
|
1727
1727
|
}), e == null || e.addOverlay(D);
|
|
1728
|
-
},
|
|
1729
|
-
|
|
1728
|
+
}, A = () => {
|
|
1729
|
+
s = null, o();
|
|
1730
1730
|
}, H = () => {
|
|
1731
|
-
i = "close", e.un("pointermove", x), g = null,
|
|
1731
|
+
i = "close", e.un("pointermove", x), g = null, E && (E.abortDrawing(), console.log("abortDrawing"), E.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((C) => {
|
|
1732
1732
|
C instanceof Oe && (C.setActive(!1), e == null || e.removeInteraction(C));
|
|
1733
|
-
}),
|
|
1733
|
+
}), E = null), l && Xe(l), l = void 0, t == null || t.clear(), t = null, v && e.getAllLayers().includes(v) && (e.removeLayer(v), v = null), L != null && L.parentElement && (L.innerHTML = "", L.parentElement.removeChild(L), L = null), m != null && m.parentElement && (m.innerHTML = "", m.parentElement.removeChild(m), m = null), D && e.removeOverlay(D), k && e.removeOverlay(k), Le(e, "pointer");
|
|
1734
1734
|
};
|
|
1735
1735
|
return {
|
|
1736
1736
|
open: o,
|
|
1737
1737
|
close: H,
|
|
1738
|
-
reset:
|
|
1738
|
+
reset: A,
|
|
1739
1739
|
getState: () => i
|
|
1740
1740
|
};
|
|
1741
1741
|
}, Fo = "zh-map-port-layer", Po = (e) => {
|
|
@@ -1751,19 +1751,19 @@ const at = (e, n) => {
|
|
|
1751
1751
|
const o = (b, m = !0) => {
|
|
1752
1752
|
if (!b || b.length === 0) return;
|
|
1753
1753
|
if (n.clear(), i) {
|
|
1754
|
-
const
|
|
1755
|
-
|
|
1754
|
+
const T = b.find((L) => L.id === (i == null ? void 0 : i.id));
|
|
1755
|
+
T ? i = T : b.push(i);
|
|
1756
1756
|
}
|
|
1757
1757
|
const k = [];
|
|
1758
|
-
b.forEach((
|
|
1759
|
-
const [L, D] =
|
|
1758
|
+
b.forEach((T) => {
|
|
1759
|
+
const [L, D] = T.latLon.split(","), W = new ae({
|
|
1760
1760
|
geometry: new ce(ee([Number(L), Number(D)])),
|
|
1761
|
-
portData:
|
|
1762
|
-
id:
|
|
1763
|
-
select:
|
|
1764
|
-
showTitle:
|
|
1765
|
-
}),
|
|
1766
|
-
|
|
1761
|
+
portData: T,
|
|
1762
|
+
id: T.id,
|
|
1763
|
+
select: T.id === (i == null ? void 0 : i.id),
|
|
1764
|
+
showTitle: T.id === (i == null ? void 0 : i.id) || m
|
|
1765
|
+
}), A = r(W);
|
|
1766
|
+
W.setStyle(A), k.push(W);
|
|
1767
1767
|
}), n.addFeatures(k);
|
|
1768
1768
|
};
|
|
1769
1769
|
let f = null, v = null;
|
|
@@ -1771,17 +1771,17 @@ const at = (e, n) => {
|
|
|
1771
1771
|
f || (f = document.createElement("canvas"), v = f.getContext("2d", {
|
|
1772
1772
|
willReadFrequently: !0
|
|
1773
1773
|
}));
|
|
1774
|
-
const k = f,
|
|
1775
|
-
if (!
|
|
1774
|
+
const k = f, T = v;
|
|
1775
|
+
if (!T) return "";
|
|
1776
1776
|
k.width = 0, k.height = 0;
|
|
1777
|
-
const L = 2, D = 8,
|
|
1778
|
-
|
|
1779
|
-
const j =
|
|
1780
|
-
k.width = Math.round(F *
|
|
1777
|
+
const L = 2, D = 8, W = window.devicePixelRatio || 1, A = "12px sans-serif";
|
|
1778
|
+
T.font = A;
|
|
1779
|
+
const j = T.measureText(b).width, F = D + j + D, C = L + 12 + L * 2;
|
|
1780
|
+
k.width = Math.round(F * W), k.height = Math.round(C * W), T.scale(W, W), T.clearRect(0, 0, F, C), T.fillStyle = m ? "#FF5733" : "#FFF", T.fillRect(0, 0, F, C), T.font = A, T.textBaseline = "middle";
|
|
1781
1781
|
const $ = C / 2;
|
|
1782
|
-
return
|
|
1782
|
+
return T.strokeStyle = m ? "#000" : "#ffffff", T.lineWidth = 1, T.strokeText(b, D, $), T.fillStyle = m ? "#FFF" : "#000000", T.fillText(b, D, $), k.toDataURL("image/png");
|
|
1783
1783
|
}, r = (b) => {
|
|
1784
|
-
const { select: m, showTitle: k } = b.getProperties(),
|
|
1784
|
+
const { select: m, showTitle: k } = b.getProperties(), T = (F) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1785
1785
|
<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="${F}"/>
|
|
1786
1786
|
<g clip-path="url(#clip0_10059_122082)">
|
|
1787
1787
|
<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"/>
|
|
@@ -1792,7 +1792,7 @@ const at = (e, n) => {
|
|
|
1792
1792
|
</clipPath>
|
|
1793
1793
|
</defs>
|
|
1794
1794
|
</svg>
|
|
1795
|
-
`, L = () => `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
1795
|
+
`, L = () => `data:image/svg+xml;utf8,${encodeURIComponent(T(m ? "#FF5733" : "#3370FF"))}`, D = e.getView().getZoom(), W = b.get("portData"), A = window.devicePixelRatio || 1, H = new Q({
|
|
1796
1796
|
image: new Ce({
|
|
1797
1797
|
src: L(),
|
|
1798
1798
|
scale: 0.5 * D / 10
|
|
@@ -1800,10 +1800,10 @@ const at = (e, n) => {
|
|
|
1800
1800
|
zIndex: m ? 110 : 100
|
|
1801
1801
|
}), j = new Q({
|
|
1802
1802
|
image: new Ce({
|
|
1803
|
-
src: t(
|
|
1803
|
+
src: t(W.shortName, m),
|
|
1804
1804
|
anchor: [0.5, 0.5],
|
|
1805
1805
|
displacement: [0, -26],
|
|
1806
|
-
scale: 1 /
|
|
1806
|
+
scale: 1 / A,
|
|
1807
1807
|
anchorXUnits: "fraction",
|
|
1808
1808
|
anchorYUnits: "fraction"
|
|
1809
1809
|
}),
|
|
@@ -1834,13 +1834,13 @@ const at = (e, n) => {
|
|
|
1834
1834
|
}, x = (b) => {
|
|
1835
1835
|
if (n) {
|
|
1836
1836
|
if (!b)
|
|
1837
|
-
return
|
|
1838
|
-
(l == null ? void 0 : l.get("portData").id) !== b.id && (
|
|
1837
|
+
return E();
|
|
1838
|
+
(l == null ? void 0 : l.get("portData").id) !== b.id && (E(), z(b));
|
|
1839
1839
|
}
|
|
1840
|
-
},
|
|
1840
|
+
}, E = () => {
|
|
1841
1841
|
var b;
|
|
1842
1842
|
if (l) {
|
|
1843
|
-
const m = l == null ? void 0 : l.get("portData"), k = (b = n.getFeatures()) == null ? void 0 : b.find((
|
|
1843
|
+
const m = l == null ? void 0 : l.get("portData"), k = (b = n.getFeatures()) == null ? void 0 : b.find((T) => T.get("portData").id === m.id);
|
|
1844
1844
|
k && (k.set("select", !1), k.setStyle(r(k)), l = null, i = null);
|
|
1845
1845
|
}
|
|
1846
1846
|
}, z = (b) => {
|
|
@@ -1870,13 +1870,14 @@ const at = (e, n) => {
|
|
|
1870
1870
|
const r = v == null ? void 0 : v.getEventPixel(t.originalEvent);
|
|
1871
1871
|
if (!r || !v) return;
|
|
1872
1872
|
const g = v.getSize();
|
|
1873
|
-
if (
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1873
|
+
if (r[0] < 0 || r[0] > g[0] || r[1] < 0 || r[1] > g[1])
|
|
1874
|
+
return;
|
|
1875
|
+
const x = v == null ? void 0 : v.forEachFeatureAtPixel(r, (E) => E);
|
|
1876
|
+
try {
|
|
1877
|
+
s == null || s.handleTrackMapEvent(x, "hover", t), l == null || l.handleShipMapEvent(x, "hover"), x && (i == null || i.handlePortHover(x));
|
|
1878
|
+
} catch (E) {
|
|
1879
|
+
console.log("pointermove---catch", E);
|
|
1880
|
+
}
|
|
1880
1881
|
}), v.on("movestart", () => {
|
|
1881
1882
|
try {
|
|
1882
1883
|
const t = v == null ? void 0 : v.getView().getZoom();
|
|
@@ -1889,8 +1890,8 @@ const at = (e, n) => {
|
|
|
1889
1890
|
if (f.getState() !== "open")
|
|
1890
1891
|
try {
|
|
1891
1892
|
if (console.log("1", o.getState()), o.getState()) return;
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1893
|
+
const E = v.getEventPixel(t.originalEvent), z = v.forEachFeatureAtPixel(
|
|
1894
|
+
E,
|
|
1894
1895
|
(M) => {
|
|
1895
1896
|
if (M != null && M.get("shipData") || M != null && M.get("portData"))
|
|
1896
1897
|
return M;
|
|
@@ -1903,8 +1904,8 @@ const at = (e, n) => {
|
|
|
1903
1904
|
i.selected(M), (x = (g = n.getProps()) == null ? void 0 : g.selectPort) == null || x.call(g, M);
|
|
1904
1905
|
}
|
|
1905
1906
|
t.preventDefault(), t.stopPropagation();
|
|
1906
|
-
} catch (
|
|
1907
|
-
console.log("click---catch",
|
|
1907
|
+
} catch (E) {
|
|
1908
|
+
console.log("click---catch", E);
|
|
1908
1909
|
}
|
|
1909
1910
|
}, 150)), v.getView().on("change:resolution", Re(() => {
|
|
1910
1911
|
const t = v == null ? void 0 : v.getView().getZoom();
|
|
@@ -1918,10 +1919,10 @@ const at = (e, n) => {
|
|
|
1918
1919
|
o.initMap(l, i);
|
|
1919
1920
|
const f = o.getInstall(), v = ko(f), t = po();
|
|
1920
1921
|
t.setProps(i), v.setShowLayerType(i.layerType), v.setGreenTileVisible(i.showGreenLayer);
|
|
1921
|
-
const r = ao(f), g = co(f, r), x = bo(f),
|
|
1922
|
+
const r = ao(f), g = co(f, r), x = bo(f), E = Mo(f), z = Eo(f, t), M = To(f, t), b = Po(f);
|
|
1922
1923
|
So(o, t, r, x, b, z, M);
|
|
1923
1924
|
const m = () => {
|
|
1924
|
-
const
|
|
1925
|
+
const T = f.getView().calculateExtent(o.getSize()), L = Me([T[0], T[1]], _.mercator, _.data), D = Me([T[2], T[3]], _.mercator, _.data);
|
|
1925
1926
|
return [L[0], L[1], D[0], D[1]];
|
|
1926
1927
|
}, k = {
|
|
1927
1928
|
id: Symbol("map-instance"),
|
|
@@ -1941,7 +1942,7 @@ const at = (e, n) => {
|
|
|
1941
1942
|
clear: b.clear,
|
|
1942
1943
|
selected: b.selected
|
|
1943
1944
|
},
|
|
1944
|
-
position:
|
|
1945
|
+
position: E,
|
|
1945
1946
|
drawLine: z,
|
|
1946
1947
|
drawPolygon: M,
|
|
1947
1948
|
// 子模块
|
package/dist/es/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { Z as B } from "./BaseInfo-BhnEjLKF.js";
|
|
|
17
17
|
import { Z as g } from "./DetailHeader-DaabNj_4.js";
|
|
18
18
|
import { Z as x } from "./DiyDataTable-D-UZVciZ.js";
|
|
19
19
|
import { D as V } from "./DiyDataTable-D-UZVciZ.js";
|
|
20
|
-
import { Z as G } from "./Map-
|
|
20
|
+
import { Z as G } from "./Map-nqeFFCPD.js";
|
|
21
21
|
import { Z as M } from "./Table-B_3YA1mb.js";
|
|
22
22
|
import { Z as $ } from "./BaseItem-C4NJy1i4.js";
|
|
23
23
|
const A = [
|
package/dist/umd/index.umd.cjs
CHANGED
|
@@ -220,7 +220,7 @@ fe.version="2.30.1",Z4(Tt),fe.fn=le,fe.min=BV,fe.max=VV,fe.now=$V,fe.utc=mi,fe.u
|
|
|
220
220
|
<div>
|
|
221
221
|
<span class="text">单击继续,双击结束</span>
|
|
222
222
|
</div>
|
|
223
|
-
`)})}),p.on("drawend",x=>{var N,F,M,R;if(!x.feature.getGeometry())return;y&&!n&&(y.innerHTML+='<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'),n=x.feature,_.setOffset([10,0]);const I=x.feature.getGeometry().getCoordinates(),P=I[0][I[0].length-2];if(_.setPosition(P),C!=null&&C.parentNode&&C.parentNode.removeChild(C),(N=e.getProps())!=null&&N.areaDrawEnd){const O=I[0].map(L=>Qi(L,Yn.mercator,Yn.data));(M=(F=e.getProps())==null?void 0:F.areaDrawEnd)==null||M.call(F,O)}p&&(p.setActive(!1),t==null||t.removeInteraction(p),(t==null?void 0:t.getInteractions()).forEach(L=>{L instanceof xf&&(L.setActive(!1),t==null||t.removeInteraction(L))})),r&&Eu(r),(R=document.querySelector(".delete-icon"))==null||R.addEventListener("click",()=>{var O,L;S(),(L=(O=e.getProps())==null?void 0:O.areaDrawEnd)==null||L.call(O,[])})})},m=(x,T)=>{const I=SE(x);switch(T){case"km":return I>1e4?Math.round(I/1e6*100)/100+" km<sup>2</sup>":Math.round(I*100)/100+" m<sup>2</sup>";case"nm":return I>1e4?Math.round(I/1e6/Math.pow(1.852,2)*100)/100+" nm<sup>2</sup>":Math.round(I*100)/100+" m<sup>2</sup>"}};let y,_;const w=()=>{y!=null&&y.parentNode&&y.parentNode.removeChild(y),y=document.createElement("div"),y.style.display="flex",y.className="ol-tooltip ol-tooltip-draw-polygon",_=new mo({element:y,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),t==null||t.addOverlay(_)};let C,b;const E=()=>{C!=null&&C.parentNode&&C.parentNode.removeChild(C),C=document.createElement("div"),C.className="ol-tooltip ol-help-tooltip",b=new mo({element:C,offset:[15,0],positioning:"center-left"}),t==null||t.addOverlay(b)},S=()=>{
|
|
223
|
+
`)})}),p.on("drawend",x=>{var N,F,M,R;if(!x.feature.getGeometry())return;y&&!n&&(y.innerHTML+='<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'),n=x.feature,_.setOffset([10,0]);const I=x.feature.getGeometry().getCoordinates(),P=I[0][I[0].length-2];if(_.setPosition(P),C!=null&&C.parentNode&&C.parentNode.removeChild(C),(N=e.getProps())!=null&&N.areaDrawEnd){const O=I[0].map(L=>Qi(L,Yn.mercator,Yn.data));(M=(F=e.getProps())==null?void 0:F.areaDrawEnd)==null||M.call(F,O)}p&&(p.setActive(!1),t==null||t.removeInteraction(p),(t==null?void 0:t.getInteractions()).forEach(L=>{L instanceof xf&&(L.setActive(!1),t==null||t.removeInteraction(L))})),r&&Eu(r),(R=document.querySelector(".delete-icon"))==null||R.addEventListener("click",()=>{var O,L;S(),(L=(O=e.getProps())==null?void 0:O.areaDrawEnd)==null||L.call(O,[])})})},m=(x,T)=>{const I=SE(x);switch(T){case"km":return I>1e4?Math.round(I/1e6*100)/100+" km<sup>2</sup>":Math.round(I*100)/100+" m<sup>2</sup>";case"nm":return I>1e4?Math.round(I/1e6/Math.pow(1.852,2)*100)/100+" nm<sup>2</sup>":Math.round(I*100)/100+" m<sup>2</sup>"}};let y,_;const w=()=>{y!=null&&y.parentNode&&y.parentNode.removeChild(y),y=document.createElement("div"),y.style.display="flex",y.className="ol-tooltip ol-tooltip-draw-polygon",_=new mo({element:y,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),t==null||t.addOverlay(_)};let C,b;const E=()=>{C!=null&&C.parentNode&&C.parentNode.removeChild(C),C=document.createElement("div"),C.className="ol-tooltip ol-help-tooltip",b=new mo({element:C,offset:[15,0],positioning:"center-left"}),t==null||t.addOverlay(b)},S=()=>{n=null,s()},v=()=>{o="close",t.un("pointermove",f),u=null,p&&(p.abortDrawing(),console.log("abortDrawing"),p.setActive(!1),(t==null?void 0:t.getInteractions()).forEach(T=>{T instanceof xf&&(T.setActive(!1),t==null||t.removeInteraction(T))}),p=null),r&&Eu(r),r=void 0,c==null||c.clear(),c=null,l&&t.getAllLayers().includes(l)&&(t.removeLayer(l),l=null),C!=null&&C.parentElement&&(C.innerHTML="",C.parentElement.removeChild(C),C=null),y!=null&&y.parentElement&&(y.innerHTML="",y.parentElement.removeChild(y),y=null),b&&t.removeOverlay(b),_&&t.removeOverlay(_),Vc(t,"pointer")};return{open:s,close:v,reset:S,getState:()=>o}},G7="zh-map-port-layer",j7=t=>{const e=new ho,n=new Go({className:G7,source:e,zIndex:100,updateWhileInteracting:!0,updateWhileAnimating:!0});t==null||t.addLayer(n);let r=null,o=null;const s=(m,y=!0)=>{if(!m||m.length===0)return;if(e.clear(),o){const w=m.find(C=>C.id===(o==null?void 0:o.id));w?o=w:m.push(o)}const _=[];m.forEach(w=>{const[C,b]=w.latLon.split(","),E=new sn({geometry:new an(rr([Number(C),Number(b)])),portData:w,id:w.id,select:w.id===(o==null?void 0:o.id),showTitle:w.id===(o==null?void 0:o.id)||y}),S=d(E);E.setStyle(S),_.push(E)}),e.addFeatures(_)};let a=null,l=null;const c=(m,y)=>{a||(a=document.createElement("canvas"),l=a.getContext("2d",{willReadFrequently:!0}));const _=a,w=l;if(!w)return"";_.width=0,_.height=0;const C=2,b=8,E=window.devicePixelRatio||1,S="12px sans-serif";w.font=S;const k=w.measureText(m).width,x=b+k+b,T=C+12+C*2;_.width=Math.round(x*E),_.height=Math.round(T*E),w.scale(E,E),w.clearRect(0,0,x,T),w.fillStyle=y?"#FF5733":"#FFF",w.fillRect(0,0,x,T),w.font=S,w.textBaseline="middle";const I=T/2;return w.strokeStyle=y?"#000":"#ffffff",w.lineWidth=1,w.strokeText(m,b,I),w.fillStyle=y?"#FFF":"#000000",w.fillText(m,b,I),_.toDataURL("image/png")},d=m=>{const{select:y,showTitle:_}=m.getProperties(),w=x=>`<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
224
224
|
<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="${x}"/>
|
|
225
225
|
<g clip-path="url(#clip0_10059_122082)">
|
|
226
226
|
<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"/>
|
|
@@ -231,7 +231,7 @@ fe.version="2.30.1",Z4(Tt),fe.fn=le,fe.min=BV,fe.max=VV,fe.now=$V,fe.utc=mi,fe.u
|
|
|
231
231
|
</clipPath>
|
|
232
232
|
</defs>
|
|
233
233
|
</svg>
|
|
234
|
-
`,C=()=>`data:image/svg+xml;utf8,${encodeURIComponent(w(y?"#FF5733":"#3370FF"))}`,b=t.getView().getZoom(),E=m.get("portData"),S=window.devicePixelRatio||1,v=new Ct({image:new ao({src:C(),scale:.5*b/10}),zIndex:y?110:100}),k=new Ct({image:new ao({src:c(E.shortName,y),anchor:[.5,.5],displacement:[0,-26],scale:1/S,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:y?110:100});return!_&&!y?v:[v,k]},u=()=>{if(e)if(r){console.log("清除非选中的港口");const m=r.get("portData").id;e.getFeatures().forEach(y=>{y.get("portData").id!==m&&e.removeFeature(y)})}else console.log("清除所有港口",e),e==null||e.clear()},f=m=>{if(e){if(!m)return p();(r==null?void 0:r.get("portData").id)!==m.id&&(p(),g(m))}},p=()=>{var m;if(r){const y=r==null?void 0:r.get("portData"),_=(m=e.getFeatures())==null?void 0:m.find(w=>w.get("portData").id===y.id);_&&(_.set("select",!1),_.setStyle(d(_)),r=null,o=null)}},g=m=>{if(!e)return;const y=e.getFeatures();o=m,r=y.find(_=>_.get("portData").id===m.id),r&&(r.set("select",!0),r.setStyle(d(r)))};return{render:s,clear:u,selected:f,handlePortHover:m=>{m&&m.get("portData")&&(t!=null&&t.getTargetElement())&&Vc(t,"pointer")}}},H7=(t,e,n,r,o,s,a)=>{const l=t.getInstall();l.on("moveend",()=>{var c,d;try{const u=t.getZoom();(d=(c=e.getProps()).mapMoveEnd)==null||d.call(c,u),n.reRenderTrackLine(),r.changeShipScale("end")}catch(u){console.log("moveend---catch",u)}}),l.on("pointermove",c=>{const d=l==null?void 0:l.getEventPixel(c.originalEvent);if(!d||!l)return;const u=l.getSize();if(!(d[0]<0||d[0]>u[0]||d[1]<0||d[1]>u[1]))try{const f=l==null?void 0:l.forEachFeatureAtPixel(d,p=>p);n==null||n.handleTrackMapEvent(f,"hover",c),r==null||r.handleShipMapEvent(f,"hover"),f&&(o==null||o.handlePortHover(f))}catch(f){console.log("pointermove---catch",f)}}),l.on("movestart",()=>{try{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=Mr.shipTriggleMin&&r.changeShipScale("start"),r.hiddenShipBlink()}catch(c){console.log("movestart---catch",c)}}),l.on("click",Nr(c=>{var d,u,f;if(a.getState()!=="open")try{if(console.log("1",s.getState()),s.getState())return;const p=l.getEventPixel(c.originalEvent),g=l.forEachFeatureAtPixel(p,h=>{if(h!=null&&h.get("shipData")||h!=null&&h.get("portData"))return h});if(g!=null&&g.get("shipData"))r.handleShipMapEvent(g,"click",(d=e.getProps())==null?void 0:d.selectShip);else if(g!=null&&g.get("portData")){const h=g.get("portData");o.selected(h),(f=(u=e.getProps())==null?void 0:u.selectPort)==null||f.call(u,h)}c.preventDefault(),c.stopPropagation()}catch(p){console.log("click---catch",p)}},150)),l.getView().on("change:resolution",Nr(()=>{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=Mr.shipTriggleMin&&r.changeSelectedScale("start")},10))},U7=()=>{const t=i.reactive([]);return{createInstance:(r,o)=>{const s=r7();s.initMap(r,o);const a=s.getInstall(),l=O7(a),c=N7();c.setProps(o),l.setShowLayerType(o.layerType),l.setGreenTileVisible(o.showGreenLayer);const d=w7(a),u=l7(a,d),f=I7(a),p=L7(a),g=Y7(a,c),h=W7(a,c),m=j7(a);H7(s,c,d,f,m,g,h);const y=()=>{const w=a.getView().calculateExtent(s.getSize()),C=Qi([w[0],w[1]],Yn.mercator,Yn.data),b=Qi([w[2],w[3]],Yn.mercator,Yn.data);return[C[0],C[1],b[0],b[1]]},_={id:Symbol("map-instance"),innerMap:null,map:s.getInstall(),destroy:()=>{t.splice(t.indexOf(_),1)},methods:{...s,layer:l,ship:f,track:d,carTrack:u,port:{render:m.render,clear:m.clear,selected:m.selected},position:p,drawLine:g,drawPolygon:h,utils:{getCalculateExtent:y,convertSixHundredThousandToLatLng:b0,calculateCirclePoints:i7}}};return t.push(_),_},destroyInstance:r=>{const o=t.findIndex(s=>s.id===r);o>-1&&(t[o].destroy(),t.splice(o,1))},destroyAll:()=>{t.forEach(r=>r.destroy()),t.splice(0,t.length)},getAllInstances:()=>[...t]}},K7={class:"zh-map-box"},X7=i.defineComponent({__name:"Map",props:{zoom:{default:Mr.default},center:{default:FG},layerType:{default:"vector"},showGreenLayer:{type:Boolean,default:!1},showScale:{type:Boolean,default:!0},scaleLineUnit:{default:"metric"},mapMoveEnd:{type:Function,default:()=>{}},lineDrawEnd:{},areaDrawEnd:{type:Function,default:()=>{}},selectShip:{type:Function,default:()=>{}},selectPort:{type:Function,default:()=>{}}},setup(t,{expose:e}){const n=i.ref(),r=i.ref(),o=U7(),s=i.ref(),a=t,l=i.ref({getInstall(){}});return i.onMounted(()=>{var c;s.value=o.createInstance(n.value,a),l.value=s.value.methods,(c=r.value)==null||c.setScaleLine(s.value.map,a.scaleLineUnit)}),i.onUnmounted(()=>{var c,d;o.destroyInstance((c=s==null?void 0:s.value)==null?void 0:c.id),(d=s.value)==null||d.destroy()}),e({getZoom:()=>{var c;return(c=s.value)==null?void 0:c.methods.getZoom()},setZoom:c=>{var d;return(d=s.value)==null?void 0:d.methods.setZoom(c)},getInstall:()=>{var c;return(c=s.value)==null?void 0:c.methods.getInstall()},getView:()=>{var c;return(c=s.value)==null?void 0:c.methods.getView()},setCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.setCenter(c,d)},getSize:()=>{var c;return(c=s.value)==null?void 0:c.methods.getSize()},getCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.getCenter()},layer:{setGreenTileVisible:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setGreenTileVisible(c)},getGreenTileVisible:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getGreenTileVisible()},getShowLayerType:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getShowLayerType()},setShowLayerType:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setShowLayerType(c)}},ship:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.selected(...c)},filter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.filter(...c)},blinking:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.blinking(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.ship.clear()}},track:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.render(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.remove(...c)},play:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.play(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.setCenter(...c)},close:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.close(...c)},getLength:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.getLength(...c)}},carTrack:{location:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.location(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.remove(...c)},renderTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.renderTrack(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.setCenter(...c)},closeTrack:()=>{var c;return(c=s.value)==null?void 0:c.methods.carTrack.closeTrack()},playTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.playTrack(...c)}},port:{render:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.port.render(c,d)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.port.clear()},selected:c=>{var d;return(d=s.value)==null?void 0:d.methods.port.selected(c)}},position:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.selected(...c)},clearSelected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.clearSelected(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.position.clear()}},drawLine:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.close()},deleteLine:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.deleteLine(c)},setUnit:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.setUnit(c)},getState:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.getState()}},drawPolygon:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.close()},reset:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.reset()}},utils:{getCalculateExtent:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.getCalculateExtent(...c)},convertSixHundredThousandToLatLng:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.convertSixHundredThousandToLatLng(...c)},calculateCirclePoints:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.utils.calculateCirclePoints(c,d)}}}),(c,d)=>(i.openBlock(),i.createElementBlock("div",K7,[i.createElementVNode("div",{id:"map",ref_key:"zhMapRef",ref:n,class:"zh-map"},null,512),i.createVNode(uG,{ref_key:"scaleLineRef",ref:r},null,512),i.createVNode(hG,{ref:"zoomControlRef","map-instance":s.value},null,8,["map-instance"])]))}}),H2=Dt(Ft(X7,[["__scopeId","data-v-1fa3c6fd"]]));var Z7={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
|
|
234
|
+
`,C=()=>`data:image/svg+xml;utf8,${encodeURIComponent(w(y?"#FF5733":"#3370FF"))}`,b=t.getView().getZoom(),E=m.get("portData"),S=window.devicePixelRatio||1,v=new Ct({image:new ao({src:C(),scale:.5*b/10}),zIndex:y?110:100}),k=new Ct({image:new ao({src:c(E.shortName,y),anchor:[.5,.5],displacement:[0,-26],scale:1/S,anchorXUnits:"fraction",anchorYUnits:"fraction"}),zIndex:y?110:100});return!_&&!y?v:[v,k]},u=()=>{if(e)if(r){console.log("清除非选中的港口");const m=r.get("portData").id;e.getFeatures().forEach(y=>{y.get("portData").id!==m&&e.removeFeature(y)})}else console.log("清除所有港口",e),e==null||e.clear()},f=m=>{if(e){if(!m)return p();(r==null?void 0:r.get("portData").id)!==m.id&&(p(),g(m))}},p=()=>{var m;if(r){const y=r==null?void 0:r.get("portData"),_=(m=e.getFeatures())==null?void 0:m.find(w=>w.get("portData").id===y.id);_&&(_.set("select",!1),_.setStyle(d(_)),r=null,o=null)}},g=m=>{if(!e)return;const y=e.getFeatures();o=m,r=y.find(_=>_.get("portData").id===m.id),r&&(r.set("select",!0),r.setStyle(d(r)))};return{render:s,clear:u,selected:f,handlePortHover:m=>{m&&m.get("portData")&&(t!=null&&t.getTargetElement())&&Vc(t,"pointer")}}},H7=(t,e,n,r,o,s,a)=>{const l=t.getInstall();l.on("moveend",()=>{var c,d;try{const u=t.getZoom();(d=(c=e.getProps()).mapMoveEnd)==null||d.call(c,u),n.reRenderTrackLine(),r.changeShipScale("end")}catch(u){console.log("moveend---catch",u)}}),l.on("pointermove",c=>{const d=l==null?void 0:l.getEventPixel(c.originalEvent);if(!d||!l)return;const u=l.getSize();if(d[0]<0||d[0]>u[0]||d[1]<0||d[1]>u[1])return;const f=l==null?void 0:l.forEachFeatureAtPixel(d,p=>p);try{n==null||n.handleTrackMapEvent(f,"hover",c),r==null||r.handleShipMapEvent(f,"hover"),f&&(o==null||o.handlePortHover(f))}catch(p){console.log("pointermove---catch",p)}}),l.on("movestart",()=>{try{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=Mr.shipTriggleMin&&r.changeShipScale("start"),r.hiddenShipBlink()}catch(c){console.log("movestart---catch",c)}}),l.on("click",Nr(c=>{var d,u,f;if(a.getState()!=="open")try{if(console.log("1",s.getState()),s.getState())return;const p=l.getEventPixel(c.originalEvent),g=l.forEachFeatureAtPixel(p,h=>{if(h!=null&&h.get("shipData")||h!=null&&h.get("portData"))return h});if(g!=null&&g.get("shipData"))r.handleShipMapEvent(g,"click",(d=e.getProps())==null?void 0:d.selectShip);else if(g!=null&&g.get("portData")){const h=g.get("portData");o.selected(h),(f=(u=e.getProps())==null?void 0:u.selectPort)==null||f.call(u,h)}c.preventDefault(),c.stopPropagation()}catch(p){console.log("click---catch",p)}},150)),l.getView().on("change:resolution",Nr(()=>{const c=l==null?void 0:l.getView().getZoom();c&&c<=Mr.shipModelMax&&c>=Mr.shipTriggleMin&&r.changeSelectedScale("start")},10))},U7=()=>{const t=i.reactive([]);return{createInstance:(r,o)=>{const s=r7();s.initMap(r,o);const a=s.getInstall(),l=O7(a),c=N7();c.setProps(o),l.setShowLayerType(o.layerType),l.setGreenTileVisible(o.showGreenLayer);const d=w7(a),u=l7(a,d),f=I7(a),p=L7(a),g=Y7(a,c),h=W7(a,c),m=j7(a);H7(s,c,d,f,m,g,h);const y=()=>{const w=a.getView().calculateExtent(s.getSize()),C=Qi([w[0],w[1]],Yn.mercator,Yn.data),b=Qi([w[2],w[3]],Yn.mercator,Yn.data);return[C[0],C[1],b[0],b[1]]},_={id:Symbol("map-instance"),innerMap:null,map:s.getInstall(),destroy:()=>{t.splice(t.indexOf(_),1)},methods:{...s,layer:l,ship:f,track:d,carTrack:u,port:{render:m.render,clear:m.clear,selected:m.selected},position:p,drawLine:g,drawPolygon:h,utils:{getCalculateExtent:y,convertSixHundredThousandToLatLng:b0,calculateCirclePoints:i7}}};return t.push(_),_},destroyInstance:r=>{const o=t.findIndex(s=>s.id===r);o>-1&&(t[o].destroy(),t.splice(o,1))},destroyAll:()=>{t.forEach(r=>r.destroy()),t.splice(0,t.length)},getAllInstances:()=>[...t]}},K7={class:"zh-map-box"},X7=i.defineComponent({__name:"Map",props:{zoom:{default:Mr.default},center:{default:FG},layerType:{default:"vector"},showGreenLayer:{type:Boolean,default:!1},showScale:{type:Boolean,default:!0},scaleLineUnit:{default:"metric"},mapMoveEnd:{type:Function,default:()=>{}},lineDrawEnd:{},areaDrawEnd:{type:Function,default:()=>{}},selectShip:{type:Function,default:()=>{}},selectPort:{type:Function,default:()=>{}}},setup(t,{expose:e}){const n=i.ref(),r=i.ref(),o=U7(),s=i.ref(),a=t,l=i.ref({getInstall(){}});return i.onMounted(()=>{var c;s.value=o.createInstance(n.value,a),l.value=s.value.methods,(c=r.value)==null||c.setScaleLine(s.value.map,a.scaleLineUnit)}),i.onUnmounted(()=>{var c,d;o.destroyInstance((c=s==null?void 0:s.value)==null?void 0:c.id),(d=s.value)==null||d.destroy()}),e({getZoom:()=>{var c;return(c=s.value)==null?void 0:c.methods.getZoom()},setZoom:c=>{var d;return(d=s.value)==null?void 0:d.methods.setZoom(c)},getInstall:()=>{var c;return(c=s.value)==null?void 0:c.methods.getInstall()},getView:()=>{var c;return(c=s.value)==null?void 0:c.methods.getView()},setCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.setCenter(c,d)},getSize:()=>{var c;return(c=s.value)==null?void 0:c.methods.getSize()},getCenter:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.getCenter()},layer:{setGreenTileVisible:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setGreenTileVisible(c)},getGreenTileVisible:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getGreenTileVisible()},getShowLayerType:()=>{var c;return(c=s.value)==null?void 0:c.methods.layer.getShowLayerType()},setShowLayerType:c=>{var d;return(d=s.value)==null?void 0:d.methods.layer.setShowLayerType(c)}},ship:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.selected(...c)},filter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.filter(...c)},blinking:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.ship.blinking(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.ship.clear()}},track:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.render(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.remove(...c)},play:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.play(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.setCenter(...c)},close:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.close(...c)},getLength:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.track.getLength(...c)}},carTrack:{location:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.location(...c)},remove:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.remove(...c)},renderTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.renderTrack(...c)},setCenter:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.setCenter(...c)},closeTrack:()=>{var c;return(c=s.value)==null?void 0:c.methods.carTrack.closeTrack()},playTrack:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.carTrack.playTrack(...c)}},port:{render:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.port.render(c,d)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.port.clear()},selected:c=>{var d;return(d=s.value)==null?void 0:d.methods.port.selected(c)}},position:{render:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.render(...c)},selected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.selected(...c)},clearSelected:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.position.clearSelected(...c)},clear:()=>{var c;return(c=s.value)==null?void 0:c.methods.position.clear()}},drawLine:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.close()},deleteLine:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.deleteLine(c)},setUnit:c=>{var d;return(d=s.value)==null?void 0:d.methods.drawLine.setUnit(c)},getState:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawLine.getState()}},drawPolygon:{open:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.open()},close:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.close()},reset:()=>{var c;return(c=s.value)==null?void 0:c.methods.drawPolygon.reset()}},utils:{getCalculateExtent:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.getCalculateExtent(...c)},convertSixHundredThousandToLatLng:(...c)=>{var d;return(d=s.value)==null?void 0:d.methods.utils.convertSixHundredThousandToLatLng(...c)},calculateCirclePoints:(c,d)=>{var u;return(u=s.value)==null?void 0:u.methods.utils.calculateCirclePoints(c,d)}}}),(c,d)=>(i.openBlock(),i.createElementBlock("div",K7,[i.createElementVNode("div",{id:"map",ref_key:"zhMapRef",ref:n,class:"zh-map"},null,512),i.createVNode(uG,{ref_key:"scaleLineRef",ref:r},null,512),i.createVNode(hG,{ref:"zoomControlRef","map-instance":s.value},null,8,["map-instance"])]))}}),H2=Dt(Ft(X7,[["__scopeId","data-v-1fa3c6fd"]]));var Z7={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
|
|
235
235
|
* Sortable 1.15.6
|
|
236
236
|
* @author RubaXa <trash@rubaxa.org>
|
|
237
237
|
* @author owenm <owen23355@gmail.com>
|