zhihao-ui 1.2.36 → 1.2.37

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.
Files changed (40) hide show
  1. package/dist/es/{BaseInfo-C4sgm12k.js → BaseInfo-BjqSNfhB.js} +1 -1
  2. package/dist/es/{BaseItem-DwoIxH38.js → BaseItem-Da1CQtVm.js} +3 -3
  3. package/dist/es/{Button-BbUxF68h.js → Button-CKHqdHWj.js} +2 -2
  4. package/dist/es/{DatePicker-BkfvEDok.js → DatePicker-BOkpRWph.js} +3 -3
  5. package/dist/es/{DetailHeader-CmvLT5jU.js → DetailHeader-CL5Fin_g.js} +3 -3
  6. package/dist/es/{DetailSubTitle-BXjqx7Gl.js → DetailSubTitle-Derdb7AV.js} +2 -2
  7. package/dist/es/{Dialog-CiO2p3lS.js → Dialog-CGN6pFzA.js} +3 -3
  8. package/dist/es/{DiyDataTable-02Fvx4gj.js → DiyDataTable-CUbUe8NL.js} +4 -4
  9. package/dist/es/{EditInfoPair-2lOiJK1x.js → EditInfoPair-Dd_u_yvQ.js} +3 -3
  10. package/dist/es/{FileWrapper-oSb83fz-.js → FileWrapper-CGoXaXk9.js} +4 -4
  11. package/dist/es/{Grid-CHKAGBr9.js → Grid-Dr8kPvc8.js} +2 -2
  12. package/dist/es/{InfoPair-CDbyplp2.js → InfoPair-B2VzU1pL.js} +3 -3
  13. package/dist/es/{Input-CWfFyiHL.js → Input-DbqCWZ3K.js} +3 -3
  14. package/dist/es/{Loading-nlPpGN-L.js → Loading-Dimy_7_w.js} +2 -2
  15. package/dist/es/{Map-DngWgfIX.js → Map-BLVl3XBl.js} +1033 -1007
  16. package/dist/es/{MessageBox-DJR9qhIT.js → MessageBox-B54tNjcZ.js} +2 -2
  17. package/dist/es/{MoneyInput-BGmF3L2m.js → MoneyInput-uw4tR9WE.js} +8 -8
  18. package/dist/es/{PageHeadPanel-Bw6wb6jF.js → PageHeadPanel-CgR9a7c6.js} +2 -2
  19. package/dist/es/{Table-D8EshRWb.js → Table-BdySjJta.js} +5 -5
  20. package/dist/es/{ToolTips-Beib4mGU.js → ToolTips-BHQkWmMR.js} +6 -6
  21. package/dist/es/index.js +23 -23
  22. package/dist/es/{utils-hD_p7bGY.js → utils-DUHqvTHl.js} +1 -1
  23. package/dist/es/{vendor-Bonn9k5m.js → vendor-B7FHttiN.js} +229 -228
  24. package/dist/index.css +1 -1
  25. package/dist/types/components/Map/components/scaleLine.vue.d.ts +2 -2
  26. package/dist/types/components/Map/components/toolPanel.vue.d.ts +2 -2
  27. package/dist/types/components/Map/interface/entity/render.d.ts +1 -1
  28. package/dist/types/components/Map/render/canvasRender/renderCustomOverlay.d.ts +3 -3
  29. package/dist/types/components/Map/render/canvasRender/renderShipStyle.d.ts +1 -2
  30. package/dist/types/components/Map/render/canvasRender/renderTrackStyle.d.ts +1 -2
  31. package/dist/types/components/Map/render/drawPolygon.d.ts +1 -2
  32. package/dist/types/components/Map/render/renderDashboard.d.ts +1 -2
  33. package/dist/types/components/Map/render/renderMarker.d.ts +1 -1
  34. package/dist/types/components/Map/render/renderShip.d.ts +4 -5
  35. package/dist/types/components/Map/render/renderTrack.d.ts +1 -1
  36. package/dist/types/components/Map/render/renderTruck.d.ts +1 -2
  37. package/dist/types/components/Map/utils/store.d.ts +3 -2
  38. package/dist/umd/index.css +1 -1
  39. package/dist/umd/index.umd.cjs +17 -17
  40. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
- var B = Object.defineProperty;
2
- var _ = (e, t, o) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var I = (e, t, o) => _(e, typeof t != "symbol" ? t + "" : t, o);
1
+ var U = Object.defineProperty;
2
+ var z = (e, t, o) => t in e ? U(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var I = (e, t, o) => z(e, typeof t != "symbol" ? t + "" : t, o);
4
4
  import { defineComponent, inject, useModel, ref, watch, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, Fragment, renderList, toDisplayString, createCommentVNode, mergeModels, nextTick, onMounted, normalizeClass, renderSlot, createBlock, useCssVars, computed, provide } from "vue";
5
- import { p as getArea, q as getLength, V as VectorSource, r as VectorLayer, S as Style, C as CircleStyle, F as Fill, s as Stroke, D as Draw, O as Overlay, u as unByKey, t as ElSelect, v as ElOption, w as fromLonLat, P as Point, x as transform, y as Feature, T as Text, I as Icon, z as Translate, A as toLonLat, B as transformExtent, h as hooks, L as LineString, G as Polyline, H as getVectorContext, i as cloneDeep, J as GeoJSON, W as WebGLPointsLayer, K as Circle, M as buffer, N as ScaleLine$1, Q as MultiPoint, R as getCenter, U as TileLayer, X as XYZ, Y as Map$1, Z as View } from "./vendor-Bonn9k5m.js";
6
- import { _ as _export_sfc } from "./Button-BbUxF68h.js";
7
- import { g as getForegroundColor } from "./DatePicker-BkfvEDok.js";
8
- import { w as withInstall } from "./utils-hD_p7bGY.js";
5
+ import { p as getArea, q as getLength, V as VectorSource, r as VectorLayer, S as Style, C as CircleStyle, F as Fill, s as Stroke, D as Draw, O as Overlay, u as unByKey, t as ElSelect, v as ElOption, w as fromLonLat, P as Point, x as transform, y as Feature, T as Text, I as Icon, z as Translate, A as toLonLat, i as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, B as Circle, H as transformExtent, h as hooks, L as LineString, J as Polyline, K as getVectorContext, M as buffer, N as ScaleLine$1, Q as MultiPoint, R as getUid, U as getCenter, X as TileLayer, Y as XYZ, Z as Map$1, _ as View } from "./vendor-B7FHttiN.js";
6
+ import { _ as _export_sfc } from "./Button-CKHqdHWj.js";
7
+ import { g as getForegroundColor } from "./DatePicker-BOkpRWph.js";
8
+ import { w as withInstall } from "./utils-DUHqvTHl.js";
9
9
  var BaseMapType = /* @__PURE__ */ ((e) => (e[e.vector = 0] = "vector", e[e.satellite = 1] = "satellite", e))(BaseMapType || {}), SEARCH_TYPE = /* @__PURE__ */ ((e) => (e[e.SEARCH_SHIP = 0] = "SEARCH_SHIP", e[e.SEARCH_PORT = 1] = "SEARCH_PORT", e[e.SEARCH_CUSTOM = 2] = "SEARCH_CUSTOM", e))(SEARCH_TYPE || {}), COPY_RIGHT_TYPE = /* @__PURE__ */ ((e) => (e[e.HORIZONTAL = 0] = "HORIZONTAL", e[e.VERTICAL = 1] = "VERTICAL", e))(COPY_RIGHT_TYPE || {}), CAR_COLOR = /* @__PURE__ */ ((e) => (e[e.BLUE = 1] = "BLUE", e[e.YELLOW = 2] = "YELLOW", e[e.Y_GREEN = 3] = "Y_GREEN", e))(CAR_COLOR || {}), DEVICE_TYPE = /* @__PURE__ */ ((e) => (e[e.HOST = 1] = "HOST", e[e.TALK = 2] = "TALK", e[e.STORAGE = 3] = "STORAGE", e[e.INTERNET = 4] = "INTERNET", e[e.CAMERA = 5] = "CAMERA", e[e.LOAD = 6] = "LOAD", e))(DEVICE_TYPE || {}), LENGTH_UNIT = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(LENGTH_UNIT || {}), SWITCH_BTN = /* @__PURE__ */ ((e) => (e.Camera = "camera", e.Mobile = "mobile", e.WaterGauge = "waterGauge", e))(SWITCH_BTN || {}), SHIP_SAIL_STATUS = /* @__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))(SHIP_SAIL_STATUS || {});
10
10
  class ShipMapData {
11
- constructor(t, o, n, l, r, i, c, s, d, m, u, f, p, w, h, g, T, M, b, V, P, x, v, y) {
11
+ constructor(t, o, n, r, i, l, s, c, d, m, u, f, p, y, h, g, k, M, b, F, V, P, v, L) {
12
12
  I(this, "id");
13
13
  // mmsi
14
14
  I(this, "mmsi");
@@ -50,40 +50,40 @@ class ShipMapData {
50
50
  I(this, "existWaterGauge");
51
51
  I(this, "selected");
52
52
  I(this, "blinkColors");
53
- this.id = t, this.mmsi = o, this.fill = n, this.shipType = l, this.name = r, this.length = i, this.breadth = c, this.lon = s, this.lat = d, this.createdAt = m, this.speed = u, this.from = f, this.sailStatus = p, this.hdg = w, this.cog = h, this.posType = g, this.type = T, this.angle = M, this.leftIconColor = b, this.existDevice = V, this.existMobile = P, this.existWaterGauge = x, this.selected = v, this.blinkColors = y;
53
+ this.id = t, this.mmsi = o, this.fill = n, this.shipType = r, this.name = i, this.length = l, this.breadth = s, this.lon = c, this.lat = d, this.createdAt = m, this.speed = u, this.from = f, this.sailStatus = p, this.hdg = y, this.cog = h, this.posType = g, this.type = k, this.angle = M, this.leftIconColor = b, this.existDevice = F, this.existMobile = V, this.existWaterGauge = P, this.selected = v, this.blinkColors = L;
54
54
  }
55
55
  }
56
56
  const formatLength = function(e, t) {
57
57
  const n = getLength(e);
58
- let l = "";
58
+ let r = "";
59
59
  switch (t) {
60
60
  case LENGTH_UNIT.M:
61
- l = Math.round(n * 100) / 100 + " m";
61
+ r = Math.round(n * 100) / 100 + " m";
62
62
  break;
63
63
  case LENGTH_UNIT.KM:
64
- l = Math.round(n / 1e3 * 100) / 100 + " km";
64
+ r = Math.round(n / 1e3 * 100) / 100 + " km";
65
65
  break;
66
66
  case LENGTH_UNIT.NM:
67
- l = (Math.round(n / 1e3 * 100) / 100 / 1.852).toFixed(2) + " nm";
67
+ r = (Math.round(n / 1e3 * 100) / 100 / 1.852).toFixed(2) + " nm";
68
68
  break;
69
69
  }
70
- return l;
70
+ return r;
71
71
  }, convertSixHundredThousandToLatLng = function(e, t) {
72
72
  const o = Number(t) / 6e5;
73
73
  return [Number(e) / 6e5, o];
74
74
  }, formatArea = (e, t) => {
75
75
  const n = getArea(e);
76
- let l;
76
+ let r;
77
77
  switch (t) {
78
78
  case LENGTH_UNIT.KM:
79
- n > 1e4 ? l = Math.round(n / 1e6 * 100) / 100 + " km<sup>2</sup>" : l = Math.round(n * 100) / 100 + " m<sup>2</sup>";
79
+ n > 1e4 ? r = Math.round(n / 1e6 * 100) / 100 + " km<sup>2</sup>" : r = Math.round(n * 100) / 100 + " m<sup>2</sup>";
80
80
  break;
81
81
  case LENGTH_UNIT.NM:
82
- const r = Math.pow(1.852, 2);
83
- n > 1e4 ? l = Math.round(n / 1e6 / r * 100) / 100 + " nm<sup>2</sup>" : l = Math.round(n * 100) / 100 + " m<sup>2</sup>";
82
+ const i = Math.pow(1.852, 2);
83
+ n > 1e4 ? r = Math.round(n / 1e6 / i * 100) / 100 + " nm<sup>2</sup>" : r = Math.round(n * 100) / 100 + " m<sup>2</sup>";
84
84
  break;
85
85
  }
86
- return l;
86
+ return r;
87
87
  }, convertShipMapData = (e) => {
88
88
  const t = (o) => new ShipMapData(
89
89
  o.id,
@@ -130,8 +130,8 @@ const formatLength = function(e, t) {
130
130
  }),
131
131
  emits: /* @__PURE__ */ mergeModels(["close"], ["update:visible"]),
132
132
  setup(e, { expose: t, emit: o }) {
133
- const n = inject("mapInstance"), l = o, r = useModel(e, "visible"), i = ref("3"), c = ref([]), s = ref(!1), d = new VectorSource();
134
- let m, u, f, p, w;
133
+ const n = inject("mapInstance"), r = o, i = useModel(e, "visible"), l = ref("3"), s = ref([]), c = ref(!1), d = new VectorSource();
134
+ let m, u, f, p, y;
135
135
  const h = new VectorLayer({
136
136
  source: d,
137
137
  style: {
@@ -141,16 +141,16 @@ const formatLength = function(e, t) {
141
141
  "circle-radius": 7,
142
142
  "circle-fill-color": "#ffcc33"
143
143
  }
144
- }), g = function(k) {
145
- if (k.dragging)
144
+ }), g = function(S) {
145
+ if (S.dragging)
146
146
  return;
147
- let S = "点击选择起点";
148
- m && (S = "单击继续,双击结束"), u && (u.innerHTML = S, f.setPosition(k.coordinate), u.classList.remove("hidden"));
149
- }, T = () => {
147
+ let T = "点击选择起点";
148
+ m && (T = "单击继续,双击结束"), u && (u.innerHTML = T, f.setPosition(S.coordinate), u.classList.remove("hidden"));
149
+ }, k = () => {
150
150
  n.value && (n.value.on("pointermove", g), n.value.getViewport().addEventListener("mouseout", function() {
151
- var k;
152
- (k = u == null ? void 0 : u.classList) == null || k.add("hidden");
153
- }), s.value = !0);
151
+ var S;
152
+ (S = u == null ? void 0 : u.classList) == null || S.add("hidden");
153
+ }), c.value = !0);
154
154
  };
155
155
  let M;
156
156
  const b = new Style({
@@ -172,95 +172,95 @@ const formatLength = function(e, t) {
172
172
  })
173
173
  })
174
174
  });
175
- function V() {
176
- var k, S;
175
+ function F() {
176
+ var S, T;
177
177
  if (n.value) {
178
- if (c.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((E) => {
179
- var C;
180
- (C = E == null ? void 0 : E.parentNode) == null || C.removeChild(E);
178
+ if (s.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((C) => {
179
+ var E;
180
+ (E = C == null ? void 0 : C.parentNode) == null || E.removeChild(C);
181
181
  }), d.clear(), M) {
182
- const E = n.value.getInteractions().getArray().find((C) => C.ol_uid === M.ol_uid);
183
- E && ((k = n.value) == null || k.removeInteraction(E));
182
+ const C = n.value.getInteractions().getArray().find((E) => E.ol_uid === M.ol_uid);
183
+ C && ((S = n.value) == null || S.removeInteraction(C));
184
184
  }
185
- (S = n.value) == null || S.removeLayer(h), u != null && u.parentNode && u.parentNode.removeChild(u), p != null && p.parentNode && p.parentNode.removeChild(p);
185
+ (T = n.value) == null || T.removeLayer(h), u != null && u.parentNode && u.parentNode.removeChild(u), p != null && p.parentNode && p.parentNode.removeChild(p);
186
186
  }
187
187
  }
188
- function P() {
189
- var S, E;
190
- V(), (S = n.value) == null || S.addLayer(h), M = new Draw({
188
+ function V() {
189
+ var T, C;
190
+ F(), (T = n.value) == null || T.addLayer(h), M = new Draw({
191
191
  source: d,
192
192
  type: "LineString",
193
193
  style: function() {
194
194
  return b;
195
195
  }
196
- }), (E = n.value) == null || E.addInteraction(M), v(), x();
197
- let k;
198
- M.on("drawstart", function(C) {
199
- var $;
200
- m = C.feature;
201
- let F;
202
- k = ($ = m.getGeometry()) == null ? void 0 : $.on("change", function(R) {
203
- const A = R.target;
204
- let N = formatUtils.formatLength(A, Number(i.value));
205
- F = A.getLastCoordinate(), p && N && (p.innerHTML = N), w.setPosition(F);
196
+ }), (C = n.value) == null || C.addInteraction(M), v(), P();
197
+ let S;
198
+ M.on("drawstart", function(E) {
199
+ var N;
200
+ m = E.feature;
201
+ let x;
202
+ S = (N = m.getGeometry()) == null ? void 0 : N.on("change", function(A) {
203
+ const $ = A.target;
204
+ let R = formatUtils.formatLength($, Number(l.value));
205
+ x = $.getLastCoordinate(), p && R && (p.innerHTML = R), y.setPosition(x);
206
206
  });
207
207
  }), M.on("drawend", function() {
208
- var C, F;
209
- p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML && (c.value.push(p == null ? void 0 : p.innerHTML), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-index="${((C = c.value) == null ? void 0 : C.length) - 1}"><i class="map-iconfont icon-delete"></i></div>`), (F = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || F.addEventListener("click", ($) => {
210
- var A;
211
- $.preventDefault(), $.stopPropagation();
212
- const R = (A = $.target) == null ? void 0 : A.getAttribute("data-index");
213
- R && y(Number(R));
214
- }), w.setOffset([0, -7]), m = null, p = null, v(), k && unByKey(k);
208
+ var E, x;
209
+ p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML && (s.value.push(p == null ? void 0 : p.innerHTML), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-index="${((E = s.value) == null ? void 0 : E.length) - 1}"><i class="map-iconfont icon-delete"></i></div>`), (x = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || x.addEventListener("click", (N) => {
210
+ var $;
211
+ N.preventDefault(), N.stopPropagation();
212
+ const A = ($ = N.target) == null ? void 0 : $.getAttribute("data-index");
213
+ A && L(Number(A));
214
+ }), y.setOffset([0, -7]), m = null, p = null, v(), S && unByKey(S);
215
215
  });
216
216
  }
217
- function x() {
218
- var k;
217
+ function P() {
218
+ var S;
219
219
  u != null && u.parentNode && u.parentNode.removeChild(u), u = document.createElement("div"), u.className = "ol-tooltip hidden", f = new Overlay({
220
220
  element: u,
221
221
  offset: [15, 0],
222
222
  positioning: "center-left"
223
- }), (k = n.value) == null || k.addOverlay(f);
223
+ }), (S = n.value) == null || S.addOverlay(f);
224
224
  }
225
225
  function v() {
226
- var k;
227
- p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure", w = new Overlay({
226
+ var S;
227
+ p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure", y = new Overlay({
228
228
  element: p,
229
229
  offset: [0, -15],
230
230
  positioning: "bottom-center",
231
231
  stopEvent: !1,
232
232
  insertFirst: !1
233
- }), (k = n.value) == null || k.addOverlay(w);
233
+ }), (S = n.value) == null || S.addOverlay(y);
234
234
  }
235
- const y = (k) => {
236
- var C, F;
237
- c.value[k] && c.value.splice(k, 1);
238
- const S = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
239
- S[k] && ((F = (C = S[k]) == null ? void 0 : C.parentNode) == null || F.removeChild(S[k]));
240
- const E = d.getFeatures();
241
- E[k] && d.removeFeature(E[k]);
242
- }, L = () => {
243
- l("close");
235
+ const L = (S) => {
236
+ var E, x;
237
+ s.value[S] && s.value.splice(S, 1);
238
+ const T = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
239
+ T[S] && ((x = (E = T[S]) == null ? void 0 : E.parentNode) == null || x.removeChild(T[S]));
240
+ const C = d.getFeatures();
241
+ C[S] && d.removeFeature(C[S]);
242
+ }, w = () => {
243
+ r("close");
244
244
  };
245
- return watch(() => r, () => {
246
- r.value && !s.value && (T(), P());
245
+ return watch(() => i, () => {
246
+ i.value && !c.value && (k(), V());
247
247
  }, { deep: !0, immediate: !0 }), t({
248
- addInteraction: P,
249
- removeInteraction: V
250
- }), (k, S) => r.value && k.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
248
+ addInteraction: V,
249
+ removeInteraction: F
250
+ }), (S, T) => i.value && S.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
251
251
  createElementVNode("div", { class: "header" }, [
252
- S[1] || (S[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
252
+ T[1] || (T[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
253
253
  createElementVNode("i", {
254
- onClick: L,
254
+ onClick: w,
255
255
  class: "map-iconfont icon-close"
256
256
  })
257
257
  ]),
258
258
  createElementVNode("div", _hoisted_2$2, [
259
- S[2] || (S[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
259
+ T[2] || (T[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
260
260
  createVNode(unref(ElSelect), {
261
261
  class: "select-length-unit",
262
- modelValue: i.value,
263
- "onUpdate:modelValue": S[0] || (S[0] = (E) => i.value = E)
262
+ modelValue: l.value,
263
+ "onUpdate:modelValue": T[0] || (T[0] = (C) => l.value = C)
264
264
  }, {
265
265
  default: withCtx(() => [
266
266
  createVNode(unref(ElOption), {
@@ -280,19 +280,19 @@ const formatLength = function(e, t) {
280
280
  }, 8, ["modelValue"])
281
281
  ]),
282
282
  createElementVNode("div", _hoisted_3$1, [
283
- (openBlock(!0), createElementBlock(Fragment, null, renderList(c.value, (E, C) => (openBlock(), createElementBlock("div", {
283
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (C, E) => (openBlock(), createElementBlock("div", {
284
284
  class: "measure-history-item",
285
- key: C
285
+ key: E
286
286
  }, [
287
287
  createElementVNode("div", _hoisted_4, [
288
- S[3] || (S[3] = createElementVNode("i", { class: "map-iconfont icon-line" }, null, -1)),
289
- createElementVNode("span", _hoisted_5, "线段" + toDisplayString(C + 1), 1),
290
- createElementVNode("span", _hoisted_6, toDisplayString(E), 1)
288
+ T[3] || (T[3] = createElementVNode("i", { class: "map-iconfont icon-line" }, null, -1)),
289
+ createElementVNode("span", _hoisted_5, "线段" + toDisplayString(E + 1), 1),
290
+ createElementVNode("span", _hoisted_6, toDisplayString(C), 1)
291
291
  ]),
292
292
  createElementVNode("div", {
293
293
  class: "delete-button",
294
- onClick: (F) => y(C)
295
- }, S[4] || (S[4] = [
294
+ onClick: (x) => L(E)
295
+ }, T[4] || (T[4] = [
296
296
  createElementVNode("i", { class: "map-iconfont icon-delete" }, null, -1)
297
297
  ]), 8, _hoisted_7)
298
298
  ]))), 128))
@@ -331,34 +331,34 @@ const formatLength = function(e, t) {
331
331
  }), renderMarker = (e, t = !0, o = !0) => {
332
332
  var m;
333
333
  if (!mapInstance$8.value || !e || e.split(",").length !== 2) return;
334
- const [n, l] = e.split(",").map(Number);
334
+ const [n, r] = e.split(",").map(Number);
335
335
  marker.value = new Feature({
336
- geometry: new Point(fromLonLat([n, l]))
336
+ geometry: new Point(fromLonLat([n, r]))
337
337
  });
338
- const r = o ? `${n}, ${l}` : "";
339
- (m = marker.value) == null || m.setStyle(createIconStyle(r));
340
- const i = new VectorSource({
338
+ const i = o ? `${n}, ${r}` : "";
339
+ (m = marker.value) == null || m.setStyle(createIconStyle(i));
340
+ const l = new VectorSource({
341
341
  features: [marker.value]
342
- }), c = new VectorLayer({
343
- source: i
344
- }), s = mapInstance$8.value.getView();
345
- if (mapInstance$8.value.addLayer(c), t) {
342
+ }), s = new VectorLayer({
343
+ source: l
344
+ }), c = mapInstance$8.value.getView();
345
+ if (mapInstance$8.value.addLayer(s), t) {
346
346
  const u = new Translate({
347
- layers: [c]
347
+ layers: [s]
348
348
  });
349
349
  u.on("translating", function(f) {
350
350
  var h;
351
- const p = f.features.item(0).getGeometry().getCoordinates(), w = toLonLat(p);
352
- markerPosition.value = `${w[0].toFixed(6)}, ${w[1].toFixed(6)}`, (h = marker.value) == null || h.setStyle(createIconStyle(markerPosition.value));
351
+ const p = f.features.item(0).getGeometry().getCoordinates(), y = toLonLat(p);
352
+ markerPosition.value = `${y[0].toFixed(6)}, ${y[1].toFixed(6)}`, (h = marker.value) == null || h.setStyle(createIconStyle(markerPosition.value));
353
353
  }), mapInstance$8.value.addInteraction(u);
354
354
  }
355
- const d = new Point([n, l]);
356
- s.setCenter(transform(d.getCoordinates(), projection.data, projection.mercator)), s.setZoom(mapZoom.findShip);
355
+ const d = new Point([n, r]);
356
+ c.setCenter(transform(d.getCoordinates(), projection.data, projection.mercator)), c.setZoom(mapZoom.findShip);
357
357
  }, setMarkerPosition = (e) => {
358
- var l, r;
358
+ var r, i;
359
359
  if (!mapInstance$8.value) return;
360
360
  const t = mapInstance$8.value.getView(), o = e.split(",").map(Number);
361
- (r = (l = marker.value) == null ? void 0 : l.getGeometry()) == null || r.setCoordinates(fromLonLat([o[0], o[1]]));
361
+ (i = (r = marker.value) == null ? void 0 : r.getGeometry()) == null || i.setCoordinates(fromLonLat([o[0], o[1]]));
362
362
  const n = new Point([o[0], o[1]]);
363
363
  t.setCenter(transform(n.getCoordinates(), projection.data, projection.mercator)), t.setZoom(mapZoom.markerPosition);
364
364
  }, CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", zhongkeKey = "15c81cc0a191a232e0a0ca1a51c3ca81", baseMap = {
@@ -428,10 +428,10 @@ const multiplyPixelRatio = (e) => {
428
428
  function n(u) {
429
429
  return 180 * (u % (2 * Math.PI)) / Math.PI;
430
430
  }
431
- function l(u) {
431
+ function r(u) {
432
432
  return u % 360 * Math.PI / 180;
433
433
  }
434
- function r(u) {
434
+ function i(u) {
435
435
  if (!u) throw new Error("Coordinate is required");
436
436
  if (!Array.isArray(u)) {
437
437
  if (u.type === "Feature" && u.geometry !== null && u.geometry.type === "Point")
@@ -444,226 +444,602 @@ const multiplyPixelRatio = (e) => {
444
444
  "Coordinate must be GeoJSON Point or an Array of numbers"
445
445
  );
446
446
  }
447
- function i(u, f, p = {}) {
447
+ function l(u, f, p = {}) {
448
448
  if (p.final)
449
- return function(x, v) {
450
- return (i(v, x) + 180) % 360;
449
+ return function(P, v) {
450
+ return (l(v, P) + 180) % 360;
451
451
  }(u, f);
452
- const w = r(u), h = r(f), g = l(w[0]), T = l(h[0]), M = l(w[1]), b = l(h[1]), V = Math.sin(T - g) * Math.cos(b), P = Math.cos(M) * Math.sin(b) - Math.sin(M) * Math.cos(b) * Math.cos(T - g);
453
- return n(Math.atan2(V, P));
452
+ const y = i(u), h = i(f), g = r(y[0]), k = r(h[0]), M = r(y[1]), b = r(h[1]), F = Math.sin(k - g) * Math.cos(b), V = Math.cos(M) * Math.sin(b) - Math.sin(M) * Math.cos(b) * Math.cos(k - g);
453
+ return n(Math.atan2(F, V));
454
454
  }
455
- function c(u) {
455
+ function s(u) {
456
456
  return !isNaN(u) && u !== null && !Array.isArray(u);
457
457
  }
458
- function s(u, f = {}, p = {}) {
459
- return u || console.log("Coordinates are required"), Array.isArray(u) || console.log("Coordinates must be an Array"), u.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!c(u[0]) || !c(u[1])) && console.log("Coordinates must contain numbers"), d({ type: "Point", coordinates: u }, f, p);
458
+ function c(u, f = {}, p = {}) {
459
+ return u || console.log("Coordinates are required"), Array.isArray(u) || console.log("Coordinates must be an Array"), u.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!s(u[0]) || !s(u[1])) && console.log("Coordinates must contain numbers"), d({ type: "Point", coordinates: u }, f, p);
460
460
  }
461
461
  function d(u, f = {}, p = {}) {
462
- const w = { type: "Feature" };
463
- return p.id !== void 0 && (w.id = p.id), p.bbox && (w.bbox = p.bbox), w.properties = f || {}, w.geometry = u, w;
462
+ const y = { type: "Feature" };
463
+ return p.id !== void 0 && (y.id = p.id), p.bbox && (y.bbox = p.bbox), y.properties = f || {}, y.geometry = u, y;
464
464
  }
465
- const m = i(s(e), s(t), o);
465
+ const m = l(c(e), c(t), o);
466
466
  return m < 0 ? 360 + m : m;
467
- }, labelAlpha = 0.8, pixelRatio = window.devicePixelRatio || 1, labelFont = `500 ${12 * pixelRatio}px Arial`, labelOutSize = 2 * pixelRatio, labelHeight = 10 * pixelRatio, fillRectRadius = (e, t, o, n, l, r, i = 4) => {
468
- e.beginPath(), e.moveTo(t + i, o), e.arcTo(t + n, o, t + n, o + i, i), e.arcTo(t + n, o + l, t + n - i, o + l, i), e.arcTo(t, o + l, t, o + l - i, i), e.arcTo(t, o, t + i, o, i), e.closePath(), e.fillStyle = r, e.fill();
467
+ }, triangleModel = multiplyPixelRatio([
468
+ [0, -8],
469
+ [5, 8],
470
+ [-5, 8]
471
+ ]), shipShapeModel = multiplyPixelRatio([
472
+ [0, -4.545],
473
+ [-0.56, -3.909],
474
+ [-1, -2.727],
475
+ [-1, 3.636],
476
+ [-0.8, 4.545],
477
+ [0.8, 4.545],
478
+ [1, 3.636],
479
+ [1, -2.727],
480
+ [0.56, -3.909],
481
+ [0, -4.545]
482
+ ]), shipDirectPath = {
483
+ left: {
484
+ 0: [
485
+ [0, 0],
486
+ [0, -8],
487
+ [-4, -8]
488
+ ],
489
+ 1: [
490
+ [0, 0],
491
+ [0, -16],
492
+ [-6, -16]
493
+ ],
494
+ 2: [
495
+ [0, 0],
496
+ [0, -24],
497
+ [-8, -24]
498
+ ]
499
+ },
500
+ right: {
501
+ 0: [
502
+ [0, 0],
503
+ [0, -8],
504
+ [-4, -8]
505
+ ],
506
+ 1: [
507
+ [0, 0],
508
+ [0, -16],
509
+ [-6, -16]
510
+ ],
511
+ 2: [
512
+ [0, 0],
513
+ [0, -24],
514
+ [-8, -24]
515
+ ]
516
+ },
517
+ front: {
518
+ 0: [
519
+ [0, 0],
520
+ [0, -8]
521
+ ],
522
+ 1: [
523
+ [0, 0],
524
+ [0, -16]
525
+ ],
526
+ 2: [
527
+ [0, 0],
528
+ [0, -24]
529
+ ]
530
+ }
531
+ }, setBlankStyle = () => new Style({
532
+ image: new CircleStyle({
533
+ radius: 0
534
+ })
535
+ }), mapInstance$7 = ref(), renderShipStyleSetInstance = (e) => mapInstance$7.value = e, speedCondition = [[1, 10], [10, 20], [20, 1 / 0]], drawShipModelByZoom = { 14: [200, 30], 15: [115, 15], 16: [55, 8], 17: [25, 5], 18: [1, 1] }, setShipStyle = (e, t = !1) => new Style({
536
+ renderer: (o, n) => {
537
+ o = o;
538
+ const r = n.context, i = n.feature.get("data");
539
+ if (!i) return;
540
+ if (i != null && i.length) {
541
+ const s = i.length / 2;
542
+ r.beginPath(), r.arc(
543
+ o[0],
544
+ o[1],
545
+ s,
546
+ 0,
547
+ 2 * Math.PI
548
+ ), r.fillStyle = "rgba(0, 0, 0, 0.01)", r.fill();
549
+ }
550
+ n.feature.get("index") === 0 && (shipLabels.value = []);
551
+ try {
552
+ const s = drawShipBody(r, i, o, t);
553
+ s && (drawHeading(r, i, s, t), i.selected = e, e && setTimeout(() => {
554
+ drawSelectBounds(r, s);
555
+ }, 50)), drawShipLabel(r, i, o);
556
+ } catch {
557
+ return !1;
558
+ }
559
+ }
560
+ }), drawShipBody = (e, t, o, n) => {
561
+ if (!mapInstance$7.value) return;
562
+ const r = Math.round(Number(mapInstance$7.value.getView().getZoom()));
563
+ if (!r) return;
564
+ let i = [];
565
+ const [l, s] = drawShipModelByZoom[r] || [0, 0], [c, d] = o;
566
+ if (r <= mapZoom.shipModelMax && r > mapZoom.shipModelMin && t.length >= l && t.breadth >= s)
567
+ i = rotateShapeModel(drawCurrentShipShapeModel(t, r), t.angle).map((u) => {
568
+ const [f, p] = u;
569
+ return [c + f, d + p];
570
+ });
571
+ else {
572
+ const m = rotateShapeModel(triangleModel, t.angle);
573
+ o.length === 2 && (i = m.map((u) => {
574
+ const [f, p] = u;
575
+ return [c + f, d + p];
576
+ }));
577
+ }
578
+ if (!(i.length > 2)) return !1;
579
+ e.save(), e.beginPath(), e.moveTo(i[0][0], i[0][1]);
580
+ for (let m = 1; m < i.length; m++)
581
+ e.lineTo(i[m][0], i[m][1]);
582
+ return e.closePath(), e.strokeStyle = n ? "#ff0000" : "#000", e.lineWidth = n ? 2 : 1, e.stroke(), e.fillStyle = t.fill, e.fill(), e.restore(), i;
583
+ }, drawHeading = (e, t, o, n) => {
584
+ const [r, i] = o[0], l = getShipDirectPath(t);
585
+ if (l) {
586
+ const s = l.map(function(c) {
587
+ const [d, m] = c;
588
+ return [d + r, m + i];
589
+ });
590
+ if (e.save(), e.beginPath(), t.angle > 0) {
591
+ e.translate(r, i);
592
+ const c = t.angle * Math.PI / 180;
593
+ e.rotate(c), e.translate(-r, -i);
594
+ }
595
+ e.moveTo(r, i);
596
+ for (let c = 1; c < s.length; c++) {
597
+ const [d, m] = s[c];
598
+ e.lineTo(d, m);
599
+ }
600
+ e.strokeStyle = n ? "#ff0000" : "#000", e.lineWidth = n ? 2 : 1, e.stroke(), e.restore();
601
+ }
602
+ }, drawSelectBounds = (e, t) => {
603
+ let [o, n, r, i] = getPixelFromCoordinate(t);
604
+ const l = 4;
605
+ o -= l, n -= l, r += l, i += l, e.save(), e.strokeStyle = "#ff0000", e.lineWidth = 4;
606
+ const s = 8;
607
+ e.beginPath(), e.moveTo(o + s, i), e.lineTo(o, i), e.lineTo(o, i - s), e.moveTo(o, n + s), e.lineTo(o, n), e.lineTo(o + s, n), e.moveTo(r - s, n), e.lineTo(r, n), e.lineTo(r, n + s), e.moveTo(r, i - s), e.lineTo(r, i), e.lineTo(r - s, i), e.stroke(), e.restore();
608
+ }, drawShipLabel = (e, t, o) => {
609
+ if (!t.selected && shipLabels.value.find((u) => u.name === t.name)) return;
610
+ const [n, r] = o, i = n, l = r, s = t.name;
611
+ let c;
612
+ t.leftIconColor && (c = { color: t.leftIconColor, icon: "&#xe599;" });
613
+ const d = getShipCustomIcon(t), m = {
614
+ id: t.id,
615
+ center: [i, l],
616
+ text: s,
617
+ fill: t.fill,
618
+ color: "#fff",
619
+ textColor: "#000",
620
+ bgColor: "#fff",
621
+ leftIcon: c,
622
+ rightIcons: d,
623
+ selected: t.selected,
624
+ blinkColors: t.blinkColors,
625
+ type: "ShipName"
626
+ };
627
+ drawLabel(e, m, shipLabels.value);
628
+ }, drawCurrentShipShapeModel = (e, t) => {
629
+ let o = 0;
630
+ t <= 14 ? o = 0.058 : t === 15 ? o = 0.12 : t === 16 ? o = 0.22 : t === 17 ? o = 0.435 : t === 18 && (o = 0.857);
631
+ const n = e.length / 4 * o, r = e.breadth * o;
632
+ let i = cloneDeep(shipShapeModel);
633
+ return i = i.map(([l, s]) => [l * r, s * n]), i;
634
+ }, getShipDirectPath = (e) => {
635
+ const { speed: t, hdg: o, cog: n } = e;
636
+ let r = "", i = null;
637
+ if (t && t > 1 && (o !== null && o != 511 && n !== null ? n - o >= 3 ? r = "left" : n - o <= -3 ? r = "right" : r = "front" : r = "front", r && t))
638
+ for (let l = 0; l < speedCondition.length; l++) {
639
+ const s = speedCondition[l];
640
+ if (t >= s[0] && t < s[1]) {
641
+ i = shipDirectPath[r][l];
642
+ break;
643
+ }
644
+ }
645
+ return i;
646
+ }, getShipCustomIcon = (e) => {
647
+ const t = [];
648
+ return e.existDevice && t.push("&#xe687;"), e.existMobile && t.push("&#xe688;"), e.existWaterGauge && t.push("&#xe686;"), t || [];
649
+ }, mapInstance$6 = ref(), renderShipSetInstance = (e) => mapInstance$6.value = e;
650
+ let shipsMarkerList = [], shipsVectorSource, largeAmountShipsSource;
651
+ const selectedShipData = ref(null);
652
+ let selectShipsVectorSource;
653
+ const renderShips = (e) => {
654
+ var o, n, r, i;
655
+ if (!mapInstance$6.value || showTrackLayer.value) return;
656
+ const t = Math.round(Number(mapInstance$6.value.getView().getZoom()));
657
+ if (selectedShipData.value && nextTick(() => {
658
+ selectSingleShipMarker(selectedShipData.value);
659
+ }).then((l) => {
660
+ }), !(!t || t < mapZoom.shipGreenDotMax) && (allShips.value = e, !hiddenOrther.value))
661
+ return t >= mapZoom.shipGreenDotMax && t < mapZoom.shipModelMin ? ((o = shipsLayer.value) == null || o.setVisible(!1), (n = largeAmountShipsLayer.value) == null || n.setVisible(!0), renderLargeAmountShips(e)) : ((r = largeAmountShipsLayer.value) == null || r.setVisible(!1), (i = shipsLayer.value) == null || i.setVisible(!0), renderShipsMarker(e));
662
+ }, renderLargeAmountShips = (e) => {
663
+ if (!mapInstance$6.value) return;
664
+ const t = e.map((o) => ({
665
+ type: "Feature",
666
+ geometry: {
667
+ type: "Point",
668
+ coordinates: [o.lon, o.lat]
669
+ },
670
+ properties: o
671
+ }));
672
+ return largeAmountShipsSource == null || largeAmountShipsSource.clear(), largeAmountShipsSource = new VectorSource({
673
+ features: new GeoJSON().readFeatures({
674
+ type: "FeatureCollection",
675
+ features: t
676
+ }, {
677
+ featureProjection: projection.mercator
678
+ })
679
+ }), largeAmountShipsLayer.value = new WebGLPointsLayer({
680
+ source: largeAmountShipsSource,
681
+ style: {
682
+ "shape-points": 3,
683
+ "shape-radius": 9,
684
+ "shape-fill-color": [
685
+ "case",
686
+ ["==", ["get", "fill"], "#D9001C"],
687
+ "#D9001C",
688
+ // 如果 fill 是 #D9001C,返回红色
689
+ ["==", ["get", "fill"], "#04C900"],
690
+ "#04C900",
691
+ // 如果 fill 是 #04C900,返回绿色
692
+ "#04C900"
693
+ // 默认颜色(绿色)
694
+ ],
695
+ "shape-rotate-with-view": !1,
696
+ "shape-rotation": [
697
+ "+",
698
+ ["get", "cog"],
699
+ // 获取 'cog' 属性值
700
+ 180
701
+ // 将值旋转 180 度
702
+ ],
703
+ "shape-scale": [0.8, 1.2],
704
+ "shape-stroke-color": "#000000",
705
+ // 边框颜色为黑色
706
+ "shape-stroke-width": 0.5
707
+ // 边框宽度为0.5px
708
+ }
709
+ }), mapInstance$6.value.addLayer(largeAmountShipsLayer.value), largeAmountShipsLayer.value;
710
+ }, renderShipsMarker = (e) => {
711
+ var o;
712
+ if (!mapInstance$6.value) return;
713
+ deleteAllShipMarkers();
714
+ let t = convertShipMapData(e);
715
+ if (t = customFilterShips(t), !!(t != null && t.length))
716
+ return t.forEach((n, r) => {
717
+ const i = [n.lon, n.lat], l = new Feature({
718
+ geometry: new Point(fromLonLat(i))
719
+ }), s = 1;
720
+ l.set("clickGeometry", new Circle(fromLonLat(i), s)), l.set("data", n), l.set("index", r), l.setStyle(
721
+ setShipStyle(!1)
722
+ ), shipsMarkerList.push({
723
+ ship: n,
724
+ lonlat: i,
725
+ feature: l
726
+ });
727
+ }), shipsVectorSource = new VectorSource({
728
+ features: shipsMarkerList.map((n) => n.feature)
729
+ }), shipsLayer.value = new VectorLayer({
730
+ source: shipsVectorSource,
731
+ zIndex: 100
732
+ }), (o = mapInstance$6.value) == null || o.addLayer(shipsLayer.value), shipsLayer.value;
733
+ }, onShipsMarkerHover = () => {
734
+ var t;
735
+ let e = null;
736
+ (t = mapInstance$6.value) == null || t.on("pointermove", function(o) {
737
+ var r, i, l;
738
+ const n = (r = mapInstance$6.value) == null ? void 0 : r.forEachFeatureAtPixel(o.pixel, (s) => s);
739
+ if (mapInstance$6.value) {
740
+ const s = mapInstance$6.value.getTargetElement();
741
+ s.style.cursor = n ? "pointer" : "";
742
+ }
743
+ if (e) {
744
+ const s = e.get("data");
745
+ if (!(s != null && s.mmsi)) return;
746
+ e.setStyle(
747
+ setShipStyle(((i = selectedShipData.value) == null ? void 0 : i.id) === s.id, !1)
748
+ );
749
+ }
750
+ if (n) {
751
+ const s = n.get("data");
752
+ if (!(s != null && s.mmsi)) return;
753
+ e = n, n.setStyle(
754
+ setShipStyle(((l = selectedShipData.value) == null ? void 0 : l.id) === s.id, !0)
755
+ );
756
+ }
757
+ });
758
+ }, customFilterShips = (e) => {
759
+ let t = cloneDeep(e);
760
+ return t = t.filter((o) => {
761
+ var r;
762
+ const n = getFilterItem(o).every(({ btnShow: i, value: l }) => i ? !!l : !0);
763
+ return (switchBtnShow.value.camera || switchBtnShow.value.mobile || switchBtnShow.value.waterGauge) && ((r = selectedShipData.value) == null ? void 0 : r.id) === o.id && clearSelectFeature(), n;
764
+ }), t;
765
+ }, getFilterItem = (e) => [
766
+ { btnShow: switchBtnShow.value.camera, value: e == null ? void 0 : e.existDevice },
767
+ { btnShow: switchBtnShow.value.mobile, value: e == null ? void 0 : e.existMobile },
768
+ { btnShow: switchBtnShow.value.waterGauge, value: e == null ? void 0 : e.existWaterGauge }
769
+ ], deleteAllShipMarkers = () => {
770
+ shipsMarkerList.forEach((e) => {
771
+ e.feature && (shipsVectorSource == null || shipsVectorSource.removeFeature(e.feature));
772
+ }), clearAllInterval(), shipsMarkerList = [];
773
+ }, selectSingleShipMarker = (e) => {
774
+ var i;
775
+ if (!mapInstance$6.value) return;
776
+ const t = cloneDeep(selectSingleShipData.value);
777
+ selectSingleShipData.value = convertShipMapData(e);
778
+ const o = [selectSingleShipData.value.lon, selectSingleShipData.value.lat], n = new Feature({
779
+ geometry: new Point(fromLonLat(o))
780
+ });
781
+ n.set("data", selectSingleShipData.value), n.setStyle(
782
+ setShipStyle(!0)
783
+ ), shipsMarkerList.push({
784
+ ship: selectSingleShipData.value,
785
+ lonlat: o,
786
+ feature: n
787
+ }), selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsVectorSource = new VectorSource({
788
+ features: [n]
789
+ }), selectShipsLayer.value = new VectorLayer({
790
+ source: selectShipsVectorSource
791
+ }), setVisibleFeatureById(shipsVectorSource, selectSingleShipData.value.id, !0);
792
+ const r = (i = shipsLayer.value) == null ? void 0 : i.getSource();
793
+ return r && (t && setVisibleFeatureById(r, t.id, !0), setVisibleFeatureById(r, selectSingleShipData.value.id, !1)), mapInstance$6.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!0), selectShipsLayer.value;
794
+ }, setVisibleFeatureById = (e, t, o) => {
795
+ e && e.forEachFeature((n) => {
796
+ const r = n.get("data");
797
+ r && r.id === t && n.setStyle(o ? setShipStyle(!1, r.id) : setBlankStyle());
798
+ });
799
+ }, findShip = (e, t, o = !0) => {
800
+ var r, i, l, s, c;
801
+ if (!e || !mapInstance$6.value) return;
802
+ const n = (l = (i = (r = shipsLayer.value) == null ? void 0 : r.getSource()) == null ? void 0 : i.getFeatures()) == null ? void 0 : l.find((d) => {
803
+ var m;
804
+ return ((m = d.get("data")) == null ? void 0 : m.id) === e;
805
+ });
806
+ if (n ? selectedShipData.value = n.get("data") : t && (selectedShipData.value = t), !t) {
807
+ console.error("找不到船舶");
808
+ return;
809
+ }
810
+ if (o && ((s = selectedShipData.value) != null && s.lon) && ((c = selectedShipData.value) != null && c.lat)) {
811
+ const d = mapInstance$6.value.getView(), m = new Point([selectedShipData.value.lon, selectedShipData.value.lat]);
812
+ d.setCenter(transform(m.getCoordinates(), projection.data, projection.mercator));
813
+ const u = d.getZoom(), f = u < mapZoom.findShipMin ? mapZoom.findShip : u;
814
+ d.setZoom(f);
815
+ }
816
+ return setTimeout(() => {
817
+ selectSingleShipMarker(t);
818
+ }, 50), n;
819
+ }, clearSelectFeature = () => {
820
+ var e;
821
+ if (selectedShipData.value) {
822
+ setVisibleFeatureById(shipsVectorSource, selectSingleShipData.value.id, !1);
823
+ const t = (e = shipsLayer.value) == null ? void 0 : e.getSource();
824
+ t && setVisibleFeatureById(t, selectSingleShipData.value.id, !0);
825
+ }
826
+ selectedShipData.value = null, mapInstance$6.value && (selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsLayer.value = new VectorLayer({
827
+ source: selectShipsVectorSource
828
+ }), mapInstance$6.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!1));
829
+ }, hiddenAllShips = () => {
830
+ var e, t;
831
+ (e = shipsLayer.value) == null || e.setVisible(!1), (t = largeAmountShipsLayer.value) == null || t.setVisible(!1);
832
+ }, switchBtnShow = ref({
833
+ // 船舶摄像头过滤开关
834
+ [SWITCH_BTN.Camera]: !1,
835
+ // 船舶联系方式过滤开关
836
+ [SWITCH_BTN.Mobile]: !1,
837
+ // 船舶水尺过滤开关
838
+ [SWITCH_BTN.WaterGauge]: !1
839
+ }), switchFilterItem = (e, t) => {
840
+ switchBtnShow.value[e] = t, renderShips(allShips.value);
841
+ }, rerenderShip = () => {
842
+ renderShips(allShips.value);
843
+ }, labelAlpha = 0.8, pixelRatio = window.devicePixelRatio || 1, labelFont = `500 ${12 * pixelRatio}px Arial`, labelOutSize = 2 * pixelRatio, labelHeight = 10 * pixelRatio, fillRectRadius = (e, t, o, n, r, i, l = 4) => {
844
+ e.beginPath(), e.moveTo(t + l, o), e.arcTo(t + n, o, t + n, o + l, l), e.arcTo(t + n, o + r, t + n - l, o + r, l), e.arcTo(t, o + r, t, o + r - l, l), e.arcTo(t, o, t + l, o, l), e.closePath(), e.fillStyle = i, e.fill();
469
845
  }, getPixelFromCoordinate = (e) => {
470
846
  if (!e || e.length === 0)
471
847
  throw new Error("Points array is empty or invalid.");
472
- let t = 1 / 0, o = 1 / 0, n = -1 / 0, l = -1 / 0;
473
- for (const [r, i] of e)
474
- r < t && (t = r), i < o && (o = i), r > n && (n = r), i > l && (l = i);
475
- return [t, o, n, l];
848
+ let t = 1 / 0, o = 1 / 0, n = -1 / 0, r = -1 / 0;
849
+ for (const [i, l] of e)
850
+ i < t && (t = i), l < o && (o = l), i > n && (n = i), l > r && (r = l);
851
+ return [t, o, n, r];
476
852
  }, calculatePolygonCentroid = (e) => {
477
853
  if (!Array.isArray(e) || e.length < 3)
478
854
  throw new Error("A polygon must have at least 3 coordinates.");
479
855
  let t = 0, o = 0, n = 0;
480
- const l = e.length;
481
- for (let c = 0; c < l - 1; c++) {
482
- const [s, d] = e[c], [m, u] = e[c + 1], f = s * u - m * d;
483
- n += f, t += (s + m) * f, o += (d + u) * f;
856
+ const r = e.length;
857
+ for (let s = 0; s < r - 1; s++) {
858
+ const [c, d] = e[s], [m, u] = e[s + 1], f = c * u - m * d;
859
+ n += f, t += (c + m) * f, o += (d + u) * f;
484
860
  }
485
861
  if (n *= 0.5, n === 0)
486
862
  throw new Error("多边形面积为零");
487
- const r = t / (6 * n), i = o / (6 * n);
488
- return [r, i];
863
+ const i = t / (6 * n), l = o / (6 * n);
864
+ return [i, l];
489
865
  }, rotateShapeModel = (e, t) => {
490
- const [o, n] = calculatePolygonCentroid(e), l = t * Math.PI / 180, r = Math.cos(l), i = Math.sin(l);
491
- return e.map(([c, s]) => {
492
- const d = c - o, m = s - n, u = d * r - m * i + o, f = d * i + m * r + n;
866
+ const [o, n] = calculatePolygonCentroid(e), r = t * Math.PI / 180, i = Math.cos(r), l = Math.sin(r);
867
+ return e.map(([s, c]) => {
868
+ const d = s - o, m = c - n, u = d * i - m * l + o, f = d * l + m * i + n;
493
869
  return [u, f];
494
870
  });
495
871
  }, getTopLeftPoint = (e) => [e[0], e[3]], getBottomLeftPoint = (e) => [e[2], e[3]], getBottomRightPoint = (e) => [e[2], e[1]], getTopRighttPoint = (e) => [e[0], e[1]];
496
- function calculateBounds(e, t, o, n, l) {
497
- let r, i, c, s;
872
+ function calculateBounds(e, t, o, n, r) {
873
+ let i, l, s, c;
498
874
  const d = e[0], m = e[1];
499
875
  switch (t) {
500
876
  case 0:
501
- r = d + l, i = r + o, s = m - l, c = s - n;
877
+ i = d + r, l = i + o, c = m - r, s = c - n;
502
878
  break;
503
879
  case 1:
504
- r = d + l, i = r + o, s = m + n / 2, c = s - n;
880
+ i = d + r, l = i + o, c = m + n / 2, s = c - n;
505
881
  break;
506
882
  case 2:
507
- r = d + l, i = r + o, s = m + l + n, c = s - n;
883
+ i = d + r, l = i + o, c = m + r + n, s = c - n;
508
884
  break;
509
885
  case 3:
510
- r = d - o / 2, i = r + o, s = m + l + n, c = s - n;
886
+ i = d - o / 2, l = i + o, c = m + r + n, s = c - n;
511
887
  break;
512
888
  case 4:
513
- i = d, r = i - o, s = m + l + n, c = s - n;
889
+ l = d, i = l - o, c = m + r + n, s = c - n;
514
890
  break;
515
891
  case 5:
516
- i = d - l, r = i - o, s = m + n / 2, c = s - n;
892
+ l = d - r, i = l - o, c = m + n / 2, s = c - n;
517
893
  break;
518
894
  case 6:
519
- i = d, r = i - o, s = m - l, c = s - n;
895
+ l = d, i = l - o, c = m - r, s = c - n;
520
896
  break;
521
897
  case 7:
522
- r = d - o / 2, i = r + o, s = m - l, c = s - n;
898
+ i = d - o / 2, l = i + o, c = m - r, s = c - n;
523
899
  }
524
- if (!(!r || !c || !i || !s))
525
- return [Math.min(r, i), Math.min(c, s), Math.max(r, i), Math.max(c, s) + 1];
900
+ if (!(!i || !s || !l || !c))
901
+ return [Math.min(i, l), Math.min(s, c), Math.max(i, l), Math.max(s, c) + 1];
526
902
  }
527
- function calculateAnchorPoint(e, t, o = 70, n = 20, l = 20) {
528
- const r = [0, 0];
903
+ function calculateAnchorPoint(e, t, o = 70, n = 20, r = 20) {
904
+ const i = [0, 0];
529
905
  switch (t) {
530
906
  case 0:
531
- r[0] = e[0] + l, r[1] = e[1] - l - n / 2;
907
+ i[0] = e[0] + r, i[1] = e[1] - r - n / 2;
532
908
  break;
533
909
  case 1:
534
- r[0] = e[0] + l, r[1] = e[1];
910
+ i[0] = e[0] + r, i[1] = e[1];
535
911
  break;
536
912
  case 2:
537
- r[0] = e[0] + l, r[1] = e[1] + l + n / 2;
913
+ i[0] = e[0] + r, i[1] = e[1] + r + n / 2;
538
914
  break;
539
915
  case 3:
540
- r[0] = e[0], r[1] = e[1] + l + n / 4;
916
+ i[0] = e[0], i[1] = e[1] + r + n / 4;
541
917
  break;
542
918
  case 4:
543
- r[0] = Math.max(e[0] - l, e[0] - o / 2), r[1] = e[1] + l + n / 4;
919
+ i[0] = Math.max(e[0] - r, e[0] - o / 2), i[1] = e[1] + r + n / 4;
544
920
  break;
545
921
  case 5:
546
- r[0] = e[0] - l, r[1] = e[1];
922
+ i[0] = e[0] - r, i[1] = e[1];
547
923
  break;
548
924
  case 6:
549
- r[0] = Math.max(e[0] - l, e[0] - o / 2), r[1] = e[1] - l - n / 4;
925
+ i[0] = Math.max(e[0] - r, e[0] - o / 2), i[1] = e[1] - r - n / 4;
550
926
  break;
551
927
  case 7:
552
- r[0] = e[0], r[1] = e[1] - l - n / 4;
928
+ i[0] = e[0], i[1] = e[1] - r - n / 4;
553
929
  }
554
- return r;
930
+ return i;
555
931
  }
556
932
  function drawLabelBody(e, t, o) {
557
933
  if (!e) return;
558
934
  const {
559
935
  font: n,
560
- labelOutSize: l = 2,
561
- labelHeight: r,
562
- center: i,
563
- text: c,
564
- leftIcon: s,
936
+ labelOutSize: r = 2,
937
+ labelHeight: i,
938
+ center: l,
939
+ text: s,
940
+ leftIcon: c,
565
941
  shipColor: d,
566
942
  lineLength: m = 20,
567
943
  selected: u
568
944
  } = o;
569
945
  e.save(), n && (e.font = n);
570
- let f = e.measureText(c).width + 4 * l;
571
- (s || d) && (f += r + 6 * l), e.restore();
572
- let p, w = 20, h = -1, g = r + 3 * l;
946
+ let f = e.measureText(s).width + 4 * r;
947
+ (c || d) && (f += i + 6 * r), e.restore();
948
+ let p, y = 20, h = -1, g = i + 3 * r;
573
949
  if (m)
574
- for (let T = 0; T < 8; T++) {
575
- p = calculateBounds(i, T, f, g, m);
950
+ for (let k = 0; k < 8; k++) {
951
+ p = calculateBounds(l, k, f, g, m);
576
952
  let M = !1;
577
953
  for (let b = 0; b < t.length; ++b) {
578
- let V = t[b].bounds, P = [
579
- V[0] - w,
580
- V[1] - w,
581
- V[2] + w,
582
- V[3] + w
954
+ let F = t[b].bounds, V = [
955
+ F[0] - y,
956
+ F[1] - y,
957
+ F[2] + y,
958
+ F[3] + y
583
959
  ];
584
- if (p && isOverlapping(p, P)) {
960
+ if (p && isOverlapping(p, V)) {
585
961
  M = !0;
586
962
  break;
587
963
  }
588
964
  }
589
965
  if (!M) {
590
- h = T;
966
+ h = k;
591
967
  break;
592
968
  }
593
969
  }
594
970
  else
595
- h = 0, p = calculateBounds(i, h, f, g, m);
971
+ h = 0, p = calculateBounds(l, h, f, g, m);
596
972
  if (u && h === -1 && (h = 0), p && h > -1) {
597
- let T = getBottomLeftPoint(p), M = getTopRighttPoint(p);
973
+ let k = getBottomLeftPoint(p), M = getTopRighttPoint(p);
598
974
  return {
599
- center: i,
600
- x: calculateAnchorPoint(i, h, f, g, m),
975
+ center: l,
976
+ x: calculateAnchorPoint(l, h, f, g, m),
601
977
  l: M,
602
- r: T,
978
+ r: k,
603
979
  bounds: p,
604
980
  position: h,
605
- name: c
981
+ name: s
606
982
  };
607
983
  } else
608
984
  return null;
609
985
  }
610
986
  const drawText = (e, t) => {
611
987
  if (!e) return;
612
- const { center: o, text: n, textColor: l, leftIcon: r, rightIcons: i, font: c } = t;
988
+ const { center: o, text: n, textColor: r, leftIcon: i, rightIcons: l, font: s } = t;
613
989
  e.save(), e.setTransform(1, 0, 0, 1, 0, 0);
614
- let [s, d] = o;
615
- if (r) {
990
+ let [c, d] = o;
991
+ if (i) {
616
992
  e.font = `${20 * pixelRatio}px map-iconfont`;
617
- let m = getIconFont(r.icon);
618
- e.fillStyle = r.color, e.fillText(m, s + labelOutSize - 3.2 * pixelRatio, d + 3.2 * pixelRatio), s += 23 * pixelRatio;
993
+ let m = getIconFont(i.icon);
994
+ e.fillStyle = i.color, e.fillText(m, c + labelOutSize - 3.2 * pixelRatio, d + 3.2 * pixelRatio), c += 23 * pixelRatio;
619
995
  }
620
- if (i != null && i.length) {
996
+ if (l != null && l.length) {
621
997
  e.font = `${12 * pixelRatio}px map-iconfont`, e.fillStyle = "#3370ff";
622
998
  const m = e.measureText(n).width + 3 * pixelRatio;
623
- i.forEach((u, f) => {
624
- const p = getIconFont(u), w = 20 * pixelRatio * f;
625
- e.fillText(p, s + m + w, d);
999
+ l.forEach((u, f) => {
1000
+ const p = getIconFont(u), y = 20 * pixelRatio * f;
1001
+ e.fillText(p, c + m + y, d);
626
1002
  });
627
1003
  }
628
- e.font = c || labelFont, e.fillStyle = l, e.fillText(n, s + 2, d), e.restore();
1004
+ e.font = s || labelFont, e.fillStyle = r, e.fillText(n, c + 2, d), e.restore();
629
1005
  }, drawPolygon = (e, t) => {
630
1006
  let {
631
1007
  points: o,
632
1008
  strokeColor: n,
633
- fillColor: l,
634
- shouldClosePath: r,
635
- translation: i,
636
- rotation: c,
637
- rotationCenter: s,
1009
+ fillColor: r,
1010
+ shouldClosePath: i,
1011
+ translation: l,
1012
+ rotation: s,
1013
+ rotationCenter: c,
638
1014
  scale: d,
639
1015
  globalAlpha: m
640
1016
  } = t;
641
1017
  if (m || (m = 1), o && e) {
642
- e.save(), e.beginPath(), c && c !== 0 && s == null && e.rotate(c), i && e.translate(i[0], i[1]), c && (s != null && s.length) && e.rotate(c), d && e.scale(d, d), e.moveTo(o[0][0], o[0][1]);
1018
+ e.save(), e.beginPath(), s && s !== 0 && c == null && e.rotate(s), l && e.translate(l[0], l[1]), s && (c != null && c.length) && e.rotate(s), d && e.scale(d, d), e.moveTo(o[0][0], o[0][1]);
643
1019
  for (let u = 1; u < o.length; u++)
644
1020
  e.lineTo(o[u][0], o[u][1]);
645
- r && e.closePath(), n && (e.strokeStyle = n, e.stroke()), l && r && (m && (e.globalAlpha = m), e.fillStyle = l, e.fill()), e.restore();
1021
+ i && e.closePath(), n && (e.strokeStyle = n, e.stroke()), r && i && (m && (e.globalAlpha = m), e.fillStyle = r, e.fill()), e.restore();
646
1022
  }
647
- }, intervalId = [], drawLabel = (e, t, o) => {
648
- var u, f, p, w, h, g, T, M;
649
- let { center: n, text: l, color: r, textColor: i, bgColor: c, leftIcon: s, rightIcons: d, type: m } = t;
650
- if (n && l) {
651
- const b = {
1023
+ }, intervalIds = {}, drawLabel = (e, t, o) => {
1024
+ var u, f, p, y, h, g, k;
1025
+ let { center: n, text: r, color: i, textColor: l, bgColor: s, leftIcon: c, rightIcons: d, type: m } = t;
1026
+ if (n && r) {
1027
+ const M = {
652
1028
  font: labelFont,
653
1029
  labelOutSize,
654
1030
  labelHeight,
655
1031
  center: n,
656
- text: l,
657
- leftIcon: s,
1032
+ text: r,
1033
+ leftIcon: c,
658
1034
  selected: t.selected
659
1035
  };
660
- (u = t.blinkColors) != null && u.length && (c = t.fill, i = getForegroundColor(t.fill));
661
- const V = drawLabelBody(e, o, b);
662
- if (V) {
663
- const { x: P, bounds: x, l: v } = V, y = [getTopLeftPoint(x), getBottomLeftPoint(x), getBottomRightPoint(x), getTopRighttPoint(x)];
664
- o.find((F) => F.name === l) || o.push(V), drawPolygon(e, {
665
- points: [n, P],
666
- strokeColor: r,
1036
+ (u = t.blinkColors) != null && u.length && (s = t.fill, l = getForegroundColor(t.fill));
1037
+ const b = drawLabelBody(e, o, M);
1038
+ if (b) {
1039
+ const { x: F, bounds: V, l: P } = b, v = [getTopLeftPoint(V), getBottomLeftPoint(V), getBottomRightPoint(V), getTopRighttPoint(V)];
1040
+ o.find((E) => E.name === r) || o.push(b), drawPolygon(e, {
1041
+ points: [n, F],
1042
+ strokeColor: i,
667
1043
  fillColor: "#000",
668
1044
  shouldClosePath: !0,
669
1045
  translation: void 0,
@@ -672,45 +1048,50 @@ const drawText = (e, t) => {
672
1048
  scale: void 0,
673
1049
  globalAlpha: labelAlpha
674
1050
  }), d != null && d.length && d.forEach(() => {
675
- y[1][0] += 20, y[2][0] += 20;
1051
+ v[1][0] += 20, v[2][0] += 20;
676
1052
  });
677
- const k = {
678
- points: y,
679
- strokeColor: r,
680
- fillColor: c,
1053
+ const w = {
1054
+ points: v,
1055
+ strokeColor: i,
1056
+ fillColor: s,
681
1057
  shouldClosePath: !0
682
- }, [S, E] = v, C = {
683
- center: [S, E + labelOutSize + labelHeight + 1],
684
- text: l,
685
- textColor: i,
686
- leftIcon: s,
1058
+ }, [S, T] = P, C = {
1059
+ center: [S, T + labelOutSize + labelHeight + 1],
1060
+ text: r,
1061
+ textColor: l,
1062
+ leftIcon: c,
687
1063
  rightIcons: d,
688
1064
  blinkColors: t.blinkColors
689
1065
  };
690
- if (drawPolygon(e, k), drawText(e, C), ((f = t == null ? void 0 : t.blinkColors) == null ? void 0 : f.length) > 0) {
691
- let F = Date.now(), $ = 0;
692
- const R = [];
693
- t.blinkColors.forEach((N) => {
694
- R.push(N), R.push("white");
695
- });
696
- const A = !!((h = (w = (p = selectShipsLayer.value) == null ? void 0 : p.getSource()) == null ? void 0 : w.getFeatures()) != null && h.find((N) => {
697
- var O;
698
- return ((O = N.get("data")) == null ? void 0 : O.id) === t.id;
699
- }) || (M = (T = (g = shipsLayer.value) == null ? void 0 : g.getSource()) == null ? void 0 : T.getFeatures()) != null && M.find((N) => {
700
- var O;
701
- return ((O = N.get("data")) == null ? void 0 : O.id) === t.id;
702
- }));
703
- !A || hiddenOrther.value ? (clearInterval(intervalId[t.id]), deleteLabelFromArray(o, l)) : (intervalId[t.id] && clearInterval(intervalId[t.id]), intervalId[t.id] = setInterval(() => {
704
- const N = Date.now();
705
- N - F >= 500 && ($ = ($ + 1) % R.length, F = N, k.fillColor = R[$], drawPolygon(e, k), C.textColor = getForegroundColor(k.fillColor), drawText(e, C), (!A || hiddenOrther.value) && (clearInterval(intervalId[t.id]), deleteLabelFromArray(o, l)));
1066
+ if (drawPolygon(e, w), drawText(e, C), t != null && t.blinkColors && t.blinkColors.length > 0) {
1067
+ let E = Date.now(), x = 0;
1068
+ const N = t.blinkColors;
1069
+ !!!((y = (p = (f = selectShipsLayer.value) == null ? void 0 : f.getSource()) == null ? void 0 : p.getFeatures()) != null && y.find(($) => {
1070
+ var R;
1071
+ return ((R = $.get("data")) == null ? void 0 : R.id) === t.id;
1072
+ }) || (k = (g = (h = shipsLayer.value) == null ? void 0 : h.getSource()) == null ? void 0 : g.getFeatures()) != null && k.find(($) => {
1073
+ var R;
1074
+ return ((R = $.get("data")) == null ? void 0 : R.id) === t.id;
1075
+ })) || hiddenOrther.value ? (clearInterval(intervalIds[t.id]), deleteLabelFromArray(o, r)) : (intervalIds[t.id] && clearInterval(intervalIds[t.id]), intervalIds[t.id] = window.setInterval(() => {
1076
+ var D, G, _;
1077
+ const $ = Date.now();
1078
+ $ - E >= 500 && (x = (x + 1) % N.length, E = $, w.fillColor = N[x], drawPolygon(e, w), C.textColor = getForegroundColor(w.fillColor), drawText(e, C));
1079
+ const R = shipsMarkerList == null ? void 0 : shipsMarkerList.some((O) => {
1080
+ var B;
1081
+ return ((B = O.ship) == null ? void 0 : B.id) === t.id;
1082
+ }), Z = (_ = (G = (D = shipsLayer.value) == null ? void 0 : D.getSource()) == null ? void 0 : G.getFeatures()) == null ? void 0 : _.some((O) => {
1083
+ const B = O.get("data");
1084
+ return (B == null ? void 0 : B.id) === t.id;
1085
+ });
1086
+ !R && !Z && (clearInterval(intervalIds[t.id]), deleteLabelFromArray(o, r));
706
1087
  }, 10));
707
1088
  } else
708
- shipLabels.value.find(($) => $.name === l) && (clearInterval(intervalId[t.id]), drawPolygon(e, k), drawText(e, C));
1089
+ shipLabels.value.find((x) => x.name === r) && (clearInterval(intervalIds[t.id]), drawPolygon(e, w), drawText(e, C));
709
1090
  }
710
1091
  }
711
1092
  return null;
712
1093
  }, clearAllInterval = () => {
713
- Object.keys(intervalId).forEach((e) => {
1094
+ Object.keys(intervalIds).forEach((e) => {
714
1095
  clearInterval(e);
715
1096
  });
716
1097
  }, deleteLabelFromArray = (e, t) => {
@@ -733,28 +1114,28 @@ function gcj02ToWgs84(e) {
733
1114
  if (outOfChina(t, o))
734
1115
  return `${t.toFixed(6)}, ${o.toFixed(6)}`;
735
1116
  {
736
- let n = transformLat(t - 105, o - 35), l = transformLng(t - 105, o - 35);
737
- const r = o / 180 * PI;
738
- let i = Math.sin(r);
739
- i = 1 - ee * i * i;
740
- const c = Math.sqrt(i);
741
- n = n * 180 / (a * (1 - ee) / (i * c) * PI), l = l * 180 / (a / c * Math.cos(r) * PI);
742
- const s = o + n, d = t + l;
743
- return `${(t * 2 - d).toFixed(6)}, ${(o * 2 - s).toFixed(6)}`;
1117
+ let n = transformLat(t - 105, o - 35), r = transformLng(t - 105, o - 35);
1118
+ const i = o / 180 * PI;
1119
+ let l = Math.sin(i);
1120
+ l = 1 - ee * l * l;
1121
+ const s = Math.sqrt(l);
1122
+ n = n * 180 / (a * (1 - ee) / (l * s) * PI), r = r * 180 / (a / s * Math.cos(i) * PI);
1123
+ const c = o + n, d = t + r;
1124
+ return `${(t * 2 - d).toFixed(6)}, ${(o * 2 - c).toFixed(6)}`;
744
1125
  }
745
1126
  }
746
1127
  function calculateCirclePoints(e, t) {
747
- const o = fromLonLat(e), n = t * 1e3, l = [
1128
+ const o = fromLonLat(e), n = t * 1e3, r = [
748
1129
  o[0] - n,
749
1130
  o[1] - n,
750
1131
  o[0] + n,
751
1132
  o[1] + n
752
- ], r = transformExtent(l, projection.mercator, projection.data);
1133
+ ], i = transformExtent(r, projection.mercator, projection.data);
753
1134
  return {
754
- leftTopPoint: { lng: r[0], lat: r[3] },
755
- rightTopPoint: { lng: r[2], lat: r[3] },
756
- rightBottomPoint: { lng: r[2], lat: r[1] },
757
- leftBottomPoint: { lng: r[0], lat: r[1] }
1135
+ leftTopPoint: { lng: i[0], lat: i[3] },
1136
+ rightTopPoint: { lng: i[2], lat: i[3] },
1137
+ rightBottomPoint: { lng: i[2], lat: i[1] },
1138
+ leftBottomPoint: { lng: i[0], lat: i[1] }
758
1139
  };
759
1140
  }
760
1141
  const equatorialCircumference = 2003750834e-2;
@@ -765,17 +1146,17 @@ function lonLatToMercator(e) {
765
1146
  }
766
1147
  function mercatorToLonLat(e, t = "lonlat") {
767
1148
  const o = { lon: 0, lat: 0 }, n = e[0] / equatorialCircumference * 180;
768
- let l = e[1] / equatorialCircumference * 180;
769
- return l = 180 / Math.PI * (2 * Math.atan(Math.exp(l * Math.PI / 180)) - Math.PI / 2), o.lon = n, o.lat = l, t === "lonlat" ? o : [n, l];
1149
+ let r = e[1] / equatorialCircumference * 180;
1150
+ return r = 180 / Math.PI * (2 * Math.atan(Math.exp(r * Math.PI / 180)) - Math.PI / 2), o.lon = n, o.lat = r, t === "lonlat" ? o : [n, r];
770
1151
  }
771
1152
  function calculateBoundingBox(e) {
772
- let t = 1 / 0, o = -1 / 0, n = 1 / 0, l = -1 / 0;
1153
+ let t = 1 / 0, o = -1 / 0, n = 1 / 0, r = -1 / 0;
773
1154
  e.forEach((h) => {
774
- const [g, T] = h;
775
- t = Math.min(t, T), o = Math.max(o, T), n = Math.min(n, g), l = Math.max(l, g);
1155
+ const [g, k] = h;
1156
+ t = Math.min(t, k), o = Math.max(o, k), n = Math.min(n, g), r = Math.max(r, g);
776
1157
  });
777
- const r = l - n, i = o - t, c = Math.max(r, i), s = (n + l) / 2, d = (t + o) / 2, m = c / 2, u = s - m, f = s + m, p = d - m, w = d + m;
778
- return [f, p, u, w];
1158
+ const i = r - n, l = o - t, s = Math.max(i, l), c = (n + r) / 2, d = (t + o) / 2, m = s / 2, u = c - m, f = c + m, p = d - m, y = d + m;
1159
+ return [f, p, u, y];
779
1160
  }
780
1161
  const transformUtils = {
781
1162
  gcj02ToWgs84,
@@ -783,14 +1164,16 @@ const transformUtils = {
783
1164
  lonLatToMercator,
784
1165
  mercatorToLonLat,
785
1166
  calculateBoundingBox
786
- }, mapInstance$7 = ref(), renderTrackStyleSetInstance = (e) => mapInstance$7.value = e, stopIcon = "&#xe6e2;", stopColor = "#E31818", slowIcon = "&#xe703;", slowColor = "#1890FF", dropletsIcon = "&#xe6d2", trackList$1 = ref([]), renderTrackLine = (e, t, o) => {
787
- var r, i, c;
1167
+ }, mapInstance$5 = ref(), renderTrackStyleSetInstance = (e) => mapInstance$5.value = e, stopIcon = "&#xe6e2;", stopColor = "#E31818", slowIcon = "&#xe703;", slowColor = "#1890FF", dropletsIcon = "&#xe6d2", trackList$1 = ref([]);
1168
+ let animationFeature;
1169
+ const renderTrackLine = (e, t, o) => {
1170
+ var i, l, s;
788
1171
  const n = e[t];
789
1172
  if (!n) return;
790
- allTracks.value[t] = n, trackList$1.value = [], trackList$1.value = n.map((s, d) => (s.center = [s.lon, s.lat], s.centerPoint = transformUtils.lonLatToMercator(s.center), s.id = t, s.index = d, s.time = hooks(s.createdAt).format("YYYY-MM-DD HH:mm:ss"), s));
791
- const l = trackList$1.value.map((s) => s.centerPoint);
792
- if (l.length >= 2) {
793
- const s = new LineString(l), d = new Feature({ geometry: s });
1173
+ allTracks.value[t] = n, trackList$1.value = [], trackList$1.value = n.map((c, d) => (c.center = [c.lon, c.lat], c.centerPoint = transformUtils.lonLatToMercator(c.center), c.id = t, c.index = d, c.time = hooks(c.createdAt).format("YYYY-MM-DD HH:mm:ss"), c));
1174
+ const r = trackList$1.value.map((c) => c.centerPoint);
1175
+ if (r.length >= 2) {
1176
+ const c = new LineString(r), d = new Feature({ geometry: c });
794
1177
  d.setStyle(
795
1178
  new Style({
796
1179
  stroke: new Stroke({
@@ -798,13 +1181,15 @@ const transformUtils = {
798
1181
  width: 2
799
1182
  })
800
1183
  })
801
- ), d.setId(t), d.set("type", "line"), (i = (r = shipTrackVectorLayer.value) == null ? void 0 : r.getSource()) == null || i.clear(), shipTrackLineFeatures.value = [];
802
- const m = shipTrackLineFeatures.value.findIndex((u) => u.getId() === t);
803
- m >= 0 ? shipTrackLineFeatures.value[m] = d : shipTrackLineFeatures.value.push(d), createAnimatedIconFeature(o, l), trackLineVectorSource.value = new VectorSource({
1184
+ ), d.setId(t), d.set("type", "line"), (l = (i = shipTrackVectorLayer.value) == null ? void 0 : i.getSource()) == null || l.clear(), shipTrackLineFeatures.value = [];
1185
+ const m = shipTrackLineFeatures.value.findIndex((f) => f.getId() === t);
1186
+ m >= 0 ? shipTrackLineFeatures.value[m] = d : shipTrackLineFeatures.value.push(d);
1187
+ const u = createAnimatedIconFeature(o, r);
1188
+ trackLineVectorSource.value = new VectorSource({
804
1189
  features: [...shipTrackLineFeatures.value]
805
- }), shipTrackVectorLayer.value = new VectorLayer({
1190
+ }), animationFeature = u, console.log(animationFeature), shipTrackVectorLayer.value = new VectorLayer({
806
1191
  source: trackLineVectorSource.value
807
- }), renderPoint(o), (c = mapInstance$7.value) == null || c.addLayer(shipTrackVectorLayer.value);
1192
+ }), renderPoint(o), (s = mapInstance$5.value) == null || s.addLayer(shipTrackVectorLayer.value);
808
1193
  }
809
1194
  }, handlePlay = (e, t) => {
810
1195
  const o = allTracks.value[String(e)];
@@ -838,27 +1223,31 @@ let polyline, linePath, startMarker, position, geoMarker, vectorLayer;
838
1223
  const trackAnimating = ref(!1);
839
1224
  let distance = 0, lastTime = Date.now(), moveFeatureHandler = null;
840
1225
  const moveFeature = (e, t) => {
841
- var u, f;
842
- const o = Number(50 * t), n = e.frameState.time, l = n - lastTime;
843
- if (distance = (distance + o * l / 1e6) % 2, lastTime = n, distance >= 1) {
1226
+ var u, f, p;
1227
+ const o = Number(50 * t), n = ((u = e.frameState) == null ? void 0 : u.time) ?? Date.now(), r = n - lastTime;
1228
+ if (distance = (distance + o * r / 1e6) % 2, lastTime = n, distance >= 1) {
844
1229
  stopAnimation();
845
1230
  return;
846
1231
  }
847
- const r = linePath.getCoordinateAt(
1232
+ const i = linePath.getCoordinateAt(
848
1233
  distance > 1 ? 2 - distance : distance
849
- ), i = linePath.getCoordinateAt(
1234
+ ), l = linePath.getCoordinateAt(
850
1235
  distance > 1 ? distance - 0.01 : distance
851
- ), c = linePath.getCoordinateAt(
1236
+ ), s = linePath.getCoordinateAt(
852
1237
  distance > 1 ? 2 - distance : distance + 0.01
853
- ), d = getRotation(transformUtils.mercatorToLonLat(i, "array"), transformUtils.mercatorToLonLat(c, "array")) * Math.PI / 180;
854
- (u = geoMarkerStyle.getText()) == null || u.setRotation(d), position.setCoordinates(r);
1238
+ ), d = getRotation(
1239
+ transformUtils.mercatorToLonLat(l, "array"),
1240
+ transformUtils.mercatorToLonLat(s, "array")
1241
+ ) * Math.PI / 180;
1242
+ (f = geoMarkerStyle.getText()) == null || f.setRotation(d), position.setCoordinates(i);
855
1243
  const m = getVectorContext(e);
856
- m.context_.save(), m.setStyle(geoMarkerStyle), m.drawGeometry(position), m.context_.restore(), (f = mapInstance$7.value) == null || f.render();
1244
+ m.context_.save(), m.setStyle(geoMarkerStyle), m.drawGeometry(position), m.context_.restore(), (p = mapInstance$5.value) == null || p.render();
857
1245
  }, startAnimation = () => {
858
- trackAnimating.value = !0, showTrackAnimatMarker.value = !0, lastTime = Date.now(), distance = 0, position = startMarker.getGeometry().clone(), vectorLayer.on("postrender", moveFeatureHandler), geoMarker.setGeometry(null);
1246
+ var e;
1247
+ trackAnimating.value = !0, showTrackAnimatMarker.value = !0, lastTime = Date.now(), distance = 0, position = ((e = startMarker.getGeometry()) == null ? void 0 : e.clone()) || new Point([0, 0]), vectorLayer.on("postrender", moveFeatureHandler), geoMarker.setGeometry(void 0);
859
1248
  }, stopAnimation = () => {
860
1249
  var e;
861
- trackAnimating.value && (trackAnimating.value = !1, geoMarker.setGeometry(null), vectorLayer.un("postrender", moveFeatureHandler), (e = mapInstance$7.value) == null || e.removeLayer(vectorLayer), vectorLayer = null, geoMarker = null);
1250
+ trackAnimating.value && (trackAnimating.value = !1, geoMarker.setGeometry(void 0), vectorLayer.un("postrender", moveFeatureHandler), (e = mapInstance$5.value) == null || e.removeLayer(vectorLayer), vectorLayer = null, geoMarker = null);
862
1251
  }, playAnimation = (e, t) => {
863
1252
  var o;
864
1253
  trackAnimating.value && stopAnimation(), polyline = new Polyline({
@@ -879,560 +1268,195 @@ const moveFeature = (e, t) => {
879
1268
  source: new VectorSource({
880
1269
  features: [geoMarker]
881
1270
  })
882
- }), (o = mapInstance$7.value) == null || o.addLayer(vectorLayer), moveFeatureHandler = (n) => moveFeature(n, t), startAnimation();
1271
+ }), (o = mapInstance$5.value) == null || o.addLayer(vectorLayer), moveFeatureHandler = (n) => moveFeature(n, t), startAnimation();
883
1272
  }, renderPoint = (e) => {
884
- if (!mapInstance$7.value) return;
1273
+ if (!mapInstance$5.value) return;
885
1274
  const t = trackList$1.value || [];
886
1275
  if (!(t && t.length > 1)) return [];
887
- const o = { 16: 24, 17: 15, default: 4 }, n = [], l = t.length;
888
- for (let c = 0; c < l; c++) {
889
- t[c].index = c;
890
- const s = mapInstance$7.value.getPixelFromCoordinate(t[c].centerPoint);
891
- if (s) {
892
- let d = s.concat(s);
1276
+ const o = { 16: 24, 17: 15, default: 4 }, n = [], r = t.length;
1277
+ for (let s = 0; s < r; s++) {
1278
+ t[s].index = s;
1279
+ const c = mapInstance$5.value.getPixelFromCoordinate(t[s].centerPoint);
1280
+ if (c) {
1281
+ let d = c.concat(c);
893
1282
  d = adjustBounds(d, [20, 20]);
894
- const m = mapInstance$7.value.getView().getZoom();
1283
+ const m = mapInstance$5.value.getView().getZoom();
895
1284
  if (!m) return;
896
1285
  if (m > 15) {
897
1286
  const f = o[m] || o.default;
898
1287
  d = adjustBounds(d, [f, f]);
899
1288
  }
900
1289
  let u = !0;
901
- if (t[c].state !== "0") {
1290
+ if (t[s].state !== "0") {
902
1291
  for (let f = 0; f < n.length; f++)
903
1292
  if (isOverlapping(d, n[f].bounds)) {
904
1293
  u = !1;
905
1294
  break;
906
1295
  }
907
1296
  }
908
- u && (t[c].bounds = d, n.push(t[c]));
1297
+ u && (t[s].bounds = d, n.push(t[s]));
909
1298
  }
910
1299
  }
911
- const r = getIconStyle(stopIcon), i = getIconStyle(slowIcon);
912
- n.forEach((c, s) => {
1300
+ const i = getIconStyle(stopIcon), l = getIconStyle(slowIcon);
1301
+ n.forEach((s, c) => {
913
1302
  var u, f;
914
1303
  const d = new Feature({
915
- geometry: new Point(c.centerPoint)
1304
+ geometry: new Point(s.centerPoint)
916
1305
  });
917
- d.set("type", "track_point"), d.set("data", c), d.setStyle([
1306
+ d.set("type", "track_point"), d.set("data", s), d.setStyle([
918
1307
  new Style({
919
1308
  // 扩大交互热区
920
1309
  image: new CircleStyle({
921
- stroke: new Stroke({ color: "rgba(0, 0, 0, 0.01)", width: 20 }),
922
- radius: 3
923
- })
924
- }),
925
- new Style({
926
- // 轨迹点样式
927
- image: new CircleStyle({
928
- fill: new Fill({ color: e }),
929
- stroke: new Stroke({ color: "#fff", width: 2 }),
930
- radius: 3
931
- })
932
- })
933
- ]), trackLineVectorSource.value.addFeature(d);
934
- const m = new Feature({
935
- geometry: new Point(fromLonLat(c.center))
936
- });
937
- if (m.set("type", "track_label"), m.set("track_label_index", s), m.setStyle(
938
- setTrackLabelStyle(c, e)
939
- ), trackLineVectorSource.value.addFeature(m), typeof c == "object" && c.hasOwnProperty("state")) {
940
- const p = new Feature({
941
- geometry: new Point(c.centerPoint)
942
- });
943
- p.set("type", "track_icon");
944
- const w = new Style({
945
- text: new Text({
946
- font: "Normal 22px map-iconfont",
947
- text: getIconFont(dropletsIcon),
948
- offsetY: -10
949
- }),
950
- zIndex: 99
951
- }), h = [];
952
- Number(c.state) === 0 ? ((u = w.getText()) == null || u.setFill(new Fill({ color: stopColor })), h.push(r)) : Number(c.state) === 1 && ((f = w.getText()) == null || f.setFill(new Fill({ color: slowColor })), h.push(i)), h.push(w), p.setStyle(h), trackLineVectorSource.value.addFeature(p);
953
- }
954
- }), renderArrow(n, e), renderIconPoint();
955
- }, renderArrow = (e, t) => {
956
- const o = e.length;
957
- o || (e.push(trackList$1.value[0]), e.push(trackList$1.value[trackList$1.value.length - 1]));
958
- for (let n = 0; n < o - 1; n++) {
959
- let l;
960
- const r = e[n], i = (e[n + 1].index + r.index) / 2;
961
- if (i % 2 === 0)
962
- l = trackList$1.value[i].centerPoint;
963
- else {
964
- const c = trackList$1.value[Math.floor(i)], s = trackList$1.value[Math.ceil(i)];
965
- if (c && s) {
966
- const [d, m] = c.centerPoint, [u, f] = s.centerPoint;
967
- l = [(d + u) / 2, (m + f) / 2];
968
- }
969
- }
970
- if (l) {
971
- const c = new Feature({
972
- geometry: new Point(l)
973
- });
974
- c.set("type", "track_arrow"), c.setStyle(
975
- new Style({
976
- text: new Text({
977
- font: "700 14px map-iconfont",
978
- text: getIconFont("&#xe6bc;"),
979
- fill: new Fill({ color: t }),
980
- // 设置箭头旋转 角度转为弧度
981
- rotation: getRotation(
982
- e[n].center,
983
- e[n + 1].center
984
- ) * (Math.PI / 180)
985
- })
986
- })
987
- ), trackLineVectorSource.value.addFeature(c);
988
- }
989
- }
990
- }, renderIconPoint = () => {
991
- const e = "&#xe69b;", t = "#fcdc3f", o = "#ff0000";
992
- (trackList$1.value.length < 2 ? [trackList$1.value[0]] : [trackList$1.value[0], trackList$1.value[trackList$1.value.length - 1]]).forEach((l) => {
993
- const r = new Feature({
994
- geometry: new Point(l.centerPoint)
995
- });
996
- r.set("type", "track_begin"), r.set("data", l);
997
- const i = l.index === 0 && trackList$1.value.length >= 2 ? t : o;
998
- r.setStyle(
999
- new Style({
1000
- text: new Text({
1001
- font: "Normal 14px map-iconfont",
1002
- text: getIconFont(e),
1003
- fill: new Fill({ color: i })
1004
- }),
1005
- zIndex: 101
1006
- })
1007
- ), trackLineVectorSource.value.addFeature(r);
1008
- });
1009
- }, setTrackLabelStyle = (e, t) => new Style({
1010
- renderer: (o, n) => {
1011
- const l = n.context, c = {
1012
- center: o,
1013
- text: e.time,
1014
- color: t,
1015
- textColor: "#000",
1016
- bgColor: "rgba(255,255,255,.8)",
1017
- selected: !0,
1018
- type: "TrackTime"
1019
- };
1020
- drawLabel(l, c, trackLabels.value);
1021
- }
1022
- }), triangleModel = multiplyPixelRatio([
1023
- [0, -8],
1024
- [5, 8],
1025
- [-5, 8]
1026
- ]), shipShapeModel = multiplyPixelRatio([
1027
- [0, -4.545],
1028
- [-0.56, -3.909],
1029
- [-1, -2.727],
1030
- [-1, 3.636],
1031
- [-0.8, 4.545],
1032
- [0.8, 4.545],
1033
- [1, 3.636],
1034
- [1, -2.727],
1035
- [0.56, -3.909],
1036
- [0, -4.545]
1037
- ]), shipDirectPath = {
1038
- left: {
1039
- 0: [
1040
- [0, 0],
1041
- [0, -8],
1042
- [-4, -8]
1043
- ],
1044
- 1: [
1045
- [0, 0],
1046
- [0, -16],
1047
- [-6, -16]
1048
- ],
1049
- 2: [
1050
- [0, 0],
1051
- [0, -24],
1052
- [-8, -24]
1053
- ]
1054
- },
1055
- right: {
1056
- 0: [
1057
- [0, 0],
1058
- [0, -8],
1059
- [-4, -8]
1060
- ],
1061
- 1: [
1062
- [0, 0],
1063
- [0, -16],
1064
- [-6, -16]
1065
- ],
1066
- 2: [
1067
- [0, 0],
1068
- [0, -24],
1069
- [-8, -24]
1070
- ]
1071
- },
1072
- front: {
1073
- 0: [
1074
- [0, 0],
1075
- [0, -8]
1076
- ],
1077
- 1: [
1078
- [0, 0],
1079
- [0, -16]
1080
- ],
1081
- 2: [
1082
- [0, 0],
1083
- [0, -24]
1084
- ]
1085
- }
1086
- }, setBlankStyle = () => new Style({
1087
- image: new CircleStyle({
1088
- radius: 0
1089
- })
1090
- }), mapInstance$6 = ref(), renderShipStyleSetInstance = (e) => mapInstance$6.value = e, speedCondition = [[1, 10], [10, 20], [20, 1 / 0]], drawShipModelByZoom = { 14: [200, 30], 15: [115, 15], 16: [55, 8], 17: [25, 5], 18: [1, 1] }, setShipStyle = (e, t = !1) => new Style({
1091
- renderer: (o, n) => {
1092
- const l = n.context, r = n.feature.get("data");
1093
- if (!r) return;
1094
- if (r != null && r.length) {
1095
- const c = r.length / 2;
1096
- l.beginPath(), l.arc(
1097
- o[0],
1098
- o[1],
1099
- c,
1100
- 0,
1101
- 2 * Math.PI
1102
- ), l.fillStyle = "rgba(0, 0, 0, 0.01)", l.fill();
1103
- }
1104
- n.feature.get("index") === 0 && (shipLabels.value = []);
1105
- try {
1106
- const c = drawShipBody(l, r, o, t);
1107
- c && (drawHeading(l, r, c, t), r.selected = e, e && setTimeout(() => {
1108
- drawSelectBounds(l, c);
1109
- }, 50)), drawShipLabel(l, r, o);
1110
- } catch {
1111
- return !1;
1112
- }
1113
- }
1114
- }), drawShipBody = (e, t, o, n) => {
1115
- if (!mapInstance$6.value) return;
1116
- const l = Math.round(Number(mapInstance$6.value.getView().getZoom()));
1117
- if (!l) return;
1118
- let r = [];
1119
- const [i, c] = drawShipModelByZoom[l] || [0, 0], [s, d] = o;
1120
- if (l <= mapZoom.shipModelMax && l > mapZoom.shipModelMin && t.length >= i && t.breadth >= c)
1121
- r = rotateShapeModel(drawCurrentShipShapeModel(t, l), t.angle).map((u) => {
1122
- const [f, p] = u;
1123
- return [s + f, d + p];
1124
- });
1125
- else {
1126
- const m = rotateShapeModel(triangleModel, t.angle);
1127
- o.length === 2 && (r = m.map((u) => {
1128
- const [f, p] = u;
1129
- return [s + f, d + p];
1130
- }));
1131
- }
1132
- if (!(r.length > 2)) return !1;
1133
- e.save(), e.beginPath(), e.moveTo(r[0][0], r[0][1]);
1134
- for (let m = 1; m < r.length; m++)
1135
- e.lineTo(r[m][0], r[m][1]);
1136
- return e.closePath(), e.strokeStyle = n ? "#ff0000" : "#000", e.lineWidth = n ? 2 : 1, e.stroke(), e.fillStyle = t.fill, e.fill(), e.restore(), r;
1137
- }, drawHeading = (e, t, o, n) => {
1138
- const [l, r] = o[0], i = getShipDirectPath(t);
1139
- if (i) {
1140
- const c = i.map(function(s) {
1141
- const [d, m] = s;
1142
- return [d + l, m + r];
1310
+ stroke: new Stroke({ color: "rgba(0, 0, 0, 0.01)", width: 20 }),
1311
+ radius: 3
1312
+ })
1313
+ }),
1314
+ new Style({
1315
+ // 轨迹点样式
1316
+ image: new CircleStyle({
1317
+ fill: new Fill({ color: e }),
1318
+ stroke: new Stroke({ color: "#fff", width: 2 }),
1319
+ radius: 3
1320
+ })
1321
+ })
1322
+ ]), trackLineVectorSource.value.addFeature(d);
1323
+ const m = new Feature({
1324
+ geometry: new Point(fromLonLat(s.center))
1143
1325
  });
1144
- if (e.save(), e.beginPath(), t.angle > 0) {
1145
- e.translate(l, r);
1146
- const s = t.angle * Math.PI / 180;
1147
- e.rotate(s), e.translate(-l, -r);
1148
- }
1149
- e.moveTo(l, r);
1150
- for (let s = 1; s < c.length; s++) {
1151
- const [d, m] = c[s];
1152
- e.lineTo(d, m);
1326
+ if (m.set("type", "track_label"), m.set("track_label_index", c), m.setStyle(
1327
+ setTrackLabelStyle(s, e)
1328
+ ), trackLineVectorSource.value.addFeature(m), typeof s == "object" && s.hasOwnProperty("state")) {
1329
+ const p = new Feature({
1330
+ geometry: new Point(s.centerPoint)
1331
+ });
1332
+ p.set("type", "track_icon");
1333
+ const y = new Style({
1334
+ text: new Text({
1335
+ font: "Normal 22px map-iconfont",
1336
+ text: getIconFont(dropletsIcon),
1337
+ offsetY: -10
1338
+ }),
1339
+ zIndex: 99
1340
+ }), h = [];
1341
+ Number(s.state) === 0 ? ((u = y.getText()) == null || u.setFill(new Fill({ color: stopColor })), h.push(i)) : Number(s.state) === 1 && ((f = y.getText()) == null || f.setFill(new Fill({ color: slowColor })), h.push(l)), h.push(y), p.setStyle(h), trackLineVectorSource.value.addFeature(p);
1153
1342
  }
1154
- e.strokeStyle = n ? "#ff0000" : "#000", e.lineWidth = n ? 2 : 1, e.stroke(), e.restore();
1155
- }
1156
- }, drawSelectBounds = (e, t) => {
1157
- let [o, n, l, r] = getPixelFromCoordinate(t);
1158
- const i = 4;
1159
- o -= i, n -= i, l += i, r += i, e.save(), e.strokeStyle = "#ff0000", e.lineWidth = 4;
1160
- const c = 8;
1161
- e.beginPath(), e.moveTo(o + c, r), e.lineTo(o, r), e.lineTo(o, r - c), e.moveTo(o, n + c), e.lineTo(o, n), e.lineTo(o + c, n), e.moveTo(l - c, n), e.lineTo(l, n), e.lineTo(l, n + c), e.moveTo(l, r - c), e.lineTo(l, r), e.lineTo(l - c, r), e.stroke(), e.restore();
1162
- }, drawShipLabel = (e, t, o) => {
1163
- if (!t.selected && shipLabels.value.find((u) => u.name === t.name)) return;
1164
- const [n, l] = o, r = n - 0, i = l - 0, c = t.name;
1165
- let s;
1166
- t.leftIconColor && (s = { color: t.leftIconColor, icon: "&#xe599;" });
1167
- const d = getShipCustomIcon(t), m = {
1168
- id: t.id,
1169
- center: [r, i],
1170
- text: c,
1171
- fill: t.fill,
1172
- color: "#fff",
1173
- textColor: "#000",
1174
- bgColor: "#fff",
1175
- leftIcon: s,
1176
- rightIcons: d,
1177
- selected: t.selected,
1178
- blinkColors: t.blinkColors,
1179
- type: "ShipName"
1180
- };
1181
- drawLabel(e, m, shipLabels.value);
1182
- }, drawCurrentShipShapeModel = (e, t) => {
1183
- let o = 0;
1184
- t <= 14 ? o = 0.058 : t === 15 ? o = 0.12 : t === 16 ? o = 0.22 : t === 17 ? o = 0.435 : t === 18 && (o = 0.857);
1185
- const n = e.length / 4 * o, l = e.breadth * o;
1186
- let r = cloneDeep(shipShapeModel);
1187
- return r = r.map(([i, c]) => [i * l, c * n]), r;
1188
- }, getShipDirectPath = (e) => {
1189
- const { speed: t, hdg: o, cog: n } = e;
1190
- let l = "", r = null;
1191
- if (t && t > 1 && (o !== null && o != 511 && n !== null ? n - o >= 3 ? l = "left" : n - o <= -3 ? l = "right" : l = "front" : l = "front", l && t))
1192
- for (const i in speedCondition) {
1193
- const c = speedCondition[i];
1194
- if (t >= c[0] && t < c[1]) {
1195
- r = shipDirectPath[l][i];
1196
- break;
1343
+ }), renderArrow(n, e), renderIconPoint();
1344
+ }, renderArrow = (e, t) => {
1345
+ const o = e.length;
1346
+ o || (e.push(trackList$1.value[0]), e.push(trackList$1.value[trackList$1.value.length - 1]));
1347
+ for (let n = 0; n < o - 1; n++) {
1348
+ let r;
1349
+ const i = e[n], l = (e[n + 1].index + i.index) / 2;
1350
+ if (l % 2 === 0)
1351
+ r = trackList$1.value[l].centerPoint;
1352
+ else {
1353
+ const s = trackList$1.value[Math.floor(l)], c = trackList$1.value[Math.ceil(l)];
1354
+ if (s && c) {
1355
+ const [d, m] = s.centerPoint, [u, f] = c.centerPoint;
1356
+ r = [(d + u) / 2, (m + f) / 2];
1197
1357
  }
1198
1358
  }
1199
- return r;
1200
- }, getShipCustomIcon = (e) => {
1201
- const t = [];
1202
- return e.existDevice && t.push("&#xe687;"), e.existMobile && t.push("&#xe688;"), e.existWaterGauge && t.push("&#xe686;"), t || [];
1203
- }, mapInstance$5 = ref(), renderShipSetInstance = (e) => mapInstance$5.value = e;
1204
- let shipsMarkerList = [], shipsVectorSource, largeAmountShipsSource;
1205
- const selectedShipData = ref(null);
1206
- let selectShipsVectorSource;
1207
- const renderShips = (e) => {
1208
- var o, n, l, r;
1209
- if (!mapInstance$5.value || showTrackLayer.value) return;
1210
- const t = Math.round(Number(mapInstance$5.value.getView().getZoom()));
1211
- if (selectedShipData.value && nextTick(() => {
1212
- selectSingleShipMarker(selectedShipData.value);
1213
- }).then((i) => {
1214
- }), !(!t || t < mapZoom.shipGreenDotMax) && (allShips.value = e, !hiddenOrther.value))
1215
- return t >= mapZoom.shipGreenDotMax && t < mapZoom.shipModelMin ? ((o = shipsLayer.value) == null || o.setVisible(!1), (n = largeAmountShipsLayer.value) == null || n.setVisible(!0), renderLargeAmountShips(e)) : ((l = largeAmountShipsLayer.value) == null || l.setVisible(!1), (r = shipsLayer.value) == null || r.setVisible(!0), renderShipsMarker(e));
1216
- }, renderLargeAmountShips = (e) => {
1217
- if (!mapInstance$5.value) return;
1218
- const t = e.map((o) => ({
1219
- type: "Feature",
1220
- geometry: {
1221
- type: "Point",
1222
- coordinates: [o.lon, o.lat]
1223
- },
1224
- properties: o
1225
- }));
1226
- return largeAmountShipsSource == null || largeAmountShipsSource.clear(), largeAmountShipsSource = new VectorSource({
1227
- features: new GeoJSON().readFeatures({
1228
- type: "FeatureCollection",
1229
- features: t
1230
- }, {
1231
- featureProjection: projection.mercator
1232
- })
1233
- }), largeAmountShipsLayer.value = new WebGLPointsLayer({
1234
- source: largeAmountShipsSource,
1235
- style: {
1236
- "shape-points": 3,
1237
- "shape-radius": 9,
1238
- "shape-fill-color": [
1239
- "case",
1240
- ["==", ["get", "fill"], "#D9001C"],
1241
- "#D9001C",
1242
- // 如果 fill 是 #D9001C,返回红色
1243
- ["==", ["get", "fill"], "#04C900"],
1244
- "#04C900",
1245
- // 如果 fill 是 #04C900,返回绿色
1246
- "#04C900"
1247
- // 默认颜色(绿色)
1248
- ],
1249
- "shape-rotate-with-view": !1,
1250
- "shape-rotation": [
1251
- "+",
1252
- ["get", "cog"],
1253
- // 获取 'cog' 属性值
1254
- 180
1255
- // 将值旋转 180 度
1256
- ],
1257
- "shape-scale": [0.8, 1.2],
1258
- "shape-stroke-color": "#000000",
1259
- // 边框颜色为黑色
1260
- "shape-stroke-width": 0.5
1261
- // 边框宽度为0.5px
1262
- }
1263
- }), mapInstance$5.value.addLayer(largeAmountShipsLayer.value), largeAmountShipsLayer.value;
1264
- }, renderShipsMarker = (e) => {
1265
- var o;
1266
- if (!mapInstance$5.value) return;
1267
- deleteAllShipMarkers();
1268
- let t = convertShipMapData(e);
1269
- if (t = customFilterShips(t), !!(t != null && t.length))
1270
- return t.forEach((n, l) => {
1271
- const r = [n.lon, n.lat], i = new Feature({
1272
- geometry: new Point(fromLonLat(r))
1273
- }), c = 1;
1274
- i.set("clickGeometry", new Circle(fromLonLat(r), c)), i.set("data", n), i.set("index", l), i.setStyle(
1275
- setShipStyle(!1)
1276
- ), shipsMarkerList.push({
1277
- ship: n,
1278
- lonlat: r,
1279
- feature: i
1359
+ if (r) {
1360
+ const s = new Feature({
1361
+ geometry: new Point(r)
1280
1362
  });
1281
- }), shipsVectorSource = new VectorSource({
1282
- features: shipsMarkerList.map((n) => n.feature)
1283
- }), shipsLayer.value = new VectorLayer({
1284
- source: shipsVectorSource,
1285
- zIndex: 100
1286
- }), (o = mapInstance$5.value) == null || o.addLayer(shipsLayer.value), shipsLayer.value;
1287
- }, onShipsMarkerHover = () => {
1288
- var t;
1289
- let e = null;
1290
- (t = mapInstance$5.value) == null || t.on("pointermove", function(o) {
1291
- var l;
1292
- const n = (l = mapInstance$5.value) == null ? void 0 : l.forEachFeatureAtPixel(o.pixel, (r) => r);
1293
- if (e) {
1294
- const r = e.get("data");
1295
- if (!(r != null && r.mmsi)) return;
1296
- e.setStyle(
1297
- setShipStyle(!1, !1)
1298
- );
1299
- }
1300
- if (n) {
1301
- const r = n.get("data");
1302
- if (!(r != null && r.mmsi)) return;
1303
- e = n, n.setStyle(
1304
- setShipStyle(!1, !0)
1305
- );
1363
+ s.set("type", "track_arrow"), s.setStyle(
1364
+ new Style({
1365
+ text: new Text({
1366
+ font: "700 14px map-iconfont",
1367
+ text: getIconFont("&#xe6bc;"),
1368
+ fill: new Fill({ color: t }),
1369
+ // 设置箭头旋转 角度转为弧度
1370
+ rotation: getRotation(
1371
+ e[n].center,
1372
+ e[n + 1].center
1373
+ ) * (Math.PI / 180)
1374
+ })
1375
+ })
1376
+ ), trackLineVectorSource.value.addFeature(s);
1306
1377
  }
1307
- });
1308
- }, customFilterShips = (e) => {
1309
- let t = cloneDeep(e);
1310
- return t = t.filter((o) => {
1311
- var l;
1312
- const n = getFilterItem(o).every(({ btnShow: r, value: i }) => r ? !!i : !0);
1313
- return (switchBtnShow.value.camera || switchBtnShow.value.mobile || switchBtnShow.value.waterGauge) && ((l = selectedShipData.value) == null ? void 0 : l.id) === o.id && clearSelectFeature(), n;
1314
- }), t;
1315
- }, getFilterItem = (e) => [
1316
- { btnShow: switchBtnShow.value.camera, value: e == null ? void 0 : e.existDevice },
1317
- { btnShow: switchBtnShow.value.mobile, value: e == null ? void 0 : e.existMobile },
1318
- { btnShow: switchBtnShow.value.waterGauge, value: e == null ? void 0 : e.existWaterGauge }
1319
- ], deleteAllShipMarkers = () => {
1320
- shipsMarkerList.forEach((e) => {
1321
- e.feature && (shipsVectorSource == null || shipsVectorSource.removeFeature(e.feature));
1322
- }), clearAllInterval(), shipsMarkerList = [];
1323
- }, selectSingleShipMarker = (e) => {
1324
- var r;
1325
- if (!mapInstance$5.value) return;
1326
- const t = cloneDeep(selectSingleShipData.value);
1327
- selectSingleShipData.value = convertShipMapData(e);
1328
- const o = [selectSingleShipData.value.lon, selectSingleShipData.value.lat], n = new Feature({
1329
- geometry: new Point(fromLonLat(o))
1330
- });
1331
- n.set("data", selectSingleShipData.value), n.setStyle(
1332
- setShipStyle(!0)
1333
- ), shipsMarkerList.push({
1334
- ship: selectSingleShipData.value,
1335
- lonlat: o,
1336
- feature: n
1337
- }), selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsVectorSource = new VectorSource({
1338
- features: [n]
1339
- }), selectShipsLayer.value = new VectorLayer({
1340
- source: selectShipsVectorSource
1341
- }), setVisibleFeatureById(shipsVectorSource, selectSingleShipData.value.id, !0);
1342
- const l = (r = shipsLayer.value) == null ? void 0 : r.getSource();
1343
- return l && (t && setVisibleFeatureById(l, t.id, !0), setVisibleFeatureById(l, selectSingleShipData.value.id, !1)), mapInstance$5.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!0), selectShipsLayer.value;
1344
- }, setVisibleFeatureById = (e, t, o) => {
1345
- e && e.forEachFeature((n) => {
1346
- const l = n.get("data");
1347
- l && l.id === t && n.setStyle(o ? setShipStyle(!1, l.id) : setBlankStyle());
1348
- });
1349
- }, findShip = (e, t, o = !0) => {
1350
- var l, r, i, c, s;
1351
- if (!e || !mapInstance$5.value) return;
1352
- const n = (i = (r = (l = shipsLayer.value) == null ? void 0 : l.getSource()) == null ? void 0 : r.getFeatures()) == null ? void 0 : i.find((d) => {
1353
- var m;
1354
- return ((m = d.get("data")) == null ? void 0 : m.id) === e;
1355
- });
1356
- if (n ? selectedShipData.value = n.get("data") : t && (selectedShipData.value = t), !t) {
1357
- console.error("找不到船舶");
1358
- return;
1359
1378
  }
1360
- if (o && ((c = selectedShipData.value) != null && c.lon) && ((s = selectedShipData.value) != null && s.lat)) {
1361
- const d = mapInstance$5.value.getView(), m = new Point([selectedShipData.value.lon, selectedShipData.value.lat]);
1362
- d.setCenter(transform(m.getCoordinates(), projection.data, projection.mercator));
1363
- const u = d.getZoom(), f = u < mapZoom.findShipMin ? mapZoom.findShip : u;
1364
- d.setZoom(f);
1365
- }
1366
- return setTimeout(() => {
1367
- selectSingleShipMarker(t);
1368
- }, 50), n;
1369
- }, clearSelectFeature = () => {
1370
- var e;
1371
- if (selectedShipData.value) {
1372
- setVisibleFeatureById(shipsVectorSource, selectSingleShipData.value.id, !1);
1373
- const t = (e = shipsLayer.value) == null ? void 0 : e.getSource();
1374
- t && setVisibleFeatureById(t, selectSingleShipData.value.id, !0);
1379
+ }, renderIconPoint = () => {
1380
+ const e = "&#xe69b;", t = "#fcdc3f", o = "#ff0000";
1381
+ (trackList$1.value.length < 2 ? [trackList$1.value[0]] : [trackList$1.value[0], trackList$1.value[trackList$1.value.length - 1]]).forEach((r) => {
1382
+ const i = new Feature({
1383
+ geometry: new Point(r.centerPoint)
1384
+ });
1385
+ i.set("type", "track_begin"), i.set("data", r);
1386
+ const l = r.index === 0 && trackList$1.value.length >= 2 ? t : o;
1387
+ i.setStyle(
1388
+ new Style({
1389
+ text: new Text({
1390
+ font: "Normal 14px map-iconfont",
1391
+ text: getIconFont(e),
1392
+ fill: new Fill({ color: l })
1393
+ }),
1394
+ zIndex: 101
1395
+ })
1396
+ ), trackLineVectorSource.value.addFeature(i);
1397
+ });
1398
+ }, setTrackLabelStyle = (e, t) => new Style({
1399
+ renderer: (o, n) => {
1400
+ const r = n.context, s = {
1401
+ id: e.id || "",
1402
+ center: o,
1403
+ text: e.time,
1404
+ color: t,
1405
+ textColor: "#000",
1406
+ bgColor: "rgba(255,255,255,.8)",
1407
+ selected: !0,
1408
+ type: "TrackTime"
1409
+ };
1410
+ drawLabel(r, s, trackLabels.value);
1375
1411
  }
1376
- selectedShipData.value = null, mapInstance$5.value && (selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsLayer.value = new VectorLayer({
1377
- source: selectShipsVectorSource
1378
- }), mapInstance$5.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!1));
1379
- }, hiddenAllShips = () => {
1380
- var e, t;
1381
- (e = shipsLayer.value) == null || e.setVisible(!1), (t = largeAmountShipsLayer.value) == null || t.setVisible(!1);
1382
- }, switchBtnShow = ref({
1383
- // 船舶摄像头过滤开关
1384
- [SWITCH_BTN.Camera]: !1,
1385
- // 船舶联系方式过滤开关
1386
- [SWITCH_BTN.Mobile]: !1,
1387
- // 船舶水尺过滤开关
1388
- [SWITCH_BTN.WaterGauge]: !1
1389
- }), switchFilterItem = (e, t) => {
1390
- switchBtnShow.value[e] = t, renderShips(allShips.value);
1391
- }, rerenderShip = () => {
1392
- renderShips(allShips.value);
1393
- }, mapInstance$4 = ref(), renderCustomOverlaySetInstance = (e) => mapInstance$4.value = e, drawCustomContent = (e, t, o, n = "top-left", l = !1) => {
1412
+ }), mapInstance$4 = ref(), renderCustomOverlaySetInstance = (e) => mapInstance$4.value = e, drawCustomContent = (e, t, o, n = "top-left", r = !1) => {
1394
1413
  var m, u;
1395
1414
  if (!t || !mapInstance$4.value) return;
1396
- document.querySelectorAll(".truck-custom-content").forEach((f) => f.parentNode.removeChild(f));
1397
- const r = document.createElement("div");
1398
- r.innerHTML = o;
1399
- const i = new Overlay({
1400
- element: r,
1415
+ document.querySelectorAll(".truck-custom-content").forEach((f) => {
1416
+ var p;
1417
+ return (p = f.parentNode) == null ? void 0 : p.removeChild(f);
1418
+ });
1419
+ const i = document.createElement("div");
1420
+ i.innerHTML = o;
1421
+ const l = new Overlay({
1422
+ element: i,
1401
1423
  position: t,
1402
1424
  // 初始位置
1403
1425
  positioning: n,
1404
- stopEvent: l
1426
+ stopEvent: r
1405
1427
  // 设置不阻拦事件
1406
1428
  });
1407
- if (l) {
1408
- let f = !1, p = [0, 0], w = [0, 0];
1409
- r.addEventListener("mousedown", function(h) {
1410
- var g;
1411
- f = !0, h.clientX, h.clientY, p = (g = mapInstance$4.value) == null ? void 0 : g.getCoordinateFromPixel([h.clientX - 200, h.clientY - 200]), w = [
1412
- h.clientX - r.getBoundingClientRect().left + 160,
1413
- h.clientY - r.getBoundingClientRect().top + 84
1414
- ], h.preventDefault();
1415
- }), document.addEventListener("mousemove", function(h) {
1416
- var g;
1429
+ if (r) {
1430
+ let f = !1, p = [0, 0], y = [0, 0], h = 0, g = 0;
1431
+ i.addEventListener("mousedown", function(k) {
1432
+ var b;
1433
+ f = !0, h = k.clientX, g = k.clientY;
1434
+ const M = (b = mapInstance$4.value) == null ? void 0 : b.getCoordinateFromPixel([k.clientX - 200, k.clientY - 200]);
1435
+ M && (p = M), y = [
1436
+ k.clientX - i.getBoundingClientRect().left + 160,
1437
+ k.clientY - i.getBoundingClientRect().top + 84
1438
+ ], k.preventDefault(), console.log(e, h, g);
1439
+ }), document.addEventListener("mousemove", function(k) {
1440
+ var M;
1417
1441
  if (f) {
1418
- const T = (g = mapInstance$4.value) == null ? void 0 : g.getCoordinateFromPixel([h.clientX - w[0], h.clientY - w[1]]), M = T[0] - p[0], b = T[1] - p[1];
1419
- i.setPosition([p[0] + M, p[1] + b]);
1442
+ const b = (M = mapInstance$4.value) == null ? void 0 : M.getCoordinateFromPixel([k.clientX - y[0], k.clientY - y[1]]), F = b[0] - p[0], V = b[1] - p[1];
1443
+ l.setPosition([p[0] + F, p[1] + V]);
1420
1444
  }
1421
1445
  }), document.addEventListener("mouseup", function() {
1422
1446
  f = !1;
1423
1447
  });
1424
1448
  }
1425
- (m = mapInstance$4.value) == null || m.addOverlay(i);
1426
- const c = r.querySelector(".close-button");
1427
- c && c.addEventListener("click", () => {
1449
+ (m = mapInstance$4.value) == null || m.addOverlay(l);
1450
+ const s = i.querySelector(".close-button");
1451
+ s && s.addEventListener("click", () => {
1428
1452
  var f, p;
1429
- (f = mapInstance$4.value) == null || f.removeOverlay(i), (p = r.parentNode) == null || p.removeChild(r);
1453
+ (f = mapInstance$4.value) == null || f.removeOverlay(l), (p = i.parentNode) == null || p.removeChild(i);
1430
1454
  });
1431
- const s = JSON.parse(JSON.stringify(t)), d = (u = mapInstance$4.value) == null ? void 0 : u.getCoordinateFromPixel(s);
1432
- return i.setPosition(d), i;
1455
+ const c = JSON.parse(JSON.stringify(t)), d = (u = mapInstance$4.value) == null ? void 0 : u.getCoordinateFromPixel(c);
1456
+ return l.setPosition(d), l;
1433
1457
  }, mapInstance$3 = ref(), renderTrackSetInstance = (e) => mapInstance$3.value = e, showTracks = ref([]), trackList = ref([]);
1434
1458
  ref(null);
1435
- const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship") => {
1459
+ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, r = "ship") => {
1436
1460
  var m;
1437
1461
  if (nextTick(() => {
1438
1462
  hiddenAllShips();
@@ -1441,21 +1465,21 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1441
1465
  ((m = showTracks.value) == null ? void 0 : m.findIndex((u) => u.id === e)) < 0 && showTracks.value.push({ id: e, length: "" });
1442
1466
  return;
1443
1467
  }
1444
- const r = {};
1468
+ const i = {};
1445
1469
  t.forEach((u) => {
1446
1470
  u.state ? u.state = Number(u.state) : delete u.state;
1447
- }), trackId.value = e, r[e] = t, trackList.value = t;
1448
- const i = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], c = r[e].map(
1471
+ }), trackId.value = e, i[e] = t, trackList.value = t;
1472
+ const l = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], s = i[e].map(
1449
1473
  (u) => transform([u.lon, u.lat], projection.data, projection.mercator)
1450
- ), s = new LineString(c), d = formatUtils.formatLength(s, n) || "--";
1474
+ ), c = new LineString(s), d = formatUtils.formatLength(c, n) || "--";
1451
1475
  nextTick(() => {
1452
1476
  var f, p;
1453
- const u = (f = showTracks.value) == null ? void 0 : f.findIndex((w) => w.id === e);
1454
- u < 0 ? showTracks.value.push({ id: e, length: d }) : showTracks.value[u].length = d, ++cursor.value, cursor.value > i.length && (cursor.value = 0), renderTrackLine(r, e, o), nextTick(() => {
1477
+ const u = (f = showTracks.value) == null ? void 0 : f.findIndex((y) => y.id === e);
1478
+ u < 0 ? showTracks.value.push({ id: e, length: d }) : showTracks.value[u].length = d, ++cursor.value, cursor.value > l.length && (cursor.value = 0), renderTrackLine(i, e, o), nextTick(() => {
1455
1479
  resetTrackView(e);
1456
1480
  }).then(() => {
1457
1481
  }), (p = mapInstance$3.value) == null || p.on("moveend", () => {
1458
- showTrackLayer.value && (trackLabels.value = [], renderTrackLine(r, e, o));
1482
+ showTrackLayer.value && (trackLabels.value = [], renderTrackLine(i, e, o));
1459
1483
  }), renderTrackPointPopup();
1460
1484
  }).then(() => {
1461
1485
  });
@@ -1463,54 +1487,54 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1463
1487
  var t;
1464
1488
  const e = ref(null);
1465
1489
  (t = mapInstance$3.value) == null || t.on("pointermove", (o) => {
1466
- var l, r, i, c;
1467
- e.value && ((l = mapInstance$3.value) == null || l.removeOverlay(e.value));
1468
- const n = (r = mapInstance$3.value) == null ? void 0 : r.forEachFeatureAtPixel(o.pixel, (s) => s);
1490
+ var r, i, l, s;
1491
+ e.value && ((r = mapInstance$3.value) == null || r.removeOverlay(e.value));
1492
+ const n = (i = mapInstance$3.value) == null ? void 0 : i.forEachFeatureAtPixel(o.pixel, (c) => c);
1469
1493
  if (n) {
1470
- const s = n.get("data");
1471
- if (!(s != null && s.time)) return;
1494
+ const c = n.get("data");
1495
+ if (!(c != null && c.time)) return;
1472
1496
  let d = "";
1473
- s != null && s.stayTime && (d = `
1497
+ c != null && c.stayTime && (d = `
1474
1498
  <div class="item w-100">
1475
1499
  <div class="item-label">停泊时间约</div>
1476
- <div class="item-item">${formatMinutesToDDHHMM(Number(s.stayTime))}</div>
1500
+ <div class="item-item">${formatMinutesToDDHHMM(Number(c.stayTime))}</div>
1477
1501
  </div>
1478
1502
  `);
1479
1503
  const m = `
1480
1504
  <div class="track-point-popup">
1481
1505
  <div class="item">
1482
1506
  <div class="item-label">状态</div>
1483
- <div class="item-item">${s != null && s.sailStatus ? SHIP_SAIL_STATUS[String(s.sailStatus)] : DEFAULT_VALUE}</div>
1507
+ <div class="item-item">${c != null && c.sailStatus ? SHIP_SAIL_STATUS[String(c.sailStatus)] : DEFAULT_VALUE}</div>
1484
1508
  </div>
1485
1509
  <div class="item">
1486
1510
  <div class="item-label">航速</div>
1487
- <div class="item-item">${s.speed || DEFAULT_VALUE}</div>
1511
+ <div class="item-item">${c.speed || DEFAULT_VALUE}</div>
1488
1512
  </div>
1489
1513
  <div class="item">
1490
1514
  <div class="item-label">艏向</div>
1491
- <div class="item-item">${s.hdg || DEFAULT_VALUE}</div>
1515
+ <div class="item-item">${c.hdg || DEFAULT_VALUE}</div>
1492
1516
  </div>
1493
1517
  <div class="item">
1494
1518
  <div class="item-label">航向</div>
1495
- <div class="item-item">${s.cog || DEFAULT_VALUE}</div>
1519
+ <div class="item-item">${c.cog || DEFAULT_VALUE}</div>
1496
1520
  </div>
1497
1521
  <div class="item">
1498
1522
  <div class="item-label">经度</div>
1499
- <div class="item-item">${s.lon || DEFAULT_VALUE}</div>
1523
+ <div class="item-item">${c.lon || DEFAULT_VALUE}</div>
1500
1524
  </div>
1501
1525
  <div class="item">
1502
1526
  <div class="item-label">纬度</div>
1503
- <div class="item-item">${s.lat || DEFAULT_VALUE}</div>
1527
+ <div class="item-item">${c.lat || DEFAULT_VALUE}</div>
1504
1528
  </div>
1505
1529
  <div class="item w-100">
1506
1530
  <div class="item-label">时间</div>
1507
- <div class="item-item">${s.time}</div>
1531
+ <div class="item-item">${c.time}</div>
1508
1532
  </div>
1509
1533
  ${d ?? d}
1510
- </div>`, u = (i = mapInstance$3.value) == null ? void 0 : i.getPixelFromCoordinate(o.coordinate);
1511
- e.value = drawCustomContent(s.time, u, m, "left-top");
1534
+ </div>`, u = (l = mapInstance$3.value) == null ? void 0 : l.getPixelFromCoordinate(o.coordinate);
1535
+ e.value = drawCustomContent(c.time, u, m, "left-top");
1512
1536
  } else
1513
- (c = mapInstance$3.value) == null || c.removeOverlay(e.value);
1537
+ (s = mapInstance$3.value) == null || s.removeOverlay(e.value);
1514
1538
  });
1515
1539
  }, removeAllTrackLayer = () => {
1516
1540
  var e;
@@ -1518,21 +1542,21 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1518
1542
  }, playTrack = (e, t) => {
1519
1543
  handlePlay(String(e), t);
1520
1544
  }, resetTrackView = (e) => {
1521
- var l;
1522
- const t = mapInstance$3.value.getView(), o = e ? shipTrackLineFeatures.value.find((r) => r.getId() === e) : shipTrackLineFeatures.value[0];
1545
+ var r;
1546
+ const t = mapInstance$3.value.getView(), o = e ? shipTrackLineFeatures.value.find((i) => i.getId() === e) : shipTrackLineFeatures.value[0];
1523
1547
  if (!o) return;
1524
- const n = (l = o == null ? void 0 : o.getGeometry()) == null ? void 0 : l.getExtent();
1548
+ const n = (r = o == null ? void 0 : o.getGeometry()) == null ? void 0 : r.getExtent();
1525
1549
  if (n != null && n.length)
1526
1550
  try {
1527
- const r = buffer(n, Math.max(n[2] - n[0], n[3] - n[1]) * 0.02);
1528
- t.fit(r);
1529
- } catch (r) {
1530
- console.log(r);
1551
+ const i = buffer(n, Math.max(n[2] - n[0], n[3] - n[1]) * 0.02);
1552
+ t.fit(i);
1553
+ } catch (i) {
1554
+ console.log(i);
1531
1555
  }
1532
1556
  }, formatMinutesToDDHHMM = (e) => {
1533
- const t = hooks.duration(e, "minutes"), o = Math.floor(t.asDays()), n = t.hours(), l = t.minutes();
1534
- let r = `${String(n).padStart(2, "0")}时${String(l).padStart(2, "0")}分`;
1535
- return o !== 0 && (r = `${String(o).padStart(2, "0")}天${r}`), r;
1557
+ const t = hooks.duration(e, "minutes"), o = Math.floor(t.asDays()), n = t.hours(), r = t.minutes();
1558
+ let i = `${String(n).padStart(2, "0")}时${String(r).padStart(2, "0")}分`;
1559
+ return o !== 0 && (i = `${String(o).padStart(2, "0")}天${i}`), i;
1536
1560
  }, _hoisted_1$3 = {
1537
1561
  key: 0,
1538
1562
  class: "more-tool-panel"
@@ -1547,25 +1571,25 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1547
1571
  },
1548
1572
  emits: ["switchGreenDot", "switchMapTile"],
1549
1573
  setup(e, { emit: t }) {
1550
- var p, w;
1551
- const o = inject("mapInstance"), n = e, l = t, r = ref(((w = (p = o.value) == null ? void 0 : p.getView()) == null ? void 0 : w.getZoom()) || mapZoom.default), i = ref(!1), c = ref(null), s = ref(!0), d = () => {
1552
- n.disableGreenDot || r.value >= mapZoom.shipGreenDotMax || (s.value = !s.value, l("switchGreenDot", s.value));
1574
+ var p, y;
1575
+ const o = inject("mapInstance"), n = e, r = t, i = ref(((y = (p = o.value) == null ? void 0 : p.getView()) == null ? void 0 : y.getZoom()) || mapZoom.default), l = ref(!1), s = ref(null), c = ref(!0), d = () => {
1576
+ n.disableGreenDot || i.value >= mapZoom.shipGreenDotMax || (c.value = !c.value, r("switchGreenDot", c.value));
1553
1577
  }, m = () => {
1554
- l("switchMapTile", n.mapTileMode === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector);
1578
+ r("switchMapTile", n.mapTileMode === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector);
1555
1579
  }, u = () => {
1556
1580
  var h, g;
1557
- i.value ? (h = c.value) == null || h.removeInteraction() : (g = c.value) == null || g.addInteraction(), i.value = !i.value;
1581
+ l.value ? (h = s.value) == null || h.removeInteraction() : (g = s.value) == null || g.addInteraction(), l.value = !l.value;
1558
1582
  }, f = () => {
1559
1583
  var h;
1560
- (h = c.value) == null || h.removeInteraction(), i.value = !1;
1584
+ (h = s.value) == null || h.removeInteraction(), l.value = !1;
1561
1585
  };
1562
1586
  return onMounted(() => {
1563
1587
  nextTick(() => {
1564
1588
  var h;
1565
1589
  (h = o.value) == null || h.on("moveend", () => {
1566
- var T, M;
1567
- const g = (M = (T = o.value) == null ? void 0 : T.getView()) == null ? void 0 : M.getZoom();
1568
- g && (r.value = g);
1590
+ var k, M;
1591
+ const g = (M = (k = o.value) == null ? void 0 : k.getView()) == null ? void 0 : M.getZoom();
1592
+ g && (i.value = g);
1569
1593
  });
1570
1594
  });
1571
1595
  }), (h, g) => (openBlock(), createElementBlock(Fragment, null, [
@@ -1576,7 +1600,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1576
1600
  createElementVNode("div", _hoisted_2$1, [
1577
1601
  h.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1578
1602
  key: 0,
1579
- class: normalizeClass(["switch-btn", `${i.value && "active"}`]),
1603
+ class: normalizeClass(["switch-btn", `${l.value && "active"}`]),
1580
1604
  onClick: u
1581
1605
  }, g[5] || (g[5] = [
1582
1606
  createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
@@ -1584,7 +1608,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1584
1608
  ]), 2)) : createCommentVNode("", !0),
1585
1609
  h.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1586
1610
  key: 1,
1587
- class: normalizeClass(`switch-btn ${s.value && "active"} ${(h.disableGreenDot || r.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
1611
+ class: normalizeClass(`switch-btn ${c.value && "active"} ${(h.disableGreenDot || i.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
1588
1612
  onClick: d
1589
1613
  }, g[6] || (g[6] = [
1590
1614
  createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
@@ -1593,7 +1617,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1593
1617
  h.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1594
1618
  key: 2,
1595
1619
  class: normalizeClass(`switch-btn ${h.mapTileMode === unref(BaseMapType).satellite && "active"}`),
1596
- onClick: g[0] || (g[0] = (T) => m())
1620
+ onClick: g[0] || (g[0] = (k) => m())
1597
1621
  }, g[7] || (g[7] = [
1598
1622
  createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
1599
1623
  createElementVNode("div", { class: "button-text" }, "图层", -1)
@@ -1601,7 +1625,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1601
1625
  h.vehicleMode === "truck" ? (openBlock(), createElementBlock("div", {
1602
1626
  key: 3,
1603
1627
  class: normalizeClass(`switch-btn ${h.mapTileMode === unref(BaseMapType).satellite && "active"}`),
1604
- onClick: g[1] || (g[1] = (T) => m())
1628
+ onClick: g[1] || (g[1] = (k) => m())
1605
1629
  }, g[8] || (g[8] = [
1606
1630
  createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
1607
1631
  createElementVNode("div", { class: "button-text" }, "卫星", -1)
@@ -1609,14 +1633,14 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1609
1633
  h.showTrackLayer ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1610
1634
  createElementVNode("div", {
1611
1635
  class: "switch-btn multiple",
1612
- onClick: g[2] || (g[2] = (T) => unref(playTrack)(unref(currentTrackId), 1))
1636
+ onClick: g[2] || (g[2] = (k) => unref(playTrack)(unref(currentTrackId), 1))
1613
1637
  }, g[9] || (g[9] = [
1614
1638
  createElementVNode("i", { class: "map-iconfont icon-play" }, null, -1),
1615
1639
  createElementVNode("div", { class: "button-text" }, "播放轨迹", -1)
1616
1640
  ])),
1617
1641
  createElementVNode("div", {
1618
1642
  class: "switch-btn multiple",
1619
- onClick: g[3] || (g[3] = (T) => unref(resetTrackView)())
1643
+ onClick: g[3] || (g[3] = (k) => unref(resetTrackView)())
1620
1644
  }, g[10] || (g[10] = [
1621
1645
  createElementVNode("i", { class: "map-iconfont icon-center" }, null, -1),
1622
1646
  createElementVNode("div", { class: "button-text" }, "轨迹居中", -1)
@@ -1627,7 +1651,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1627
1651
  ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1628
1652
  h.vehicleMode === "ship" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1629
1653
  createElementVNode("div", {
1630
- class: normalizeClass(["switch-btn", `${i.value && "active"}`]),
1654
+ class: normalizeClass(["switch-btn", `${l.value && "active"}`]),
1631
1655
  onClick: u
1632
1656
  }, g[11] || (g[11] = [
1633
1657
  createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
@@ -1635,7 +1659,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1635
1659
  ]), 2),
1636
1660
  h.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
1637
1661
  key: 0,
1638
- class: normalizeClass(`switch-btn ${s.value && "active"} ${(h.disableGreenDot || r.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
1662
+ class: normalizeClass(`switch-btn ${c.value && "active"} ${(h.disableGreenDot || i.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
1639
1663
  onClick: d
1640
1664
  }, g[12] || (g[12] = [
1641
1665
  createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
@@ -1652,33 +1676,34 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1652
1676
  ], 64))
1653
1677
  ], 2),
1654
1678
  createElementVNode("div", _hoisted_3, [
1655
- i.value ? (openBlock(), createBlock(Measure, {
1679
+ l.value ? (openBlock(), createBlock(Measure, {
1656
1680
  key: 0,
1657
1681
  ref_key: "measureRef",
1658
- ref: c,
1659
- visible: i.value,
1660
- "onUpdate:visible": g[4] || (g[4] = (T) => i.value = T),
1682
+ ref: s,
1683
+ visible: l.value,
1684
+ "onUpdate:visible": g[4] || (g[4] = (k) => l.value = k),
1661
1685
  onClose: f,
1662
1686
  "view-mode": h.viewMode
1663
1687
  }, null, 8, ["visible", "view-mode"])) : createCommentVNode("", !0)
1664
1688
  ])
1665
1689
  ], 64));
1666
1690
  }
1667
- }), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ef931f65"]]), _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
1691
+ }), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-458187f4"]]), _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
1668
1692
  __name: "scaleLine",
1669
1693
  setup(e, { expose: t }) {
1670
1694
  const o = inject("mapInstance");
1671
1695
  return t({
1672
- setScaleLine: (l) => {
1673
- var c;
1674
- const r = new ScaleLine$1({
1675
- units: l || "metric"
1676
- }), i = document.getElementById("scale-line-container");
1677
- i && (r.setTarget(i), (c = o.value) == null || c.addControl(r));
1696
+ setScaleLine: (r) => {
1697
+ var s;
1698
+ r || (r = "metric");
1699
+ const i = new ScaleLine$1({
1700
+ units: r
1701
+ }), l = document.getElementById("scale-line-container");
1702
+ l && (i.setTarget(l), (s = o == null ? void 0 : o.value) == null || s.addControl(i));
1678
1703
  }
1679
- }), (l, r) => (openBlock(), createElementBlock("div", _hoisted_1$2));
1704
+ }), (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$2));
1680
1705
  }
1681
- }), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-8c27b246"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
1706
+ }), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-d666f80d"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
1682
1707
  __name: "zoomControl",
1683
1708
  props: {
1684
1709
  map: {
@@ -1688,14 +1713,14 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1688
1713
  setup(e) {
1689
1714
  const t = inject("mapInstance"), o = () => {
1690
1715
  if (!t.value) return;
1691
- const l = t.value.getView(), r = l.getZoom();
1692
- r && l.setZoom(r + 1);
1716
+ const r = t.value.getView(), i = r.getZoom();
1717
+ i && r.setZoom(i + 1);
1693
1718
  }, n = () => {
1694
1719
  if (!t.value) return;
1695
- const l = t.value.getView(), r = l.getZoom();
1696
- r && l.setZoom(r - 1);
1720
+ const r = t.value.getView(), i = r.getZoom();
1721
+ i && r.setZoom(i - 1);
1697
1722
  };
1698
- return (l, r) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
1723
+ return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
1699
1724
  createElementVNode("div", {
1700
1725
  onClick: o,
1701
1726
  class: "button big-button"
@@ -1712,11 +1737,11 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship")
1712
1737
  type: { default: COPY_RIGHT_TYPE.HORIZONTAL }
1713
1738
  },
1714
1739
  setup(e) {
1715
- useCssVars((r) => ({
1716
- "4bfada56": l.value
1740
+ useCssVars((i) => ({
1741
+ "4bfada56": r.value
1717
1742
  }));
1718
- const t = e, o = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "map/tdt-copyright-h.svg" : `map/tdt-copyright-v${mapTile === "satellite" ? "-w" : ""}.svg`), n = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "400px" : "168px"), l = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "auto auto 0 5px" : "0 auto auto 5px");
1719
- return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1, [
1743
+ const t = e, o = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "map/tdt-copyright-h.svg" : `map/tdt-copyright-v${mapTile === "satellite" ? "-w" : ""}.svg`), n = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "400px" : "168px"), r = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "auto auto 0 5px" : "0 auto auto 5px");
1744
+ return (i, l) => (openBlock(), createElementBlock("div", _hoisted_1, [
1720
1745
  createElementVNode("img", {
1721
1746
  src: unref(CDN_URL) + o.value,
1722
1747
  width: n.value,
@@ -1738,30 +1763,30 @@ const loadImage = new Image();
1738
1763
  loadImage.src = `${CDN_URL}/map/map-load.svg`;
1739
1764
  loadImage.crossOrigin = "anonymous";
1740
1765
  const setTruckStyle = (e, t, o, n) => new Style({
1741
- renderer: (l, r) => {
1742
- const i = r.context;
1743
- i.save();
1744
- let c = 1;
1745
- i.scale(c, c);
1746
- let [s, d] = l;
1747
- s = s / c - 20, d = d / c;
1748
- const m = s - 70, u = d - 68;
1766
+ renderer: (r, i) => {
1767
+ const l = i.context;
1768
+ l.save();
1769
+ let s = 1;
1770
+ l.scale(s, s);
1771
+ let [c, d] = r;
1772
+ c = c / s - 20, d = d / s;
1773
+ const m = c - 70, u = d - 68;
1749
1774
  let f = 180;
1750
- const p = 56, w = "#FFFFFF";
1775
+ const p = 56, y = "#FFFFFF";
1751
1776
  let h = 176;
1752
1777
  const g = 52;
1753
- let T = "#164AFF", M = "#FFFFFF";
1754
- o === CAR_COLOR.YELLOW ? (h = 176, T = "#FFC81E", M = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (f = 200, h = 196, T = "#8FED7C", M = "rgba(0,0,0,0.88)"), n != null && n.length && (f += n.length * 56), fillRectRadius(i, m, u, f, p, w), fillRectRadius(i, m + 2, u + 2, h, g, T), o === CAR_COLOR.Y_GREEN && fillRectRadius(i, m + 2, u + 2, 68, g, "#FFC81E"), i.save(), i.restore(), i.fillStyle = M, i.font = "bold 28px Arial", i.textAlign = "left", i.textBaseline = "middle";
1778
+ let k = "#164AFF", M = "#FFFFFF";
1779
+ o === CAR_COLOR.YELLOW ? (h = 176, k = "#FFC81E", M = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (f = 200, h = 196, k = "#8FED7C", M = "rgba(0,0,0,0.88)"), n != null && n.length && (f += n.length * 56), fillRectRadius(l, m, u, f, p, y), fillRectRadius(l, m + 2, u + 2, h, g, k), o === CAR_COLOR.Y_GREEN && fillRectRadius(l, m + 2, u + 2, 68, g, "#FFC81E"), l.save(), l.restore(), l.fillStyle = M, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
1755
1780
  const b = `${t.slice(0, 2) + " · " + t.slice(2)}`;
1756
- if (i.fillText(b, m + 12, u + 32), i.save(), i.restore(), n != null && n.length) {
1757
- const P = i.measureText(b).width + 12;
1758
- let x = 0;
1781
+ if (l.fillText(b, m + 12, u + 32), l.save(), l.restore(), n != null && n.length) {
1782
+ const V = l.measureText(b).width + 12;
1783
+ let P = 0;
1759
1784
  n.forEach((v) => {
1760
- v === DEVICE_TYPE.CAMERA && (i.drawImage(cameraImage, s - 54 + P + x * 56, d - 64, 50, 50), ++x), v === DEVICE_TYPE.LOAD && (i.drawImage(loadImage, s - 54 + P + x * 56, d - 64, 50, 50), ++x);
1785
+ v === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, c - 54 + V + P * 56, d - 64, 50, 50), ++P), v === DEVICE_TYPE.LOAD && (l.drawImage(loadImage, c - 54 + V + P * 56, d - 64, 50, 50), ++P);
1761
1786
  });
1762
1787
  }
1763
- const V = dotImage$1;
1764
- i.drawImage(V, s + f / 2 - 90, d, 50 / c, 50 / c), i.restore();
1788
+ const F = dotImage$1;
1789
+ l.drawImage(F, c + f / 2 - 90, d, 50 / s, 50 / s), l.restore();
1765
1790
  }
1766
1791
  }), mapInstance$2 = ref(), renderDashboardSetInstance = (e) => mapInstance$2.value = e;
1767
1792
  ref([]);
@@ -1793,8 +1818,8 @@ const renderTrucksMarker = (e) => {
1793
1818
  focusShipData.value = e;
1794
1819
  const t = formatUtils.convertSixHundredThousandToLatLng(e.lon, e.lat), o = mapInstance$1.value.getPixelFromCoordinate(transform(t, projection.data, projection.mercator));
1795
1820
  currentTruckOverlay.value = drawTruckIcon(e.vno, o, e == null ? void 0 : e.drc);
1796
- const n = mapInstance$1.value.getView(), l = new Point(t);
1797
- n.setCenter(transform(l.getCoordinates(), projection.data, projection.mercator));
1821
+ const n = mapInstance$1.value.getView(), r = new Point(t);
1822
+ n.setCenter(transform(r.getCoordinates(), projection.data, projection.mercator));
1798
1823
  }, clearAllTruck = () => {
1799
1824
  vehicle.value.clearAllShip();
1800
1825
  }, drawTruckIcon = (e, t, o) => {
@@ -1807,15 +1832,15 @@ const renderTrucksMarker = (e) => {
1807
1832
  const e = (t = currentTruckOverlay.value) == null ? void 0 : t.getElement();
1808
1833
  e && (e.innerHTML = "");
1809
1834
  }, zoomTruckIcon = () => {
1810
- var r;
1835
+ var i;
1811
1836
  if (!mapInstance$1.value) return;
1812
1837
  const e = mapInstance$1.value.getView().getZoom(), t = 120, o = 60;
1813
- function n(i) {
1814
- return i < 14 ? o : i >= 14 && i <= 18 ? Math.round((i - 14) * (t - o) / 4 + o) : t;
1838
+ function n(l) {
1839
+ return l < 14 ? o : l >= 14 && l <= 18 ? Math.round((l - 14) * (t - o) / 4 + o) : t;
1815
1840
  }
1816
- const l = n(e);
1817
- (r = document.querySelectorAll(".truck-custom-content")) == null || r.forEach((i) => {
1818
- i.style.width = `${l}px`, i.style.height = `${l}px`;
1841
+ const r = n(e);
1842
+ (i = document.querySelectorAll(".truck-custom-content")) == null || i.forEach((l) => {
1843
+ l.style.width = `${r}px`, l.style.height = `${r}px`;
1819
1844
  });
1820
1845
  }, mapInstance = ref(), drawPolygonSetInstance = (e) => mapInstance.value = e;
1821
1846
  let layerState = "drawn", drawnState = "undrawn";
@@ -1861,13 +1886,13 @@ function createHelpTooltip() {
1861
1886
  }
1862
1887
  let squareLimitError = !1, lineLimitError = !1;
1863
1888
  const validateSquareLimit = (e) => {
1864
- let o = 1 / 0, n = -1 / 0, l = 1 / 0, r = -1 / 0;
1865
- e == null || e.forEach((s) => {
1866
- const d = transform(s, projection.mercator, projection.data), m = d[0], u = d[1];
1867
- o = Math.min(o, u), n = Math.max(n, u), l = Math.min(l, m), r = Math.max(r, m);
1889
+ let o = 1 / 0, n = -1 / 0, r = 1 / 0, i = -1 / 0;
1890
+ e == null || e.forEach((c) => {
1891
+ const d = transform(c, projection.mercator, projection.data), m = d[0], u = d[1];
1892
+ o = Math.min(o, u), n = Math.max(n, u), r = Math.min(r, m), i = Math.max(i, m);
1868
1893
  });
1869
- const i = (n - o) * 111, c = (r - l) * 111;
1870
- squareLimitError = i > 150 || c > 150;
1894
+ const l = (n - o) * 111, s = (i - r) * 111;
1895
+ squareLimitError = l > 150 || s > 150;
1871
1896
  };
1872
1897
  let storeFeature, callbackFunction = null;
1873
1898
  const addInteraction = (e) => {
@@ -1879,41 +1904,41 @@ const addInteraction = (e) => {
1879
1904
  style: [drawPolygonStyle.drawing, circleStyle]
1880
1905
  }), (n = mapInstance.value) == null || n.addInteraction(draw), createMeasureTooltip(), createHelpTooltip();
1881
1906
  let t;
1882
- draw.on("drawstart", function(l) {
1883
- var r;
1884
- layerState = "drawn", sketch = l.feature, t = (r = sketch.getGeometry()) == null ? void 0 : r.on("change", function(i) {
1885
- const c = i.target, s = formatUtils.formatArea(c, LENGTH_UNIT.NM), m = c.getCoordinates()[0], u = new LineString([m[m.length - 2], m[m.length - 1]]), f = formatUtils.formatLength(u, LENGTH_UNIT.NM);
1886
- if (lineLimitError = Number(getLength(u) / 1e3) > 150, validateSquareLimit(m), measureTooltipElement && s && (measureTooltipElement.innerHTML = `
1887
- <span class="text">面积:${s}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1888
- `), helpTooltipElement && s) {
1907
+ draw.on("drawstart", function(r) {
1908
+ var i;
1909
+ layerState = "drawn", sketch = r.feature, t = (i = sketch.getGeometry()) == null ? void 0 : i.on("change", function(l) {
1910
+ const s = l.target, c = formatUtils.formatArea(s, LENGTH_UNIT.NM), m = s.getCoordinates()[0], u = new LineString([m[m.length - 2], m[m.length - 1]]), f = formatUtils.formatLength(u, LENGTH_UNIT.NM);
1911
+ if (lineLimitError = Number(getLength(u) / 1e3) > 150, validateSquareLimit(m), measureTooltipElement && c && (measureTooltipElement.innerHTML = `
1912
+ <span class="text">面积:${c}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1913
+ `), helpTooltipElement && c) {
1889
1914
  let p = "";
1890
- parseFloat(s) > 0 && (p = `
1891
- <div class="text ${squareLimitError ? "error" : ""}">面积:${s}${squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</div>`), helpTooltipElement.innerHTML = `${p}
1915
+ parseFloat(c) > 0 && (p = `
1916
+ <div class="text ${squareLimitError ? "error" : ""}">面积:${c}${squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</div>`), helpTooltipElement.innerHTML = `${p}
1892
1917
  <span class="text ${lineLimitError ? "error" : ""}">线段${m.length - 2}:${f}${lineLimitError ? '<span class="error pl-4">超出可以绘画的距离</span>' : ""}</span>
1893
1918
  <div><span class="text">单击继续,双击结束</span></div>
1894
1919
  `;
1895
1920
  }
1896
1921
  }), drawnState = "drawing";
1897
- }), draw.on("drawend", function(l) {
1898
- var r;
1899
- if (l.feature.getGeometry()) {
1900
- storeFeature = l.feature;
1901
- const i = endFn(l.feature);
1902
- i != null && i.length && callbackFunction && callbackFunction(i);
1922
+ }), draw.on("drawend", function(r) {
1923
+ var i;
1924
+ if (r.feature.getGeometry()) {
1925
+ storeFeature = r.feature;
1926
+ const l = endFn(r.feature);
1927
+ l != null && l.length && callbackFunction && callbackFunction(l);
1903
1928
  }
1904
1929
  if (sketch = null, measureTooltipElement = null, createMeasureTooltip(), t && unByKey(t), drawnState = "drawend", draw) {
1905
- const i = mapInstance.value.getInteractions().getArray().find((c) => c.ol_uid === draw.ol_uid);
1906
- i && ((r = mapInstance.value) == null || r.removeInteraction(i)), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement);
1930
+ const l = mapInstance.value.getInteractions().getArray().find((s) => getUid(s) === getUid(draw));
1931
+ l && ((i = mapInstance.value) == null || i.removeInteraction(l)), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement);
1907
1932
  }
1908
1933
  });
1909
1934
  }, removeInteraction = () => {
1910
1935
  var e, t, o;
1911
1936
  if (mapInstance.value) {
1912
1937
  if (document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach((n) => {
1913
- var l;
1914
- (l = n == null ? void 0 : n.parentNode) == null || l.removeChild(n);
1938
+ var r;
1939
+ (r = n == null ? void 0 : n.parentNode) == null || r.removeChild(n);
1915
1940
  }), source.clear(), (e = mapInstance.value) == null || e.removeLayer(drawVector), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement), ((t = mapInstance.value) == null ? void 0 : t.getTargetElement()).style.cursor = "", document.querySelector("#map").style.cursor = "", draw) {
1916
- const n = mapInstance.value.getInteractions().getArray().find((l) => l.ol_uid === draw.ol_uid);
1941
+ const n = mapInstance.value.getInteractions().getArray().find((r) => getUid(r) === getUid(draw));
1917
1942
  n && ((o = mapInstance.value) == null || o.removeInteraction(n));
1918
1943
  }
1919
1944
  drawnState = "undrawn", layerState = "destroyed";
@@ -1921,15 +1946,15 @@ const addInteraction = (e) => {
1921
1946
  }, endFn = (e) => {
1922
1947
  var t, o, n;
1923
1948
  if (e.getGeometry()) {
1924
- const l = [], i = e.getGeometry().getCoordinates();
1925
- (t = i[0]) == null || t.forEach((s) => {
1926
- l.push(transform(s, projection.mercator, projection.data));
1949
+ const r = [], l = e.getGeometry().getCoordinates();
1950
+ (t = l[0]) == null || t.forEach((c) => {
1951
+ r.push(transform(c, projection.mercator, projection.data));
1927
1952
  });
1928
- const c = i[0][i[0].length - 2];
1929
- if (c && measureTooltip.setPosition(c), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), (o = document.querySelector(".delete-icon")) == null || o.addEventListener("click", () => {
1953
+ const s = l[0][l[0].length - 2];
1954
+ if (s && measureTooltip.setPosition(s), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), (o = document.querySelector(".delete-icon")) == null || o.addEventListener("click", () => {
1930
1955
  reset();
1931
1956
  }), !lineLimitError && !squareLimitError)
1932
- return l;
1957
+ return r;
1933
1958
  draw && ((n = mapInstance.value) == null || n.removeInteraction(draw)), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement);
1934
1959
  }
1935
1960
  }, initFeature = (e) => {
@@ -1937,14 +1962,14 @@ const addInteraction = (e) => {
1937
1962
  if (e && (callbackFunction = e), layerState = "drawn", storeFeature) {
1938
1963
  const n = storeFeature.getGeometry();
1939
1964
  if (!n) return;
1940
- const l = formatUtils.formatArea(n, LENGTH_UNIT.NM);
1965
+ const r = formatUtils.formatArea(n, LENGTH_UNIT.NM);
1941
1966
  measureTooltipElement && (measureTooltipElement.innerHTML = `
1942
- <span class="text">面积:${l}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1967
+ <span class="text">面积:${r}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1943
1968
  `), (t = drawVector.getSource()) == null || t.addFeature(storeFeature);
1944
- const r = endFn(storeFeature);
1945
- r != null && r.length && callbackFunction && callbackFunction(r);
1946
- const i = getCenter(storeFeature.getGeometry().getExtent());
1947
- (o = mapInstance.value) == null || o.getView().setCenter(i);
1969
+ const i = endFn(storeFeature);
1970
+ i != null && i.length && callbackFunction && callbackFunction(i);
1971
+ const l = getCenter(storeFeature.getGeometry().getExtent());
1972
+ (o = mapInstance.value) == null || o.getView().setCenter(l);
1948
1973
  }
1949
1974
  }, pointerMoveHandler = function(e) {
1950
1975
  var o;
@@ -1985,17 +2010,17 @@ dotImage.crossOrigin = "anonymous";
1985
2010
  const dotActiveImage = new Image();
1986
2011
  dotActiveImage.crossOrigin = "anonymous";
1987
2012
  const setPointStyle = (e, t, o) => {
1988
- const { color: n, url: l, activeUrl: r, activeColor: i } = o;
1989
- return (r || l) && (e ? dotActiveImage.src = CDN_URL + (r || l) : dotImage.src = CDN_URL + (l || r)), new Style({
1990
- renderer: (c, s) => {
1991
- const d = s.context;
2013
+ const { color: n, url: r, activeUrl: i, activeColor: l } = o;
2014
+ return (i || r) && (e ? dotActiveImage.src = CDN_URL + (i || r) : dotImage.src = CDN_URL + (r || i)), new Style({
2015
+ renderer: (s, c) => {
2016
+ const d = c.context;
1992
2017
  d.save();
1993
2018
  const m = 1;
1994
2019
  d.scale(m, m);
1995
- let [u, f] = c;
1996
- u = u / m, f = f / m, d.font = "12px Arial";
1997
- const p = d.measureText(t).width, w = u - p / 2, h = f - 10, g = p + 4, T = 20, M = e && i || n;
1998
- if (fillRectRadius(d, w, h + 30, g, T, M), d.save(), d.restore(), d.fillStyle = e ? "#FFFFFF" : "#000000", d.textAlign = "center", d.textBaseline = "middle", d.fillText(t, w + (p + 4) / 2, h + 41), d.save(), d.restore(), l || r) {
2020
+ let [u, f] = s;
2021
+ u = Number(u) / m, f = Number(f) / m, d.font = "12px Arial";
2022
+ const p = d.measureText(t).width, y = u - p / 2, h = f - 10, g = p + 4, k = 20, M = e && l || n;
2023
+ if (fillRectRadius(d, y, h + 30, g, k, M), d.save(), d.restore(), d.fillStyle = e ? "#FFFFFF" : "#000000", d.textAlign = "center", d.textBaseline = "middle", d.fillText(t, y + (p + 4) / 2, h + 41), d.save(), d.restore(), r || i) {
1999
2024
  const b = e ? dotActiveImage : dotImage;
2000
2025
  d.drawImage(b, u - b.width / 2, f - b.height / 2, 40 / m, 40 / m);
2001
2026
  }
@@ -2042,9 +2067,9 @@ class PointMarkerClass {
2042
2067
  if (this.deleteAllPointMarkers(), !this.mapInstance) return;
2043
2068
  let o = {};
2044
2069
  t.forEach((n) => {
2045
- var r;
2046
- const l = [n.lon, n.lat];
2047
- if (((r = this.highlightPoint) == null ? void 0 : r.id) === n.id)
2070
+ var i;
2071
+ const r = [n.lon, n.lat];
2072
+ if (((i = this.highlightPoint) == null ? void 0 : i.id) === n.id)
2048
2073
  o = {
2049
2074
  id: n.id,
2050
2075
  name: n.name,
@@ -2052,12 +2077,12 @@ class PointMarkerClass {
2052
2077
  pointType: n.pointType
2053
2078
  };
2054
2079
  else {
2055
- const i = this.getFeature(n, l);
2080
+ const l = this.getFeature(n, r);
2056
2081
  this.pointMarkerList.push({
2057
2082
  id: n.id,
2058
2083
  name: n.name,
2059
2084
  lonlat: [Number(n.lon), Number(n.lat)],
2060
- feature: i,
2085
+ feature: l,
2061
2086
  pointType: n.pointType
2062
2087
  });
2063
2088
  }
@@ -2103,23 +2128,23 @@ class PointMarkerClass {
2103
2128
  */
2104
2129
  highlightPointMarker(t) {
2105
2130
  if (!this.mapInstance) return;
2106
- const { id: o, name: n, fullName: l, lon: r, lat: i, pointType: c } = t, s = [Number(r), Number(i)];
2131
+ const { id: o, name: n, fullName: r, lon: i, lat: l, pointType: s } = t, c = [Number(i), Number(l)];
2107
2132
  this.highlightPoint = {
2108
2133
  id: o,
2109
2134
  name: n,
2110
- fullName: l,
2111
- lonlat: s,
2112
- pointType: c
2113
- }, this.setPointCenter(s);
2135
+ fullName: r,
2136
+ lonlat: c,
2137
+ pointType: s
2138
+ }, this.setPointCenter(c);
2114
2139
  }
2115
2140
  // 获取feature
2116
2141
  getFeature(t, o) {
2117
- var l;
2142
+ var r;
2118
2143
  const n = new Feature({
2119
2144
  geometry: new Point(fromLonLat(o))
2120
2145
  });
2121
2146
  return n.set("data", t), n.setStyle(
2122
- setPointStyle(((l = this.highlightPoint) == null ? void 0 : l.id) === t.id, t.name, this.options)
2147
+ setPointStyle(((r = this.highlightPoint) == null ? void 0 : r.id) === t.id, t.name, this.options)
2123
2148
  ), n;
2124
2149
  }
2125
2150
  /**
@@ -2132,10 +2157,10 @@ class PointMarkerClass {
2132
2157
  */
2133
2158
  setPointCenter(t, o = { customZoom: mapZoom.findShip, type: 1 }) {
2134
2159
  if (!this.mapInstance) return;
2135
- const { customZoom: n = mapZoom.findShip, type: l = 1 } = o, r = this.mapInstance.getView(), i = r.getZoom();
2136
- (l === 1 || i > n && l === 2 || i < n && l === 3) && r.setZoom(n);
2137
- const c = new Point(t);
2138
- r.setCenter(transform(c.getCoordinates(), projection.data, projection.mercator));
2160
+ const { customZoom: n = mapZoom.findShip, type: r = 1 } = o, i = this.mapInstance.getView(), l = i.getZoom();
2161
+ (r === 1 || l > n && r === 2 || l < n && r === 3) && i.setZoom(n);
2162
+ const s = new Point(t);
2163
+ i.setCenter(transform(s.getCoordinates(), projection.data, projection.mercator));
2139
2164
  }
2140
2165
  }
2141
2166
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -2153,23 +2178,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2153
2178
  setup(e, { expose: t, emit: o }) {
2154
2179
  const n = ref();
2155
2180
  provide("mapInstance", n);
2156
- const l = ref(null), r = ref(null), i = ref(null), c = o, s = e, d = ref(s.zoom || mapZoom.default), m = ref(!1), u = ref(!0), f = ref(!0);
2157
- let p;
2158
- ((v) => {
2159
- v[v.tiandituTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) })] = "tiandituTile", v[v.tiandituTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) })] = "tiandituTileMark", v[v.tiandituImgTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 })] = "tiandituImgTile", v[v.tiandituImgTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 })] = "tiandituImgTileMark", v[v.greenMark = new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })] = "greenMark";
2160
- })(p || (p = {}));
2161
- const w = () => {
2162
- var y, L;
2181
+ const r = ref(null), i = ref(null), l = ref(null), s = o, c = e, d = ref(c.zoom || mapZoom.default), m = ref(!1), u = ref(!0), f = ref(!0), p = {
2182
+ tiandituTile: new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) }),
2183
+ tiandituTileMark: new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) }),
2184
+ tiandituImgTile: new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 }),
2185
+ tiandituImgTileMark: new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 }),
2186
+ greenMark: new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })
2187
+ }, y = () => {
2188
+ var L, w;
2163
2189
  const v = {
2164
2190
  projection: projection.mercator,
2165
2191
  // 地图投影坐标系
2166
- zoom: s.zoom || (s.vehicleMode === "ship" ? mapZoom.default : mapZoom.truckDefault),
2192
+ zoom: c.zoom || (c.vehicleMode === "ship" ? mapZoom.default : mapZoom.truckDefault),
2167
2193
  // 地图缩放级别(打开页面时默认级别)
2168
2194
  minZoom: mapZoom.min,
2169
2195
  // 地图缩放最小级别
2170
2196
  maxZoom: mapZoom.max,
2171
2197
  // 地图缩放最大级别
2172
- center: transformUtils.lonLatToMercator(s.center || mapDefaultCenter),
2198
+ center: transformUtils.lonLatToMercator(c.center || mapDefaultCenter),
2173
2199
  // 地图中心坐标
2174
2200
  constrainResolution: !0,
2175
2201
  // 需设为true禁用平滑缩放,zoom值为整数
@@ -2189,67 +2215,67 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2189
2215
  p.greenMark
2190
2216
  ],
2191
2217
  view: new View(v)
2192
- }), h(), (y = r.value) == null || y.setScaleLine(s.vehicleMode === "ship" && "nautical"), (L = n.value) == null || L.on("moveend", b), g(v.zoom < mapZoom.shipGreenDotMax), M(s.vehicleMode === "ship" || s.viewMode === "findShip" ? BaseMapType.satellite : BaseMapType.vector), s.viewMode === "findShip" && s.mmsi && s.shipData && nextTick(() => {
2193
- findShip(String(s.mmsi), s.shipData);
2218
+ }), h(), (L = i.value) == null || L.setScaleLine(c.vehicleMode === "ship" ? "nautical" : "metric"), (w = n.value) == null || w.on("moveend", b), g(v.zoom < mapZoom.shipGreenDotMax), M(c.vehicleMode === "ship" || c.viewMode === "findShip" ? BaseMapType.satellite : BaseMapType.vector), c.viewMode === "findShip" && c.mmsi && c.shipData && nextTick(() => {
2219
+ findShip(String(c.mmsi), c.shipData);
2194
2220
  }), onShipsMarkerHover();
2195
2221
  };
2196
2222
  onMounted(() => {
2197
- w();
2223
+ y();
2198
2224
  });
2199
2225
  const h = () => {
2200
2226
  n.value && (renderCustomOverlaySetInstance(n.value), renderTruckSetInstance(n.value), drawPolygonSetInstance(n.value), renderShipStyleSetInstance(n.value), renderTrackStyleSetInstance(n.value), renderDashboardSetInstance(n.value), renderMarkerSetInstance(n.value), renderShipSetInstance(n.value), renderTrackSetInstance(n.value));
2201
2227
  }, g = (v) => {
2202
- var y;
2203
- s.vehicleMode !== "ship" && (v = !1), (y = n.value) == null || y.getLayers().forEach((L) => {
2204
- L.ol_uid === p.greenMark.ol_uid && (L.setVisible(v), u.value = v);
2228
+ var L;
2229
+ c.vehicleMode !== "ship" && (v = !1), (L = n.value) == null || L.getLayers().forEach((w) => {
2230
+ getUid(w) === getUid(p.greenMark) && (w.setVisible(v), u.value = v);
2205
2231
  });
2206
- }, T = ref(BaseMapType.satellite), M = (v) => {
2207
- var y;
2208
- T.value = v, (y = n.value) == null || y.getLayers().forEach((L) => {
2209
- (L.ol_uid === p.tiandituTile.ol_uid || L.ol_uid === p.tiandituTileMark.ol_uid || L.ol_uid === p.tiandituImgTile.ol_uid || L.ol_uid === p.tiandituImgTileMark.ol_uid) && L.setVisible(!1), (v === BaseMapType.vector && (L.ol_uid === p.tiandituTile.ol_uid || L.ol_uid === p.tiandituTileMark.ol_uid) || v === BaseMapType.satellite && (L.ol_uid === p.tiandituImgTile.ol_uid || L.ol_uid === p.tiandituImgTileMark.ol_uid)) && L.setVisible(!0);
2232
+ }, k = ref(BaseMapType.satellite), M = (v) => {
2233
+ var L;
2234
+ k.value = v, (L = n.value) == null || L.getLayers().forEach((w) => {
2235
+ (getUid(w) === getUid(p.tiandituTile) || getUid(w) === getUid(p.tiandituTileMark) || getUid(w) === getUid(p.tiandituImgTile) || getUid(w) === getUid(p.tiandituImgTileMark)) && w.setVisible(!1), (v === BaseMapType.vector && (getUid(w) === getUid(p.tiandituTile) || getUid(w) === getUid(p.tiandituTileMark)) || v === BaseMapType.satellite && (getUid(w) === getUid(p.tiandituImgTile) || getUid(w) === getUid(p.tiandituImgTileMark))) && w.setVisible(!0);
2210
2236
  });
2211
2237
  }, b = () => {
2212
- const v = n.value.getView(), y = v.getZoom();
2213
- y && V(y);
2214
- const L = v.calculateExtent(n.value.getSize());
2215
- L && y && P(L, y);
2216
- }, V = (v) => {
2217
- var k, S, E, C, F;
2238
+ const v = n.value.getView(), L = v.getZoom();
2239
+ L && F(L);
2240
+ const w = v.calculateExtent(n.value.getSize());
2241
+ w && L && V(w, L);
2242
+ }, F = (v) => {
2243
+ var S, T, C, E, x;
2218
2244
  d.value = v, g(v < mapZoom.shipGreenDotMax);
2219
- const y = (k = n.value) == null ? void 0 : k.getLayers(), L = s.vehicleMode === "ship" ? y == null ? void 0 : y.getArray().find(($) => $.ol_uid === p.greenMark.ol_uid) : void 0;
2220
- showTrackLayer.value ? (f.value = !1, L == null || L.setVisible(!1), (S = shipsLayer.value) == null || S.setVisible(!1), (E = largeAmountShipsLayer.value) == null || E.setVisible(!1)) : !m.value && u.value && v <= mapZoom.shipGreenDotMax ? (f.value = !0, L == null || L.setVisible(!0), (C = shipsLayer.value) == null || C.setVisible(!1), (F = largeAmountShipsLayer.value) == null || F.setVisible(!1)) : (f.value = !1, L == null || L.setVisible(!1)), c("zoomChanged", v);
2221
- }, P = (v, y) => {
2222
- const L = transform([v[0], v[1]], projection.mercator, projection.data), k = transform([v[2], v[3]], projection.mercator, projection.data);
2223
- c("extentChanged", { extent: [L, k], zoom: y });
2245
+ const L = (S = n.value) == null ? void 0 : S.getLayers(), w = c.vehicleMode === "ship" ? L == null ? void 0 : L.getArray().find((N) => getUid(N) === getUid(p.greenMark)) : void 0;
2246
+ showTrackLayer.value ? (f.value = !1, w == null || w.setVisible(!1), (T = shipsLayer.value) == null || T.setVisible(!1), (C = largeAmountShipsLayer.value) == null || C.setVisible(!1)) : !m.value && u.value && v <= mapZoom.shipGreenDotMax ? (f.value = !0, w == null || w.setVisible(!0), (E = shipsLayer.value) == null || E.setVisible(!1), (x = largeAmountShipsLayer.value) == null || x.setVisible(!1)) : (f.value = !1, w == null || w.setVisible(!1)), s("zoomChanged", v);
2247
+ }, V = (v, L) => {
2248
+ const w = transform([v[0], v[1]], projection.mercator, projection.data), S = transform([v[2], v[3]], projection.mercator, projection.data);
2249
+ s("extentChanged", { extent: [w, S], zoom: L });
2224
2250
  };
2225
2251
  return t({
2226
2252
  mapInstance: n,
2227
- initMap: w,
2228
- pointRender: (v, y) => new PointMarkerClass(v, y),
2253
+ initMap: y,
2254
+ pointRender: (v, L) => new PointMarkerClass(v, L),
2229
2255
  renderTrucksMarker,
2230
2256
  renderShip: renderShips,
2231
- renderTrack: (v, y, L) => {
2232
- var k, S;
2233
- currentTrackId.value = v, showTrackLayer.value = !0, m.value = !0, hiddenAllShips(), (S = (k = largeAmountShipsLayer.value) == null ? void 0 : k.getSource()) == null || S.clear(), renderTrack(v, s.vehicleMode === "ship" ? y.reverse() : y, L, LENGTH_UNIT.NM);
2257
+ renderTrack: (v, L, w) => {
2258
+ var S, T;
2259
+ currentTrackId.value = v, showTrackLayer.value = !0, m.value = !0, hiddenAllShips(), (T = (S = largeAmountShipsLayer.value) == null ? void 0 : S.getSource()) == null || T.clear(), renderTrack(v, c.vehicleMode === "ship" ? L.reverse() : L, w, LENGTH_UNIT.NM);
2234
2260
  },
2235
2261
  findTruck,
2236
2262
  removeTruckIcon,
2237
2263
  clearAllTruck,
2238
2264
  closeTrack: () => {
2239
- var v, y;
2240
- showTrackLayer.value = !1, (v = shipTrackVectorLayer.value) == null || v.setVisible(!1), (y = selectShipsLayer.value) == null || y.setVisible(!0), m.value = !1, g(d.value < mapZoom.shipGreenDotMax), allTracks.value = [], stopAnimation();
2265
+ var v, L;
2266
+ showTrackLayer.value = !1, (v = shipTrackVectorLayer.value) == null || v.setVisible(!1), (L = selectShipsLayer.value) == null || L.setVisible(!0), m.value = !1, g(d.value < mapZoom.shipGreenDotMax), allTracks.value = [], stopAnimation();
2241
2267
  },
2242
2268
  closeTruckTrack: () => {
2243
- var v, y;
2244
- showTrackLayer.value = !1, (v = shipTrackVectorLayer.value) == null || v.setVisible(!1), (y = selectShipsLayer.value) == null || y.setVisible(!0), stopAnimation();
2269
+ var v, L;
2270
+ showTrackLayer.value = !1, (v = shipTrackVectorLayer.value) == null || v.setVisible(!1), (L = selectShipsLayer.value) == null || L.setVisible(!0), stopAnimation();
2245
2271
  },
2246
2272
  resetTrackView,
2247
2273
  playTrack,
2248
2274
  clearSelectFeature,
2249
2275
  findShip,
2250
- focusShip: (v, y, L = !0) => {
2251
- var k, S;
2252
- hiddenOrther.value = L, (k = shipsLayer.value) == null || k.setVisible(!L), (S = largeAmountShipsLayer.value) == null || S.setVisible(!1), findShip(v, y);
2276
+ focusShip: (v, L, w = !0) => {
2277
+ var S, T;
2278
+ hiddenOrther.value = w, (S = shipsLayer.value) == null || S.setVisible(!w), (T = largeAmountShipsLayer.value) == null || T.setVisible(!1), findShip(v, L);
2253
2279
  },
2254
2280
  showTracks,
2255
2281
  removeAllTrackLayer,
@@ -2257,8 +2283,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2257
2283
  rerenderShip,
2258
2284
  switchGreenDot: () => g(!1),
2259
2285
  zoomTruckIcon,
2260
- renderTruckTrack: (v, y, L) => {
2261
- showTrackLayer.value = !0, renderTrack(v, y, L, LENGTH_UNIT.KM, "truck");
2286
+ renderTruckTrack: (v, L, w) => {
2287
+ showTrackLayer.value = !0, renderTrack(v, L, w, LENGTH_UNIT.KM, "truck");
2262
2288
  },
2263
2289
  removerLayer: removeShipTrackLineFeatureByIndex,
2264
2290
  renderMarker,
@@ -2266,18 +2292,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2266
2292
  m.value = !0, setMarkerPosition(v);
2267
2293
  },
2268
2294
  getZoomAndCenter: () => {
2269
- var S;
2270
- const v = (S = n.value) == null ? void 0 : S.getView();
2295
+ var T;
2296
+ const v = (T = n.value) == null ? void 0 : T.getView();
2271
2297
  if (!v) return null;
2272
- const y = Math.round(Number(v.getZoom())), { lon: L, lat: k } = transformUtils.mercatorToLonLat(v.getCenter());
2273
- return { zoom: y, center: [L, k] };
2298
+ const L = Math.round(Number(v.getZoom())), { lon: w, lat: S } = transformUtils.mercatorToLonLat(v.getCenter());
2299
+ return { zoom: L, center: [w, S] };
2274
2300
  },
2275
2301
  setCenter: (v) => {
2276
- var k;
2277
- const y = (k = n.value) == null ? void 0 : k.getView();
2278
- if (!y) return null;
2279
- const L = new Point(v);
2280
- y.setCenter(transform(L.getCoordinates(), projection.data, projection.mercator));
2302
+ var S;
2303
+ const L = (S = n.value) == null ? void 0 : S.getView();
2304
+ if (!L) return null;
2305
+ const w = new Point(v);
2306
+ L.setCenter(transform(w.getCoordinates(), projection.data, projection.mercator));
2281
2307
  },
2282
2308
  drawPolygonTool,
2283
2309
  setMapInstance: h,
@@ -2289,12 +2315,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2289
2315
  transform: transformUtils,
2290
2316
  format: formatUtils
2291
2317
  }
2292
- }), (v, y) => (openBlock(), createElementBlock("div", {
2318
+ }), (v, L) => (openBlock(), createElementBlock("div", {
2293
2319
  class: "map-page map-container",
2294
2320
  ref_key: "pageRef",
2295
- ref: l
2321
+ ref: r
2296
2322
  }, [
2297
- y[0] || (y[0] = createElementVNode("div", {
2323
+ L[0] || (L[0] = createElementVNode("div", {
2298
2324
  id: "map",
2299
2325
  class: "map"
2300
2326
  }, null, -1)),
@@ -2303,7 +2329,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2303
2329
  "view-mode": v.viewMode,
2304
2330
  "disable-green-dot": m.value,
2305
2331
  "show-track-layer": unref(showTrackLayer),
2306
- "map-tile-mode": T.value,
2332
+ "map-tile-mode": k.value,
2307
2333
  onSwitchGreenDot: g,
2308
2334
  onSwitchMapTile: M
2309
2335
  }, {
@@ -2315,20 +2341,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2315
2341
  v.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2316
2342
  createVNode(ScaleLine, {
2317
2343
  ref_key: "scaleLineControl",
2318
- ref: r
2344
+ ref: i
2319
2345
  }, null, 512),
2320
2346
  createVNode(ZoomControl, {
2321
2347
  ref_key: "zoomControl",
2322
- ref: i
2348
+ ref: l
2323
2349
  }, null, 512)
2324
2350
  ], 64)) : createCommentVNode("", !0),
2325
2351
  createVNode(Copyright, {
2326
2352
  type: v.logoType,
2327
- "map-tile": T.value
2353
+ "map-tile": k.value
2328
2354
  }, null, 8, ["type", "map-tile"])
2329
2355
  ], 512));
2330
2356
  }
2331
- }), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-79369628"]]), ZhMap = withInstall(Map);
2357
+ }), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8300c924"]]), ZhMap = withInstall(Map);
2332
2358
  export {
2333
2359
  BaseMapType as B,
2334
2360
  CDN_URL as C,