zhihao-ui 1.2.37 → 1.2.39

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