zhihao-ui 1.3.30 → 1.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/{Map-CE1xShMf.js → Map-Ch5zj0xU.js} +660 -654
- package/dist/es/index.js +1 -1
- package/dist/umd/index.umd.cjs +30 -28
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as Ge, openBlock as We, createElementBlock as Ye, createElementVNode as Ze, ref as U, computed as
|
|
2
|
-
import { S as zt, M as Ue, T as he, X as me, p as I, V as Ot, q as Rt, r as Zt, t as At, h as lt, s as Be, u as Dt, v as ue, F as
|
|
1
|
+
import { defineComponent as Ge, openBlock as We, createElementBlock as Ye, createElementVNode as Ze, ref as U, computed as Ee, h as oe, createVNode as Ae, render as St, reactive as Nt, onMounted as $t, onUnmounted as Vt } from "vue";
|
|
2
|
+
import { S as zt, M as Ue, T as he, X as me, p as I, V as Ot, q as Rt, r as Zt, t as At, h as lt, s as Be, u as Dt, v as ue, F as j, w as H, O as ie, P as re, x as xe, y as qe, L as Pe, z as Gt, A as Ie, B as se, C as ve, D as ae, G as fe, i as Wt, H as Se, I as Yt, J as Ve, K as Bt, N as qt, Q as st, R as Fe, U as De, W as et, Y as Ht, Z as Xt, _ as jt } from "./vendor-DHIg4jsE.js";
|
|
3
3
|
import { _ as He } from "./Button-BEYBRduL.js";
|
|
4
4
|
import { w as Qt } from "./utils-BOPMDuno.js";
|
|
5
5
|
const Jt = { id: "scale-line-container" }, Kt = /* @__PURE__ */ Ge({
|
|
@@ -49,7 +49,7 @@ const Jt = { id: "scale-line-container" }, Kt = /* @__PURE__ */ Ge({
|
|
|
49
49
|
}, " - ")
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
|
-
}), eo = /* @__PURE__ */ He(It, [["__scopeId", "data-v-c39c3075"]]),
|
|
52
|
+
}), eo = /* @__PURE__ */ He(It, [["__scopeId", "data-v-c39c3075"]]), Te = "a6e8f78974f2581f2ca00485b40c948f", ne = {
|
|
53
53
|
// 地图默认层级
|
|
54
54
|
default: 13,
|
|
55
55
|
// 地图缩放最小层级
|
|
@@ -69,37 +69,37 @@ const Jt = { id: "scale-line-container" }, Kt = /* @__PURE__ */ Ge({
|
|
|
69
69
|
data: "EPSG:4326",
|
|
70
70
|
// 墨卡托投影坐标 渲染坐标
|
|
71
71
|
mercator: "EPSG:3857"
|
|
72
|
-
}, to = [114.84, 30.52], it = "https://static.zhihaoscm.cn/",
|
|
73
|
-
var de = ((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=${
|
|
72
|
+
}, to = [114.84, 30.52], it = "https://static.zhihaoscm.cn/", Ne = 2003750834e-2;
|
|
73
|
+
var de = ((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=${Te}`, 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=${Te}`, 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=${Te}`, 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=${Te}`, e.greenTile = `${it}/map/tile/{z}/{x}/{y}.png`, e))(de || {}), we = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(we || {});
|
|
74
74
|
function oo() {
|
|
75
75
|
const e = U(), r = () => e.value, l = () => r().getView(), s = () => {
|
|
76
76
|
var y;
|
|
77
77
|
return (y = l()) == null ? void 0 : y.getZoom();
|
|
78
78
|
}, a = (y) => {
|
|
79
|
-
var
|
|
80
|
-
(
|
|
81
|
-
}, o = (y,
|
|
82
|
-
var
|
|
83
|
-
(
|
|
79
|
+
var F;
|
|
80
|
+
(F = l()) == null || F.setZoom(y);
|
|
81
|
+
}, o = (y, F) => {
|
|
82
|
+
var V;
|
|
83
|
+
(V = l()) == null || V.setCenter(I([y, F]));
|
|
84
84
|
}, v = () => {
|
|
85
|
-
var
|
|
86
|
-
const y = (
|
|
85
|
+
var F;
|
|
86
|
+
const y = (F = l()) == null ? void 0 : F.getCenter();
|
|
87
87
|
return At(y);
|
|
88
|
-
},
|
|
88
|
+
}, b = () => {
|
|
89
89
|
var y;
|
|
90
90
|
return (y = r()) == null ? void 0 : y.getSize();
|
|
91
|
-
}, t = new Ue(), n = (y,
|
|
92
|
-
m(
|
|
93
|
-
const
|
|
94
|
-
zoom:
|
|
95
|
-
center: I(
|
|
91
|
+
}, t = new Ue(), n = (y, F) => {
|
|
92
|
+
m(F);
|
|
93
|
+
const V = {
|
|
94
|
+
zoom: F.zoom,
|
|
95
|
+
center: I(F.center),
|
|
96
96
|
minZoom: ne.min,
|
|
97
97
|
maxZoom: ne.max,
|
|
98
98
|
constrainResolution: !0,
|
|
99
99
|
enableRotation: !1,
|
|
100
100
|
multiWorld: !0
|
|
101
101
|
};
|
|
102
|
-
let
|
|
102
|
+
let C = {
|
|
103
103
|
target: y,
|
|
104
104
|
controls: Rt({
|
|
105
105
|
zoom: !1
|
|
@@ -110,10 +110,10 @@ function oo() {
|
|
|
110
110
|
t.get("satelliteImgTile"),
|
|
111
111
|
t.get("satelliteImgTileMark")
|
|
112
112
|
],
|
|
113
|
-
view: new Ot(
|
|
113
|
+
view: new Ot(V)
|
|
114
114
|
};
|
|
115
|
-
const
|
|
116
|
-
(
|
|
115
|
+
const d = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), k = /MicroMessenger/i.test(navigator.userAgent);
|
|
116
|
+
(d || k) && (C.interactions = Zt({
|
|
117
117
|
// 禁用双击缩放(移动端不需要)
|
|
118
118
|
doubleClickZoom: !1,
|
|
119
119
|
// 禁用鼠标拖拽(用触摸拖拽代替)
|
|
@@ -122,8 +122,8 @@ function oo() {
|
|
|
122
122
|
pinchZoom: !0,
|
|
123
123
|
shiftDragZoom: !1
|
|
124
124
|
}));
|
|
125
|
-
const
|
|
126
|
-
e.value =
|
|
125
|
+
const w = new Ue(C);
|
|
126
|
+
e.value = w;
|
|
127
127
|
}, m = (y) => {
|
|
128
128
|
t.set("vectorTile", new he({
|
|
129
129
|
source: new me({ url: de.vectorTile }),
|
|
@@ -163,7 +163,7 @@ function oo() {
|
|
|
163
163
|
setZoom: a,
|
|
164
164
|
setCenter: o,
|
|
165
165
|
getCenter: v,
|
|
166
|
-
getSize:
|
|
166
|
+
getSize: b,
|
|
167
167
|
initMap: n,
|
|
168
168
|
setBaseLayerMap: m
|
|
169
169
|
};
|
|
@@ -201,9 +201,9 @@ const Xe = function(e, r) {
|
|
|
201
201
|
return a;
|
|
202
202
|
};
|
|
203
203
|
function lo(e) {
|
|
204
|
-
const r = e[0] *
|
|
204
|
+
const r = e[0] * Ne / 180;
|
|
205
205
|
let l = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
|
|
206
|
-
return l = l *
|
|
206
|
+
return l = l * Ne / 180, [r, l];
|
|
207
207
|
}
|
|
208
208
|
function ge(e = "") {
|
|
209
209
|
let r = e.replace(/&?/g, "&");
|
|
@@ -216,7 +216,7 @@ const tt = (e) => {
|
|
|
216
216
|
const r = new ue({
|
|
217
217
|
font: "Normal 14px map-iconfont",
|
|
218
218
|
text: ge(e),
|
|
219
|
-
fill: new
|
|
219
|
+
fill: new j({ color: "#fff" }),
|
|
220
220
|
offsetY: -14
|
|
221
221
|
});
|
|
222
222
|
return new H({
|
|
@@ -224,8 +224,8 @@ const tt = (e) => {
|
|
|
224
224
|
zIndex: 100
|
|
225
225
|
});
|
|
226
226
|
}, ot = (e, r = "lonlat") => {
|
|
227
|
-
const l = { lon: 0, lat: 0 }, s = e[0] /
|
|
228
|
-
let a = e[1] /
|
|
227
|
+
const l = { lon: 0, lat: 0 }, s = e[0] / Ne * 180;
|
|
228
|
+
let a = e[1] / Ne * 180;
|
|
229
229
|
return a = 180 / Math.PI * (2 * Math.atan(Math.exp(a * Math.PI / 180)) - Math.PI / 2), l.lon = s, l.lat = a, r === "lonlat" ? l : [s, a];
|
|
230
230
|
}, so = (e) => {
|
|
231
231
|
const r = lt.duration(e, "minutes"), l = Math.floor(r.asDays()), s = r.hours(), a = r.minutes();
|
|
@@ -237,20 +237,20 @@ const tt = (e) => {
|
|
|
237
237
|
if (!e || (console.log("vehicleInfo", m), !(m != null && m.lon && (m != null && m.lat)))) return;
|
|
238
238
|
const y = Math.abs(Number(m.lon)) > 180 ? Xe(m.lon, m.lat) : [m.lon, m.lat];
|
|
239
239
|
a(m, I(y));
|
|
240
|
-
const
|
|
241
|
-
|
|
240
|
+
const F = e == null ? void 0 : e.getView(), V = new re(y);
|
|
241
|
+
F.setCenter(xe(V.getCoordinates(), J.data, J.mercator));
|
|
242
242
|
}, a = (m, y) => {
|
|
243
|
-
const
|
|
243
|
+
const F = `${it}map/car-icon.gif`;
|
|
244
244
|
l || (l = new ie({
|
|
245
245
|
element: document.createElement("div"),
|
|
246
246
|
positioning: "center-center",
|
|
247
247
|
stopEvent: !1
|
|
248
248
|
// 允许交互事件穿透
|
|
249
249
|
}), e.addOverlay(l));
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
250
|
+
const V = l.getElement();
|
|
251
|
+
V.style.backgroundImage = `url(${F})`, V.style.width = "80px", V.style.height = "80px";
|
|
252
|
+
const C = (m == null ? void 0 : m.drc) || "";
|
|
253
|
+
V.style.transform = `rotate(${C}deg)`, V.style.backgroundSize = "cover", l == null || l.setPosition(y);
|
|
254
254
|
};
|
|
255
255
|
return {
|
|
256
256
|
location: s,
|
|
@@ -258,8 +258,8 @@ const tt = (e) => {
|
|
|
258
258
|
const m = l == null ? void 0 : l.getElement();
|
|
259
259
|
m && (m.innerHTML = "");
|
|
260
260
|
},
|
|
261
|
-
renderTrack: (m, y,
|
|
262
|
-
r.render(m, y,
|
|
261
|
+
renderTrack: (m, y, F) => {
|
|
262
|
+
r.render(m, y, F, "truck", 1e3);
|
|
263
263
|
},
|
|
264
264
|
setCenter: (m) => {
|
|
265
265
|
r.setCenter(m);
|
|
@@ -278,98 +278,98 @@ const co = (e) => {
|
|
|
278
278
|
let s = null;
|
|
279
279
|
const a = "--";
|
|
280
280
|
let o = null;
|
|
281
|
-
const v = document.createElement("div"),
|
|
281
|
+
const v = document.createElement("div"), b = new ie({
|
|
282
282
|
element: v,
|
|
283
283
|
positioning: "top-left",
|
|
284
284
|
stopEvent: !1,
|
|
285
285
|
className: "track-label-popup"
|
|
286
286
|
});
|
|
287
|
-
let t, n, m, y,
|
|
288
|
-
const
|
|
289
|
-
var
|
|
290
|
-
for (
|
|
291
|
-
const
|
|
292
|
-
|
|
287
|
+
let t, n, m, y, F, V = !1, C = Date.now(), d, k = 0, w = null, x = 20, G = !1;
|
|
288
|
+
const Z = 5, Y = [], X = (c) => {
|
|
289
|
+
var u;
|
|
290
|
+
for (Y.unshift(c); Y.length > Z; ) {
|
|
291
|
+
const f = Y.pop(), M = r.get(f);
|
|
292
|
+
M && ((u = M.getSource()) == null || u.clear(), e == null || e.removeLayer(M), r.delete(f), delete l[f]);
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
295
|
let O = "";
|
|
296
|
-
const
|
|
296
|
+
const A = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], i = qe(() => {
|
|
297
297
|
if (s && l[s] && r.get(s).getVisible() && G) {
|
|
298
298
|
console.log("reRenderTrackLine------------");
|
|
299
|
-
const c = Wt(
|
|
299
|
+
const c = Wt(g(s, l[s]));
|
|
300
300
|
ze(s, c);
|
|
301
301
|
}
|
|
302
|
-
}, 300),
|
|
303
|
-
let
|
|
304
|
-
const
|
|
305
|
-
return
|
|
302
|
+
}, 300), g = (c, u) => {
|
|
303
|
+
let f = [];
|
|
304
|
+
const M = Math.max(1, Math.floor(u.length / x));
|
|
305
|
+
return f = u.filter((T, R) => R % M === 0).map((T, R) => {
|
|
306
306
|
if (Number(T.lon) > 180 || Number(T.lat) > 180) {
|
|
307
|
-
const [
|
|
308
|
-
T.lon =
|
|
307
|
+
const [N, W] = Xe(T.lon, T.lat);
|
|
308
|
+
T.lon = N, T.lat = W;
|
|
309
309
|
}
|
|
310
310
|
return T.center = [T.lon, T.lat], T.centerPoint = lo(T.center), T.time = lt(T.createdAt).format("YYYY-MM-DD HH:mm:ss"), T.id = c, T.index = R, T;
|
|
311
|
-
}),
|
|
312
|
-
}, h = async (c,
|
|
313
|
-
if (console.log("renderTrackLine--------", c,
|
|
311
|
+
}), f;
|
|
312
|
+
}, h = async (c, u, f, M = "ship", E = 200) => {
|
|
313
|
+
if (console.log("renderTrackLine--------", c, u, f), !e || JSON.stringify(l[c]) === JSON.stringify(u) && s === c || (u = u == null ? void 0 : u.reverse(), b && M === "ship" && (e != null && e.getOverlays().getArray().includes(b) || e.addOverlay(b)), (u == null ? void 0 : u.length) < 2))
|
|
314
314
|
return;
|
|
315
|
-
X(c), s = c, l[c] =
|
|
315
|
+
X(c), s = c, l[c] = u, x = E;
|
|
316
316
|
const T = Object.keys(l).findIndex((R) => R === c) || 0;
|
|
317
|
-
O =
|
|
317
|
+
O = f || A[T > 10 ? 10 : T], G = !0, await S(), await Je(s);
|
|
318
318
|
}, L = (c) => {
|
|
319
|
-
const
|
|
319
|
+
const u = new ae();
|
|
320
320
|
return new ve({
|
|
321
|
-
source:
|
|
321
|
+
source: u,
|
|
322
322
|
visible: !1,
|
|
323
323
|
// 默认隐藏
|
|
324
324
|
className: `track-layer-${c}`,
|
|
325
325
|
renderBuffer: 1024
|
|
326
326
|
// 增大渲染缓冲区
|
|
327
327
|
});
|
|
328
|
-
},
|
|
329
|
-
r.forEach((
|
|
328
|
+
}, p = (c) => {
|
|
329
|
+
r.forEach((u, f) => {
|
|
330
330
|
var E;
|
|
331
|
-
const
|
|
332
|
-
|
|
331
|
+
const M = f === c;
|
|
332
|
+
u.getVisible() !== M && (u.setVisible(M), e.getLayers().getArray().includes(u) || e.addLayer(u), M || (E = u.getSource()) == null || E.clear());
|
|
333
333
|
}), s = c;
|
|
334
|
-
},
|
|
334
|
+
}, S = async () => {
|
|
335
335
|
const c = s;
|
|
336
336
|
if (!r.has(c)) {
|
|
337
337
|
const T = L(c);
|
|
338
338
|
r.set(c, T);
|
|
339
339
|
}
|
|
340
|
-
await
|
|
341
|
-
const
|
|
342
|
-
if (!(
|
|
343
|
-
let
|
|
344
|
-
|
|
345
|
-
const E =
|
|
346
|
-
|
|
347
|
-
}, z = (c,
|
|
348
|
-
const
|
|
340
|
+
await p(c);
|
|
341
|
+
const u = O || "", f = l[c] || [];
|
|
342
|
+
if (!(f && f.length > 1)) return [];
|
|
343
|
+
let M = [];
|
|
344
|
+
M = g(c, f);
|
|
345
|
+
const E = M.map((T) => T.centerPoint);
|
|
346
|
+
M.length >= 2 && await z(c, E, u);
|
|
347
|
+
}, z = (c, u, f) => {
|
|
348
|
+
const M = new Pe(u), E = r.get(c).getSource(), T = E.getFeatureById(c);
|
|
349
349
|
if (T)
|
|
350
|
-
T.setGeometry(
|
|
350
|
+
T.setGeometry(M), T.setId(c), T.setStyle(D(f)), w = T;
|
|
351
351
|
else {
|
|
352
|
-
const R = new se({ geometry:
|
|
353
|
-
R.setId(c), R.set("type", "line"), R.setStyle(
|
|
352
|
+
const R = new se({ geometry: M });
|
|
353
|
+
R.setId(c), R.set("type", "line"), R.setStyle(D(f)), E.addFeature(R), w = R;
|
|
354
354
|
}
|
|
355
|
-
return
|
|
356
|
-
},
|
|
355
|
+
return w;
|
|
356
|
+
}, D = (c) => new H({
|
|
357
357
|
stroke: new fe({
|
|
358
358
|
color: c,
|
|
359
359
|
width: 2
|
|
360
360
|
})
|
|
361
|
-
}),
|
|
362
|
-
const
|
|
363
|
-
if (c &&
|
|
364
|
-
e.getTargetElement().style.cursor =
|
|
365
|
-
const E = c.get("data"), T = ce(E), R =
|
|
366
|
-
R && (v.querySelector(".popup-content"), v.innerHTML = T,
|
|
361
|
+
}), $ = (c, u, f) => {
|
|
362
|
+
const M = c == null ? void 0 : c.get("trackId");
|
|
363
|
+
if (c && M && u === "hover") {
|
|
364
|
+
e.getTargetElement().style.cursor = M ? "pointer" : "";
|
|
365
|
+
const E = c.get("data"), T = ce(E), R = f == null ? void 0 : f.coordinate;
|
|
366
|
+
R && (v.querySelector(".popup-content"), v.innerHTML = T, b == null || b.setPosition(R));
|
|
367
367
|
} else
|
|
368
|
-
|
|
368
|
+
b && b.setPosition(void 0);
|
|
369
369
|
}, ce = (c) => {
|
|
370
370
|
if (!(c != null && c.time)) return;
|
|
371
|
-
let
|
|
372
|
-
return c != null && c.stayTime && (
|
|
371
|
+
let u = "";
|
|
372
|
+
return c != null && c.stayTime && (u = `
|
|
373
373
|
<div class="item w-100">
|
|
374
374
|
<div class="item-label">停泊时间约</div>
|
|
375
375
|
<div class="item-item">${so(Number(c.stayTime))}</div>
|
|
@@ -404,67 +404,67 @@ const co = (e) => {
|
|
|
404
404
|
<div class="item-label">时间</div>
|
|
405
405
|
<div class="item-item">${c.time}</div>
|
|
406
406
|
</div>
|
|
407
|
-
${
|
|
407
|
+
${u ?? u}
|
|
408
408
|
</div>`;
|
|
409
409
|
}, te = (c) => {
|
|
410
|
-
const
|
|
411
|
-
const
|
|
410
|
+
const f = c.map((N) => {
|
|
411
|
+
const W = e.getPixelFromCoordinate(I(N.center));
|
|
412
412
|
return {
|
|
413
|
-
|
|
414
|
-
original:
|
|
415
|
-
pixel:
|
|
413
|
+
...N,
|
|
414
|
+
original: N,
|
|
415
|
+
pixel: W,
|
|
416
416
|
distance: 0
|
|
417
417
|
// 先初始化,后续计算
|
|
418
418
|
};
|
|
419
419
|
});
|
|
420
|
-
let
|
|
421
|
-
|
|
422
|
-
for (let
|
|
423
|
-
const
|
|
424
|
-
|
|
420
|
+
let M = 0;
|
|
421
|
+
f[0].distance = 0;
|
|
422
|
+
for (let N = 1; N < f.length; N++) {
|
|
423
|
+
const W = f[N - 1].pixel, q = f[N].pixel, K = q[0] - W[0], P = q[1] - W[1];
|
|
424
|
+
M += Math.sqrt(K * K + P * P), f[N].distance = M;
|
|
425
425
|
}
|
|
426
|
-
const E =
|
|
427
|
-
(
|
|
426
|
+
const E = f.filter(
|
|
427
|
+
(N, W) => W === 0 || W === f.length - 1
|
|
428
428
|
), T = [];
|
|
429
|
-
for (let
|
|
430
|
-
const
|
|
431
|
-
if (T.push(
|
|
432
|
-
const q = E[
|
|
433
|
-
for (let
|
|
434
|
-
const
|
|
435
|
-
if (
|
|
429
|
+
for (let N = 0; N < E.length; N++) {
|
|
430
|
+
const W = E[N];
|
|
431
|
+
if (T.push(W), N < E.length - 1) {
|
|
432
|
+
const q = E[N + 1], K = q.distance - W.distance, P = Math.floor(K / 100);
|
|
433
|
+
for (let B = 1; B <= P; B++) {
|
|
434
|
+
const Q = W.distance + B * 100;
|
|
435
|
+
if (Q >= q.distance) break;
|
|
436
436
|
const _ = le(
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
f,
|
|
438
|
+
Q
|
|
439
439
|
);
|
|
440
440
|
_ && T.push(_);
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
return Array.from(
|
|
445
|
-
new Map(T.map((
|
|
446
|
-
).map((
|
|
447
|
-
|
|
445
|
+
new Map(T.map((N) => [N.distance.toFixed(2), N])).values()
|
|
446
|
+
).map((N) => ({
|
|
447
|
+
...N.original,
|
|
448
448
|
// 优先保留原始数据
|
|
449
|
-
|
|
449
|
+
...N,
|
|
450
450
|
// 覆盖坐标等计算属性
|
|
451
|
-
coord:
|
|
451
|
+
coord: N.coord,
|
|
452
452
|
// 确保使用插值后的坐标
|
|
453
|
-
pixel:
|
|
454
|
-
distance:
|
|
453
|
+
pixel: N.pixel,
|
|
454
|
+
distance: N.distance
|
|
455
455
|
}));
|
|
456
456
|
};
|
|
457
|
-
function le(c,
|
|
458
|
-
for (let
|
|
459
|
-
const
|
|
460
|
-
if (
|
|
461
|
-
const T = (
|
|
457
|
+
function le(c, u) {
|
|
458
|
+
for (let f = 1; f < c.length; f++) {
|
|
459
|
+
const M = c[f - 1], E = c[f];
|
|
460
|
+
if (u >= M.distance && u <= E.distance) {
|
|
461
|
+
const T = (u - M.distance) / (E.distance - M.distance), R = M.pixel[0] + T * (E.pixel[0] - M.pixel[0]), N = M.pixel[1] + T * (E.pixel[1] - M.pixel[1]), W = e == null ? void 0 : e.getCoordinateFromPixel([R, N]);
|
|
462
462
|
return {
|
|
463
|
-
...
|
|
463
|
+
...M,
|
|
464
464
|
// 继承前一个点的属性(可调整)
|
|
465
|
-
coord:
|
|
466
|
-
pixel: [R,
|
|
467
|
-
distance:
|
|
465
|
+
coord: W,
|
|
466
|
+
pixel: [R, N],
|
|
467
|
+
distance: u,
|
|
468
468
|
original: void 0
|
|
469
469
|
// 明确标记为插值生成点
|
|
470
470
|
};
|
|
@@ -472,27 +472,27 @@ const co = (e) => {
|
|
|
472
472
|
}
|
|
473
473
|
return null;
|
|
474
474
|
}
|
|
475
|
-
const ze = async (c,
|
|
475
|
+
const ze = async (c, u) => {
|
|
476
476
|
await Qe(), await ft(c);
|
|
477
|
-
const
|
|
478
|
-
r.get(c).getSource().addFeatures(
|
|
479
|
-
const R =
|
|
477
|
+
const f = te(u), M = f.map((T) => be(T));
|
|
478
|
+
r.get(c).getSource().addFeatures(M), ht(c, f, u, O), f.forEach((T) => {
|
|
479
|
+
const R = ke(c, O, T);
|
|
480
480
|
e.addOverlay(R);
|
|
481
481
|
});
|
|
482
|
-
},
|
|
483
|
-
const
|
|
482
|
+
}, be = (c) => {
|
|
483
|
+
const u = new se({
|
|
484
484
|
geometry: new re(c.centerPoint),
|
|
485
485
|
data: c
|
|
486
486
|
});
|
|
487
|
-
|
|
488
|
-
let
|
|
487
|
+
u.set("type", "track_point"), u.set("trackId", c.id), u.set("data", c);
|
|
488
|
+
let f = [
|
|
489
489
|
...vt(c, O)
|
|
490
490
|
];
|
|
491
|
-
return (c.index === 0 || c.index === l[c.id].length - 1) && (
|
|
492
|
-
},
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
<span>${
|
|
491
|
+
return (c.index === 0 || c.index === l[c.id].length - 1) && (f = [...mt(c)], u.set("type", "track_begin")), c.state !== void 0 && c.state !== null && (f = [...yt(c)], u.set("type", "track_icon")), u.setStyle(f), u;
|
|
492
|
+
}, ke = (c, u, f) => {
|
|
493
|
+
const M = document.createElement("div");
|
|
494
|
+
M.className = "track-overlay-label", M.style.position = "relative", M.style.backgroundColor = "rgba(255,255,255,0.8)", M.style.border = `1px solid ${u}`, M.style.fontSize = "12px", M.innerHTML = `
|
|
495
|
+
<span>${f.time}</span>
|
|
496
496
|
<svg
|
|
497
497
|
style="position: absolute;right: -20px;top: 0;"
|
|
498
498
|
viewBox="0 0 20 20"
|
|
@@ -501,12 +501,12 @@ const co = (e) => {
|
|
|
501
501
|
height="20">
|
|
502
502
|
<line x1="-20" y1="0"
|
|
503
503
|
x2="20" y2="20"
|
|
504
|
-
stroke="${
|
|
504
|
+
stroke="${u}"
|
|
505
505
|
stroke-width="1" />
|
|
506
506
|
`;
|
|
507
507
|
const E = new ie({
|
|
508
|
-
element:
|
|
509
|
-
position: I(
|
|
508
|
+
element: M,
|
|
509
|
+
position: I(f.center),
|
|
510
510
|
positioning: "top-right",
|
|
511
511
|
offset: [-20, -20],
|
|
512
512
|
stopEvent: !1,
|
|
@@ -514,169 +514,169 @@ const co = (e) => {
|
|
|
514
514
|
});
|
|
515
515
|
return E.set("class", "track-label-overlay"), E.set("trackId", c), E;
|
|
516
516
|
}, Qe = () => {
|
|
517
|
-
const c = e == null ? void 0 : e.getOverlays().getArray(),
|
|
518
|
-
|
|
519
|
-
|
|
517
|
+
const c = e == null ? void 0 : e.getOverlays().getArray(), u = c == null ? void 0 : c.filter((f) => f.get("class") === "track-label-overlay");
|
|
518
|
+
u && u.length > 0 && u.forEach((f) => {
|
|
519
|
+
f.setPosition(void 0), f.dispose();
|
|
520
520
|
});
|
|
521
521
|
}, ft = (c) => {
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
522
|
+
const u = r.get(c).getSource();
|
|
523
|
+
u.forEachFeature((f) => {
|
|
524
|
+
f.get("type") !== "line" && u.removeFeature(f);
|
|
525
525
|
});
|
|
526
|
-
}, vt = (c,
|
|
526
|
+
}, vt = (c, u) => (`${c.time}`, [
|
|
527
527
|
new H({
|
|
528
528
|
// 扩大交互热区
|
|
529
|
-
image: new
|
|
529
|
+
image: new Se({
|
|
530
530
|
stroke: new fe({ color: "rgba(0, 0, 0, 0.01)", width: 20 }),
|
|
531
531
|
radius: 3
|
|
532
532
|
})
|
|
533
533
|
}),
|
|
534
534
|
// 轨迹点样式
|
|
535
535
|
new H({
|
|
536
|
-
image: new
|
|
537
|
-
fill: new
|
|
536
|
+
image: new Se({
|
|
537
|
+
fill: new j({ color: u }),
|
|
538
538
|
stroke: new fe({ color: "#fff", width: 2 }),
|
|
539
539
|
radius: 3
|
|
540
540
|
})
|
|
541
541
|
})
|
|
542
542
|
// textStyle,
|
|
543
543
|
]), yt = (c) => {
|
|
544
|
-
const
|
|
544
|
+
const u = "#E31818", f = "#1890FF", M = "", E = new H({
|
|
545
545
|
text: new ue({
|
|
546
546
|
font: "Normal 22px map-iconfont",
|
|
547
|
-
text: ge(
|
|
547
|
+
text: ge(M),
|
|
548
548
|
offsetY: -10,
|
|
549
|
-
fill: new
|
|
550
|
-
color: Number(c.state) === 0 ?
|
|
549
|
+
fill: new j({
|
|
550
|
+
color: Number(c.state) === 0 ? u : Number(c.state) === 1 ? f : ""
|
|
551
551
|
})
|
|
552
552
|
}),
|
|
553
553
|
zIndex: 99
|
|
554
|
-
}), R = tt(""),
|
|
555
|
-
return Number(c.state) === 0 ? q.push(R) : Number(c.state) === 1 && q.push(
|
|
556
|
-
}, ht = (c,
|
|
557
|
-
const E =
|
|
558
|
-
T || (E.push(
|
|
554
|
+
}), R = tt(""), W = tt(""), q = [];
|
|
555
|
+
return Number(c.state) === 0 ? q.push(R) : Number(c.state) === 1 && q.push(W), q.push(E), q;
|
|
556
|
+
}, ht = (c, u, f, M) => {
|
|
557
|
+
const E = u || [], T = u.length;
|
|
558
|
+
T || (E.push(f[0]), E.push(f[f.length - 1]));
|
|
559
559
|
const R = [];
|
|
560
|
-
for (let
|
|
560
|
+
for (let W = 0; W < T - 1; W++) {
|
|
561
561
|
let q;
|
|
562
|
-
const K =
|
|
563
|
-
if (
|
|
564
|
-
q =
|
|
562
|
+
const K = u[W], P = (u[W + 1].index + K.index) / 2;
|
|
563
|
+
if (P % 2 === 0)
|
|
564
|
+
q = f[P].centerPoint;
|
|
565
565
|
else {
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
const [_,
|
|
569
|
-
q = [(_ +
|
|
566
|
+
const B = f[Math.floor(P)], Q = f[Math.ceil(P)];
|
|
567
|
+
if (B && Q) {
|
|
568
|
+
const [_, Me] = B.centerPoint, [Ce, Le] = Q.centerPoint;
|
|
569
|
+
q = [(_ + Ce) / 2, (Me + Le) / 2];
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
if (q) {
|
|
573
|
-
const
|
|
573
|
+
const B = new se({
|
|
574
574
|
geometry: new re(q)
|
|
575
575
|
});
|
|
576
|
-
|
|
576
|
+
B.set("type", "track_arrow"), B.setStyle(
|
|
577
577
|
new H({
|
|
578
578
|
text: new ue({
|
|
579
579
|
font: "700 12px map-iconfont",
|
|
580
580
|
text: ge(""),
|
|
581
|
-
fill: new
|
|
581
|
+
fill: new j({ color: M }),
|
|
582
582
|
// 设置箭头旋转 角度转为弧度
|
|
583
583
|
rotation: Ke(
|
|
584
|
-
|
|
585
|
-
|
|
584
|
+
u[W].center,
|
|
585
|
+
u[W + 1].center
|
|
586
586
|
) * (Math.PI / 180)
|
|
587
587
|
})
|
|
588
588
|
})
|
|
589
|
-
), R.push(
|
|
589
|
+
), R.push(B);
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
const
|
|
593
|
-
|
|
592
|
+
const N = r.get(c).getSource();
|
|
593
|
+
N == null || N.addFeatures(R);
|
|
594
594
|
}, Je = (c) => {
|
|
595
595
|
var T, R;
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
598
|
-
const E = (R =
|
|
596
|
+
const u = e.getView(), f = (T = r == null ? void 0 : r.get(c)) == null ? void 0 : T.getSource(), M = w || (c ? f == null ? void 0 : f.getFeatureById(c) : null);
|
|
597
|
+
if (!M) return;
|
|
598
|
+
const E = (R = M == null ? void 0 : M.getGeometry()) == null ? void 0 : R.getExtent();
|
|
599
599
|
if (E != null && E.length)
|
|
600
600
|
try {
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
} catch (
|
|
604
|
-
console.log(
|
|
601
|
+
const N = Gt(E, Math.max(E[2] - E[0], E[3] - E[1]) * 0.02);
|
|
602
|
+
u.fit(N);
|
|
603
|
+
} catch (N) {
|
|
604
|
+
console.log(N);
|
|
605
605
|
}
|
|
606
606
|
}, mt = (c) => {
|
|
607
|
-
const
|
|
607
|
+
const u = "", E = c.index === 0 ? "#fcdc3f" : "#ff0000";
|
|
608
608
|
return [new H({
|
|
609
609
|
text: new ue({
|
|
610
610
|
font: "Normal 14px map-iconfont",
|
|
611
|
-
text: ge(
|
|
612
|
-
fill: new
|
|
611
|
+
text: ge(u),
|
|
612
|
+
fill: new j({ color: E })
|
|
613
613
|
}),
|
|
614
614
|
zIndex: 101
|
|
615
615
|
})];
|
|
616
616
|
}, wt = () => {
|
|
617
|
-
console.log("清除所有的轨迹-----"),
|
|
618
|
-
var
|
|
619
|
-
(
|
|
620
|
-
}), Object.keys(l).forEach((
|
|
621
|
-
r.delete(
|
|
617
|
+
console.log("清除所有的轨迹-----"), pe(), r.forEach((u) => {
|
|
618
|
+
var f;
|
|
619
|
+
(f = u.getSource()) == null || f.clear(), e == null || e.removeLayer(u);
|
|
620
|
+
}), Object.keys(l).forEach((u) => {
|
|
621
|
+
r.delete(u), delete l[u];
|
|
622
622
|
}), G = !1, Qe();
|
|
623
623
|
}, xt = (c) => {
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
const
|
|
627
|
-
for (let
|
|
628
|
-
const E =
|
|
629
|
-
E.get("class") === "track-label-overlay" ? (E.setPosition(void 0), e.removeOverlay(E)) :
|
|
624
|
+
const u = r.get(c || s);
|
|
625
|
+
u == null || u.setVisible(!1);
|
|
626
|
+
const f = e.getOverlays().getArray();
|
|
627
|
+
for (let M = 0; M < f.length; ) {
|
|
628
|
+
const E = f[M];
|
|
629
|
+
E.get("class") === "track-label-overlay" ? (E.setPosition(void 0), e.removeOverlay(E)) : M++;
|
|
630
630
|
}
|
|
631
|
-
|
|
632
|
-
}, bt = (c,
|
|
633
|
-
const
|
|
631
|
+
pe();
|
|
632
|
+
}, bt = (c, u = we.NM) => {
|
|
633
|
+
const f = {
|
|
634
634
|
id: c,
|
|
635
635
|
length: "--"
|
|
636
636
|
}, E = (l[c] || []).map(
|
|
637
637
|
(R) => xe([R.lon, R.lat], J.data, J.mercator)
|
|
638
638
|
), T = new Pe(E);
|
|
639
|
-
return
|
|
640
|
-
}, kt = (c,
|
|
641
|
-
pt(String(c),
|
|
642
|
-
}, pt = (c,
|
|
643
|
-
const
|
|
644
|
-
|
|
639
|
+
return f.length = no(T, u) || "--", f;
|
|
640
|
+
}, kt = (c, u) => {
|
|
641
|
+
pt(String(c), u);
|
|
642
|
+
}, pt = (c, u) => {
|
|
643
|
+
const f = l[String(c)], M = f == null ? void 0 : f.map((E) => [E.lon, E.lat]);
|
|
644
|
+
M && Lt(M, u);
|
|
645
645
|
}, Oe = new H({
|
|
646
646
|
text: new ue({
|
|
647
647
|
font: "700 20px map-iconfont",
|
|
648
648
|
text: ge(""),
|
|
649
|
-
fill: new
|
|
649
|
+
fill: new j({ color: "#ff0000" }),
|
|
650
650
|
rotation: 0
|
|
651
651
|
// 初始旋转角度
|
|
652
652
|
})
|
|
653
|
-
}), Mt = (c,
|
|
654
|
-
var
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
|
|
653
|
+
}), Mt = (c, u) => {
|
|
654
|
+
var P, B;
|
|
655
|
+
const f = Number(50 * u), M = ((P = c.frameState) == null ? void 0 : P.time) ?? Date.now(), E = M - C;
|
|
656
|
+
if (k = (k + f * E / 1e6) % 2, C = M, k >= 1) {
|
|
657
|
+
pe();
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
660
|
const T = n.getCoordinateAt(
|
|
661
|
-
|
|
661
|
+
k > 1 ? 2 - k : k
|
|
662
662
|
), R = n.getCoordinateAt(
|
|
663
|
-
|
|
664
|
-
),
|
|
665
|
-
|
|
663
|
+
k > 1 ? k - 0.01 : k
|
|
664
|
+
), N = n.getCoordinateAt(
|
|
665
|
+
k > 1 ? 2 - k : k + 0.01
|
|
666
666
|
), q = Ke(
|
|
667
667
|
ot(R, "array"),
|
|
668
|
-
ot(
|
|
668
|
+
ot(N, "array")
|
|
669
669
|
) * Math.PI / 180;
|
|
670
|
-
(
|
|
670
|
+
(B = Oe.getText()) == null || B.setRotation(q), y.setCoordinates(T);
|
|
671
671
|
const K = Yt(c);
|
|
672
672
|
K.setStyle(Oe), K.drawGeometry(y), e == null || e.render();
|
|
673
673
|
}, Ct = () => {
|
|
674
674
|
var c;
|
|
675
|
-
|
|
676
|
-
},
|
|
677
|
-
|
|
678
|
-
}, Lt = (c,
|
|
679
|
-
|
|
675
|
+
V = !0, C = Date.now(), k = 0, y = ((c = m.getGeometry()) == null ? void 0 : c.clone()) || new re([0, 0]), o && (d == null || d.on("postrender", o)), F == null || F.setGeometry(void 0);
|
|
676
|
+
}, pe = () => {
|
|
677
|
+
V && (V = !1, F == null || F.setGeometry(void 0), o && d && d.un("postrender", o), d && (e == null || e.removeLayer(d)), d = null, F = null);
|
|
678
|
+
}, Lt = (c, u) => {
|
|
679
|
+
V && pe(), t = new Ie({
|
|
680
680
|
factor: 1e6
|
|
681
681
|
}).writeGeometry(new Pe(c)), n = new Ie({
|
|
682
682
|
factor: 1e6
|
|
@@ -687,52 +687,52 @@ const co = (e) => {
|
|
|
687
687
|
type: "icon",
|
|
688
688
|
geometry: new re(n.getFirstCoordinate())
|
|
689
689
|
});
|
|
690
|
-
const
|
|
691
|
-
y =
|
|
690
|
+
const f = m.getGeometry();
|
|
691
|
+
y = f ? f.clone() : new re([0, 0]), F = new se({
|
|
692
692
|
type: "geoMarker",
|
|
693
693
|
style: Oe,
|
|
694
694
|
geometry: y
|
|
695
|
-
}),
|
|
695
|
+
}), d = new ve({
|
|
696
696
|
source: new ae({
|
|
697
|
-
features: [
|
|
697
|
+
features: [F]
|
|
698
698
|
})
|
|
699
|
-
}), e == null || e.addLayer(
|
|
700
|
-
}, Ke = (c,
|
|
701
|
-
function
|
|
702
|
-
return 180 * (
|
|
699
|
+
}), e == null || e.addLayer(d), o = (M) => Mt(M, u), Ct();
|
|
700
|
+
}, Ke = (c, u, f) => {
|
|
701
|
+
function M(P) {
|
|
702
|
+
return 180 * (P % (2 * Math.PI)) / Math.PI;
|
|
703
703
|
}
|
|
704
|
-
function E(
|
|
705
|
-
return
|
|
704
|
+
function E(P) {
|
|
705
|
+
return P % 360 * Math.PI / 180;
|
|
706
706
|
}
|
|
707
|
-
function T(
|
|
708
|
-
var
|
|
709
|
-
if (!
|
|
710
|
-
if (!Array.isArray(
|
|
711
|
-
if ((
|
|
712
|
-
return
|
|
713
|
-
if (
|
|
707
|
+
function T(P) {
|
|
708
|
+
var B;
|
|
709
|
+
if (!P) throw new Error("Coordinate is required");
|
|
710
|
+
if (!Array.isArray(P)) {
|
|
711
|
+
if ((P == null ? void 0 : P.type) === "Feature" && (P == null ? void 0 : P.geometry) !== null && ((B = P == null ? void 0 : P.geometry) == null ? void 0 : B.type) === "Point")
|
|
712
|
+
return P == null ? void 0 : P.geometry.coordinates;
|
|
713
|
+
if (P.type === "Point") return (P == null ? void 0 : P.coordinates) || [];
|
|
714
714
|
}
|
|
715
|
-
if (Array.isArray(
|
|
716
|
-
return
|
|
715
|
+
if (Array.isArray(P) && P.length >= 2 && !Array.isArray(P[0]) && !Array.isArray(P[1]))
|
|
716
|
+
return P;
|
|
717
717
|
throw new Error(
|
|
718
718
|
"Coordinate must be GeoJSON Point or an Array of numbers"
|
|
719
719
|
);
|
|
720
720
|
}
|
|
721
|
-
function R(
|
|
722
|
-
if (
|
|
723
|
-
return function(
|
|
724
|
-
return (R(
|
|
725
|
-
}(
|
|
726
|
-
const _ = T(
|
|
727
|
-
return
|
|
721
|
+
function R(P, B, Q = {}) {
|
|
722
|
+
if (Q.final)
|
|
723
|
+
return function(Pt, Ft) {
|
|
724
|
+
return (R(Ft, Pt) + 180) % 360;
|
|
725
|
+
}(P, B);
|
|
726
|
+
const _ = T(P), Me = T(B), Ce = E(_[0]), Le = E(Me[0]), _e = E(_[1]), Re = E(Me[1]), Et = Math.sin(Le - Ce) * Math.cos(Re), Tt = Math.cos(_e) * Math.sin(Re) - Math.sin(_e) * Math.cos(Re) * Math.cos(Le - Ce);
|
|
727
|
+
return M(Math.atan2(Et, Tt));
|
|
728
728
|
}
|
|
729
|
-
function
|
|
730
|
-
return !isNaN(
|
|
729
|
+
function N(P) {
|
|
730
|
+
return !isNaN(P) && P !== null && !Array.isArray(P);
|
|
731
731
|
}
|
|
732
|
-
function
|
|
733
|
-
return
|
|
732
|
+
function W(P, B = {}, Q = {}) {
|
|
733
|
+
return P || console.log("Coordinates are required"), Array.isArray(P) || console.log("Coordinates must be an Array"), P.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!N(P[0]) || !N(P[1])) && console.log("Coordinates must contain numbers"), q({ type: "Point", coordinates: P }, B, Q);
|
|
734
734
|
}
|
|
735
|
-
function q(
|
|
735
|
+
function q(P, B = {}, Q = {}) {
|
|
736
736
|
const _ = {
|
|
737
737
|
type: "Feature",
|
|
738
738
|
id: "",
|
|
@@ -740,9 +740,9 @@ const co = (e) => {
|
|
|
740
740
|
bbox: {},
|
|
741
741
|
geometry: {}
|
|
742
742
|
};
|
|
743
|
-
return
|
|
743
|
+
return Q.id !== void 0 && (_.id = Q.id), Q.bbox && (_.bbox = Q.bbox), _.properties = B, _.geometry = P, _;
|
|
744
744
|
}
|
|
745
|
-
const K = R(
|
|
745
|
+
const K = R(W(c), W(u), f);
|
|
746
746
|
return K < 0 ? 360 + K : K;
|
|
747
747
|
};
|
|
748
748
|
return {
|
|
@@ -752,13 +752,13 @@ const co = (e) => {
|
|
|
752
752
|
setCenter: Je,
|
|
753
753
|
close: xt,
|
|
754
754
|
getLength: bt,
|
|
755
|
-
handleTrackMapEvent:
|
|
755
|
+
handleTrackMapEvent: $,
|
|
756
756
|
reRenderTrackLine: i
|
|
757
757
|
};
|
|
758
758
|
};
|
|
759
759
|
function ao(e) {
|
|
760
760
|
console.log("useShipOverlay", e);
|
|
761
|
-
const r = U(null), l =
|
|
761
|
+
const r = U(null), l = Ee(() => ({
|
|
762
762
|
"--overlay-color": "#FFF",
|
|
763
763
|
"--bg-color1": e.colors && e.colors[0] ? e.colors[0] : "#ffffff",
|
|
764
764
|
// 默认第一个颜色
|
|
@@ -766,7 +766,7 @@ function ao(e) {
|
|
|
766
766
|
"--bg-color": "#ffffff",
|
|
767
767
|
position: "relative",
|
|
768
768
|
"pointer-events": "none"
|
|
769
|
-
})), s =
|
|
769
|
+
})), s = Ee(() => {
|
|
770
770
|
var v;
|
|
771
771
|
return {
|
|
772
772
|
position: "relative",
|
|
@@ -787,12 +787,12 @@ function ao(e) {
|
|
|
787
787
|
animation: e.selected ? e.colors && ((v = e.colors) == null ? void 0 : v.length) >= 2 ? "blink-dual 2s ease-in-out infinite" : "blink-single 1.5s ease-in-out infinite" : "none"
|
|
788
788
|
// "animation": props.selected ? 'blink 1.5s ease-in-out infinite' : 'none', // 动画开关
|
|
789
789
|
};
|
|
790
|
-
}), a =
|
|
790
|
+
}), a = Ee(() => ({
|
|
791
791
|
width: "14px",
|
|
792
792
|
height: "14px",
|
|
793
793
|
margin: "1px 5px 1px 1px",
|
|
794
794
|
"background-color": "var(--attention-bg)"
|
|
795
|
-
})), o =
|
|
795
|
+
})), o = Ee(() => ({
|
|
796
796
|
position: "absolute",
|
|
797
797
|
top: "0px",
|
|
798
798
|
color: "var(--overlay-color)",
|
|
@@ -902,13 +902,13 @@ const go = (e) => {
|
|
|
902
902
|
}
|
|
903
903
|
return ne.scaleNum;
|
|
904
904
|
}, fo = (e, r, l) => {
|
|
905
|
-
const { color: s, direct: a, isHighlight: o, shipData: v } = e.getProperties(),
|
|
905
|
+
const { color: s, direct: a, isHighlight: o, shipData: v } = e.getProperties(), b = ((v == null ? void 0 : v.cog) - 90 + 360) % 360;
|
|
906
906
|
return new H({
|
|
907
|
-
image: new
|
|
907
|
+
image: new Ve({
|
|
908
908
|
src: t(),
|
|
909
909
|
scale: r || ne.scaleNum,
|
|
910
910
|
anchor: [0.5, 0.5],
|
|
911
|
-
rotation:
|
|
911
|
+
rotation: b * Math.PI / 180,
|
|
912
912
|
rotateWithView: !1
|
|
913
913
|
})
|
|
914
914
|
});
|
|
@@ -966,7 +966,7 @@ const go = (e) => {
|
|
|
966
966
|
}, ut = (e) => {
|
|
967
967
|
const r = document.createElement("div");
|
|
968
968
|
r.className = "ship-overlay-box", r.style.position = "relative";
|
|
969
|
-
const { lon: l, lat: s, blinking: a, blinkingColors: o, name: v } = e,
|
|
969
|
+
const { lon: l, lat: s, blinking: a, blinkingColors: o, name: v } = e, b = Ae({
|
|
970
970
|
setup() {
|
|
971
971
|
return ao({
|
|
972
972
|
position: [l + 2e-3, s + 2e-3],
|
|
@@ -979,7 +979,7 @@ const go = (e) => {
|
|
|
979
979
|
});
|
|
980
980
|
}
|
|
981
981
|
});
|
|
982
|
-
return St(
|
|
982
|
+
return St(b, r), r;
|
|
983
983
|
}, rt = (e) => {
|
|
984
984
|
const r = [];
|
|
985
985
|
return e.existDevice && r.push(""), e.existMobile && r.push(""), e.existWaterGauge && r.push(""), r;
|
|
@@ -999,68 +999,68 @@ const mo = window.devicePixelRatio || 1;
|
|
|
999
999
|
function wo(e, r, l = "left-bottom", s = 2) {
|
|
1000
1000
|
const a = document.createElement("canvas"), o = a.getContext("2d");
|
|
1001
1001
|
if (!o) return "";
|
|
1002
|
-
const v = 2,
|
|
1002
|
+
const v = 2, b = 8, t = 16, n = window.devicePixelRatio || 1, m = "500 12px Arial", y = "14px map-iconfont";
|
|
1003
1003
|
o.font = m;
|
|
1004
|
-
const
|
|
1004
|
+
const V = o.measureText(e).width;
|
|
1005
1005
|
o.font = y;
|
|
1006
|
-
const
|
|
1007
|
-
let G,
|
|
1008
|
-
switch (G = t +
|
|
1006
|
+
const C = r.map((p) => ({ width: o.measureText(ge(p)).width, height: 14 })), d = C.reduce((p, S) => p + S.width, 0), k = (r.length - 1) * s, w = b + V + d + k + b, x = v + 14 + v;
|
|
1007
|
+
let G, Z, Y = 0, X = 0, O = 0, A = 0, i = 0, g = 0;
|
|
1008
|
+
switch (G = t + w, l) {
|
|
1009
1009
|
case "right-top":
|
|
1010
|
-
|
|
1010
|
+
Z = t + x, Y = 0, X = t + x, O = t, A = 0, i = t, g = 0;
|
|
1011
1011
|
break;
|
|
1012
1012
|
case "right-middle":
|
|
1013
|
-
|
|
1013
|
+
Z = x, Y = 0, X = x / 2, O = t, A = x / 2, i = t, g = 0;
|
|
1014
1014
|
break;
|
|
1015
1015
|
case "right-bottom":
|
|
1016
|
-
|
|
1016
|
+
Z = t + x, Y = 0, X = 0, O = t, A = t, i = t, g = t;
|
|
1017
1017
|
break;
|
|
1018
1018
|
case "left-top":
|
|
1019
|
-
|
|
1019
|
+
Z = t + x, Y = w, X = t, O = w + t, A = x + t, i = 0, g = 0;
|
|
1020
1020
|
break;
|
|
1021
1021
|
case "left-middle":
|
|
1022
|
-
|
|
1022
|
+
Z = x, Y = w, X = x / 2, O = w + t, A = x / 2, i = 0, g = 0;
|
|
1023
1023
|
break;
|
|
1024
1024
|
case "left-bottom":
|
|
1025
|
-
|
|
1025
|
+
Z = t + x, Y = w, X = x, O = w + t, A = 0, i = 0, g = t;
|
|
1026
1026
|
break;
|
|
1027
1027
|
}
|
|
1028
|
-
a.width = Math.round(G * n), a.height = Math.round(
|
|
1029
|
-
const h =
|
|
1030
|
-
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, i +
|
|
1031
|
-
let L = i +
|
|
1032
|
-
return r.length > 0 && r.forEach((
|
|
1033
|
-
const z =
|
|
1034
|
-
o.fillText(ge(
|
|
1028
|
+
Z = Z + v, a.width = Math.round(G * n), a.height = Math.round(Z * n), o.scale(n, n), o.clearRect(0, 0, G, Z), o.beginPath(), o.moveTo(Y, X), o.lineTo(O, A), o.strokeStyle = "#FFF", o.lineWidth = 1, o.stroke(), o.fillStyle = "#FFF", o.fillRect(i, g, w, x), o.font = m, o.textBaseline = "middle";
|
|
1029
|
+
const h = g + v + x / 2;
|
|
1030
|
+
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, i + b, h), o.fillStyle = "#000000", o.fillText(e, i + b, h), o.font = y, o.fillStyle = "#3370ff";
|
|
1031
|
+
let L = i + b + V + s;
|
|
1032
|
+
return r.length > 0 && r.forEach((p, S) => {
|
|
1033
|
+
const z = g + v + x / 2;
|
|
1034
|
+
o.fillText(ge(p), L, z), L += C[S].width + s;
|
|
1035
1035
|
}), a.toDataURL("image/png");
|
|
1036
1036
|
}
|
|
1037
1037
|
const nt = (e, r) => {
|
|
1038
1038
|
const { name: l, rightIcons: s, selected: a } = e.getProperties(), o = r !== 1 ? ho() : "right-top", v = wo(l, s, o);
|
|
1039
|
-
let
|
|
1039
|
+
let b = [0, 0];
|
|
1040
1040
|
switch (o) {
|
|
1041
1041
|
case "right-top":
|
|
1042
|
-
|
|
1042
|
+
b = [0, 1];
|
|
1043
1043
|
break;
|
|
1044
1044
|
case "right-middle":
|
|
1045
|
-
|
|
1045
|
+
b = [0, 0.5];
|
|
1046
1046
|
break;
|
|
1047
1047
|
case "right-bottom":
|
|
1048
|
-
|
|
1048
|
+
b = [0, 0];
|
|
1049
1049
|
break;
|
|
1050
1050
|
case "left-top":
|
|
1051
|
-
|
|
1051
|
+
b = [1, 1];
|
|
1052
1052
|
break;
|
|
1053
1053
|
case "left-middle":
|
|
1054
|
-
|
|
1054
|
+
b = [1, 0.5];
|
|
1055
1055
|
break;
|
|
1056
1056
|
case "left-bottom":
|
|
1057
|
-
|
|
1057
|
+
b = [1, 0];
|
|
1058
1058
|
break;
|
|
1059
1059
|
}
|
|
1060
1060
|
return new H({
|
|
1061
|
-
image: new
|
|
1061
|
+
image: new Ve({
|
|
1062
1062
|
src: v,
|
|
1063
|
-
anchor:
|
|
1063
|
+
anchor: b,
|
|
1064
1064
|
displacement: [0, 0],
|
|
1065
1065
|
scale: 1 / mo,
|
|
1066
1066
|
anchorXUnits: "fraction",
|
|
@@ -1085,24 +1085,24 @@ const nt = (e, r) => {
|
|
|
1085
1085
|
declutter: !0
|
|
1086
1086
|
});
|
|
1087
1087
|
e == null || e.addLayer(a), e == null || e.addLayer(v);
|
|
1088
|
-
let
|
|
1088
|
+
let b = null, t = "", n = {}, m = {};
|
|
1089
1089
|
const y = (i) => {
|
|
1090
1090
|
if (!i || !e) return;
|
|
1091
|
-
const
|
|
1091
|
+
const g = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id"));
|
|
1092
1092
|
if (l) {
|
|
1093
|
-
const h = i.filter((L) => L.id ===
|
|
1093
|
+
const h = i.filter((L) => L.id === g);
|
|
1094
1094
|
h.length === 0 ? i.push(l) : l = h[0];
|
|
1095
1095
|
}
|
|
1096
|
-
|
|
1097
|
-
},
|
|
1098
|
-
var
|
|
1099
|
-
const
|
|
1096
|
+
d(), k(!0), A(i), V();
|
|
1097
|
+
}, F = (i) => {
|
|
1098
|
+
var $;
|
|
1099
|
+
const g = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id")), h = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), L = (($ = m[i.id]) == null ? void 0 : $.blinkColors) || [], S = L[L.length - 1] || i.fill || "#04C900", z = go(i), D = new se({
|
|
1100
1100
|
geometry: new re(h),
|
|
1101
1101
|
// 船舶数据
|
|
1102
1102
|
shipData: i,
|
|
1103
1103
|
id: i.id,
|
|
1104
1104
|
name: i.cnname || i.enname || i.name || i.id || "未命名船舶",
|
|
1105
|
-
selected: i.id ===
|
|
1105
|
+
selected: i.id === g,
|
|
1106
1106
|
// 图标
|
|
1107
1107
|
rightIcons: rt(i),
|
|
1108
1108
|
// 是否闪烁
|
|
@@ -1110,126 +1110,126 @@ const nt = (e, r) => {
|
|
|
1110
1110
|
// // 闪烁颜色
|
|
1111
1111
|
// blinkingColor: attentionShipsColor[ship.id].blinkColors || '',
|
|
1112
1112
|
// 船舶颜色
|
|
1113
|
-
color:
|
|
1113
|
+
color: S,
|
|
1114
1114
|
// 船艏向的方向
|
|
1115
1115
|
direct: z,
|
|
1116
1116
|
// 高亮
|
|
1117
1117
|
isHighlight: !1
|
|
1118
1118
|
});
|
|
1119
|
-
return
|
|
1120
|
-
},
|
|
1119
|
+
return D.set("clickGeometry", new qt(h)), D;
|
|
1120
|
+
}, V = async () => {
|
|
1121
1121
|
if (!l || !e) return;
|
|
1122
|
-
let
|
|
1123
|
-
if (
|
|
1122
|
+
let g = e.getOverlays().getArray().find((h) => h.get("class") == "ship-overlay-selected");
|
|
1123
|
+
if (g) {
|
|
1124
1124
|
const h = dt(e, l);
|
|
1125
|
-
await
|
|
1125
|
+
await g.setElement(h), await g.setPosition(I([l.lon, l.lat]));
|
|
1126
1126
|
} else
|
|
1127
|
-
|
|
1127
|
+
g = vo(e, l), g && e.addOverlay(g);
|
|
1128
1128
|
setTimeout(() => {
|
|
1129
1129
|
var h;
|
|
1130
|
-
|
|
1130
|
+
g && ((h = g.get("element")) != null && h.parentElement) && (g.get("element").parentElement.style.display = "block");
|
|
1131
1131
|
}, 20);
|
|
1132
|
-
},
|
|
1132
|
+
}, C = (i) => {
|
|
1133
1133
|
if (i === "start") {
|
|
1134
|
-
const
|
|
1135
|
-
s.getFeatures().forEach((
|
|
1136
|
-
|
|
1134
|
+
const g = () => {
|
|
1135
|
+
s.getFeatures().forEach((p) => {
|
|
1136
|
+
p.setStyle(ye(e, p));
|
|
1137
1137
|
});
|
|
1138
|
-
const L = (e == null ? void 0 : e.getOverlays().getArray()).find((
|
|
1138
|
+
const L = (e == null ? void 0 : e.getOverlays().getArray()).find((p) => p.get("class") == "ship-overlay-selected");
|
|
1139
1139
|
if (L) {
|
|
1140
|
-
const
|
|
1141
|
-
console.log("scaleFactor",
|
|
1140
|
+
const p = L.getElement(), S = je(e, l, "ship");
|
|
1141
|
+
console.log("scaleFactor", S), p.style.transform = `scale(${S})`;
|
|
1142
1142
|
}
|
|
1143
|
-
|
|
1143
|
+
b = requestAnimationFrame(g);
|
|
1144
1144
|
};
|
|
1145
|
-
|
|
1146
|
-
} else i === "end" &&
|
|
1147
|
-
},
|
|
1148
|
-
e && s && (s.clear(), o.clear(),
|
|
1149
|
-
},
|
|
1150
|
-
const
|
|
1151
|
-
if (
|
|
1152
|
-
for (let h = 0; h <
|
|
1153
|
-
if (!i &&
|
|
1154
|
-
const L =
|
|
1145
|
+
g();
|
|
1146
|
+
} else i === "end" && b && (cancelAnimationFrame(b), b = null);
|
|
1147
|
+
}, d = () => {
|
|
1148
|
+
e && s && (s.clear(), o.clear(), k(), C("end"));
|
|
1149
|
+
}, k = (i) => {
|
|
1150
|
+
const g = e.getOverlays().getArray().filter((h) => h.get("class") == "zh-map-ship-overlay");
|
|
1151
|
+
if (g && g.length > 0) {
|
|
1152
|
+
for (let h = 0; h < g.length; h++)
|
|
1153
|
+
if (!i && g[h].get("class") !== "ship-overlay-selected") {
|
|
1154
|
+
const L = g[h];
|
|
1155
1155
|
L.setPosition(void 0), e.removeOverlay(L), L.dispose();
|
|
1156
1156
|
}
|
|
1157
1157
|
}
|
|
1158
|
-
},
|
|
1159
|
-
n = i, m =
|
|
1158
|
+
}, w = (i, g) => {
|
|
1159
|
+
n = i, m = g;
|
|
1160
1160
|
const h = e.getOverlays().getArray(), L = s.getFeatures();
|
|
1161
|
-
for (const
|
|
1162
|
-
const
|
|
1163
|
-
if (z &&
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1161
|
+
for (const p in n) {
|
|
1162
|
+
const S = n[p], z = h.find(($) => $.getId() === "label-" + p), D = L.find(($) => p === $.get("id"));
|
|
1163
|
+
if (z && D) {
|
|
1164
|
+
const $ = g[p].blinkColors || [], { shipData: ce, name: te, color: le } = D.getProperties();
|
|
1165
|
+
D.set("blinking", S), $[($ == null ? void 0 : $.length) - 1] && le !== $[($ == null ? void 0 : $.length) - 1] && (D.set("color", $[($ == null ? void 0 : $.length) - 1] || ""), D.setStyle(ye(e, D)));
|
|
1166
1166
|
const ze = {
|
|
1167
1167
|
...ce,
|
|
1168
|
-
blinking:
|
|
1169
|
-
blinkingColors:
|
|
1170
|
-
name: te + "(" +
|
|
1171
|
-
},
|
|
1172
|
-
|
|
1168
|
+
blinking: S,
|
|
1169
|
+
blinkingColors: $ || [],
|
|
1170
|
+
name: te + "(" + g[p].shipState + ")"
|
|
1171
|
+
}, be = z.getElement(), ke = ut(ze);
|
|
1172
|
+
be && be !== ke && z.setElement(ke);
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
},
|
|
1175
|
+
}, x = (i) => {
|
|
1176
1176
|
if (!e) return;
|
|
1177
|
-
const
|
|
1178
|
-
i.forEach((
|
|
1179
|
-
z.set(
|
|
1177
|
+
const g = s.getFeatures(), h = o.getFeatures(), L = r ? r.get("id") : "", p = g.filter(($) => $.get("id") !== L), S = h == null ? void 0 : h.filter(($) => $.get("id") !== L), z = /* @__PURE__ */ new Map();
|
|
1178
|
+
i.forEach(($) => {
|
|
1179
|
+
z.set($.id, !0);
|
|
1180
1180
|
});
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1183
|
-
const ce =
|
|
1181
|
+
const D = e.getOverlays().getArray();
|
|
1182
|
+
p.forEach(($) => {
|
|
1183
|
+
const ce = $.get("id");
|
|
1184
1184
|
if (!z.has(ce))
|
|
1185
|
-
|
|
1185
|
+
$.setStyle([]);
|
|
1186
1186
|
else {
|
|
1187
|
-
const le =
|
|
1188
|
-
(le == null ? void 0 : le.length) == 0 &&
|
|
1187
|
+
const le = $.getStyle();
|
|
1188
|
+
(le == null ? void 0 : le.length) == 0 && $.setStyle(ye(e, $));
|
|
1189
1189
|
}
|
|
1190
|
-
const te =
|
|
1190
|
+
const te = D.find((le) => le.getId() === "label-" + ce);
|
|
1191
1191
|
te && te.setPosition(void 0);
|
|
1192
|
-
}), console.log(
|
|
1193
|
-
const ce =
|
|
1192
|
+
}), console.log(S), S.forEach(($) => {
|
|
1193
|
+
const ce = $.get("id");
|
|
1194
1194
|
if (!z.has(ce))
|
|
1195
|
-
|
|
1195
|
+
$.setStyle([]);
|
|
1196
1196
|
else {
|
|
1197
|
-
const te =
|
|
1198
|
-
(te == null ? void 0 : te.length) == 0 &&
|
|
1197
|
+
const te = $.getStyle();
|
|
1198
|
+
(te == null ? void 0 : te.length) == 0 && $.setStyle(nt($));
|
|
1199
1199
|
}
|
|
1200
1200
|
});
|
|
1201
1201
|
}, G = (i) => {
|
|
1202
1202
|
if (i) {
|
|
1203
1203
|
console.log("选中", i);
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1204
|
+
const g = s.getFeatures().find((L) => L.get("id") === i.id), h = o.getFeatures().find((L) => L.get("id") === i.id);
|
|
1205
|
+
g && (r = g), h && h.set("selected", !0), l = i, V();
|
|
1206
1206
|
} else
|
|
1207
1207
|
console.log("取消选中"), l = null, r = null, X();
|
|
1208
|
-
},
|
|
1208
|
+
}, Z = qe((i, g, h) => {
|
|
1209
1209
|
try {
|
|
1210
1210
|
if (i) {
|
|
1211
|
-
const L = i.get("shipData"),
|
|
1212
|
-
if (e.getTargetElement().style.cursor =
|
|
1213
|
-
t && t !==
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1211
|
+
const L = i.get("shipData"), p = i.get("id");
|
|
1212
|
+
if (e.getTargetElement().style.cursor = p ? "pointer" : "", g === "click" && (G(L), h && h(p)), g === "hover") {
|
|
1213
|
+
t && t !== p && Y(), t = p;
|
|
1214
|
+
const S = s.getFeatures().find((z) => z.get("id") === t);
|
|
1215
|
+
S == null || S.set("isHighlight", !0), S == null || S.setStyle(ye(e, S));
|
|
1216
1216
|
}
|
|
1217
1217
|
} else
|
|
1218
|
-
e.getTargetElement().style.cursor = "",
|
|
1218
|
+
e.getTargetElement().style.cursor = "", Y();
|
|
1219
1219
|
} catch (L) {
|
|
1220
1220
|
console.log("handleShipMapEvent", L);
|
|
1221
1221
|
}
|
|
1222
|
-
}, 10),
|
|
1223
|
-
const i = t ? s.getFeatures().find((
|
|
1222
|
+
}, 10), Y = () => {
|
|
1223
|
+
const i = t ? s.getFeatures().find((g) => g.get("id") === t) : null;
|
|
1224
1224
|
t = null, i == null || i.set("isHighlight", !1), i == null || i.setStyle(ye(e, i));
|
|
1225
1225
|
}, X = () => {
|
|
1226
1226
|
try {
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1227
|
+
const g = e.getOverlays().getArray().find((h) => h.get("class") == "ship-overlay-selected");
|
|
1228
|
+
g && g.setPosition(void 0);
|
|
1229
1229
|
} catch (i) {
|
|
1230
1230
|
console.log(i);
|
|
1231
1231
|
}
|
|
1232
|
-
}, O = (i,
|
|
1232
|
+
}, O = (i, g) => {
|
|
1233
1233
|
const h = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), L = new se({
|
|
1234
1234
|
geometry: new re(h),
|
|
1235
1235
|
name: i.cnname || i.enname || i.name || i.id || "未命名船舶",
|
|
@@ -1239,37 +1239,37 @@ const nt = (e, r) => {
|
|
|
1239
1239
|
shipData: i
|
|
1240
1240
|
});
|
|
1241
1241
|
L.set("id", i.id);
|
|
1242
|
-
const
|
|
1243
|
-
return L.setStyle(
|
|
1244
|
-
},
|
|
1245
|
-
const
|
|
1242
|
+
const p = nt(L, g);
|
|
1243
|
+
return L.setStyle(p), L;
|
|
1244
|
+
}, A = (i) => {
|
|
1245
|
+
const g = e.getView().getZoom();
|
|
1246
1246
|
i.forEach((h) => {
|
|
1247
|
-
const L =
|
|
1248
|
-
if (L.setStyle(ye(e, L)), s.addFeature(L), (l == null ? void 0 : l.id) == h.id ||
|
|
1247
|
+
const L = F(h);
|
|
1248
|
+
if (L.setStyle(ye(e, L)), s.addFeature(L), (l == null ? void 0 : l.id) == h.id || g >= ne.shipModelMin)
|
|
1249
1249
|
if (n[h.id]) {
|
|
1250
1250
|
if (h.id && m[h == null ? void 0 : h.id]) {
|
|
1251
|
-
const
|
|
1251
|
+
const p = m[h == null ? void 0 : h.id] || {}, S = (p == null ? void 0 : p.blinkColors) || [], z = (p == null ? void 0 : p.shipState) || "", D = (h.cnname || h.enname || h.name || h.id || "未命名船舶") + "(" + z + ")", $ = {
|
|
1252
1252
|
...h,
|
|
1253
|
-
name:
|
|
1253
|
+
name: D,
|
|
1254
1254
|
blinking: n[h.id],
|
|
1255
|
-
blinkingColors:
|
|
1255
|
+
blinkingColors: S || []
|
|
1256
1256
|
};
|
|
1257
|
-
yo(e,
|
|
1257
|
+
yo(e, $);
|
|
1258
1258
|
}
|
|
1259
1259
|
} else {
|
|
1260
|
-
const
|
|
1261
|
-
o.addFeature(
|
|
1260
|
+
const p = O(h, i.length);
|
|
1261
|
+
o.addFeature(p);
|
|
1262
1262
|
}
|
|
1263
1263
|
});
|
|
1264
1264
|
};
|
|
1265
1265
|
return {
|
|
1266
1266
|
render: y,
|
|
1267
1267
|
selected: G,
|
|
1268
|
-
filter:
|
|
1269
|
-
blinking:
|
|
1270
|
-
clear:
|
|
1271
|
-
handleShipMapEvent:
|
|
1272
|
-
changeShipScale:
|
|
1268
|
+
filter: x,
|
|
1269
|
+
blinking: w,
|
|
1270
|
+
clear: d,
|
|
1271
|
+
handleShipMapEvent: Z,
|
|
1272
|
+
changeShipScale: C
|
|
1273
1273
|
};
|
|
1274
1274
|
}, bo = (e) => {
|
|
1275
1275
|
const r = () => e == null ? void 0 : e.getLayers(), l = U("vector"), s = () => l.value, a = (t) => {
|
|
@@ -1316,68 +1316,68 @@ const nt = (e, r) => {
|
|
|
1316
1316
|
}, po = (e) => {
|
|
1317
1317
|
const r = "zh-map-location-layer";
|
|
1318
1318
|
let l, s, a = null, o = null;
|
|
1319
|
-
const v = (
|
|
1320
|
-
if (!(!
|
|
1319
|
+
const v = (C) => {
|
|
1320
|
+
if (!(!C || C.length === 0)) {
|
|
1321
1321
|
if (s || (s = new ae()), s.clear(), o) {
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1322
|
+
const d = C.find((k) => k.id === o.id);
|
|
1323
|
+
d ? o = d : C.push(o);
|
|
1324
1324
|
}
|
|
1325
|
-
|
|
1326
|
-
|
|
1325
|
+
C.forEach((d) => {
|
|
1326
|
+
b(d);
|
|
1327
1327
|
}), l || (l = new ve({
|
|
1328
1328
|
className: r,
|
|
1329
1329
|
source: s,
|
|
1330
1330
|
zIndex: 100
|
|
1331
1331
|
}), e == null || e.addLayer(l));
|
|
1332
1332
|
}
|
|
1333
|
-
},
|
|
1334
|
-
const
|
|
1335
|
-
geometry: new re(I([Number(
|
|
1333
|
+
}, b = (C) => {
|
|
1334
|
+
const d = e == null ? void 0 : e.getView().getZoom(), [k, w] = C.latLon.split(","), x = new se({
|
|
1335
|
+
geometry: new re(I([Number(k), Number(w)]))
|
|
1336
1336
|
});
|
|
1337
|
-
|
|
1338
|
-
}, t = (
|
|
1339
|
-
const
|
|
1340
|
-
image: new
|
|
1341
|
-
src:
|
|
1342
|
-
scale: 0.5 *
|
|
1337
|
+
x.setStyle(t(C, d, C.id === (o == null ? void 0 : o.id))), x.set("loactionData", C), s.addFeature(x);
|
|
1338
|
+
}, t = (C, d, k) => {
|
|
1339
|
+
const w = {
|
|
1340
|
+
image: new Ve({
|
|
1341
|
+
src: k && C.selectedPath || C.defaultPath,
|
|
1342
|
+
scale: 0.5 * d / 10
|
|
1343
1343
|
})
|
|
1344
1344
|
};
|
|
1345
|
-
return
|
|
1346
|
-
text:
|
|
1345
|
+
return C.name && (w.text = new ue({
|
|
1346
|
+
text: C.name,
|
|
1347
1347
|
font: "12px sans-serif",
|
|
1348
|
-
fill: new
|
|
1348
|
+
fill: new j({
|
|
1349
1349
|
color: "#000000"
|
|
1350
1350
|
}),
|
|
1351
|
-
backgroundFill: new
|
|
1351
|
+
backgroundFill: new j({
|
|
1352
1352
|
color: "#FFFFFF"
|
|
1353
1353
|
}),
|
|
1354
1354
|
offsetY: 30
|
|
1355
|
-
})), new H(
|
|
1355
|
+
})), new H(w);
|
|
1356
1356
|
}, n = () => {
|
|
1357
1357
|
if (a) {
|
|
1358
|
-
const
|
|
1359
|
-
s.getFeatures().forEach((
|
|
1360
|
-
|
|
1358
|
+
const C = a.get("loactionData").id;
|
|
1359
|
+
s.getFeatures().forEach((d) => {
|
|
1360
|
+
d.get("loactionData").id !== C && s.removeFeature(d);
|
|
1361
1361
|
});
|
|
1362
1362
|
} else
|
|
1363
1363
|
s.clear();
|
|
1364
1364
|
}, m = () => {
|
|
1365
|
-
var
|
|
1366
|
-
const
|
|
1367
|
-
s.getFeatures().forEach((
|
|
1368
|
-
|
|
1365
|
+
var w;
|
|
1366
|
+
const C = a.get("loactionData"), d = (w = e == null ? void 0 : e.getView()) == null ? void 0 : w.getZoom();
|
|
1367
|
+
s.getFeatures().forEach((x) => {
|
|
1368
|
+
x.get("loactionData").id === C.id && (x == null || x.setStyle(t(C, d, !1)));
|
|
1369
1369
|
}), o = null, a = null;
|
|
1370
|
-
}, y = (
|
|
1371
|
-
|
|
1372
|
-
},
|
|
1373
|
-
var
|
|
1370
|
+
}, y = (C) => {
|
|
1371
|
+
C ? (F(), V(C)) : clearSelectedPort();
|
|
1372
|
+
}, F = () => {
|
|
1373
|
+
var C;
|
|
1374
1374
|
if (a) {
|
|
1375
|
-
const
|
|
1376
|
-
a.setStyle(t(
|
|
1375
|
+
const d = a.get("loactionData"), k = (C = e == null ? void 0 : e.getView()) == null ? void 0 : C.getZoom();
|
|
1376
|
+
a.setStyle(t(d, k, !1));
|
|
1377
1377
|
}
|
|
1378
|
-
},
|
|
1379
|
-
const
|
|
1380
|
-
o =
|
|
1378
|
+
}, V = (C) => {
|
|
1379
|
+
const d = s.getFeatures();
|
|
1380
|
+
o = C, a = d.find((k) => k.get("loactionData").id === C.id);
|
|
1381
1381
|
};
|
|
1382
1382
|
return {
|
|
1383
1383
|
render: v,
|
|
@@ -1393,7 +1393,7 @@ const nt = (e, r) => {
|
|
|
1393
1393
|
e.getInteractions().forEach((r) => {
|
|
1394
1394
|
r instanceof st && r.setActive(!0);
|
|
1395
1395
|
});
|
|
1396
|
-
},
|
|
1396
|
+
}, $e = (e, r) => {
|
|
1397
1397
|
const l = e.getViewport();
|
|
1398
1398
|
l && (l.style.cursor = r);
|
|
1399
1399
|
}, Lo = (e, r) => {
|
|
@@ -1401,10 +1401,10 @@ const nt = (e, r) => {
|
|
|
1401
1401
|
s.value = i;
|
|
1402
1402
|
};
|
|
1403
1403
|
let o;
|
|
1404
|
-
const v = U(!1),
|
|
1405
|
-
|
|
1404
|
+
const v = U(!1), b = () => {
|
|
1405
|
+
$e(e, "crosshair"), m(), Mo(e), e.on("pointermove", V), e.getViewport().addEventListener("mouseout", () => {
|
|
1406
1406
|
o && o.classList.add("hidden");
|
|
1407
|
-
}),
|
|
1407
|
+
}), d(), v.value = !0;
|
|
1408
1408
|
};
|
|
1409
1409
|
let t, n;
|
|
1410
1410
|
const m = () => {
|
|
@@ -1420,20 +1420,20 @@ const nt = (e, r) => {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
}), e == null || e.addLayer(n);
|
|
1422
1422
|
};
|
|
1423
|
-
let y,
|
|
1424
|
-
const
|
|
1423
|
+
let y, F;
|
|
1424
|
+
const V = (i) => {
|
|
1425
1425
|
if (i.dragging)
|
|
1426
1426
|
return;
|
|
1427
|
-
let
|
|
1428
|
-
y && (
|
|
1427
|
+
let g = "点击选择起点";
|
|
1428
|
+
y && (g = "单击继续,双击结束"), o && (o.innerHTML = g, F.setPosition(i.coordinate), o.classList.remove("hidden"));
|
|
1429
1429
|
};
|
|
1430
|
-
let
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1430
|
+
let C;
|
|
1431
|
+
const d = () => {
|
|
1432
|
+
C = new Fe({
|
|
1433
1433
|
source: t,
|
|
1434
1434
|
type: "LineString",
|
|
1435
1435
|
style: new H({
|
|
1436
|
-
fill: new
|
|
1436
|
+
fill: new j({
|
|
1437
1437
|
color: "rgba(255, 255, 255, 0.2)"
|
|
1438
1438
|
}),
|
|
1439
1439
|
stroke: new fe({
|
|
@@ -1441,89 +1441,89 @@ const nt = (e, r) => {
|
|
|
1441
1441
|
lineDash: [10, 10],
|
|
1442
1442
|
width: 2
|
|
1443
1443
|
}),
|
|
1444
|
-
image: new
|
|
1444
|
+
image: new Se({
|
|
1445
1445
|
radius: 5,
|
|
1446
1446
|
stroke: new fe({
|
|
1447
1447
|
color: "rgba(0, 0, 0, 0.7)"
|
|
1448
1448
|
}),
|
|
1449
|
-
fill: new
|
|
1449
|
+
fill: new j({
|
|
1450
1450
|
color: "rgba(255, 255, 255, 0.2)"
|
|
1451
1451
|
})
|
|
1452
1452
|
})
|
|
1453
1453
|
}),
|
|
1454
1454
|
// 添加条件函数,判断是否应该出发点绘制
|
|
1455
|
-
condition: (
|
|
1456
|
-
}), e == null || e.addInteraction(
|
|
1455
|
+
condition: (g) => g.originalEvent.target.tagName !== "DIV"
|
|
1456
|
+
}), e == null || e.addInteraction(C), G(), Z();
|
|
1457
1457
|
let i;
|
|
1458
|
-
|
|
1458
|
+
C.on("drawstart", function(g) {
|
|
1459
1459
|
var L;
|
|
1460
|
-
y =
|
|
1460
|
+
y = g.feature, y.set("randomId", k());
|
|
1461
1461
|
let h;
|
|
1462
|
-
i = (L = y.getGeometry()) == null ? void 0 : L.on("change", function(
|
|
1463
|
-
const
|
|
1464
|
-
h =
|
|
1462
|
+
i = (L = y.getGeometry()) == null ? void 0 : L.on("change", function(p) {
|
|
1463
|
+
const S = p.target, z = gt(S, s.value);
|
|
1464
|
+
h = S.getLastCoordinate(), w && z && (w.innerHTML = z), x.setPosition(h);
|
|
1465
1465
|
});
|
|
1466
|
-
}),
|
|
1467
|
-
var
|
|
1468
|
-
if (
|
|
1469
|
-
const
|
|
1470
|
-
l.value.push({ id:
|
|
1466
|
+
}), C.on("drawend", function() {
|
|
1467
|
+
var g, h, L;
|
|
1468
|
+
if (w && (w.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), w != null && w.innerHTML) {
|
|
1469
|
+
const p = (y == null ? void 0 : y.get("randomId")) || k();
|
|
1470
|
+
l.value.push({ id: p, value: w == null ? void 0 : w.innerHTML }), w.innerHTML = `${w.innerHTML}<div class="ol-tooltip-delete-button" data-id="${p}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
1471
1471
|
}
|
|
1472
|
-
(
|
|
1472
|
+
(g = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || g.addEventListener("click", (p) => {
|
|
1473
1473
|
var z;
|
|
1474
|
-
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1477
|
-
}),
|
|
1474
|
+
p.preventDefault(), p.stopPropagation();
|
|
1475
|
+
const S = (z = p.target) == null ? void 0 : z.getAttribute("data-id");
|
|
1476
|
+
S && X(S);
|
|
1477
|
+
}), x.setOffset([0, -7]), y = null, w = null, G(), i && De(i), (L = (h = r.getProps()) == null ? void 0 : h.lineDrawEnd) == null || L.call(h, l.value);
|
|
1478
1478
|
});
|
|
1479
|
-
},
|
|
1480
|
-
let
|
|
1479
|
+
}, k = () => Math.random().toString(36).substring(2, 9);
|
|
1480
|
+
let w, x;
|
|
1481
1481
|
const G = () => {
|
|
1482
|
-
|
|
1483
|
-
element:
|
|
1482
|
+
w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.className = "ol-tooltip ol-tooltip-measure", x = new ie({
|
|
1483
|
+
element: w,
|
|
1484
1484
|
offset: [0, -15],
|
|
1485
1485
|
positioning: "bottom-center",
|
|
1486
1486
|
stopEvent: !1,
|
|
1487
1487
|
insertFirst: !1
|
|
1488
|
-
}), e == null || e.addOverlay(
|
|
1489
|
-
},
|
|
1490
|
-
o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden",
|
|
1488
|
+
}), e == null || e.addOverlay(x);
|
|
1489
|
+
}, Z = () => {
|
|
1490
|
+
o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", F = new ie({
|
|
1491
1491
|
element: o,
|
|
1492
1492
|
offset: [15, 0],
|
|
1493
1493
|
positioning: "center-left"
|
|
1494
|
-
}), e == null || e.addOverlay(
|
|
1495
|
-
},
|
|
1496
|
-
l.value.forEach((i,
|
|
1497
|
-
var
|
|
1494
|
+
}), e == null || e.addOverlay(F);
|
|
1495
|
+
}, Y = () => {
|
|
1496
|
+
l.value.forEach((i, g) => {
|
|
1497
|
+
var p, S;
|
|
1498
1498
|
const h = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1499
|
-
h[
|
|
1499
|
+
h[g] && ((S = (p = h[g]) == null ? void 0 : p.parentNode) == null || S.removeChild(h[g]));
|
|
1500
1500
|
const L = t.getFeatures();
|
|
1501
|
-
L[
|
|
1502
|
-
}), O(), Co(e), v.value = !1,
|
|
1501
|
+
L[g] && t.removeFeature(L[g]);
|
|
1502
|
+
}), O(), Co(e), v.value = !1, $e(e, "pointer");
|
|
1503
1503
|
}, X = (i) => {
|
|
1504
|
-
var h, L,
|
|
1505
|
-
const
|
|
1506
|
-
if (
|
|
1507
|
-
l.value.splice(
|
|
1504
|
+
var h, L, p, S;
|
|
1505
|
+
const g = l.value.findIndex((z) => z.id === i);
|
|
1506
|
+
if (g !== -1) {
|
|
1507
|
+
l.value.splice(g, 1);
|
|
1508
1508
|
const z = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1509
|
-
z[
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1509
|
+
z[g] && ((L = (h = z[g]) == null ? void 0 : h.parentNode) == null || L.removeChild(z[g]));
|
|
1510
|
+
const D = t.getFeatures();
|
|
1511
|
+
D[g] && t.removeFeature(D[g]);
|
|
1512
1512
|
}
|
|
1513
|
-
(
|
|
1513
|
+
(S = (p = r.getProps()) == null ? void 0 : p.lineDrawEnd) == null || S.call(p, l.value);
|
|
1514
1514
|
}, O = () => {
|
|
1515
1515
|
if (l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((i) => {
|
|
1516
|
-
var
|
|
1517
|
-
(
|
|
1518
|
-
}), t.clear(),
|
|
1519
|
-
const i = e.getInteractions().getArray().find((
|
|
1516
|
+
var g;
|
|
1517
|
+
(g = i == null ? void 0 : i.parentNode) == null || g.removeChild(i);
|
|
1518
|
+
}), t.clear(), C) {
|
|
1519
|
+
const i = e.getInteractions().getArray().find((g) => et(g) === et(C));
|
|
1520
1520
|
i && e.removeInteraction(i);
|
|
1521
1521
|
}
|
|
1522
|
-
e.removeLayer(n), o != null && o.parentNode && o.parentNode.removeChild(o),
|
|
1522
|
+
e.removeLayer(n), o != null && o.parentNode && o.parentNode.removeChild(o), w != null && w.parentNode && w.parentNode.removeChild(w);
|
|
1523
1523
|
};
|
|
1524
1524
|
return {
|
|
1525
|
-
open:
|
|
1526
|
-
close:
|
|
1525
|
+
open: b,
|
|
1526
|
+
close: Y,
|
|
1527
1527
|
deleteLine: X,
|
|
1528
1528
|
setUnit: a,
|
|
1529
1529
|
getState: () => v.value
|
|
@@ -1546,14 +1546,14 @@ const nt = (e, r) => {
|
|
|
1546
1546
|
}, Eo = (e, r) => {
|
|
1547
1547
|
let l, s;
|
|
1548
1548
|
const a = () => {
|
|
1549
|
-
o(),
|
|
1549
|
+
o(), $e(e, "crosshair");
|
|
1550
1550
|
}, o = () => {
|
|
1551
|
-
t(),
|
|
1551
|
+
t(), w(), Z(), V();
|
|
1552
1552
|
};
|
|
1553
|
-
let v = null,
|
|
1553
|
+
let v = null, b = null;
|
|
1554
1554
|
const t = () => {
|
|
1555
|
-
if (v &&
|
|
1556
|
-
const O = new ae(),
|
|
1555
|
+
if (v && b) return;
|
|
1556
|
+
const O = new ae(), A = new ve({
|
|
1557
1557
|
source: O,
|
|
1558
1558
|
style: new H({
|
|
1559
1559
|
stroke: new fe({
|
|
@@ -1562,45 +1562,45 @@ const nt = (e, r) => {
|
|
|
1562
1562
|
})
|
|
1563
1563
|
})
|
|
1564
1564
|
});
|
|
1565
|
-
v =
|
|
1565
|
+
v = A, b = O, e.on("pointermove", m), e.addLayer(A), e.on(["dblclick"], function(i) {
|
|
1566
1566
|
y && (i.stopPropagation(), i.preventDefault());
|
|
1567
1567
|
});
|
|
1568
1568
|
};
|
|
1569
1569
|
let n;
|
|
1570
1570
|
const m = (O) => {
|
|
1571
1571
|
if (O.dragging) return;
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1572
|
+
const A = n ? "单击继续,双击结束" : "点击选择起点";
|
|
1573
|
+
x && (x.innerHTML = A, G.setPosition(O.coordinate));
|
|
1574
1574
|
};
|
|
1575
|
-
let y,
|
|
1576
|
-
const
|
|
1575
|
+
let y, F = !1;
|
|
1576
|
+
const V = () => {
|
|
1577
1577
|
if (l) {
|
|
1578
|
-
|
|
1578
|
+
x != null && x.parentNode && x.parentNode.removeChild(x);
|
|
1579
1579
|
const O = l.getGeometry();
|
|
1580
1580
|
if (!O) return;
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1583
|
-
<span class="text">面积:${
|
|
1584
|
-
`),
|
|
1585
|
-
const i = O.getCoordinates(),
|
|
1586
|
-
if (
|
|
1581
|
+
const A = C(O, "nm");
|
|
1582
|
+
d && (d.innerHTML = `
|
|
1583
|
+
<span class="text">面积:${A}${F ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1584
|
+
`), d && (d.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
|
|
1585
|
+
const i = O.getCoordinates(), g = i[0][i[0].length - 2];
|
|
1586
|
+
if (k.setPosition(g), v) {
|
|
1587
1587
|
const L = v.getSource();
|
|
1588
1588
|
L && l && (L.clear(), L.addFeature(l));
|
|
1589
1589
|
}
|
|
1590
1590
|
setTimeout(() => {
|
|
1591
1591
|
var L;
|
|
1592
1592
|
(L = document.querySelector(".delete-icon")) == null || L.addEventListener("click", () => {
|
|
1593
|
-
var
|
|
1594
|
-
console.log("delete"),
|
|
1593
|
+
var p, S;
|
|
1594
|
+
console.log("delete"), Y(), (S = (p = r.getProps()) == null ? void 0 : p.areaDrawEnd) == null || S.call(p, []);
|
|
1595
1595
|
});
|
|
1596
1596
|
}, 0);
|
|
1597
1597
|
const h = Xt(l.getGeometry().getExtent());
|
|
1598
1598
|
e == null || e.getView().setCenter(h);
|
|
1599
1599
|
return;
|
|
1600
1600
|
}
|
|
1601
|
-
y = new
|
|
1601
|
+
y = new Fe({
|
|
1602
1602
|
type: "Polygon",
|
|
1603
|
-
source:
|
|
1603
|
+
source: b,
|
|
1604
1604
|
trace: !0,
|
|
1605
1605
|
style: [new H({
|
|
1606
1606
|
stroke: new fe({
|
|
@@ -1608,39 +1608,39 @@ const nt = (e, r) => {
|
|
|
1608
1608
|
width: 1.5,
|
|
1609
1609
|
lineDash: [10, 10]
|
|
1610
1610
|
}),
|
|
1611
|
-
fill: new
|
|
1611
|
+
fill: new j({
|
|
1612
1612
|
color: "rgba(255, 255, 255, 0.25)"
|
|
1613
1613
|
})
|
|
1614
1614
|
}), new H({
|
|
1615
|
-
image: new
|
|
1615
|
+
image: new Se({
|
|
1616
1616
|
radius: 5,
|
|
1617
|
-
fill: new
|
|
1617
|
+
fill: new j({
|
|
1618
1618
|
color: "rgb(51,112,255, 1)"
|
|
1619
1619
|
})
|
|
1620
1620
|
}),
|
|
1621
1621
|
geometry: function(O) {
|
|
1622
|
-
const
|
|
1623
|
-
return new jt(
|
|
1622
|
+
const A = O.getGeometry().getCoordinates();
|
|
1623
|
+
return new jt(A);
|
|
1624
1624
|
}
|
|
1625
1625
|
})]
|
|
1626
1626
|
}), e == null || e.addInteraction(y), y.on("drawstart", (O) => {
|
|
1627
|
-
var
|
|
1628
|
-
n = O.feature, s = (
|
|
1629
|
-
const
|
|
1630
|
-
if (
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1627
|
+
var A;
|
|
1628
|
+
n = O.feature, s = (A = n.getGeometry()) == null ? void 0 : A.on("change", (i) => {
|
|
1629
|
+
const g = i.target, h = C(g, "nm"), p = g.getCoordinates()[0], S = new Pe([p[p.length - 2], p[p.length - 1]]), z = gt(S, "nm");
|
|
1630
|
+
if (F = Number(Be(S) / 1e3) > 150, !h) return;
|
|
1631
|
+
const D = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1632
|
+
d && (d.innerHTML = `
|
|
1633
1633
|
<div class="text">
|
|
1634
1634
|
面积:${h}
|
|
1635
|
-
${
|
|
1635
|
+
${F ? D : ""}
|
|
1636
1636
|
</div>
|
|
1637
|
-
`),
|
|
1637
|
+
`), x && (x.innerHTML = `
|
|
1638
1638
|
<div class="text">
|
|
1639
1639
|
面积:${h}
|
|
1640
1640
|
</div>
|
|
1641
|
-
<div class="text ${
|
|
1642
|
-
线段 ${
|
|
1643
|
-
${
|
|
1641
|
+
<div class="text ${F ? "error" : ""}">
|
|
1642
|
+
线段 ${p.length - 2}: ${z}
|
|
1643
|
+
${F ? D : ""}
|
|
1644
1644
|
|
|
1645
1645
|
</div>
|
|
1646
1646
|
<div>
|
|
@@ -1649,90 +1649,102 @@ const nt = (e, r) => {
|
|
|
1649
1649
|
`);
|
|
1650
1650
|
});
|
|
1651
1651
|
}), y.on("drawend", (O) => {
|
|
1652
|
-
var h, L,
|
|
1652
|
+
var h, L, p, S;
|
|
1653
1653
|
if (!O.feature.getGeometry()) return;
|
|
1654
|
-
|
|
1655
|
-
const i = O.feature.getGeometry().getCoordinates(),
|
|
1656
|
-
if (
|
|
1657
|
-
const z = i[0].map((
|
|
1658
|
-
(
|
|
1654
|
+
d && !l && (d.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), l = O.feature, k.setOffset([10, 0]);
|
|
1655
|
+
const i = O.feature.getGeometry().getCoordinates(), g = i[0][i[0].length - 2];
|
|
1656
|
+
if (k.setPosition(g), x != null && x.parentNode && x.parentNode.removeChild(x), (h = r.getProps()) != null && h.areaDrawEnd) {
|
|
1657
|
+
const z = i[0].map((D) => xe(D, J.mercator, J.data));
|
|
1658
|
+
(p = (L = r.getProps()) == null ? void 0 : L.areaDrawEnd) == null || p.call(L, z);
|
|
1659
1659
|
}
|
|
1660
|
-
y && (y.setActive(!1), e == null || e.removeInteraction(y), (e == null ? void 0 : e.getInteractions()).forEach((
|
|
1661
|
-
|
|
1662
|
-
})), s && De(s), (
|
|
1663
|
-
var z,
|
|
1664
|
-
|
|
1660
|
+
y && (y.setActive(!1), e == null || e.removeInteraction(y), (e == null ? void 0 : e.getInteractions()).forEach((D) => {
|
|
1661
|
+
D instanceof Fe && (D.setActive(!1), e == null || e.removeInteraction(D));
|
|
1662
|
+
})), s && De(s), (S = document.querySelector(".delete-icon")) == null || S.addEventListener("click", () => {
|
|
1663
|
+
var z, D;
|
|
1664
|
+
Y(), (D = (z = r.getProps()) == null ? void 0 : z.areaDrawEnd) == null || D.call(z, []);
|
|
1665
1665
|
});
|
|
1666
1666
|
});
|
|
1667
|
-
},
|
|
1667
|
+
}, C = (O, A) => {
|
|
1668
1668
|
const i = Ht(O);
|
|
1669
|
-
switch (
|
|
1669
|
+
switch (A) {
|
|
1670
1670
|
case "km":
|
|
1671
1671
|
return i > 1e4 ? Math.round(i / 1e6 * 100) / 100 + " km<sup>2</sup>" : Math.round(i * 100) / 100 + " m<sup>2</sup>";
|
|
1672
1672
|
case "nm":
|
|
1673
1673
|
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>";
|
|
1674
1674
|
}
|
|
1675
1675
|
};
|
|
1676
|
-
let
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1679
|
-
element:
|
|
1676
|
+
let d, k;
|
|
1677
|
+
const w = () => {
|
|
1678
|
+
d != null && d.parentNode && d.parentNode.removeChild(d), d = document.createElement("div"), d.style.display = "flex", d.className = "ol-tooltip ol-tooltip-draw-polygon", k = new ie({
|
|
1679
|
+
element: d,
|
|
1680
1680
|
offset: [0, -15],
|
|
1681
1681
|
positioning: "bottom-center",
|
|
1682
1682
|
stopEvent: !1,
|
|
1683
1683
|
insertFirst: !1
|
|
1684
|
-
}), e == null || e.addOverlay(
|
|
1684
|
+
}), e == null || e.addOverlay(k);
|
|
1685
1685
|
};
|
|
1686
|
-
let
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1689
|
-
element:
|
|
1686
|
+
let x, G;
|
|
1687
|
+
const Z = () => {
|
|
1688
|
+
x != null && x.parentNode && x.parentNode.removeChild(x), x = document.createElement("div"), x.className = "ol-tooltip ol-help-tooltip", G = new ie({
|
|
1689
|
+
element: x,
|
|
1690
1690
|
offset: [15, 0],
|
|
1691
1691
|
positioning: "center-left"
|
|
1692
1692
|
}), e == null || e.addOverlay(G);
|
|
1693
|
-
},
|
|
1694
|
-
|
|
1693
|
+
}, Y = () => {
|
|
1694
|
+
b == null || b.clear(), l = null, w(), Z(), V();
|
|
1695
1695
|
};
|
|
1696
1696
|
return {
|
|
1697
1697
|
open: a,
|
|
1698
1698
|
close: () => {
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
}), y = null), s && De(s),
|
|
1699
|
+
b == null || b.clear(), b = null, v && (e.removeLayer(v), v = null), n = null, y && (y.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((A) => {
|
|
1700
|
+
A instanceof Fe && (A.setActive(!1), e == null || e.removeInteraction(A));
|
|
1701
|
+
}), y = null), s && De(s), x != null && x.parentElement && x.parentElement.removeChild(x), d != null && d.parentElement && d.parentElement.removeChild(d), G && e.removeOverlay(G), k && e.removeOverlay(k), $e(e, "pointer");
|
|
1702
1702
|
},
|
|
1703
|
-
reset:
|
|
1703
|
+
reset: Y
|
|
1704
1704
|
};
|
|
1705
|
-
}, To = "zh-map-port-layer",
|
|
1705
|
+
}, To = "zh-map-port-layer", Po = (e) => {
|
|
1706
1706
|
const r = new ae(), l = new ve({
|
|
1707
1707
|
className: To,
|
|
1708
1708
|
source: r,
|
|
1709
1709
|
zIndex: 100,
|
|
1710
|
-
updateWhileInteracting: !
|
|
1711
|
-
updateWhileAnimating: !
|
|
1710
|
+
updateWhileInteracting: !0,
|
|
1711
|
+
updateWhileAnimating: !0
|
|
1712
1712
|
});
|
|
1713
1713
|
e == null || e.addLayer(l);
|
|
1714
1714
|
let s = null, a = null;
|
|
1715
|
-
const o = (
|
|
1716
|
-
if (!(!
|
|
1715
|
+
const o = (d, k = !0) => {
|
|
1716
|
+
if (!(!d || d.length === 0)) {
|
|
1717
1717
|
if (r.clear(), a) {
|
|
1718
|
-
const w =
|
|
1719
|
-
w ? a = w :
|
|
1718
|
+
const w = d.find((x) => x.id === a.id);
|
|
1719
|
+
w ? a = w : d.push(a);
|
|
1720
1720
|
}
|
|
1721
|
-
|
|
1722
|
-
v(w,
|
|
1721
|
+
d.forEach((w) => {
|
|
1722
|
+
v(w, k);
|
|
1723
1723
|
});
|
|
1724
1724
|
}
|
|
1725
|
-
}, v = (
|
|
1726
|
-
const [w,
|
|
1727
|
-
geometry: new re(I([Number(w), Number(
|
|
1728
|
-
portData:
|
|
1729
|
-
select:
|
|
1730
|
-
showTitle:
|
|
1731
|
-
}),
|
|
1732
|
-
|
|
1733
|
-
},
|
|
1734
|
-
|
|
1735
|
-
|
|
1725
|
+
}, v = (d, k = !0) => {
|
|
1726
|
+
const [w, x] = d.latLon.split(","), G = d.id === (a == null ? void 0 : a.id), Z = new se({
|
|
1727
|
+
geometry: new re(I([Number(w), Number(x)])),
|
|
1728
|
+
portData: d,
|
|
1729
|
+
select: G,
|
|
1730
|
+
showTitle: d.id === (a == null ? void 0 : a.id) || k
|
|
1731
|
+
}), Y = n(Z);
|
|
1732
|
+
Z.setStyle(Y), G && b(Z), r.addFeature(Z);
|
|
1733
|
+
}, b = (d) => {
|
|
1734
|
+
try {
|
|
1735
|
+
const k = d.getStyle();
|
|
1736
|
+
if (k) {
|
|
1737
|
+
const w = k.getText(), x = k == null ? void 0 : k.getImage();
|
|
1738
|
+
w && w.setBackgroundFill(new j({ color: "#FF5733" })), x && x.setImage(t(!0)), d.setStyle(k);
|
|
1739
|
+
}
|
|
1740
|
+
} catch (k) {
|
|
1741
|
+
console.log("changeSelectedStyle-port", k);
|
|
1742
|
+
}
|
|
1743
|
+
}, t = (d) => {
|
|
1744
|
+
const w = 0.5 * e.getView().getZoom() / 10, x = (Z) => `<svg style="transform: scale(${w})" width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1745
|
+
<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"
|
|
1746
|
+
fill="${Z}"
|
|
1747
|
+
/>
|
|
1736
1748
|
<g clip-path="url(#clip0_10059_122082)">
|
|
1737
1749
|
<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"/>
|
|
1738
1750
|
</g>
|
|
@@ -1742,119 +1754,113 @@ const nt = (e, r) => {
|
|
|
1742
1754
|
</clipPath>
|
|
1743
1755
|
</defs>
|
|
1744
1756
|
</svg>
|
|
1745
|
-
`,
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
console.log("showTitle", w, G.shortName, "选中", f, b);
|
|
1755
|
-
const Y = new H({
|
|
1757
|
+
`, G = () => `data:image/svg+xml;utf8,${encodeURIComponent(x(d ? "#FF5733" : "#3370FF"))}`;
|
|
1758
|
+
return new Ve({
|
|
1759
|
+
src: G()
|
|
1760
|
+
});
|
|
1761
|
+
}, n = (d) => {
|
|
1762
|
+
const { select: k, showTitle: w } = d.getProperties(), x = d.get("portData"), Z = {
|
|
1763
|
+
image: t(k),
|
|
1764
|
+
zIndex: k ? 110 : 100
|
|
1765
|
+
}, Y = {
|
|
1756
1766
|
text: new ue({
|
|
1757
|
-
text:
|
|
1767
|
+
text: x.shortName,
|
|
1758
1768
|
font: "12px sans-serif",
|
|
1759
|
-
fill: new
|
|
1760
|
-
color:
|
|
1769
|
+
fill: new j({
|
|
1770
|
+
color: "#000000"
|
|
1761
1771
|
}),
|
|
1762
|
-
backgroundFill: new
|
|
1763
|
-
color:
|
|
1772
|
+
backgroundFill: new j({
|
|
1773
|
+
color: "#FFF"
|
|
1764
1774
|
}),
|
|
1765
1775
|
offsetY: 30
|
|
1766
|
-
})
|
|
1767
|
-
|
|
1776
|
+
})
|
|
1777
|
+
};
|
|
1778
|
+
return !w && !k ? new H({ ...Z }) : new H({
|
|
1779
|
+
...Z,
|
|
1780
|
+
...Y
|
|
1768
1781
|
});
|
|
1769
|
-
|
|
1770
|
-
image: new be({
|
|
1771
|
-
src: M(),
|
|
1772
|
-
scale: 0.5 * b / 10
|
|
1773
|
-
}),
|
|
1774
|
-
zIndex: f ? 110 : 100
|
|
1775
|
-
}), Y];
|
|
1776
|
-
}, t = () => {
|
|
1782
|
+
}, m = () => {
|
|
1777
1783
|
if (r)
|
|
1778
1784
|
if (s) {
|
|
1779
1785
|
console.log("清除非选中的港口");
|
|
1780
|
-
const
|
|
1781
|
-
r.getFeatures().forEach((
|
|
1782
|
-
|
|
1786
|
+
const d = s.get("portData").id;
|
|
1787
|
+
r.getFeatures().forEach((k) => {
|
|
1788
|
+
k.get("portData").id !== d && r.removeFeature(k);
|
|
1783
1789
|
});
|
|
1784
1790
|
} else
|
|
1785
1791
|
console.log("清除所有港口", r), r == null || r.clear();
|
|
1786
|
-
},
|
|
1792
|
+
}, y = (d) => {
|
|
1787
1793
|
if (r) {
|
|
1788
|
-
if (!
|
|
1789
|
-
return
|
|
1790
|
-
(s == null ? void 0 : s.get("portData").id) !==
|
|
1794
|
+
if (!d)
|
|
1795
|
+
return F();
|
|
1796
|
+
(s == null ? void 0 : s.get("portData").id) !== d.id && (F(), V(d));
|
|
1791
1797
|
}
|
|
1792
|
-
},
|
|
1798
|
+
}, F = () => {
|
|
1793
1799
|
if (s) {
|
|
1794
|
-
const
|
|
1800
|
+
const d = s == null ? void 0 : s.get("portData");
|
|
1795
1801
|
r.getFeatures().forEach((w) => {
|
|
1796
|
-
w.get("portData").id ===
|
|
1802
|
+
w.get("portData").id === d.id && (w.set("select", !1), w.setStyle(n(w)), s = null);
|
|
1797
1803
|
});
|
|
1798
1804
|
}
|
|
1799
|
-
},
|
|
1805
|
+
}, V = (d) => {
|
|
1800
1806
|
if (!r) return;
|
|
1801
|
-
const
|
|
1802
|
-
a =
|
|
1807
|
+
const k = r.getFeatures();
|
|
1808
|
+
a = d, s = k.find((w) => w.get("portData").id === d.id), s && (s.set("select", !0), b(s));
|
|
1803
1809
|
};
|
|
1804
1810
|
return {
|
|
1805
1811
|
render: o,
|
|
1806
|
-
clear:
|
|
1807
|
-
selected:
|
|
1808
|
-
handlePortHover: (
|
|
1809
|
-
const
|
|
1810
|
-
|
|
1812
|
+
clear: m,
|
|
1813
|
+
selected: y,
|
|
1814
|
+
handlePortHover: (d) => {
|
|
1815
|
+
const k = e == null ? void 0 : e.getTargetElement();
|
|
1816
|
+
d && d.get("portData") && k && (k.style.cursor = "pointer");
|
|
1811
1817
|
}
|
|
1812
1818
|
};
|
|
1813
|
-
},
|
|
1819
|
+
}, Fo = (e, r, l, s, a, o) => {
|
|
1814
1820
|
const v = e.getInstall();
|
|
1815
1821
|
v.on("moveend", () => {
|
|
1816
|
-
var
|
|
1822
|
+
var b, t;
|
|
1817
1823
|
try {
|
|
1818
1824
|
const n = e.getZoom();
|
|
1819
|
-
(t = (
|
|
1825
|
+
(t = (b = r.getProps()).mapMoveEnd) == null || t.call(b, n), l.reRenderTrackLine(), s.changeShipScale("end");
|
|
1820
1826
|
} catch (n) {
|
|
1821
1827
|
console.log("moveend---catch", n);
|
|
1822
1828
|
}
|
|
1823
|
-
}), v.on("pointermove", (
|
|
1829
|
+
}), v.on("pointermove", (b) => {
|
|
1824
1830
|
try {
|
|
1825
|
-
const t = v == null ? void 0 : v.getEventPixel(
|
|
1831
|
+
const t = v == null ? void 0 : v.getEventPixel(b.originalEvent);
|
|
1826
1832
|
if (!t || !v) return;
|
|
1827
1833
|
const n = v == null ? void 0 : v.forEachFeatureAtPixel(t, (m) => m, {
|
|
1828
1834
|
layerFilter: (m) => m.getVisible()
|
|
1829
1835
|
});
|
|
1830
|
-
s == null || s.handleShipMapEvent(n, "hover"), l == null || l.handleTrackMapEvent(n, "hover",
|
|
1836
|
+
s == null || s.handleShipMapEvent(n, "hover"), l == null || l.handleTrackMapEvent(n, "hover", b), n && (a == null || a.handlePortHover(n));
|
|
1831
1837
|
} catch (t) {
|
|
1832
1838
|
console.log("pointermove---catch", t);
|
|
1833
1839
|
}
|
|
1834
1840
|
}), v.on("movestart", () => {
|
|
1835
1841
|
try {
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1838
|
-
} catch (
|
|
1839
|
-
console.log("movestart---catch",
|
|
1842
|
+
const b = v == null ? void 0 : v.getView().getZoom();
|
|
1843
|
+
b && b <= ne.shipModelMax && b >= ne.shipTriggleMin && s.changeShipScale("start");
|
|
1844
|
+
} catch (b) {
|
|
1845
|
+
console.log("movestart---catch", b);
|
|
1840
1846
|
}
|
|
1841
|
-
}), v.on("singleclick", qe((
|
|
1847
|
+
}), v.on("singleclick", qe((b) => {
|
|
1842
1848
|
var t, n, m;
|
|
1843
1849
|
try {
|
|
1844
1850
|
if (console.log("1", o.getState()), o.getState()) return;
|
|
1845
|
-
const y = v.getFeaturesAtPixel(
|
|
1851
|
+
const y = v.getFeaturesAtPixel(b.pixel);
|
|
1846
1852
|
if (!y && y.length === 0) return;
|
|
1847
1853
|
console.log("features------------", y);
|
|
1848
|
-
let
|
|
1849
|
-
if (y == null || y.forEach((
|
|
1850
|
-
|
|
1851
|
-
}),
|
|
1852
|
-
s.handleShipMapEvent(
|
|
1853
|
-
else if (
|
|
1854
|
-
const
|
|
1855
|
-
a.selected(
|
|
1854
|
+
let F = null, V = null;
|
|
1855
|
+
if (y == null || y.forEach((C) => {
|
|
1856
|
+
C.get("shipData") && (F = C), C.get("portData") && (V = C);
|
|
1857
|
+
}), F)
|
|
1858
|
+
s.handleShipMapEvent(F, "click", (t = r.getProps()) == null ? void 0 : t.selectShip);
|
|
1859
|
+
else if (V) {
|
|
1860
|
+
const C = V.get("portData");
|
|
1861
|
+
a.selected(C), (m = (n = r.getProps()) == null ? void 0 : n.selectPort) == null || m.call(n, C);
|
|
1856
1862
|
}
|
|
1857
|
-
|
|
1863
|
+
b.preventDefault(), b.stopPropagation();
|
|
1858
1864
|
} catch (y) {
|
|
1859
1865
|
console.log("click---catch", y);
|
|
1860
1866
|
}
|
|
@@ -1865,43 +1871,43 @@ const nt = (e, r) => {
|
|
|
1865
1871
|
createInstance: (s, a) => {
|
|
1866
1872
|
const o = oo();
|
|
1867
1873
|
o.initMap(s, a);
|
|
1868
|
-
const v = o.getInstall(),
|
|
1869
|
-
t.setProps(a),
|
|
1870
|
-
const n = co(v), m = io(v, n), y = xo(v),
|
|
1871
|
-
|
|
1872
|
-
const
|
|
1873
|
-
const
|
|
1874
|
-
return [G[0], G[1],
|
|
1875
|
-
},
|
|
1874
|
+
const v = o.getInstall(), b = bo(v), t = ko();
|
|
1875
|
+
t.setProps(a), b.setShowLayerType(a.layerType), b.setGreenTileVisible(a.showGreenLayer);
|
|
1876
|
+
const n = co(v), m = io(v, n), y = xo(v), F = po(v), V = Lo(v, t), C = Eo(v, t), d = Po(v);
|
|
1877
|
+
Fo(o, t, n, y, d, V);
|
|
1878
|
+
const k = () => {
|
|
1879
|
+
const x = v.getView().calculateExtent(o.getSize()), G = xe([x[0], x[1]], J.mercator, J.data), Z = xe([x[2], x[3]], J.mercator, J.data);
|
|
1880
|
+
return [G[0], G[1], Z[0], Z[1]];
|
|
1881
|
+
}, w = {
|
|
1876
1882
|
id: Symbol("map-instance"),
|
|
1877
1883
|
innerMap: null,
|
|
1878
1884
|
map: o.getInstall(),
|
|
1879
1885
|
destroy: () => {
|
|
1880
|
-
e.splice(e.indexOf(
|
|
1886
|
+
e.splice(e.indexOf(w), 1);
|
|
1881
1887
|
},
|
|
1882
1888
|
methods: {
|
|
1883
1889
|
...o,
|
|
1884
|
-
layer:
|
|
1890
|
+
layer: b,
|
|
1885
1891
|
ship: y,
|
|
1886
1892
|
track: n,
|
|
1887
1893
|
carTrack: m,
|
|
1888
1894
|
port: {
|
|
1889
|
-
render:
|
|
1890
|
-
clear:
|
|
1891
|
-
selected:
|
|
1895
|
+
render: d.render,
|
|
1896
|
+
clear: d.clear,
|
|
1897
|
+
selected: d.selected
|
|
1892
1898
|
},
|
|
1893
|
-
position:
|
|
1894
|
-
drawLine:
|
|
1895
|
-
drawPolygon:
|
|
1899
|
+
position: F,
|
|
1900
|
+
drawLine: V,
|
|
1901
|
+
drawPolygon: C,
|
|
1896
1902
|
// 子模块
|
|
1897
1903
|
utils: {
|
|
1898
|
-
getCalculateExtent:
|
|
1904
|
+
getCalculateExtent: k,
|
|
1899
1905
|
convertSixHundredThousandToLatLng: Xe,
|
|
1900
1906
|
calculateCirclePoints: ro
|
|
1901
1907
|
}
|
|
1902
1908
|
}
|
|
1903
1909
|
};
|
|
1904
|
-
return e.push(
|
|
1910
|
+
return e.push(w), w;
|
|
1905
1911
|
},
|
|
1906
1912
|
destroyInstance: (s) => {
|
|
1907
1913
|
const a = e.findIndex((o) => o.id === s);
|
|
@@ -1932,13 +1938,13 @@ const nt = (e, r) => {
|
|
|
1932
1938
|
} }
|
|
1933
1939
|
},
|
|
1934
1940
|
setup(e, { expose: r }) {
|
|
1935
|
-
const l = U(), s = U(), a = So(), o = U(), v = e,
|
|
1941
|
+
const l = U(), s = U(), a = So(), o = U(), v = e, b = U({
|
|
1936
1942
|
getInstall() {
|
|
1937
1943
|
}
|
|
1938
1944
|
});
|
|
1939
1945
|
return $t(() => {
|
|
1940
1946
|
var t;
|
|
1941
|
-
o.value = a.createInstance(l.value, v),
|
|
1947
|
+
o.value = a.createInstance(l.value, v), b.value = o.value.methods, (t = s.value) == null || t.setScaleLine(o.value.map, v.scaleLineUnit);
|
|
1942
1948
|
}), Vt(() => {
|
|
1943
1949
|
var t, n;
|
|
1944
1950
|
a.destroyInstance((t = o == null ? void 0 : o.value) == null ? void 0 : t.id), (n = o.value) == null || n.destroy();
|