zhihao-ui 1.3.42-alpha.4 → 1.3.42-alpha.6
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.
|
@@ -73,26 +73,26 @@ const Kt = { id: "scale-line-container" }, _t = /* @__PURE__ */ je({
|
|
|
73
73
|
var fe = ((e) => (e.vectorTile = `https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Ve}`, e.vectorTileMark = `https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Ve}`, e.satelliteImgTile = `https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Ve}`, e.satelliteImgTileMark = `https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Ve}`, e.greenTile = `${gt}/map/tile/{z}/{x}/{y}.png`, e))(fe || {}), ke = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(ke || {});
|
|
74
74
|
function ro() {
|
|
75
75
|
const e = oe(), n = () => e.value, s = () => n().getView(), l = () => {
|
|
76
|
-
var
|
|
77
|
-
return (
|
|
78
|
-
}, i = (
|
|
79
|
-
var
|
|
80
|
-
(
|
|
81
|
-
}, o = (
|
|
76
|
+
var p;
|
|
77
|
+
return (p = s()) == null ? void 0 : p.getZoom();
|
|
78
|
+
}, i = (p) => {
|
|
79
|
+
var T;
|
|
80
|
+
(T = s()) == null || T.setZoom(p);
|
|
81
|
+
}, o = (p, T) => {
|
|
82
82
|
var z;
|
|
83
|
-
(z = s()) == null || z.setCenter(ee([
|
|
83
|
+
(z = s()) == null || z.setCenter(ee([p, T]));
|
|
84
84
|
}, f = () => {
|
|
85
|
-
var
|
|
86
|
-
const
|
|
87
|
-
return At(
|
|
88
|
-
},
|
|
89
|
-
var
|
|
90
|
-
return (
|
|
91
|
-
}, t = new rt(), r = (
|
|
92
|
-
g(
|
|
85
|
+
var T;
|
|
86
|
+
const p = (T = s()) == null ? void 0 : T.getCenter();
|
|
87
|
+
return At(p);
|
|
88
|
+
}, w = () => {
|
|
89
|
+
var p;
|
|
90
|
+
return (p = n()) == null ? void 0 : p.getSize();
|
|
91
|
+
}, t = new rt(), r = (p, T) => {
|
|
92
|
+
g(T);
|
|
93
93
|
const z = {
|
|
94
|
-
zoom:
|
|
95
|
-
center: ee(
|
|
94
|
+
zoom: T.zoom,
|
|
95
|
+
center: ee(T.center),
|
|
96
96
|
minZoom: re.min,
|
|
97
97
|
maxZoom: re.max,
|
|
98
98
|
constrainResolution: !0,
|
|
@@ -100,7 +100,7 @@ function ro() {
|
|
|
100
100
|
multiWorld: !0
|
|
101
101
|
};
|
|
102
102
|
let M = {
|
|
103
|
-
target:
|
|
103
|
+
target: p,
|
|
104
104
|
controls: Dt({
|
|
105
105
|
zoom: !1
|
|
106
106
|
}),
|
|
@@ -112,36 +112,36 @@ function ro() {
|
|
|
112
112
|
],
|
|
113
113
|
view: new Zt(z)
|
|
114
114
|
};
|
|
115
|
-
const
|
|
116
|
-
e.value =
|
|
117
|
-
}, g = (
|
|
115
|
+
const x = new rt(M);
|
|
116
|
+
e.value = x;
|
|
117
|
+
}, g = (p) => {
|
|
118
118
|
t.set("vectorTile", new we({
|
|
119
119
|
source: new xe({ url: fe.vectorTile }),
|
|
120
|
-
visible:
|
|
120
|
+
visible: p.layerType === "vector",
|
|
121
121
|
zIndex: 0,
|
|
122
122
|
preload: 1,
|
|
123
123
|
className: "vector"
|
|
124
124
|
})), t.set("vectorTileMark", new we({
|
|
125
125
|
source: new xe({ url: fe.vectorTileMark }),
|
|
126
|
-
visible:
|
|
126
|
+
visible: p.layerType === "vector",
|
|
127
127
|
zIndex: 1,
|
|
128
128
|
preload: 1,
|
|
129
129
|
className: "vector"
|
|
130
130
|
})), t.set("satelliteImgTile", new we({
|
|
131
131
|
source: new xe({ url: fe.satelliteImgTile }),
|
|
132
|
-
visible:
|
|
132
|
+
visible: p.layerType === "satellite",
|
|
133
133
|
zIndex: 0,
|
|
134
134
|
preload: 1,
|
|
135
135
|
className: "satellite"
|
|
136
136
|
})), t.set("satelliteImgTileMark", new we({
|
|
137
137
|
source: new xe({ url: fe.satelliteImgTileMark }),
|
|
138
|
-
visible:
|
|
138
|
+
visible: p.layerType === "satellite",
|
|
139
139
|
zIndex: 1,
|
|
140
140
|
preload: 1,
|
|
141
141
|
className: "satellite"
|
|
142
142
|
})), t.set("greenMark", new we({
|
|
143
143
|
source: new xe({ url: fe.greenTile }),
|
|
144
|
-
visible:
|
|
144
|
+
visible: p.showGreenLayer,
|
|
145
145
|
zIndex: 2,
|
|
146
146
|
className: "greenTile"
|
|
147
147
|
}));
|
|
@@ -153,7 +153,7 @@ function ro() {
|
|
|
153
153
|
setZoom: i,
|
|
154
154
|
setCenter: o,
|
|
155
155
|
getCenter: f,
|
|
156
|
-
getSize:
|
|
156
|
+
getSize: w,
|
|
157
157
|
initMap: r,
|
|
158
158
|
setBaseLayerMap: g
|
|
159
159
|
};
|
|
@@ -225,12 +225,12 @@ const st = (e) => {
|
|
|
225
225
|
let s = null;
|
|
226
226
|
const l = async (g) => {
|
|
227
227
|
if (!e || (console.log("vehicleInfo", g), !(g != null && g.lon && (g != null && g.lat)))) return;
|
|
228
|
-
const
|
|
229
|
-
i(g, ee(
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
}, i = (g,
|
|
233
|
-
const
|
|
228
|
+
const p = Math.abs(Number(g.lon)) > 180 ? Ue(g.lon, g.lat) : [g.lon, g.lat];
|
|
229
|
+
i(g, ee(p));
|
|
230
|
+
const T = e == null ? void 0 : e.getView(), z = new ce(p);
|
|
231
|
+
T.setCenter(Me(z.getCoordinates(), _.data, _.mercator));
|
|
232
|
+
}, i = (g, p) => {
|
|
233
|
+
const T = `${gt}map/car-icon.gif`;
|
|
234
234
|
s || (s = new de({
|
|
235
235
|
element: document.createElement("div"),
|
|
236
236
|
positioning: "center-center",
|
|
@@ -238,9 +238,9 @@ 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(${T})`, z.style.width = "80px", z.style.height = "80px";
|
|
242
242
|
const M = (g == null ? void 0 : g.drc) || "";
|
|
243
|
-
z.style.transform = `rotate(${M}deg)`, z.style.backgroundSize = "cover", s == null || s.setPosition(
|
|
243
|
+
z.style.transform = `rotate(${M}deg)`, z.style.backgroundSize = "cover", s == null || s.setPosition(p);
|
|
244
244
|
};
|
|
245
245
|
return {
|
|
246
246
|
location: l,
|
|
@@ -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,
|
|
252
|
-
n.render(g,
|
|
251
|
+
renderTrack: (g, p, T) => {
|
|
252
|
+
n.render(g, p, T, "truck", 1e3);
|
|
253
253
|
},
|
|
254
254
|
setCenter: (g) => {
|
|
255
255
|
n.setCenter(g);
|
|
@@ -257,8 +257,8 @@ const st = (e) => {
|
|
|
257
257
|
closeTrack: () => {
|
|
258
258
|
n.close();
|
|
259
259
|
},
|
|
260
|
-
playTrack: (g,
|
|
261
|
-
n.play(g,
|
|
260
|
+
playTrack: (g, p) => {
|
|
261
|
+
n.play(g, p);
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
264
|
};
|
|
@@ -268,17 +268,17 @@ const ao = (e) => {
|
|
|
268
268
|
let l = null;
|
|
269
269
|
const i = "--";
|
|
270
270
|
let o = null;
|
|
271
|
-
const f = document.createElement("div"),
|
|
271
|
+
const f = document.createElement("div"), w = new de({
|
|
272
272
|
element: f,
|
|
273
273
|
positioning: "top-left",
|
|
274
274
|
className: "track-label-popup"
|
|
275
275
|
});
|
|
276
|
-
let t, r, g,
|
|
276
|
+
let t, r, g, p, T, z = !1, M = Date.now(), x, y = 0, b = null, E = 20;
|
|
277
277
|
const L = 8, D = [], W = (c) => {
|
|
278
278
|
var d;
|
|
279
279
|
for (D.unshift(c); D.length > L; ) {
|
|
280
|
-
const h = D.pop(),
|
|
281
|
-
|
|
280
|
+
const h = D.pop(), k = n.get(h);
|
|
281
|
+
k && ((d = k.getSource()) == null || d.clear(), e == null || e.removeLayer(k), n.delete(h), delete s[h]);
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
284
|
let A = "";
|
|
@@ -290,20 +290,20 @@ const ao = (e) => {
|
|
|
290
290
|
}
|
|
291
291
|
}, 300), F = (c, d) => {
|
|
292
292
|
let h = [];
|
|
293
|
-
const
|
|
294
|
-
return h = d.filter((S, Z) => Z %
|
|
293
|
+
const k = Math.max(1, Math.floor(d.length / E));
|
|
294
|
+
return h = d.filter((S, Z) => Z % k === 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);
|
|
297
297
|
S.lon = O, S.lat = Y;
|
|
298
298
|
}
|
|
299
299
|
return S.center = [S.lon, S.lat], S.centerPoint = so(S.center), S.time = dt(S.createdAt).format("YYYY-MM-DD HH:mm:ss"), S.id = c, S.index = Z, S;
|
|
300
300
|
}), h;
|
|
301
|
-
}, C = async (c, d, h,
|
|
302
|
-
if (!e || JSON.stringify(s[c]) === JSON.stringify(d) && l === c || (d = d == null ? void 0 : d.reverse(),
|
|
301
|
+
}, C = async (c, d, h, k = "ship", P = 200) => {
|
|
302
|
+
if (!e || JSON.stringify(s[c]) === JSON.stringify(d) && l === c || (d = d == null ? void 0 : d.reverse(), w && k === "ship" && (e != null && e.getOverlays().getArray().includes(w) || e.addOverlay(w)), (d == null ? void 0 : d.length) < 2))
|
|
303
303
|
return;
|
|
304
|
-
W(c), l = c, s[c] = d,
|
|
304
|
+
W(c), l = c, s[c] = d, E = P;
|
|
305
305
|
const S = Object.keys(s).findIndex((Z) => Z === c) || 0;
|
|
306
|
-
A = h || H[S > 10 ? 10 : S], await
|
|
306
|
+
A = h || H[S > 10 ? 10 : S], await v(), await et(l);
|
|
307
307
|
}, $ = (c) => {
|
|
308
308
|
const d = new ge();
|
|
309
309
|
return new ye({
|
|
@@ -317,10 +317,10 @@ const ao = (e) => {
|
|
|
317
317
|
}, a = (c) => {
|
|
318
318
|
n.forEach((d, h) => {
|
|
319
319
|
var P;
|
|
320
|
-
const
|
|
321
|
-
d.getVisible() !==
|
|
320
|
+
const k = h === c;
|
|
321
|
+
d.getVisible() !== k && (d.setVisible(k), e.getLayers().getArray().includes(d) || e.addLayer(d), k || (P = d.getSource()) == null || P.clear());
|
|
322
322
|
}), l = c;
|
|
323
|
-
},
|
|
323
|
+
}, v = async () => {
|
|
324
324
|
const c = l;
|
|
325
325
|
if (!n.has(c)) {
|
|
326
326
|
const S = $(c);
|
|
@@ -329,35 +329,35 @@ const ao = (e) => {
|
|
|
329
329
|
await a(c);
|
|
330
330
|
const d = A || "", h = s[c] || [];
|
|
331
331
|
if (!(h && h.length > 1)) return [];
|
|
332
|
-
let
|
|
333
|
-
|
|
334
|
-
const P =
|
|
335
|
-
|
|
332
|
+
let k = [];
|
|
333
|
+
k = F(c, h);
|
|
334
|
+
const P = k.map((S) => S.centerPoint);
|
|
335
|
+
k.length >= 2 && await u(c, P, d);
|
|
336
336
|
}, u = (c, d, h) => {
|
|
337
|
-
const
|
|
337
|
+
const k = new ze(d), P = n.get(c).getSource(), S = P.getFeatureById(c);
|
|
338
338
|
if (S)
|
|
339
|
-
S.setGeometry(
|
|
339
|
+
S.setGeometry(k), S.setId(c), S.setStyle(m(h)), b = S;
|
|
340
340
|
else {
|
|
341
|
-
const Z = new ae({ geometry:
|
|
342
|
-
Z.setId(c), Z.set("type", "line"), Z.setStyle(
|
|
341
|
+
const Z = new ae({ geometry: k });
|
|
342
|
+
Z.setId(c), Z.set("type", "line"), Z.setStyle(m(h)), P.addFeature(Z), b = Z;
|
|
343
343
|
}
|
|
344
|
-
return
|
|
345
|
-
},
|
|
344
|
+
return b;
|
|
345
|
+
}, m = (c) => new Q({
|
|
346
346
|
stroke: new ve({
|
|
347
347
|
color: c,
|
|
348
348
|
width: 2
|
|
349
349
|
})
|
|
350
350
|
}), V = (c, d, h) => {
|
|
351
351
|
try {
|
|
352
|
-
const
|
|
353
|
-
if (console.log("trackId-data",
|
|
354
|
-
e.getTargetElement().style.cursor =
|
|
355
|
-
const P = G(
|
|
356
|
-
S && (f.querySelector(".popup-content"), f.innerHTML = P,
|
|
352
|
+
const k = c == null ? void 0 : c.get("data");
|
|
353
|
+
if (console.log("trackId-data", k), c && k && d === "hover") {
|
|
354
|
+
e.getTargetElement().style.cursor = k ? "pointer" : "";
|
|
355
|
+
const P = G(k), S = h == null ? void 0 : h.coordinate;
|
|
356
|
+
S && (f.querySelector(".popup-content"), f.innerHTML = P, w == null || w.setPosition(S));
|
|
357
357
|
} else
|
|
358
|
-
|
|
359
|
-
} catch (
|
|
360
|
-
console.error("handleTrackMapEvent",
|
|
358
|
+
w && w.setPosition(void 0);
|
|
359
|
+
} catch (k) {
|
|
360
|
+
console.error("handleTrackMapEvent", k);
|
|
361
361
|
}
|
|
362
362
|
}, G = (c) => {
|
|
363
363
|
if (!(c != null && c.time)) return;
|
|
@@ -410,11 +410,11 @@ const ao = (e) => {
|
|
|
410
410
|
// 先初始化,后续计算
|
|
411
411
|
};
|
|
412
412
|
});
|
|
413
|
-
let
|
|
413
|
+
let k = 0;
|
|
414
414
|
h[0].distance = 0;
|
|
415
415
|
for (let O = 1; O < h.length; O++) {
|
|
416
416
|
const Y = h[O - 1].pixel, X = h[O].pixel, U = X[0] - Y[0], N = X[1] - Y[1];
|
|
417
|
-
|
|
417
|
+
k += Math.sqrt(U * U + N * N), h[O].distance = k;
|
|
418
418
|
}
|
|
419
419
|
const P = h.filter(
|
|
420
420
|
(O, Y) => Y === 0 || Y === h.length - 1
|
|
@@ -449,11 +449,11 @@ const ao = (e) => {
|
|
|
449
449
|
};
|
|
450
450
|
function J(c, d) {
|
|
451
451
|
for (let h = 1; h < c.length; h++) {
|
|
452
|
-
const
|
|
453
|
-
if (d >=
|
|
454
|
-
const S = (d -
|
|
452
|
+
const k = c[h - 1], P = c[h];
|
|
453
|
+
if (d >= k.distance && d <= P.distance) {
|
|
454
|
+
const S = (d - k.distance) / (P.distance - k.distance), Z = k.pixel[0] + S * (P.pixel[0] - k.pixel[0]), O = k.pixel[1] + S * (P.pixel[1] - k.pixel[1]), Y = e == null ? void 0 : e.getCoordinateFromPixel([Z, O]);
|
|
455
455
|
return {
|
|
456
|
-
...
|
|
456
|
+
...k,
|
|
457
457
|
// 继承前一个点的属性(可调整)
|
|
458
458
|
coord: Y,
|
|
459
459
|
pixel: [Z, O],
|
|
@@ -467,8 +467,8 @@ const ao = (e) => {
|
|
|
467
467
|
}
|
|
468
468
|
const R = async (c, d) => {
|
|
469
469
|
await se(), await Ae(c);
|
|
470
|
-
const h = B(d),
|
|
471
|
-
n.get(c).getSource().addFeatures(
|
|
470
|
+
const h = B(d), k = h.map((S) => ue(S));
|
|
471
|
+
n.get(c).getSource().addFeatures(k), wt(c, h, d, A), h.forEach((S) => {
|
|
472
472
|
const Z = le(c, A, S);
|
|
473
473
|
e.addOverlay(Z);
|
|
474
474
|
});
|
|
@@ -483,8 +483,8 @@ const ao = (e) => {
|
|
|
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) => {
|
|
486
|
-
const
|
|
487
|
-
|
|
486
|
+
const k = document.createElement("div");
|
|
487
|
+
k.className = "track-overlay-label", k.style.position = "relative", k.style.backgroundColor = "rgba(255,255,255,0.8)", k.style.border = `1px solid ${d}`, k.style.fontSize = "12px", k.innerHTML = `
|
|
488
488
|
<span>${h.time}</span>
|
|
489
489
|
<svg
|
|
490
490
|
style="position: absolute;right: -20px;top: 0;"
|
|
@@ -498,7 +498,7 @@ const ao = (e) => {
|
|
|
498
498
|
stroke-width="1" />
|
|
499
499
|
`;
|
|
500
500
|
const P = new de({
|
|
501
|
-
element:
|
|
501
|
+
element: k,
|
|
502
502
|
position: ee(h.center),
|
|
503
503
|
positioning: "top-right",
|
|
504
504
|
offset: [-20, -20],
|
|
@@ -534,10 +534,10 @@ const ao = (e) => {
|
|
|
534
534
|
})
|
|
535
535
|
// textStyle,
|
|
536
536
|
], Te = (c) => {
|
|
537
|
-
const d = "#E31818", h = "#1890FF",
|
|
537
|
+
const d = "#E31818", h = "#1890FF", k = "", P = new Q({
|
|
538
538
|
text: new be({
|
|
539
539
|
font: "Normal 22px map-iconfont",
|
|
540
|
-
text: he(
|
|
540
|
+
text: he(k),
|
|
541
541
|
offsetY: -10,
|
|
542
542
|
fill: new te({
|
|
543
543
|
color: Number(c.state) === 0 ? d : Number(c.state) === 1 ? h : ""
|
|
@@ -546,7 +546,7 @@ const ao = (e) => {
|
|
|
546
546
|
zIndex: 99
|
|
547
547
|
}), Z = st(""), Y = st(""), X = [];
|
|
548
548
|
return Number(c.state) === 0 ? X.push(Z) : Number(c.state) === 1 && X.push(Y), X.push(P), X;
|
|
549
|
-
}, wt = (c, d, h,
|
|
549
|
+
}, wt = (c, d, h, k) => {
|
|
550
550
|
const P = d || [], S = d.length;
|
|
551
551
|
S || (P.push(h[0]), P.push(h[h.length - 1]));
|
|
552
552
|
const Z = [];
|
|
@@ -571,7 +571,7 @@ const ao = (e) => {
|
|
|
571
571
|
text: new be({
|
|
572
572
|
font: "700 12px map-iconfont",
|
|
573
573
|
text: he(""),
|
|
574
|
-
fill: new te({ color:
|
|
574
|
+
fill: new te({ color: k }),
|
|
575
575
|
// 设置箭头旋转 角度转为弧度
|
|
576
576
|
rotation: tt(
|
|
577
577
|
d[Y].center,
|
|
@@ -586,9 +586,9 @@ const ao = (e) => {
|
|
|
586
586
|
O == null || O.addFeatures(Z);
|
|
587
587
|
}, et = (c) => {
|
|
588
588
|
var S, Z;
|
|
589
|
-
const d = e.getView(), h = (S = n == null ? void 0 : n.get(c)) == null ? void 0 : S.getSource(),
|
|
590
|
-
if (!
|
|
591
|
-
const P = (Z =
|
|
589
|
+
const d = e.getView(), h = (S = n == null ? void 0 : n.get(c)) == null ? void 0 : S.getSource(), k = b || (c ? h == null ? void 0 : h.getFeatureById(c) : null);
|
|
590
|
+
if (!k) return;
|
|
591
|
+
const P = (Z = k == null ? void 0 : k.getGeometry()) == null ? void 0 : Z.getExtent();
|
|
592
592
|
if (P != null && P.length)
|
|
593
593
|
try {
|
|
594
594
|
const O = Wt(P, Math.max(P[2] - P[0], P[3] - P[1]) * 0.02);
|
|
@@ -617,9 +617,9 @@ const ao = (e) => {
|
|
|
617
617
|
const d = n.get(c || l);
|
|
618
618
|
d == null || d.setVisible(!1);
|
|
619
619
|
const h = e.getOverlays().getArray();
|
|
620
|
-
for (let
|
|
621
|
-
const P = h[
|
|
622
|
-
P.get("class") === "track-label-overlay" ? (P.setPosition(void 0), e.removeOverlay(P)) :
|
|
620
|
+
for (let k = 0; k < h.length; ) {
|
|
621
|
+
const P = h[k];
|
|
622
|
+
P.get("class") === "track-label-overlay" ? (P.setPosition(void 0), e.removeOverlay(P)) : k++;
|
|
623
623
|
}
|
|
624
624
|
Fe();
|
|
625
625
|
}, pt = (c, d = ke.NM) => {
|
|
@@ -633,8 +633,8 @@ const ao = (e) => {
|
|
|
633
633
|
}, Mt = (c, d) => {
|
|
634
634
|
Ct(String(c), d);
|
|
635
635
|
}, Ct = (c, d) => {
|
|
636
|
-
const h = s[String(c)],
|
|
637
|
-
|
|
636
|
+
const h = s[String(c)], k = h == null ? void 0 : h.map((P) => [P.lon, P.lat]);
|
|
637
|
+
k && Tt(k, d);
|
|
638
638
|
}, Ge = new Q({
|
|
639
639
|
text: new be({
|
|
640
640
|
font: "700 20px map-iconfont",
|
|
@@ -645,29 +645,29 @@ const ao = (e) => {
|
|
|
645
645
|
})
|
|
646
646
|
}), Lt = (c, d) => {
|
|
647
647
|
var N, q;
|
|
648
|
-
const h = Number(50 * d),
|
|
649
|
-
if (
|
|
648
|
+
const h = Number(50 * d), k = ((N = c.frameState) == null ? void 0 : N.time) ?? Date.now(), P = k - M;
|
|
649
|
+
if (y = (y + h * P / 1e6) % 2, M = k, y >= 1) {
|
|
650
650
|
Fe();
|
|
651
651
|
return;
|
|
652
652
|
}
|
|
653
653
|
const S = r.getCoordinateAt(
|
|
654
|
-
|
|
654
|
+
y > 1 ? 2 - y : y
|
|
655
655
|
), Z = r.getCoordinateAt(
|
|
656
|
-
|
|
656
|
+
y > 1 ? y - 0.01 : y
|
|
657
657
|
), O = r.getCoordinateAt(
|
|
658
|
-
|
|
658
|
+
y > 1 ? 2 - y : y + 0.01
|
|
659
659
|
), X = tt(
|
|
660
660
|
it(Z, "array"),
|
|
661
661
|
it(O, "array")
|
|
662
662
|
) * Math.PI / 180;
|
|
663
|
-
(q = Ge.getText()) == null || q.setRotation(X),
|
|
663
|
+
(q = Ge.getText()) == null || q.setRotation(X), p.setCoordinates(S);
|
|
664
664
|
const U = Bt(c);
|
|
665
|
-
U.setStyle(Ge), U.drawGeometry(
|
|
665
|
+
U.setStyle(Ge), U.drawGeometry(p), e == null || e.render();
|
|
666
666
|
}, Et = () => {
|
|
667
667
|
var c;
|
|
668
|
-
z = !0, M = Date.now(),
|
|
668
|
+
z = !0, M = Date.now(), y = 0, p = ((c = g.getGeometry()) == null ? void 0 : c.clone()) || new ce([0, 0]), o && (x == null || x.on("postrender", o)), T == null || T.setGeometry(void 0);
|
|
669
669
|
}, Fe = () => {
|
|
670
|
-
z && (z = !1,
|
|
670
|
+
z && (z = !1, T == null || T.setGeometry(void 0), o && x && x.un("postrender", o), x && (e == null || e.removeLayer(x)), x = null, T = null);
|
|
671
671
|
}, Tt = (c, d) => {
|
|
672
672
|
z && Fe(), t = new nt({
|
|
673
673
|
factor: 1e6
|
|
@@ -681,17 +681,17 @@ const ao = (e) => {
|
|
|
681
681
|
geometry: new ce(r.getFirstCoordinate())
|
|
682
682
|
});
|
|
683
683
|
const h = g.getGeometry();
|
|
684
|
-
|
|
684
|
+
p = h ? h.clone() : new ce([0, 0]), T = new ae({
|
|
685
685
|
type: "geoMarker",
|
|
686
686
|
style: Ge,
|
|
687
|
-
geometry:
|
|
688
|
-
}),
|
|
687
|
+
geometry: p
|
|
688
|
+
}), x = new ye({
|
|
689
689
|
source: new ge({
|
|
690
|
-
features: [
|
|
690
|
+
features: [T]
|
|
691
691
|
})
|
|
692
|
-
}), e == null || e.addLayer(
|
|
692
|
+
}), e == null || e.addLayer(x), o = (k) => Lt(k, d), Et();
|
|
693
693
|
}, tt = (c, d, h) => {
|
|
694
|
-
function
|
|
694
|
+
function k(N) {
|
|
695
695
|
return 180 * (N % (2 * Math.PI)) / Math.PI;
|
|
696
696
|
}
|
|
697
697
|
function P(N) {
|
|
@@ -717,7 +717,7 @@ const ao = (e) => {
|
|
|
717
717
|
return (Z(Nt, St) + 180) % 360;
|
|
718
718
|
}(N, q);
|
|
719
719
|
const I = S(N), Pe = S(q), Se = P(I[0]), Ne = P(Pe[0]), ot = P(I[1]), We = P(Pe[1]), Ft = Math.sin(Ne - Se) * Math.cos(We), Pt = Math.cos(ot) * Math.sin(We) - Math.sin(ot) * Math.cos(We) * Math.cos(Ne - Se);
|
|
720
|
-
return
|
|
720
|
+
return k(Math.atan2(Ft, Pt));
|
|
721
721
|
}
|
|
722
722
|
function O(N) {
|
|
723
723
|
return !isNaN(N) && N !== null && !Array.isArray(N);
|
|
@@ -875,18 +875,18 @@ const go = (e) => {
|
|
|
875
875
|
return n <= re.shipModelMax && n >= re.shipTriggleMin ? "ship" : "triangle";
|
|
876
876
|
}, Ie = (e, n, s) => {
|
|
877
877
|
if (s === "ship") {
|
|
878
|
-
const { len: l, wid: i } = n, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), r = l * t / o, g = i * t / f,
|
|
879
|
-
return
|
|
878
|
+
const { len: l, wid: i } = n, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), r = l * t / o, g = i * t / f, p = Math.min(r, g);
|
|
879
|
+
return p < 0.2 ? 0.2 : p > 2 ? 2 : p;
|
|
880
880
|
}
|
|
881
881
|
return re.scaleNum;
|
|
882
882
|
}, fo = (e, n, s) => {
|
|
883
|
-
const { color: l, direct: i, isHighlight: o, shipData: f } = e.getProperties(),
|
|
883
|
+
const { color: l, direct: i, isHighlight: o, shipData: f } = e.getProperties(), w = ((f == null ? void 0 : f.cog) - 90 + 360) % 360;
|
|
884
884
|
return new Q({
|
|
885
885
|
image: new Ce({
|
|
886
886
|
src: t(),
|
|
887
887
|
scale: n || re.scaleNum,
|
|
888
888
|
anchor: [0.5, 0.5],
|
|
889
|
-
rotation:
|
|
889
|
+
rotation: w * Math.PI / 180,
|
|
890
890
|
rotateWithView: !1
|
|
891
891
|
})
|
|
892
892
|
});
|
|
@@ -959,7 +959,7 @@ const yo = (e, n) => {
|
|
|
959
959
|
}, yt = (e) => {
|
|
960
960
|
const n = document.createElement("div");
|
|
961
961
|
n.className = "ship-overlay-box", n.style.position = "relative";
|
|
962
|
-
const { lon: s, lat: l, blinking: i, blinkingColors: o, name: f } = e,
|
|
962
|
+
const { lon: s, lat: l, blinking: i, blinkingColors: o, name: f } = e, w = He({
|
|
963
963
|
setup() {
|
|
964
964
|
return uo({
|
|
965
965
|
position: [s + 2e-3, l + 2e-3],
|
|
@@ -972,7 +972,7 @@ const yo = (e, n) => {
|
|
|
972
972
|
});
|
|
973
973
|
}
|
|
974
974
|
});
|
|
975
|
-
return $t(
|
|
975
|
+
return $t(w, n), n;
|
|
976
976
|
}, ct = (e) => {
|
|
977
977
|
const n = [];
|
|
978
978
|
return e.existDevice && n.push(""), e.existMobile && n.push(""), e.existWaterGauge && n.push(""), n;
|
|
@@ -1007,13 +1007,13 @@ 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
|
|
1011
|
-
f.font =
|
|
1010
|
+
const w = 2, t = 8, r = 16, g = window.devicePixelRatio || 1, p = "500 12px Arial", T = "14px map-iconfont";
|
|
1011
|
+
f.font = p;
|
|
1012
1012
|
const M = f.measureText(e).width;
|
|
1013
|
-
f.font =
|
|
1014
|
-
const
|
|
1013
|
+
f.font = T;
|
|
1014
|
+
const x = n.map((m) => ({ width: f.measureText(he(m)).width, height: 14 })), y = x.reduce((m, V) => m + V.width, 0), b = (n.length - 1) * l, E = t + M + y + b + t, L = w + 14 + w;
|
|
1015
1015
|
let D, W, A = 0, H = 0, j = 0, F = 0, C = 0, $ = 0;
|
|
1016
|
-
switch (D = r +
|
|
1016
|
+
switch (D = r + E, 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;
|
|
@@ -1024,53 +1024,53 @@ function xo(e, n, s = "left-bottom", l = 2) {
|
|
|
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
|
-
W = r + L, A =
|
|
1027
|
+
W = r + L, A = E, H = r, j = E + r, F = L + r, C = 0, $ = 0;
|
|
1028
1028
|
break;
|
|
1029
1029
|
case "left-middle":
|
|
1030
|
-
W = L, A =
|
|
1030
|
+
W = L, A = E, H = L / 2, j = E + r, F = L / 2, C = 0, $ = 0;
|
|
1031
1031
|
break;
|
|
1032
1032
|
case "left-bottom":
|
|
1033
|
-
W = r + L, A =
|
|
1033
|
+
W = r + L, A = E, H = L, j = E + r, F = 0, C = 0, $ = r;
|
|
1034
1034
|
break;
|
|
1035
1035
|
}
|
|
1036
|
-
W = W +
|
|
1037
|
-
const a = $ +
|
|
1038
|
-
f.strokeStyle = "#ffffff", f.lineWidth = 1, f.strokeText(e, C + t, a), f.fillStyle = "#000000", f.fillText(e, C + t, a), f.font =
|
|
1039
|
-
let
|
|
1040
|
-
n.length > 0 && n.forEach((
|
|
1041
|
-
const G = $ +
|
|
1042
|
-
f.fillText(he(
|
|
1036
|
+
W = W + w, 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, $, E, L), f.font = p, f.textBaseline = "middle";
|
|
1037
|
+
const a = $ + w + 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 = T, f.fillStyle = "#3370ff";
|
|
1039
|
+
let v = C + t + M + l;
|
|
1040
|
+
n.length > 0 && n.forEach((m, V) => {
|
|
1041
|
+
const G = $ + w + L / 2;
|
|
1042
|
+
f.fillText(he(m), v, G), v += x[V].width + l;
|
|
1043
1043
|
});
|
|
1044
1044
|
const u = o.toDataURL("image/png");
|
|
1045
1045
|
return Ye.set(i, u), u;
|
|
1046
1046
|
}
|
|
1047
1047
|
const at = (e, n) => {
|
|
1048
1048
|
const { name: s, rightIcons: l, selected: i } = e.getProperties(), o = n !== 1 ? mo() : "right-top", f = xo(s, l, o);
|
|
1049
|
-
let
|
|
1049
|
+
let w = [0, 0];
|
|
1050
1050
|
switch (o) {
|
|
1051
1051
|
case "right-top":
|
|
1052
|
-
|
|
1052
|
+
w = [0, 1];
|
|
1053
1053
|
break;
|
|
1054
1054
|
case "right-middle":
|
|
1055
|
-
|
|
1055
|
+
w = [0, 0.5];
|
|
1056
1056
|
break;
|
|
1057
1057
|
case "right-bottom":
|
|
1058
|
-
|
|
1058
|
+
w = [0, 0];
|
|
1059
1059
|
break;
|
|
1060
1060
|
case "left-top":
|
|
1061
|
-
|
|
1061
|
+
w = [1, 1];
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "left-middle":
|
|
1064
|
-
|
|
1064
|
+
w = [1, 0.5];
|
|
1065
1065
|
break;
|
|
1066
1066
|
case "left-bottom":
|
|
1067
|
-
|
|
1067
|
+
w = [1, 0];
|
|
1068
1068
|
break;
|
|
1069
1069
|
}
|
|
1070
1070
|
return new Q({
|
|
1071
1071
|
image: new Ce({
|
|
1072
1072
|
src: f,
|
|
1073
|
-
anchor:
|
|
1073
|
+
anchor: w,
|
|
1074
1074
|
displacement: [0, 0],
|
|
1075
1075
|
scale: 1 / wo,
|
|
1076
1076
|
anchorXUnits: "fraction",
|
|
@@ -1099,24 +1099,24 @@ const at = (e, n) => {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
});
|
|
1101
1101
|
e == null || e.addLayer(i), e == null || e.addLayer(f);
|
|
1102
|
-
let
|
|
1103
|
-
const
|
|
1102
|
+
let w = null, t = "", r = {}, g = {};
|
|
1103
|
+
const p = (a) => {
|
|
1104
1104
|
if (!a || !e) return;
|
|
1105
|
-
const
|
|
1105
|
+
const v = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id"));
|
|
1106
1106
|
if (s) {
|
|
1107
|
-
const u = a.filter((
|
|
1107
|
+
const u = a.filter((m) => m.id === v);
|
|
1108
1108
|
u.length === 0 ? a.push(s) : s = u[0];
|
|
1109
1109
|
}
|
|
1110
|
-
|
|
1111
|
-
},
|
|
1110
|
+
y(), $(a), z(), D();
|
|
1111
|
+
}, T = (a) => {
|
|
1112
1112
|
var R;
|
|
1113
|
-
const
|
|
1113
|
+
const v = (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]), m = ((R = g[a.id]) == null ? void 0 : R.blinkColors) || [], G = m[m.length - 1] || a.fill || "#04C900", B = go(a), J = new ae({
|
|
1114
1114
|
geometry: new ce(u),
|
|
1115
1115
|
// 船舶数据
|
|
1116
1116
|
shipData: a,
|
|
1117
1117
|
id: a.id,
|
|
1118
1118
|
name: a.cnname || a.enname || a.name || a.id || "未命名船舶",
|
|
1119
|
-
selected: a.id ===
|
|
1119
|
+
selected: a.id === v,
|
|
1120
1120
|
// 图标
|
|
1121
1121
|
rightIcons: ct(a),
|
|
1122
1122
|
// 船舶颜色
|
|
@@ -1129,56 +1129,56 @@ const at = (e, n) => {
|
|
|
1129
1129
|
return J.set("clickGeometry", new Ht(u)), J;
|
|
1130
1130
|
}, z = async () => {
|
|
1131
1131
|
if (!s || !e) return;
|
|
1132
|
-
let
|
|
1133
|
-
if (
|
|
1132
|
+
let v = e.getOverlays().getArray().find((u) => u.get("class") == "ship-overlay-selected");
|
|
1133
|
+
if (v) {
|
|
1134
1134
|
const u = vt(e, s);
|
|
1135
|
-
await
|
|
1135
|
+
await v.setElement(u), await v.setPosition(ee([s.lon, s.lat]));
|
|
1136
1136
|
} else
|
|
1137
|
-
|
|
1137
|
+
v = ho(e, s), v && e.addOverlay(v);
|
|
1138
1138
|
setTimeout(() => {
|
|
1139
1139
|
var u;
|
|
1140
|
-
|
|
1140
|
+
v && ((u = v.get("element")) != null && u.parentElement) && (v.get("element").parentElement.style.display = "block");
|
|
1141
1141
|
}, 20);
|
|
1142
1142
|
}, M = (a) => {
|
|
1143
1143
|
if (a === "start") {
|
|
1144
|
-
const
|
|
1144
|
+
const v = () => {
|
|
1145
1145
|
l.getFeatures().forEach((u) => {
|
|
1146
1146
|
u.setStyle(me(e, u));
|
|
1147
|
-
}),
|
|
1147
|
+
}), w = requestAnimationFrame(v);
|
|
1148
1148
|
};
|
|
1149
|
-
|
|
1149
|
+
v();
|
|
1150
1150
|
}
|
|
1151
|
-
a === "end" &&
|
|
1152
|
-
},
|
|
1153
|
-
const
|
|
1154
|
-
if (
|
|
1155
|
-
const u =
|
|
1156
|
-
console.log(V), V && (V.style.transform = `scale(${
|
|
1151
|
+
a === "end" && w && (cancelAnimationFrame(w), w = null);
|
|
1152
|
+
}, x = () => {
|
|
1153
|
+
const v = (e == null ? void 0 : e.getOverlays().getArray()).find((u) => u.get("class") == "ship-overlay-selected");
|
|
1154
|
+
if (v) {
|
|
1155
|
+
const u = v.getElement(), m = Ie(e, s, "ship"), V = u.querySelector("svg");
|
|
1156
|
+
console.log(V), V && (V.style.transform = `scale(${m})`);
|
|
1157
1157
|
}
|
|
1158
|
-
},
|
|
1159
|
-
e && l && (
|
|
1160
|
-
},
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
for (let u = 0; u <
|
|
1164
|
-
if (
|
|
1165
|
-
const
|
|
1166
|
-
console.log("overlay---",
|
|
1158
|
+
}, y = () => {
|
|
1159
|
+
e && l && (b(), l.clear(), o.clear(), M("end"));
|
|
1160
|
+
}, b = (a) => {
|
|
1161
|
+
const v = e.getOverlays().getArray().filter((u) => u.get("class") == "zh-map-ship-overlay");
|
|
1162
|
+
if (v && v.length > 0) {
|
|
1163
|
+
for (let u = 0; u < v.length; u++)
|
|
1164
|
+
if (v[u].get("class") !== "ship-overlay-selected") {
|
|
1165
|
+
const m = v[u];
|
|
1166
|
+
console.log("overlay---", m), m.setPosition(void 0), e.removeOverlay(m), m.dispose();
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
|
-
},
|
|
1170
|
-
r = a, g =
|
|
1171
|
-
const u = e.getOverlays().getArray(),
|
|
1169
|
+
}, E = (a, v) => {
|
|
1170
|
+
r = a, g = v;
|
|
1171
|
+
const u = e.getOverlays().getArray(), m = l.getFeatures();
|
|
1172
1172
|
for (const V in r) {
|
|
1173
|
-
const G = r[V], B = u.find((R) => R.getId() === "label-" + V), J =
|
|
1173
|
+
const G = r[V], B = u.find((R) => R.getId() === "label-" + V), J = m.find((R) => V === R.get("id"));
|
|
1174
1174
|
if (B && J) {
|
|
1175
|
-
const R =
|
|
1175
|
+
const R = v[V].blinkColors || [], { shipData: ue, name: le, color: se } = J.getProperties();
|
|
1176
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
1179
|
blinking: G,
|
|
1180
1180
|
blinkingColors: R || [],
|
|
1181
|
-
name: le + "(" +
|
|
1181
|
+
name: le + "(" + v[V].shipState + ")"
|
|
1182
1182
|
}, Ee = B.getElement(), Te = yt(Ae);
|
|
1183
1183
|
Ee && Ee !== Te && B.setElement(Te);
|
|
1184
1184
|
}
|
|
@@ -1186,26 +1186,26 @@ const at = (e, n) => {
|
|
|
1186
1186
|
}, L = () => {
|
|
1187
1187
|
const a = e.getOverlays().getArray();
|
|
1188
1188
|
if (r)
|
|
1189
|
-
for (const
|
|
1190
|
-
const u = a.find((
|
|
1189
|
+
for (const v in r) {
|
|
1190
|
+
const u = a.find((m) => m.getId() === "label-" + v);
|
|
1191
1191
|
if (u) {
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1192
|
+
const m = u.getElement();
|
|
1193
|
+
m && (m.style.opacity = 0);
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
1196
|
}, D = () => {
|
|
1197
1197
|
const a = e.getOverlays().getArray();
|
|
1198
1198
|
if (r)
|
|
1199
|
-
for (const
|
|
1200
|
-
const u = a.find((
|
|
1199
|
+
for (const v in r) {
|
|
1200
|
+
const u = a.find((m) => m.getId() === "label-" + v);
|
|
1201
1201
|
if (u) {
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1202
|
+
const m = u.getElement();
|
|
1203
|
+
m && (m.style.opacity = 1);
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
}, W = (a) => {
|
|
1207
1207
|
if (!e) return;
|
|
1208
|
-
const
|
|
1208
|
+
const v = l.getFeatures(), u = o.getFeatures(), m = n ? n.get("id") : "", V = v.filter((R) => R.get("id") !== m), G = u == null ? void 0 : u.filter((R) => R.get("id") !== m), B = /* @__PURE__ */ new Map();
|
|
1209
1209
|
a.forEach((R) => {
|
|
1210
1210
|
B.set(R.id, !0);
|
|
1211
1211
|
});
|
|
@@ -1232,36 +1232,36 @@ const at = (e, n) => {
|
|
|
1232
1232
|
}, A = (a) => {
|
|
1233
1233
|
if (a) {
|
|
1234
1234
|
console.log("选中", a);
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1235
|
+
const v = l.getFeatures().find((m) => m.get("id") === a.id), u = o.getFeatures().find((m) => m.get("id") === a.id);
|
|
1236
|
+
v && (n = v), u && u.set("selected", !0), s = a, z();
|
|
1237
1237
|
} else
|
|
1238
1238
|
console.log("取消选中"), s = null, n = null, F();
|
|
1239
|
-
}, H = Re((a,
|
|
1239
|
+
}, H = Re((a, v, u) => {
|
|
1240
1240
|
try {
|
|
1241
1241
|
if (a) {
|
|
1242
|
-
const
|
|
1243
|
-
if (e.getTargetElement().style.cursor = V ? "pointer" : "",
|
|
1242
|
+
const m = a.get("shipData"), V = a.get("id");
|
|
1243
|
+
if (e.getTargetElement().style.cursor = V ? "pointer" : "", v === "click" && (A(m), u && u(V)), v === "hover") {
|
|
1244
1244
|
t && t !== V && j(), t = V;
|
|
1245
1245
|
const G = l.getFeatures().find((B) => B.get("id") === t);
|
|
1246
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();
|
|
1250
|
-
} catch (
|
|
1251
|
-
console.log("handleShipMapEvent",
|
|
1250
|
+
} catch (m) {
|
|
1251
|
+
console.log("handleShipMapEvent", m);
|
|
1252
1252
|
}
|
|
1253
1253
|
}, 10), j = () => {
|
|
1254
|
-
const a = t ? l.getFeatures().find((
|
|
1254
|
+
const a = t ? l.getFeatures().find((v) => v.get("id") === t) : null;
|
|
1255
1255
|
t = null, a == null || a.set("isHighlight", !1), a == null || a.setStyle(me(e, a));
|
|
1256
1256
|
}, F = () => {
|
|
1257
1257
|
try {
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1258
|
+
const v = e.getOverlays().getArray().find((u) => u.get("class") == "ship-overlay-selected");
|
|
1259
|
+
v && v.setPosition(void 0);
|
|
1260
1260
|
} catch (a) {
|
|
1261
1261
|
console.log(a);
|
|
1262
1262
|
}
|
|
1263
|
-
}, C = (a,
|
|
1264
|
-
const u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]),
|
|
1263
|
+
}, C = (a, v) => {
|
|
1264
|
+
const u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), m = new ae({
|
|
1265
1265
|
geometry: new ce(u),
|
|
1266
1266
|
name: a.cnname || a.enname || a.name || a.id || "未命名船舶",
|
|
1267
1267
|
// 图标
|
|
@@ -1269,14 +1269,14 @@ const at = (e, n) => {
|
|
|
1269
1269
|
selected: (a == null ? void 0 : a.id) === (s == null ? void 0 : s.id),
|
|
1270
1270
|
shipData: a
|
|
1271
1271
|
});
|
|
1272
|
-
|
|
1273
|
-
const V = at(
|
|
1274
|
-
return
|
|
1272
|
+
m.set("id", a.id);
|
|
1273
|
+
const V = at(m, v);
|
|
1274
|
+
return m.setStyle(V), m;
|
|
1275
1275
|
}, $ = (a) => {
|
|
1276
|
-
const
|
|
1276
|
+
const v = e.getView().getZoom();
|
|
1277
1277
|
a.forEach((u) => {
|
|
1278
|
-
const
|
|
1279
|
-
if (
|
|
1278
|
+
const m = T(u);
|
|
1279
|
+
if (m.setStyle(me(e, m)), l.addFeature(m), (s == null ? void 0 : s.id) == u.id || v >= re.shipModelMin)
|
|
1280
1280
|
if (r[u.id]) {
|
|
1281
1281
|
if (u.id && g[u == null ? void 0 : u.id]) {
|
|
1282
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 = {
|
|
@@ -1294,14 +1294,14 @@ const at = (e, n) => {
|
|
|
1294
1294
|
});
|
|
1295
1295
|
};
|
|
1296
1296
|
return {
|
|
1297
|
-
render:
|
|
1297
|
+
render: p,
|
|
1298
1298
|
selected: A,
|
|
1299
1299
|
filter: W,
|
|
1300
|
-
blinking:
|
|
1301
|
-
clear:
|
|
1300
|
+
blinking: E,
|
|
1301
|
+
clear: y,
|
|
1302
1302
|
handleShipMapEvent: H,
|
|
1303
1303
|
changeShipScale: M,
|
|
1304
|
-
changeSelectedScale:
|
|
1304
|
+
changeSelectedScale: x,
|
|
1305
1305
|
hiddenShipBlink: L,
|
|
1306
1306
|
showShipBlink: D
|
|
1307
1307
|
};
|
|
@@ -1320,17 +1320,17 @@ const at = (e, n) => {
|
|
|
1320
1320
|
if (t !== o.value) {
|
|
1321
1321
|
if (t) {
|
|
1322
1322
|
const r = n();
|
|
1323
|
-
if (!r.getArray().find((
|
|
1324
|
-
const
|
|
1323
|
+
if (!r.getArray().find((p) => p.className_ === "greenTile")) {
|
|
1324
|
+
const p = new we({
|
|
1325
1325
|
source: new xe({ url: fe.greenTile }),
|
|
1326
1326
|
visible: t,
|
|
1327
1327
|
zIndex: 2,
|
|
1328
1328
|
className: "greenTile"
|
|
1329
1329
|
});
|
|
1330
|
-
r.push(
|
|
1330
|
+
r.push(p);
|
|
1331
1331
|
}
|
|
1332
1332
|
} else {
|
|
1333
|
-
const r = n(), g = r.getArray().find((
|
|
1333
|
+
const r = n(), g = r.getArray().find((p) => p.className_ === "greenTile");
|
|
1334
1334
|
g && r.remove(g);
|
|
1335
1335
|
}
|
|
1336
1336
|
o.value = t;
|
|
@@ -1353,30 +1353,30 @@ const at = (e, n) => {
|
|
|
1353
1353
|
const f = (M) => {
|
|
1354
1354
|
if (!(!M || M.length === 0)) {
|
|
1355
1355
|
if (l || (l = new ge()), l.clear(), o) {
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1356
|
+
const x = M.find((y) => y.id === o.id);
|
|
1357
|
+
x ? o = x : M.push(o);
|
|
1358
1358
|
}
|
|
1359
|
-
M.forEach((
|
|
1360
|
-
|
|
1359
|
+
M.forEach((x) => {
|
|
1360
|
+
w(x);
|
|
1361
1361
|
}), s || (s = new ye({
|
|
1362
1362
|
className: n,
|
|
1363
1363
|
source: l,
|
|
1364
1364
|
zIndex: 100
|
|
1365
1365
|
}), e == null || e.addLayer(s));
|
|
1366
1366
|
}
|
|
1367
|
-
},
|
|
1368
|
-
const
|
|
1369
|
-
geometry: new ce(ee([Number(
|
|
1367
|
+
}, w = (M) => {
|
|
1368
|
+
const x = e == null ? void 0 : e.getView().getZoom(), [y, b] = M.latLon.split(","), E = new ae({
|
|
1369
|
+
geometry: new ce(ee([Number(y), Number(b)]))
|
|
1370
1370
|
});
|
|
1371
|
-
|
|
1372
|
-
}, t = (M,
|
|
1373
|
-
const
|
|
1371
|
+
E.setStyle(t(M, x, M.id === (o == null ? void 0 : o.id))), E.set("loactionData", M), l.addFeature(E);
|
|
1372
|
+
}, t = (M, x, y) => {
|
|
1373
|
+
const b = {
|
|
1374
1374
|
image: new Ce({
|
|
1375
|
-
src:
|
|
1376
|
-
scale: 0.5 *
|
|
1375
|
+
src: y && M.selectedPath || M.defaultPath,
|
|
1376
|
+
scale: 0.5 * x / 10
|
|
1377
1377
|
})
|
|
1378
1378
|
};
|
|
1379
|
-
return M.name && (
|
|
1379
|
+
return M.name && (b.text = new be({
|
|
1380
1380
|
text: M.name,
|
|
1381
1381
|
font: "12px sans-serif",
|
|
1382
1382
|
fill: new te({
|
|
@@ -1386,36 +1386,36 @@ const at = (e, n) => {
|
|
|
1386
1386
|
color: "#FFFFFF"
|
|
1387
1387
|
}),
|
|
1388
1388
|
offsetY: 30
|
|
1389
|
-
})), new Q(
|
|
1389
|
+
})), new Q(b);
|
|
1390
1390
|
}, r = () => {
|
|
1391
1391
|
if (i) {
|
|
1392
1392
|
const M = i.get("loactionData").id;
|
|
1393
|
-
l.getFeatures().forEach((
|
|
1394
|
-
|
|
1393
|
+
l.getFeatures().forEach((x) => {
|
|
1394
|
+
x.get("loactionData").id !== M && l.removeFeature(x);
|
|
1395
1395
|
});
|
|
1396
1396
|
} else
|
|
1397
1397
|
l.clear();
|
|
1398
1398
|
}, g = () => {
|
|
1399
|
-
var
|
|
1400
|
-
const M = i.get("loactionData"),
|
|
1401
|
-
l.getFeatures().forEach((
|
|
1402
|
-
|
|
1399
|
+
var b;
|
|
1400
|
+
const M = i.get("loactionData"), x = (b = e == null ? void 0 : e.getView()) == null ? void 0 : b.getZoom();
|
|
1401
|
+
l.getFeatures().forEach((E) => {
|
|
1402
|
+
E.get("loactionData").id === M.id && (E == null || E.setStyle(t(M, x, !1)));
|
|
1403
1403
|
}), o = null, i = null;
|
|
1404
|
-
},
|
|
1405
|
-
M ? (
|
|
1406
|
-
},
|
|
1404
|
+
}, p = (M) => {
|
|
1405
|
+
M ? (T(), z(M)) : clearSelectedPort();
|
|
1406
|
+
}, T = () => {
|
|
1407
1407
|
var M;
|
|
1408
1408
|
if (i) {
|
|
1409
|
-
const
|
|
1410
|
-
i.setStyle(t(
|
|
1409
|
+
const x = i.get("loactionData"), y = (M = e == null ? void 0 : e.getView()) == null ? void 0 : M.getZoom();
|
|
1410
|
+
i.setStyle(t(x, y, !1));
|
|
1411
1411
|
}
|
|
1412
1412
|
}, z = (M) => {
|
|
1413
|
-
const
|
|
1414
|
-
o = M, i =
|
|
1413
|
+
const x = l.getFeatures();
|
|
1414
|
+
o = M, i = x.find((y) => y.get("loactionData").id === M.id);
|
|
1415
1415
|
};
|
|
1416
1416
|
return {
|
|
1417
1417
|
render: f,
|
|
1418
|
-
selected:
|
|
1418
|
+
selected: p,
|
|
1419
1419
|
clearSelected: g,
|
|
1420
1420
|
clear: r
|
|
1421
1421
|
};
|
|
@@ -1435,10 +1435,10 @@ const at = (e, n) => {
|
|
|
1435
1435
|
l.value = F;
|
|
1436
1436
|
};
|
|
1437
1437
|
let o;
|
|
1438
|
-
const f = oe(!1),
|
|
1438
|
+
const f = oe(!1), w = () => {
|
|
1439
1439
|
Le(e, "crosshair"), g(), Co(e), e.on("pointermove", z), e.getViewport().addEventListener("mouseout", () => {
|
|
1440
1440
|
o && o.classList.add("hidden");
|
|
1441
|
-
}),
|
|
1441
|
+
}), x(), f.value = !0;
|
|
1442
1442
|
};
|
|
1443
1443
|
let t, r;
|
|
1444
1444
|
const g = () => {
|
|
@@ -1454,15 +1454,15 @@ const at = (e, n) => {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
}), e == null || e.addLayer(r);
|
|
1456
1456
|
};
|
|
1457
|
-
let
|
|
1457
|
+
let p, T;
|
|
1458
1458
|
const z = (F) => {
|
|
1459
1459
|
if (F.dragging)
|
|
1460
1460
|
return;
|
|
1461
1461
|
let C = "点击选择起点";
|
|
1462
|
-
|
|
1462
|
+
p && (C = "单击继续,双击结束"), o && (o.innerHTML = C, T.setPosition(F.coordinate), o.classList.remove("hidden"));
|
|
1463
1463
|
};
|
|
1464
1464
|
let M;
|
|
1465
|
-
const
|
|
1465
|
+
const x = () => {
|
|
1466
1466
|
M = new Oe({
|
|
1467
1467
|
source: t,
|
|
1468
1468
|
type: "LineString",
|
|
@@ -1491,60 +1491,60 @@ const at = (e, n) => {
|
|
|
1491
1491
|
let F;
|
|
1492
1492
|
M.on("drawstart", function(C) {
|
|
1493
1493
|
var a;
|
|
1494
|
-
|
|
1494
|
+
p = C.feature, p.set("randomId", y());
|
|
1495
1495
|
let $;
|
|
1496
|
-
F = (a =
|
|
1497
|
-
const u =
|
|
1498
|
-
$ = u.getLastCoordinate(),
|
|
1496
|
+
F = (a = p.getGeometry()) == null ? void 0 : a.on("change", function(v) {
|
|
1497
|
+
const u = v.target, m = mt(u, l.value);
|
|
1498
|
+
$ = u.getLastCoordinate(), b && m && (b.innerHTML = m), E.setPosition($);
|
|
1499
1499
|
});
|
|
1500
1500
|
}), M.on("drawend", function() {
|
|
1501
1501
|
var C, $, a;
|
|
1502
|
-
if (
|
|
1503
|
-
const
|
|
1504
|
-
s.value.push({ id:
|
|
1502
|
+
if (b && (b.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), b != null && b.innerHTML) {
|
|
1503
|
+
const v = (p == null ? void 0 : p.get("randomId")) || y();
|
|
1504
|
+
s.value.push({ id: v, value: b == null ? void 0 : b.innerHTML }), b.innerHTML = `${b.innerHTML}<div class="ol-tooltip-delete-button" data-id="${v}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
1505
1505
|
}
|
|
1506
|
-
(C = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || C.addEventListener("click", (
|
|
1507
|
-
var
|
|
1508
|
-
|
|
1509
|
-
const u = (
|
|
1506
|
+
(C = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || C.addEventListener("click", (v) => {
|
|
1507
|
+
var m;
|
|
1508
|
+
v.preventDefault(), v.stopPropagation();
|
|
1509
|
+
const u = (m = v.target) == null ? void 0 : m.getAttribute("data-id");
|
|
1510
1510
|
u && A(u);
|
|
1511
|
-
}),
|
|
1511
|
+
}), E.setOffset([0, -7]), p = null, b = null, L(), F && Xe(F), (a = ($ = n.getProps()) == null ? void 0 : $.lineDrawEnd) == null || a.call($, s.value);
|
|
1512
1512
|
});
|
|
1513
|
-
},
|
|
1514
|
-
let
|
|
1513
|
+
}, y = () => Math.random().toString(36).substring(2, 9);
|
|
1514
|
+
let b, E;
|
|
1515
1515
|
const L = () => {
|
|
1516
|
-
|
|
1517
|
-
element:
|
|
1516
|
+
b != null && b.parentNode && b.parentNode.removeChild(b), b = document.createElement("div"), b.className = "ol-tooltip ol-tooltip-measure", E = new de({
|
|
1517
|
+
element: b,
|
|
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(E);
|
|
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", T = new de({
|
|
1525
1525
|
element: o,
|
|
1526
1526
|
offset: [15, 0],
|
|
1527
1527
|
positioning: "center-left"
|
|
1528
|
-
}), e == null || e.addOverlay(
|
|
1528
|
+
}), e == null || e.addOverlay(T);
|
|
1529
1529
|
}, W = () => {
|
|
1530
1530
|
s.value.forEach((F, C) => {
|
|
1531
|
-
var
|
|
1531
|
+
var v, u;
|
|
1532
1532
|
const $ = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1533
|
-
$[C] && ((u = (
|
|
1533
|
+
$[C] && ((u = (v = $[C]) == null ? void 0 : v.parentNode) == null || u.removeChild($[C]));
|
|
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
|
-
var $, a,
|
|
1539
|
-
const C = s.value.findIndex((
|
|
1538
|
+
var $, a, v, u;
|
|
1539
|
+
const C = s.value.findIndex((m) => m.id === F);
|
|
1540
1540
|
if (C !== -1) {
|
|
1541
1541
|
s.value.splice(C, 1);
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1542
|
+
const m = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1543
|
+
m[C] && ((a = ($ = m[C]) == null ? void 0 : $.parentNode) == null || a.removeChild(m[C]));
|
|
1544
1544
|
const V = t.getFeatures();
|
|
1545
1545
|
V[C] && t.removeFeature(V[C]);
|
|
1546
1546
|
}
|
|
1547
|
-
(u = (
|
|
1547
|
+
(u = (v = n.getProps()) == null ? void 0 : v.lineDrawEnd) == null || u.call(v, s.value);
|
|
1548
1548
|
}, H = () => {
|
|
1549
1549
|
if (s.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((F) => {
|
|
1550
1550
|
var C;
|
|
@@ -1553,10 +1553,10 @@ const at = (e, n) => {
|
|
|
1553
1553
|
const F = e.getInteractions().getArray().find((C) => lt(C) === lt(M));
|
|
1554
1554
|
F && e.removeInteraction(F);
|
|
1555
1555
|
}
|
|
1556
|
-
e.removeLayer(r), o != null && o.parentNode && o.parentNode.removeChild(o),
|
|
1556
|
+
e.removeLayer(r), o != null && o.parentNode && o.parentNode.removeChild(o), b != null && b.parentNode && b.parentNode.removeChild(b);
|
|
1557
1557
|
};
|
|
1558
1558
|
return {
|
|
1559
|
-
open:
|
|
1559
|
+
open: w,
|
|
1560
1560
|
close: W,
|
|
1561
1561
|
deleteLine: A,
|
|
1562
1562
|
setUnit: i,
|
|
@@ -1582,11 +1582,11 @@ const at = (e, n) => {
|
|
|
1582
1582
|
const o = () => {
|
|
1583
1583
|
H(), i = "open", f(), Le(e, "crosshair");
|
|
1584
1584
|
}, f = () => {
|
|
1585
|
-
r(),
|
|
1585
|
+
r(), E(), W(), M();
|
|
1586
1586
|
};
|
|
1587
|
-
let
|
|
1587
|
+
let w = null, t = null;
|
|
1588
1588
|
const r = () => {
|
|
1589
|
-
if (
|
|
1589
|
+
if (w && t) return;
|
|
1590
1590
|
const F = new ge(), C = new ye({
|
|
1591
1591
|
source: F,
|
|
1592
1592
|
style: new Q({
|
|
@@ -1597,43 +1597,43 @@ const at = (e, n) => {
|
|
|
1597
1597
|
}),
|
|
1598
1598
|
zIndex: 1e3
|
|
1599
1599
|
});
|
|
1600
|
-
|
|
1601
|
-
|
|
1600
|
+
w = C, t = F, e.on("pointermove", p), e.addLayer(C), e.on(["dblclick"], function($) {
|
|
1601
|
+
T && ($.stopPropagation(), $.preventDefault());
|
|
1602
1602
|
});
|
|
1603
1603
|
};
|
|
1604
1604
|
let g;
|
|
1605
|
-
const
|
|
1605
|
+
const p = (F) => {
|
|
1606
1606
|
if (F.dragging) return;
|
|
1607
1607
|
const C = g ? "单击继续,双击结束" : "点击选择起点";
|
|
1608
1608
|
L && (L.innerHTML = C, D.setPosition(F.coordinate));
|
|
1609
1609
|
};
|
|
1610
|
-
let
|
|
1610
|
+
let T, z = !1;
|
|
1611
1611
|
const M = () => {
|
|
1612
1612
|
if (s) {
|
|
1613
1613
|
L != null && L.parentNode && L.parentNode.removeChild(L);
|
|
1614
1614
|
const F = s.getGeometry();
|
|
1615
1615
|
if (!F) return;
|
|
1616
|
-
const C =
|
|
1617
|
-
|
|
1616
|
+
const C = x(F, "nm");
|
|
1617
|
+
y && (y.innerHTML = `
|
|
1618
1618
|
<span class="text">面积:${C}${z ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1619
|
-
`),
|
|
1619
|
+
`), y && (y.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
|
|
1620
1620
|
const $ = F.getCoordinates(), a = $[0][$[0].length - 2];
|
|
1621
|
-
if (
|
|
1622
|
-
const u =
|
|
1621
|
+
if (b.setPosition(a), w) {
|
|
1622
|
+
const u = w.getSource();
|
|
1623
1623
|
u && s && (u.clear(), u.addFeature(s));
|
|
1624
1624
|
}
|
|
1625
1625
|
setTimeout(() => {
|
|
1626
1626
|
var u;
|
|
1627
1627
|
(u = document.querySelector(".delete-icon")) == null || u.addEventListener("click", () => {
|
|
1628
|
-
var
|
|
1629
|
-
console.log("delete"), A(), (V = (
|
|
1628
|
+
var m, V;
|
|
1629
|
+
console.log("delete"), A(), (V = (m = n.getProps()) == null ? void 0 : m.areaDrawEnd) == null || V.call(m, []);
|
|
1630
1630
|
});
|
|
1631
1631
|
}, 0);
|
|
1632
|
-
const
|
|
1633
|
-
e == null || e.getView().setCenter(
|
|
1632
|
+
const v = jt(s.getGeometry().getExtent());
|
|
1633
|
+
e == null || e.getView().setCenter(v);
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
|
-
|
|
1636
|
+
T = new Oe({
|
|
1637
1637
|
type: "Polygon",
|
|
1638
1638
|
source: t,
|
|
1639
1639
|
trace: !0,
|
|
@@ -1658,23 +1658,23 @@ const at = (e, n) => {
|
|
|
1658
1658
|
return new Qt(C);
|
|
1659
1659
|
}
|
|
1660
1660
|
})]
|
|
1661
|
-
}), e == null || e.addInteraction(
|
|
1661
|
+
}), e == null || e.addInteraction(T), T.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,
|
|
1665
|
-
if (z = Number(Ke(V) / 1e3) > 150, !
|
|
1664
|
+
const a = $.target, v = x(a, "nm"), m = a.getCoordinates()[0], V = new ze([m[m.length - 2], m[m.length - 1]]), G = mt(V, "nm");
|
|
1665
|
+
if (z = Number(Ke(V) / 1e3) > 150, !v) return;
|
|
1666
1666
|
const B = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1667
|
-
|
|
1667
|
+
y && (y.innerHTML = `
|
|
1668
1668
|
<div class="text">
|
|
1669
|
-
面积:${
|
|
1669
|
+
面积:${v}
|
|
1670
1670
|
${z ? B : ""}
|
|
1671
1671
|
</div>
|
|
1672
1672
|
`), L && (L.innerHTML = `
|
|
1673
1673
|
<div class="text">
|
|
1674
|
-
面积:${
|
|
1674
|
+
面积:${v}
|
|
1675
1675
|
</div>
|
|
1676
1676
|
<div class="text ${z ? "error" : ""}">
|
|
1677
|
-
线段 ${
|
|
1677
|
+
线段 ${m.length - 2}: ${G}
|
|
1678
1678
|
${z ? B : ""}
|
|
1679
1679
|
|
|
1680
1680
|
</div>
|
|
@@ -1683,23 +1683,23 @@ const at = (e, n) => {
|
|
|
1683
1683
|
</div>
|
|
1684
1684
|
`);
|
|
1685
1685
|
});
|
|
1686
|
-
}),
|
|
1687
|
-
var
|
|
1686
|
+
}), T.on("drawend", (F) => {
|
|
1687
|
+
var v, u, m, V;
|
|
1688
1688
|
if (!F.feature.getGeometry()) return;
|
|
1689
|
-
|
|
1689
|
+
y && !s && (y.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), s = F.feature, b.setOffset([10, 0]);
|
|
1690
1690
|
const $ = F.feature.getGeometry().getCoordinates(), a = $[0][$[0].length - 2];
|
|
1691
|
-
if (
|
|
1691
|
+
if (b.setPosition(a), L != null && L.parentNode && L.parentNode.removeChild(L), (v = n.getProps()) != null && v.areaDrawEnd) {
|
|
1692
1692
|
const G = $[0].map((B) => Me(B, _.mercator, _.data));
|
|
1693
|
-
(
|
|
1693
|
+
(m = (u = n.getProps()) == null ? void 0 : u.areaDrawEnd) == null || m.call(u, G);
|
|
1694
1694
|
}
|
|
1695
|
-
|
|
1695
|
+
T && (T.setActive(!1), e == null || e.removeInteraction(T), (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
1698
|
var G, B;
|
|
1699
1699
|
A(), (B = (G = n.getProps()) == null ? void 0 : G.areaDrawEnd) == null || B.call(G, []);
|
|
1700
1700
|
});
|
|
1701
1701
|
});
|
|
1702
|
-
},
|
|
1702
|
+
}, x = (F, C) => {
|
|
1703
1703
|
const $ = Xt(F);
|
|
1704
1704
|
switch (C) {
|
|
1705
1705
|
case "km":
|
|
@@ -1708,15 +1708,15 @@ const at = (e, n) => {
|
|
|
1708
1708
|
return $ > 1e4 ? Math.round($ / 1e6 / Math.pow(1.852, 2) * 100) / 100 + " nm<sup>2</sup>" : Math.round($ * 100) / 100 + " m<sup>2</sup>";
|
|
1709
1709
|
}
|
|
1710
1710
|
};
|
|
1711
|
-
let
|
|
1712
|
-
const
|
|
1713
|
-
|
|
1714
|
-
element:
|
|
1711
|
+
let y, b;
|
|
1712
|
+
const E = () => {
|
|
1713
|
+
y != null && y.parentNode && y.parentNode.removeChild(y), y = document.createElement("div"), y.style.display = "flex", y.className = "ol-tooltip ol-tooltip-draw-polygon", b = new de({
|
|
1714
|
+
element: y,
|
|
1715
1715
|
offset: [0, -15],
|
|
1716
1716
|
positioning: "bottom-center",
|
|
1717
1717
|
stopEvent: !1,
|
|
1718
1718
|
insertFirst: !1
|
|
1719
|
-
}), e == null || e.addOverlay(
|
|
1719
|
+
}), e == null || e.addOverlay(b);
|
|
1720
1720
|
};
|
|
1721
1721
|
let L, D;
|
|
1722
1722
|
const W = () => {
|
|
@@ -1728,9 +1728,9 @@ const at = (e, n) => {
|
|
|
1728
1728
|
}, A = () => {
|
|
1729
1729
|
s = null, o();
|
|
1730
1730
|
}, H = () => {
|
|
1731
|
-
i = "close", e.un("pointermove",
|
|
1731
|
+
i = "close", e.un("pointermove", p), g = null, T && (T.abortDrawing(), console.log("abortDrawing"), T.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
|
+
}), T = null), l && Xe(l), l = void 0, t == null || t.clear(), t = null, w && e.getAllLayers().includes(w) && (e.removeLayer(w), w = null), L != null && L.parentElement && (L.innerHTML = "", L.parentElement.removeChild(L), L = null), y != null && y.parentElement && (y.innerHTML = "", y.parentElement.removeChild(y), y = null), D && e.removeOverlay(D), b && e.removeOverlay(b), Le(e, "pointer");
|
|
1734
1734
|
};
|
|
1735
1735
|
return {
|
|
1736
1736
|
open: o,
|
|
@@ -1748,40 +1748,40 @@ const at = (e, n) => {
|
|
|
1748
1748
|
});
|
|
1749
1749
|
e == null || e.addLayer(s);
|
|
1750
1750
|
let l = null, i = null;
|
|
1751
|
-
const o = (
|
|
1752
|
-
if (!
|
|
1751
|
+
const o = (x, y = !0) => {
|
|
1752
|
+
if (!x || x.length === 0) return;
|
|
1753
1753
|
if (n.clear(), i) {
|
|
1754
|
-
const
|
|
1755
|
-
|
|
1754
|
+
const E = x.find((L) => L.id === (i == null ? void 0 : i.id));
|
|
1755
|
+
E ? i = E : x.push(i);
|
|
1756
1756
|
}
|
|
1757
|
-
const
|
|
1758
|
-
|
|
1759
|
-
const [L, D] =
|
|
1757
|
+
const b = [];
|
|
1758
|
+
x.forEach((E) => {
|
|
1759
|
+
const [L, D] = E.latLon.split(","), W = new ae({
|
|
1760
1760
|
geometry: new ce(ee([Number(L), Number(D)])),
|
|
1761
|
-
portData:
|
|
1762
|
-
id:
|
|
1763
|
-
select:
|
|
1764
|
-
showTitle:
|
|
1761
|
+
portData: E,
|
|
1762
|
+
id: E.id,
|
|
1763
|
+
select: E.id === (i == null ? void 0 : i.id),
|
|
1764
|
+
showTitle: E.id === (i == null ? void 0 : i.id) || y
|
|
1765
1765
|
}), A = r(W);
|
|
1766
|
-
W.setStyle(A),
|
|
1767
|
-
}), n.addFeatures(
|
|
1766
|
+
W.setStyle(A), b.push(W);
|
|
1767
|
+
}), n.addFeatures(b);
|
|
1768
1768
|
};
|
|
1769
|
-
let f = null,
|
|
1770
|
-
const t = (
|
|
1771
|
-
f || (f = document.createElement("canvas"),
|
|
1769
|
+
let f = null, w = null;
|
|
1770
|
+
const t = (x, y) => {
|
|
1771
|
+
f || (f = document.createElement("canvas"), w = f.getContext("2d", {
|
|
1772
1772
|
willReadFrequently: !0
|
|
1773
1773
|
}));
|
|
1774
|
-
const
|
|
1775
|
-
if (!
|
|
1776
|
-
|
|
1774
|
+
const b = f, E = w;
|
|
1775
|
+
if (!E) return "";
|
|
1776
|
+
b.width = 0, b.height = 0;
|
|
1777
1777
|
const L = 2, D = 8, W = window.devicePixelRatio || 1, A = "12px sans-serif";
|
|
1778
|
-
|
|
1779
|
-
const j =
|
|
1780
|
-
|
|
1778
|
+
E.font = A;
|
|
1779
|
+
const j = E.measureText(x).width, F = D + j + D, C = L + 12 + L * 2;
|
|
1780
|
+
b.width = Math.round(F * W), b.height = Math.round(C * W), E.scale(W, W), E.clearRect(0, 0, F, C), E.fillStyle = y ? "#FF5733" : "#FFF", E.fillRect(0, 0, F, C), E.font = A, E.textBaseline = "middle";
|
|
1781
1781
|
const $ = C / 2;
|
|
1782
|
-
return
|
|
1783
|
-
}, r = (
|
|
1784
|
-
const { select:
|
|
1782
|
+
return E.strokeStyle = y ? "#000" : "#ffffff", E.lineWidth = 1, E.strokeText(x, D, $), E.fillStyle = y ? "#FFF" : "#000000", E.fillText(x, D, $), b.toDataURL("image/png");
|
|
1783
|
+
}, r = (x) => {
|
|
1784
|
+
const { select: y, showTitle: b } = x.getProperties(), E = (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,22 +1792,22 @@ 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(E(y ? "#FF5733" : "#3370FF"))}`, D = e.getView().getZoom(), W = x.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
|
|
1799
1799
|
}),
|
|
1800
|
-
zIndex:
|
|
1800
|
+
zIndex: y ? 110 : 100
|
|
1801
1801
|
}), j = new Q({
|
|
1802
1802
|
image: new Ce({
|
|
1803
|
-
src: t(W.shortName,
|
|
1803
|
+
src: t(W.shortName, y),
|
|
1804
1804
|
anchor: [0.5, 0.5],
|
|
1805
1805
|
displacement: [0, -26],
|
|
1806
1806
|
scale: 1 / A,
|
|
1807
1807
|
anchorXUnits: "fraction",
|
|
1808
1808
|
anchorYUnits: "fraction"
|
|
1809
1809
|
}),
|
|
1810
|
-
zIndex:
|
|
1810
|
+
zIndex: y ? 110 : 100
|
|
1811
1811
|
// text: new Text({
|
|
1812
1812
|
// text: port.shortName,
|
|
1813
1813
|
// font: '12px sans-serif',
|
|
@@ -1820,45 +1820,45 @@ const at = (e, n) => {
|
|
|
1820
1820
|
// offsetY: 30,
|
|
1821
1821
|
// }),
|
|
1822
1822
|
});
|
|
1823
|
-
return !
|
|
1823
|
+
return !b && !y ? H : [H, j];
|
|
1824
1824
|
}, g = () => {
|
|
1825
1825
|
if (n)
|
|
1826
1826
|
if (l) {
|
|
1827
1827
|
console.log("清除非选中的港口");
|
|
1828
|
-
const
|
|
1829
|
-
n.getFeatures().forEach((
|
|
1830
|
-
|
|
1828
|
+
const x = l.get("portData").id;
|
|
1829
|
+
n.getFeatures().forEach((y) => {
|
|
1830
|
+
y.get("portData").id !== x && n.removeFeature(y);
|
|
1831
1831
|
});
|
|
1832
1832
|
} else
|
|
1833
1833
|
console.log("清除所有港口", n), n == null || n.clear();
|
|
1834
|
-
},
|
|
1834
|
+
}, p = (x) => {
|
|
1835
1835
|
if (n) {
|
|
1836
|
-
if (!
|
|
1837
|
-
return
|
|
1838
|
-
(l == null ? void 0 : l.get("portData").id) !==
|
|
1836
|
+
if (!x)
|
|
1837
|
+
return T();
|
|
1838
|
+
(l == null ? void 0 : l.get("portData").id) !== x.id && (T(), z(x));
|
|
1839
1839
|
}
|
|
1840
|
-
},
|
|
1841
|
-
var
|
|
1840
|
+
}, T = () => {
|
|
1841
|
+
var x;
|
|
1842
1842
|
if (l) {
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1843
|
+
const y = l == null ? void 0 : l.get("portData"), b = (x = n.getFeatures()) == null ? void 0 : x.find((E) => E.get("portData").id === y.id);
|
|
1844
|
+
b && (b.set("select", !1), b.setStyle(r(b)), l = null, i = null);
|
|
1845
1845
|
}
|
|
1846
|
-
}, z = (
|
|
1846
|
+
}, z = (x) => {
|
|
1847
1847
|
if (!n) return;
|
|
1848
|
-
const
|
|
1849
|
-
i =
|
|
1848
|
+
const y = n.getFeatures();
|
|
1849
|
+
i = x, l = y.find((b) => b.get("portData").id === x.id), l && (l.set("select", !0), l.setStyle(r(l)));
|
|
1850
1850
|
};
|
|
1851
1851
|
return {
|
|
1852
1852
|
render: o,
|
|
1853
1853
|
clear: g,
|
|
1854
|
-
selected:
|
|
1855
|
-
handlePortHover: (
|
|
1856
|
-
|
|
1854
|
+
selected: p,
|
|
1855
|
+
handlePortHover: (x) => {
|
|
1856
|
+
x && x.get("portData") && (e != null && e.getTargetElement()) && Le(e, "pointer");
|
|
1857
1857
|
}
|
|
1858
1858
|
};
|
|
1859
1859
|
}, So = (e, n, s, l, i, o, f) => {
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1860
|
+
const w = e.getInstall();
|
|
1861
|
+
w.on("moveend", () => {
|
|
1862
1862
|
var t, r;
|
|
1863
1863
|
try {
|
|
1864
1864
|
const g = e.getZoom();
|
|
@@ -1866,33 +1866,36 @@ const at = (e, n) => {
|
|
|
1866
1866
|
} catch (g) {
|
|
1867
1867
|
console.log("moveend---catch", g);
|
|
1868
1868
|
}
|
|
1869
|
-
}),
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1869
|
+
}), w.on("pointermove", (t) => {
|
|
1870
|
+
if (t.dragging || !w) return;
|
|
1871
|
+
const r = w.forEachFeatureAtPixel(
|
|
1872
|
+
t.pixel,
|
|
1873
|
+
function(g) {
|
|
1874
|
+
return g;
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
hitTolerance: 3,
|
|
1878
|
+
// 3像素的容差范围
|
|
1879
|
+
layerFilter: function(g) {
|
|
1880
|
+
return g.get("interactive") === !0;
|
|
1881
|
+
}
|
|
1880
1882
|
}
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
+
);
|
|
1884
|
+
s == null || s.handleTrackMapEvent(r, "hover", t), l == null || l.handleShipMapEvent(r, "hover"), r && (i == null || i.handlePortHover(r));
|
|
1885
|
+
}), w.on("movestart", () => {
|
|
1883
1886
|
try {
|
|
1884
|
-
const t =
|
|
1887
|
+
const t = w == null ? void 0 : w.getView().getZoom();
|
|
1885
1888
|
t && t <= re.shipModelMax && t >= re.shipTriggleMin && l.changeShipScale("start"), l.hiddenShipBlink();
|
|
1886
1889
|
} catch (t) {
|
|
1887
1890
|
console.log("movestart---catch", t);
|
|
1888
1891
|
}
|
|
1889
|
-
}),
|
|
1890
|
-
var r, g,
|
|
1892
|
+
}), w.on("click", Re((t) => {
|
|
1893
|
+
var r, g, p;
|
|
1891
1894
|
if (f.getState() !== "open")
|
|
1892
1895
|
try {
|
|
1893
1896
|
if (console.log("1", o.getState()), o.getState()) return;
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1897
|
+
const T = w.getEventPixel(t.originalEvent), z = w.forEachFeatureAtPixel(
|
|
1898
|
+
T,
|
|
1896
1899
|
(M) => {
|
|
1897
1900
|
if (M != null && M.get("shipData") || M != null && M.get("portData"))
|
|
1898
1901
|
return M;
|
|
@@ -1902,14 +1905,14 @@ const at = (e, n) => {
|
|
|
1902
1905
|
l.handleShipMapEvent(z, "click", (r = n.getProps()) == null ? void 0 : r.selectShip);
|
|
1903
1906
|
else if (z != null && z.get("portData")) {
|
|
1904
1907
|
const M = z.get("portData");
|
|
1905
|
-
i.selected(M), (
|
|
1908
|
+
i.selected(M), (p = (g = n.getProps()) == null ? void 0 : g.selectPort) == null || p.call(g, M);
|
|
1906
1909
|
}
|
|
1907
1910
|
t.preventDefault(), t.stopPropagation();
|
|
1908
|
-
} catch (
|
|
1909
|
-
console.log("click---catch",
|
|
1911
|
+
} catch (T) {
|
|
1912
|
+
console.log("click---catch", T);
|
|
1910
1913
|
}
|
|
1911
|
-
}, 150)),
|
|
1912
|
-
const t =
|
|
1914
|
+
}, 150)), w.getView().on("change:resolution", Re(() => {
|
|
1915
|
+
const t = w == null ? void 0 : w.getView().getZoom();
|
|
1913
1916
|
t && t <= re.shipModelMax && t >= re.shipTriggleMin && l.changeSelectedScale("start");
|
|
1914
1917
|
}, 10));
|
|
1915
1918
|
}, No = () => {
|
|
@@ -1918,43 +1921,43 @@ const at = (e, n) => {
|
|
|
1918
1921
|
createInstance: (l, i) => {
|
|
1919
1922
|
const o = ro();
|
|
1920
1923
|
o.initMap(l, i);
|
|
1921
|
-
const f = o.getInstall(),
|
|
1922
|
-
t.setProps(i),
|
|
1923
|
-
const r = ao(f), g = co(f, r),
|
|
1924
|
-
So(o, t, r,
|
|
1925
|
-
const
|
|
1926
|
-
const
|
|
1924
|
+
const f = o.getInstall(), w = ko(f), t = po();
|
|
1925
|
+
t.setProps(i), w.setShowLayerType(i.layerType), w.setGreenTileVisible(i.showGreenLayer);
|
|
1926
|
+
const r = ao(f), g = co(f, r), p = bo(f), T = Mo(f), z = Eo(f, t), M = To(f, t), x = Po(f);
|
|
1927
|
+
So(o, t, r, p, x, z, M);
|
|
1928
|
+
const y = () => {
|
|
1929
|
+
const E = f.getView().calculateExtent(o.getSize()), L = Me([E[0], E[1]], _.mercator, _.data), D = Me([E[2], E[3]], _.mercator, _.data);
|
|
1927
1930
|
return [L[0], L[1], D[0], D[1]];
|
|
1928
|
-
},
|
|
1931
|
+
}, b = {
|
|
1929
1932
|
id: Symbol("map-instance"),
|
|
1930
1933
|
innerMap: null,
|
|
1931
1934
|
map: o.getInstall(),
|
|
1932
1935
|
destroy: () => {
|
|
1933
|
-
e.splice(e.indexOf(
|
|
1936
|
+
e.splice(e.indexOf(b), 1);
|
|
1934
1937
|
},
|
|
1935
1938
|
methods: {
|
|
1936
1939
|
...o,
|
|
1937
|
-
layer:
|
|
1938
|
-
ship:
|
|
1940
|
+
layer: w,
|
|
1941
|
+
ship: p,
|
|
1939
1942
|
track: r,
|
|
1940
1943
|
carTrack: g,
|
|
1941
1944
|
port: {
|
|
1942
|
-
render:
|
|
1943
|
-
clear:
|
|
1944
|
-
selected:
|
|
1945
|
+
render: x.render,
|
|
1946
|
+
clear: x.clear,
|
|
1947
|
+
selected: x.selected
|
|
1945
1948
|
},
|
|
1946
|
-
position:
|
|
1949
|
+
position: T,
|
|
1947
1950
|
drawLine: z,
|
|
1948
1951
|
drawPolygon: M,
|
|
1949
1952
|
// 子模块
|
|
1950
1953
|
utils: {
|
|
1951
|
-
getCalculateExtent:
|
|
1954
|
+
getCalculateExtent: y,
|
|
1952
1955
|
convertSixHundredThousandToLatLng: Ue,
|
|
1953
1956
|
calculateCirclePoints: no
|
|
1954
1957
|
}
|
|
1955
1958
|
}
|
|
1956
1959
|
};
|
|
1957
|
-
return e.push(
|
|
1960
|
+
return e.push(b), b;
|
|
1958
1961
|
},
|
|
1959
1962
|
destroyInstance: (l) => {
|
|
1960
1963
|
const i = e.findIndex((o) => o.id === l);
|
|
@@ -1985,13 +1988,13 @@ const at = (e, n) => {
|
|
|
1985
1988
|
} }
|
|
1986
1989
|
},
|
|
1987
1990
|
setup(e, { expose: n }) {
|
|
1988
|
-
const s = oe(), l = oe(), i = No(), o = oe(), f = e,
|
|
1991
|
+
const s = oe(), l = oe(), i = No(), o = oe(), f = e, w = oe({
|
|
1989
1992
|
getInstall() {
|
|
1990
1993
|
}
|
|
1991
1994
|
});
|
|
1992
1995
|
return zt(() => {
|
|
1993
1996
|
var t;
|
|
1994
|
-
o.value = i.createInstance(s.value, f),
|
|
1997
|
+
o.value = i.createInstance(s.value, f), w.value = o.value.methods, (t = l.value) == null || t.setScaleLine(o.value.map, f.scaleLineUnit);
|
|
1995
1998
|
}), Ot(() => {
|
|
1996
1999
|
var t, r;
|
|
1997
2000
|
i.destroyInstance((t = o == null ? void 0 : o.value) == null ? void 0 : t.id), (r = o.value) == null || r.destroy();
|