zhihao-ui 1.3.26 → 1.3.28
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as Ae, openBlock as We, createElementBlock as Ye, createElementVNode as Ze, ref as U, computed as Te, h as re, createVNode as De, render as
|
|
2
|
-
import { S as zt, M as Ue, T as
|
|
1
|
+
import { defineComponent as Ae, openBlock as We, createElementBlock as Ye, createElementVNode as Ze, ref as U, computed as Te, h as re, createVNode as De, render as Nt, reactive as St, 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, t as Zt, h as lt, r as Be, s as Dt, u as ue, F as Q, v as H, O as ie, P as ne, w as xe, x as qe, L as Pe, y as Gt, z as Ie, A as se, B as ve, C as ae, D as fe, i as At, G as Se, H as Wt, I as be, J as Yt, K as Bt, N as st, Q as Ne, R as Ge, U as et, W as qt, Y as Ht, Z as Xt } from "./vendor-D2mv9LHk.js";
|
|
3
3
|
import { _ as He } from "./Button-CGndQwez.js";
|
|
4
4
|
import { w as jt } from "./utils-D2wHR1YB.js";
|
|
5
5
|
const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
|
|
@@ -26,7 +26,7 @@ const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
|
|
|
26
26
|
setup(e) {
|
|
27
27
|
const l = e;
|
|
28
28
|
console.log("props", l);
|
|
29
|
-
const
|
|
29
|
+
const r = () => {
|
|
30
30
|
console.log("props");
|
|
31
31
|
const { setZoom: a, getZoom: o, getInstall: f } = l.mapInstance.methods;
|
|
32
32
|
if (!f()) return;
|
|
@@ -41,7 +41,7 @@ const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
|
|
|
41
41
|
return (a, o) => (We(), Ye("div", _t, [
|
|
42
42
|
Ze("div", {
|
|
43
43
|
class: "button big-button",
|
|
44
|
-
onClick:
|
|
44
|
+
onClick: r
|
|
45
45
|
}, " + "),
|
|
46
46
|
Ze("div", {
|
|
47
47
|
class: "button small-button",
|
|
@@ -72,25 +72,25 @@ const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
|
|
|
72
72
|
}, eo = [114.84, 30.52], it = "https://static.zhihaoscm.cn/", $e = 2003750834e-2;
|
|
73
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=${Fe}`, e.vectorTileMark = `https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.satelliteImgTile = `https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.satelliteImgTileMark = `https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.greenTile = `${it}/map/tile/{z}/{x}/{y}.png`, e))(de || {}), we = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(we || {});
|
|
74
74
|
function to() {
|
|
75
|
-
const e = U(), l = () => e.value,
|
|
76
|
-
var
|
|
77
|
-
return (
|
|
78
|
-
}, a = (
|
|
75
|
+
const e = U(), l = () => e.value, r = () => l().getView(), s = () => {
|
|
76
|
+
var h;
|
|
77
|
+
return (h = r()) == null ? void 0 : h.getZoom();
|
|
78
|
+
}, a = (h) => {
|
|
79
79
|
var P;
|
|
80
|
-
(P =
|
|
81
|
-
}, o = (
|
|
82
|
-
var
|
|
83
|
-
(
|
|
80
|
+
(P = r()) == null || P.setZoom(h);
|
|
81
|
+
}, o = (h, P) => {
|
|
82
|
+
var S;
|
|
83
|
+
(S = r()) == null || S.setCenter(I([h, P]));
|
|
84
84
|
}, f = () => {
|
|
85
85
|
var P;
|
|
86
|
-
const
|
|
87
|
-
return Zt(
|
|
88
|
-
},
|
|
89
|
-
var
|
|
90
|
-
return (
|
|
91
|
-
}, t = new Ue(),
|
|
86
|
+
const h = (P = r()) == null ? void 0 : P.getCenter();
|
|
87
|
+
return Zt(h);
|
|
88
|
+
}, x = () => {
|
|
89
|
+
var h;
|
|
90
|
+
return (h = l()) == null ? void 0 : h.getSize();
|
|
91
|
+
}, t = new Ue(), n = (h, P) => {
|
|
92
92
|
m(P);
|
|
93
|
-
const
|
|
93
|
+
const S = {
|
|
94
94
|
zoom: P.zoom,
|
|
95
95
|
center: I(P.center),
|
|
96
96
|
minZoom: ee.min,
|
|
@@ -98,8 +98,8 @@ function to() {
|
|
|
98
98
|
constrainResolution: !0,
|
|
99
99
|
enableRotation: !1,
|
|
100
100
|
multiWorld: !0
|
|
101
|
-
},
|
|
102
|
-
target:
|
|
101
|
+
}, y = new Ue({
|
|
102
|
+
target: h,
|
|
103
103
|
controls: Rt({
|
|
104
104
|
zoom: !1
|
|
105
105
|
}),
|
|
@@ -109,62 +109,62 @@ function to() {
|
|
|
109
109
|
t.get("satelliteImgTile"),
|
|
110
110
|
t.get("satelliteImgTileMark")
|
|
111
111
|
],
|
|
112
|
-
view: new Ot(
|
|
112
|
+
view: new Ot(S)
|
|
113
113
|
});
|
|
114
|
-
e.value =
|
|
115
|
-
}, m = (
|
|
116
|
-
t.set("vectorTile", new
|
|
114
|
+
e.value = y;
|
|
115
|
+
}, m = (h) => {
|
|
116
|
+
t.set("vectorTile", new he({
|
|
117
117
|
source: new me({ url: de.vectorTile }),
|
|
118
|
-
visible:
|
|
118
|
+
visible: h.layerType === "vector",
|
|
119
119
|
zIndex: 0,
|
|
120
120
|
preload: 1,
|
|
121
121
|
className: "vector"
|
|
122
|
-
})), t.set("vectorTileMark", new
|
|
122
|
+
})), t.set("vectorTileMark", new he({
|
|
123
123
|
source: new me({ url: de.vectorTileMark }),
|
|
124
|
-
visible:
|
|
124
|
+
visible: h.layerType === "vector",
|
|
125
125
|
zIndex: 1,
|
|
126
126
|
preload: 1,
|
|
127
127
|
className: "vector"
|
|
128
|
-
})), t.set("satelliteImgTile", new
|
|
128
|
+
})), t.set("satelliteImgTile", new he({
|
|
129
129
|
source: new me({ url: de.satelliteImgTile }),
|
|
130
|
-
visible:
|
|
130
|
+
visible: h.layerType === "satellite",
|
|
131
131
|
zIndex: 0,
|
|
132
132
|
preload: 1,
|
|
133
133
|
className: "satellite"
|
|
134
|
-
})), t.set("satelliteImgTileMark", new
|
|
134
|
+
})), t.set("satelliteImgTileMark", new he({
|
|
135
135
|
source: new me({ url: de.satelliteImgTileMark }),
|
|
136
|
-
visible:
|
|
136
|
+
visible: h.layerType === "satellite",
|
|
137
137
|
zIndex: 1,
|
|
138
138
|
preload: 1,
|
|
139
139
|
className: "satellite"
|
|
140
|
-
})), t.set("greenMark", new
|
|
140
|
+
})), t.set("greenMark", new he({
|
|
141
141
|
source: new me({ url: de.greenTile }),
|
|
142
|
-
visible:
|
|
142
|
+
visible: h.showGreenLayer,
|
|
143
143
|
zIndex: 2,
|
|
144
144
|
className: "greenTile"
|
|
145
145
|
}));
|
|
146
146
|
};
|
|
147
147
|
return {
|
|
148
148
|
getInstall: l,
|
|
149
|
-
getView:
|
|
149
|
+
getView: r,
|
|
150
150
|
getZoom: s,
|
|
151
151
|
setZoom: a,
|
|
152
152
|
setCenter: o,
|
|
153
153
|
getCenter: f,
|
|
154
|
-
getSize:
|
|
155
|
-
initMap:
|
|
154
|
+
getSize: x,
|
|
155
|
+
initMap: n,
|
|
156
156
|
setBaseLayerMap: m
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
const Xe = function(e, l) {
|
|
160
|
-
const
|
|
161
|
-
return [Number(e) / 6e5,
|
|
160
|
+
const r = Number(l) / 6e5;
|
|
161
|
+
return [Number(e) / 6e5, r];
|
|
162
162
|
}, oo = (e, l) => {
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
const r = I(e), s = l * 1e3, a = [
|
|
164
|
+
r[0] - s,
|
|
165
|
+
r[1] - s,
|
|
166
|
+
r[0] + s,
|
|
167
|
+
r[1] + s
|
|
168
168
|
], o = Dt(a, J.mercator, J.data);
|
|
169
169
|
return {
|
|
170
170
|
leftTopPoint: { lng: o[0], lat: o[3] },
|
|
@@ -190,12 +190,12 @@ const Xe = function(e, l) {
|
|
|
190
190
|
};
|
|
191
191
|
function no(e) {
|
|
192
192
|
const l = e[0] * $e / 180;
|
|
193
|
-
let
|
|
194
|
-
return
|
|
193
|
+
let r = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
|
|
194
|
+
return r = r * $e / 180, [l, r];
|
|
195
195
|
}
|
|
196
196
|
function ge(e = "") {
|
|
197
197
|
let l = e.replace(/&?/g, "&");
|
|
198
|
-
return l = l.replace(/&#x([0-9a-fA-F]+);?/g, (
|
|
198
|
+
return l = l.replace(/&#x([0-9a-fA-F]+);?/g, (r, s) => {
|
|
199
199
|
const a = parseInt(s, 16);
|
|
200
200
|
return String.fromCodePoint(a);
|
|
201
201
|
}), l;
|
|
@@ -212,42 +212,42 @@ const tt = (e) => {
|
|
|
212
212
|
zIndex: 100
|
|
213
213
|
});
|
|
214
214
|
}, ot = (e, l = "lonlat") => {
|
|
215
|
-
const
|
|
215
|
+
const r = { lon: 0, lat: 0 }, s = e[0] / $e * 180;
|
|
216
216
|
let a = e[1] / $e * 180;
|
|
217
|
-
return a = 180 / Math.PI * (2 * Math.atan(Math.exp(a * Math.PI / 180)) - Math.PI / 2),
|
|
217
|
+
return a = 180 / Math.PI * (2 * Math.atan(Math.exp(a * Math.PI / 180)) - Math.PI / 2), r.lon = s, r.lat = a, l === "lonlat" ? r : [s, a];
|
|
218
218
|
}, lo = (e) => {
|
|
219
|
-
const l = lt.duration(e, "minutes"),
|
|
219
|
+
const l = lt.duration(e, "minutes"), r = Math.floor(l.asDays()), s = l.hours(), a = l.minutes();
|
|
220
220
|
let o = `${String(a).padStart(2, "0")}分`;
|
|
221
|
-
return s !== 0 && (o = `${String(s).padStart(2, "0")}时${o}`),
|
|
221
|
+
return s !== 0 && (o = `${String(s).padStart(2, "0")}时${o}`), r !== 0 && (o = `${String(r).padStart(2, "0")}天${o}`), o;
|
|
222
222
|
}, so = (e, l) => {
|
|
223
|
-
let
|
|
223
|
+
let r = null;
|
|
224
224
|
const s = async (m) => {
|
|
225
225
|
if (!e || (console.log("vehicleInfo", m), !(m != null && m.lon && (m != null && m.lat)))) return;
|
|
226
|
-
const
|
|
227
|
-
a(m, I(
|
|
228
|
-
const P = e == null ? void 0 : e.getView(),
|
|
229
|
-
P.setCenter(xe(
|
|
230
|
-
}, a = (m,
|
|
226
|
+
const h = Math.abs(Number(m.lon)) > 180 ? Xe(m.lon, m.lat) : [m.lon, m.lat];
|
|
227
|
+
a(m, I(h));
|
|
228
|
+
const P = e == null ? void 0 : e.getView(), S = new ne(h);
|
|
229
|
+
P.setCenter(xe(S.getCoordinates(), J.data, J.mercator));
|
|
230
|
+
}, a = (m, h) => {
|
|
231
231
|
const P = `${it}map/car-icon.gif`;
|
|
232
|
-
|
|
232
|
+
r || (r = new ie({
|
|
233
233
|
element: document.createElement("div"),
|
|
234
234
|
positioning: "center-center",
|
|
235
235
|
stopEvent: !1
|
|
236
236
|
// 允许交互事件穿透
|
|
237
|
-
}), e.addOverlay(
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
|
|
237
|
+
}), e.addOverlay(r));
|
|
238
|
+
const S = r.getElement();
|
|
239
|
+
S.style.backgroundImage = `url(${P})`, S.style.width = "80px", S.style.height = "80px";
|
|
240
|
+
const y = (m == null ? void 0 : m.drc) || "";
|
|
241
|
+
S.style.transform = `rotate(${y}deg)`, S.style.backgroundSize = "cover", r == null || r.setPosition(h);
|
|
242
242
|
};
|
|
243
243
|
return {
|
|
244
244
|
location: s,
|
|
245
245
|
remove: () => {
|
|
246
|
-
const m =
|
|
246
|
+
const m = r == null ? void 0 : r.getElement();
|
|
247
247
|
m && (m.innerHTML = "");
|
|
248
248
|
},
|
|
249
|
-
renderTrack: (m,
|
|
250
|
-
l.render(m,
|
|
249
|
+
renderTrack: (m, h, P) => {
|
|
250
|
+
l.render(m, h, P, "truck", 1e3);
|
|
251
251
|
},
|
|
252
252
|
setCenter: (m) => {
|
|
253
253
|
l.setCenter(m);
|
|
@@ -255,54 +255,54 @@ const tt = (e) => {
|
|
|
255
255
|
closeTrack: () => {
|
|
256
256
|
l.close();
|
|
257
257
|
},
|
|
258
|
-
playTrack: (m,
|
|
259
|
-
l.play(m,
|
|
258
|
+
playTrack: (m, h) => {
|
|
259
|
+
l.play(m, h);
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
262
|
};
|
|
263
263
|
var ct = /* @__PURE__ */ ((e) => (e[e.发动机使用中 = 0] = "发动机使用中", e[e.锚泊 = 1] = "锚泊", e[e.未操作 = 2] = "未操作", e[e.操纵能力受限 = 3] = "操纵能力受限", e[e.吃水受限 = 4] = "吃水受限", e[e.系泊 = 5] = "系泊", e[e.搁浅 = 6] = "搁浅", e[e.从事捕捞 = 7] = "从事捕捞", e[e.航行中 = 8] = "航行中", e[e.留作将来修正导航状态 = 9] = "留作将来修正导航状态", e[e.高速船留用 = 10] = "高速船留用", e[e.机动船尾推作业 = 11] = "机动船尾推作业", e[e.机动船顶推或侧推作业 = 12] = "机动船顶推或侧推作业", e[e.飞翼船留用 = 13] = "飞翼船留用", e[e.现行的 = 14] = "现行的", e[e.未定义 = 15] = "未定义", e))(ct || {}), te = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.front = "front", e.up = "up", e.down = "down", e.back = "back", e))(te || {});
|
|
264
264
|
const io = (e) => {
|
|
265
|
-
const l = /* @__PURE__ */ new Map(),
|
|
265
|
+
const l = /* @__PURE__ */ new Map(), r = {};
|
|
266
266
|
let s = null;
|
|
267
267
|
const a = "--";
|
|
268
268
|
let o = null;
|
|
269
|
-
const f = document.createElement("div"),
|
|
269
|
+
const f = document.createElement("div"), x = new ie({
|
|
270
270
|
element: f,
|
|
271
271
|
positioning: "top-left",
|
|
272
272
|
stopEvent: !1,
|
|
273
273
|
className: "track-label-popup"
|
|
274
274
|
});
|
|
275
|
-
let t,
|
|
275
|
+
let t, n, m, h, P, S = !1, y = Date.now(), w, L = 0, p = null, b = 20, G = !1;
|
|
276
276
|
const W = 5, B = [], X = (c) => {
|
|
277
277
|
var d;
|
|
278
278
|
for (B.unshift(c); B.length > W; ) {
|
|
279
279
|
const g = B.pop(), M = l.get(g);
|
|
280
|
-
M && ((d = M.getSource()) == null || d.clear(), e == null || e.removeLayer(M), l.delete(g), delete
|
|
280
|
+
M && ((d = M.getSource()) == null || d.clear(), e == null || e.removeLayer(M), l.delete(g), delete r[g]);
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
283
|
let O = "";
|
|
284
284
|
const D = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], i = qe(() => {
|
|
285
|
-
if (s &&
|
|
285
|
+
if (s && r[s] && l.get(s).getVisible() && G) {
|
|
286
286
|
console.log("reRenderTrackLine------------");
|
|
287
|
-
const c = At(u(s,
|
|
287
|
+
const c = At(u(s, r[s]));
|
|
288
288
|
ze(s, c);
|
|
289
289
|
}
|
|
290
290
|
}, 300), u = (c, d) => {
|
|
291
291
|
let g = [];
|
|
292
|
-
const M = Math.max(1, Math.floor(d.length /
|
|
293
|
-
return g = d.filter((
|
|
294
|
-
if (Number(
|
|
295
|
-
const [$, A] = Xe(
|
|
296
|
-
|
|
292
|
+
const M = Math.max(1, Math.floor(d.length / b));
|
|
293
|
+
return g = d.filter((T, R) => R % M === 0).map((T, R) => {
|
|
294
|
+
if (Number(T.lon) > 180 || Number(T.lat) > 180) {
|
|
295
|
+
const [$, A] = Xe(T.lon, T.lat);
|
|
296
|
+
T.lon = $, T.lat = A;
|
|
297
297
|
}
|
|
298
|
-
return
|
|
298
|
+
return T.center = [T.lon, T.lat], T.centerPoint = no(T.center), T.time = lt(T.createdAt).format("YYYY-MM-DD HH:mm:ss"), T.id = c, T.index = R, T;
|
|
299
299
|
}), g;
|
|
300
|
-
},
|
|
301
|
-
if (console.log("renderTrackLine--------", c, d, g), !e || JSON.stringify(
|
|
300
|
+
}, v = async (c, d, g, M = "ship", E = 200) => {
|
|
301
|
+
if (console.log("renderTrackLine--------", c, d, g), !e || JSON.stringify(r[c]) === JSON.stringify(d) && s === c || (d = d == null ? void 0 : d.reverse(), x && M === "ship" && (e != null && e.getOverlays().getArray().includes(x) || e.addOverlay(x)), (d == null ? void 0 : d.length) < 2))
|
|
302
302
|
return;
|
|
303
|
-
X(c), s = c,
|
|
304
|
-
const
|
|
305
|
-
O = g || D[
|
|
303
|
+
X(c), s = c, r[c] = d, b = E;
|
|
304
|
+
const T = Object.keys(r).findIndex((R) => R === c) || 0;
|
|
305
|
+
O = g || D[T > 10 ? 10 : T], G = !0, await N(), await Je(s);
|
|
306
306
|
}, C = (c) => {
|
|
307
307
|
const d = new ae();
|
|
308
308
|
return new ve({
|
|
@@ -315,30 +315,30 @@ const io = (e) => {
|
|
|
315
315
|
});
|
|
316
316
|
}, k = (c) => {
|
|
317
317
|
l.forEach((d, g) => {
|
|
318
|
-
var
|
|
318
|
+
var E;
|
|
319
319
|
const M = g === c;
|
|
320
|
-
d.getVisible() !== M && (d.setVisible(M), e.getLayers().getArray().includes(d) || e.addLayer(d), M || (
|
|
320
|
+
d.getVisible() !== M && (d.setVisible(M), e.getLayers().getArray().includes(d) || e.addLayer(d), M || (E = d.getSource()) == null || E.clear());
|
|
321
321
|
}), s = c;
|
|
322
|
-
},
|
|
322
|
+
}, N = async () => {
|
|
323
323
|
const c = s;
|
|
324
324
|
if (!l.has(c)) {
|
|
325
|
-
const
|
|
326
|
-
l.set(c,
|
|
325
|
+
const T = C(c);
|
|
326
|
+
l.set(c, T);
|
|
327
327
|
}
|
|
328
328
|
await k(c);
|
|
329
|
-
const d = O || "", g =
|
|
329
|
+
const d = O || "", g = r[c] || [];
|
|
330
330
|
if (!(g && g.length > 1)) return [];
|
|
331
331
|
let M = [];
|
|
332
332
|
M = u(c, g);
|
|
333
|
-
const
|
|
334
|
-
M.length >= 2 && await z(c,
|
|
333
|
+
const E = M.map((T) => T.centerPoint);
|
|
334
|
+
M.length >= 2 && await z(c, E, d);
|
|
335
335
|
}, z = (c, d, g) => {
|
|
336
|
-
const M = new Pe(d),
|
|
337
|
-
if (
|
|
338
|
-
|
|
336
|
+
const M = new Pe(d), E = l.get(c).getSource(), T = E.getFeatureById(c);
|
|
337
|
+
if (T)
|
|
338
|
+
T.setGeometry(M), T.setId(c), T.setStyle(Z(g)), p = T;
|
|
339
339
|
else {
|
|
340
340
|
const R = new se({ geometry: M });
|
|
341
|
-
R.setId(c), R.set("type", "line"), R.setStyle(Z(g)),
|
|
341
|
+
R.setId(c), R.set("type", "line"), R.setStyle(Z(g)), E.addFeature(R), p = R;
|
|
342
342
|
}
|
|
343
343
|
return p;
|
|
344
344
|
}, Z = (c) => new H({
|
|
@@ -350,10 +350,10 @@ const io = (e) => {
|
|
|
350
350
|
const M = c == null ? void 0 : c.get("trackId");
|
|
351
351
|
if (c && M && d === "hover") {
|
|
352
352
|
e.getTargetElement().style.cursor = M ? "pointer" : "";
|
|
353
|
-
const
|
|
354
|
-
R && (f.querySelector(".popup-content"), f.innerHTML =
|
|
353
|
+
const E = c.get("data"), T = ce(E), R = g == null ? void 0 : g.coordinate;
|
|
354
|
+
R && (f.querySelector(".popup-content"), f.innerHTML = T, x == null || x.setPosition(R));
|
|
355
355
|
} else
|
|
356
|
-
|
|
356
|
+
x && x.setPosition(void 0);
|
|
357
357
|
}, ce = (c) => {
|
|
358
358
|
if (!(c != null && c.time)) return;
|
|
359
359
|
let d = "";
|
|
@@ -408,29 +408,29 @@ const io = (e) => {
|
|
|
408
408
|
let M = 0;
|
|
409
409
|
g[0].distance = 0;
|
|
410
410
|
for (let $ = 1; $ < g.length; $++) {
|
|
411
|
-
const A = g[$ - 1].pixel, q = g[$].pixel, K = q[0] - A[0],
|
|
412
|
-
M += Math.sqrt(K * K +
|
|
411
|
+
const A = g[$ - 1].pixel, q = g[$].pixel, K = q[0] - A[0], F = q[1] - A[1];
|
|
412
|
+
M += Math.sqrt(K * K + F * F), g[$].distance = M;
|
|
413
413
|
}
|
|
414
|
-
const
|
|
414
|
+
const E = g.filter(
|
|
415
415
|
($, A) => A === 0 || A === g.length - 1
|
|
416
|
-
),
|
|
417
|
-
for (let $ = 0; $ <
|
|
418
|
-
const A =
|
|
419
|
-
if (
|
|
420
|
-
const q =
|
|
421
|
-
for (let Y = 1; Y <=
|
|
416
|
+
), T = [];
|
|
417
|
+
for (let $ = 0; $ < E.length; $++) {
|
|
418
|
+
const A = E[$];
|
|
419
|
+
if (T.push(A), $ < E.length - 1) {
|
|
420
|
+
const q = E[$ + 1], K = q.distance - A.distance, F = Math.floor(K / 100);
|
|
421
|
+
for (let Y = 1; Y <= F; Y++) {
|
|
422
422
|
const j = A.distance + Y * 100;
|
|
423
423
|
if (j >= q.distance) break;
|
|
424
424
|
const _ = le(
|
|
425
425
|
g,
|
|
426
426
|
j
|
|
427
427
|
);
|
|
428
|
-
_ &&
|
|
428
|
+
_ && T.push(_);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
return Array.from(
|
|
433
|
-
new Map(
|
|
433
|
+
new Map(T.map(($) => [$.distance.toFixed(2), $])).values()
|
|
434
434
|
).map(($) => ({
|
|
435
435
|
...$.original,
|
|
436
436
|
// 优先保留原始数据
|
|
@@ -444,9 +444,9 @@ const io = (e) => {
|
|
|
444
444
|
};
|
|
445
445
|
function le(c, d) {
|
|
446
446
|
for (let g = 1; g < c.length; g++) {
|
|
447
|
-
const M = c[g - 1],
|
|
448
|
-
if (d >= M.distance && d <=
|
|
449
|
-
const
|
|
447
|
+
const M = c[g - 1], E = c[g];
|
|
448
|
+
if (d >= M.distance && d <= E.distance) {
|
|
449
|
+
const T = (d - M.distance) / (E.distance - M.distance), R = M.pixel[0] + T * (E.pixel[0] - M.pixel[0]), $ = M.pixel[1] + T * (E.pixel[1] - M.pixel[1]), A = e == null ? void 0 : e.getCoordinateFromPixel([R, $]);
|
|
450
450
|
return {
|
|
451
451
|
...M,
|
|
452
452
|
// 继承前一个点的属性(可调整)
|
|
@@ -462,9 +462,9 @@ const io = (e) => {
|
|
|
462
462
|
}
|
|
463
463
|
const ze = async (c, d) => {
|
|
464
464
|
await Qe(), await ft(c);
|
|
465
|
-
const g = oe(d), M = g.map((
|
|
466
|
-
l.get(c).getSource().addFeatures(M),
|
|
467
|
-
const R = pe(c, O,
|
|
465
|
+
const g = oe(d), M = g.map((T) => ke(T));
|
|
466
|
+
l.get(c).getSource().addFeatures(M), ht(c, g, d, O), g.forEach((T) => {
|
|
467
|
+
const R = pe(c, O, T);
|
|
468
468
|
e.addOverlay(R);
|
|
469
469
|
});
|
|
470
470
|
}, ke = (c) => {
|
|
@@ -476,7 +476,7 @@ const io = (e) => {
|
|
|
476
476
|
let g = [
|
|
477
477
|
...vt(c, O)
|
|
478
478
|
];
|
|
479
|
-
return (c.index === 0 || c.index ===
|
|
479
|
+
return (c.index === 0 || c.index === r[c.id].length - 1) && (g = [...mt(c)], d.set("type", "track_begin")), c.state !== void 0 && c.state !== null && (g = [...yt(c)], d.set("type", "track_icon")), d.setStyle(g), d;
|
|
480
480
|
}, pe = (c, d, g) => {
|
|
481
481
|
const M = document.createElement("div");
|
|
482
482
|
M.className = "track-overlay-label", M.style.position = "relative", M.style.backgroundColor = "rgba(255,255,255,0.8)", M.style.border = `1px solid ${d}`, M.style.fontSize = "12px", M.innerHTML = `
|
|
@@ -492,7 +492,7 @@ const io = (e) => {
|
|
|
492
492
|
stroke="${d}"
|
|
493
493
|
stroke-width="1" />
|
|
494
494
|
`;
|
|
495
|
-
const
|
|
495
|
+
const E = new ie({
|
|
496
496
|
element: M,
|
|
497
497
|
position: I(g.center),
|
|
498
498
|
positioning: "top-right",
|
|
@@ -500,7 +500,7 @@ const io = (e) => {
|
|
|
500
500
|
stopEvent: !1,
|
|
501
501
|
className: "track-label-time-overlay"
|
|
502
502
|
});
|
|
503
|
-
return
|
|
503
|
+
return E.set("class", "track-label-overlay"), E.set("trackId", c), E;
|
|
504
504
|
}, Qe = () => {
|
|
505
505
|
const c = e == null ? void 0 : e.getOverlays().getArray(), d = c == null ? void 0 : c.filter((g) => g.get("class") === "track-label-overlay");
|
|
506
506
|
d && d.length > 0 && d.forEach((g) => {
|
|
@@ -514,22 +514,22 @@ const io = (e) => {
|
|
|
514
514
|
}, vt = (c, d) => (`${c.time}`, [
|
|
515
515
|
new H({
|
|
516
516
|
// 扩大交互热区
|
|
517
|
-
image: new
|
|
517
|
+
image: new Se({
|
|
518
518
|
stroke: new fe({ color: "rgba(0, 0, 0, 0.01)", width: 20 }),
|
|
519
519
|
radius: 3
|
|
520
520
|
})
|
|
521
521
|
}),
|
|
522
522
|
// 轨迹点样式
|
|
523
523
|
new H({
|
|
524
|
-
image: new
|
|
524
|
+
image: new Se({
|
|
525
525
|
fill: new Q({ color: d }),
|
|
526
526
|
stroke: new fe({ color: "#fff", width: 2 }),
|
|
527
527
|
radius: 3
|
|
528
528
|
})
|
|
529
529
|
})
|
|
530
530
|
// textStyle,
|
|
531
|
-
]),
|
|
532
|
-
const d = "#E31818", g = "#1890FF", M = "",
|
|
531
|
+
]), yt = (c) => {
|
|
532
|
+
const d = "#E31818", g = "#1890FF", M = "", E = new H({
|
|
533
533
|
text: new ue({
|
|
534
534
|
font: "Normal 22px map-iconfont",
|
|
535
535
|
text: ge(M),
|
|
@@ -540,18 +540,18 @@ const io = (e) => {
|
|
|
540
540
|
}),
|
|
541
541
|
zIndex: 99
|
|
542
542
|
}), R = tt(""), A = tt(""), q = [];
|
|
543
|
-
return Number(c.state) === 0 ? q.push(R) : Number(c.state) === 1 && q.push(A), q.push(
|
|
544
|
-
},
|
|
545
|
-
const
|
|
546
|
-
|
|
543
|
+
return Number(c.state) === 0 ? q.push(R) : Number(c.state) === 1 && q.push(A), q.push(E), q;
|
|
544
|
+
}, ht = (c, d, g, M) => {
|
|
545
|
+
const E = d || [], T = d.length;
|
|
546
|
+
T || (E.push(g[0]), E.push(g[g.length - 1]));
|
|
547
547
|
const R = [];
|
|
548
|
-
for (let A = 0; A <
|
|
548
|
+
for (let A = 0; A < T - 1; A++) {
|
|
549
549
|
let q;
|
|
550
|
-
const K = d[A],
|
|
551
|
-
if (
|
|
552
|
-
q = g[
|
|
550
|
+
const K = d[A], F = (d[A + 1].index + K.index) / 2;
|
|
551
|
+
if (F % 2 === 0)
|
|
552
|
+
q = g[F].centerPoint;
|
|
553
553
|
else {
|
|
554
|
-
const Y = g[Math.floor(
|
|
554
|
+
const Y = g[Math.floor(F)], j = g[Math.ceil(F)];
|
|
555
555
|
if (Y && j) {
|
|
556
556
|
const [_, Ce] = Y.centerPoint, [Le, Ee] = j.centerPoint;
|
|
557
557
|
q = [(_ + Le) / 2, (Ce + Ee) / 2];
|
|
@@ -580,24 +580,24 @@ const io = (e) => {
|
|
|
580
580
|
const $ = l.get(c).getSource();
|
|
581
581
|
$ == null || $.addFeatures(R);
|
|
582
582
|
}, Je = (c) => {
|
|
583
|
-
var
|
|
584
|
-
const d = e.getView(), g = (
|
|
583
|
+
var T, R;
|
|
584
|
+
const d = e.getView(), g = (T = l == null ? void 0 : l.get(c)) == null ? void 0 : T.getSource(), M = p || (c ? g == null ? void 0 : g.getFeatureById(c) : null);
|
|
585
585
|
if (!M) return;
|
|
586
|
-
const
|
|
587
|
-
if (
|
|
586
|
+
const E = (R = M == null ? void 0 : M.getGeometry()) == null ? void 0 : R.getExtent();
|
|
587
|
+
if (E != null && E.length)
|
|
588
588
|
try {
|
|
589
|
-
const $ = Gt(
|
|
589
|
+
const $ = Gt(E, Math.max(E[2] - E[0], E[3] - E[1]) * 0.02);
|
|
590
590
|
d.fit($);
|
|
591
591
|
} catch ($) {
|
|
592
592
|
console.log($);
|
|
593
593
|
}
|
|
594
594
|
}, mt = (c) => {
|
|
595
|
-
const d = "",
|
|
595
|
+
const d = "", E = c.index === 0 ? "#fcdc3f" : "#ff0000";
|
|
596
596
|
return [new H({
|
|
597
597
|
text: new ue({
|
|
598
598
|
font: "Normal 14px map-iconfont",
|
|
599
599
|
text: ge(d),
|
|
600
|
-
fill: new Q({ color:
|
|
600
|
+
fill: new Q({ color: E })
|
|
601
601
|
}),
|
|
602
602
|
zIndex: 101
|
|
603
603
|
})];
|
|
@@ -605,30 +605,30 @@ const io = (e) => {
|
|
|
605
605
|
console.log("清除所有的轨迹-----"), Me(), l.forEach((d) => {
|
|
606
606
|
var g;
|
|
607
607
|
(g = d.getSource()) == null || g.clear(), e == null || e.removeLayer(d);
|
|
608
|
-
}), Object.keys(
|
|
609
|
-
l.delete(d), delete
|
|
608
|
+
}), Object.keys(r).forEach((d) => {
|
|
609
|
+
l.delete(d), delete r[d];
|
|
610
610
|
}), G = !1, Qe();
|
|
611
611
|
}, xt = (c) => {
|
|
612
612
|
const d = l.get(c || s);
|
|
613
613
|
d == null || d.setVisible(!1);
|
|
614
614
|
const g = e.getOverlays().getArray();
|
|
615
615
|
for (let M = 0; M < g.length; ) {
|
|
616
|
-
const
|
|
617
|
-
|
|
616
|
+
const E = g[M];
|
|
617
|
+
E.get("class") === "track-label-overlay" ? (E.setPosition(void 0), e.removeOverlay(E)) : M++;
|
|
618
618
|
}
|
|
619
619
|
Me();
|
|
620
620
|
}, bt = (c, d = we.NM) => {
|
|
621
621
|
const g = {
|
|
622
622
|
id: c,
|
|
623
623
|
length: "--"
|
|
624
|
-
},
|
|
624
|
+
}, E = (r[c] || []).map(
|
|
625
625
|
(R) => xe([R.lon, R.lat], J.data, J.mercator)
|
|
626
|
-
),
|
|
627
|
-
return g.length = ro(
|
|
626
|
+
), T = new Pe(E);
|
|
627
|
+
return g.length = ro(T, d) || "--", g;
|
|
628
628
|
}, kt = (c, d) => {
|
|
629
629
|
pt(String(c), d);
|
|
630
630
|
}, pt = (c, d) => {
|
|
631
|
-
const g =
|
|
631
|
+
const g = r[String(c)], M = g == null ? void 0 : g.map((E) => [E.lon, E.lat]);
|
|
632
632
|
M && Lt(M, d);
|
|
633
633
|
}, Oe = new H({
|
|
634
634
|
text: new ue({
|
|
@@ -639,88 +639,88 @@ const io = (e) => {
|
|
|
639
639
|
// 初始旋转角度
|
|
640
640
|
})
|
|
641
641
|
}), Mt = (c, d) => {
|
|
642
|
-
var
|
|
643
|
-
const g = Number(50 * d), M = ((
|
|
644
|
-
if (
|
|
642
|
+
var F, Y;
|
|
643
|
+
const g = Number(50 * d), M = ((F = c.frameState) == null ? void 0 : F.time) ?? Date.now(), E = M - y;
|
|
644
|
+
if (L = (L + g * E / 1e6) % 2, y = M, L >= 1) {
|
|
645
645
|
Me();
|
|
646
646
|
return;
|
|
647
647
|
}
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
), R =
|
|
651
|
-
|
|
652
|
-
), $ =
|
|
653
|
-
|
|
648
|
+
const T = n.getCoordinateAt(
|
|
649
|
+
L > 1 ? 2 - L : L
|
|
650
|
+
), R = n.getCoordinateAt(
|
|
651
|
+
L > 1 ? L - 0.01 : L
|
|
652
|
+
), $ = n.getCoordinateAt(
|
|
653
|
+
L > 1 ? 2 - L : L + 0.01
|
|
654
654
|
), q = Ke(
|
|
655
655
|
ot(R, "array"),
|
|
656
656
|
ot($, "array")
|
|
657
657
|
) * Math.PI / 180;
|
|
658
|
-
(Y = Oe.getText()) == null || Y.setRotation(q),
|
|
658
|
+
(Y = Oe.getText()) == null || Y.setRotation(q), h.setCoordinates(T);
|
|
659
659
|
const K = Wt(c);
|
|
660
|
-
K.setStyle(Oe), K.drawGeometry(
|
|
660
|
+
K.setStyle(Oe), K.drawGeometry(h), e == null || e.render();
|
|
661
661
|
}, Ct = () => {
|
|
662
662
|
var c;
|
|
663
|
-
|
|
663
|
+
S = !0, y = Date.now(), L = 0, h = ((c = m.getGeometry()) == null ? void 0 : c.clone()) || new ne([0, 0]), o && (w == null || w.on("postrender", o)), P == null || P.setGeometry(void 0);
|
|
664
664
|
}, Me = () => {
|
|
665
|
-
|
|
665
|
+
S && (S = !1, P == null || P.setGeometry(void 0), o && w && w.un("postrender", o), w && (e == null || e.removeLayer(w)), w = null, P = null);
|
|
666
666
|
}, Lt = (c, d) => {
|
|
667
|
-
|
|
667
|
+
S && Me(), t = new Ie({
|
|
668
668
|
factor: 1e6
|
|
669
|
-
}).writeGeometry(new Pe(c)),
|
|
669
|
+
}).writeGeometry(new Pe(c)), n = new Ie({
|
|
670
670
|
factor: 1e6
|
|
671
671
|
}).readGeometry(t, {
|
|
672
672
|
dataProjection: J.data,
|
|
673
673
|
featureProjection: J.mercator
|
|
674
674
|
}), m = new se({
|
|
675
675
|
type: "icon",
|
|
676
|
-
geometry: new ne(
|
|
676
|
+
geometry: new ne(n.getFirstCoordinate())
|
|
677
677
|
});
|
|
678
678
|
const g = m.getGeometry();
|
|
679
|
-
|
|
679
|
+
h = g ? g.clone() : new ne([0, 0]), P = new se({
|
|
680
680
|
type: "geoMarker",
|
|
681
681
|
style: Oe,
|
|
682
|
-
geometry:
|
|
682
|
+
geometry: h
|
|
683
683
|
}), w = new ve({
|
|
684
684
|
source: new ae({
|
|
685
685
|
features: [P]
|
|
686
686
|
})
|
|
687
687
|
}), e == null || e.addLayer(w), o = (M) => Mt(M, d), Ct();
|
|
688
688
|
}, Ke = (c, d, g) => {
|
|
689
|
-
function M(
|
|
690
|
-
return 180 * (
|
|
689
|
+
function M(F) {
|
|
690
|
+
return 180 * (F % (2 * Math.PI)) / Math.PI;
|
|
691
691
|
}
|
|
692
|
-
function
|
|
693
|
-
return
|
|
692
|
+
function E(F) {
|
|
693
|
+
return F % 360 * Math.PI / 180;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function T(F) {
|
|
696
696
|
var Y;
|
|
697
|
-
if (!
|
|
698
|
-
if (!Array.isArray(
|
|
699
|
-
if ((
|
|
700
|
-
return
|
|
701
|
-
if (
|
|
697
|
+
if (!F) throw new Error("Coordinate is required");
|
|
698
|
+
if (!Array.isArray(F)) {
|
|
699
|
+
if ((F == null ? void 0 : F.type) === "Feature" && (F == null ? void 0 : F.geometry) !== null && ((Y = F == null ? void 0 : F.geometry) == null ? void 0 : Y.type) === "Point")
|
|
700
|
+
return F == null ? void 0 : F.geometry.coordinates;
|
|
701
|
+
if (F.type === "Point") return (F == null ? void 0 : F.coordinates) || [];
|
|
702
702
|
}
|
|
703
|
-
if (Array.isArray(
|
|
704
|
-
return
|
|
703
|
+
if (Array.isArray(F) && F.length >= 2 && !Array.isArray(F[0]) && !Array.isArray(F[1]))
|
|
704
|
+
return F;
|
|
705
705
|
throw new Error(
|
|
706
706
|
"Coordinate must be GeoJSON Point or an Array of numbers"
|
|
707
707
|
);
|
|
708
708
|
}
|
|
709
|
-
function R(
|
|
709
|
+
function R(F, Y, j = {}) {
|
|
710
710
|
if (j.final)
|
|
711
711
|
return function(Ft, Pt) {
|
|
712
712
|
return (R(Pt, Ft) + 180) % 360;
|
|
713
|
-
}(
|
|
714
|
-
const _ =
|
|
713
|
+
}(F, Y);
|
|
714
|
+
const _ = T(F), Ce = T(Y), Le = E(_[0]), Ee = E(Ce[0]), _e = E(_[1]), Re = E(Ce[1]), Et = Math.sin(Ee - Le) * Math.cos(Re), Tt = Math.cos(_e) * Math.sin(Re) - Math.sin(_e) * Math.cos(Re) * Math.cos(Ee - Le);
|
|
715
715
|
return M(Math.atan2(Et, Tt));
|
|
716
716
|
}
|
|
717
|
-
function $(
|
|
718
|
-
return !isNaN(
|
|
717
|
+
function $(F) {
|
|
718
|
+
return !isNaN(F) && F !== null && !Array.isArray(F);
|
|
719
719
|
}
|
|
720
|
-
function A(
|
|
721
|
-
return
|
|
720
|
+
function A(F, Y = {}, j = {}) {
|
|
721
|
+
return F || console.log("Coordinates are required"), Array.isArray(F) || console.log("Coordinates must be an Array"), F.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!$(F[0]) || !$(F[1])) && console.log("Coordinates must contain numbers"), q({ type: "Point", coordinates: F }, Y, j);
|
|
722
722
|
}
|
|
723
|
-
function q(
|
|
723
|
+
function q(F, Y = {}, j = {}) {
|
|
724
724
|
const _ = {
|
|
725
725
|
type: "Feature",
|
|
726
726
|
id: "",
|
|
@@ -728,13 +728,13 @@ const io = (e) => {
|
|
|
728
728
|
bbox: {},
|
|
729
729
|
geometry: {}
|
|
730
730
|
};
|
|
731
|
-
return j.id !== void 0 && (_.id = j.id), j.bbox && (_.bbox = j.bbox), _.properties = Y, _.geometry =
|
|
731
|
+
return j.id !== void 0 && (_.id = j.id), j.bbox && (_.bbox = j.bbox), _.properties = Y, _.geometry = F, _;
|
|
732
732
|
}
|
|
733
733
|
const K = R(A(c), A(d), g);
|
|
734
734
|
return K < 0 ? 360 + K : K;
|
|
735
735
|
};
|
|
736
736
|
return {
|
|
737
|
-
render:
|
|
737
|
+
render: v,
|
|
738
738
|
remove: wt,
|
|
739
739
|
play: kt,
|
|
740
740
|
setCenter: Je,
|
|
@@ -746,7 +746,7 @@ const io = (e) => {
|
|
|
746
746
|
};
|
|
747
747
|
function co(e) {
|
|
748
748
|
console.log("useShipOverlay", e);
|
|
749
|
-
const l = U(null),
|
|
749
|
+
const l = U(null), r = Te(() => ({
|
|
750
750
|
"--overlay-color": "#FFF",
|
|
751
751
|
"--bg-color1": e.colors && e.colors[0] ? e.colors[0] : "#ffffff",
|
|
752
752
|
// 默认第一个颜色
|
|
@@ -795,7 +795,7 @@ function co(e) {
|
|
|
795
795
|
return () => re("div", {
|
|
796
796
|
ref: l,
|
|
797
797
|
class: "ship-overlay-container",
|
|
798
|
-
style:
|
|
798
|
+
style: r.value
|
|
799
799
|
}, [
|
|
800
800
|
re(
|
|
801
801
|
"div",
|
|
@@ -860,10 +860,10 @@ function co(e) {
|
|
|
860
860
|
]);
|
|
861
861
|
}
|
|
862
862
|
U([]);
|
|
863
|
-
function ao(e, l,
|
|
863
|
+
function ao(e, l, r, s) {
|
|
864
864
|
if (l) {
|
|
865
865
|
const a = new ie({
|
|
866
|
-
element:
|
|
866
|
+
element: r,
|
|
867
867
|
positioning: "top-left",
|
|
868
868
|
id: "label-" + (s == null ? void 0 : s.id),
|
|
869
869
|
offset: [20, -20],
|
|
@@ -875,36 +875,36 @@ function ao(e, l, n, s) {
|
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
const uo = (e) => {
|
|
878
|
-
const { spd: l, hdg:
|
|
879
|
-
return l ?
|
|
880
|
-
},
|
|
881
|
-
const { shipData:
|
|
878
|
+
const { spd: l, hdg: r, cog: s } = e;
|
|
879
|
+
return l ? r !== null && +r != 511 && s !== null ? s - +r >= 3 ? te.right : s - +r <= -3 ? te.left : te.front : te.front : "";
|
|
880
|
+
}, ye = (e, l) => {
|
|
881
|
+
const { shipData: r } = l.getProperties(), s = at(e), a = je(e, r, s);
|
|
882
882
|
return go(l, a, s);
|
|
883
883
|
}, at = (e) => {
|
|
884
884
|
const l = e == null ? void 0 : e.getView().getZoom();
|
|
885
885
|
return l <= ee.shipModelMax && l >= ee.shipTriggleMin ? "ship" : "triangle";
|
|
886
|
-
}, je = (e, l,
|
|
887
|
-
if (
|
|
888
|
-
const { len: s, wid: a } = l, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()),
|
|
889
|
-
return
|
|
886
|
+
}, je = (e, l, r) => {
|
|
887
|
+
if (r === "ship") {
|
|
888
|
+
const { len: s, wid: a } = l, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), n = s * t / o, m = a * t / f, h = Math.min(n, m);
|
|
889
|
+
return h < 0.2 ? 0.2 : h > 2 ? 2 : h;
|
|
890
890
|
}
|
|
891
891
|
return ee.scaleNum;
|
|
892
|
-
}, go = (e, l,
|
|
893
|
-
const { color: s, direct: a, isHighlight: o, shipData: f } = e.getProperties(),
|
|
892
|
+
}, go = (e, l, r) => {
|
|
893
|
+
const { color: s, direct: a, isHighlight: o, shipData: f } = e.getProperties(), x = ((f == null ? void 0 : f.cog) - 90 + 360) % 360;
|
|
894
894
|
return new H({
|
|
895
895
|
image: new be({
|
|
896
896
|
src: t(),
|
|
897
897
|
scale: l || ee.scaleNum,
|
|
898
898
|
anchor: [0.5, 0.5],
|
|
899
|
-
rotation:
|
|
899
|
+
rotation: x * Math.PI / 180,
|
|
900
900
|
rotateWithView: !1
|
|
901
901
|
})
|
|
902
902
|
});
|
|
903
903
|
function t() {
|
|
904
|
-
return `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
904
|
+
return `data:image/svg+xml;utf8,${encodeURIComponent(n())}`;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
switch (
|
|
906
|
+
function n() {
|
|
907
|
+
switch (r) {
|
|
908
908
|
case "triangle":
|
|
909
909
|
return `<svg width="41" height="24" viewBox="0 0 41 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
910
910
|
<path d="M30.8843 12.6777L2.21343 21.7067C1.75559 21.8509 1.28947 21.509 1.28947 21.029L1.28947 2.97103C1.28947 2.49102 1.75558 2.14913 2.21342 2.29331L30.8843 11.3223C31.5471 11.531 31.5471 12.469 30.8843 12.6777Z"
|
|
@@ -931,8 +931,8 @@ const uo = (e) => {
|
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
}, fo = (e, l) => {
|
|
934
|
-
const
|
|
935
|
-
element:
|
|
934
|
+
const r = dt(e, l), s = l.id, { lon: a, lat: o } = l, f = new ie({
|
|
935
|
+
element: r,
|
|
936
936
|
position: I([a, o]),
|
|
937
937
|
id: "selected-" + s,
|
|
938
938
|
positioning: "center-center",
|
|
@@ -941,7 +941,7 @@ const uo = (e) => {
|
|
|
941
941
|
});
|
|
942
942
|
return f.set("class", "ship-overlay-selected"), f;
|
|
943
943
|
}, dt = (e, l) => {
|
|
944
|
-
const
|
|
944
|
+
const r = at(e), s = je(e, l, r), a = r === "ship" ? 109 : 49, o = `
|
|
945
945
|
<svg style="transform:scale(${s});" xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 49 49" fill="none">
|
|
946
946
|
<path d="M1.99982 46.9998L1.99982 1.99982L46.9998 1.99982L46.9998 46.9998L1.99982 46.9998Z" fill="#FF2424" fill-opacity="0.2"/>
|
|
947
947
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9998 0.5V3.5L3.49976 3.5V20H0.499756V0.500002L19.9998 0.5ZM45.4998 3.5H28.9998V0.5H48.4998V20H45.4998V3.5ZM48.4998 29L48.4998 48.5H28.9998V45.5H45.4998L45.4998 29H48.4998ZM3.49976 45.5L3.49976 29H0.499756L0.499758 48.5L19.9998 48.5V45.5L3.49976 45.5Z" fill="#FF2424"/>
|
|
@@ -949,15 +949,15 @@ const uo = (e) => {
|
|
|
949
949
|
`, f = document.createElement("div");
|
|
950
950
|
return f.className = "ship-overlay-selected", f.innerHTML = o, f;
|
|
951
951
|
}, vo = (e, l) => {
|
|
952
|
-
const { lon:
|
|
953
|
-
|
|
952
|
+
const { lon: r, lat: s, blinking: a } = l, o = ut(l);
|
|
953
|
+
r && s && ao(e, I([r, s]), o, { ...l, blinking: a });
|
|
954
954
|
}, ut = (e) => {
|
|
955
955
|
const l = document.createElement("div");
|
|
956
956
|
l.className = "ship-overlay-box", l.style.position = "relative";
|
|
957
|
-
const { lon:
|
|
957
|
+
const { lon: r, lat: s, blinking: a, blinkingColors: o, name: f } = e, x = De({
|
|
958
958
|
setup() {
|
|
959
959
|
return co({
|
|
960
|
-
position: [
|
|
960
|
+
position: [r + 2e-3, s + 2e-3],
|
|
961
961
|
selected: a,
|
|
962
962
|
name: f,
|
|
963
963
|
colors: o || [],
|
|
@@ -967,12 +967,12 @@ const uo = (e) => {
|
|
|
967
967
|
});
|
|
968
968
|
}
|
|
969
969
|
});
|
|
970
|
-
return
|
|
970
|
+
return Nt(x, l), l;
|
|
971
971
|
}, rt = (e) => {
|
|
972
972
|
const l = [];
|
|
973
973
|
return e.existDevice && l.push(""), e.existMobile && l.push(""), e.existWaterGauge && l.push(""), l;
|
|
974
974
|
};
|
|
975
|
-
function
|
|
975
|
+
function yo() {
|
|
976
976
|
const e = [
|
|
977
977
|
"left-top",
|
|
978
978
|
"left-middle",
|
|
@@ -983,81 +983,81 @@ function ho() {
|
|
|
983
983
|
];
|
|
984
984
|
return e[Math.floor(Math.random() * e.length)];
|
|
985
985
|
}
|
|
986
|
-
const
|
|
987
|
-
function mo(e, l,
|
|
986
|
+
const ho = window.devicePixelRatio || 1;
|
|
987
|
+
function mo(e, l, r = "left-bottom", s = 2) {
|
|
988
988
|
const a = document.createElement("canvas"), o = a.getContext("2d");
|
|
989
989
|
if (!o) return "";
|
|
990
|
-
const f = 2,
|
|
990
|
+
const f = 2, x = 8, t = 16, n = window.devicePixelRatio || 1, m = "500 12px Arial", h = "14px map-iconfont";
|
|
991
991
|
o.font = m;
|
|
992
|
-
const
|
|
993
|
-
o.font =
|
|
994
|
-
const
|
|
992
|
+
const S = o.measureText(e).width;
|
|
993
|
+
o.font = h;
|
|
994
|
+
const y = l.map((k) => ({ width: o.measureText(ge(k)).width, height: 14 })), w = y.reduce((k, N) => k + N.width, 0), L = (l.length - 1) * s, p = x + S + w + L + x, b = f + 14 + f * 2;
|
|
995
995
|
let G, W, B = 0, X = 0, O = 0, D = 0, i = 0, u = 0;
|
|
996
|
-
switch (G = t + p,
|
|
996
|
+
switch (G = t + p, r) {
|
|
997
997
|
case "right-top":
|
|
998
|
-
W = t +
|
|
998
|
+
W = t + b, B = 0, X = t + b, O = t, D = 0, i = t, u = 0;
|
|
999
999
|
break;
|
|
1000
1000
|
case "right-middle":
|
|
1001
|
-
W =
|
|
1001
|
+
W = b, B = 0, X = b / 2, O = t, D = b / 2, i = t, u = 0;
|
|
1002
1002
|
break;
|
|
1003
1003
|
case "right-bottom":
|
|
1004
|
-
W = t +
|
|
1004
|
+
W = t + b, B = 0, X = 0, O = t, D = t, i = t, u = t;
|
|
1005
1005
|
break;
|
|
1006
1006
|
case "left-top":
|
|
1007
|
-
W = t +
|
|
1007
|
+
W = t + b, B = p, X = t, O = p + t, D = b + t, i = 0, u = 0;
|
|
1008
1008
|
break;
|
|
1009
1009
|
case "left-middle":
|
|
1010
|
-
W =
|
|
1010
|
+
W = b, B = p, X = b / 2, O = p + t, D = b / 2, i = 0, u = 0;
|
|
1011
1011
|
break;
|
|
1012
1012
|
case "left-bottom":
|
|
1013
|
-
W = t +
|
|
1013
|
+
W = t + b, B = p, X = b, O = p + t, D = 0, i = 0, u = t;
|
|
1014
1014
|
break;
|
|
1015
1015
|
}
|
|
1016
|
-
a.width = Math.round(G *
|
|
1017
|
-
const
|
|
1018
|
-
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, i +
|
|
1019
|
-
let C = i +
|
|
1020
|
-
return l.length > 0 && l.forEach((k,
|
|
1021
|
-
const z = u + f +
|
|
1022
|
-
o.fillText(ge(k), C, z), C +=
|
|
1016
|
+
a.width = Math.round(G * n), a.height = Math.round(W * n), o.scale(n, n), o.clearRect(0, 0, G, W), o.beginPath(), o.moveTo(B, X), o.lineTo(O, D), o.strokeStyle = "#FFF", o.lineWidth = 1, o.stroke(), o.fillStyle = "#FFF", o.fillRect(i, u, p, b), o.font = m, o.textBaseline = "middle";
|
|
1017
|
+
const v = u + f + b / 2;
|
|
1018
|
+
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, i + x, v), o.fillStyle = "#000000", o.fillText(e, i + x, v), o.font = h, o.fillStyle = "#3370ff";
|
|
1019
|
+
let C = i + x + S + s;
|
|
1020
|
+
return l.length > 0 && l.forEach((k, N) => {
|
|
1021
|
+
const z = u + f + b / 2;
|
|
1022
|
+
o.fillText(ge(k), C, z), C += y[N].width + s;
|
|
1023
1023
|
}), a.toDataURL("image/png");
|
|
1024
1024
|
}
|
|
1025
1025
|
const nt = (e, l) => {
|
|
1026
|
-
const { name:
|
|
1027
|
-
let
|
|
1026
|
+
const { name: r, rightIcons: s, selected: a } = e.getProperties(), o = l !== 1 ? yo() : "right-top", f = mo(r, s, o);
|
|
1027
|
+
let x = [0, 0];
|
|
1028
1028
|
switch (o) {
|
|
1029
1029
|
case "right-top":
|
|
1030
|
-
|
|
1030
|
+
x = [0, 1];
|
|
1031
1031
|
break;
|
|
1032
1032
|
case "right-middle":
|
|
1033
|
-
|
|
1033
|
+
x = [0, 0.5];
|
|
1034
1034
|
break;
|
|
1035
1035
|
case "right-bottom":
|
|
1036
|
-
|
|
1036
|
+
x = [0, 0];
|
|
1037
1037
|
break;
|
|
1038
1038
|
case "left-top":
|
|
1039
|
-
|
|
1039
|
+
x = [1, 1];
|
|
1040
1040
|
break;
|
|
1041
1041
|
case "left-middle":
|
|
1042
|
-
|
|
1042
|
+
x = [1, 0.5];
|
|
1043
1043
|
break;
|
|
1044
1044
|
case "left-bottom":
|
|
1045
|
-
|
|
1045
|
+
x = [1, 0];
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
1048
|
return new H({
|
|
1049
1049
|
image: new be({
|
|
1050
1050
|
src: f,
|
|
1051
|
-
anchor:
|
|
1051
|
+
anchor: x,
|
|
1052
1052
|
displacement: [0, 0],
|
|
1053
|
-
scale: 1 /
|
|
1053
|
+
scale: 1 / ho,
|
|
1054
1054
|
anchorXUnits: "fraction",
|
|
1055
1055
|
anchorYUnits: "fraction"
|
|
1056
1056
|
}),
|
|
1057
1057
|
zIndex: a ? 100 : 10
|
|
1058
1058
|
});
|
|
1059
1059
|
}, wo = (e) => {
|
|
1060
|
-
let l = null,
|
|
1060
|
+
let l = null, r = null;
|
|
1061
1061
|
const s = new ae(), a = new Yt({
|
|
1062
1062
|
source: s,
|
|
1063
1063
|
className: "zh-map--ship-layer",
|
|
@@ -1072,19 +1072,19 @@ const nt = (e, l) => {
|
|
|
1072
1072
|
declutter: !0
|
|
1073
1073
|
});
|
|
1074
1074
|
e == null || e.addLayer(a), e == null || e.addLayer(f);
|
|
1075
|
-
let
|
|
1076
|
-
const
|
|
1075
|
+
let x = null, t = "", n = {}, m = {};
|
|
1076
|
+
const h = (i) => {
|
|
1077
1077
|
if (!i || !e) return;
|
|
1078
|
-
const u = (
|
|
1079
|
-
if (
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1078
|
+
const u = (r == null ? void 0 : r.id) || (l == null ? void 0 : l.get("id"));
|
|
1079
|
+
if (r) {
|
|
1080
|
+
const v = i.filter((C) => C.id === u);
|
|
1081
|
+
v.length === 0 ? i.push(r) : r = v[0];
|
|
1082
1082
|
}
|
|
1083
|
-
w(),
|
|
1083
|
+
w(), L(!0), D(i), S();
|
|
1084
1084
|
}, P = (i) => {
|
|
1085
1085
|
var V;
|
|
1086
|
-
const u = (
|
|
1087
|
-
geometry: new ne(
|
|
1086
|
+
const u = (r == null ? void 0 : r.id) || (l == null ? void 0 : l.get("id")), v = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), C = ((V = m[i.id]) == null ? void 0 : V.blinkColors) || [], N = C[C.length - 1] || i.fill || "#04C900", z = uo(i), Z = new se({
|
|
1087
|
+
geometry: new ne(v),
|
|
1088
1088
|
// 船舶数据
|
|
1089
1089
|
shipData: i,
|
|
1090
1090
|
id: i.id,
|
|
@@ -1097,72 +1097,72 @@ const nt = (e, l) => {
|
|
|
1097
1097
|
// // 闪烁颜色
|
|
1098
1098
|
// blinkingColor: attentionShipsColor[ship.id].blinkColors || '',
|
|
1099
1099
|
// 船舶颜色
|
|
1100
|
-
color:
|
|
1100
|
+
color: N,
|
|
1101
1101
|
// 船艏向的方向
|
|
1102
1102
|
direct: z,
|
|
1103
1103
|
// 高亮
|
|
1104
1104
|
isHighlight: !1
|
|
1105
1105
|
});
|
|
1106
|
-
return Z.set("clickGeometry", new Bt(
|
|
1107
|
-
},
|
|
1108
|
-
if (!
|
|
1109
|
-
let u = e.getOverlays().getArray().find((
|
|
1106
|
+
return Z.set("clickGeometry", new Bt(v)), Z;
|
|
1107
|
+
}, S = async () => {
|
|
1108
|
+
if (!r || !e) return;
|
|
1109
|
+
let u = e.getOverlays().getArray().find((v) => v.get("class") == "ship-overlay-selected");
|
|
1110
1110
|
if (u) {
|
|
1111
|
-
const
|
|
1112
|
-
await u.setElement(
|
|
1111
|
+
const v = dt(e, r);
|
|
1112
|
+
await u.setElement(v), await u.setPosition(I([r.lon, r.lat]));
|
|
1113
1113
|
} else
|
|
1114
|
-
u = fo(e,
|
|
1114
|
+
u = fo(e, r), u && e.addOverlay(u);
|
|
1115
1115
|
setTimeout(() => {
|
|
1116
|
-
var
|
|
1117
|
-
u && ((
|
|
1116
|
+
var v;
|
|
1117
|
+
u && ((v = u.get("element")) != null && v.parentElement) && (u.get("element").parentElement.style.display = "block");
|
|
1118
1118
|
}, 20);
|
|
1119
|
-
},
|
|
1119
|
+
}, y = (i) => {
|
|
1120
1120
|
if (i === "start") {
|
|
1121
1121
|
const u = () => {
|
|
1122
1122
|
s.getFeatures().forEach((k) => {
|
|
1123
|
-
k.setStyle(
|
|
1123
|
+
k.setStyle(ye(e, k));
|
|
1124
1124
|
});
|
|
1125
1125
|
const C = (e == null ? void 0 : e.getOverlays().getArray()).find((k) => k.get("class") == "ship-overlay-selected");
|
|
1126
1126
|
if (C) {
|
|
1127
|
-
const k = C.getElement(),
|
|
1128
|
-
console.log("scaleFactor",
|
|
1127
|
+
const k = C.getElement(), N = je(e, r, "ship");
|
|
1128
|
+
console.log("scaleFactor", N), k.style.transform = `scale(${N})`;
|
|
1129
1129
|
}
|
|
1130
|
-
|
|
1130
|
+
x = requestAnimationFrame(u);
|
|
1131
1131
|
};
|
|
1132
1132
|
u();
|
|
1133
1133
|
} else
|
|
1134
|
-
|
|
1134
|
+
x && (cancelAnimationFrame(x), x = null);
|
|
1135
1135
|
}, w = () => {
|
|
1136
|
-
e && s && (s.clear(), o.clear(),
|
|
1137
|
-
},
|
|
1138
|
-
const u = e.getOverlays().getArray().filter((
|
|
1136
|
+
e && s && (s.clear(), o.clear(), L());
|
|
1137
|
+
}, L = (i) => {
|
|
1138
|
+
const u = e.getOverlays().getArray().filter((v) => v.get("class") == "zh-map-ship-overlay");
|
|
1139
1139
|
if (u && u.length > 0) {
|
|
1140
|
-
for (let
|
|
1141
|
-
if (!i && u[
|
|
1142
|
-
const C = u[
|
|
1140
|
+
for (let v = 0; v < u.length; v++)
|
|
1141
|
+
if (!i && u[v].get("class") !== "ship-overlay-selected") {
|
|
1142
|
+
const C = u[v];
|
|
1143
1143
|
C.setPosition(void 0), e.removeOverlay(C), C.dispose();
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
}, p = (i, u) => {
|
|
1147
|
-
|
|
1148
|
-
const
|
|
1149
|
-
for (const k in
|
|
1150
|
-
const
|
|
1147
|
+
n = i, m = u, console.log("attentionShips", n, "attentionShipsColor", u);
|
|
1148
|
+
const v = e.getOverlays().getArray(), C = s.getFeatures();
|
|
1149
|
+
for (const k in n) {
|
|
1150
|
+
const N = n[k], z = v.find((V) => V.getId() === "label-" + k), Z = C.find((V) => k === V.get("id"));
|
|
1151
1151
|
if (z && Z) {
|
|
1152
1152
|
const V = u[k].blinkColors || [], { shipData: ce, name: oe, color: le } = Z == null ? void 0 : Z.getProperties();
|
|
1153
|
-
Z.set("blinking",
|
|
1153
|
+
Z.set("blinking", N), V[(V == null ? void 0 : V.length) - 1] && le !== V[(V == null ? void 0 : V.length) - 1] && (Z.set("color", V[(V == null ? void 0 : V.length) - 1] || ""), Z.setStyle(ye(e, Z)));
|
|
1154
1154
|
const ze = {
|
|
1155
1155
|
...ce,
|
|
1156
|
-
blinking:
|
|
1156
|
+
blinking: N,
|
|
1157
1157
|
blinkingColors: V || [],
|
|
1158
1158
|
name: oe + "(" + u[k].shipState + ")"
|
|
1159
1159
|
}, ke = z.getElement(), pe = ut(ze);
|
|
1160
1160
|
ke && ke !== pe && z.setElement(pe);
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
|
-
},
|
|
1163
|
+
}, b = (i) => {
|
|
1164
1164
|
if (!e) return;
|
|
1165
|
-
const u = s.getFeatures(),
|
|
1165
|
+
const u = s.getFeatures(), v = o.getFeatures(), C = l ? l.get("id") : "", k = u.filter((V) => V.get("id") !== C), N = v == null ? void 0 : v.filter((V) => V.get("id") !== C), z = /* @__PURE__ */ new Map();
|
|
1166
1166
|
i.forEach((V) => {
|
|
1167
1167
|
z.set(V.id, !0);
|
|
1168
1168
|
});
|
|
@@ -1173,11 +1173,11 @@ const nt = (e, l) => {
|
|
|
1173
1173
|
V.setStyle([]);
|
|
1174
1174
|
else {
|
|
1175
1175
|
const le = V.getStyle();
|
|
1176
|
-
(le == null ? void 0 : le.length) == 0 && V.setStyle(
|
|
1176
|
+
(le == null ? void 0 : le.length) == 0 && V.setStyle(ye(e, V));
|
|
1177
1177
|
}
|
|
1178
1178
|
const oe = Z.find((le) => le.getId() === "label-" + ce);
|
|
1179
1179
|
oe && oe.setPosition(void 0);
|
|
1180
|
-
}), console.log(
|
|
1180
|
+
}), console.log(N), N.forEach((V) => {
|
|
1181
1181
|
const ce = V.get("id");
|
|
1182
1182
|
if (!z.has(ce))
|
|
1183
1183
|
V.setStyle([]);
|
|
@@ -1189,18 +1189,18 @@ const nt = (e, l) => {
|
|
|
1189
1189
|
}, G = (i) => {
|
|
1190
1190
|
if (i) {
|
|
1191
1191
|
console.log("选中", i);
|
|
1192
|
-
const u = s.getFeatures().find((C) => C.get("id") === i.id),
|
|
1193
|
-
u && (l = u),
|
|
1192
|
+
const u = s.getFeatures().find((C) => C.get("id") === i.id), v = o.getFeatures().find((C) => C.get("id") === i.id);
|
|
1193
|
+
u && (l = u), v && v.set("selected", !0), r = i, S();
|
|
1194
1194
|
} else
|
|
1195
|
-
console.log("取消选中"),
|
|
1196
|
-
}, W = qe((i, u,
|
|
1195
|
+
console.log("取消选中"), r = null, l = null, X();
|
|
1196
|
+
}, W = qe((i, u, v) => {
|
|
1197
1197
|
try {
|
|
1198
1198
|
if (i) {
|
|
1199
1199
|
const C = i.get("shipData"), k = i.get("id");
|
|
1200
|
-
if (e.getTargetElement().style.cursor = k ? "pointer" : "", u === "click" && (G(C),
|
|
1200
|
+
if (e.getTargetElement().style.cursor = k ? "pointer" : "", u === "click" && (G(C), v && v(k)), u === "hover") {
|
|
1201
1201
|
t && t !== k && B(), t = k;
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1202
|
+
const N = s.getFeatures().find((z) => z.get("id") === t);
|
|
1203
|
+
N == null || N.set("isHighlight", !0), N == null || N.setStyle(ye(e, N));
|
|
1204
1204
|
}
|
|
1205
1205
|
} else
|
|
1206
1206
|
e.getTargetElement().style.cursor = "", B();
|
|
@@ -1209,21 +1209,21 @@ const nt = (e, l) => {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
}, 10), B = () => {
|
|
1211
1211
|
const i = t ? s.getFeatures().find((u) => u.get("id") === t) : null;
|
|
1212
|
-
t = null, i == null || i.set("isHighlight", !1), i == null || i.setStyle(
|
|
1212
|
+
t = null, i == null || i.set("isHighlight", !1), i == null || i.setStyle(ye(e, i));
|
|
1213
1213
|
}, X = () => {
|
|
1214
1214
|
try {
|
|
1215
|
-
const u = e.getOverlays().getArray().find((
|
|
1215
|
+
const u = e.getOverlays().getArray().find((v) => v.get("class") == "ship-overlay-selected");
|
|
1216
1216
|
u && u.setPosition(void 0);
|
|
1217
1217
|
} catch (i) {
|
|
1218
1218
|
console.log(i);
|
|
1219
1219
|
}
|
|
1220
1220
|
}, O = (i, u) => {
|
|
1221
|
-
const
|
|
1222
|
-
geometry: new ne(
|
|
1221
|
+
const v = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), C = new se({
|
|
1222
|
+
geometry: new ne(v),
|
|
1223
1223
|
name: i.cnname || i.enname || i.name || i.id || "未命名船舶",
|
|
1224
1224
|
// 图标
|
|
1225
1225
|
rightIcons: rt(i),
|
|
1226
|
-
selected: (i == null ? void 0 : i.id) === (
|
|
1226
|
+
selected: (i == null ? void 0 : i.id) === (r == null ? void 0 : r.id),
|
|
1227
1227
|
shipData: i
|
|
1228
1228
|
});
|
|
1229
1229
|
C.set("id", i.id);
|
|
@@ -1231,39 +1231,39 @@ const nt = (e, l) => {
|
|
|
1231
1231
|
return C.setStyle(k), C;
|
|
1232
1232
|
}, D = (i) => {
|
|
1233
1233
|
const u = e.getView().getZoom();
|
|
1234
|
-
i.forEach((
|
|
1235
|
-
const C = P(
|
|
1236
|
-
if (C.setStyle(
|
|
1237
|
-
if (
|
|
1238
|
-
if (
|
|
1239
|
-
const k = m[
|
|
1240
|
-
...
|
|
1234
|
+
i.forEach((v) => {
|
|
1235
|
+
const C = P(v);
|
|
1236
|
+
if (C.setStyle(ye(e, C)), s.addFeature(C), (r == null ? void 0 : r.id) == v.id || u >= ee.shipModelMin)
|
|
1237
|
+
if (n[v.id]) {
|
|
1238
|
+
if (v.id && m[v == null ? void 0 : v.id]) {
|
|
1239
|
+
const k = m[v == null ? void 0 : v.id] || {}, N = (k == null ? void 0 : k.blinkColors) || [], z = (k == null ? void 0 : k.shipState) || "", Z = (v.cnname || v.enname || v.name || v.id || "未命名船舶") + "(" + z + ")", V = {
|
|
1240
|
+
...v,
|
|
1241
1241
|
name: Z,
|
|
1242
|
-
blinking:
|
|
1243
|
-
blinkingColors:
|
|
1242
|
+
blinking: n[v.id],
|
|
1243
|
+
blinkingColors: N || []
|
|
1244
1244
|
};
|
|
1245
1245
|
vo(e, V);
|
|
1246
1246
|
}
|
|
1247
1247
|
} else {
|
|
1248
|
-
const k = O(
|
|
1248
|
+
const k = O(v, i.length);
|
|
1249
1249
|
o.addFeature(k);
|
|
1250
1250
|
}
|
|
1251
1251
|
});
|
|
1252
1252
|
};
|
|
1253
1253
|
return {
|
|
1254
|
-
render:
|
|
1254
|
+
render: h,
|
|
1255
1255
|
selected: G,
|
|
1256
|
-
filter:
|
|
1256
|
+
filter: b,
|
|
1257
1257
|
blinking: p,
|
|
1258
1258
|
clear: w,
|
|
1259
1259
|
handleShipMapEvent: W,
|
|
1260
|
-
changeShipScale:
|
|
1260
|
+
changeShipScale: y
|
|
1261
1261
|
};
|
|
1262
1262
|
}, xo = (e) => {
|
|
1263
|
-
const l = () => e == null ? void 0 : e.getLayers(),
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1263
|
+
const l = () => e == null ? void 0 : e.getLayers(), r = U("vector"), s = () => r.value, a = (t) => {
|
|
1264
|
+
r.value = t;
|
|
1265
|
+
const n = l();
|
|
1266
|
+
n && (n == null || n.getArray().forEach((m) => {
|
|
1267
1267
|
(m.className_ === "vector" || m.className_ === "satellite") && m.setVisible(m.className_ === t);
|
|
1268
1268
|
}));
|
|
1269
1269
|
}, o = U(!1);
|
|
@@ -1273,19 +1273,19 @@ const nt = (e, l) => {
|
|
|
1273
1273
|
setGreenTileVisible: (t) => {
|
|
1274
1274
|
if (t !== o.value) {
|
|
1275
1275
|
if (t) {
|
|
1276
|
-
const
|
|
1277
|
-
if (!
|
|
1278
|
-
const
|
|
1276
|
+
const n = l();
|
|
1277
|
+
if (!n.getArray().find((h) => h.className_ === "greenTile")) {
|
|
1278
|
+
const h = new he({
|
|
1279
1279
|
source: new me({ url: de.greenTile }),
|
|
1280
1280
|
visible: t,
|
|
1281
1281
|
zIndex: 2,
|
|
1282
1282
|
className: "greenTile"
|
|
1283
1283
|
});
|
|
1284
|
-
|
|
1284
|
+
n.push(h);
|
|
1285
1285
|
}
|
|
1286
1286
|
} else {
|
|
1287
|
-
const
|
|
1288
|
-
m &&
|
|
1287
|
+
const n = l(), m = n.getArray().find((h) => h.className_ === "greenTile");
|
|
1288
|
+
m && n.remove(m);
|
|
1289
1289
|
}
|
|
1290
1290
|
o.value = t;
|
|
1291
1291
|
}
|
|
@@ -1303,35 +1303,35 @@ const nt = (e, l) => {
|
|
|
1303
1303
|
};
|
|
1304
1304
|
}, ko = (e) => {
|
|
1305
1305
|
const l = "zh-map-location-layer";
|
|
1306
|
-
let
|
|
1307
|
-
const f = (
|
|
1308
|
-
if (!(!
|
|
1306
|
+
let r, s, a = null, o = null;
|
|
1307
|
+
const f = (y) => {
|
|
1308
|
+
if (!(!y || y.length === 0)) {
|
|
1309
1309
|
if (s || (s = new ae()), s.clear(), o) {
|
|
1310
|
-
const w =
|
|
1311
|
-
w ? o = w :
|
|
1310
|
+
const w = y.find((L) => L.id === o.id);
|
|
1311
|
+
w ? o = w : y.push(o);
|
|
1312
1312
|
}
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
}),
|
|
1313
|
+
y.forEach((w) => {
|
|
1314
|
+
x(w);
|
|
1315
|
+
}), r || (r = new ve({
|
|
1316
1316
|
className: l,
|
|
1317
1317
|
source: s,
|
|
1318
1318
|
zIndex: 100
|
|
1319
|
-
}), e == null || e.addLayer(
|
|
1319
|
+
}), e == null || e.addLayer(r));
|
|
1320
1320
|
}
|
|
1321
|
-
},
|
|
1322
|
-
const w = e == null ? void 0 : e.getView().getZoom(), [
|
|
1323
|
-
geometry: new ne(I([Number(
|
|
1321
|
+
}, x = (y) => {
|
|
1322
|
+
const w = e == null ? void 0 : e.getView().getZoom(), [L, p] = y.latLon.split(","), b = new se({
|
|
1323
|
+
geometry: new ne(I([Number(L), Number(p)]))
|
|
1324
1324
|
});
|
|
1325
|
-
|
|
1326
|
-
}, t = (
|
|
1325
|
+
b.setStyle(t(y, w, y.id === (o == null ? void 0 : o.id))), b.set("loactionData", y), s.addFeature(b);
|
|
1326
|
+
}, t = (y, w, L) => {
|
|
1327
1327
|
const p = {
|
|
1328
1328
|
image: new be({
|
|
1329
|
-
src:
|
|
1329
|
+
src: L && y.selectedPath || y.defaultPath,
|
|
1330
1330
|
scale: 0.5 * w / 10
|
|
1331
1331
|
})
|
|
1332
1332
|
};
|
|
1333
|
-
return
|
|
1334
|
-
text:
|
|
1333
|
+
return y.name && (p.text = new ue({
|
|
1334
|
+
text: y.name,
|
|
1335
1335
|
font: "12px sans-serif",
|
|
1336
1336
|
fill: new Q({
|
|
1337
1337
|
color: "#000000"
|
|
@@ -1341,37 +1341,37 @@ const nt = (e, l) => {
|
|
|
1341
1341
|
}),
|
|
1342
1342
|
offsetY: 30
|
|
1343
1343
|
})), new H(p);
|
|
1344
|
-
},
|
|
1344
|
+
}, n = () => {
|
|
1345
1345
|
if (a) {
|
|
1346
|
-
const
|
|
1346
|
+
const y = a.get("loactionData").id;
|
|
1347
1347
|
s.getFeatures().forEach((w) => {
|
|
1348
|
-
w.get("loactionData").id !==
|
|
1348
|
+
w.get("loactionData").id !== y && s.removeFeature(w);
|
|
1349
1349
|
});
|
|
1350
1350
|
} else
|
|
1351
1351
|
s.clear();
|
|
1352
1352
|
}, m = () => {
|
|
1353
1353
|
var p;
|
|
1354
|
-
const
|
|
1355
|
-
s.getFeatures().forEach((
|
|
1356
|
-
|
|
1354
|
+
const y = a.get("loactionData"), w = (p = e == null ? void 0 : e.getView()) == null ? void 0 : p.getZoom();
|
|
1355
|
+
s.getFeatures().forEach((b) => {
|
|
1356
|
+
b.get("loactionData").id === y.id && (b == null || b.setStyle(t(y, w, !1)));
|
|
1357
1357
|
}), o = null, a = null;
|
|
1358
|
-
},
|
|
1359
|
-
|
|
1358
|
+
}, h = (y) => {
|
|
1359
|
+
y ? (P(), S(y)) : clearSelectedPort();
|
|
1360
1360
|
}, P = () => {
|
|
1361
|
-
var
|
|
1361
|
+
var y;
|
|
1362
1362
|
if (a) {
|
|
1363
|
-
const w = a.get("loactionData"),
|
|
1364
|
-
a.setStyle(t(w,
|
|
1363
|
+
const w = a.get("loactionData"), L = (y = e == null ? void 0 : e.getView()) == null ? void 0 : y.getZoom();
|
|
1364
|
+
a.setStyle(t(w, L, !1));
|
|
1365
1365
|
}
|
|
1366
|
-
},
|
|
1366
|
+
}, S = (y) => {
|
|
1367
1367
|
const w = s.getFeatures();
|
|
1368
|
-
o =
|
|
1368
|
+
o = y, a = w.find((L) => L.get("loactionData").id === y.id);
|
|
1369
1369
|
};
|
|
1370
1370
|
return {
|
|
1371
1371
|
render: f,
|
|
1372
|
-
selected:
|
|
1372
|
+
selected: h,
|
|
1373
1373
|
clearSelected: m,
|
|
1374
|
-
clear:
|
|
1374
|
+
clear: n
|
|
1375
1375
|
};
|
|
1376
1376
|
}, po = (e) => {
|
|
1377
1377
|
e.getInteractions().forEach((l) => {
|
|
@@ -1382,21 +1382,21 @@ const nt = (e, l) => {
|
|
|
1382
1382
|
l instanceof st && l.setActive(!0);
|
|
1383
1383
|
});
|
|
1384
1384
|
}, Ve = (e, l) => {
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1385
|
+
const r = e.getViewport();
|
|
1386
|
+
r && (r.style.cursor = l);
|
|
1387
1387
|
}, Co = (e, l) => {
|
|
1388
|
-
const
|
|
1388
|
+
const r = U([]), s = U("km"), a = (i) => {
|
|
1389
1389
|
s.value = i;
|
|
1390
1390
|
};
|
|
1391
1391
|
let o;
|
|
1392
|
-
const f = U(!1),
|
|
1393
|
-
Ve(e, "crosshair"), m(), po(e), e.on("pointermove",
|
|
1392
|
+
const f = U(!1), x = () => {
|
|
1393
|
+
Ve(e, "crosshair"), m(), po(e), e.on("pointermove", S), e.getViewport().addEventListener("mouseout", () => {
|
|
1394
1394
|
o && o.classList.add("hidden");
|
|
1395
1395
|
}), w(), f.value = !0;
|
|
1396
1396
|
};
|
|
1397
|
-
let t,
|
|
1397
|
+
let t, n;
|
|
1398
1398
|
const m = () => {
|
|
1399
|
-
t = new ae(),
|
|
1399
|
+
t = new ae(), n = new ve({
|
|
1400
1400
|
source: t,
|
|
1401
1401
|
zIndex: 1e3,
|
|
1402
1402
|
style: {
|
|
@@ -1406,18 +1406,18 @@ const nt = (e, l) => {
|
|
|
1406
1406
|
"circle-radius": 7,
|
|
1407
1407
|
"circle-fill-color": "#ffcc33"
|
|
1408
1408
|
}
|
|
1409
|
-
}), e == null || e.addLayer(
|
|
1409
|
+
}), e == null || e.addLayer(n);
|
|
1410
1410
|
};
|
|
1411
|
-
let
|
|
1412
|
-
const
|
|
1411
|
+
let h, P;
|
|
1412
|
+
const S = (i) => {
|
|
1413
1413
|
if (i.dragging)
|
|
1414
1414
|
return;
|
|
1415
1415
|
let u = "点击选择起点";
|
|
1416
|
-
|
|
1416
|
+
h && (u = "单击继续,双击结束"), o && (o.innerHTML = u, P.setPosition(i.coordinate), o.classList.remove("hidden"));
|
|
1417
1417
|
};
|
|
1418
|
-
let
|
|
1418
|
+
let y;
|
|
1419
1419
|
const w = () => {
|
|
1420
|
-
|
|
1420
|
+
y = new Ne({
|
|
1421
1421
|
source: t,
|
|
1422
1422
|
type: "LineString",
|
|
1423
1423
|
style: new H({
|
|
@@ -1429,7 +1429,7 @@ const nt = (e, l) => {
|
|
|
1429
1429
|
lineDash: [10, 10],
|
|
1430
1430
|
width: 2
|
|
1431
1431
|
}),
|
|
1432
|
-
image: new
|
|
1432
|
+
image: new Se({
|
|
1433
1433
|
radius: 5,
|
|
1434
1434
|
stroke: new fe({
|
|
1435
1435
|
color: "rgba(0, 0, 0, 0.7)"
|
|
@@ -1441,39 +1441,39 @@ const nt = (e, l) => {
|
|
|
1441
1441
|
}),
|
|
1442
1442
|
// 添加条件函数,判断是否应该出发点绘制
|
|
1443
1443
|
condition: (u) => u.originalEvent.target.tagName !== "DIV"
|
|
1444
|
-
}), e == null || e.addInteraction(
|
|
1444
|
+
}), e == null || e.addInteraction(y), G(), W();
|
|
1445
1445
|
let i;
|
|
1446
|
-
|
|
1446
|
+
y.on("drawstart", function(u) {
|
|
1447
1447
|
var C;
|
|
1448
|
-
|
|
1449
|
-
let
|
|
1450
|
-
i = (C =
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1448
|
+
h = u.feature, h.set("randomId", L());
|
|
1449
|
+
let v;
|
|
1450
|
+
i = (C = h.getGeometry()) == null ? void 0 : C.on("change", function(k) {
|
|
1451
|
+
const N = k.target, z = gt(N, s.value);
|
|
1452
|
+
v = N.getLastCoordinate(), p && z && (p.innerHTML = z), b.setPosition(v);
|
|
1453
1453
|
});
|
|
1454
|
-
}),
|
|
1455
|
-
var u,
|
|
1454
|
+
}), y.on("drawend", function() {
|
|
1455
|
+
var u, v, C;
|
|
1456
1456
|
if (p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML) {
|
|
1457
|
-
const k = (
|
|
1458
|
-
|
|
1457
|
+
const k = (h == null ? void 0 : h.get("randomId")) || L();
|
|
1458
|
+
r.value.push({ id: k, value: p == null ? void 0 : p.innerHTML }), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-id="${k}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
1459
1459
|
}
|
|
1460
1460
|
(u = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || u.addEventListener("click", (k) => {
|
|
1461
1461
|
var z;
|
|
1462
1462
|
k.preventDefault(), k.stopPropagation();
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
}),
|
|
1463
|
+
const N = (z = k.target) == null ? void 0 : z.getAttribute("data-id");
|
|
1464
|
+
N && X(N);
|
|
1465
|
+
}), b.setOffset([0, -7]), h = null, p = null, G(), i && Ge(i), (C = (v = l.getProps()) == null ? void 0 : v.lineDrawEnd) == null || C.call(v, r.value);
|
|
1466
1466
|
});
|
|
1467
|
-
},
|
|
1468
|
-
let p,
|
|
1467
|
+
}, L = () => Math.random().toString(36).substring(2, 9);
|
|
1468
|
+
let p, b;
|
|
1469
1469
|
const G = () => {
|
|
1470
|
-
p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure",
|
|
1470
|
+
p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure", b = new ie({
|
|
1471
1471
|
element: p,
|
|
1472
1472
|
offset: [0, -15],
|
|
1473
1473
|
positioning: "bottom-center",
|
|
1474
1474
|
stopEvent: !1,
|
|
1475
1475
|
insertFirst: !1
|
|
1476
|
-
}), e == null || e.addOverlay(
|
|
1476
|
+
}), e == null || e.addOverlay(b);
|
|
1477
1477
|
}, W = () => {
|
|
1478
1478
|
o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", P = new ie({
|
|
1479
1479
|
element: o,
|
|
@@ -1481,36 +1481,36 @@ const nt = (e, l) => {
|
|
|
1481
1481
|
positioning: "center-left"
|
|
1482
1482
|
}), e == null || e.addOverlay(P);
|
|
1483
1483
|
}, B = () => {
|
|
1484
|
-
|
|
1485
|
-
var k,
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1484
|
+
r.value.forEach((i, u) => {
|
|
1485
|
+
var k, N;
|
|
1486
|
+
const v = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1487
|
+
v[u] && ((N = (k = v[u]) == null ? void 0 : k.parentNode) == null || N.removeChild(v[u]));
|
|
1488
1488
|
const C = t.getFeatures();
|
|
1489
1489
|
C[u] && t.removeFeature(C[u]);
|
|
1490
1490
|
}), O(), Mo(e), f.value = !1, Ve(e, "pointer");
|
|
1491
1491
|
}, X = (i) => {
|
|
1492
|
-
var
|
|
1493
|
-
const u =
|
|
1492
|
+
var v, C, k, N;
|
|
1493
|
+
const u = r.value.findIndex((z) => z.id === i);
|
|
1494
1494
|
if (u !== -1) {
|
|
1495
|
-
|
|
1495
|
+
r.value.splice(u, 1);
|
|
1496
1496
|
const z = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1497
|
-
z[u] && ((C = (
|
|
1497
|
+
z[u] && ((C = (v = z[u]) == null ? void 0 : v.parentNode) == null || C.removeChild(z[u]));
|
|
1498
1498
|
const Z = t.getFeatures();
|
|
1499
1499
|
Z[u] && t.removeFeature(Z[u]);
|
|
1500
1500
|
}
|
|
1501
|
-
(
|
|
1501
|
+
(N = (k = l.getProps()) == null ? void 0 : k.lineDrawEnd) == null || N.call(k, r.value);
|
|
1502
1502
|
}, O = () => {
|
|
1503
|
-
if (
|
|
1503
|
+
if (r.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((i) => {
|
|
1504
1504
|
var u;
|
|
1505
1505
|
(u = i == null ? void 0 : i.parentNode) == null || u.removeChild(i);
|
|
1506
|
-
}), t.clear(),
|
|
1507
|
-
const i = e.getInteractions().getArray().find((u) => et(u) === et(
|
|
1506
|
+
}), t.clear(), y) {
|
|
1507
|
+
const i = e.getInteractions().getArray().find((u) => et(u) === et(y));
|
|
1508
1508
|
i && e.removeInteraction(i);
|
|
1509
1509
|
}
|
|
1510
|
-
e.removeLayer(
|
|
1510
|
+
e.removeLayer(n), o != null && o.parentNode && o.parentNode.removeChild(o), p != null && p.parentNode && p.parentNode.removeChild(p);
|
|
1511
1511
|
};
|
|
1512
1512
|
return {
|
|
1513
|
-
open:
|
|
1513
|
+
open: x,
|
|
1514
1514
|
close: B,
|
|
1515
1515
|
deleteLine: X,
|
|
1516
1516
|
setUnit: a,
|
|
@@ -1532,15 +1532,15 @@ const nt = (e, l) => {
|
|
|
1532
1532
|
}
|
|
1533
1533
|
return a;
|
|
1534
1534
|
}, Lo = (e, l) => {
|
|
1535
|
-
let
|
|
1535
|
+
let r, s;
|
|
1536
1536
|
const a = () => {
|
|
1537
1537
|
o(), Ve(e, "crosshair");
|
|
1538
1538
|
}, o = () => {
|
|
1539
|
-
t(), p(), W(),
|
|
1539
|
+
t(), p(), W(), S();
|
|
1540
1540
|
};
|
|
1541
|
-
let f = null,
|
|
1541
|
+
let f = null, x = null;
|
|
1542
1542
|
const t = () => {
|
|
1543
|
-
if (f &&
|
|
1543
|
+
if (f && x) return;
|
|
1544
1544
|
const O = new ae(), D = new ve({
|
|
1545
1545
|
source: O,
|
|
1546
1546
|
style: new H({
|
|
@@ -1550,45 +1550,45 @@ const nt = (e, l) => {
|
|
|
1550
1550
|
})
|
|
1551
1551
|
})
|
|
1552
1552
|
});
|
|
1553
|
-
f = D,
|
|
1554
|
-
|
|
1553
|
+
f = D, x = O, e.on("pointermove", m), e.addLayer(D), e.on(["dblclick"], function(i) {
|
|
1554
|
+
h && (i.stopPropagation(), i.preventDefault());
|
|
1555
1555
|
});
|
|
1556
1556
|
};
|
|
1557
|
-
let
|
|
1557
|
+
let n;
|
|
1558
1558
|
const m = (O) => {
|
|
1559
1559
|
if (O.dragging) return;
|
|
1560
|
-
const D =
|
|
1561
|
-
|
|
1560
|
+
const D = n ? "单击继续,双击结束" : "点击选择起点";
|
|
1561
|
+
b && (b.innerHTML = D, G.setPosition(O.coordinate));
|
|
1562
1562
|
};
|
|
1563
|
-
let
|
|
1564
|
-
const
|
|
1565
|
-
if (
|
|
1566
|
-
|
|
1567
|
-
const O =
|
|
1563
|
+
let h, P = !1;
|
|
1564
|
+
const S = () => {
|
|
1565
|
+
if (r) {
|
|
1566
|
+
b != null && b.parentNode && b.parentNode.removeChild(b);
|
|
1567
|
+
const O = r.getGeometry();
|
|
1568
1568
|
if (!O) return;
|
|
1569
|
-
const D =
|
|
1569
|
+
const D = y(O, "nm");
|
|
1570
1570
|
w && (w.innerHTML = `
|
|
1571
1571
|
<span class="text">面积:${D}${P ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1572
1572
|
`), w && (w.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
|
|
1573
1573
|
const i = O.getCoordinates(), u = i[0][i[0].length - 2];
|
|
1574
|
-
if (
|
|
1574
|
+
if (L.setPosition(u), f) {
|
|
1575
1575
|
const C = f.getSource();
|
|
1576
|
-
C &&
|
|
1576
|
+
C && r && (C.clear(), C.addFeature(r));
|
|
1577
1577
|
}
|
|
1578
1578
|
setTimeout(() => {
|
|
1579
1579
|
var C;
|
|
1580
1580
|
(C = document.querySelector(".delete-icon")) == null || C.addEventListener("click", () => {
|
|
1581
|
-
var k,
|
|
1582
|
-
console.log("delete"), B(), (
|
|
1581
|
+
var k, N;
|
|
1582
|
+
console.log("delete"), B(), (N = (k = l.getProps()) == null ? void 0 : k.areaDrawEnd) == null || N.call(k, []);
|
|
1583
1583
|
});
|
|
1584
1584
|
}, 0);
|
|
1585
|
-
const
|
|
1586
|
-
e == null || e.getView().setCenter(
|
|
1585
|
+
const v = Ht(r.getGeometry().getExtent());
|
|
1586
|
+
e == null || e.getView().setCenter(v);
|
|
1587
1587
|
return;
|
|
1588
1588
|
}
|
|
1589
|
-
|
|
1589
|
+
h = new Ne({
|
|
1590
1590
|
type: "Polygon",
|
|
1591
|
-
source:
|
|
1591
|
+
source: x,
|
|
1592
1592
|
trace: !0,
|
|
1593
1593
|
style: [new H({
|
|
1594
1594
|
stroke: new fe({
|
|
@@ -1600,7 +1600,7 @@ const nt = (e, l) => {
|
|
|
1600
1600
|
color: "rgba(255, 255, 255, 0.25)"
|
|
1601
1601
|
})
|
|
1602
1602
|
}), new H({
|
|
1603
|
-
image: new
|
|
1603
|
+
image: new Se({
|
|
1604
1604
|
radius: 5,
|
|
1605
1605
|
fill: new Q({
|
|
1606
1606
|
color: "rgb(51,112,255, 1)"
|
|
@@ -1611,20 +1611,20 @@ const nt = (e, l) => {
|
|
|
1611
1611
|
return new Xt(D);
|
|
1612
1612
|
}
|
|
1613
1613
|
})]
|
|
1614
|
-
}), e == null || e.addInteraction(
|
|
1614
|
+
}), e == null || e.addInteraction(h), h.on("drawstart", (O) => {
|
|
1615
1615
|
var D;
|
|
1616
|
-
|
|
1617
|
-
const u = i.target,
|
|
1618
|
-
if (P = Number(Be(
|
|
1616
|
+
n = O.feature, s = (D = n.getGeometry()) == null ? void 0 : D.on("change", (i) => {
|
|
1617
|
+
const u = i.target, v = y(u, "nm"), k = u.getCoordinates()[0], N = new Pe([k[k.length - 2], k[k.length - 1]]), z = gt(N, "nm");
|
|
1618
|
+
if (P = Number(Be(N) / 1e3) > 150, !v) return;
|
|
1619
1619
|
const Z = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1620
1620
|
w && (w.innerHTML = `
|
|
1621
1621
|
<div class="text">
|
|
1622
|
-
面积:${
|
|
1622
|
+
面积:${v}
|
|
1623
1623
|
${P ? Z : ""}
|
|
1624
1624
|
</div>
|
|
1625
|
-
`),
|
|
1625
|
+
`), b && (b.innerHTML = `
|
|
1626
1626
|
<div class="text">
|
|
1627
|
-
面积:${
|
|
1627
|
+
面积:${v}
|
|
1628
1628
|
</div>
|
|
1629
1629
|
<div class="text ${P ? "error" : ""}">
|
|
1630
1630
|
线段 ${k.length - 2}: ${z}
|
|
@@ -1636,23 +1636,23 @@ const nt = (e, l) => {
|
|
|
1636
1636
|
</div>
|
|
1637
1637
|
`);
|
|
1638
1638
|
});
|
|
1639
|
-
}),
|
|
1640
|
-
var
|
|
1639
|
+
}), h.on("drawend", (O) => {
|
|
1640
|
+
var v, C, k, N;
|
|
1641
1641
|
if (!O.feature.getGeometry()) return;
|
|
1642
|
-
|
|
1642
|
+
r = O.feature, w && (w.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), L.setOffset([10, 0]);
|
|
1643
1643
|
const i = O.feature.getGeometry().getCoordinates(), u = i[0][i[0].length - 2];
|
|
1644
|
-
if (
|
|
1644
|
+
if (L.setPosition(u), b != null && b.parentNode && b.parentNode.removeChild(b), (v = l.getProps()) != null && v.areaDrawEnd) {
|
|
1645
1645
|
const z = i[0].map((Z) => xe(Z, J.mercator, J.data));
|
|
1646
1646
|
(k = (C = l.getProps()) == null ? void 0 : C.areaDrawEnd) == null || k.call(C, z);
|
|
1647
1647
|
}
|
|
1648
|
-
|
|
1649
|
-
Z instanceof
|
|
1650
|
-
})), s && Ge(s), (
|
|
1648
|
+
h && (h.setActive(!1), e == null || e.removeInteraction(h), (e == null ? void 0 : e.getInteractions()).forEach((Z) => {
|
|
1649
|
+
Z instanceof Ne && (Z.setActive(!1), e == null || e.removeInteraction(Z));
|
|
1650
|
+
})), s && Ge(s), (N = document.querySelector(".delete-icon")) == null || N.addEventListener("click", () => {
|
|
1651
1651
|
var z, Z;
|
|
1652
1652
|
B(), (Z = (z = l.getProps()) == null ? void 0 : z.areaDrawEnd) == null || Z.call(z, []);
|
|
1653
1653
|
});
|
|
1654
1654
|
});
|
|
1655
|
-
},
|
|
1655
|
+
}, y = (O, D) => {
|
|
1656
1656
|
const i = qt(O);
|
|
1657
1657
|
switch (D) {
|
|
1658
1658
|
case "km":
|
|
@@ -1661,62 +1661,63 @@ const nt = (e, l) => {
|
|
|
1661
1661
|
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>";
|
|
1662
1662
|
}
|
|
1663
1663
|
};
|
|
1664
|
-
let w,
|
|
1664
|
+
let w, L;
|
|
1665
1665
|
const p = () => {
|
|
1666
|
-
w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.style.display = "flex", w.className = "ol-tooltip ol-tooltip-draw-polygon",
|
|
1666
|
+
w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.style.display = "flex", w.className = "ol-tooltip ol-tooltip-draw-polygon", L = new ie({
|
|
1667
1667
|
element: w,
|
|
1668
1668
|
offset: [0, -15],
|
|
1669
1669
|
positioning: "bottom-center",
|
|
1670
1670
|
stopEvent: !1,
|
|
1671
1671
|
insertFirst: !1
|
|
1672
|
-
}), e == null || e.addOverlay(
|
|
1672
|
+
}), e == null || e.addOverlay(L);
|
|
1673
1673
|
};
|
|
1674
|
-
let
|
|
1674
|
+
let b, G;
|
|
1675
1675
|
const W = () => {
|
|
1676
|
-
|
|
1677
|
-
element:
|
|
1676
|
+
b != null && b.parentNode && b.parentNode.removeChild(b), b = document.createElement("div"), b.className = "ol-tooltip ol-help-tooltip", G = new ie({
|
|
1677
|
+
element: b,
|
|
1678
1678
|
offset: [15, 0],
|
|
1679
1679
|
positioning: "center-left"
|
|
1680
1680
|
}), e == null || e.addOverlay(G);
|
|
1681
1681
|
}, B = () => {
|
|
1682
|
-
|
|
1682
|
+
x == null || x.clear(), r = null, p(), W(), S();
|
|
1683
1683
|
};
|
|
1684
1684
|
return {
|
|
1685
1685
|
open: a,
|
|
1686
1686
|
close: () => {
|
|
1687
|
-
|
|
1688
|
-
D instanceof
|
|
1689
|
-
}),
|
|
1687
|
+
x == null || x.clear(), x = null, f && (e.removeLayer(f), f = null), n = null, h && (h.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((D) => {
|
|
1688
|
+
D instanceof Ne && (D.setActive(!1), e == null || e.removeInteraction(D));
|
|
1689
|
+
}), h = null), s && Ge(s), b != null && b.parentElement && b.parentElement.removeChild(b), w != null && w.parentElement && w.parentElement.removeChild(w), G && e.removeOverlay(G), L && e.removeOverlay(L), Ve(e, "pointer");
|
|
1690
1690
|
},
|
|
1691
1691
|
reset: B
|
|
1692
1692
|
};
|
|
1693
1693
|
}, Eo = "zh-map-port-layer", To = (e) => {
|
|
1694
|
-
const l = e.getInstall()
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1694
|
+
const l = e.getInstall(), r = new ae(), s = new ve({
|
|
1695
|
+
className: Eo,
|
|
1696
|
+
source: r,
|
|
1697
|
+
zIndex: 100
|
|
1698
|
+
});
|
|
1699
|
+
l == null || l.addLayer(s);
|
|
1700
|
+
let a = null, o = null;
|
|
1701
|
+
const f = (y, w = !0) => {
|
|
1702
|
+
if (!(!y || y.length === 0)) {
|
|
1703
|
+
if (r.clear(), o) {
|
|
1704
|
+
const L = y.find((p) => p.id === o.id);
|
|
1705
|
+
L ? o = L : y.push(o);
|
|
1701
1706
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
})
|
|
1705
|
-
className: Eo,
|
|
1706
|
-
source: s,
|
|
1707
|
-
zIndex: 100
|
|
1708
|
-
}), l.addLayer(n));
|
|
1707
|
+
y.forEach((L) => {
|
|
1708
|
+
x(L, w);
|
|
1709
|
+
});
|
|
1709
1710
|
}
|
|
1710
|
-
},
|
|
1711
|
-
const
|
|
1712
|
-
geometry: new ne(I([Number(p), Number(
|
|
1713
|
-
portData:
|
|
1714
|
-
select:
|
|
1715
|
-
showTitle:
|
|
1716
|
-
});
|
|
1717
|
-
|
|
1718
|
-
}, t = (
|
|
1719
|
-
const
|
|
1711
|
+
}, x = (y, w = !0) => {
|
|
1712
|
+
const L = e.getZoom(), [p, b] = y.latLon.split(","), G = new se({
|
|
1713
|
+
geometry: new ne(I([Number(p), Number(b)])),
|
|
1714
|
+
portData: y,
|
|
1715
|
+
select: y.id === (o == null ? void 0 : o.id),
|
|
1716
|
+
showTitle: y.id === (o == null ? void 0 : o.id) || w
|
|
1717
|
+
}), W = t(G, L);
|
|
1718
|
+
console.log("point-styles--------", W), G.setStyle(W), r.addFeature(G);
|
|
1719
|
+
}, t = (y, w) => {
|
|
1720
|
+
const { select: L, showTitle: p } = y.getProperties(), b = (B) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1720
1721
|
<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="${B}"/>
|
|
1721
1722
|
<g clip-path="url(#clip0_10059_122082)">
|
|
1722
1723
|
<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"/>
|
|
@@ -1727,131 +1728,130 @@ const nt = (e, l) => {
|
|
|
1727
1728
|
</clipPath>
|
|
1728
1729
|
</defs>
|
|
1729
1730
|
</svg>
|
|
1730
|
-
`,
|
|
1731
|
-
return !
|
|
1731
|
+
`, G = () => `data:image/svg+xml;utf8,${encodeURIComponent(b(L ? "#FF5733" : "#3370FF"))}`, W = y.get("portData");
|
|
1732
|
+
return !p && !L ? new H({
|
|
1732
1733
|
image: new be({
|
|
1733
|
-
src:
|
|
1734
|
+
src: G(),
|
|
1734
1735
|
scale: 0.5 * w / 10
|
|
1735
1736
|
}),
|
|
1736
|
-
zIndex:
|
|
1737
|
-
}) : (console.log("showTitle", W.shortName,
|
|
1737
|
+
zIndex: L ? 110 : 100
|
|
1738
|
+
}) : (console.log("showTitle", p, W.shortName, "选中", L), new H({
|
|
1738
1739
|
text: new ue({
|
|
1739
1740
|
text: W.shortName,
|
|
1740
1741
|
font: "12px sans-serif",
|
|
1741
1742
|
fill: new Q({
|
|
1742
|
-
color:
|
|
1743
|
+
color: L ? "#ffffff" : "#000000"
|
|
1743
1744
|
}),
|
|
1744
1745
|
backgroundFill: new Q({
|
|
1745
|
-
color:
|
|
1746
|
+
color: L ? "#FF5733" : "#FFFFFF"
|
|
1746
1747
|
}),
|
|
1747
1748
|
offsetY: 30
|
|
1748
1749
|
}),
|
|
1749
1750
|
image: new be({
|
|
1750
|
-
src:
|
|
1751
|
+
src: G(),
|
|
1751
1752
|
scale: 0.5 * w / 10
|
|
1752
1753
|
}),
|
|
1753
|
-
zIndex:
|
|
1754
|
+
zIndex: L ? 110 : 100
|
|
1754
1755
|
}));
|
|
1755
|
-
},
|
|
1756
|
-
if (
|
|
1756
|
+
}, n = () => {
|
|
1757
|
+
if (r)
|
|
1757
1758
|
if (a) {
|
|
1758
1759
|
console.log("清除非选中的港口");
|
|
1759
|
-
const
|
|
1760
|
-
|
|
1761
|
-
w.get("portData").id !==
|
|
1760
|
+
const y = a.get("portData").id;
|
|
1761
|
+
r.getFeatures().forEach((w) => {
|
|
1762
|
+
w.get("portData").id !== y && r.removeFeature(w);
|
|
1762
1763
|
});
|
|
1763
1764
|
} else
|
|
1764
|
-
console.log("清除所有港口",
|
|
1765
|
-
}, m = (
|
|
1766
|
-
if (
|
|
1767
|
-
if (!
|
|
1768
|
-
return
|
|
1769
|
-
(a == null ? void 0 : a.get("portData").id) !==
|
|
1765
|
+
console.log("清除所有港口", r), r == null || r.clear();
|
|
1766
|
+
}, m = (y) => {
|
|
1767
|
+
if (r) {
|
|
1768
|
+
if (!y)
|
|
1769
|
+
return h();
|
|
1770
|
+
(a == null ? void 0 : a.get("portData").id) !== y.id && (h(), P(y));
|
|
1770
1771
|
}
|
|
1771
|
-
},
|
|
1772
|
+
}, h = () => {
|
|
1772
1773
|
if (a) {
|
|
1773
|
-
const
|
|
1774
|
-
|
|
1775
|
-
p.get("portData").id ===
|
|
1774
|
+
const y = a == null ? void 0 : a.get("portData"), w = e.getZoom();
|
|
1775
|
+
r.getFeatures().forEach((p) => {
|
|
1776
|
+
p.get("portData").id === y.id && (p.setStyle(t(p, w)), p.set("select", !1), a = null);
|
|
1776
1777
|
});
|
|
1777
1778
|
}
|
|
1778
|
-
}, P = (
|
|
1779
|
-
if (!
|
|
1780
|
-
const w =
|
|
1781
|
-
o =
|
|
1779
|
+
}, P = (y) => {
|
|
1780
|
+
if (!r) return;
|
|
1781
|
+
const w = r.getFeatures();
|
|
1782
|
+
o = y, a = w.find((L) => L.get("portData").id === y.id), a && (a.set("select", !0), a.setStyle(t(a, e.getZoom())));
|
|
1782
1783
|
};
|
|
1783
1784
|
return {
|
|
1784
1785
|
render: f,
|
|
1785
|
-
clear:
|
|
1786
|
+
clear: n,
|
|
1786
1787
|
selected: m,
|
|
1787
|
-
handlePortHover: (
|
|
1788
|
+
handlePortHover: (y) => {
|
|
1788
1789
|
const w = l == null ? void 0 : l.getTargetElement();
|
|
1789
|
-
|
|
1790
|
+
y && y.get("portData") && w && (w.style.cursor = "pointer");
|
|
1790
1791
|
}
|
|
1791
1792
|
};
|
|
1792
|
-
}, Fo = (e, l,
|
|
1793
|
+
}, Fo = (e, l, r, s, a, o) => {
|
|
1793
1794
|
const f = e.getInstall();
|
|
1794
1795
|
f.on("moveend", () => {
|
|
1795
|
-
var
|
|
1796
|
+
var x, t;
|
|
1796
1797
|
try {
|
|
1797
|
-
const
|
|
1798
|
-
(t = (
|
|
1799
|
-
} catch (
|
|
1800
|
-
console.log("moveend---catch",
|
|
1798
|
+
const n = e.getZoom();
|
|
1799
|
+
(t = (x = l.getProps()).mapMoveEnd) == null || t.call(x, n), r.reRenderTrackLine(), n <= ee.shipModelMax && n >= ee.shipTriggleMin && s.changeShipScale("end");
|
|
1800
|
+
} catch (n) {
|
|
1801
|
+
console.log("moveend---catch", n);
|
|
1801
1802
|
}
|
|
1802
|
-
}), f.on("pointermove", (
|
|
1803
|
+
}), f.on("pointermove", (x) => {
|
|
1803
1804
|
try {
|
|
1804
|
-
const t = f == null ? void 0 : f.getEventPixel(
|
|
1805
|
+
const t = f == null ? void 0 : f.getEventPixel(x.originalEvent);
|
|
1805
1806
|
if (!t || !f) return;
|
|
1806
|
-
const
|
|
1807
|
+
const n = f == null ? void 0 : f.forEachFeatureAtPixel(t, (m) => m, {
|
|
1807
1808
|
layerFilter: (m) => m.getVisible()
|
|
1808
1809
|
});
|
|
1809
|
-
s == null || s.handleShipMapEvent(
|
|
1810
|
+
s == null || s.handleShipMapEvent(n, "hover"), r == null || r.handleTrackMapEvent(n, "hover", x), n && (a == null || a.handlePortHover(n));
|
|
1810
1811
|
} catch (t) {
|
|
1811
1812
|
console.log("pointermove---catch", t);
|
|
1812
1813
|
}
|
|
1813
1814
|
}), f.on("movestart", () => {
|
|
1814
1815
|
try {
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
} catch (
|
|
1818
|
-
console.log("movestart---catch",
|
|
1816
|
+
const x = f == null ? void 0 : f.getView().getZoom();
|
|
1817
|
+
x && x <= ee.shipModelMax && x >= ee.shipTriggleMin && s.changeShipScale("start");
|
|
1818
|
+
} catch (x) {
|
|
1819
|
+
console.log("movestart---catch", x);
|
|
1819
1820
|
}
|
|
1820
|
-
}), f.on("click", qe((
|
|
1821
|
-
var t,
|
|
1821
|
+
}), f.on("click", qe((x) => {
|
|
1822
|
+
var t, n, m;
|
|
1822
1823
|
try {
|
|
1823
1824
|
if (console.log("1", o.getState()), o.getState()) return;
|
|
1824
|
-
const
|
|
1825
|
-
|
|
1826
|
-
(
|
|
1827
|
-
if (
|
|
1828
|
-
return
|
|
1825
|
+
const h = f.getEventPixel(x.originalEvent), P = f.forEachFeatureAtPixel(
|
|
1826
|
+
h,
|
|
1827
|
+
(S) => {
|
|
1828
|
+
if (S != null && S.get("shipData") || S != null && S.get("portData"))
|
|
1829
|
+
return S;
|
|
1829
1830
|
}
|
|
1830
1831
|
);
|
|
1831
1832
|
if (console.log("2", P), !P) return;
|
|
1832
1833
|
if (P.get("shipData"))
|
|
1833
1834
|
s.handleShipMapEvent(P, "click", (t = l.getProps()) == null ? void 0 : t.selectShip);
|
|
1834
1835
|
else if (P.get("portData")) {
|
|
1835
|
-
const
|
|
1836
|
-
a.selected(
|
|
1836
|
+
const S = P.get("portData");
|
|
1837
|
+
a.selected(S), (m = (n = l.getProps()) == null ? void 0 : n.selectPort) == null || m.call(n, S);
|
|
1837
1838
|
}
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
console.log("click---catch", y);
|
|
1839
|
+
} catch (h) {
|
|
1840
|
+
console.log("click---catch", h);
|
|
1841
1841
|
}
|
|
1842
1842
|
}, 150));
|
|
1843
1843
|
}, Po = () => {
|
|
1844
|
-
const e =
|
|
1844
|
+
const e = St([]);
|
|
1845
1845
|
return {
|
|
1846
1846
|
createInstance: (s, a) => {
|
|
1847
1847
|
const o = to();
|
|
1848
1848
|
o.initMap(s, a);
|
|
1849
|
-
const f = o.getInstall(),
|
|
1850
|
-
t.setProps(a),
|
|
1851
|
-
const
|
|
1852
|
-
Fo(o, t,
|
|
1853
|
-
const
|
|
1854
|
-
const
|
|
1849
|
+
const f = o.getInstall(), x = xo(f), t = bo();
|
|
1850
|
+
t.setProps(a), x.setShowLayerType(a.layerType), x.setGreenTileVisible(a.showGreenLayer);
|
|
1851
|
+
const n = io(f), m = so(f, n), h = wo(f), P = ko(f), S = Co(f, t), y = Lo(f, t), w = To(o);
|
|
1852
|
+
Fo(o, t, n, h, w, S);
|
|
1853
|
+
const L = () => {
|
|
1854
|
+
const b = f.getView().calculateExtent(o.getSize()), G = xe([b[0], b[1]], J.mercator, J.data), W = xe([b[2], b[3]], J.mercator, J.data);
|
|
1855
1855
|
return [G[0], G[1], W[0], W[1]];
|
|
1856
1856
|
}, p = {
|
|
1857
1857
|
id: Symbol("map-instance"),
|
|
@@ -1862,9 +1862,9 @@ const nt = (e, l) => {
|
|
|
1862
1862
|
},
|
|
1863
1863
|
methods: {
|
|
1864
1864
|
...o,
|
|
1865
|
-
layer:
|
|
1866
|
-
ship:
|
|
1867
|
-
track:
|
|
1865
|
+
layer: x,
|
|
1866
|
+
ship: h,
|
|
1867
|
+
track: n,
|
|
1868
1868
|
carTrack: m,
|
|
1869
1869
|
port: {
|
|
1870
1870
|
render: w.render,
|
|
@@ -1872,11 +1872,11 @@ const nt = (e, l) => {
|
|
|
1872
1872
|
selected: w.selected
|
|
1873
1873
|
},
|
|
1874
1874
|
position: P,
|
|
1875
|
-
drawLine:
|
|
1876
|
-
drawPolygon:
|
|
1875
|
+
drawLine: S,
|
|
1876
|
+
drawPolygon: y,
|
|
1877
1877
|
// 子模块
|
|
1878
1878
|
utils: {
|
|
1879
|
-
getCalculateExtent:
|
|
1879
|
+
getCalculateExtent: L,
|
|
1880
1880
|
convertSixHundredThousandToLatLng: Xe,
|
|
1881
1881
|
calculateCirclePoints: oo
|
|
1882
1882
|
}
|
|
@@ -1893,7 +1893,7 @@ const nt = (e, l) => {
|
|
|
1893
1893
|
},
|
|
1894
1894
|
getAllInstances: () => [...e]
|
|
1895
1895
|
};
|
|
1896
|
-
},
|
|
1896
|
+
}, No = { class: "zh-map-box" }, So = /* @__PURE__ */ Ae({
|
|
1897
1897
|
__name: "Map",
|
|
1898
1898
|
props: {
|
|
1899
1899
|
zoom: { default: ee.default },
|
|
@@ -1913,24 +1913,24 @@ const nt = (e, l) => {
|
|
|
1913
1913
|
} }
|
|
1914
1914
|
},
|
|
1915
1915
|
setup(e, { expose: l }) {
|
|
1916
|
-
const
|
|
1916
|
+
const r = U(), s = U(), a = Po(), o = U(), f = e, x = U({
|
|
1917
1917
|
getInstall() {
|
|
1918
1918
|
}
|
|
1919
1919
|
});
|
|
1920
1920
|
return $t(() => {
|
|
1921
1921
|
var t;
|
|
1922
|
-
o.value = a.createInstance(
|
|
1922
|
+
o.value = a.createInstance(r.value, f), x.value = o.value.methods, (t = s.value) == null || t.setScaleLine(o.value.map, f.scaleLineUnit);
|
|
1923
1923
|
}), Vt(() => {
|
|
1924
|
-
var t,
|
|
1925
|
-
a.destroyInstance((t = o == null ? void 0 : o.value) == null ? void 0 : t.id), (
|
|
1924
|
+
var t, n;
|
|
1925
|
+
a.destroyInstance((t = o == null ? void 0 : o.value) == null ? void 0 : t.id), (n = o.value) == null || n.destroy();
|
|
1926
1926
|
}), l({
|
|
1927
1927
|
getZoom: () => {
|
|
1928
1928
|
var t;
|
|
1929
1929
|
return (t = o.value) == null ? void 0 : t.methods.getZoom();
|
|
1930
1930
|
},
|
|
1931
1931
|
setZoom: (t) => {
|
|
1932
|
-
var
|
|
1933
|
-
return (
|
|
1932
|
+
var n;
|
|
1933
|
+
return (n = o.value) == null ? void 0 : n.methods.setZoom(t);
|
|
1934
1934
|
},
|
|
1935
1935
|
getInstall: () => {
|
|
1936
1936
|
var t;
|
|
@@ -1940,22 +1940,22 @@ const nt = (e, l) => {
|
|
|
1940
1940
|
var t;
|
|
1941
1941
|
return (t = o.value) == null ? void 0 : t.methods.getView();
|
|
1942
1942
|
},
|
|
1943
|
-
setCenter: (t,
|
|
1943
|
+
setCenter: (t, n) => {
|
|
1944
1944
|
var m;
|
|
1945
|
-
return (m = o.value) == null ? void 0 : m.methods.setCenter(t,
|
|
1945
|
+
return (m = o.value) == null ? void 0 : m.methods.setCenter(t, n);
|
|
1946
1946
|
},
|
|
1947
1947
|
getSize: () => {
|
|
1948
1948
|
var t;
|
|
1949
1949
|
return (t = o.value) == null ? void 0 : t.methods.getSize();
|
|
1950
1950
|
},
|
|
1951
|
-
getCenter: (t,
|
|
1951
|
+
getCenter: (t, n) => {
|
|
1952
1952
|
var m;
|
|
1953
1953
|
return (m = o.value) == null ? void 0 : m.methods.getCenter();
|
|
1954
1954
|
},
|
|
1955
1955
|
layer: {
|
|
1956
1956
|
setGreenTileVisible: (t) => {
|
|
1957
|
-
var
|
|
1958
|
-
return (
|
|
1957
|
+
var n;
|
|
1958
|
+
return (n = o.value) == null ? void 0 : n.methods.layer.setGreenTileVisible(t);
|
|
1959
1959
|
},
|
|
1960
1960
|
getGreenTileVisible: () => {
|
|
1961
1961
|
var t;
|
|
@@ -1966,26 +1966,26 @@ const nt = (e, l) => {
|
|
|
1966
1966
|
return (t = o.value) == null ? void 0 : t.methods.layer.getShowLayerType();
|
|
1967
1967
|
},
|
|
1968
1968
|
setShowLayerType: (t) => {
|
|
1969
|
-
var
|
|
1970
|
-
return (
|
|
1969
|
+
var n;
|
|
1970
|
+
return (n = o.value) == null ? void 0 : n.methods.layer.setShowLayerType(t);
|
|
1971
1971
|
}
|
|
1972
1972
|
},
|
|
1973
1973
|
ship: {
|
|
1974
1974
|
render: (...t) => {
|
|
1975
|
-
var
|
|
1976
|
-
return (
|
|
1975
|
+
var n;
|
|
1976
|
+
return (n = o.value) == null ? void 0 : n.methods.ship.render(...t);
|
|
1977
1977
|
},
|
|
1978
1978
|
selected: (...t) => {
|
|
1979
|
-
var
|
|
1980
|
-
return (
|
|
1979
|
+
var n;
|
|
1980
|
+
return (n = o.value) == null ? void 0 : n.methods.ship.selected(...t);
|
|
1981
1981
|
},
|
|
1982
1982
|
filter: (...t) => {
|
|
1983
|
-
var
|
|
1984
|
-
return (
|
|
1983
|
+
var n;
|
|
1984
|
+
return (n = o.value) == null ? void 0 : n.methods.ship.filter(...t);
|
|
1985
1985
|
},
|
|
1986
1986
|
blinking: (...t) => {
|
|
1987
|
-
var
|
|
1988
|
-
return (
|
|
1987
|
+
var n;
|
|
1988
|
+
return (n = o.value) == null ? void 0 : n.methods.ship.blinking(...t);
|
|
1989
1989
|
},
|
|
1990
1990
|
clear: () => {
|
|
1991
1991
|
var t;
|
|
@@ -1994,82 +1994,82 @@ const nt = (e, l) => {
|
|
|
1994
1994
|
},
|
|
1995
1995
|
track: {
|
|
1996
1996
|
render: (...t) => {
|
|
1997
|
-
var
|
|
1998
|
-
return (
|
|
1997
|
+
var n;
|
|
1998
|
+
return (n = o.value) == null ? void 0 : n.methods.track.render(...t);
|
|
1999
1999
|
},
|
|
2000
2000
|
remove: (...t) => {
|
|
2001
|
-
var
|
|
2002
|
-
return (
|
|
2001
|
+
var n;
|
|
2002
|
+
return (n = o.value) == null ? void 0 : n.methods.track.remove(...t);
|
|
2003
2003
|
},
|
|
2004
2004
|
play: (...t) => {
|
|
2005
|
-
var
|
|
2006
|
-
return (
|
|
2005
|
+
var n;
|
|
2006
|
+
return (n = o.value) == null ? void 0 : n.methods.track.play(...t);
|
|
2007
2007
|
},
|
|
2008
2008
|
setCenter: (...t) => {
|
|
2009
|
-
var
|
|
2010
|
-
return (
|
|
2009
|
+
var n;
|
|
2010
|
+
return (n = o.value) == null ? void 0 : n.methods.track.setCenter(...t);
|
|
2011
2011
|
},
|
|
2012
2012
|
close: (...t) => {
|
|
2013
|
-
var
|
|
2014
|
-
return (
|
|
2013
|
+
var n;
|
|
2014
|
+
return (n = o.value) == null ? void 0 : n.methods.track.close(...t);
|
|
2015
2015
|
},
|
|
2016
2016
|
getLength: (...t) => {
|
|
2017
|
-
var
|
|
2018
|
-
return (
|
|
2017
|
+
var n;
|
|
2018
|
+
return (n = o.value) == null ? void 0 : n.methods.track.getLength(...t);
|
|
2019
2019
|
}
|
|
2020
2020
|
},
|
|
2021
2021
|
carTrack: {
|
|
2022
2022
|
location: (...t) => {
|
|
2023
|
-
var
|
|
2024
|
-
return (
|
|
2023
|
+
var n;
|
|
2024
|
+
return (n = o.value) == null ? void 0 : n.methods.carTrack.location(...t);
|
|
2025
2025
|
},
|
|
2026
2026
|
remove: (...t) => {
|
|
2027
|
-
var
|
|
2028
|
-
return (
|
|
2027
|
+
var n;
|
|
2028
|
+
return (n = o.value) == null ? void 0 : n.methods.carTrack.remove(...t);
|
|
2029
2029
|
},
|
|
2030
2030
|
renderTrack: (...t) => {
|
|
2031
|
-
var
|
|
2032
|
-
return (
|
|
2031
|
+
var n;
|
|
2032
|
+
return (n = o.value) == null ? void 0 : n.methods.carTrack.renderTrack(...t);
|
|
2033
2033
|
},
|
|
2034
2034
|
setCenter: (...t) => {
|
|
2035
|
-
var
|
|
2036
|
-
return (
|
|
2035
|
+
var n;
|
|
2036
|
+
return (n = o.value) == null ? void 0 : n.methods.carTrack.setCenter(...t);
|
|
2037
2037
|
},
|
|
2038
2038
|
closeTrack: () => {
|
|
2039
2039
|
var t;
|
|
2040
2040
|
return (t = o.value) == null ? void 0 : t.methods.carTrack.closeTrack();
|
|
2041
2041
|
},
|
|
2042
2042
|
playTrack: (...t) => {
|
|
2043
|
-
var
|
|
2044
|
-
return (
|
|
2043
|
+
var n;
|
|
2044
|
+
return (n = o.value) == null ? void 0 : n.methods.carTrack.playTrack(...t);
|
|
2045
2045
|
}
|
|
2046
2046
|
},
|
|
2047
2047
|
port: {
|
|
2048
|
-
render: (t,
|
|
2048
|
+
render: (t, n) => {
|
|
2049
2049
|
var m;
|
|
2050
|
-
return (m = o.value) == null ? void 0 : m.methods.port.render(t,
|
|
2050
|
+
return (m = o.value) == null ? void 0 : m.methods.port.render(t, n);
|
|
2051
2051
|
},
|
|
2052
2052
|
clear: () => {
|
|
2053
2053
|
var t;
|
|
2054
2054
|
return (t = o.value) == null ? void 0 : t.methods.port.clear();
|
|
2055
2055
|
},
|
|
2056
2056
|
selected: (t) => {
|
|
2057
|
-
var
|
|
2058
|
-
return (
|
|
2057
|
+
var n;
|
|
2058
|
+
return (n = o.value) == null ? void 0 : n.methods.port.selected(t);
|
|
2059
2059
|
}
|
|
2060
2060
|
},
|
|
2061
2061
|
position: {
|
|
2062
2062
|
render: (...t) => {
|
|
2063
|
-
var
|
|
2064
|
-
return (
|
|
2063
|
+
var n;
|
|
2064
|
+
return (n = o.value) == null ? void 0 : n.methods.position.render(...t);
|
|
2065
2065
|
},
|
|
2066
2066
|
selected: (...t) => {
|
|
2067
|
-
var
|
|
2068
|
-
return (
|
|
2067
|
+
var n;
|
|
2068
|
+
return (n = o.value) == null ? void 0 : n.methods.position.selected(...t);
|
|
2069
2069
|
},
|
|
2070
2070
|
clearSelected: (...t) => {
|
|
2071
|
-
var
|
|
2072
|
-
return (
|
|
2071
|
+
var n;
|
|
2072
|
+
return (n = o.value) == null ? void 0 : n.methods.position.clearSelected(...t);
|
|
2073
2073
|
},
|
|
2074
2074
|
clear: () => {
|
|
2075
2075
|
var t;
|
|
@@ -2086,12 +2086,12 @@ const nt = (e, l) => {
|
|
|
2086
2086
|
return (t = o.value) == null ? void 0 : t.methods.drawLine.close();
|
|
2087
2087
|
},
|
|
2088
2088
|
deleteLine: (t) => {
|
|
2089
|
-
var
|
|
2090
|
-
return (
|
|
2089
|
+
var n;
|
|
2090
|
+
return (n = o.value) == null ? void 0 : n.methods.drawLine.deleteLine(t);
|
|
2091
2091
|
},
|
|
2092
2092
|
setUnit: (t) => {
|
|
2093
|
-
var
|
|
2094
|
-
return (
|
|
2093
|
+
var n;
|
|
2094
|
+
return (n = o.value) == null ? void 0 : n.methods.drawLine.setUnit(t);
|
|
2095
2095
|
},
|
|
2096
2096
|
getState: () => {
|
|
2097
2097
|
var t;
|
|
@@ -2115,23 +2115,23 @@ const nt = (e, l) => {
|
|
|
2115
2115
|
// 子模块
|
|
2116
2116
|
utils: {
|
|
2117
2117
|
getCalculateExtent: (...t) => {
|
|
2118
|
-
var
|
|
2119
|
-
return (
|
|
2118
|
+
var n;
|
|
2119
|
+
return (n = o.value) == null ? void 0 : n.methods.utils.getCalculateExtent(...t);
|
|
2120
2120
|
},
|
|
2121
2121
|
convertSixHundredThousandToLatLng: (...t) => {
|
|
2122
|
-
var
|
|
2123
|
-
return (
|
|
2122
|
+
var n;
|
|
2123
|
+
return (n = o.value) == null ? void 0 : n.methods.utils.convertSixHundredThousandToLatLng(...t);
|
|
2124
2124
|
},
|
|
2125
|
-
calculateCirclePoints: (t,
|
|
2125
|
+
calculateCirclePoints: (t, n) => {
|
|
2126
2126
|
var m;
|
|
2127
|
-
return (m = o.value) == null ? void 0 : m.methods.utils.calculateCirclePoints(t,
|
|
2127
|
+
return (m = o.value) == null ? void 0 : m.methods.utils.calculateCirclePoints(t, n);
|
|
2128
2128
|
}
|
|
2129
2129
|
}
|
|
2130
|
-
}), (t,
|
|
2130
|
+
}), (t, n) => (We(), Ye("div", No, [
|
|
2131
2131
|
Ze("div", {
|
|
2132
2132
|
id: "map",
|
|
2133
2133
|
ref_key: "zhMapRef",
|
|
2134
|
-
ref:
|
|
2134
|
+
ref: r,
|
|
2135
2135
|
class: "zh-map"
|
|
2136
2136
|
}, null, 512),
|
|
2137
2137
|
De(Kt, {
|
|
@@ -2144,7 +2144,7 @@ const nt = (e, l) => {
|
|
|
2144
2144
|
}, null, 8, ["map-instance"])
|
|
2145
2145
|
]));
|
|
2146
2146
|
}
|
|
2147
|
-
}), $o = /* @__PURE__ */ He(
|
|
2147
|
+
}), $o = /* @__PURE__ */ He(So, [["__scopeId", "data-v-5724a05d"]]), Do = jt($o);
|
|
2148
2148
|
export {
|
|
2149
2149
|
Do as Z
|
|
2150
2150
|
};
|