zhihao-ui 1.3.61-alpha.2 → 1.3.61-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/{Map-qSFTN8LW.js → Map-D9kvu6Im.js} +363 -353
- package/dist/es/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/types/components/Map/index.d.ts +9 -0
- package/dist/types/components/Map/interface/mapProps.d.ts +1 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +5 -5
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { S as
|
|
1
|
+
import { defineComponent as vt, createElementBlock as tt, openBlock as ot, createElementVNode as nt, ref as fe, computed as Ue, h as we, createVNode as ht, render as Bt, reactive as Xt, onMounted as qt, onUnmounted as _t, createCommentVNode as Kt } from "vue";
|
|
2
|
+
import { S as jt, M as Ct, T as ze, X as Ve, t as he, V as Qt, u as Jt, D as yt, v as Ut, w as It, x as wt, j as $t, y as Oe, F as ge, z as oe, O as pe, A as zt, B as Xe, L as Ge, G as eo, P as Mt, H as me, I as ue, J as Ce, K as be, N as Pe, Q as Fe, R as rt, U as to, W as Lt, Y as et, Z as mt, _ as oo, $ as no, a0 as ro, a1 as lo, a2 as io, a3 as so } from "./vendor-Dz44HqMM.js";
|
|
3
3
|
import { _ as xt } from "./Button-C39vlreJ.js";
|
|
4
|
-
import { w as
|
|
5
|
-
const
|
|
4
|
+
import { w as co } from "./utils-D7-cBAU3.js";
|
|
5
|
+
const ao = { id: "scale-line-container" }, uo = /* @__PURE__ */ vt({
|
|
6
6
|
__name: "scaleLine",
|
|
7
7
|
setup(e, { expose: l }) {
|
|
8
8
|
return l({
|
|
9
9
|
setScaleLine: (r, u) => {
|
|
10
10
|
u || (u = "metric");
|
|
11
|
-
const a = new
|
|
11
|
+
const a = new jt({
|
|
12
12
|
units: u
|
|
13
13
|
}), n = document.getElementById("scale-line-container");
|
|
14
14
|
n && (a.setTarget(n), r.addControl(a));
|
|
15
15
|
}
|
|
16
|
-
}), (r, u) => (
|
|
16
|
+
}), (r, u) => (ot(), tt("div", ao));
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
18
|
+
}), go = /* @__PURE__ */ xt(uo, [["__scopeId", "data-v-2bc5dee8"]]), fo = { class: "zoom" }, ho = /* @__PURE__ */ vt({
|
|
19
19
|
__name: "zoomControl",
|
|
20
20
|
props: {
|
|
21
21
|
mapInstance: {
|
|
@@ -38,18 +38,18 @@ const co = { id: "scale-line-container" }, ao = /* @__PURE__ */ ht({
|
|
|
38
38
|
const w = a();
|
|
39
39
|
w && u(w - 1);
|
|
40
40
|
};
|
|
41
|
-
return (u, a) => (
|
|
42
|
-
|
|
41
|
+
return (u, a) => (ot(), tt("div", fo, [
|
|
42
|
+
nt("div", {
|
|
43
43
|
class: "button big-button",
|
|
44
44
|
onClick: s
|
|
45
45
|
}, " + "),
|
|
46
|
-
|
|
46
|
+
nt("div", {
|
|
47
47
|
class: "button small-button",
|
|
48
48
|
onClick: r
|
|
49
49
|
}, " - ")
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
|
-
}),
|
|
52
|
+
}), mo = /* @__PURE__ */ xt(ho, [["__scopeId", "data-v-78a81741"]]), Ie = "a6e8f78974f2581f2ca00485b40c948f", se = {
|
|
53
53
|
// 地图默认层级
|
|
54
54
|
default: 13,
|
|
55
55
|
// 地图缩放最小层级
|
|
@@ -81,31 +81,31 @@ const co = { id: "scale-line-container" }, ao = /* @__PURE__ */ ht({
|
|
|
81
81
|
data: "EPSG:4326",
|
|
82
82
|
// 墨卡托投影坐标 渲染坐标
|
|
83
83
|
mercator: "EPSG:3857"
|
|
84
|
-
}, Et = [114.84, 30.52], Vt = "https://static.zhihaoscm.cn/",
|
|
84
|
+
}, Et = [114.84, 30.52], Vt = "https://static.zhihaoscm.cn/", lt = 2003750834e-2;
|
|
85
85
|
var Ee = ((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=${Ie}`, 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=${Ie}`, 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=${Ie}`, 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=${Ie}`, e.greenTile = `${Vt}/map/tile/{z}/{x}/{y}.png`, e))(Ee || {}), Ae = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(Ae || {}), le = /* @__PURE__ */ ((e) => (e.PORT = "port", e.SHIP = "ship", e.TRACK = "track", e.DELETE = "delete", e.PATH = "path", e))(le || {});
|
|
86
86
|
function vo() {
|
|
87
|
-
const e = fe(), l = fe(!0), s = () => e.value, r = () => s().getView(), u = (
|
|
88
|
-
l.value =
|
|
87
|
+
const e = fe(), l = fe(!0), s = () => e.value, r = () => s().getView(), u = (C) => {
|
|
88
|
+
l.value = C;
|
|
89
89
|
}, a = () => l.value, n = () => {
|
|
90
|
-
var
|
|
91
|
-
return (
|
|
92
|
-
}, c = (
|
|
90
|
+
var C;
|
|
91
|
+
return (C = r()) == null ? void 0 : C.getZoom();
|
|
92
|
+
}, c = (C) => {
|
|
93
93
|
var i;
|
|
94
|
-
(i = r()) == null || i.setZoom(
|
|
95
|
-
}, w = (
|
|
94
|
+
(i = r()) == null || i.setZoom(C);
|
|
95
|
+
}, w = (C, i) => {
|
|
96
96
|
var g;
|
|
97
|
-
(g = r()) == null || g.setCenter(he([
|
|
97
|
+
(g = r()) == null || g.setCenter(he([C, i]));
|
|
98
98
|
}, L = () => {
|
|
99
99
|
var i;
|
|
100
|
-
const
|
|
101
|
-
return
|
|
100
|
+
const C = (i = r()) == null ? void 0 : i.getCenter();
|
|
101
|
+
return Ut(C);
|
|
102
102
|
}, t = () => {
|
|
103
|
-
var
|
|
104
|
-
return (
|
|
103
|
+
var C;
|
|
104
|
+
return (C = s()) == null ? void 0 : C.getSize();
|
|
105
105
|
}, o = () => {
|
|
106
|
-
const
|
|
106
|
+
const C = window.navigator.userAgent, i = /iPad|iPhone|iPod/.test(C), g = /Safari/.test(C) && !/CriOS/.test(C), b = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(C);
|
|
107
107
|
return i && (g || b);
|
|
108
|
-
}, y = new
|
|
108
|
+
}, y = new Ct(), N = (C, i) => {
|
|
109
109
|
Z(i);
|
|
110
110
|
const g = {
|
|
111
111
|
zoom: i.zoom,
|
|
@@ -117,8 +117,8 @@ function vo() {
|
|
|
117
117
|
multiWorld: !0
|
|
118
118
|
};
|
|
119
119
|
let b = {
|
|
120
|
-
target:
|
|
121
|
-
controls:
|
|
120
|
+
target: C,
|
|
121
|
+
controls: Jt({
|
|
122
122
|
zoom: !1
|
|
123
123
|
}),
|
|
124
124
|
layers: [
|
|
@@ -127,9 +127,9 @@ function vo() {
|
|
|
127
127
|
y.get("satelliteImgTile"),
|
|
128
128
|
y.get("satelliteImgTileMark")
|
|
129
129
|
],
|
|
130
|
-
view: new
|
|
130
|
+
view: new Qt(g)
|
|
131
131
|
};
|
|
132
|
-
const h = new
|
|
132
|
+
const h = new Ct(b);
|
|
133
133
|
if (o()) {
|
|
134
134
|
const M = new yt({
|
|
135
135
|
handleEvent: function(A) {
|
|
@@ -144,34 +144,34 @@ function vo() {
|
|
|
144
144
|
h.addInteraction(M);
|
|
145
145
|
}
|
|
146
146
|
e.value = h;
|
|
147
|
-
}, Z = (
|
|
147
|
+
}, Z = (C) => {
|
|
148
148
|
y.set("vectorTile", new ze({
|
|
149
149
|
source: new Ve({ url: Ee.vectorTile }),
|
|
150
|
-
visible:
|
|
150
|
+
visible: C.layerType === "vector",
|
|
151
151
|
zIndex: 0,
|
|
152
152
|
preload: 1,
|
|
153
153
|
className: "vector"
|
|
154
154
|
})), y.set("vectorTileMark", new ze({
|
|
155
155
|
source: new Ve({ url: Ee.vectorTileMark }),
|
|
156
|
-
visible:
|
|
156
|
+
visible: C.layerType === "vector",
|
|
157
157
|
zIndex: 1,
|
|
158
158
|
preload: 1,
|
|
159
159
|
className: "vector"
|
|
160
160
|
})), y.set("satelliteImgTile", new ze({
|
|
161
161
|
source: new Ve({ url: Ee.satelliteImgTile }),
|
|
162
|
-
visible:
|
|
162
|
+
visible: C.layerType === "satellite",
|
|
163
163
|
zIndex: 0,
|
|
164
164
|
preload: 1,
|
|
165
165
|
className: "satellite"
|
|
166
166
|
})), y.set("satelliteImgTileMark", new ze({
|
|
167
167
|
source: new Ve({ url: Ee.satelliteImgTileMark }),
|
|
168
|
-
visible:
|
|
168
|
+
visible: C.layerType === "satellite",
|
|
169
169
|
zIndex: 1,
|
|
170
170
|
preload: 1,
|
|
171
171
|
className: "satellite"
|
|
172
172
|
})), y.set("greenMark", new ze({
|
|
173
173
|
source: new Ve({ url: Ee.greenTile }),
|
|
174
|
-
visible:
|
|
174
|
+
visible: C.showGreenLayer,
|
|
175
175
|
zIndex: 2,
|
|
176
176
|
className: "greenTile"
|
|
177
177
|
}));
|
|
@@ -193,20 +193,20 @@ function vo() {
|
|
|
193
193
|
const bt = function(e, l) {
|
|
194
194
|
const s = Number(l) / 6e5;
|
|
195
195
|
return [Number(e) / 6e5, s];
|
|
196
|
-
},
|
|
196
|
+
}, yo = (e, l) => {
|
|
197
197
|
const s = he(e), r = l * 1e3, u = [
|
|
198
198
|
s[0] - r,
|
|
199
199
|
s[1] - r,
|
|
200
200
|
s[0] + r,
|
|
201
201
|
s[1] + r
|
|
202
|
-
], a =
|
|
202
|
+
], a = It(u, ie.mercator, ie.data);
|
|
203
203
|
return {
|
|
204
204
|
leftTopPoint: { lng: a[0], lat: a[3] },
|
|
205
205
|
rightTopPoint: { lng: a[2], lat: a[3] },
|
|
206
206
|
rightBottomPoint: { lng: a[2], lat: a[1] },
|
|
207
207
|
leftBottomPoint: { lng: a[0], lat: a[1] }
|
|
208
208
|
};
|
|
209
|
-
},
|
|
209
|
+
}, wo = function(e, l) {
|
|
210
210
|
const r = wt(e);
|
|
211
211
|
let u = "";
|
|
212
212
|
switch (console.log(l, Ae), l) {
|
|
@@ -222,10 +222,10 @@ const bt = function(e, l) {
|
|
|
222
222
|
}
|
|
223
223
|
return u;
|
|
224
224
|
};
|
|
225
|
-
function
|
|
226
|
-
const l = e[0] *
|
|
225
|
+
function xo(e) {
|
|
226
|
+
const l = e[0] * lt / 180;
|
|
227
227
|
let s = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
|
|
228
|
-
return s = s *
|
|
228
|
+
return s = s * lt / 180, [l, s];
|
|
229
229
|
}
|
|
230
230
|
function Te(e = "") {
|
|
231
231
|
let l = e.replace(/&?/g, "&");
|
|
@@ -246,64 +246,64 @@ const Tt = (e) => {
|
|
|
246
246
|
zIndex: 100
|
|
247
247
|
});
|
|
248
248
|
}, Pt = (e, l = "lonlat") => {
|
|
249
|
-
const s = { lon: 0, lat: 0 }, r = e[0] /
|
|
250
|
-
let u = e[1] /
|
|
249
|
+
const s = { lon: 0, lat: 0 }, r = e[0] / lt * 180;
|
|
250
|
+
let u = e[1] / lt * 180;
|
|
251
251
|
return u = 180 / Math.PI * (2 * Math.atan(Math.exp(u * Math.PI / 180)) - Math.PI / 2), s.lon = r, s.lat = u, l === "lonlat" ? s : [r, u];
|
|
252
|
-
},
|
|
252
|
+
}, bo = (e) => {
|
|
253
253
|
const l = $t.duration(e, "minutes"), s = Math.floor(l.asDays()), r = l.hours(), u = l.minutes();
|
|
254
254
|
let a = `${String(u).padStart(2, "0")}分`;
|
|
255
255
|
return r !== 0 && (a = `${String(r).padStart(2, "0")}时${a}`), s !== 0 && (a = `${String(s).padStart(2, "0")}天${a}`), a;
|
|
256
256
|
};
|
|
257
|
-
var Ot = /* @__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))(Ot || {}),
|
|
258
|
-
const
|
|
257
|
+
var Ot = /* @__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))(Ot || {}), ve = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.front = "front", e.up = "up", e.down = "down", e.back = "back", e))(ve || {});
|
|
258
|
+
const ko = (e) => {
|
|
259
259
|
const l = /* @__PURE__ */ new Map(), s = {};
|
|
260
260
|
let r = null;
|
|
261
261
|
const u = "--";
|
|
262
262
|
let a = null;
|
|
263
|
-
const n = document.createElement("div"), c = new
|
|
263
|
+
const n = document.createElement("div"), c = new pe({
|
|
264
264
|
element: n,
|
|
265
265
|
positioning: "top-left",
|
|
266
266
|
className: "track-label-popup"
|
|
267
267
|
});
|
|
268
|
-
let w, L, t, o, y, N = !1, Z = Date.now(),
|
|
268
|
+
let w, L, t, o, y, N = !1, Z = Date.now(), C, i = 0, g = null, b = 20;
|
|
269
269
|
const h = 8, M = [], A = (d) => {
|
|
270
|
-
var
|
|
270
|
+
var v;
|
|
271
271
|
for (M.unshift(d); M.length > h; ) {
|
|
272
272
|
const x = M.pop(), k = l.get(x);
|
|
273
|
-
k && ((
|
|
273
|
+
k && ((v = k.getSource()) == null || v.clear(), e == null || e.removeLayer(k), l.delete(x), delete s[x]);
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
276
|
let z = "";
|
|
277
277
|
const _ = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], ee = zt(async () => {
|
|
278
278
|
if (r && s[r] && l.get(r).getVisible()) {
|
|
279
279
|
console.log("reRenderTrackLine------------"), await U(r);
|
|
280
|
-
const d =
|
|
280
|
+
const d = p(r, s[r]);
|
|
281
281
|
qe(r, d);
|
|
282
282
|
}
|
|
283
|
-
}, 100), V = () => r && s[r] && l.get(r).getVisible(),
|
|
283
|
+
}, 100), V = () => r && s[r] && l.get(r).getVisible(), p = (d, v) => {
|
|
284
284
|
let x = [];
|
|
285
|
-
const k = Math.max(1, Math.floor(
|
|
286
|
-
return x =
|
|
285
|
+
const k = Math.max(1, Math.floor(v.length / b));
|
|
286
|
+
return x = v.filter((E, T) => T % k === 0).map((E, T) => {
|
|
287
287
|
if (Number(E.lon) > 180 || Number(E.lat) > 180) {
|
|
288
288
|
const [W, K] = bt(E.lon, E.lat);
|
|
289
289
|
E.lon = W, E.lat = K;
|
|
290
290
|
}
|
|
291
|
-
return E.center = [E.lon, E.lat], E.centerPoint =
|
|
291
|
+
return E.center = [E.lon, E.lat], E.centerPoint = xo(E.center), E.time = $t(E.createdAt).format("YYYY-MM-DD HH:mm:ss"), E.id = d, E.index = T, E;
|
|
292
292
|
}), x.filter(
|
|
293
293
|
(E, T, W) => T === W.findIndex(
|
|
294
294
|
(K) => Math.abs(K.lon - E.lon) < 1e-6 && Math.abs(K.lat - E.lat) < 1e-6
|
|
295
295
|
)
|
|
296
296
|
);
|
|
297
|
-
}, F = async (d,
|
|
298
|
-
if (!e || JSON.stringify(s[d]) === JSON.stringify(
|
|
297
|
+
}, F = async (d, v, x, k = "ship", m = 200) => {
|
|
298
|
+
if (!e || JSON.stringify(s[d]) === JSON.stringify(v) && r === d || (k === "ship" && (v = v == null ? void 0 : v.reverse()), c && k === "ship" && (e != null && e.getOverlays().getArray().includes(c) || e.addOverlay(c)), (v == null ? void 0 : v.length) < 2))
|
|
299
299
|
return;
|
|
300
|
-
A(d), r = d, s[d] =
|
|
300
|
+
A(d), r = d, s[d] = v, b = m;
|
|
301
301
|
const O = Object.keys(s).findIndex((E) => E === d) || 0;
|
|
302
302
|
z = x || _[O > 10 ? 10 : O], await X(), await de(r);
|
|
303
303
|
}, G = (d) => {
|
|
304
|
-
const
|
|
305
|
-
return new
|
|
306
|
-
source:
|
|
304
|
+
const v = new be();
|
|
305
|
+
return new Ce({
|
|
306
|
+
source: v,
|
|
307
307
|
visible: !1,
|
|
308
308
|
// 默认隐藏
|
|
309
309
|
className: `track-layer-${d}`,
|
|
@@ -312,10 +312,10 @@ const bo = (e) => {
|
|
|
312
312
|
zIndex: 10
|
|
313
313
|
});
|
|
314
314
|
}, D = (d) => {
|
|
315
|
-
l.forEach((
|
|
316
|
-
var
|
|
315
|
+
l.forEach((v, x) => {
|
|
316
|
+
var m;
|
|
317
317
|
const k = x === d;
|
|
318
|
-
|
|
318
|
+
v.getVisible() !== k && (v.setVisible(k), e.getLayers().getArray().includes(v) || e.addLayer(v), k || (m = v.getSource()) == null || m.clear());
|
|
319
319
|
}), r = d;
|
|
320
320
|
}, X = async () => {
|
|
321
321
|
const d = r;
|
|
@@ -324,19 +324,19 @@ const bo = (e) => {
|
|
|
324
324
|
l.set(d, O);
|
|
325
325
|
}
|
|
326
326
|
await D(d);
|
|
327
|
-
const
|
|
327
|
+
const v = z || "", x = s[d] || [];
|
|
328
328
|
if (!(x && x.length > 1)) return [];
|
|
329
329
|
let k = [];
|
|
330
|
-
k =
|
|
331
|
-
const
|
|
332
|
-
k.length >= 2 && await q(d,
|
|
333
|
-
}, q = (d,
|
|
334
|
-
const k = new Ge(
|
|
330
|
+
k = p(d, x);
|
|
331
|
+
const m = k.map((O) => O.centerPoint);
|
|
332
|
+
k.length >= 2 && await q(d, m, v);
|
|
333
|
+
}, q = (d, v, x) => {
|
|
334
|
+
const k = new Ge(v), m = l.get(d).getSource(), O = m.getFeatureById(d);
|
|
335
335
|
if (O)
|
|
336
336
|
O.setGeometry(k), O.setId(d), O.setStyle(B(x)), g = O;
|
|
337
337
|
else {
|
|
338
|
-
const E = new
|
|
339
|
-
E.setId(d), E.set("type", "line"), E.setStyle(B(x)),
|
|
338
|
+
const E = new me({ geometry: k });
|
|
339
|
+
E.setId(d), E.set("type", "line"), E.setStyle(B(x)), m.addFeature(E), g = E;
|
|
340
340
|
}
|
|
341
341
|
return g;
|
|
342
342
|
}, B = (d) => new oe({
|
|
@@ -344,13 +344,13 @@ const bo = (e) => {
|
|
|
344
344
|
color: d,
|
|
345
345
|
width: 2
|
|
346
346
|
})
|
|
347
|
-
}), ne = (d,
|
|
347
|
+
}), ne = (d, v, x) => {
|
|
348
348
|
try {
|
|
349
349
|
const k = d == null ? void 0 : d.get("data");
|
|
350
|
-
if (d && k &&
|
|
350
|
+
if (d && k && v === "hover") {
|
|
351
351
|
e.getTargetElement().style.cursor = k ? "pointer" : "";
|
|
352
|
-
const
|
|
353
|
-
O && (n.querySelector(".popup-content"), n.innerHTML =
|
|
352
|
+
const m = ke(k), O = x == null ? void 0 : x.coordinate;
|
|
353
|
+
O && (n.querySelector(".popup-content"), n.innerHTML = m, c == null || c.setPosition(O));
|
|
354
354
|
} else
|
|
355
355
|
c && c.setPosition(void 0);
|
|
356
356
|
} catch (k) {
|
|
@@ -358,11 +358,11 @@ const bo = (e) => {
|
|
|
358
358
|
}
|
|
359
359
|
}, ke = (d) => {
|
|
360
360
|
if (!(d != null && d.time)) return;
|
|
361
|
-
let
|
|
362
|
-
return d != null && d.stayTime && (
|
|
361
|
+
let v = "";
|
|
362
|
+
return d != null && d.stayTime && (v = `
|
|
363
363
|
<div class="item w-100">
|
|
364
364
|
<div class="item-label">停泊时间约</div>
|
|
365
|
-
<div class="item-item">${
|
|
365
|
+
<div class="item-item">${bo(Number(d.stayTime))}</div>
|
|
366
366
|
</div>
|
|
367
367
|
`), `
|
|
368
368
|
<div class="track-point-popup">
|
|
@@ -394,7 +394,7 @@ const bo = (e) => {
|
|
|
394
394
|
<div class="item-label">时间</div>
|
|
395
395
|
<div class="item-item">${d.time}</div>
|
|
396
396
|
</div>
|
|
397
|
-
${
|
|
397
|
+
${v ?? v}
|
|
398
398
|
</div>`;
|
|
399
399
|
}, ce = (d) => {
|
|
400
400
|
const x = d.map((T) => {
|
|
@@ -413,13 +413,13 @@ const bo = (e) => {
|
|
|
413
413
|
const W = x[T - 1].pixel, K = x[T].pixel, re = K[0] - W[0], P = K[1] - W[1];
|
|
414
414
|
k += Math.sqrt(re * re + P * P), x[T].distance = k;
|
|
415
415
|
}
|
|
416
|
-
const
|
|
416
|
+
const m = x.filter(
|
|
417
417
|
(T, W) => W === 0 || W === x.length - 1
|
|
418
418
|
), O = [];
|
|
419
|
-
for (let T = 0; T <
|
|
420
|
-
const W =
|
|
421
|
-
if (O.push(W), T <
|
|
422
|
-
const K =
|
|
419
|
+
for (let T = 0; T < m.length; T++) {
|
|
420
|
+
const W = m[T];
|
|
421
|
+
if (O.push(W), T < m.length - 1) {
|
|
422
|
+
const K = m[T + 1], re = K.distance - W.distance, P = Math.floor(re / 100);
|
|
423
423
|
for (let j = 1; j <= P; j++) {
|
|
424
424
|
const I = W.distance + j * 100;
|
|
425
425
|
if (I >= K.distance) break;
|
|
@@ -444,17 +444,17 @@ const bo = (e) => {
|
|
|
444
444
|
distance: T.distance
|
|
445
445
|
}));
|
|
446
446
|
};
|
|
447
|
-
function ae(d,
|
|
447
|
+
function ae(d, v) {
|
|
448
448
|
for (let x = 1; x < d.length; x++) {
|
|
449
|
-
const k = d[x - 1],
|
|
450
|
-
if (
|
|
451
|
-
const O = (
|
|
449
|
+
const k = d[x - 1], m = d[x];
|
|
450
|
+
if (v >= k.distance && v <= m.distance) {
|
|
451
|
+
const O = (v - k.distance) / (m.distance - k.distance), E = k.pixel[0] + O * (m.pixel[0] - k.pixel[0]), T = k.pixel[1] + O * (m.pixel[1] - k.pixel[1]), W = e == null ? void 0 : e.getCoordinateFromPixel([E, T]);
|
|
452
452
|
return {
|
|
453
453
|
...k,
|
|
454
454
|
// 继承前一个点的属性(可调整)
|
|
455
455
|
coord: W,
|
|
456
456
|
pixel: [E, T],
|
|
457
|
-
distance:
|
|
457
|
+
distance: v,
|
|
458
458
|
original: void 0
|
|
459
459
|
// 明确标记为插值生成点
|
|
460
460
|
};
|
|
@@ -462,27 +462,27 @@ const bo = (e) => {
|
|
|
462
462
|
}
|
|
463
463
|
return null;
|
|
464
464
|
}
|
|
465
|
-
const qe = async (d,
|
|
466
|
-
if (!
|
|
467
|
-
const x = ce(
|
|
468
|
-
|
|
465
|
+
const qe = async (d, v) => {
|
|
466
|
+
if (!v || v.length === 0) return [];
|
|
467
|
+
const x = ce(v), k = l.get(d).getSource(), m = x.map((T) => ct(T));
|
|
468
|
+
m && m.length > 0 && k.addFeatures(m);
|
|
469
469
|
const O = x.map((T) => J(T, z));
|
|
470
470
|
O && O.length > 0 && k.addFeatures(O);
|
|
471
|
-
const E = $(x,
|
|
471
|
+
const E = $(x, v, z);
|
|
472
472
|
E && E.length > 0 && k.addFeatures(E);
|
|
473
|
-
},
|
|
474
|
-
const
|
|
473
|
+
}, ct = (d) => {
|
|
474
|
+
const v = new me({
|
|
475
475
|
geometry: new ue(d.centerPoint),
|
|
476
476
|
data: d
|
|
477
477
|
});
|
|
478
|
-
|
|
478
|
+
v.set("type", "track_point"), v.set("trackId", d.id), v.set("data", d);
|
|
479
479
|
let x = [
|
|
480
480
|
...te(z)
|
|
481
481
|
];
|
|
482
|
-
return (d.index === 0 || d.index === s[d.id].length - 1) && (x = [...ye(d)],
|
|
483
|
-
},
|
|
482
|
+
return (d.index === 0 || d.index === s[d.id].length - 1) && (x = [...ye(d)], v.set("type", "track_begin")), d.state !== void 0 && d.state !== null && (x = [...Y(d)], v.set("type", "track_icon")), v.setStyle(x), v;
|
|
483
|
+
}, at = window.devicePixelRatio || 1, f = /* @__PURE__ */ new Map();
|
|
484
484
|
let S = null, R = null;
|
|
485
|
-
function H(d,
|
|
485
|
+
function H(d, v) {
|
|
486
486
|
const x = `${d}`;
|
|
487
487
|
if (f.has(x))
|
|
488
488
|
return f.get(x);
|
|
@@ -492,89 +492,89 @@ const bo = (e) => {
|
|
|
492
492
|
R = S.getContext("2d", {
|
|
493
493
|
willReadFrequently: !0
|
|
494
494
|
});
|
|
495
|
-
} catch (
|
|
496
|
-
console.log("e",
|
|
495
|
+
} catch (pt) {
|
|
496
|
+
console.log("e", pt), R = S.getContext("2d");
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
const k = S,
|
|
500
|
-
if (!
|
|
499
|
+
const k = S, m = R;
|
|
500
|
+
if (!m) return "";
|
|
501
501
|
k.width = 0, k.height = 0;
|
|
502
502
|
const O = 2, E = 8, T = 16, W = window.devicePixelRatio || 1, K = "500 12px Arial";
|
|
503
|
-
|
|
504
|
-
const P =
|
|
503
|
+
m.font = K;
|
|
504
|
+
const P = m.measureText(d).width, j = E + P + E, I = O + 14 + O;
|
|
505
505
|
let Q = 0, Se = 0, Ze = 0, De = 0, He = 0, Ne = 0, Le = 0, Re = 0;
|
|
506
|
-
Q = T + j, Se = T + I, Ze = j, De = I, He = j + T, Ne = 0, Le = 0, Re = T, k.width = Math.round(Q * W), k.height = Math.round(Se * W),
|
|
506
|
+
Q = T + j, Se = T + I, Ze = j, De = I, He = j + T, Ne = 0, Le = 0, Re = T, k.width = Math.round(Q * W), k.height = Math.round(Se * W), m.scale(W, W), m.clearRect(0, 0, Q, Se), m.beginPath(), m.moveTo(Ze, De), m.lineTo(He, Ne), m.strokeStyle = v || "#FFF", m.lineWidth = 1, m.stroke(), m.fillStyle = "#FFF", m.fillRect(Le, Re, j, I), m.strokeStyle = v || "#FFF", m.lineWidth = 1, m.strokeRect(Le, Re, j, I), m.font = K, m.textBaseline = "middle";
|
|
507
507
|
const Qe = Re + O / 2 + I / 2;
|
|
508
|
-
|
|
508
|
+
m.strokeStyle = "#ffffff", m.lineWidth = 1, m.strokeText(d, Le + E, Qe), m.fillStyle = "#000000", m.fillText(d, Le + E, Qe);
|
|
509
509
|
const Je = k.toDataURL("image/png");
|
|
510
510
|
return f.set(x, Je), Je;
|
|
511
511
|
}
|
|
512
|
-
const J = (d,
|
|
513
|
-
const x = H(d.time,
|
|
512
|
+
const J = (d, v) => {
|
|
513
|
+
const x = H(d.time, v), k = new me({
|
|
514
514
|
geometry: new ue(d.centerPoint),
|
|
515
515
|
data: d
|
|
516
516
|
});
|
|
517
517
|
k.set("type", "track_point_label");
|
|
518
|
-
const
|
|
518
|
+
const m = new oe({
|
|
519
519
|
image: new Fe({
|
|
520
520
|
src: x,
|
|
521
521
|
anchor: [1, 0],
|
|
522
522
|
displacement: [0, 0],
|
|
523
|
-
scale: 1 /
|
|
523
|
+
scale: 1 / at,
|
|
524
524
|
anchorXUnits: "fraction",
|
|
525
525
|
anchorYUnits: "fraction"
|
|
526
526
|
}),
|
|
527
527
|
zIndex: 100
|
|
528
528
|
});
|
|
529
|
-
return k.setStyle(
|
|
529
|
+
return k.setStyle(m), k;
|
|
530
530
|
}, U = (d) => {
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
x.get("type") !== "line" &&
|
|
531
|
+
const v = l.get(d).getSource();
|
|
532
|
+
v.forEachFeature((x) => {
|
|
533
|
+
x.get("type") !== "line" && v.removeFeature(x);
|
|
534
534
|
});
|
|
535
535
|
}, te = (d) => [
|
|
536
536
|
new oe({
|
|
537
537
|
// 扩大交互热区
|
|
538
|
-
image: new
|
|
538
|
+
image: new rt({
|
|
539
539
|
stroke: new Pe({ color: "rgba(0, 0, 0, 0.01)", width: 20 }),
|
|
540
540
|
radius: 3
|
|
541
541
|
})
|
|
542
542
|
}),
|
|
543
543
|
// 轨迹点样式
|
|
544
544
|
new oe({
|
|
545
|
-
image: new
|
|
545
|
+
image: new rt({
|
|
546
546
|
fill: new ge({ color: d }),
|
|
547
547
|
stroke: new Pe({ color: "#fff", width: 2 }),
|
|
548
548
|
radius: 3
|
|
549
549
|
})
|
|
550
550
|
})
|
|
551
551
|
], Y = (d) => {
|
|
552
|
-
const
|
|
552
|
+
const v = "#E31818", x = "#1890FF", k = "", m = new oe({
|
|
553
553
|
text: new Oe({
|
|
554
554
|
font: "Normal 22px map-iconfont",
|
|
555
555
|
text: Te(k),
|
|
556
556
|
offsetY: -10,
|
|
557
557
|
fill: new ge({
|
|
558
|
-
color: Number(d.state) === 0 ?
|
|
558
|
+
color: Number(d.state) === 0 ? v : Number(d.state) === 1 ? x : ""
|
|
559
559
|
})
|
|
560
560
|
}),
|
|
561
561
|
zIndex: 99
|
|
562
562
|
}), E = Tt(""), W = Tt(""), K = [];
|
|
563
|
-
return Number(d.state) === 0 ? K.push(E) : Number(d.state) === 1 && K.push(W), K.push(
|
|
564
|
-
}, $ = (d,
|
|
563
|
+
return Number(d.state) === 0 ? K.push(E) : Number(d.state) === 1 && K.push(W), K.push(m), K;
|
|
564
|
+
}, $ = (d, v, x) => {
|
|
565
565
|
const k = [];
|
|
566
566
|
if (d.length < 2)
|
|
567
567
|
return k;
|
|
568
|
-
for (let
|
|
568
|
+
for (let m = 0; m < d.length - 1; m++)
|
|
569
569
|
try {
|
|
570
|
-
const O = d[
|
|
570
|
+
const O = d[m], E = d[m + 1], T = v.findIndex(
|
|
571
571
|
(Q) => Q.lon === O.lon && Q.lat === O.lat
|
|
572
|
-
), W =
|
|
572
|
+
), W = v.findIndex(
|
|
573
573
|
(Q) => Q.lon === E.lon && Q.lat === E.lat
|
|
574
574
|
);
|
|
575
575
|
if (T === -1 || W === -1 || T >= W)
|
|
576
576
|
continue;
|
|
577
|
-
const K =
|
|
577
|
+
const K = v.slice(T, W + 1).map((Q) => Q.centerPoint), P = new Ge(K).getCoordinateAt(0.5), j = kt(d[m].center, d[m + 1].center) * (Math.PI / 180), I = new me({
|
|
578
578
|
geometry: new ue(P)
|
|
579
579
|
});
|
|
580
580
|
I.set("type", "track_arrow"), I.setStyle(
|
|
@@ -595,22 +595,22 @@ const bo = (e) => {
|
|
|
595
595
|
return k;
|
|
596
596
|
}, de = (d) => {
|
|
597
597
|
var O, E;
|
|
598
|
-
const
|
|
598
|
+
const v = e.getView(), x = (O = l == null ? void 0 : l.get(d)) == null ? void 0 : O.getSource(), k = g || (d ? x == null ? void 0 : x.getFeatureById(d) : null);
|
|
599
599
|
if (!k) return;
|
|
600
|
-
const
|
|
601
|
-
if (!
|
|
600
|
+
const m = (E = k == null ? void 0 : k.getGeometry()) == null ? void 0 : E.getExtent();
|
|
601
|
+
if (!m || m[0] === m[2] || m[1] === m[3]) {
|
|
602
602
|
console.warn("Invalid track extent");
|
|
603
603
|
return;
|
|
604
604
|
}
|
|
605
605
|
try {
|
|
606
|
-
const T =
|
|
606
|
+
const T = m[2] - m[0], W = m[3] - m[1], K = 1e-4;
|
|
607
607
|
if (T < K || W < K) {
|
|
608
|
-
const P = [(
|
|
609
|
-
|
|
608
|
+
const P = [(m[0] + m[2]) / 2, (m[1] + m[3]) / 2];
|
|
609
|
+
v.setCenter(P);
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
612
|
-
const re =
|
|
613
|
-
|
|
612
|
+
const re = eo(m, Math.max(T, W) * 0.1);
|
|
613
|
+
v.fit(re, {
|
|
614
614
|
maxZoom: se.max,
|
|
615
615
|
padding: [30, 30, 30, 30]
|
|
616
616
|
// 添加边距
|
|
@@ -619,45 +619,45 @@ const bo = (e) => {
|
|
|
619
619
|
console.error("setTrackViewCenter error:", T);
|
|
620
620
|
}
|
|
621
621
|
}, ye = (d) => {
|
|
622
|
-
const
|
|
622
|
+
const v = "", m = d.index === 0 ? "#fcdc3f" : "#ff0000";
|
|
623
623
|
return [new oe({
|
|
624
624
|
text: new Oe({
|
|
625
625
|
font: "Normal 14px map-iconfont",
|
|
626
|
-
text: Te(
|
|
627
|
-
fill: new ge({ color:
|
|
626
|
+
text: Te(v),
|
|
627
|
+
fill: new ge({ color: m })
|
|
628
628
|
}),
|
|
629
629
|
zIndex: 101
|
|
630
630
|
})];
|
|
631
631
|
}, xe = () => {
|
|
632
|
-
console.log("清除所有的轨迹-----"), je(), l.forEach((
|
|
632
|
+
console.log("清除所有的轨迹-----"), je(), l.forEach((v) => {
|
|
633
633
|
var x;
|
|
634
|
-
(x =
|
|
635
|
-
}), Object.keys(s).forEach((
|
|
636
|
-
l.delete(
|
|
634
|
+
(x = v.getSource()) == null || x.clear(), e == null || e.removeLayer(v);
|
|
635
|
+
}), Object.keys(s).forEach((v) => {
|
|
636
|
+
l.delete(v), delete s[v];
|
|
637
637
|
});
|
|
638
|
-
},
|
|
639
|
-
const
|
|
640
|
-
|
|
638
|
+
}, dt = (d) => {
|
|
639
|
+
const v = l.get(d || r);
|
|
640
|
+
v == null || v.setVisible(!1);
|
|
641
641
|
const x = e.getOverlays().getArray();
|
|
642
642
|
for (let k = 0; k < x.length; ) {
|
|
643
|
-
const
|
|
644
|
-
|
|
643
|
+
const m = x[k];
|
|
644
|
+
m.get("class") === "track-label-overlay" ? (m.setPosition(void 0), m.dispose()) : k++;
|
|
645
645
|
}
|
|
646
646
|
je();
|
|
647
|
-
}, _e = (d,
|
|
647
|
+
}, _e = (d, v = Ae.NM) => {
|
|
648
648
|
const x = {
|
|
649
649
|
id: d,
|
|
650
650
|
length: "--"
|
|
651
|
-
},
|
|
651
|
+
}, m = (s[d] || []).map(
|
|
652
652
|
(E) => Xe([E.lon, E.lat], ie.data, ie.mercator)
|
|
653
|
-
), O = new Ge(
|
|
654
|
-
return x.length =
|
|
655
|
-
}, Ke = (d,
|
|
656
|
-
Ht(String(d),
|
|
657
|
-
}, Ht = (d,
|
|
658
|
-
const x = s[String(d)], k = x == null ? void 0 : x.map((
|
|
659
|
-
k && Yt(k,
|
|
660
|
-
},
|
|
653
|
+
), O = new Ge(m);
|
|
654
|
+
return x.length = wo(O, v) || "--", x;
|
|
655
|
+
}, Ke = (d, v) => {
|
|
656
|
+
Ht(String(d), v);
|
|
657
|
+
}, Ht = (d, v) => {
|
|
658
|
+
const x = s[String(d)], k = x == null ? void 0 : x.map((m) => [m.lon, m.lat]);
|
|
659
|
+
k && Yt(k, v);
|
|
660
|
+
}, ut = new oe({
|
|
661
661
|
text: new Oe({
|
|
662
662
|
font: "700 20px map-iconfont",
|
|
663
663
|
text: Te(""),
|
|
@@ -665,10 +665,10 @@ const bo = (e) => {
|
|
|
665
665
|
rotation: 0
|
|
666
666
|
// 初始旋转角度
|
|
667
667
|
})
|
|
668
|
-
}), Wt = (d,
|
|
668
|
+
}), Wt = (d, v) => {
|
|
669
669
|
var P, j;
|
|
670
|
-
const x = Number(50 *
|
|
671
|
-
if (i = (i + x *
|
|
670
|
+
const x = Number(50 * v), k = ((P = d.frameState) == null ? void 0 : P.time) ?? Date.now(), m = k - Z;
|
|
671
|
+
if (i = (i + x * m / 1e6) % 2, Z = k, i >= 1) {
|
|
672
672
|
je();
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
@@ -682,15 +682,15 @@ const bo = (e) => {
|
|
|
682
682
|
Pt(E, "array"),
|
|
683
683
|
Pt(T, "array")
|
|
684
684
|
) * Math.PI / 180;
|
|
685
|
-
(j =
|
|
686
|
-
const re =
|
|
687
|
-
re.setStyle(
|
|
685
|
+
(j = ut.getText()) == null || j.setRotation(K), o.setCoordinates(O);
|
|
686
|
+
const re = to(d);
|
|
687
|
+
re.setStyle(ut), re.drawGeometry(o), e == null || e.render();
|
|
688
688
|
}, Gt = () => {
|
|
689
689
|
var d;
|
|
690
|
-
N = !0, Z = Date.now(), i = 0, o = ((d = t.getGeometry()) == null ? void 0 : d.clone()) || new ue([0, 0]), a && (
|
|
690
|
+
N = !0, Z = Date.now(), i = 0, o = ((d = t.getGeometry()) == null ? void 0 : d.clone()) || new ue([0, 0]), a && (C == null || C.on("postrender", a)), y == null || y.setGeometry(void 0);
|
|
691
691
|
}, je = () => {
|
|
692
|
-
N && (N = !1, y == null || y.setGeometry(void 0), a &&
|
|
693
|
-
}, Yt = (d,
|
|
692
|
+
N && (N = !1, y == null || y.setGeometry(void 0), a && C && C.un("postrender", a), C && (e == null || e.removeLayer(C)), C = null, y = null);
|
|
693
|
+
}, Yt = (d, v) => {
|
|
694
694
|
N && je(), w = new Mt({
|
|
695
695
|
factor: 1e6
|
|
696
696
|
}).writeGeometry(new Ge(d)), L = new Mt({
|
|
@@ -698,25 +698,25 @@ const bo = (e) => {
|
|
|
698
698
|
}).readGeometry(w, {
|
|
699
699
|
dataProjection: ie.data,
|
|
700
700
|
featureProjection: ie.mercator
|
|
701
|
-
}), t = new
|
|
701
|
+
}), t = new me({
|
|
702
702
|
type: "icon",
|
|
703
703
|
geometry: new ue(L.getFirstCoordinate())
|
|
704
704
|
});
|
|
705
705
|
const x = t.getGeometry();
|
|
706
|
-
o = x ? x.clone() : new ue([0, 0]), y = new
|
|
706
|
+
o = x ? x.clone() : new ue([0, 0]), y = new me({
|
|
707
707
|
type: "geoMarker",
|
|
708
|
-
style:
|
|
708
|
+
style: ut,
|
|
709
709
|
geometry: o
|
|
710
|
-
}),
|
|
710
|
+
}), C = new Ce({
|
|
711
711
|
source: new be({
|
|
712
712
|
features: [y]
|
|
713
713
|
})
|
|
714
|
-
}), e == null || e.addLayer(
|
|
715
|
-
}, kt = (d,
|
|
714
|
+
}), e == null || e.addLayer(C), a = (k) => Wt(k, v), Gt();
|
|
715
|
+
}, kt = (d, v, x) => {
|
|
716
716
|
function k(P) {
|
|
717
717
|
return 180 * (P % (2 * Math.PI)) / Math.PI;
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function m(P) {
|
|
720
720
|
return P % 360 * Math.PI / 180;
|
|
721
721
|
}
|
|
722
722
|
function O(P) {
|
|
@@ -738,7 +738,7 @@ const bo = (e) => {
|
|
|
738
738
|
return function(Qe, Je) {
|
|
739
739
|
return (E(Je, Qe) + 180) % 360;
|
|
740
740
|
}(P, j);
|
|
741
|
-
const Q = O(P), Se = O(j), Ze =
|
|
741
|
+
const Q = O(P), Se = O(j), Ze = m(Q[0]), De = m(Se[0]), He = m(Q[1]), Ne = m(Se[1]), Le = Math.sin(De - Ze) * Math.cos(Ne), Re = Math.cos(He) * Math.sin(Ne) - Math.sin(He) * Math.cos(Ne) * Math.cos(De - Ze);
|
|
742
742
|
return k(Math.atan2(Le, Re));
|
|
743
743
|
}
|
|
744
744
|
function T(P) {
|
|
@@ -757,7 +757,7 @@ const bo = (e) => {
|
|
|
757
757
|
};
|
|
758
758
|
return I.id !== void 0 && (Q.id = I.id), I.bbox && (Q.bbox = I.bbox), Q.properties = j, Q.geometry = P, Q;
|
|
759
759
|
}
|
|
760
|
-
const re = E(W(d), W(
|
|
760
|
+
const re = E(W(d), W(v), x);
|
|
761
761
|
return re < 0 ? 360 + re : re;
|
|
762
762
|
};
|
|
763
763
|
return {
|
|
@@ -765,13 +765,13 @@ const bo = (e) => {
|
|
|
765
765
|
remove: xe,
|
|
766
766
|
play: Ke,
|
|
767
767
|
setCenter: de,
|
|
768
|
-
close:
|
|
768
|
+
close: dt,
|
|
769
769
|
getLength: _e,
|
|
770
770
|
handleTrackMapEvent: ne,
|
|
771
771
|
reRenderTrackLine: ee,
|
|
772
772
|
getTrackStatus: V
|
|
773
773
|
};
|
|
774
|
-
},
|
|
774
|
+
}, po = (e, l) => {
|
|
775
775
|
let s = null;
|
|
776
776
|
const r = async (t) => {
|
|
777
777
|
if (!e || (console.log("vehicleInfo", t), !(t != null && t.lon && (t != null && t.lat)))) return;
|
|
@@ -781,7 +781,7 @@ const bo = (e) => {
|
|
|
781
781
|
y.setCenter(Xe(N.getCoordinates(), ie.data, ie.mercator));
|
|
782
782
|
}, u = (t, o) => {
|
|
783
783
|
const y = `${Vt}map/car-icon.gif`;
|
|
784
|
-
s || (s = new
|
|
784
|
+
s || (s = new pe({
|
|
785
785
|
element: document.createElement("div"),
|
|
786
786
|
positioning: "center-center",
|
|
787
787
|
stopEvent: !1
|
|
@@ -820,7 +820,7 @@ const bo = (e) => {
|
|
|
820
820
|
getProps: () => e.value
|
|
821
821
|
};
|
|
822
822
|
};
|
|
823
|
-
function
|
|
823
|
+
function Mo(e) {
|
|
824
824
|
const l = fe(null), s = Ue(() => ({
|
|
825
825
|
"--overlay-color": "#FFF",
|
|
826
826
|
"--bg-color1": e.colors && e.colors[0] ? e.colors[0] : "#ffffff",
|
|
@@ -948,10 +948,10 @@ function po(e) {
|
|
|
948
948
|
}
|
|
949
949
|
const At = (e) => {
|
|
950
950
|
const { spd: l, hdg: s, cog: r } = e;
|
|
951
|
-
return l ? s !== null && +s != 511 && r !== null ? r - +s >= 3 ?
|
|
951
|
+
return l ? s !== null && +s != 511 && r !== null ? r - +s >= 3 ? ve.right : r - +s <= -3 ? ve.left : ve.front : ve.front : "";
|
|
952
952
|
};
|
|
953
|
-
function
|
|
954
|
-
const { isHighlight: s, shipData: r, color: u } = e.getProperties(), a =
|
|
953
|
+
function Lo(e, l) {
|
|
954
|
+
const { isHighlight: s, shipData: r, color: u } = e.getProperties(), a = it(l), n = st(l, r, a), c = ((r == null ? void 0 : r.cog) - 90 + 360) % 360, w = At(r);
|
|
955
955
|
return {
|
|
956
956
|
featureId: r.id,
|
|
957
957
|
shipType: a,
|
|
@@ -963,21 +963,21 @@ function Mo(e, l) {
|
|
|
963
963
|
};
|
|
964
964
|
}
|
|
965
965
|
const Ye = /* @__PURE__ */ new Map();
|
|
966
|
-
function
|
|
966
|
+
function Eo(e) {
|
|
967
967
|
return `${e.featureId}_${e.shipType}_${e.isHighlight}_${e.scale}_${e.fill}_${e.deg}_${e.direct}`;
|
|
968
968
|
}
|
|
969
969
|
const $e = (e, l) => {
|
|
970
|
-
const s =
|
|
970
|
+
const s = Lo(l, e), r = Eo(s);
|
|
971
971
|
if (Ye.has(r))
|
|
972
972
|
return Ye.get(r);
|
|
973
|
-
const { shipData: u } = l.getProperties(), a =
|
|
973
|
+
const { shipData: u } = l.getProperties(), a = it(e), n = st(e, u, a), c = To(l, n, a);
|
|
974
974
|
return Ye.set(r, c), c;
|
|
975
|
-
},
|
|
975
|
+
}, it = (e) => {
|
|
976
976
|
const l = e == null ? void 0 : e.getView().getZoom();
|
|
977
977
|
return l && l <= se.shipModelMax && l >= se.shipTriggleMin ? "ship" : "triangle";
|
|
978
978
|
};
|
|
979
979
|
let Ft = null;
|
|
980
|
-
const
|
|
980
|
+
const st = (e, l, s) => {
|
|
981
981
|
if (s === "triangle")
|
|
982
982
|
return se.scaleNum;
|
|
983
983
|
const r = e == null ? void 0 : e.getView().getResolution();
|
|
@@ -988,7 +988,7 @@ const rt = (e, l, s) => {
|
|
|
988
988
|
return Math.max(0.2, Math.min(2, o));
|
|
989
989
|
}
|
|
990
990
|
return se.scaleNum;
|
|
991
|
-
},
|
|
991
|
+
}, To = (e, l, s) => {
|
|
992
992
|
const { color: r, direct: u, isHighlight: a, shipData: n } = e.getProperties(), c = ((n == null ? void 0 : n.cog) - 90 + 360) % 360;
|
|
993
993
|
return new oe({
|
|
994
994
|
image: new Fe({
|
|
@@ -1009,20 +1009,20 @@ const rt = (e, l, s) => {
|
|
|
1009
1009
|
<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"
|
|
1010
1010
|
fill="${r}" stroke="${a ? "#FF2424" : "black"}" stroke-width="${a ? "2" : "0.578947"}" />
|
|
1011
1011
|
<!--path船航向左边或者向前-->
|
|
1012
|
-
${u ===
|
|
1012
|
+
${u === ve.left && `<path d="M30 12L40 12L40 8" stroke="${a ? "#FF2424" : "black"}" stroke-width="2"/>`}
|
|
1013
1013
|
<!--path船航向右边-->
|
|
1014
|
-
${u ===
|
|
1014
|
+
${u === ve.right && `<path d="M30 12L40 12L40 16" stroke="${a ? "#FF2424" : "black"}" stroke-width="2"/>`}
|
|
1015
1015
|
<!--path黑线无左右-->
|
|
1016
|
-
${u ===
|
|
1016
|
+
${u === ve.front && `<path d="M30 12L40 12" stroke="${a ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1017
1017
|
</svg>
|
|
1018
1018
|
`;
|
|
1019
1019
|
case "ship":
|
|
1020
1020
|
return `<svg width="97" height="20" viewBox="0 0 97 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1021
1021
|
<path d="M0.289474 17.3433L0.289474 2.65655C0.289474 2.28572 0.574654 1.97725 0.944343 1.9482L22.0544 0.289473L67.5204 0.289473C67.6295 0.289473 67.7372 0.314613 67.835 0.362943L86.0565 9.3629C86.5844 9.6236 86.5844 10.3763 86.0565 10.637L67.835 19.6371C67.7372 19.6854 67.6295 19.7105 67.5203 19.7105L22.0544 19.7105L0.944343 18.0517C0.574653 18.0226 0.289474 17.7142 0.289474 17.3433Z"
|
|
1022
1022
|
fill="${r}" stroke="${a ? "#FF2424" : "black"}" stroke-width="${a ? "4" : "0.578947"}"/>
|
|
1023
|
-
${u ===
|
|
1024
|
-
${u ===
|
|
1025
|
-
${u ===
|
|
1023
|
+
${u === ve.left && `<path d="M86 10L96 10L96 6" stroke="${a ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1024
|
+
${u === ve.right && `<path d="M86 10L96 10L96 14" stroke="${a ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1025
|
+
${u === ve.front && `<path d="M86 10L96 10" stroke="${a ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1026
1026
|
</svg>
|
|
1027
1027
|
`;
|
|
1028
1028
|
default:
|
|
@@ -1030,15 +1030,15 @@ const rt = (e, l, s) => {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
1032
|
}, Be = /* @__PURE__ */ new Map();
|
|
1033
|
-
function
|
|
1034
|
-
const s =
|
|
1033
|
+
function Po(e, l) {
|
|
1034
|
+
const s = it(l), r = st(l, e, s);
|
|
1035
1035
|
return `${s}_${r}_${s === "ship" ? 109 : 49}`;
|
|
1036
1036
|
}
|
|
1037
1037
|
const St = (e, l) => {
|
|
1038
|
-
const s =
|
|
1038
|
+
const s = Po(l, e);
|
|
1039
1039
|
if (Be.has(s))
|
|
1040
1040
|
return Be.get(s);
|
|
1041
|
-
const r =
|
|
1041
|
+
const r = it(e), u = st(e, l, r), a = r === "ship" ? 109 : 49, n = `
|
|
1042
1042
|
<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 49 49" fill="none">
|
|
1043
1043
|
<path d="M1.99982 46.9998L1.99982 1.99982L46.9998 1.99982L46.9998 46.9998L1.99982 46.9998Z" fill="#FF2424" fill-opacity="0.2"/>
|
|
1044
1044
|
<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"/>
|
|
@@ -1053,9 +1053,9 @@ const St = (e, l) => {
|
|
|
1053
1053
|
});
|
|
1054
1054
|
return Be.set(s, c), c;
|
|
1055
1055
|
};
|
|
1056
|
-
function
|
|
1056
|
+
function Fo(e, l, s, r) {
|
|
1057
1057
|
if (l) {
|
|
1058
|
-
const u = new
|
|
1058
|
+
const u = new pe({
|
|
1059
1059
|
element: s,
|
|
1060
1060
|
positioning: "top-left",
|
|
1061
1061
|
id: "label-" + (r == null ? void 0 : r.id),
|
|
@@ -1068,15 +1068,15 @@ function Po(e, l, s, r) {
|
|
|
1068
1068
|
u.set("class", "zh-map-ship-overlay"), e.addOverlay(u);
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
const
|
|
1071
|
+
const So = (e, l) => {
|
|
1072
1072
|
const { lon: s, lat: r, blinking: u } = l, a = Zt(l);
|
|
1073
|
-
s && r &&
|
|
1073
|
+
s && r && Fo(e, he([s, r]), a, { ...l, blinking: u });
|
|
1074
1074
|
}, Zt = (e) => {
|
|
1075
1075
|
const l = document.createElement("div");
|
|
1076
1076
|
l.className = "ship-overlay-box", l.style.position = "relative";
|
|
1077
|
-
const { lon: s, lat: r, blinking: u, blinkingColors: a, name: n } = e, c =
|
|
1077
|
+
const { lon: s, lat: r, blinking: u, blinkingColors: a, name: n } = e, c = ht({
|
|
1078
1078
|
setup() {
|
|
1079
|
-
return
|
|
1079
|
+
return Mo({
|
|
1080
1080
|
id: e == null ? void 0 : e.id,
|
|
1081
1081
|
selected: u,
|
|
1082
1082
|
name: n,
|
|
@@ -1092,7 +1092,7 @@ const Fo = (e, l) => {
|
|
|
1092
1092
|
const l = [];
|
|
1093
1093
|
return e.existDevice && l.push(""), e.existMobile && l.push(""), e.existWaterGauge && l.push(""), l;
|
|
1094
1094
|
};
|
|
1095
|
-
function
|
|
1095
|
+
function No() {
|
|
1096
1096
|
const e = [
|
|
1097
1097
|
"left-top",
|
|
1098
1098
|
"left-middle",
|
|
@@ -1103,64 +1103,64 @@ function So() {
|
|
|
1103
1103
|
];
|
|
1104
1104
|
return e[Math.floor(Math.random() * e.length)];
|
|
1105
1105
|
}
|
|
1106
|
-
const
|
|
1107
|
-
let We = null,
|
|
1108
|
-
function
|
|
1106
|
+
const Ro = window.devicePixelRatio || 1, gt = /* @__PURE__ */ new Map();
|
|
1107
|
+
let We = null, ft = null;
|
|
1108
|
+
function $o(e, l, s = "left-bottom", r = 10) {
|
|
1109
1109
|
const u = `${e}-${l.join(",")}-${s}-${r}`;
|
|
1110
|
-
if (
|
|
1111
|
-
return
|
|
1110
|
+
if (gt.has(u))
|
|
1111
|
+
return gt.get(u);
|
|
1112
1112
|
if (!We) {
|
|
1113
1113
|
We = document.createElement("canvas");
|
|
1114
1114
|
try {
|
|
1115
|
-
|
|
1115
|
+
ft = We.getContext("2d", {
|
|
1116
1116
|
willReadFrequently: !0
|
|
1117
1117
|
});
|
|
1118
1118
|
} catch {
|
|
1119
|
-
|
|
1119
|
+
ft = We.getContext("2d");
|
|
1120
1120
|
}
|
|
1121
1121
|
}
|
|
1122
|
-
const a = We, n =
|
|
1122
|
+
const a = We, n = ft;
|
|
1123
1123
|
if (!n) return "";
|
|
1124
1124
|
a.width = 0, a.height = 0;
|
|
1125
1125
|
const c = 2, w = 4, L = 16, t = window.devicePixelRatio || 1, o = "500 12px Arial", y = "12px map-iconfont";
|
|
1126
1126
|
n.font = o;
|
|
1127
1127
|
const Z = n.measureText(e).width;
|
|
1128
1128
|
n.font = y;
|
|
1129
|
-
const
|
|
1130
|
-
let M, A, z = 0, _ = 0, ee = 0, V = 0,
|
|
1129
|
+
const C = l.map((B) => ({ width: n.measureText(Te(B)).width, height: 14 })), i = C.reduce((B, ne) => B + ne.width, 0), g = l.length * r, b = w + Z + i + g + w, h = c + 14 + c * 2;
|
|
1130
|
+
let M, A, z = 0, _ = 0, ee = 0, V = 0, p = 0, F = 0;
|
|
1131
1131
|
switch (M = L + b, s) {
|
|
1132
1132
|
case "right-top":
|
|
1133
|
-
A = L + h, z = 0, _ = L + h, ee = L, V = 0,
|
|
1133
|
+
A = L + h, z = 0, _ = L + h, ee = L, V = 0, p = L, F = 0;
|
|
1134
1134
|
break;
|
|
1135
1135
|
case "right-middle":
|
|
1136
|
-
A = h, z = 0, _ = h / 2, ee = L, V = h / 2,
|
|
1136
|
+
A = h, z = 0, _ = h / 2, ee = L, V = h / 2, p = L, F = 0;
|
|
1137
1137
|
break;
|
|
1138
1138
|
case "right-bottom":
|
|
1139
|
-
A = L + h, z = 0, _ = 0, ee = L, V = L,
|
|
1139
|
+
A = L + h, z = 0, _ = 0, ee = L, V = L, p = L, F = L;
|
|
1140
1140
|
break;
|
|
1141
1141
|
case "left-top":
|
|
1142
|
-
A = L + h, z = b, _ = L, ee = b + L, V = h + L,
|
|
1142
|
+
A = L + h, z = b, _ = L, ee = b + L, V = h + L, p = 0, F = 0;
|
|
1143
1143
|
break;
|
|
1144
1144
|
case "left-middle":
|
|
1145
|
-
A = h, z = b, _ = h / 2, ee = b + L, V = h / 2,
|
|
1145
|
+
A = h, z = b, _ = h / 2, ee = b + L, V = h / 2, p = 0, F = 0;
|
|
1146
1146
|
break;
|
|
1147
1147
|
case "left-bottom":
|
|
1148
|
-
A = L + h, z = b, _ = h, ee = b + L, V = 0,
|
|
1148
|
+
A = L + h, z = b, _ = h, ee = b + L, V = 0, p = 0, F = L;
|
|
1149
1149
|
break;
|
|
1150
1150
|
}
|
|
1151
|
-
A = A + c, a.width = Math.round(M * t), a.height = Math.round(A * t), n.scale(t, t), n.clearRect(0, 0, M, A), n.beginPath(), n.moveTo(z, _), n.lineTo(ee, V), n.strokeStyle = "#FFF", n.lineWidth = 1, n.stroke(), n.fillStyle = "#FFF", n.fillRect(
|
|
1151
|
+
A = A + c, a.width = Math.round(M * t), a.height = Math.round(A * t), n.scale(t, t), n.clearRect(0, 0, M, A), n.beginPath(), n.moveTo(z, _), n.lineTo(ee, V), n.strokeStyle = "#FFF", n.lineWidth = 1, n.stroke(), n.fillStyle = "#FFF", n.fillRect(p, F, b, h), n.font = o, n.textBaseline = "middle";
|
|
1152
1152
|
const G = F + c / 2 + h / 2;
|
|
1153
|
-
n.strokeStyle = "#ffffff", n.lineWidth = 1, n.strokeText(e,
|
|
1154
|
-
let D =
|
|
1153
|
+
n.strokeStyle = "#ffffff", n.lineWidth = 1, n.strokeText(e, p + w, G), n.fillStyle = "#000000", n.fillText(e, p + w, G), n.font = y, n.fillStyle = "#3370ff";
|
|
1154
|
+
let D = p + w + Z + r;
|
|
1155
1155
|
const X = F + h / 2;
|
|
1156
1156
|
l.length > 0 && l.forEach((B, ne) => {
|
|
1157
|
-
n.fillText(Te(B), D, X), D +=
|
|
1157
|
+
n.fillText(Te(B), D, X), D += C[ne].width + r;
|
|
1158
1158
|
});
|
|
1159
1159
|
const q = a.toDataURL("image/png");
|
|
1160
|
-
return
|
|
1160
|
+
return gt.set(u, q), q;
|
|
1161
1161
|
}
|
|
1162
1162
|
const Rt = (e, l) => {
|
|
1163
|
-
const { name: s, rightIcons: r, selected: u } = e.getProperties(), a = l !== 1 ?
|
|
1163
|
+
const { name: s, rightIcons: r, selected: u } = e.getProperties(), a = l !== 1 ? No() : "right-top", n = $o(s, r, a);
|
|
1164
1164
|
let c = [0, 0];
|
|
1165
1165
|
switch (a) {
|
|
1166
1166
|
case "right-top":
|
|
@@ -1187,36 +1187,36 @@ const Rt = (e, l) => {
|
|
|
1187
1187
|
src: n,
|
|
1188
1188
|
anchor: c,
|
|
1189
1189
|
displacement: [0, 0],
|
|
1190
|
-
scale: 1 /
|
|
1190
|
+
scale: 1 / Ro,
|
|
1191
1191
|
anchorXUnits: "fraction",
|
|
1192
1192
|
anchorYUnits: "fraction"
|
|
1193
1193
|
}),
|
|
1194
1194
|
zIndex: u ? 100 : 10
|
|
1195
1195
|
});
|
|
1196
|
-
},
|
|
1196
|
+
}, zo = (e) => {
|
|
1197
1197
|
e.getInteractions().forEach((l) => {
|
|
1198
1198
|
l instanceof yt && l.setActive(!1);
|
|
1199
1199
|
});
|
|
1200
|
-
},
|
|
1200
|
+
}, Vo = (e) => {
|
|
1201
1201
|
e.getInteractions().forEach((l) => {
|
|
1202
1202
|
l instanceof yt && l.setActive(!0);
|
|
1203
1203
|
});
|
|
1204
1204
|
}, Me = (e, l) => {
|
|
1205
1205
|
const s = e.getViewport();
|
|
1206
1206
|
s && (s.style.cursor = l);
|
|
1207
|
-
},
|
|
1207
|
+
}, Oo = (e, l) => {
|
|
1208
1208
|
const s = fe([]), r = fe("km"), u = (V) => {
|
|
1209
1209
|
r.value = V;
|
|
1210
1210
|
};
|
|
1211
1211
|
let a, n = "close";
|
|
1212
1212
|
const c = () => {
|
|
1213
|
-
Me(e, "crosshair"), t(),
|
|
1213
|
+
Me(e, "crosshair"), t(), zo(e), e.on("pointermove", N), e.getViewport().addEventListener("mouseout", () => {
|
|
1214
1214
|
a && a.classList.add("hidden");
|
|
1215
|
-
}),
|
|
1215
|
+
}), C(), n = "open";
|
|
1216
1216
|
};
|
|
1217
1217
|
let w, L;
|
|
1218
1218
|
const t = () => {
|
|
1219
|
-
w = new be(), L = new
|
|
1219
|
+
w = new be(), L = new Ce({
|
|
1220
1220
|
source: w,
|
|
1221
1221
|
zIndex: 1e3,
|
|
1222
1222
|
style: {
|
|
@@ -1232,11 +1232,11 @@ const Rt = (e, l) => {
|
|
|
1232
1232
|
const N = (V) => {
|
|
1233
1233
|
if (V.dragging)
|
|
1234
1234
|
return;
|
|
1235
|
-
let
|
|
1236
|
-
o && (
|
|
1235
|
+
let p = "点击选择起点";
|
|
1236
|
+
o && (p = "单击继续,双击结束"), a && (a.innerHTML = p, y.setPosition(V.coordinate), a.classList.remove("hidden"));
|
|
1237
1237
|
};
|
|
1238
1238
|
let Z;
|
|
1239
|
-
const
|
|
1239
|
+
const C = () => {
|
|
1240
1240
|
Z = new et({
|
|
1241
1241
|
source: w,
|
|
1242
1242
|
type: "LineString",
|
|
@@ -1249,7 +1249,7 @@ const Rt = (e, l) => {
|
|
|
1249
1249
|
lineDash: [10, 10],
|
|
1250
1250
|
width: 2
|
|
1251
1251
|
}),
|
|
1252
|
-
image: new
|
|
1252
|
+
image: new rt({
|
|
1253
1253
|
radius: 5,
|
|
1254
1254
|
stroke: new Pe({
|
|
1255
1255
|
color: "rgba(0, 0, 0, 0.7)"
|
|
@@ -1260,37 +1260,37 @@ const Rt = (e, l) => {
|
|
|
1260
1260
|
})
|
|
1261
1261
|
}),
|
|
1262
1262
|
// 添加条件函数,判断是否应该出发点绘制
|
|
1263
|
-
condition: (
|
|
1264
|
-
const F =
|
|
1263
|
+
condition: (p) => {
|
|
1264
|
+
const F = p.originalEvent.target;
|
|
1265
1265
|
return F.className !== "ol-tooltip-measure" && F.className !== "ol-tooltip-delete-button";
|
|
1266
1266
|
}
|
|
1267
1267
|
}), e == null || e.addInteraction(Z), h(), M();
|
|
1268
1268
|
let V;
|
|
1269
|
-
Z.on("drawstart", function(
|
|
1269
|
+
Z.on("drawstart", function(p) {
|
|
1270
1270
|
var G;
|
|
1271
|
-
o =
|
|
1271
|
+
o = p.feature, o.set("randomId", i());
|
|
1272
1272
|
let F;
|
|
1273
1273
|
V = (G = o.getGeometry()) == null ? void 0 : G.on("change", function(D) {
|
|
1274
1274
|
const X = D.target, q = Dt(X, r.value);
|
|
1275
1275
|
F = X.getLastCoordinate(), g && q && (g.innerHTML = q), b.setPosition(F);
|
|
1276
1276
|
});
|
|
1277
1277
|
}), Z.on("drawend", function() {
|
|
1278
|
-
var
|
|
1278
|
+
var p, F, G;
|
|
1279
1279
|
if (g && (g.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), g != null && g.innerHTML) {
|
|
1280
1280
|
const D = (o == null ? void 0 : o.get("randomId")) || i();
|
|
1281
1281
|
s.value.push({ id: D, value: g == null ? void 0 : g.innerHTML }), g.innerHTML = `${g.innerHTML}<div class="ol-tooltip-delete-button" data-id="${D}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
1282
1282
|
}
|
|
1283
|
-
(
|
|
1283
|
+
(p = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || p.addEventListener("click", (D) => {
|
|
1284
1284
|
var q;
|
|
1285
1285
|
D.preventDefault(), D.stopPropagation();
|
|
1286
1286
|
const X = (q = D.target) == null ? void 0 : q.getAttribute("data-id");
|
|
1287
1287
|
X && z(X);
|
|
1288
|
-
}), b.setOffset([0, -7]), o = null, g = null, h(), V &&
|
|
1288
|
+
}), b.setOffset([0, -7]), o = null, g = null, h(), V && mt(V), (G = (F = l.getProps()) == null ? void 0 : F.lineDrawEnd) == null || G.call(F, s.value), a.innerHTML = "";
|
|
1289
1289
|
});
|
|
1290
1290
|
}, i = () => Math.random().toString(36).substring(2, 9);
|
|
1291
1291
|
let g, b;
|
|
1292
1292
|
const h = () => {
|
|
1293
|
-
g != null && g.parentNode && g.parentNode.removeChild(g), g = document.createElement("div"), g.className = "ol-tooltip ol-tooltip-measure", b = new
|
|
1293
|
+
g != null && g.parentNode && g.parentNode.removeChild(g), g = document.createElement("div"), g.className = "ol-tooltip ol-tooltip-measure", b = new pe({
|
|
1294
1294
|
element: g,
|
|
1295
1295
|
offset: [0, -15],
|
|
1296
1296
|
positioning: "bottom-center",
|
|
@@ -1298,37 +1298,37 @@ const Rt = (e, l) => {
|
|
|
1298
1298
|
insertFirst: !1
|
|
1299
1299
|
}), e == null || e.addOverlay(b);
|
|
1300
1300
|
}, M = () => {
|
|
1301
|
-
a != null && a.parentNode && a.parentNode.removeChild(a), a = document.createElement("div"), a.className = "ol-tooltip hidden", y = new
|
|
1301
|
+
a != null && a.parentNode && a.parentNode.removeChild(a), a = document.createElement("div"), a.className = "ol-tooltip hidden", y = new pe({
|
|
1302
1302
|
element: a,
|
|
1303
1303
|
offset: [15, 0],
|
|
1304
1304
|
positioning: "center-left",
|
|
1305
1305
|
stopEvent: !1
|
|
1306
1306
|
}), e == null || e.addOverlay(y);
|
|
1307
1307
|
}, A = () => {
|
|
1308
|
-
s.value.forEach((V,
|
|
1308
|
+
s.value.forEach((V, p) => {
|
|
1309
1309
|
var D, X;
|
|
1310
1310
|
const F = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1311
|
-
F[
|
|
1311
|
+
F[p] && ((X = (D = F[p]) == null ? void 0 : D.parentNode) == null || X.removeChild(F[p]));
|
|
1312
1312
|
const G = w.getFeatures();
|
|
1313
|
-
G[
|
|
1314
|
-
}), _(),
|
|
1313
|
+
G[p] && w.removeFeature(G[p]);
|
|
1314
|
+
}), _(), Vo(e), n = "close", Me(e, "grab");
|
|
1315
1315
|
}, z = (V) => {
|
|
1316
1316
|
var F, G, D, X;
|
|
1317
|
-
const
|
|
1318
|
-
if (
|
|
1319
|
-
s.value.splice(
|
|
1317
|
+
const p = s.value.findIndex((q) => q.id === V);
|
|
1318
|
+
if (p !== -1) {
|
|
1319
|
+
s.value.splice(p, 1);
|
|
1320
1320
|
const q = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1321
|
-
q[
|
|
1321
|
+
q[p] && ((G = (F = q[p]) == null ? void 0 : F.parentNode) == null || G.removeChild(q[p]));
|
|
1322
1322
|
const B = w.getFeatures();
|
|
1323
|
-
B[
|
|
1323
|
+
B[p] && w.removeFeature(B[p]);
|
|
1324
1324
|
}
|
|
1325
1325
|
(X = (D = l.getProps()) == null ? void 0 : D.lineDrawEnd) == null || X.call(D, s.value);
|
|
1326
1326
|
}, _ = () => {
|
|
1327
1327
|
if (s.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((V) => {
|
|
1328
|
-
var
|
|
1329
|
-
(
|
|
1328
|
+
var p;
|
|
1329
|
+
(p = V == null ? void 0 : V.parentNode) == null || p.removeChild(V);
|
|
1330
1330
|
}), w == null || w.clear(), Z) {
|
|
1331
|
-
const V = e.getInteractions().getArray().find((
|
|
1331
|
+
const V = e.getInteractions().getArray().find((p) => Lt(p) === Lt(Z));
|
|
1332
1332
|
V && e.removeInteraction(V);
|
|
1333
1333
|
}
|
|
1334
1334
|
e.removeLayer(L), a != null && a.parentNode && a.parentNode.removeChild(a), g != null && g.parentNode && g.parentNode.removeChild(g);
|
|
@@ -1355,7 +1355,7 @@ const Rt = (e, l) => {
|
|
|
1355
1355
|
break;
|
|
1356
1356
|
}
|
|
1357
1357
|
return u;
|
|
1358
|
-
},
|
|
1358
|
+
}, Ao = (e, l) => {
|
|
1359
1359
|
let s, r, u = "close";
|
|
1360
1360
|
const a = () => {
|
|
1361
1361
|
_(), u = "open", n(), Me(e, "crosshair");
|
|
@@ -1365,7 +1365,7 @@ const Rt = (e, l) => {
|
|
|
1365
1365
|
let c = null, w = null;
|
|
1366
1366
|
const L = () => {
|
|
1367
1367
|
if (c && w) return;
|
|
1368
|
-
const V = new be(),
|
|
1368
|
+
const V = new be(), p = new Ce({
|
|
1369
1369
|
source: V,
|
|
1370
1370
|
style: new oe({
|
|
1371
1371
|
stroke: new Pe({
|
|
@@ -1375,27 +1375,27 @@ const Rt = (e, l) => {
|
|
|
1375
1375
|
}),
|
|
1376
1376
|
zIndex: 1e3
|
|
1377
1377
|
});
|
|
1378
|
-
c =
|
|
1378
|
+
c = p, w = V, e.on("pointermove", o), e.addLayer(p), e.on(["dblclick"], function(F) {
|
|
1379
1379
|
y && (F.stopPropagation(), F.preventDefault());
|
|
1380
1380
|
});
|
|
1381
1381
|
};
|
|
1382
1382
|
let t;
|
|
1383
1383
|
const o = (V) => {
|
|
1384
1384
|
if (V.dragging) return;
|
|
1385
|
-
const
|
|
1386
|
-
h && (h.innerHTML =
|
|
1385
|
+
const p = t ? "单击继续,双击结束" : "点击选择起点";
|
|
1386
|
+
h && (h.innerHTML = p, M.setPosition(V.coordinate));
|
|
1387
1387
|
};
|
|
1388
1388
|
let y, N = !1;
|
|
1389
1389
|
const Z = () => {
|
|
1390
1390
|
if (s) {
|
|
1391
1391
|
h != null && h.parentNode && h.parentNode.removeChild(h);
|
|
1392
|
-
const
|
|
1393
|
-
if (!
|
|
1394
|
-
const F = p
|
|
1392
|
+
const p = s.getGeometry();
|
|
1393
|
+
if (!p) return;
|
|
1394
|
+
const F = C(p, "nm");
|
|
1395
1395
|
i && (i.innerHTML = `
|
|
1396
1396
|
<span class="text">面积:${F}${N ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1397
1397
|
`), i && (i.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
|
|
1398
|
-
const G =
|
|
1398
|
+
const G = p.getCoordinates(), D = G[0][G[0].length - 2];
|
|
1399
1399
|
if (g.setPosition(D), c) {
|
|
1400
1400
|
const q = c.getSource();
|
|
1401
1401
|
q && s && (q.clear(), q.addFeature(s));
|
|
@@ -1407,7 +1407,7 @@ const Rt = (e, l) => {
|
|
|
1407
1407
|
z(), (ne = (B = l.getProps()) == null ? void 0 : B.areaDrawEnd) == null || ne.call(B, []);
|
|
1408
1408
|
});
|
|
1409
1409
|
}, 0);
|
|
1410
|
-
const X =
|
|
1410
|
+
const X = oo(s.getGeometry().getExtent());
|
|
1411
1411
|
e == null || e.getView().setCenter(X);
|
|
1412
1412
|
return;
|
|
1413
1413
|
}
|
|
@@ -1424,22 +1424,22 @@ const Rt = (e, l) => {
|
|
|
1424
1424
|
color: "rgba(255, 255, 255, 0.25)"
|
|
1425
1425
|
})
|
|
1426
1426
|
}), new oe({
|
|
1427
|
-
image: new
|
|
1427
|
+
image: new rt({
|
|
1428
1428
|
radius: 5,
|
|
1429
1429
|
fill: new ge({
|
|
1430
1430
|
color: "rgb(51,112,255, 1)"
|
|
1431
1431
|
})
|
|
1432
1432
|
}),
|
|
1433
|
-
geometry: function(
|
|
1434
|
-
const F =
|
|
1435
|
-
return new
|
|
1433
|
+
geometry: function(p) {
|
|
1434
|
+
const F = p.getGeometry().getCoordinates();
|
|
1435
|
+
return new no(F);
|
|
1436
1436
|
}
|
|
1437
1437
|
})]
|
|
1438
1438
|
};
|
|
1439
|
-
V.source = w, y = new et(V), e == null || e.addInteraction(y), y.on("drawstart", (
|
|
1439
|
+
V.source = w, y = new et(V), e == null || e.addInteraction(y), y.on("drawstart", (p) => {
|
|
1440
1440
|
var F;
|
|
1441
|
-
t =
|
|
1442
|
-
const D = G.target, X =
|
|
1441
|
+
t = p.feature, r = (F = t.getGeometry()) == null ? void 0 : F.on("change", (G) => {
|
|
1442
|
+
const D = G.target, X = C(D, "nm"), B = D.getCoordinates()[0], ne = new Ge([B[B.length - 2], B[B.length - 1]]), ke = Dt(ne, "nm");
|
|
1443
1443
|
if (N = Number(wt(ne) / 1e3) > 150, !X) return;
|
|
1444
1444
|
const ce = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1445
1445
|
i && (i.innerHTML = `
|
|
@@ -1460,25 +1460,25 @@ const Rt = (e, l) => {
|
|
|
1460
1460
|
</div>
|
|
1461
1461
|
`);
|
|
1462
1462
|
});
|
|
1463
|
-
}), y.on("drawend", (
|
|
1463
|
+
}), y.on("drawend", (p) => {
|
|
1464
1464
|
var q, B, ne, ke;
|
|
1465
|
-
if (!
|
|
1466
|
-
i && !s && (i.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), s =
|
|
1467
|
-
const D =
|
|
1465
|
+
if (!p.feature.getGeometry()) return;
|
|
1466
|
+
i && !s && (i.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), s = p.feature, g.setOffset([10, 0]);
|
|
1467
|
+
const D = p.feature.getGeometry().getCoordinates(), X = D[0][D[0].length - 2];
|
|
1468
1468
|
if (g.setPosition(X), h != null && h.parentNode && h.parentNode.removeChild(h), (q = l.getProps()) != null && q.areaDrawEnd) {
|
|
1469
1469
|
const ce = D[0].map((ae) => Xe(ae, ie.mercator, ie.data));
|
|
1470
1470
|
(ne = (B = l.getProps()) == null ? void 0 : B.areaDrawEnd) == null || ne.call(B, ce);
|
|
1471
1471
|
}
|
|
1472
1472
|
y && (y.setActive(!1), e == null || e.removeInteraction(y), (e == null ? void 0 : e.getInteractions()).forEach((ae) => {
|
|
1473
1473
|
ae instanceof et && (ae.setActive(!1), e == null || e.removeInteraction(ae));
|
|
1474
|
-
})), r &&
|
|
1474
|
+
})), r && mt(r), (ke = document.querySelector(".delete-icon")) == null || ke.addEventListener("click", () => {
|
|
1475
1475
|
var ce, ae;
|
|
1476
1476
|
z(), (ae = (ce = l.getProps()) == null ? void 0 : ce.areaDrawEnd) == null || ae.call(ce, []);
|
|
1477
1477
|
});
|
|
1478
1478
|
});
|
|
1479
|
-
},
|
|
1480
|
-
const F =
|
|
1481
|
-
switch (
|
|
1479
|
+
}, C = (V, p) => {
|
|
1480
|
+
const F = ro(V);
|
|
1481
|
+
switch (p) {
|
|
1482
1482
|
case "km":
|
|
1483
1483
|
return F > 1e4 ? Math.round(F / 1e6 * 100) / 100 + " km<sup>2</sup>" : Math.round(F * 100) / 100 + " m<sup>2</sup>";
|
|
1484
1484
|
case "nm": {
|
|
@@ -1491,7 +1491,7 @@ const Rt = (e, l) => {
|
|
|
1491
1491
|
};
|
|
1492
1492
|
let i, g;
|
|
1493
1493
|
const b = () => {
|
|
1494
|
-
i != null && i.parentNode && i.parentNode.removeChild(i), i = document.createElement("div"), i.style.display = "flex", i.className = "ol-tooltip ol-tooltip-draw-polygon", g = new
|
|
1494
|
+
i != null && i.parentNode && i.parentNode.removeChild(i), i = document.createElement("div"), i.style.display = "flex", i.className = "ol-tooltip ol-tooltip-draw-polygon", g = new pe({
|
|
1495
1495
|
element: i,
|
|
1496
1496
|
offset: [0, -15],
|
|
1497
1497
|
positioning: "bottom-center",
|
|
@@ -1503,7 +1503,7 @@ const Rt = (e, l) => {
|
|
|
1503
1503
|
const A = () => {
|
|
1504
1504
|
h != null && h.parentNode && (h.parentNode.removeChild(h), h.parentNode.addEventListener("click", (V) => {
|
|
1505
1505
|
V.preventDefault(), V.stopPropagation();
|
|
1506
|
-
})), h = document.createElement("div"), h.className = "ol-tooltip ol-help-tooltip pointer-none", M = new
|
|
1506
|
+
})), h = document.createElement("div"), h.className = "ol-tooltip ol-help-tooltip pointer-none", M = new pe({
|
|
1507
1507
|
element: h,
|
|
1508
1508
|
offset: [15, 0],
|
|
1509
1509
|
positioning: "center-left",
|
|
@@ -1512,9 +1512,9 @@ const Rt = (e, l) => {
|
|
|
1512
1512
|
}, z = () => {
|
|
1513
1513
|
s = null, a();
|
|
1514
1514
|
}, _ = () => {
|
|
1515
|
-
u = "close", e.un("pointermove", o), t = null, y && (y.abortDrawing(), console.log("abortDrawing"), y.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((
|
|
1516
|
-
|
|
1517
|
-
}), y = null), r &&
|
|
1515
|
+
u = "close", e.un("pointermove", o), t = null, y && (y.abortDrawing(), console.log("abortDrawing"), y.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((p) => {
|
|
1516
|
+
p instanceof et && (p.setActive(!1), e == null || e.removeInteraction(p));
|
|
1517
|
+
}), y = null), r && mt(r), r = void 0, w == null || w.clear(), w = null, c && e.getAllLayers().includes(c) && (e.removeLayer(c), c = null), h != null && h.parentElement && (h.innerHTML = "", h.parentElement.removeChild(h), h = null), i != null && i.parentElement && (i.innerHTML = "", i.parentElement.removeChild(i), i = null), M && e.removeOverlay(M), g && e.removeOverlay(g), Me(e, "grab");
|
|
1518
1518
|
};
|
|
1519
1519
|
return {
|
|
1520
1520
|
open: a,
|
|
@@ -1522,15 +1522,15 @@ const Rt = (e, l) => {
|
|
|
1522
1522
|
reset: z,
|
|
1523
1523
|
getState: () => u
|
|
1524
1524
|
};
|
|
1525
|
-
},
|
|
1525
|
+
}, Zo = (e, l, s, r, u, a) => {
|
|
1526
1526
|
let n = null, c = null;
|
|
1527
|
-
const w = new be(), L = new
|
|
1527
|
+
const w = new be(), L = new lo({
|
|
1528
1528
|
source: w,
|
|
1529
1529
|
className: "zh-map--ship-layer",
|
|
1530
1530
|
renderBuffer: 300,
|
|
1531
1531
|
zIndex: 101,
|
|
1532
1532
|
properties: { layerType: le.SHIP }
|
|
1533
|
-
}), t = new be(), o = new
|
|
1533
|
+
}), t = new be(), o = new Ce({
|
|
1534
1534
|
source: t,
|
|
1535
1535
|
className: "zh-map--ship-label-layer",
|
|
1536
1536
|
zIndex: 102,
|
|
@@ -1538,13 +1538,13 @@ const Rt = (e, l) => {
|
|
|
1538
1538
|
updateWhileAnimating: !1,
|
|
1539
1539
|
properties: { layerType: le.SHIP },
|
|
1540
1540
|
declutter: a
|
|
1541
|
-
}), y = new be(), N = new
|
|
1541
|
+
}), y = new be(), N = new Ce({
|
|
1542
1542
|
source: y,
|
|
1543
1543
|
className: "zh-map--ship-selected-layer",
|
|
1544
1544
|
zIndex: 999
|
|
1545
1545
|
});
|
|
1546
1546
|
e == null || e.addLayer(L), e == null || e.addLayer(o), e == null || e.addLayer(N);
|
|
1547
|
-
let Z = null,
|
|
1547
|
+
let Z = null, C = null, i = null, g = "", b = {}, h = {};
|
|
1548
1548
|
const M = (f) => {
|
|
1549
1549
|
if (!f || !e) return;
|
|
1550
1550
|
const S = (c == null ? void 0 : c.id) || (n == null ? void 0 : n.get("id"));
|
|
@@ -1552,7 +1552,7 @@ const Rt = (e, l) => {
|
|
|
1552
1552
|
const R = f.filter((H) => H.id === S);
|
|
1553
1553
|
R.length === 0 ? f.push(c) : c = R[0];
|
|
1554
1554
|
}
|
|
1555
|
-
|
|
1555
|
+
p(), ae(f), ee(), A(f);
|
|
1556
1556
|
}, A = (f) => {
|
|
1557
1557
|
Array.from(Ye.keys()).forEach((S) => {
|
|
1558
1558
|
const R = S.split("_")[0];
|
|
@@ -1564,7 +1564,7 @@ const Rt = (e, l) => {
|
|
|
1564
1564
|
});
|
|
1565
1565
|
}, _ = (f) => {
|
|
1566
1566
|
var $;
|
|
1567
|
-
const S = (c == null ? void 0 : c.id) || (n == null ? void 0 : n.get("id")), R = he([f == null ? void 0 : f.lon, f == null ? void 0 : f.lat]), H = (($ = h[f.id]) == null ? void 0 : $.blinkColors) || [], U = H[H.length - 1] || f.fill || "#04C900", te = At(f), Y = new
|
|
1567
|
+
const S = (c == null ? void 0 : c.id) || (n == null ? void 0 : n.get("id")), R = he([f == null ? void 0 : f.lon, f == null ? void 0 : f.lat]), H = (($ = h[f.id]) == null ? void 0 : $.blinkColors) || [], U = H[H.length - 1] || f.fill || "#04C900", te = At(f), Y = new me({
|
|
1568
1568
|
geometry: new ue(R),
|
|
1569
1569
|
// 船舶数据
|
|
1570
1570
|
shipData: f,
|
|
@@ -1580,11 +1580,11 @@ const Rt = (e, l) => {
|
|
|
1580
1580
|
// 高亮
|
|
1581
1581
|
isHighlight: !1
|
|
1582
1582
|
});
|
|
1583
|
-
return Y.set("clickGeometry", new
|
|
1583
|
+
return Y.set("clickGeometry", new so(R)), Y;
|
|
1584
1584
|
}, ee = () => {
|
|
1585
1585
|
if (c && e && c) {
|
|
1586
1586
|
y.getFeatures().length > 0 && y.clear();
|
|
1587
|
-
const f = he([c == null ? void 0 : c.lon, c == null ? void 0 : c.lat]), S = new
|
|
1587
|
+
const f = he([c == null ? void 0 : c.lon, c == null ? void 0 : c.lat]), S = new me({
|
|
1588
1588
|
geometry: new ue(f),
|
|
1589
1589
|
id: c.id
|
|
1590
1590
|
});
|
|
@@ -1607,7 +1607,7 @@ const Rt = (e, l) => {
|
|
|
1607
1607
|
const te = St(e, c);
|
|
1608
1608
|
U.setStyle(te);
|
|
1609
1609
|
}
|
|
1610
|
-
},
|
|
1610
|
+
}, p = () => {
|
|
1611
1611
|
e && w && (F(), w.clear(), t.clear(), y.clear());
|
|
1612
1612
|
}, F = () => {
|
|
1613
1613
|
const f = e.getOverlays().getArray().filter((S) => S.get("class") == "zh-map-ship-overlay");
|
|
@@ -1624,12 +1624,12 @@ const Rt = (e, l) => {
|
|
|
1624
1624
|
if (te && Y) {
|
|
1625
1625
|
const $ = S[J].blinkColors || [], { shipData: de, name: ye, color: xe } = Y.getProperties();
|
|
1626
1626
|
Y.set("blinking", U), $[($ == null ? void 0 : $.length) - 1] && xe !== $[($ == null ? void 0 : $.length) - 1] && (Y.set("color", $[($ == null ? void 0 : $.length) - 1] || ""), Y.setStyle($e(e, Y)));
|
|
1627
|
-
const
|
|
1627
|
+
const dt = {
|
|
1628
1628
|
...de,
|
|
1629
1629
|
blinking: U,
|
|
1630
1630
|
blinkingColors: $ || [],
|
|
1631
1631
|
name: ye + "(" + S[J].shipState + ")"
|
|
1632
|
-
}, _e = te.getElement(), Ke = Zt(
|
|
1632
|
+
}, _e = te.getElement(), Ke = Zt(dt);
|
|
1633
1633
|
_e && _e !== Ke && te.setElement(Ke);
|
|
1634
1634
|
}
|
|
1635
1635
|
}
|
|
@@ -1667,8 +1667,8 @@ const Rt = (e, l) => {
|
|
|
1667
1667
|
} else
|
|
1668
1668
|
console.log("取消选中"), c = null, n = null, ke(), z();
|
|
1669
1669
|
}, q = (f, S, R) => {
|
|
1670
|
-
|
|
1671
|
-
}, B =
|
|
1670
|
+
C = f, i = S, Z = R;
|
|
1671
|
+
}, B = io((f, S, R) => {
|
|
1672
1672
|
try {
|
|
1673
1673
|
if (f) {
|
|
1674
1674
|
const H = f.get("shipData"), J = f.get("id");
|
|
@@ -1692,7 +1692,7 @@ const Rt = (e, l) => {
|
|
|
1692
1692
|
console.log(f);
|
|
1693
1693
|
}
|
|
1694
1694
|
}, ce = (f, S) => {
|
|
1695
|
-
const R = he([f == null ? void 0 : f.lon, f == null ? void 0 : f.lat]), H = new
|
|
1695
|
+
const R = he([f == null ? void 0 : f.lon, f == null ? void 0 : f.lat]), H = new me({
|
|
1696
1696
|
geometry: new ue(R),
|
|
1697
1697
|
name: f.cnname || f.enname || f.name || f.id || "未命名船舶",
|
|
1698
1698
|
// 图标
|
|
@@ -1709,18 +1709,18 @@ const Rt = (e, l) => {
|
|
|
1709
1709
|
const $ = _(Y);
|
|
1710
1710
|
$.setStyle($e(e, $)), w.addFeature($), b[Y.id] && R.push(Y), (c == null ? void 0 : c.id) == Y.id && (c = Y), !b[Y.id] && (c == null ? void 0 : c.id) !== Y.id && H.push(Y);
|
|
1711
1711
|
}), (i !== null ? i : (c == null ? void 0 : c.id) && b[c == null ? void 0 : c.id] || S && S >= se.shipModelMin) && R.map((Y) => {
|
|
1712
|
-
|
|
1713
|
-
}), c && (Z !== null ? Z : !0) && !b[c == null ? void 0 : c.id] && qe(c, f), (
|
|
1712
|
+
at(Y);
|
|
1713
|
+
}), c && (Z !== null ? Z : !0) && !b[c == null ? void 0 : c.id] && qe(c, f), (C !== null ? C : S && S >= se.shipModelMin) && H.map((Y) => {
|
|
1714
1714
|
qe(Y, f);
|
|
1715
1715
|
});
|
|
1716
1716
|
}, qe = (f, S) => {
|
|
1717
1717
|
const R = ce(f, S.length);
|
|
1718
1718
|
t.addFeature(R);
|
|
1719
|
-
},
|
|
1719
|
+
}, ct = (f) => {
|
|
1720
1720
|
var R;
|
|
1721
1721
|
const S = w.getFeatures().find((H) => H.get("id") === f);
|
|
1722
1722
|
S && B(S, "click", (R = l.getProps()) == null ? void 0 : R.selectShip);
|
|
1723
|
-
},
|
|
1723
|
+
}, at = (f) => {
|
|
1724
1724
|
var S;
|
|
1725
1725
|
if (f.id && h[f == null ? void 0 : f.id]) {
|
|
1726
1726
|
const R = h[f == null ? void 0 : f.id] || {}, H = (R == null ? void 0 : R.blinkColors) || [], J = (R == null ? void 0 : R.shipState) || "", U = (f.cnname || f.enname || f.name || f.id || "未命名船舶") + "(" + J + ")", te = {
|
|
@@ -1729,11 +1729,11 @@ const Rt = (e, l) => {
|
|
|
1729
1729
|
blinking: b[f.id],
|
|
1730
1730
|
blinkingColors: H || []
|
|
1731
1731
|
};
|
|
1732
|
-
|
|
1732
|
+
So(e, te), (S = document.querySelector(".ship-label-overlay-blinking")) == null || S.addEventListener("click", (Y) => {
|
|
1733
1733
|
var de;
|
|
1734
1734
|
if (r.getState() === "open" || u.getState() === "open" || !s.getMapClick()) return;
|
|
1735
1735
|
const $ = (de = Y.target) == null ? void 0 : de.getAttribute("data-id");
|
|
1736
|
-
Y.preventDefault(), $ &&
|
|
1736
|
+
Y.preventDefault(), $ && ct($);
|
|
1737
1737
|
});
|
|
1738
1738
|
}
|
|
1739
1739
|
};
|
|
@@ -1742,12 +1742,12 @@ const Rt = (e, l) => {
|
|
|
1742
1742
|
selected: X,
|
|
1743
1743
|
filter: D,
|
|
1744
1744
|
blinking: G,
|
|
1745
|
-
clear:
|
|
1745
|
+
clear: p,
|
|
1746
1746
|
setLableStatus: q,
|
|
1747
1747
|
handleShipMapEvent: B,
|
|
1748
1748
|
changeShipScale: V
|
|
1749
1749
|
};
|
|
1750
|
-
},
|
|
1750
|
+
}, Do = (e) => {
|
|
1751
1751
|
const l = () => e == null ? void 0 : e.getLayers(), s = fe("vector"), r = () => s.value, u = (w) => {
|
|
1752
1752
|
s.value = w;
|
|
1753
1753
|
const L = l();
|
|
@@ -1781,7 +1781,7 @@ const Rt = (e, l) => {
|
|
|
1781
1781
|
getShowLayerType: r,
|
|
1782
1782
|
setShowLayerType: u
|
|
1783
1783
|
};
|
|
1784
|
-
},
|
|
1784
|
+
}, Ho = (e) => {
|
|
1785
1785
|
const l = "zh-map-location-layer";
|
|
1786
1786
|
let s;
|
|
1787
1787
|
const r = new be();
|
|
@@ -1794,14 +1794,14 @@ const Rt = (e, l) => {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
i.forEach((g) => {
|
|
1796
1796
|
c(g);
|
|
1797
|
-
}), s || (s = new
|
|
1797
|
+
}), s || (s = new Ce({
|
|
1798
1798
|
className: l,
|
|
1799
1799
|
source: r,
|
|
1800
1800
|
zIndex: 100
|
|
1801
1801
|
}), e == null || e.addLayer(s));
|
|
1802
1802
|
}
|
|
1803
1803
|
}, c = (i) => {
|
|
1804
|
-
const g = e == null ? void 0 : e.getView().getZoom(), [b, h] = i.latLon.split(","), M = new
|
|
1804
|
+
const g = e == null ? void 0 : e.getView().getZoom(), [b, h] = i.latLon.split(","), M = new me({
|
|
1805
1805
|
geometry: new ue(he([Number(b), Number(h)]))
|
|
1806
1806
|
});
|
|
1807
1807
|
M.setStyle(w(i, g, i.id === (a == null ? void 0 : a.id))), M.set("loactionData", i), r.addFeature(M);
|
|
@@ -1879,7 +1879,7 @@ const Rt = (e, l) => {
|
|
|
1879
1879
|
...A,
|
|
1880
1880
|
...h
|
|
1881
1881
|
});
|
|
1882
|
-
const z = new
|
|
1882
|
+
const z = new pe(A);
|
|
1883
1883
|
z.setPosition(he(g)), e.addOverlay(z);
|
|
1884
1884
|
},
|
|
1885
1885
|
removeHtml: (i) => {
|
|
@@ -1890,9 +1890,9 @@ const Rt = (e, l) => {
|
|
|
1890
1890
|
clearSelected: t,
|
|
1891
1891
|
clear: L
|
|
1892
1892
|
};
|
|
1893
|
-
},
|
|
1894
|
-
const l = new be(), s = new
|
|
1895
|
-
className:
|
|
1893
|
+
}, Wo = "zh-map-port-layer", Go = (e) => {
|
|
1894
|
+
const l = new be(), s = new Ce({
|
|
1895
|
+
className: Wo,
|
|
1896
1896
|
source: l,
|
|
1897
1897
|
zIndex: 100,
|
|
1898
1898
|
updateWhileInteracting: !0,
|
|
@@ -1909,7 +1909,7 @@ const Rt = (e, l) => {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
const b = [];
|
|
1911
1911
|
i.forEach((h) => {
|
|
1912
|
-
const [M, A] = h.latLon.split(","), z = new
|
|
1912
|
+
const [M, A] = h.latLon.split(","), z = new me({
|
|
1913
1913
|
geometry: new ue(he([Number(M), Number(A)])),
|
|
1914
1914
|
portData: h,
|
|
1915
1915
|
id: h.id,
|
|
@@ -1932,15 +1932,15 @@ const Rt = (e, l) => {
|
|
|
1932
1932
|
h.width = 0, h.height = 0;
|
|
1933
1933
|
const A = 2, z = 8, _ = window.devicePixelRatio || 1, ee = "12px sans-serif";
|
|
1934
1934
|
M.font = ee;
|
|
1935
|
-
const
|
|
1935
|
+
const p = M.measureText(i).width, F = z + p + z, G = A + 12 + A * 2;
|
|
1936
1936
|
h.width = Math.round(F * _), h.height = Math.round(G * _), M.scale(_, _), M.clearRect(0, 0, F, G), M.fillStyle = g ? "#F32D2D" : "#FFF", M.beginPath(), M.roundRect(0, 0, F, G, 4), M.fill(), M.font = ee, M.textBaseline = "middle";
|
|
1937
1937
|
const D = G / 2;
|
|
1938
1938
|
M.strokeStyle = g ? "#000" : "#ffffff", M.lineWidth = 1, M.strokeText(i, z, D), M.fillStyle = g ? "#FFF" : "#000000", M.fillText(i, z, D);
|
|
1939
1939
|
const X = h.toDataURL("image/png");
|
|
1940
1940
|
return w.set(b, X), X;
|
|
1941
1941
|
}, t = (i) => {
|
|
1942
|
-
const { select: g, showTitle: b } = i.getProperties(), h = (
|
|
1943
|
-
<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="${
|
|
1942
|
+
const { select: g, showTitle: b } = i.getProperties(), h = (p) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1943
|
+
<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="${p}"/>
|
|
1944
1944
|
<g clip-path="url(#clip0_10059_122082)">
|
|
1945
1945
|
<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"/>
|
|
1946
1946
|
</g>
|
|
@@ -2014,7 +2014,7 @@ const Rt = (e, l) => {
|
|
|
2014
2014
|
i && i.get("portData") ? Me(e, "pointer") : Me(e, "grab");
|
|
2015
2015
|
}
|
|
2016
2016
|
};
|
|
2017
|
-
},
|
|
2017
|
+
}, Yo = (e, l, s, r, u, a, n) => {
|
|
2018
2018
|
const c = e.getInstall();
|
|
2019
2019
|
c.on("moveend", () => {
|
|
2020
2020
|
var o, y;
|
|
@@ -2057,19 +2057,19 @@ const Rt = (e, l) => {
|
|
|
2057
2057
|
if (n.getState() !== "open" && a.getState() !== "open" && e.getMapClick() && !c.getView().getAnimating())
|
|
2058
2058
|
try {
|
|
2059
2059
|
let y = !1, N = !1;
|
|
2060
|
-
const Z = c.getLayers().getArray().filter((
|
|
2060
|
+
const Z = c.getLayers().getArray().filter((C) => C.get("layerType"));
|
|
2061
2061
|
try {
|
|
2062
|
-
Z && Z.length > 0 && Z.forEach((
|
|
2062
|
+
Z && Z.length > 0 && Z.forEach((C) => {
|
|
2063
2063
|
if (N) return;
|
|
2064
|
-
const i = c == null ? void 0 : c.getEventPixel(o.originalEvent), g =
|
|
2065
|
-
layerFilter: (h) => h ===
|
|
2064
|
+
const i = c == null ? void 0 : c.getEventPixel(o.originalEvent), g = C == null ? void 0 : C.get("layerType"), b = c == null ? void 0 : c.forEachFeatureAtPixel(i, (h) => h, {
|
|
2065
|
+
layerFilter: (h) => h === C,
|
|
2066
2066
|
// 严格图层过滤
|
|
2067
2067
|
hitTolerance: 5
|
|
2068
2068
|
});
|
|
2069
2069
|
b !== w[g] && (w[g] && t(g, w[g]), w[g] = b, b && (L(g, b, o), N = !0)), b && (y = !0);
|
|
2070
2070
|
}), y ? Me(c, "pointer") : Me(c, "grab");
|
|
2071
|
-
} catch (
|
|
2072
|
-
console.log("pointermove----",
|
|
2071
|
+
} catch (C) {
|
|
2072
|
+
console.log("pointermove----", C);
|
|
2073
2073
|
}
|
|
2074
2074
|
} catch (y) {
|
|
2075
2075
|
console.log("pointermove----", y);
|
|
@@ -2080,10 +2080,10 @@ const Rt = (e, l) => {
|
|
|
2080
2080
|
let y = !1;
|
|
2081
2081
|
const N = c.getLayers().getArray().filter((Z) => Z.get("layerType"));
|
|
2082
2082
|
N && N.length > 0 && N.forEach((Z) => {
|
|
2083
|
-
var
|
|
2083
|
+
var C, i, g, b, h;
|
|
2084
2084
|
if (!y)
|
|
2085
2085
|
try {
|
|
2086
|
-
if (((i = (
|
|
2086
|
+
if (((i = (C = Z == null ? void 0 : Z.getSource()) == null ? void 0 : C.getFeatures()) == null ? void 0 : i.length) > 0) {
|
|
2087
2087
|
const M = c == null ? void 0 : c.getEventPixel(o.originalEvent), A = c == null ? void 0 : c.forEachFeatureAtPixel(M, (z) => {
|
|
2088
2088
|
if (z.get("shipData") || z.get("portData") || z.get("polygonData") || z.get("pathData"))
|
|
2089
2089
|
return z;
|
|
@@ -2112,16 +2112,16 @@ const Rt = (e, l) => {
|
|
|
2112
2112
|
}, 150)), c.getView().on("change:resolution", () => {
|
|
2113
2113
|
r.changeShipScale();
|
|
2114
2114
|
});
|
|
2115
|
-
},
|
|
2115
|
+
}, Bo = () => {
|
|
2116
2116
|
const e = Xt([]);
|
|
2117
2117
|
return {
|
|
2118
2118
|
createInstance: (r, u) => {
|
|
2119
2119
|
const a = vo();
|
|
2120
2120
|
a.initMap(r, u);
|
|
2121
|
-
const n = a.getInstall(), c =
|
|
2121
|
+
const n = a.getInstall(), c = Do(n), w = Co();
|
|
2122
2122
|
w.setProps(u), c.setShowLayerType(u.layerType), c.setGreenTileVisible(u.showGreenLayer);
|
|
2123
|
-
const L =
|
|
2124
|
-
|
|
2123
|
+
const L = ko(n), t = po(n, L), o = Oo(n, w), y = Ao(n, w), N = Zo(n, w, a, y, o, u.declutter), Z = Ho(n), C = Go(n);
|
|
2124
|
+
Yo(a, w, L, N, C, o, y);
|
|
2125
2125
|
const i = () => {
|
|
2126
2126
|
const b = n.getView().calculateExtent(a.getSize()), h = Xe([b[0], b[1]], ie.mercator, ie.data), M = Xe([b[2], b[3]], ie.mercator, ie.data);
|
|
2127
2127
|
return [h[0], h[1], M[0], M[1]];
|
|
@@ -2139,9 +2139,9 @@ const Rt = (e, l) => {
|
|
|
2139
2139
|
track: L,
|
|
2140
2140
|
carTrack: t,
|
|
2141
2141
|
port: {
|
|
2142
|
-
render:
|
|
2143
|
-
clear:
|
|
2144
|
-
selected:
|
|
2142
|
+
render: C.render,
|
|
2143
|
+
clear: C.clear,
|
|
2144
|
+
selected: C.selected
|
|
2145
2145
|
},
|
|
2146
2146
|
position: Z,
|
|
2147
2147
|
drawLine: o,
|
|
@@ -2150,7 +2150,7 @@ const Rt = (e, l) => {
|
|
|
2150
2150
|
utils: {
|
|
2151
2151
|
getCalculateExtent: i,
|
|
2152
2152
|
convertSixHundredThousandToLatLng: bt,
|
|
2153
|
-
calculateCirclePoints:
|
|
2153
|
+
calculateCirclePoints: yo
|
|
2154
2154
|
}
|
|
2155
2155
|
}
|
|
2156
2156
|
};
|
|
@@ -2165,7 +2165,10 @@ const Rt = (e, l) => {
|
|
|
2165
2165
|
},
|
|
2166
2166
|
getAllInstances: () => [...e]
|
|
2167
2167
|
};
|
|
2168
|
-
},
|
|
2168
|
+
}, Xo = { class: "zh-map-box" }, qo = {
|
|
2169
|
+
key: 0,
|
|
2170
|
+
class: "map-copyright"
|
|
2171
|
+
}, _o = ["src"], Ko = /* @__PURE__ */ vt({
|
|
2169
2172
|
__name: "Map",
|
|
2170
2173
|
props: {
|
|
2171
2174
|
zoom: { default: se.default },
|
|
@@ -2183,7 +2186,8 @@ const Rt = (e, l) => {
|
|
|
2183
2186
|
} },
|
|
2184
2187
|
selectPort: { type: Function, default: () => {
|
|
2185
2188
|
} },
|
|
2186
|
-
declutter: { type: Boolean, default: !0 }
|
|
2189
|
+
declutter: { type: Boolean, default: !0 },
|
|
2190
|
+
copyrightImgUrl: {}
|
|
2187
2191
|
},
|
|
2188
2192
|
setup(e, { expose: l }) {
|
|
2189
2193
|
function s() {
|
|
@@ -2192,7 +2196,7 @@ const Rt = (e, l) => {
|
|
|
2192
2196
|
});
|
|
2193
2197
|
}
|
|
2194
2198
|
s();
|
|
2195
|
-
const r = fe(), u = fe(), a =
|
|
2199
|
+
const r = fe(), u = fe(), a = Bo(), n = fe(), c = e, w = fe({
|
|
2196
2200
|
getInstall() {
|
|
2197
2201
|
}
|
|
2198
2202
|
});
|
|
@@ -2203,11 +2207,11 @@ const Rt = (e, l) => {
|
|
|
2203
2207
|
});
|
|
2204
2208
|
});
|
|
2205
2209
|
function L() {
|
|
2206
|
-
var o, y, N, Z,
|
|
2210
|
+
var o, y, N, Z, C;
|
|
2207
2211
|
if (((o = n.value) == null ? void 0 : o.methods.drawPolygon.getState()) === "open" || ((y = n.value) == null ? void 0 : y.methods.drawLine.getState()) === "open" || !((N = n.value) != null && N.methods.getMapClick()))
|
|
2208
2212
|
return;
|
|
2209
2213
|
let t = (Z = n.value) == null ? void 0 : Z.methods.getZoom();
|
|
2210
|
-
(
|
|
2214
|
+
(C = n.value) == null || C.methods.setZoom(t + 1);
|
|
2211
2215
|
}
|
|
2212
2216
|
return _t(() => {
|
|
2213
2217
|
var t, o;
|
|
@@ -2441,24 +2445,30 @@ const Rt = (e, l) => {
|
|
|
2441
2445
|
MAP_ZOOM: se,
|
|
2442
2446
|
projection: ie
|
|
2443
2447
|
}
|
|
2444
|
-
}), (t, o) => (
|
|
2445
|
-
|
|
2448
|
+
}), (t, o) => (ot(), tt("div", Xo, [
|
|
2449
|
+
nt("div", {
|
|
2446
2450
|
id: "map",
|
|
2447
2451
|
ref_key: "zhMapRef",
|
|
2448
2452
|
ref: r,
|
|
2449
2453
|
class: "zh-map"
|
|
2450
2454
|
}, null, 512),
|
|
2451
|
-
|
|
2455
|
+
ht(go, {
|
|
2452
2456
|
ref_key: "scaleLineRef",
|
|
2453
2457
|
ref: u
|
|
2454
2458
|
}, null, 512),
|
|
2455
|
-
|
|
2459
|
+
ht(mo, {
|
|
2456
2460
|
ref: "zoomControlRef",
|
|
2457
2461
|
"map-instance": n.value
|
|
2458
|
-
}, null, 8, ["map-instance"])
|
|
2462
|
+
}, null, 8, ["map-instance"]),
|
|
2463
|
+
t.copyrightImgUrl ? (ot(), tt("div", qo, [
|
|
2464
|
+
nt("img", {
|
|
2465
|
+
src: t.copyrightImgUrl,
|
|
2466
|
+
alt: "copyright"
|
|
2467
|
+
}, null, 8, _o)
|
|
2468
|
+
])) : Kt("", !0)
|
|
2459
2469
|
]));
|
|
2460
2470
|
}
|
|
2461
|
-
}),
|
|
2471
|
+
}), jo = /* @__PURE__ */ xt(Ko, [["__scopeId", "data-v-b1d33deb"]]), en = co(jo);
|
|
2462
2472
|
export {
|
|
2463
|
-
|
|
2473
|
+
en as Z
|
|
2464
2474
|
};
|