zhihao-ui 1.3.28 → 1.3.30

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 (28) hide show
  1. package/dist/es/{BaseInfo-BhnEjLKF.js → BaseInfo-lEzbpRa-.js} +1 -1
  2. package/dist/es/{BaseItem-C4NJy1i4.js → BaseItem-Ba9x8bVd.js} +3 -3
  3. package/dist/es/{Button-CGndQwez.js → Button-BEYBRduL.js} +2 -2
  4. package/dist/es/{DatePicker-Dy1K1cJQ.js → DatePicker-LYMSAOex.js} +3 -3
  5. package/dist/es/{DetailHeader-DaabNj_4.js → DetailHeader-BmAOi010.js} +3 -3
  6. package/dist/es/{DetailSubTitle-CzFZPXeE.js → DetailSubTitle-BiVypTgw.js} +2 -2
  7. package/dist/es/{Dialog-BUW6ag1B.js → Dialog-CxVSOXNv.js} +3 -3
  8. package/dist/es/{DiyDataTable-D-UZVciZ.js → DiyDataTable-Ccfx_x83.js} +4 -4
  9. package/dist/es/{EditInfoPair-B2f6zoGY.js → EditInfoPair-B13CtS67.js} +3 -3
  10. package/dist/es/{FileWrapper-D4IxJemr.js → FileWrapper-BS8tKD93.js} +4 -4
  11. package/dist/es/{Grid-DIs695lY.js → Grid-C2SGqgzr.js} +2 -2
  12. package/dist/es/{InfoPair-Ce7nDfxD.js → InfoPair-Dh7Wmmxp.js} +3 -3
  13. package/dist/es/{Input-C5X2X_YD.js → Input-D2hOF2Qz.js} +3 -3
  14. package/dist/es/{Loading-BgoEv5qE.js → Loading-D_TaBO77.js} +2 -2
  15. package/dist/es/{Map-ClzGhgQK.js → Map-CE1xShMf.js} +718 -699
  16. package/dist/es/{MessageBox-DiGH5x51.js → MessageBox-jeff4H3s.js} +2 -2
  17. package/dist/es/{MoneyInput-D0kYiOfP.js → MoneyInput-DsPqwnRE.js} +8 -8
  18. package/dist/es/{PageHeadPanel-C6IdOq6I.js → PageHeadPanel-DzTiZsrm.js} +2 -2
  19. package/dist/es/{Table-B_3YA1mb.js → Table-DVUXl407.js} +5 -5
  20. package/dist/es/{ToolTips-CiQHxGrw.js → ToolTips-D6btU9GM.js} +6 -6
  21. package/dist/es/index.js +22 -22
  22. package/dist/es/{utils-D2wHR1YB.js → utils-BOPMDuno.js} +1 -1
  23. package/dist/es/{vendor-D2mv9LHk.js → vendor-DHIg4jsE.js} +1231 -1230
  24. package/dist/index.css +1 -1
  25. package/dist/types/components/Map/function/port.d.ts +1 -2
  26. package/dist/umd/index.css +1 -1
  27. package/dist/umd/index.umd.cjs +39 -39
  28. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
- import { defineComponent as Ae, openBlock as We, createElementBlock as Ye, createElementVNode as Ze, ref as U, computed as Te, h as re, createVNode as De, render as Nt, reactive as St, onMounted as $t, onUnmounted as Vt } from "vue";
2
- import { S as zt, M as Ue, T as he, X as me, p as I, V as Ot, q as Rt, t as Zt, h as lt, r as Be, s as Dt, u as ue, F as Q, v as H, O as ie, P as ne, w as xe, x as qe, L as Pe, y as Gt, z as Ie, A as se, B as ve, C as ae, D as fe, i as At, G as Se, H as Wt, I as be, J as Yt, K as Bt, N as st, Q as Ne, R as Ge, U as et, W as qt, Y as Ht, Z as Xt } from "./vendor-D2mv9LHk.js";
3
- import { _ as He } from "./Button-CGndQwez.js";
4
- import { w as jt } from "./utils-D2wHR1YB.js";
5
- const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
1
+ import { defineComponent as Ge, openBlock as We, createElementBlock as Ye, createElementVNode as Ze, ref as U, computed as Te, h as oe, createVNode as Ae, render as St, reactive as Nt, onMounted as $t, onUnmounted as Vt } from "vue";
2
+ import { S as zt, M as Ue, T as he, X as me, p as I, V as Ot, q as Rt, r as Zt, t as At, h as lt, s as Be, u as Dt, v as ue, F as Q, w as H, O as ie, P as re, x as xe, y as qe, L as Pe, z as Gt, A as Ie, B as se, C as ve, D as ae, G as fe, i as Wt, H as Ne, I as Yt, J as be, K as Bt, N as qt, Q as st, R as Se, U as De, W as et, Y as Ht, Z as Xt, _ as jt } from "./vendor-DHIg4jsE.js";
3
+ import { _ as He } from "./Button-BEYBRduL.js";
4
+ import { w as Qt } from "./utils-BOPMDuno.js";
5
+ const Jt = { id: "scale-line-container" }, Kt = /* @__PURE__ */ Ge({
6
6
  __name: "scaleLine",
7
- setup(e, { expose: l }) {
8
- return l({
7
+ setup(e, { expose: r }) {
8
+ return r({
9
9
  setScaleLine: (s, a) => {
10
10
  a || (a = "metric");
11
11
  const o = new zt({
12
12
  units: a
13
- }), f = document.getElementById("scale-line-container");
14
- f && (o.setTarget(f), s.addControl(o));
13
+ }), v = document.getElementById("scale-line-container");
14
+ v && (o.setTarget(v), s.addControl(o));
15
15
  }
16
- }), (s, a) => (We(), Ye("div", Qt));
16
+ }), (s, a) => (We(), Ye("div", Jt));
17
17
  }
18
- }), Kt = /* @__PURE__ */ He(Jt, [["__scopeId", "data-v-2bc5dee8"]]), _t = { class: "zoom" }, Ut = /* @__PURE__ */ Ae({
18
+ }), _t = /* @__PURE__ */ He(Kt, [["__scopeId", "data-v-2bc5dee8"]]), Ut = { class: "zoom" }, It = /* @__PURE__ */ Ge({
19
19
  __name: "zoomControl",
20
20
  props: {
21
21
  mapInstance: {
@@ -24,24 +24,24 @@ const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
24
24
  }
25
25
  },
26
26
  setup(e) {
27
- const l = e;
28
- console.log("props", l);
29
- const r = () => {
27
+ const r = e;
28
+ console.log("props", r);
29
+ const l = () => {
30
30
  console.log("props");
31
- const { setZoom: a, getZoom: o, getInstall: f } = l.mapInstance.methods;
32
- if (!f()) return;
31
+ const { setZoom: a, getZoom: o, getInstall: v } = r.mapInstance.methods;
32
+ if (!v()) return;
33
33
  const t = o();
34
34
  t && a(t + 1);
35
35
  }, s = () => {
36
- const { setZoom: a, getZoom: o, getInstall: f } = l.mapInstance.methods;
37
- if (!f()) return;
36
+ const { setZoom: a, getZoom: o, getInstall: v } = r.mapInstance.methods;
37
+ if (!v()) return;
38
38
  const t = o();
39
39
  t && a(t - 1);
40
40
  };
41
- return (a, o) => (We(), Ye("div", _t, [
41
+ return (a, o) => (We(), Ye("div", Ut, [
42
42
  Ze("div", {
43
43
  class: "button big-button",
44
- onClick: r
44
+ onClick: l
45
45
  }, " + "),
46
46
  Ze("div", {
47
47
  class: "button small-button",
@@ -49,7 +49,7 @@ const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
49
49
  }, " - ")
50
50
  ]));
51
51
  }
52
- }), It = /* @__PURE__ */ He(Ut, [["__scopeId", "data-v-c39c3075"]]), Fe = "a6e8f78974f2581f2ca00485b40c948f", ee = {
52
+ }), eo = /* @__PURE__ */ He(It, [["__scopeId", "data-v-c39c3075"]]), Fe = "a6e8f78974f2581f2ca00485b40c948f", ne = {
53
53
  // 地图默认层级
54
54
  default: 13,
55
55
  // 地图缩放最小层级
@@ -69,37 +69,38 @@ const Qt = { id: "scale-line-container" }, Jt = /* @__PURE__ */ Ae({
69
69
  data: "EPSG:4326",
70
70
  // 墨卡托投影坐标 渲染坐标
71
71
  mercator: "EPSG:3857"
72
- }, eo = [114.84, 30.52], it = "https://static.zhihaoscm.cn/", $e = 2003750834e-2;
72
+ }, to = [114.84, 30.52], it = "https://static.zhihaoscm.cn/", $e = 2003750834e-2;
73
73
  var de = ((e) => (e.vectorTile = `https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.vectorTileMark = `https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.satelliteImgTile = `https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.satelliteImgTileMark = `https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${Fe}`, e.greenTile = `${it}/map/tile/{z}/{x}/{y}.png`, e))(de || {}), we = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(we || {});
74
- function to() {
75
- const e = U(), l = () => e.value, r = () => l().getView(), s = () => {
76
- var h;
77
- return (h = r()) == null ? void 0 : h.getZoom();
78
- }, a = (h) => {
79
- var P;
80
- (P = r()) == null || P.setZoom(h);
81
- }, o = (h, P) => {
74
+ function oo() {
75
+ const e = U(), r = () => e.value, l = () => r().getView(), s = () => {
76
+ var y;
77
+ return (y = l()) == null ? void 0 : y.getZoom();
78
+ }, a = (y) => {
79
+ var S;
80
+ (S = l()) == null || S.setZoom(y);
81
+ }, o = (y, S) => {
82
+ var C;
83
+ (C = l()) == null || C.setCenter(I([y, S]));
84
+ }, v = () => {
82
85
  var S;
83
- (S = r()) == null || S.setCenter(I([h, P]));
84
- }, f = () => {
85
- var P;
86
- const h = (P = r()) == null ? void 0 : P.getCenter();
87
- return Zt(h);
86
+ const y = (S = l()) == null ? void 0 : S.getCenter();
87
+ return At(y);
88
88
  }, x = () => {
89
- var h;
90
- return (h = l()) == null ? void 0 : h.getSize();
91
- }, t = new Ue(), n = (h, P) => {
92
- m(P);
93
- const S = {
94
- zoom: P.zoom,
95
- center: I(P.center),
96
- minZoom: ee.min,
97
- maxZoom: ee.max,
89
+ var y;
90
+ return (y = r()) == null ? void 0 : y.getSize();
91
+ }, t = new Ue(), n = (y, S) => {
92
+ m(S);
93
+ const C = {
94
+ zoom: S.zoom,
95
+ center: I(S.center),
96
+ minZoom: ne.min,
97
+ maxZoom: ne.max,
98
98
  constrainResolution: !0,
99
99
  enableRotation: !1,
100
100
  multiWorld: !0
101
- }, y = new Ue({
102
- target: h,
101
+ };
102
+ let f = {
103
+ target: y,
103
104
  controls: Rt({
104
105
  zoom: !1
105
106
  }),
@@ -109,62 +110,73 @@ function to() {
109
110
  t.get("satelliteImgTile"),
110
111
  t.get("satelliteImgTileMark")
111
112
  ],
112
- view: new Ot(S)
113
- });
114
- e.value = y;
115
- }, m = (h) => {
113
+ view: new Ot(C)
114
+ };
115
+ const w = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), P = /MicroMessenger/i.test(navigator.userAgent);
116
+ (w || P) && (f.interactions = Zt({
117
+ // 禁用双击缩放(移动端不需要)
118
+ doubleClickZoom: !1,
119
+ // 禁用鼠标拖拽(用触摸拖拽代替)
120
+ dragPan: !1,
121
+ // 启用触摸拖拽和捏合缩放
122
+ pinchZoom: !0,
123
+ shiftDragZoom: !1
124
+ }));
125
+ const M = new Ue(f);
126
+ e.value = M;
127
+ }, m = (y) => {
116
128
  t.set("vectorTile", new he({
117
129
  source: new me({ url: de.vectorTile }),
118
- visible: h.layerType === "vector",
130
+ visible: y.layerType === "vector",
119
131
  zIndex: 0,
120
132
  preload: 1,
121
133
  className: "vector"
122
134
  })), t.set("vectorTileMark", new he({
123
135
  source: new me({ url: de.vectorTileMark }),
124
- visible: h.layerType === "vector",
136
+ visible: y.layerType === "vector",
125
137
  zIndex: 1,
126
138
  preload: 1,
127
139
  className: "vector"
128
140
  })), t.set("satelliteImgTile", new he({
129
141
  source: new me({ url: de.satelliteImgTile }),
130
- visible: h.layerType === "satellite",
142
+ visible: y.layerType === "satellite",
131
143
  zIndex: 0,
132
144
  preload: 1,
133
145
  className: "satellite"
134
146
  })), t.set("satelliteImgTileMark", new he({
135
147
  source: new me({ url: de.satelliteImgTileMark }),
136
- visible: h.layerType === "satellite",
148
+ visible: y.layerType === "satellite",
137
149
  zIndex: 1,
138
150
  preload: 1,
139
151
  className: "satellite"
140
152
  })), t.set("greenMark", new he({
141
153
  source: new me({ url: de.greenTile }),
142
- visible: h.showGreenLayer,
154
+ visible: y.showGreenLayer,
143
155
  zIndex: 2,
144
156
  className: "greenTile"
145
157
  }));
146
158
  };
147
159
  return {
148
- getInstall: l,
149
- getView: r,
160
+ getInstall: r,
161
+ getView: l,
150
162
  getZoom: s,
151
163
  setZoom: a,
152
164
  setCenter: o,
153
- getCenter: f,
165
+ getCenter: v,
154
166
  getSize: x,
155
167
  initMap: n,
156
168
  setBaseLayerMap: m
157
169
  };
158
170
  }
159
- const Xe = function(e, l) {
160
- const r = Number(l) / 6e5;
161
- return [Number(e) / 6e5, r];
162
- }, oo = (e, l) => {
163
- const r = I(e), s = l * 1e3, a = [
164
- r[0] - s,
165
- r[1] - s,
166
- r[0] + s,
167
- r[1] + s
171
+ const Xe = function(e, r) {
172
+ const l = Number(r) / 6e5;
173
+ return [Number(e) / 6e5, l];
174
+ }, ro = (e, r) => {
175
+ const l = I(e), s = r * 1e3, a = [
176
+ l[0] - s,
177
+ l[1] - s,
178
+ l[0] + s,
179
+ l[1] + s
168
180
  ], o = Dt(a, J.mercator, J.data);
169
181
  return {
170
182
  leftTopPoint: { lng: o[0], lat: o[3] },
@@ -172,10 +184,10 @@ const Xe = function(e, l) {
172
184
  rightBottomPoint: { lng: o[2], lat: o[1] },
173
185
  leftBottomPoint: { lng: o[0], lat: o[1] }
174
186
  };
175
- }, ro = function(e, l) {
187
+ }, no = function(e, r) {
176
188
  const s = Be(e);
177
189
  let a = "";
178
- switch (console.log(l, we), l) {
190
+ switch (console.log(r, we), r) {
179
191
  case we.M:
180
192
  a = Math.round(s * 100) / 100 + " m";
181
193
  break;
@@ -188,122 +200,122 @@ const Xe = function(e, l) {
188
200
  }
189
201
  return a;
190
202
  };
191
- function no(e) {
192
- const l = e[0] * $e / 180;
193
- let r = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
194
- return r = r * $e / 180, [l, r];
203
+ function lo(e) {
204
+ const r = e[0] * $e / 180;
205
+ let l = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
206
+ return l = l * $e / 180, [r, l];
195
207
  }
196
208
  function ge(e = "") {
197
- let l = e.replace(/&?/g, "&");
198
- return l = l.replace(/&#x([0-9a-fA-F]+);?/g, (r, s) => {
209
+ let r = e.replace(/&?/g, "&");
210
+ return r = r.replace(/&#x([0-9a-fA-F]+);?/g, (l, s) => {
199
211
  const a = parseInt(s, 16);
200
212
  return String.fromCodePoint(a);
201
- }), l;
213
+ }), r;
202
214
  }
203
215
  const tt = (e) => {
204
- const l = new ue({
216
+ const r = new ue({
205
217
  font: "Normal 14px map-iconfont",
206
218
  text: ge(e),
207
219
  fill: new Q({ color: "#fff" }),
208
220
  offsetY: -14
209
221
  });
210
222
  return new H({
211
- text: l,
223
+ text: r,
212
224
  zIndex: 100
213
225
  });
214
- }, ot = (e, l = "lonlat") => {
215
- const r = { lon: 0, lat: 0 }, s = e[0] / $e * 180;
226
+ }, ot = (e, r = "lonlat") => {
227
+ const l = { lon: 0, lat: 0 }, s = e[0] / $e * 180;
216
228
  let a = e[1] / $e * 180;
217
- return a = 180 / Math.PI * (2 * Math.atan(Math.exp(a * Math.PI / 180)) - Math.PI / 2), r.lon = s, r.lat = a, l === "lonlat" ? r : [s, a];
218
- }, lo = (e) => {
219
- const l = lt.duration(e, "minutes"), r = Math.floor(l.asDays()), s = l.hours(), a = l.minutes();
229
+ return a = 180 / Math.PI * (2 * Math.atan(Math.exp(a * Math.PI / 180)) - Math.PI / 2), l.lon = s, l.lat = a, r === "lonlat" ? l : [s, a];
230
+ }, so = (e) => {
231
+ const r = lt.duration(e, "minutes"), l = Math.floor(r.asDays()), s = r.hours(), a = r.minutes();
220
232
  let o = `${String(a).padStart(2, "0")}分`;
221
- return s !== 0 && (o = `${String(s).padStart(2, "0")}时${o}`), r !== 0 && (o = `${String(r).padStart(2, "0")}天${o}`), o;
222
- }, so = (e, l) => {
223
- let r = null;
233
+ return s !== 0 && (o = `${String(s).padStart(2, "0")}时${o}`), l !== 0 && (o = `${String(l).padStart(2, "0")}天${o}`), o;
234
+ }, io = (e, r) => {
235
+ let l = null;
224
236
  const s = async (m) => {
225
237
  if (!e || (console.log("vehicleInfo", m), !(m != null && m.lon && (m != null && m.lat)))) return;
226
- const h = Math.abs(Number(m.lon)) > 180 ? Xe(m.lon, m.lat) : [m.lon, m.lat];
227
- a(m, I(h));
228
- const P = e == null ? void 0 : e.getView(), S = new ne(h);
229
- P.setCenter(xe(S.getCoordinates(), J.data, J.mercator));
230
- }, a = (m, h) => {
231
- const P = `${it}map/car-icon.gif`;
232
- r || (r = new ie({
238
+ const y = Math.abs(Number(m.lon)) > 180 ? Xe(m.lon, m.lat) : [m.lon, m.lat];
239
+ a(m, I(y));
240
+ const S = e == null ? void 0 : e.getView(), C = new re(y);
241
+ S.setCenter(xe(C.getCoordinates(), J.data, J.mercator));
242
+ }, a = (m, y) => {
243
+ const S = `${it}map/car-icon.gif`;
244
+ l || (l = new ie({
233
245
  element: document.createElement("div"),
234
246
  positioning: "center-center",
235
247
  stopEvent: !1
236
248
  // 允许交互事件穿透
237
- }), e.addOverlay(r));
238
- const S = r.getElement();
239
- S.style.backgroundImage = `url(${P})`, S.style.width = "80px", S.style.height = "80px";
240
- const y = (m == null ? void 0 : m.drc) || "";
241
- S.style.transform = `rotate(${y}deg)`, S.style.backgroundSize = "cover", r == null || r.setPosition(h);
249
+ }), e.addOverlay(l));
250
+ const C = l.getElement();
251
+ C.style.backgroundImage = `url(${S})`, C.style.width = "80px", C.style.height = "80px";
252
+ const f = (m == null ? void 0 : m.drc) || "";
253
+ C.style.transform = `rotate(${f}deg)`, C.style.backgroundSize = "cover", l == null || l.setPosition(y);
242
254
  };
243
255
  return {
244
256
  location: s,
245
257
  remove: () => {
246
- const m = r == null ? void 0 : r.getElement();
258
+ const m = l == null ? void 0 : l.getElement();
247
259
  m && (m.innerHTML = "");
248
260
  },
249
- renderTrack: (m, h, P) => {
250
- l.render(m, h, P, "truck", 1e3);
261
+ renderTrack: (m, y, S) => {
262
+ r.render(m, y, S, "truck", 1e3);
251
263
  },
252
264
  setCenter: (m) => {
253
- l.setCenter(m);
265
+ r.setCenter(m);
254
266
  },
255
267
  closeTrack: () => {
256
- l.close();
268
+ r.close();
257
269
  },
258
- playTrack: (m, h) => {
259
- l.play(m, h);
270
+ playTrack: (m, y) => {
271
+ r.play(m, y);
260
272
  }
261
273
  };
262
274
  };
263
- var ct = /* @__PURE__ */ ((e) => (e[e.发动机使用中 = 0] = "发动机使用中", e[e.锚泊 = 1] = "锚泊", e[e.未操作 = 2] = "未操作", e[e.操纵能力受限 = 3] = "操纵能力受限", e[e.吃水受限 = 4] = "吃水受限", e[e.系泊 = 5] = "系泊", e[e.搁浅 = 6] = "搁浅", e[e.从事捕捞 = 7] = "从事捕捞", e[e.航行中 = 8] = "航行中", e[e.留作将来修正导航状态 = 9] = "留作将来修正导航状态", e[e.高速船留用 = 10] = "高速船留用", e[e.机动船尾推作业 = 11] = "机动船尾推作业", e[e.机动船顶推或侧推作业 = 12] = "机动船顶推或侧推作业", e[e.飞翼船留用 = 13] = "飞翼船留用", e[e.现行的 = 14] = "现行的", e[e.未定义 = 15] = "未定义", e))(ct || {}), te = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.front = "front", e.up = "up", e.down = "down", e.back = "back", e))(te || {});
264
- const io = (e) => {
265
- const l = /* @__PURE__ */ new Map(), r = {};
275
+ var ct = /* @__PURE__ */ ((e) => (e[e.发动机使用中 = 0] = "发动机使用中", e[e.锚泊 = 1] = "锚泊", e[e.未操作 = 2] = "未操作", e[e.操纵能力受限 = 3] = "操纵能力受限", e[e.吃水受限 = 4] = "吃水受限", e[e.系泊 = 5] = "系泊", e[e.搁浅 = 6] = "搁浅", e[e.从事捕捞 = 7] = "从事捕捞", e[e.航行中 = 8] = "航行中", e[e.留作将来修正导航状态 = 9] = "留作将来修正导航状态", e[e.高速船留用 = 10] = "高速船留用", e[e.机动船尾推作业 = 11] = "机动船尾推作业", e[e.机动船顶推或侧推作业 = 12] = "机动船顶推或侧推作业", e[e.飞翼船留用 = 13] = "飞翼船留用", e[e.现行的 = 14] = "现行的", e[e.未定义 = 15] = "未定义", e))(ct || {}), ee = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.front = "front", e.up = "up", e.down = "down", e.back = "back", e))(ee || {});
276
+ const co = (e) => {
277
+ const r = /* @__PURE__ */ new Map(), l = {};
266
278
  let s = null;
267
279
  const a = "--";
268
280
  let o = null;
269
- const f = document.createElement("div"), x = new ie({
270
- element: f,
281
+ const v = document.createElement("div"), x = new ie({
282
+ element: v,
271
283
  positioning: "top-left",
272
284
  stopEvent: !1,
273
285
  className: "track-label-popup"
274
286
  });
275
- let t, n, m, h, P, S = !1, y = Date.now(), w, L = 0, p = null, b = 20, G = !1;
276
- const W = 5, B = [], X = (c) => {
287
+ let t, n, m, y, S, C = !1, f = Date.now(), w, P = 0, M = null, b = 20, G = !1;
288
+ const Y = 5, B = [], X = (c) => {
277
289
  var d;
278
- for (B.unshift(c); B.length > W; ) {
279
- const g = B.pop(), M = l.get(g);
280
- M && ((d = M.getSource()) == null || d.clear(), e == null || e.removeLayer(M), l.delete(g), delete r[g]);
290
+ for (B.unshift(c); B.length > Y; ) {
291
+ const g = B.pop(), p = r.get(g);
292
+ p && ((d = p.getSource()) == null || d.clear(), e == null || e.removeLayer(p), r.delete(g), delete l[g]);
281
293
  }
282
294
  };
283
295
  let O = "";
284
- const D = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], i = qe(() => {
285
- if (s && r[s] && l.get(s).getVisible() && G) {
296
+ const Z = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], i = qe(() => {
297
+ if (s && l[s] && r.get(s).getVisible() && G) {
286
298
  console.log("reRenderTrackLine------------");
287
- const c = At(u(s, r[s]));
299
+ const c = Wt(u(s, l[s]));
288
300
  ze(s, c);
289
301
  }
290
302
  }, 300), u = (c, d) => {
291
303
  let g = [];
292
- const M = Math.max(1, Math.floor(d.length / b));
293
- return g = d.filter((T, R) => R % M === 0).map((T, R) => {
304
+ const p = Math.max(1, Math.floor(d.length / b));
305
+ return g = d.filter((T, R) => R % p === 0).map((T, R) => {
294
306
  if (Number(T.lon) > 180 || Number(T.lat) > 180) {
295
- const [$, A] = Xe(T.lon, T.lat);
296
- T.lon = $, T.lat = A;
307
+ const [$, D] = Xe(T.lon, T.lat);
308
+ T.lon = $, T.lat = D;
297
309
  }
298
- return T.center = [T.lon, T.lat], T.centerPoint = no(T.center), T.time = lt(T.createdAt).format("YYYY-MM-DD HH:mm:ss"), T.id = c, T.index = R, T;
310
+ return T.center = [T.lon, T.lat], T.centerPoint = lo(T.center), T.time = lt(T.createdAt).format("YYYY-MM-DD HH:mm:ss"), T.id = c, T.index = R, T;
299
311
  }), g;
300
- }, v = async (c, d, g, M = "ship", E = 200) => {
301
- if (console.log("renderTrackLine--------", c, d, g), !e || JSON.stringify(r[c]) === JSON.stringify(d) && s === c || (d = d == null ? void 0 : d.reverse(), x && M === "ship" && (e != null && e.getOverlays().getArray().includes(x) || e.addOverlay(x)), (d == null ? void 0 : d.length) < 2))
312
+ }, h = async (c, d, g, p = "ship", E = 200) => {
313
+ if (console.log("renderTrackLine--------", c, d, g), !e || JSON.stringify(l[c]) === JSON.stringify(d) && s === c || (d = d == null ? void 0 : d.reverse(), x && p === "ship" && (e != null && e.getOverlays().getArray().includes(x) || e.addOverlay(x)), (d == null ? void 0 : d.length) < 2))
302
314
  return;
303
- X(c), s = c, r[c] = d, b = E;
304
- const T = Object.keys(r).findIndex((R) => R === c) || 0;
305
- O = g || D[T > 10 ? 10 : T], G = !0, await N(), await Je(s);
306
- }, C = (c) => {
315
+ X(c), s = c, l[c] = d, b = E;
316
+ const T = Object.keys(l).findIndex((R) => R === c) || 0;
317
+ O = g || Z[T > 10 ? 10 : T], G = !0, await N(), await Je(s);
318
+ }, L = (c) => {
307
319
  const d = new ae();
308
320
  return new ve({
309
321
  source: d,
@@ -314,44 +326,44 @@ const io = (e) => {
314
326
  // 增大渲染缓冲区
315
327
  });
316
328
  }, k = (c) => {
317
- l.forEach((d, g) => {
329
+ r.forEach((d, g) => {
318
330
  var E;
319
- const M = g === c;
320
- d.getVisible() !== M && (d.setVisible(M), e.getLayers().getArray().includes(d) || e.addLayer(d), M || (E = d.getSource()) == null || E.clear());
331
+ const p = g === c;
332
+ d.getVisible() !== p && (d.setVisible(p), e.getLayers().getArray().includes(d) || e.addLayer(d), p || (E = d.getSource()) == null || E.clear());
321
333
  }), s = c;
322
334
  }, N = async () => {
323
335
  const c = s;
324
- if (!l.has(c)) {
325
- const T = C(c);
326
- l.set(c, T);
336
+ if (!r.has(c)) {
337
+ const T = L(c);
338
+ r.set(c, T);
327
339
  }
328
340
  await k(c);
329
- const d = O || "", g = r[c] || [];
341
+ const d = O || "", g = l[c] || [];
330
342
  if (!(g && g.length > 1)) return [];
331
- let M = [];
332
- M = u(c, g);
333
- const E = M.map((T) => T.centerPoint);
334
- M.length >= 2 && await z(c, E, d);
343
+ let p = [];
344
+ p = u(c, g);
345
+ const E = p.map((T) => T.centerPoint);
346
+ p.length >= 2 && await z(c, E, d);
335
347
  }, z = (c, d, g) => {
336
- const M = new Pe(d), E = l.get(c).getSource(), T = E.getFeatureById(c);
348
+ const p = new Pe(d), E = r.get(c).getSource(), T = E.getFeatureById(c);
337
349
  if (T)
338
- T.setGeometry(M), T.setId(c), T.setStyle(Z(g)), p = T;
350
+ T.setGeometry(p), T.setId(c), T.setStyle(A(g)), M = T;
339
351
  else {
340
- const R = new se({ geometry: M });
341
- R.setId(c), R.set("type", "line"), R.setStyle(Z(g)), E.addFeature(R), p = R;
352
+ const R = new se({ geometry: p });
353
+ R.setId(c), R.set("type", "line"), R.setStyle(A(g)), E.addFeature(R), M = R;
342
354
  }
343
- return p;
344
- }, Z = (c) => new H({
355
+ return M;
356
+ }, A = (c) => new H({
345
357
  stroke: new fe({
346
358
  color: c,
347
359
  width: 2
348
360
  })
349
361
  }), V = (c, d, g) => {
350
- const M = c == null ? void 0 : c.get("trackId");
351
- if (c && M && d === "hover") {
352
- e.getTargetElement().style.cursor = M ? "pointer" : "";
362
+ const p = c == null ? void 0 : c.get("trackId");
363
+ if (c && p && d === "hover") {
364
+ e.getTargetElement().style.cursor = p ? "pointer" : "";
353
365
  const E = c.get("data"), T = ce(E), R = g == null ? void 0 : g.coordinate;
354
- R && (f.querySelector(".popup-content"), f.innerHTML = T, x == null || x.setPosition(R));
366
+ R && (v.querySelector(".popup-content"), v.innerHTML = T, x == null || x.setPosition(R));
355
367
  } else
356
368
  x && x.setPosition(void 0);
357
369
  }, ce = (c) => {
@@ -360,7 +372,7 @@ const io = (e) => {
360
372
  return c != null && c.stayTime && (d = `
361
373
  <div class="item w-100">
362
374
  <div class="item-label">停泊时间约</div>
363
- <div class="item-item">${lo(Number(c.stayTime))}</div>
375
+ <div class="item-item">${so(Number(c.stayTime))}</div>
364
376
  </div>
365
377
  `), `
366
378
  <div class="track-point-popup">
@@ -394,32 +406,32 @@ const io = (e) => {
394
406
  </div>
395
407
  ${d ?? d}
396
408
  </div>`;
397
- }, oe = (c) => {
409
+ }, te = (c) => {
398
410
  const g = c.map(($) => {
399
- const A = e.getPixelFromCoordinate(I($.center));
411
+ const D = e.getPixelFromCoordinate(I($.center));
400
412
  return {
401
413
  ...$,
402
414
  original: $,
403
- pixel: A,
415
+ pixel: D,
404
416
  distance: 0
405
417
  // 先初始化,后续计算
406
418
  };
407
419
  });
408
- let M = 0;
420
+ let p = 0;
409
421
  g[0].distance = 0;
410
422
  for (let $ = 1; $ < g.length; $++) {
411
- const A = g[$ - 1].pixel, q = g[$].pixel, K = q[0] - A[0], F = q[1] - A[1];
412
- M += Math.sqrt(K * K + F * F), g[$].distance = M;
423
+ const D = g[$ - 1].pixel, q = g[$].pixel, K = q[0] - D[0], F = q[1] - D[1];
424
+ p += Math.sqrt(K * K + F * F), g[$].distance = p;
413
425
  }
414
426
  const E = g.filter(
415
- ($, A) => A === 0 || A === g.length - 1
427
+ ($, D) => D === 0 || D === g.length - 1
416
428
  ), T = [];
417
429
  for (let $ = 0; $ < E.length; $++) {
418
- const A = E[$];
419
- if (T.push(A), $ < E.length - 1) {
420
- const q = E[$ + 1], K = q.distance - A.distance, F = Math.floor(K / 100);
421
- for (let Y = 1; Y <= F; Y++) {
422
- const j = A.distance + Y * 100;
430
+ const D = E[$];
431
+ if (T.push(D), $ < E.length - 1) {
432
+ const q = E[$ + 1], K = q.distance - D.distance, F = Math.floor(K / 100);
433
+ for (let W = 1; W <= F; W++) {
434
+ const j = D.distance + W * 100;
423
435
  if (j >= q.distance) break;
424
436
  const _ = le(
425
437
  g,
@@ -444,13 +456,13 @@ const io = (e) => {
444
456
  };
445
457
  function le(c, d) {
446
458
  for (let g = 1; g < c.length; g++) {
447
- const M = c[g - 1], E = c[g];
448
- if (d >= M.distance && d <= E.distance) {
449
- const T = (d - M.distance) / (E.distance - M.distance), R = M.pixel[0] + T * (E.pixel[0] - M.pixel[0]), $ = M.pixel[1] + T * (E.pixel[1] - M.pixel[1]), A = e == null ? void 0 : e.getCoordinateFromPixel([R, $]);
459
+ const p = c[g - 1], E = c[g];
460
+ if (d >= p.distance && d <= E.distance) {
461
+ const T = (d - p.distance) / (E.distance - p.distance), R = p.pixel[0] + T * (E.pixel[0] - p.pixel[0]), $ = p.pixel[1] + T * (E.pixel[1] - p.pixel[1]), D = e == null ? void 0 : e.getCoordinateFromPixel([R, $]);
450
462
  return {
451
- ...M,
463
+ ...p,
452
464
  // 继承前一个点的属性(可调整)
453
- coord: A,
465
+ coord: D,
454
466
  pixel: [R, $],
455
467
  distance: d,
456
468
  original: void 0
@@ -462,24 +474,24 @@ const io = (e) => {
462
474
  }
463
475
  const ze = async (c, d) => {
464
476
  await Qe(), await ft(c);
465
- const g = oe(d), M = g.map((T) => ke(T));
466
- l.get(c).getSource().addFeatures(M), ht(c, g, d, O), g.forEach((T) => {
477
+ const g = te(d), p = g.map((T) => ke(T));
478
+ r.get(c).getSource().addFeatures(p), ht(c, g, d, O), g.forEach((T) => {
467
479
  const R = pe(c, O, T);
468
480
  e.addOverlay(R);
469
481
  });
470
482
  }, ke = (c) => {
471
483
  const d = new se({
472
- geometry: new ne(c.centerPoint),
484
+ geometry: new re(c.centerPoint),
473
485
  data: c
474
486
  });
475
487
  d.set("type", "track_point"), d.set("trackId", c.id), d.set("data", c);
476
488
  let g = [
477
489
  ...vt(c, O)
478
490
  ];
479
- return (c.index === 0 || c.index === r[c.id].length - 1) && (g = [...mt(c)], d.set("type", "track_begin")), c.state !== void 0 && c.state !== null && (g = [...yt(c)], d.set("type", "track_icon")), d.setStyle(g), d;
491
+ return (c.index === 0 || c.index === l[c.id].length - 1) && (g = [...mt(c)], d.set("type", "track_begin")), c.state !== void 0 && c.state !== null && (g = [...yt(c)], d.set("type", "track_icon")), d.setStyle(g), d;
480
492
  }, pe = (c, d, g) => {
481
- const M = document.createElement("div");
482
- M.className = "track-overlay-label", M.style.position = "relative", M.style.backgroundColor = "rgba(255,255,255,0.8)", M.style.border = `1px solid ${d}`, M.style.fontSize = "12px", M.innerHTML = `
493
+ const p = document.createElement("div");
494
+ p.className = "track-overlay-label", p.style.position = "relative", p.style.backgroundColor = "rgba(255,255,255,0.8)", p.style.border = `1px solid ${d}`, p.style.fontSize = "12px", p.innerHTML = `
483
495
  <span>${g.time}</span>
484
496
  <svg
485
497
  style="position: absolute;right: -20px;top: 0;"
@@ -493,7 +505,7 @@ const io = (e) => {
493
505
  stroke-width="1" />
494
506
  `;
495
507
  const E = new ie({
496
- element: M,
508
+ element: p,
497
509
  position: I(g.center),
498
510
  positioning: "top-right",
499
511
  offset: [-20, -20],
@@ -507,21 +519,21 @@ const io = (e) => {
507
519
  g.setPosition(void 0), g.dispose();
508
520
  });
509
521
  }, ft = (c) => {
510
- const d = l.get(c).getSource();
522
+ const d = r.get(c).getSource();
511
523
  d.forEachFeature((g) => {
512
524
  g.get("type") !== "line" && d.removeFeature(g);
513
525
  });
514
526
  }, vt = (c, d) => (`${c.time}`, [
515
527
  new H({
516
528
  // 扩大交互热区
517
- image: new Se({
529
+ image: new Ne({
518
530
  stroke: new fe({ color: "rgba(0, 0, 0, 0.01)", width: 20 }),
519
531
  radius: 3
520
532
  })
521
533
  }),
522
534
  // 轨迹点样式
523
535
  new H({
524
- image: new Se({
536
+ image: new Ne({
525
537
  fill: new Q({ color: d }),
526
538
  stroke: new fe({ color: "#fff", width: 2 }),
527
539
  radius: 3
@@ -529,61 +541,61 @@ const io = (e) => {
529
541
  })
530
542
  // textStyle,
531
543
  ]), yt = (c) => {
532
- const d = "#E31818", g = "#1890FF", M = "&#xe6d2", E = new H({
544
+ const d = "#E31818", g = "#1890FF", p = "&#xe6d2", E = new H({
533
545
  text: new ue({
534
546
  font: "Normal 22px map-iconfont",
535
- text: ge(M),
547
+ text: ge(p),
536
548
  offsetY: -10,
537
549
  fill: new Q({
538
550
  color: Number(c.state) === 0 ? d : Number(c.state) === 1 ? g : ""
539
551
  })
540
552
  }),
541
553
  zIndex: 99
542
- }), R = tt("&#xe6e2;"), A = tt("&#xe703;"), q = [];
543
- return Number(c.state) === 0 ? q.push(R) : Number(c.state) === 1 && q.push(A), q.push(E), q;
544
- }, ht = (c, d, g, M) => {
554
+ }), R = tt("&#xe6e2;"), D = tt("&#xe703;"), q = [];
555
+ return Number(c.state) === 0 ? q.push(R) : Number(c.state) === 1 && q.push(D), q.push(E), q;
556
+ }, ht = (c, d, g, p) => {
545
557
  const E = d || [], T = d.length;
546
558
  T || (E.push(g[0]), E.push(g[g.length - 1]));
547
559
  const R = [];
548
- for (let A = 0; A < T - 1; A++) {
560
+ for (let D = 0; D < T - 1; D++) {
549
561
  let q;
550
- const K = d[A], F = (d[A + 1].index + K.index) / 2;
562
+ const K = d[D], F = (d[D + 1].index + K.index) / 2;
551
563
  if (F % 2 === 0)
552
564
  q = g[F].centerPoint;
553
565
  else {
554
- const Y = g[Math.floor(F)], j = g[Math.ceil(F)];
555
- if (Y && j) {
556
- const [_, Ce] = Y.centerPoint, [Le, Ee] = j.centerPoint;
566
+ const W = g[Math.floor(F)], j = g[Math.ceil(F)];
567
+ if (W && j) {
568
+ const [_, Ce] = W.centerPoint, [Le, Ee] = j.centerPoint;
557
569
  q = [(_ + Le) / 2, (Ce + Ee) / 2];
558
570
  }
559
571
  }
560
572
  if (q) {
561
- const Y = new se({
562
- geometry: new ne(q)
573
+ const W = new se({
574
+ geometry: new re(q)
563
575
  });
564
- Y.set("type", "track_arrow"), Y.setStyle(
576
+ W.set("type", "track_arrow"), W.setStyle(
565
577
  new H({
566
578
  text: new ue({
567
579
  font: "700 12px map-iconfont",
568
580
  text: ge("&#xe6bc;"),
569
- fill: new Q({ color: M }),
581
+ fill: new Q({ color: p }),
570
582
  // 设置箭头旋转 角度转为弧度
571
583
  rotation: Ke(
572
- d[A].center,
573
- d[A + 1].center
584
+ d[D].center,
585
+ d[D + 1].center
574
586
  ) * (Math.PI / 180)
575
587
  })
576
588
  })
577
- ), R.push(Y);
589
+ ), R.push(W);
578
590
  }
579
591
  }
580
- const $ = l.get(c).getSource();
592
+ const $ = r.get(c).getSource();
581
593
  $ == null || $.addFeatures(R);
582
594
  }, Je = (c) => {
583
595
  var T, R;
584
- const d = e.getView(), g = (T = l == null ? void 0 : l.get(c)) == null ? void 0 : T.getSource(), M = p || (c ? g == null ? void 0 : g.getFeatureById(c) : null);
585
- if (!M) return;
586
- const E = (R = M == null ? void 0 : M.getGeometry()) == null ? void 0 : R.getExtent();
596
+ const d = e.getView(), g = (T = r == null ? void 0 : r.get(c)) == null ? void 0 : T.getSource(), p = M || (c ? g == null ? void 0 : g.getFeatureById(c) : null);
597
+ if (!p) return;
598
+ const E = (R = p == null ? void 0 : p.getGeometry()) == null ? void 0 : R.getExtent();
587
599
  if (E != null && E.length)
588
600
  try {
589
601
  const $ = Gt(E, Math.max(E[2] - E[0], E[3] - E[1]) * 0.02);
@@ -602,34 +614,34 @@ const io = (e) => {
602
614
  zIndex: 101
603
615
  })];
604
616
  }, wt = () => {
605
- console.log("清除所有的轨迹-----"), Me(), l.forEach((d) => {
617
+ console.log("清除所有的轨迹-----"), Me(), r.forEach((d) => {
606
618
  var g;
607
619
  (g = d.getSource()) == null || g.clear(), e == null || e.removeLayer(d);
608
- }), Object.keys(r).forEach((d) => {
609
- l.delete(d), delete r[d];
620
+ }), Object.keys(l).forEach((d) => {
621
+ r.delete(d), delete l[d];
610
622
  }), G = !1, Qe();
611
623
  }, xt = (c) => {
612
- const d = l.get(c || s);
624
+ const d = r.get(c || s);
613
625
  d == null || d.setVisible(!1);
614
626
  const g = e.getOverlays().getArray();
615
- for (let M = 0; M < g.length; ) {
616
- const E = g[M];
617
- E.get("class") === "track-label-overlay" ? (E.setPosition(void 0), e.removeOverlay(E)) : M++;
627
+ for (let p = 0; p < g.length; ) {
628
+ const E = g[p];
629
+ E.get("class") === "track-label-overlay" ? (E.setPosition(void 0), e.removeOverlay(E)) : p++;
618
630
  }
619
631
  Me();
620
632
  }, bt = (c, d = we.NM) => {
621
633
  const g = {
622
634
  id: c,
623
635
  length: "--"
624
- }, E = (r[c] || []).map(
636
+ }, E = (l[c] || []).map(
625
637
  (R) => xe([R.lon, R.lat], J.data, J.mercator)
626
638
  ), T = new Pe(E);
627
- return g.length = ro(T, d) || "--", g;
639
+ return g.length = no(T, d) || "--", g;
628
640
  }, kt = (c, d) => {
629
641
  pt(String(c), d);
630
642
  }, pt = (c, d) => {
631
- const g = r[String(c)], M = g == null ? void 0 : g.map((E) => [E.lon, E.lat]);
632
- M && Lt(M, d);
643
+ const g = l[String(c)], p = g == null ? void 0 : g.map((E) => [E.lon, E.lat]);
644
+ p && Lt(p, d);
633
645
  }, Oe = new H({
634
646
  text: new ue({
635
647
  font: "700 20px map-iconfont",
@@ -639,32 +651,32 @@ const io = (e) => {
639
651
  // 初始旋转角度
640
652
  })
641
653
  }), Mt = (c, d) => {
642
- var F, Y;
643
- const g = Number(50 * d), M = ((F = c.frameState) == null ? void 0 : F.time) ?? Date.now(), E = M - y;
644
- if (L = (L + g * E / 1e6) % 2, y = M, L >= 1) {
654
+ var F, W;
655
+ const g = Number(50 * d), p = ((F = c.frameState) == null ? void 0 : F.time) ?? Date.now(), E = p - f;
656
+ if (P = (P + g * E / 1e6) % 2, f = p, P >= 1) {
645
657
  Me();
646
658
  return;
647
659
  }
648
660
  const T = n.getCoordinateAt(
649
- L > 1 ? 2 - L : L
661
+ P > 1 ? 2 - P : P
650
662
  ), R = n.getCoordinateAt(
651
- L > 1 ? L - 0.01 : L
663
+ P > 1 ? P - 0.01 : P
652
664
  ), $ = n.getCoordinateAt(
653
- L > 1 ? 2 - L : L + 0.01
665
+ P > 1 ? 2 - P : P + 0.01
654
666
  ), q = Ke(
655
667
  ot(R, "array"),
656
668
  ot($, "array")
657
669
  ) * Math.PI / 180;
658
- (Y = Oe.getText()) == null || Y.setRotation(q), h.setCoordinates(T);
659
- const K = Wt(c);
660
- K.setStyle(Oe), K.drawGeometry(h), e == null || e.render();
670
+ (W = Oe.getText()) == null || W.setRotation(q), y.setCoordinates(T);
671
+ const K = Yt(c);
672
+ K.setStyle(Oe), K.drawGeometry(y), e == null || e.render();
661
673
  }, Ct = () => {
662
674
  var c;
663
- S = !0, y = Date.now(), L = 0, h = ((c = m.getGeometry()) == null ? void 0 : c.clone()) || new ne([0, 0]), o && (w == null || w.on("postrender", o)), P == null || P.setGeometry(void 0);
675
+ C = !0, f = Date.now(), P = 0, y = ((c = m.getGeometry()) == null ? void 0 : c.clone()) || new re([0, 0]), o && (w == null || w.on("postrender", o)), S == null || S.setGeometry(void 0);
664
676
  }, Me = () => {
665
- S && (S = !1, P == null || P.setGeometry(void 0), o && w && w.un("postrender", o), w && (e == null || e.removeLayer(w)), w = null, P = null);
677
+ C && (C = !1, S == null || S.setGeometry(void 0), o && w && w.un("postrender", o), w && (e == null || e.removeLayer(w)), w = null, S = null);
666
678
  }, Lt = (c, d) => {
667
- S && Me(), t = new Ie({
679
+ C && Me(), t = new Ie({
668
680
  factor: 1e6
669
681
  }).writeGeometry(new Pe(c)), n = new Ie({
670
682
  factor: 1e6
@@ -673,30 +685,30 @@ const io = (e) => {
673
685
  featureProjection: J.mercator
674
686
  }), m = new se({
675
687
  type: "icon",
676
- geometry: new ne(n.getFirstCoordinate())
688
+ geometry: new re(n.getFirstCoordinate())
677
689
  });
678
690
  const g = m.getGeometry();
679
- h = g ? g.clone() : new ne([0, 0]), P = new se({
691
+ y = g ? g.clone() : new re([0, 0]), S = new se({
680
692
  type: "geoMarker",
681
693
  style: Oe,
682
- geometry: h
694
+ geometry: y
683
695
  }), w = new ve({
684
696
  source: new ae({
685
- features: [P]
697
+ features: [S]
686
698
  })
687
- }), e == null || e.addLayer(w), o = (M) => Mt(M, d), Ct();
699
+ }), e == null || e.addLayer(w), o = (p) => Mt(p, d), Ct();
688
700
  }, Ke = (c, d, g) => {
689
- function M(F) {
701
+ function p(F) {
690
702
  return 180 * (F % (2 * Math.PI)) / Math.PI;
691
703
  }
692
704
  function E(F) {
693
705
  return F % 360 * Math.PI / 180;
694
706
  }
695
707
  function T(F) {
696
- var Y;
708
+ var W;
697
709
  if (!F) throw new Error("Coordinate is required");
698
710
  if (!Array.isArray(F)) {
699
- if ((F == null ? void 0 : F.type) === "Feature" && (F == null ? void 0 : F.geometry) !== null && ((Y = F == null ? void 0 : F.geometry) == null ? void 0 : Y.type) === "Point")
711
+ if ((F == null ? void 0 : F.type) === "Feature" && (F == null ? void 0 : F.geometry) !== null && ((W = F == null ? void 0 : F.geometry) == null ? void 0 : W.type) === "Point")
700
712
  return F == null ? void 0 : F.geometry.coordinates;
701
713
  if (F.type === "Point") return (F == null ? void 0 : F.coordinates) || [];
702
714
  }
@@ -706,21 +718,21 @@ const io = (e) => {
706
718
  "Coordinate must be GeoJSON Point or an Array of numbers"
707
719
  );
708
720
  }
709
- function R(F, Y, j = {}) {
721
+ function R(F, W, j = {}) {
710
722
  if (j.final)
711
723
  return function(Ft, Pt) {
712
724
  return (R(Pt, Ft) + 180) % 360;
713
- }(F, Y);
714
- const _ = T(F), Ce = T(Y), Le = E(_[0]), Ee = E(Ce[0]), _e = E(_[1]), Re = E(Ce[1]), Et = Math.sin(Ee - Le) * Math.cos(Re), Tt = Math.cos(_e) * Math.sin(Re) - Math.sin(_e) * Math.cos(Re) * Math.cos(Ee - Le);
715
- return M(Math.atan2(Et, Tt));
725
+ }(F, W);
726
+ const _ = T(F), Ce = T(W), Le = E(_[0]), Ee = E(Ce[0]), _e = E(_[1]), Re = E(Ce[1]), Et = Math.sin(Ee - Le) * Math.cos(Re), Tt = Math.cos(_e) * Math.sin(Re) - Math.sin(_e) * Math.cos(Re) * Math.cos(Ee - Le);
727
+ return p(Math.atan2(Et, Tt));
716
728
  }
717
729
  function $(F) {
718
730
  return !isNaN(F) && F !== null && !Array.isArray(F);
719
731
  }
720
- function A(F, Y = {}, j = {}) {
721
- return F || console.log("Coordinates are required"), Array.isArray(F) || console.log("Coordinates must be an Array"), F.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!$(F[0]) || !$(F[1])) && console.log("Coordinates must contain numbers"), q({ type: "Point", coordinates: F }, Y, j);
732
+ function D(F, W = {}, j = {}) {
733
+ return F || console.log("Coordinates are required"), Array.isArray(F) || console.log("Coordinates must be an Array"), F.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!$(F[0]) || !$(F[1])) && console.log("Coordinates must contain numbers"), q({ type: "Point", coordinates: F }, W, j);
722
734
  }
723
- function q(F, Y = {}, j = {}) {
735
+ function q(F, W = {}, j = {}) {
724
736
  const _ = {
725
737
  type: "Feature",
726
738
  id: "",
@@ -728,13 +740,13 @@ const io = (e) => {
728
740
  bbox: {},
729
741
  geometry: {}
730
742
  };
731
- return j.id !== void 0 && (_.id = j.id), j.bbox && (_.bbox = j.bbox), _.properties = Y, _.geometry = F, _;
743
+ return j.id !== void 0 && (_.id = j.id), j.bbox && (_.bbox = j.bbox), _.properties = W, _.geometry = F, _;
732
744
  }
733
- const K = R(A(c), A(d), g);
745
+ const K = R(D(c), D(d), g);
734
746
  return K < 0 ? 360 + K : K;
735
747
  };
736
748
  return {
737
- render: v,
749
+ render: h,
738
750
  remove: wt,
739
751
  play: kt,
740
752
  setCenter: Je,
@@ -744,9 +756,9 @@ const io = (e) => {
744
756
  reRenderTrackLine: i
745
757
  };
746
758
  };
747
- function co(e) {
759
+ function ao(e) {
748
760
  console.log("useShipOverlay", e);
749
- const l = U(null), r = Te(() => ({
761
+ const r = U(null), l = Te(() => ({
750
762
  "--overlay-color": "#FFF",
751
763
  "--bg-color1": e.colors && e.colors[0] ? e.colors[0] : "#ffffff",
752
764
  // 默认第一个颜色
@@ -755,7 +767,7 @@ function co(e) {
755
767
  position: "relative",
756
768
  "pointer-events": "none"
757
769
  })), s = Te(() => {
758
- var f;
770
+ var v;
759
771
  return {
760
772
  position: "relative",
761
773
  "border-radius": "1px",
@@ -772,7 +784,7 @@ function co(e) {
772
784
  "z-index": "1",
773
785
  display: "flex",
774
786
  "align-items": "center",
775
- animation: e.selected ? e.colors && ((f = e.colors) == null ? void 0 : f.length) >= 2 ? "blink-dual 2s ease-in-out infinite" : "blink-single 1.5s ease-in-out infinite" : "none"
787
+ animation: e.selected ? e.colors && ((v = e.colors) == null ? void 0 : v.length) >= 2 ? "blink-dual 2s ease-in-out infinite" : "blink-single 1.5s ease-in-out infinite" : "none"
776
788
  // "animation": props.selected ? 'blink 1.5s ease-in-out infinite' : 'none', // 动画开关
777
789
  };
778
790
  }), a = Te(() => ({
@@ -792,22 +804,22 @@ function co(e) {
792
804
  overflow: "visible",
793
805
  left: "-20px"
794
806
  }));
795
- return () => re("div", {
796
- ref: l,
807
+ return () => oe("div", {
808
+ ref: r,
797
809
  class: "ship-overlay-container",
798
- style: r.value
810
+ style: l.value
799
811
  }, [
800
- re(
812
+ oe(
801
813
  "div",
802
814
  {
803
815
  class: "ship-overlay-content",
804
816
  style: s.value
805
817
  },
806
818
  [
807
- re("div", {
819
+ oe("div", {
808
820
  style: e.selected ? a.value : {}
809
821
  }, ""),
810
- re("div", {
822
+ oe("div", {
811
823
  class: "text",
812
824
  style: {
813
825
  fontSize: "12px",
@@ -815,25 +827,25 @@ function co(e) {
815
827
  fontFamily: "Arial"
816
828
  }
817
829
  }, e.name || "未命名船舶"),
818
- re("div", {
830
+ oe("div", {
819
831
  class: "icons",
820
832
  style: {
821
833
  color: "#3370ff"
822
834
  }
823
835
  }, [
824
- e.existDevice ? re("i", {
836
+ e.existDevice ? oe("i", {
825
837
  class: "map-iconfont icon-camera",
826
838
  style: {
827
839
  fontSize: "12px"
828
840
  }
829
841
  }) : "",
830
- e.existMobile ? re("i", {
842
+ e.existMobile ? oe("i", {
831
843
  class: "map-iconfont icon-tele",
832
844
  style: {
833
845
  fontSize: "12px"
834
846
  }
835
847
  }) : "",
836
- e.existWaterGauge ? re("i", {
848
+ e.existWaterGauge ? oe("i", {
837
849
  class: "map-iconfont icon-ruler",
838
850
  style: {
839
851
  fontSize: "12px"
@@ -842,13 +854,13 @@ function co(e) {
842
854
  ])
843
855
  ]
844
856
  ),
845
- re("svg", {
857
+ oe("svg", {
846
858
  class: "ship-overlay-line",
847
859
  style: o.value,
848
860
  viewBox: "0 0 20 20",
849
861
  xmlns: "http://www.w3.org/2000/svg"
850
862
  }, [
851
- re("line", {
863
+ oe("line", {
852
864
  x1: "0",
853
865
  y1: "20",
854
866
  x2: "20",
@@ -860,41 +872,41 @@ function co(e) {
860
872
  ]);
861
873
  }
862
874
  U([]);
863
- function ao(e, l, r, s) {
864
- if (l) {
875
+ function uo(e, r, l, s) {
876
+ if (r) {
865
877
  const a = new ie({
866
- element: r,
878
+ element: l,
867
879
  positioning: "top-left",
868
880
  id: "label-" + (s == null ? void 0 : s.id),
869
881
  offset: [20, -20],
870
882
  autoPan: !1,
871
- position: l,
883
+ position: r,
872
884
  className: s.blinking ? "ship-label-overlay-blinking" : "ship-label-overlay"
873
885
  });
874
886
  a.set("class", "zh-map-ship-overlay"), e.addOverlay(a);
875
887
  }
876
888
  }
877
- const uo = (e) => {
878
- const { spd: l, hdg: r, cog: s } = e;
879
- return l ? r !== null && +r != 511 && s !== null ? s - +r >= 3 ? te.right : s - +r <= -3 ? te.left : te.front : te.front : "";
880
- }, ye = (e, l) => {
881
- const { shipData: r } = l.getProperties(), s = at(e), a = je(e, r, s);
882
- return go(l, a, s);
889
+ const go = (e) => {
890
+ const { spd: r, hdg: l, cog: s } = e;
891
+ return r ? l !== null && +l != 511 && s !== null ? s - +l >= 3 ? ee.right : s - +l <= -3 ? ee.left : ee.front : ee.front : "";
892
+ }, ye = (e, r) => {
893
+ const { shipData: l } = r.getProperties(), s = at(e), a = je(e, l, s);
894
+ return fo(r, a, s);
883
895
  }, at = (e) => {
884
- const l = e == null ? void 0 : e.getView().getZoom();
885
- return l <= ee.shipModelMax && l >= ee.shipTriggleMin ? "ship" : "triangle";
886
- }, je = (e, l, r) => {
887
- if (r === "ship") {
888
- const { len: s, wid: a } = l, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), n = s * t / o, m = a * t / f, h = Math.min(n, m);
889
- return h < 0.2 ? 0.2 : h > 2 ? 2 : h;
896
+ const r = e == null ? void 0 : e.getView().getZoom();
897
+ return r <= ne.shipModelMax && r >= ne.shipTriggleMin ? "ship" : "triangle";
898
+ }, je = (e, r, l) => {
899
+ if (l === "ship") {
900
+ const { len: s, wid: a } = r, o = 97, v = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), n = s * t / o, m = a * t / v, y = Math.min(n, m);
901
+ return y < 0.2 ? 0.2 : y > 2 ? 2 : y;
890
902
  }
891
- return ee.scaleNum;
892
- }, go = (e, l, r) => {
893
- const { color: s, direct: a, isHighlight: o, shipData: f } = e.getProperties(), x = ((f == null ? void 0 : f.cog) - 90 + 360) % 360;
903
+ return ne.scaleNum;
904
+ }, fo = (e, r, l) => {
905
+ const { color: s, direct: a, isHighlight: o, shipData: v } = e.getProperties(), x = ((v == null ? void 0 : v.cog) - 90 + 360) % 360;
894
906
  return new H({
895
907
  image: new be({
896
908
  src: t(),
897
- scale: l || ee.scaleNum,
909
+ scale: r || ne.scaleNum,
898
910
  anchor: [0.5, 0.5],
899
911
  rotation: x * Math.PI / 180,
900
912
  rotateWithView: !1
@@ -904,62 +916,62 @@ const uo = (e) => {
904
916
  return `data:image/svg+xml;utf8,${encodeURIComponent(n())}`;
905
917
  }
906
918
  function n() {
907
- switch (r) {
919
+ switch (l) {
908
920
  case "triangle":
909
921
  return `<svg width="41" height="24" viewBox="0 0 41 24" fill="none" xmlns="http://www.w3.org/2000/svg">
910
922
  <path d="M30.8843 12.6777L2.21343 21.7067C1.75559 21.8509 1.28947 21.509 1.28947 21.029L1.28947 2.97103C1.28947 2.49102 1.75558 2.14913 2.21342 2.29331L30.8843 11.3223C31.5471 11.531 31.5471 12.469 30.8843 12.6777Z"
911
923
  fill="${s}" stroke="${o ? "#FF2424" : "black"}" stroke-width="${o ? "2" : "0.578947"}" />
912
924
  <!--path船航向左边或者向前-->
913
- ${a === te.left && `<path d="M30 12L40 12L40 8" stroke="${o ? "#FF2424" : "black"}" stroke-width="2"/>`}
925
+ ${a === ee.left && `<path d="M30 12L40 12L40 8" stroke="${o ? "#FF2424" : "black"}" stroke-width="2"/>`}
914
926
  <!--path船航向右边-->
915
- ${a === te.right && `<path d="M30 12L40 12L40 16" stroke="${o ? "#FF2424" : "black"}" stroke-width="2"/>`}
927
+ ${a === ee.right && `<path d="M30 12L40 12L40 16" stroke="${o ? "#FF2424" : "black"}" stroke-width="2"/>`}
916
928
  <!--path黑线无左右-->
917
- ${a === te.front && `<path d="M30 12L40 12" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
929
+ ${a === ee.front && `<path d="M30 12L40 12" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
918
930
  </svg>
919
931
  `;
920
932
  case "ship":
921
933
  return `<svg width="97" height="20" viewBox="0 0 97 20" fill="none" xmlns="http://www.w3.org/2000/svg">
922
934
  <path d="M0.289474 17.3433L0.289474 2.65655C0.289474 2.28572 0.574654 1.97725 0.944343 1.9482L22.0544 0.289473L67.5204 0.289473C67.6295 0.289473 67.7372 0.314613 67.835 0.362943L86.0565 9.3629C86.5844 9.6236 86.5844 10.3763 86.0565 10.637L67.835 19.6371C67.7372 19.6854 67.6295 19.7105 67.5203 19.7105L22.0544 19.7105L0.944343 18.0517C0.574653 18.0226 0.289474 17.7142 0.289474 17.3433Z"
923
935
  fill="${s}" stroke="${o ? "#FF2424" : "black"}" stroke-width="${o ? "4" : "0.578947"}"/>
924
- ${a === te.left && `<path d="M86 10L96 10L96 6" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
925
- ${a === te.right && `<path d="M86 10L96 10L96 14" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
926
- ${a === te.front && `<path d="M86 10L96 10" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
936
+ ${a === ee.left && `<path d="M86 10L96 10L96 6" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
937
+ ${a === ee.right && `<path d="M86 10L96 10L96 14" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
938
+ ${a === ee.front && `<path d="M86 10L96 10" stroke="${o ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
927
939
  </svg>
928
940
  `;
929
941
  default:
930
942
  return "";
931
943
  }
932
944
  }
933
- }, fo = (e, l) => {
934
- const r = dt(e, l), s = l.id, { lon: a, lat: o } = l, f = new ie({
935
- element: r,
945
+ }, vo = (e, r) => {
946
+ const l = dt(e, r), s = r.id, { lon: a, lat: o } = r, v = new ie({
947
+ element: l,
936
948
  position: I([a, o]),
937
949
  id: "selected-" + s,
938
950
  positioning: "center-center",
939
951
  offset: [0, 5],
940
952
  className: "ship-selected-overlay"
941
953
  });
942
- return f.set("class", "ship-overlay-selected"), f;
943
- }, dt = (e, l) => {
944
- const r = at(e), s = je(e, l, r), a = r === "ship" ? 109 : 49, o = `
954
+ return v.set("class", "ship-overlay-selected"), v;
955
+ }, dt = (e, r) => {
956
+ const l = at(e), s = je(e, r, l), a = l === "ship" ? 109 : 49, o = `
945
957
  <svg style="transform:scale(${s});" xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 49 49" fill="none">
946
958
  <path d="M1.99982 46.9998L1.99982 1.99982L46.9998 1.99982L46.9998 46.9998L1.99982 46.9998Z" fill="#FF2424" fill-opacity="0.2"/>
947
959
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.9998 0.5V3.5L3.49976 3.5V20H0.499756V0.500002L19.9998 0.5ZM45.4998 3.5H28.9998V0.5H48.4998V20H45.4998V3.5ZM48.4998 29L48.4998 48.5H28.9998V45.5H45.4998L45.4998 29H48.4998ZM3.49976 45.5L3.49976 29H0.499756L0.499758 48.5L19.9998 48.5V45.5L3.49976 45.5Z" fill="#FF2424"/>
948
960
  </svg>
949
- `, f = document.createElement("div");
950
- return f.className = "ship-overlay-selected", f.innerHTML = o, f;
951
- }, vo = (e, l) => {
952
- const { lon: r, lat: s, blinking: a } = l, o = ut(l);
953
- r && s && ao(e, I([r, s]), o, { ...l, blinking: a });
961
+ `, v = document.createElement("div");
962
+ return v.className = "ship-overlay-selected", v.innerHTML = o, v;
963
+ }, yo = (e, r) => {
964
+ const { lon: l, lat: s, blinking: a } = r, o = ut(r);
965
+ l && s && uo(e, I([l, s]), o, { ...r, blinking: a });
954
966
  }, ut = (e) => {
955
- const l = document.createElement("div");
956
- l.className = "ship-overlay-box", l.style.position = "relative";
957
- const { lon: r, lat: s, blinking: a, blinkingColors: o, name: f } = e, x = De({
967
+ const r = document.createElement("div");
968
+ r.className = "ship-overlay-box", r.style.position = "relative";
969
+ const { lon: l, lat: s, blinking: a, blinkingColors: o, name: v } = e, x = Ae({
958
970
  setup() {
959
- return co({
960
- position: [r + 2e-3, s + 2e-3],
971
+ return ao({
972
+ position: [l + 2e-3, s + 2e-3],
961
973
  selected: a,
962
- name: f,
974
+ name: v,
963
975
  colors: o || [],
964
976
  existDevice: e == null ? void 0 : e.existDevice,
965
977
  existMobile: e == null ? void 0 : e.existMobile,
@@ -967,12 +979,12 @@ const uo = (e) => {
967
979
  });
968
980
  }
969
981
  });
970
- return Nt(x, l), l;
982
+ return St(x, r), r;
971
983
  }, rt = (e) => {
972
- const l = [];
973
- return e.existDevice && l.push("&#xe687;"), e.existMobile && l.push("&#xe688;"), e.existWaterGauge && l.push("&#xe686;"), l;
984
+ const r = [];
985
+ return e.existDevice && r.push("&#xe687;"), e.existMobile && r.push("&#xe688;"), e.existWaterGauge && r.push("&#xe686;"), r;
974
986
  };
975
- function yo() {
987
+ function ho() {
976
988
  const e = [
977
989
  "left-top",
978
990
  "left-middle",
@@ -983,47 +995,47 @@ function yo() {
983
995
  ];
984
996
  return e[Math.floor(Math.random() * e.length)];
985
997
  }
986
- const ho = window.devicePixelRatio || 1;
987
- function mo(e, l, r = "left-bottom", s = 2) {
998
+ const mo = window.devicePixelRatio || 1;
999
+ function wo(e, r, l = "left-bottom", s = 2) {
988
1000
  const a = document.createElement("canvas"), o = a.getContext("2d");
989
1001
  if (!o) return "";
990
- const f = 2, x = 8, t = 16, n = window.devicePixelRatio || 1, m = "500 12px Arial", h = "14px map-iconfont";
1002
+ const v = 2, x = 8, t = 16, n = window.devicePixelRatio || 1, m = "500 12px Arial", y = "14px map-iconfont";
991
1003
  o.font = m;
992
- const S = o.measureText(e).width;
993
- o.font = h;
994
- const y = l.map((k) => ({ width: o.measureText(ge(k)).width, height: 14 })), w = y.reduce((k, N) => k + N.width, 0), L = (l.length - 1) * s, p = x + S + w + L + x, b = f + 14 + f * 2;
995
- let G, W, B = 0, X = 0, O = 0, D = 0, i = 0, u = 0;
996
- switch (G = t + p, r) {
1004
+ const C = o.measureText(e).width;
1005
+ o.font = y;
1006
+ const f = r.map((k) => ({ width: o.measureText(ge(k)).width, height: 14 })), w = f.reduce((k, N) => k + N.width, 0), P = (r.length - 1) * s, M = x + C + w + P + x, b = v + 14 + v * 2;
1007
+ let G, Y, B = 0, X = 0, O = 0, Z = 0, i = 0, u = 0;
1008
+ switch (G = t + M, l) {
997
1009
  case "right-top":
998
- W = t + b, B = 0, X = t + b, O = t, D = 0, i = t, u = 0;
1010
+ Y = t + b, B = 0, X = t + b, O = t, Z = 0, i = t, u = 0;
999
1011
  break;
1000
1012
  case "right-middle":
1001
- W = b, B = 0, X = b / 2, O = t, D = b / 2, i = t, u = 0;
1013
+ Y = b, B = 0, X = b / 2, O = t, Z = b / 2, i = t, u = 0;
1002
1014
  break;
1003
1015
  case "right-bottom":
1004
- W = t + b, B = 0, X = 0, O = t, D = t, i = t, u = t;
1016
+ Y = t + b, B = 0, X = 0, O = t, Z = t, i = t, u = t;
1005
1017
  break;
1006
1018
  case "left-top":
1007
- W = t + b, B = p, X = t, O = p + t, D = b + t, i = 0, u = 0;
1019
+ Y = t + b, B = M, X = t, O = M + t, Z = b + t, i = 0, u = 0;
1008
1020
  break;
1009
1021
  case "left-middle":
1010
- W = b, B = p, X = b / 2, O = p + t, D = b / 2, i = 0, u = 0;
1022
+ Y = b, B = M, X = b / 2, O = M + t, Z = b / 2, i = 0, u = 0;
1011
1023
  break;
1012
1024
  case "left-bottom":
1013
- W = t + b, B = p, X = b, O = p + t, D = 0, i = 0, u = t;
1025
+ Y = t + b, B = M, X = b, O = M + t, Z = 0, i = 0, u = t;
1014
1026
  break;
1015
1027
  }
1016
- a.width = Math.round(G * n), a.height = Math.round(W * n), o.scale(n, n), o.clearRect(0, 0, G, W), o.beginPath(), o.moveTo(B, X), o.lineTo(O, D), o.strokeStyle = "#FFF", o.lineWidth = 1, o.stroke(), o.fillStyle = "#FFF", o.fillRect(i, u, p, b), o.font = m, o.textBaseline = "middle";
1017
- const v = u + f + b / 2;
1018
- o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, i + x, v), o.fillStyle = "#000000", o.fillText(e, i + x, v), o.font = h, o.fillStyle = "#3370ff";
1019
- let C = i + x + S + s;
1020
- return l.length > 0 && l.forEach((k, N) => {
1021
- const z = u + f + b / 2;
1022
- o.fillText(ge(k), C, z), C += y[N].width + s;
1028
+ a.width = Math.round(G * n), a.height = Math.round(Y * n), o.scale(n, n), o.clearRect(0, 0, G, Y), o.beginPath(), o.moveTo(B, X), o.lineTo(O, Z), o.strokeStyle = "#FFF", o.lineWidth = 1, o.stroke(), o.fillStyle = "#FFF", o.fillRect(i, u, M, b), o.font = m, o.textBaseline = "middle";
1029
+ const h = u + v + b / 2;
1030
+ o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, i + x, h), o.fillStyle = "#000000", o.fillText(e, i + x, h), o.font = y, o.fillStyle = "#3370ff";
1031
+ let L = i + x + C + s;
1032
+ return r.length > 0 && r.forEach((k, N) => {
1033
+ const z = u + v + b / 2;
1034
+ o.fillText(ge(k), L, z), L += f[N].width + s;
1023
1035
  }), a.toDataURL("image/png");
1024
1036
  }
1025
- const nt = (e, l) => {
1026
- const { name: r, rightIcons: s, selected: a } = e.getProperties(), o = l !== 1 ? yo() : "right-top", f = mo(r, s, o);
1037
+ const nt = (e, r) => {
1038
+ const { name: l, rightIcons: s, selected: a } = e.getProperties(), o = r !== 1 ? ho() : "right-top", v = wo(l, s, o);
1027
1039
  let x = [0, 0];
1028
1040
  switch (o) {
1029
1041
  case "right-top":
@@ -1047,23 +1059,24 @@ const nt = (e, l) => {
1047
1059
  }
1048
1060
  return new H({
1049
1061
  image: new be({
1050
- src: f,
1062
+ src: v,
1051
1063
  anchor: x,
1052
1064
  displacement: [0, 0],
1053
- scale: 1 / ho,
1065
+ scale: 1 / mo,
1054
1066
  anchorXUnits: "fraction",
1055
1067
  anchorYUnits: "fraction"
1056
1068
  }),
1057
1069
  zIndex: a ? 100 : 10
1058
1070
  });
1059
- }, wo = (e) => {
1060
- let l = null, r = null;
1061
- const s = new ae(), a = new Yt({
1071
+ }, xo = (e) => {
1072
+ let r = null, l = null;
1073
+ const s = new ae(), a = new Bt({
1062
1074
  source: s,
1063
1075
  className: "zh-map--ship-layer",
1064
1076
  renderBuffer: 300,
1065
- zIndex: 101
1066
- }), o = new ae(), f = new ve({
1077
+ zIndex: 101,
1078
+ hitTolerance: 10
1079
+ }), o = new ae(), v = new ve({
1067
1080
  source: o,
1068
1081
  className: "zh-map--ship-label-layer",
1069
1082
  zIndex: 102,
@@ -1071,20 +1084,20 @@ const nt = (e, l) => {
1071
1084
  updateWhileAnimating: !1,
1072
1085
  declutter: !0
1073
1086
  });
1074
- e == null || e.addLayer(a), e == null || e.addLayer(f);
1087
+ e == null || e.addLayer(a), e == null || e.addLayer(v);
1075
1088
  let x = null, t = "", n = {}, m = {};
1076
- const h = (i) => {
1089
+ const y = (i) => {
1077
1090
  if (!i || !e) return;
1078
- const u = (r == null ? void 0 : r.id) || (l == null ? void 0 : l.get("id"));
1079
- if (r) {
1080
- const v = i.filter((C) => C.id === u);
1081
- v.length === 0 ? i.push(r) : r = v[0];
1091
+ const u = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id"));
1092
+ if (l) {
1093
+ const h = i.filter((L) => L.id === u);
1094
+ h.length === 0 ? i.push(l) : l = h[0];
1082
1095
  }
1083
- w(), L(!0), D(i), S();
1084
- }, P = (i) => {
1096
+ w(), P(!0), Z(i), C();
1097
+ }, S = (i) => {
1085
1098
  var V;
1086
- const u = (r == null ? void 0 : r.id) || (l == null ? void 0 : l.get("id")), v = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), C = ((V = m[i.id]) == null ? void 0 : V.blinkColors) || [], N = C[C.length - 1] || i.fill || "#04C900", z = uo(i), Z = new se({
1087
- geometry: new ne(v),
1099
+ const u = (l == null ? void 0 : l.id) || (r == null ? void 0 : r.get("id")), h = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), L = ((V = m[i.id]) == null ? void 0 : V.blinkColors) || [], N = L[L.length - 1] || i.fill || "#04C900", z = go(i), A = new se({
1100
+ geometry: new re(h),
1088
1101
  // 船舶数据
1089
1102
  shipData: i,
1090
1103
  id: i.id,
@@ -1103,70 +1116,69 @@ const nt = (e, l) => {
1103
1116
  // 高亮
1104
1117
  isHighlight: !1
1105
1118
  });
1106
- return Z.set("clickGeometry", new Bt(v)), Z;
1107
- }, S = async () => {
1108
- if (!r || !e) return;
1109
- let u = e.getOverlays().getArray().find((v) => v.get("class") == "ship-overlay-selected");
1119
+ return A.set("clickGeometry", new qt(h)), A;
1120
+ }, C = async () => {
1121
+ if (!l || !e) return;
1122
+ let u = e.getOverlays().getArray().find((h) => h.get("class") == "ship-overlay-selected");
1110
1123
  if (u) {
1111
- const v = dt(e, r);
1112
- await u.setElement(v), await u.setPosition(I([r.lon, r.lat]));
1124
+ const h = dt(e, l);
1125
+ await u.setElement(h), await u.setPosition(I([l.lon, l.lat]));
1113
1126
  } else
1114
- u = fo(e, r), u && e.addOverlay(u);
1127
+ u = vo(e, l), u && e.addOverlay(u);
1115
1128
  setTimeout(() => {
1116
- var v;
1117
- u && ((v = u.get("element")) != null && v.parentElement) && (u.get("element").parentElement.style.display = "block");
1129
+ var h;
1130
+ u && ((h = u.get("element")) != null && h.parentElement) && (u.get("element").parentElement.style.display = "block");
1118
1131
  }, 20);
1119
- }, y = (i) => {
1132
+ }, f = (i) => {
1120
1133
  if (i === "start") {
1121
1134
  const u = () => {
1122
1135
  s.getFeatures().forEach((k) => {
1123
1136
  k.setStyle(ye(e, k));
1124
1137
  });
1125
- const C = (e == null ? void 0 : e.getOverlays().getArray()).find((k) => k.get("class") == "ship-overlay-selected");
1126
- if (C) {
1127
- const k = C.getElement(), N = je(e, r, "ship");
1138
+ const L = (e == null ? void 0 : e.getOverlays().getArray()).find((k) => k.get("class") == "ship-overlay-selected");
1139
+ if (L) {
1140
+ const k = L.getElement(), N = je(e, l, "ship");
1128
1141
  console.log("scaleFactor", N), k.style.transform = `scale(${N})`;
1129
1142
  }
1130
1143
  x = requestAnimationFrame(u);
1131
1144
  };
1132
1145
  u();
1133
- } else
1134
- x && (cancelAnimationFrame(x), x = null);
1146
+ } else i === "end" && x && (cancelAnimationFrame(x), x = null);
1135
1147
  }, w = () => {
1136
- e && s && (s.clear(), o.clear(), L());
1137
- }, L = (i) => {
1138
- const u = e.getOverlays().getArray().filter((v) => v.get("class") == "zh-map-ship-overlay");
1148
+ e && s && (s.clear(), o.clear(), P(), f("end"));
1149
+ }, P = (i) => {
1150
+ const u = e.getOverlays().getArray().filter((h) => h.get("class") == "zh-map-ship-overlay");
1139
1151
  if (u && u.length > 0) {
1140
- for (let v = 0; v < u.length; v++)
1141
- if (!i && u[v].get("class") !== "ship-overlay-selected") {
1142
- const C = u[v];
1143
- C.setPosition(void 0), e.removeOverlay(C), C.dispose();
1152
+ for (let h = 0; h < u.length; h++)
1153
+ if (!i && u[h].get("class") !== "ship-overlay-selected") {
1154
+ const L = u[h];
1155
+ L.setPosition(void 0), e.removeOverlay(L), L.dispose();
1144
1156
  }
1145
1157
  }
1146
- }, p = (i, u) => {
1147
- n = i, m = u, console.log("attentionShips", n, "attentionShipsColor", u);
1148
- const v = e.getOverlays().getArray(), C = s.getFeatures();
1158
+ }, M = (i, u) => {
1159
+ n = i, m = u;
1160
+ const h = e.getOverlays().getArray(), L = s.getFeatures();
1149
1161
  for (const k in n) {
1150
- const N = n[k], z = v.find((V) => V.getId() === "label-" + k), Z = C.find((V) => k === V.get("id"));
1151
- if (z && Z) {
1152
- const V = u[k].blinkColors || [], { shipData: ce, name: oe, color: le } = Z == null ? void 0 : Z.getProperties();
1153
- Z.set("blinking", N), V[(V == null ? void 0 : V.length) - 1] && le !== V[(V == null ? void 0 : V.length) - 1] && (Z.set("color", V[(V == null ? void 0 : V.length) - 1] || ""), Z.setStyle(ye(e, Z)));
1162
+ const N = n[k], z = h.find((V) => V.getId() === "label-" + k), A = L.find((V) => k === V.get("id"));
1163
+ if (z && A) {
1164
+ const V = u[k].blinkColors || [], { shipData: ce, name: te, color: le } = A.getProperties();
1165
+ A.set("blinking", N), V[(V == null ? void 0 : V.length) - 1] && le !== V[(V == null ? void 0 : V.length) - 1] && (A.set("color", V[(V == null ? void 0 : V.length) - 1] || ""), A.setStyle(ye(e, A)));
1154
1166
  const ze = {
1155
1167
  ...ce,
1156
1168
  blinking: N,
1157
1169
  blinkingColors: V || [],
1158
- name: oe + "(" + u[k].shipState + ")"
1170
+ name: te + "(" + u[k].shipState + ")"
1159
1171
  }, ke = z.getElement(), pe = ut(ze);
1160
1172
  ke && ke !== pe && z.setElement(pe);
1161
1173
  }
1162
1174
  }
1163
1175
  }, b = (i) => {
1164
1176
  if (!e) return;
1165
- const u = s.getFeatures(), v = o.getFeatures(), C = l ? l.get("id") : "", k = u.filter((V) => V.get("id") !== C), N = v == null ? void 0 : v.filter((V) => V.get("id") !== C), z = /* @__PURE__ */ new Map();
1177
+ const u = s.getFeatures(), h = o.getFeatures(), L = r ? r.get("id") : "", k = u.filter((V) => V.get("id") !== L), N = h == null ? void 0 : h.filter((V) => V.get("id") !== L), z = /* @__PURE__ */ new Map();
1166
1178
  i.forEach((V) => {
1167
1179
  z.set(V.id, !0);
1168
1180
  });
1169
- const Z = e.getOverlays().getArray();
1181
+ const A = e.getOverlays().getArray();
1170
1182
  k.forEach((V) => {
1171
1183
  const ce = V.get("id");
1172
1184
  if (!z.has(ce))
@@ -1175,116 +1187,116 @@ const nt = (e, l) => {
1175
1187
  const le = V.getStyle();
1176
1188
  (le == null ? void 0 : le.length) == 0 && V.setStyle(ye(e, V));
1177
1189
  }
1178
- const oe = Z.find((le) => le.getId() === "label-" + ce);
1179
- oe && oe.setPosition(void 0);
1190
+ const te = A.find((le) => le.getId() === "label-" + ce);
1191
+ te && te.setPosition(void 0);
1180
1192
  }), console.log(N), N.forEach((V) => {
1181
1193
  const ce = V.get("id");
1182
1194
  if (!z.has(ce))
1183
1195
  V.setStyle([]);
1184
1196
  else {
1185
- const oe = V.getStyle();
1186
- (oe == null ? void 0 : oe.length) == 0 && V.setStyle(nt(V));
1197
+ const te = V.getStyle();
1198
+ (te == null ? void 0 : te.length) == 0 && V.setStyle(nt(V));
1187
1199
  }
1188
1200
  });
1189
1201
  }, G = (i) => {
1190
1202
  if (i) {
1191
1203
  console.log("选中", i);
1192
- const u = s.getFeatures().find((C) => C.get("id") === i.id), v = o.getFeatures().find((C) => C.get("id") === i.id);
1193
- u && (l = u), v && v.set("selected", !0), r = i, S();
1204
+ const u = s.getFeatures().find((L) => L.get("id") === i.id), h = o.getFeatures().find((L) => L.get("id") === i.id);
1205
+ u && (r = u), h && h.set("selected", !0), l = i, C();
1194
1206
  } else
1195
- console.log("取消选中"), r = null, l = null, X();
1196
- }, W = qe((i, u, v) => {
1207
+ console.log("取消选中"), l = null, r = null, X();
1208
+ }, Y = qe((i, u, h) => {
1197
1209
  try {
1198
1210
  if (i) {
1199
- const C = i.get("shipData"), k = i.get("id");
1200
- if (e.getTargetElement().style.cursor = k ? "pointer" : "", u === "click" && (G(C), v && v(k)), u === "hover") {
1211
+ const L = i.get("shipData"), k = i.get("id");
1212
+ if (e.getTargetElement().style.cursor = k ? "pointer" : "", u === "click" && (G(L), h && h(k)), u === "hover") {
1201
1213
  t && t !== k && B(), t = k;
1202
1214
  const N = s.getFeatures().find((z) => z.get("id") === t);
1203
1215
  N == null || N.set("isHighlight", !0), N == null || N.setStyle(ye(e, N));
1204
1216
  }
1205
1217
  } else
1206
1218
  e.getTargetElement().style.cursor = "", B();
1207
- } catch (C) {
1208
- console.log("handleShipMapEvent", C);
1219
+ } catch (L) {
1220
+ console.log("handleShipMapEvent", L);
1209
1221
  }
1210
1222
  }, 10), B = () => {
1211
1223
  const i = t ? s.getFeatures().find((u) => u.get("id") === t) : null;
1212
1224
  t = null, i == null || i.set("isHighlight", !1), i == null || i.setStyle(ye(e, i));
1213
1225
  }, X = () => {
1214
1226
  try {
1215
- const u = e.getOverlays().getArray().find((v) => v.get("class") == "ship-overlay-selected");
1227
+ const u = e.getOverlays().getArray().find((h) => h.get("class") == "ship-overlay-selected");
1216
1228
  u && u.setPosition(void 0);
1217
1229
  } catch (i) {
1218
1230
  console.log(i);
1219
1231
  }
1220
1232
  }, O = (i, u) => {
1221
- const v = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), C = new se({
1222
- geometry: new ne(v),
1233
+ const h = I([i == null ? void 0 : i.lon, i == null ? void 0 : i.lat]), L = new se({
1234
+ geometry: new re(h),
1223
1235
  name: i.cnname || i.enname || i.name || i.id || "未命名船舶",
1224
1236
  // 图标
1225
1237
  rightIcons: rt(i),
1226
- selected: (i == null ? void 0 : i.id) === (r == null ? void 0 : r.id),
1238
+ selected: (i == null ? void 0 : i.id) === (l == null ? void 0 : l.id),
1227
1239
  shipData: i
1228
1240
  });
1229
- C.set("id", i.id);
1230
- const k = nt(C, u);
1231
- return C.setStyle(k), C;
1232
- }, D = (i) => {
1241
+ L.set("id", i.id);
1242
+ const k = nt(L, u);
1243
+ return L.setStyle(k), L;
1244
+ }, Z = (i) => {
1233
1245
  const u = e.getView().getZoom();
1234
- i.forEach((v) => {
1235
- const C = P(v);
1236
- if (C.setStyle(ye(e, C)), s.addFeature(C), (r == null ? void 0 : r.id) == v.id || u >= ee.shipModelMin)
1237
- if (n[v.id]) {
1238
- if (v.id && m[v == null ? void 0 : v.id]) {
1239
- const k = m[v == null ? void 0 : v.id] || {}, N = (k == null ? void 0 : k.blinkColors) || [], z = (k == null ? void 0 : k.shipState) || "", Z = (v.cnname || v.enname || v.name || v.id || "未命名船舶") + "(" + z + ")", V = {
1240
- ...v,
1241
- name: Z,
1242
- blinking: n[v.id],
1246
+ i.forEach((h) => {
1247
+ const L = S(h);
1248
+ if (L.setStyle(ye(e, L)), s.addFeature(L), (l == null ? void 0 : l.id) == h.id || u >= ne.shipModelMin)
1249
+ if (n[h.id]) {
1250
+ if (h.id && m[h == null ? void 0 : h.id]) {
1251
+ const k = m[h == null ? void 0 : h.id] || {}, N = (k == null ? void 0 : k.blinkColors) || [], z = (k == null ? void 0 : k.shipState) || "", A = (h.cnname || h.enname || h.name || h.id || "未命名船舶") + "(" + z + ")", V = {
1252
+ ...h,
1253
+ name: A,
1254
+ blinking: n[h.id],
1243
1255
  blinkingColors: N || []
1244
1256
  };
1245
- vo(e, V);
1257
+ yo(e, V);
1246
1258
  }
1247
1259
  } else {
1248
- const k = O(v, i.length);
1260
+ const k = O(h, i.length);
1249
1261
  o.addFeature(k);
1250
1262
  }
1251
1263
  });
1252
1264
  };
1253
1265
  return {
1254
- render: h,
1266
+ render: y,
1255
1267
  selected: G,
1256
1268
  filter: b,
1257
- blinking: p,
1269
+ blinking: M,
1258
1270
  clear: w,
1259
- handleShipMapEvent: W,
1260
- changeShipScale: y
1271
+ handleShipMapEvent: Y,
1272
+ changeShipScale: f
1261
1273
  };
1262
- }, xo = (e) => {
1263
- const l = () => e == null ? void 0 : e.getLayers(), r = U("vector"), s = () => r.value, a = (t) => {
1264
- r.value = t;
1265
- const n = l();
1274
+ }, bo = (e) => {
1275
+ const r = () => e == null ? void 0 : e.getLayers(), l = U("vector"), s = () => l.value, a = (t) => {
1276
+ l.value = t;
1277
+ const n = r();
1266
1278
  n && (n == null || n.getArray().forEach((m) => {
1267
1279
  (m.className_ === "vector" || m.className_ === "satellite") && m.setVisible(m.className_ === t);
1268
1280
  }));
1269
1281
  }, o = U(!1);
1270
1282
  return {
1271
- getLayers: l,
1283
+ getLayers: r,
1272
1284
  getGreenTileVisible: () => o.value,
1273
1285
  setGreenTileVisible: (t) => {
1274
1286
  if (t !== o.value) {
1275
1287
  if (t) {
1276
- const n = l();
1277
- if (!n.getArray().find((h) => h.className_ === "greenTile")) {
1278
- const h = new he({
1288
+ const n = r();
1289
+ if (!n.getArray().find((y) => y.className_ === "greenTile")) {
1290
+ const y = new he({
1279
1291
  source: new me({ url: de.greenTile }),
1280
1292
  visible: t,
1281
1293
  zIndex: 2,
1282
1294
  className: "greenTile"
1283
1295
  });
1284
- n.push(h);
1296
+ n.push(y);
1285
1297
  }
1286
1298
  } else {
1287
- const n = l(), m = n.getArray().find((h) => h.className_ === "greenTile");
1299
+ const n = r(), m = n.getArray().find((y) => y.className_ === "greenTile");
1288
1300
  m && n.remove(m);
1289
1301
  }
1290
1302
  o.value = t;
@@ -1293,7 +1305,7 @@ const nt = (e, l) => {
1293
1305
  getShowLayerType: s,
1294
1306
  setShowLayerType: a
1295
1307
  };
1296
- }, bo = () => {
1308
+ }, ko = () => {
1297
1309
  const e = U();
1298
1310
  return {
1299
1311
  setProps: (s) => {
@@ -1301,37 +1313,37 @@ const nt = (e, l) => {
1301
1313
  },
1302
1314
  getProps: () => e.value
1303
1315
  };
1304
- }, ko = (e) => {
1305
- const l = "zh-map-location-layer";
1306
- let r, s, a = null, o = null;
1307
- const f = (y) => {
1308
- if (!(!y || y.length === 0)) {
1316
+ }, po = (e) => {
1317
+ const r = "zh-map-location-layer";
1318
+ let l, s, a = null, o = null;
1319
+ const v = (f) => {
1320
+ if (!(!f || f.length === 0)) {
1309
1321
  if (s || (s = new ae()), s.clear(), o) {
1310
- const w = y.find((L) => L.id === o.id);
1311
- w ? o = w : y.push(o);
1322
+ const w = f.find((P) => P.id === o.id);
1323
+ w ? o = w : f.push(o);
1312
1324
  }
1313
- y.forEach((w) => {
1325
+ f.forEach((w) => {
1314
1326
  x(w);
1315
- }), r || (r = new ve({
1316
- className: l,
1327
+ }), l || (l = new ve({
1328
+ className: r,
1317
1329
  source: s,
1318
1330
  zIndex: 100
1319
- }), e == null || e.addLayer(r));
1331
+ }), e == null || e.addLayer(l));
1320
1332
  }
1321
- }, x = (y) => {
1322
- const w = e == null ? void 0 : e.getView().getZoom(), [L, p] = y.latLon.split(","), b = new se({
1323
- geometry: new ne(I([Number(L), Number(p)]))
1333
+ }, x = (f) => {
1334
+ const w = e == null ? void 0 : e.getView().getZoom(), [P, M] = f.latLon.split(","), b = new se({
1335
+ geometry: new re(I([Number(P), Number(M)]))
1324
1336
  });
1325
- b.setStyle(t(y, w, y.id === (o == null ? void 0 : o.id))), b.set("loactionData", y), s.addFeature(b);
1326
- }, t = (y, w, L) => {
1327
- const p = {
1337
+ b.setStyle(t(f, w, f.id === (o == null ? void 0 : o.id))), b.set("loactionData", f), s.addFeature(b);
1338
+ }, t = (f, w, P) => {
1339
+ const M = {
1328
1340
  image: new be({
1329
- src: L && y.selectedPath || y.defaultPath,
1341
+ src: P && f.selectedPath || f.defaultPath,
1330
1342
  scale: 0.5 * w / 10
1331
1343
  })
1332
1344
  };
1333
- return y.name && (p.text = new ue({
1334
- text: y.name,
1345
+ return f.name && (M.text = new ue({
1346
+ text: f.name,
1335
1347
  font: "12px sans-serif",
1336
1348
  fill: new Q({
1337
1349
  color: "#000000"
@@ -1340,59 +1352,59 @@ const nt = (e, l) => {
1340
1352
  color: "#FFFFFF"
1341
1353
  }),
1342
1354
  offsetY: 30
1343
- })), new H(p);
1355
+ })), new H(M);
1344
1356
  }, n = () => {
1345
1357
  if (a) {
1346
- const y = a.get("loactionData").id;
1358
+ const f = a.get("loactionData").id;
1347
1359
  s.getFeatures().forEach((w) => {
1348
- w.get("loactionData").id !== y && s.removeFeature(w);
1360
+ w.get("loactionData").id !== f && s.removeFeature(w);
1349
1361
  });
1350
1362
  } else
1351
1363
  s.clear();
1352
1364
  }, m = () => {
1353
- var p;
1354
- const y = a.get("loactionData"), w = (p = e == null ? void 0 : e.getView()) == null ? void 0 : p.getZoom();
1365
+ var M;
1366
+ const f = a.get("loactionData"), w = (M = e == null ? void 0 : e.getView()) == null ? void 0 : M.getZoom();
1355
1367
  s.getFeatures().forEach((b) => {
1356
- b.get("loactionData").id === y.id && (b == null || b.setStyle(t(y, w, !1)));
1368
+ b.get("loactionData").id === f.id && (b == null || b.setStyle(t(f, w, !1)));
1357
1369
  }), o = null, a = null;
1358
- }, h = (y) => {
1359
- y ? (P(), S(y)) : clearSelectedPort();
1360
- }, P = () => {
1361
- var y;
1370
+ }, y = (f) => {
1371
+ f ? (S(), C(f)) : clearSelectedPort();
1372
+ }, S = () => {
1373
+ var f;
1362
1374
  if (a) {
1363
- const w = a.get("loactionData"), L = (y = e == null ? void 0 : e.getView()) == null ? void 0 : y.getZoom();
1364
- a.setStyle(t(w, L, !1));
1375
+ const w = a.get("loactionData"), P = (f = e == null ? void 0 : e.getView()) == null ? void 0 : f.getZoom();
1376
+ a.setStyle(t(w, P, !1));
1365
1377
  }
1366
- }, S = (y) => {
1378
+ }, C = (f) => {
1367
1379
  const w = s.getFeatures();
1368
- o = y, a = w.find((L) => L.get("loactionData").id === y.id);
1380
+ o = f, a = w.find((P) => P.get("loactionData").id === f.id);
1369
1381
  };
1370
1382
  return {
1371
- render: f,
1372
- selected: h,
1383
+ render: v,
1384
+ selected: y,
1373
1385
  clearSelected: m,
1374
1386
  clear: n
1375
1387
  };
1376
- }, po = (e) => {
1377
- e.getInteractions().forEach((l) => {
1378
- l instanceof st && l.setActive(!1);
1379
- });
1380
1388
  }, Mo = (e) => {
1381
- e.getInteractions().forEach((l) => {
1382
- l instanceof st && l.setActive(!0);
1389
+ e.getInteractions().forEach((r) => {
1390
+ r instanceof st && r.setActive(!1);
1391
+ });
1392
+ }, Co = (e) => {
1393
+ e.getInteractions().forEach((r) => {
1394
+ r instanceof st && r.setActive(!0);
1383
1395
  });
1384
- }, Ve = (e, l) => {
1385
- const r = e.getViewport();
1386
- r && (r.style.cursor = l);
1387
- }, Co = (e, l) => {
1388
- const r = U([]), s = U("km"), a = (i) => {
1396
+ }, Ve = (e, r) => {
1397
+ const l = e.getViewport();
1398
+ l && (l.style.cursor = r);
1399
+ }, Lo = (e, r) => {
1400
+ const l = U([]), s = U("km"), a = (i) => {
1389
1401
  s.value = i;
1390
1402
  };
1391
1403
  let o;
1392
- const f = U(!1), x = () => {
1393
- Ve(e, "crosshair"), m(), po(e), e.on("pointermove", S), e.getViewport().addEventListener("mouseout", () => {
1404
+ const v = U(!1), x = () => {
1405
+ Ve(e, "crosshair"), m(), Mo(e), e.on("pointermove", C), e.getViewport().addEventListener("mouseout", () => {
1394
1406
  o && o.classList.add("hidden");
1395
- }), w(), f.value = !0;
1407
+ }), w(), v.value = !0;
1396
1408
  };
1397
1409
  let t, n;
1398
1410
  const m = () => {
@@ -1408,16 +1420,16 @@ const nt = (e, l) => {
1408
1420
  }
1409
1421
  }), e == null || e.addLayer(n);
1410
1422
  };
1411
- let h, P;
1412
- const S = (i) => {
1423
+ let y, S;
1424
+ const C = (i) => {
1413
1425
  if (i.dragging)
1414
1426
  return;
1415
1427
  let u = "点击选择起点";
1416
- h && (u = "单击继续,双击结束"), o && (o.innerHTML = u, P.setPosition(i.coordinate), o.classList.remove("hidden"));
1428
+ y && (u = "单击继续,双击结束"), o && (o.innerHTML = u, S.setPosition(i.coordinate), o.classList.remove("hidden"));
1417
1429
  };
1418
- let y;
1430
+ let f;
1419
1431
  const w = () => {
1420
- y = new Ne({
1432
+ f = new Se({
1421
1433
  source: t,
1422
1434
  type: "LineString",
1423
1435
  style: new H({
@@ -1429,7 +1441,7 @@ const nt = (e, l) => {
1429
1441
  lineDash: [10, 10],
1430
1442
  width: 2
1431
1443
  }),
1432
- image: new Se({
1444
+ image: new Ne({
1433
1445
  radius: 5,
1434
1446
  stroke: new fe({
1435
1447
  color: "rgba(0, 0, 0, 0.7)"
@@ -1441,85 +1453,85 @@ const nt = (e, l) => {
1441
1453
  }),
1442
1454
  // 添加条件函数,判断是否应该出发点绘制
1443
1455
  condition: (u) => u.originalEvent.target.tagName !== "DIV"
1444
- }), e == null || e.addInteraction(y), G(), W();
1456
+ }), e == null || e.addInteraction(f), G(), Y();
1445
1457
  let i;
1446
- y.on("drawstart", function(u) {
1447
- var C;
1448
- h = u.feature, h.set("randomId", L());
1449
- let v;
1450
- i = (C = h.getGeometry()) == null ? void 0 : C.on("change", function(k) {
1458
+ f.on("drawstart", function(u) {
1459
+ var L;
1460
+ y = u.feature, y.set("randomId", P());
1461
+ let h;
1462
+ i = (L = y.getGeometry()) == null ? void 0 : L.on("change", function(k) {
1451
1463
  const N = k.target, z = gt(N, s.value);
1452
- v = N.getLastCoordinate(), p && z && (p.innerHTML = z), b.setPosition(v);
1464
+ h = N.getLastCoordinate(), M && z && (M.innerHTML = z), b.setPosition(h);
1453
1465
  });
1454
- }), y.on("drawend", function() {
1455
- var u, v, C;
1456
- if (p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML) {
1457
- const k = (h == null ? void 0 : h.get("randomId")) || L();
1458
- r.value.push({ id: k, value: p == null ? void 0 : p.innerHTML }), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-id="${k}"><i class="map-iconfont icon-delete"></i></div>`;
1466
+ }), f.on("drawend", function() {
1467
+ var u, h, L;
1468
+ if (M && (M.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), M != null && M.innerHTML) {
1469
+ const k = (y == null ? void 0 : y.get("randomId")) || P();
1470
+ l.value.push({ id: k, value: M == null ? void 0 : M.innerHTML }), M.innerHTML = `${M.innerHTML}<div class="ol-tooltip-delete-button" data-id="${k}"><i class="map-iconfont icon-delete"></i></div>`;
1459
1471
  }
1460
1472
  (u = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || u.addEventListener("click", (k) => {
1461
1473
  var z;
1462
1474
  k.preventDefault(), k.stopPropagation();
1463
1475
  const N = (z = k.target) == null ? void 0 : z.getAttribute("data-id");
1464
1476
  N && X(N);
1465
- }), b.setOffset([0, -7]), h = null, p = null, G(), i && Ge(i), (C = (v = l.getProps()) == null ? void 0 : v.lineDrawEnd) == null || C.call(v, r.value);
1477
+ }), b.setOffset([0, -7]), y = null, M = null, G(), i && De(i), (L = (h = r.getProps()) == null ? void 0 : h.lineDrawEnd) == null || L.call(h, l.value);
1466
1478
  });
1467
- }, L = () => Math.random().toString(36).substring(2, 9);
1468
- let p, b;
1479
+ }, P = () => Math.random().toString(36).substring(2, 9);
1480
+ let M, b;
1469
1481
  const G = () => {
1470
- p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure", b = new ie({
1471
- element: p,
1482
+ M != null && M.parentNode && M.parentNode.removeChild(M), M = document.createElement("div"), M.className = "ol-tooltip ol-tooltip-measure", b = new ie({
1483
+ element: M,
1472
1484
  offset: [0, -15],
1473
1485
  positioning: "bottom-center",
1474
1486
  stopEvent: !1,
1475
1487
  insertFirst: !1
1476
1488
  }), e == null || e.addOverlay(b);
1477
- }, W = () => {
1478
- o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", P = new ie({
1489
+ }, Y = () => {
1490
+ o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", S = new ie({
1479
1491
  element: o,
1480
1492
  offset: [15, 0],
1481
1493
  positioning: "center-left"
1482
- }), e == null || e.addOverlay(P);
1494
+ }), e == null || e.addOverlay(S);
1483
1495
  }, B = () => {
1484
- r.value.forEach((i, u) => {
1496
+ l.value.forEach((i, u) => {
1485
1497
  var k, N;
1486
- const v = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
1487
- v[u] && ((N = (k = v[u]) == null ? void 0 : k.parentNode) == null || N.removeChild(v[u]));
1488
- const C = t.getFeatures();
1489
- C[u] && t.removeFeature(C[u]);
1490
- }), O(), Mo(e), f.value = !1, Ve(e, "pointer");
1498
+ const h = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
1499
+ h[u] && ((N = (k = h[u]) == null ? void 0 : k.parentNode) == null || N.removeChild(h[u]));
1500
+ const L = t.getFeatures();
1501
+ L[u] && t.removeFeature(L[u]);
1502
+ }), O(), Co(e), v.value = !1, Ve(e, "pointer");
1491
1503
  }, X = (i) => {
1492
- var v, C, k, N;
1493
- const u = r.value.findIndex((z) => z.id === i);
1504
+ var h, L, k, N;
1505
+ const u = l.value.findIndex((z) => z.id === i);
1494
1506
  if (u !== -1) {
1495
- r.value.splice(u, 1);
1507
+ l.value.splice(u, 1);
1496
1508
  const z = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
1497
- z[u] && ((C = (v = z[u]) == null ? void 0 : v.parentNode) == null || C.removeChild(z[u]));
1498
- const Z = t.getFeatures();
1499
- Z[u] && t.removeFeature(Z[u]);
1509
+ z[u] && ((L = (h = z[u]) == null ? void 0 : h.parentNode) == null || L.removeChild(z[u]));
1510
+ const A = t.getFeatures();
1511
+ A[u] && t.removeFeature(A[u]);
1500
1512
  }
1501
- (N = (k = l.getProps()) == null ? void 0 : k.lineDrawEnd) == null || N.call(k, r.value);
1513
+ (N = (k = r.getProps()) == null ? void 0 : k.lineDrawEnd) == null || N.call(k, l.value);
1502
1514
  }, O = () => {
1503
- if (r.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((i) => {
1515
+ if (l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((i) => {
1504
1516
  var u;
1505
1517
  (u = i == null ? void 0 : i.parentNode) == null || u.removeChild(i);
1506
- }), t.clear(), y) {
1507
- const i = e.getInteractions().getArray().find((u) => et(u) === et(y));
1518
+ }), t.clear(), f) {
1519
+ const i = e.getInteractions().getArray().find((u) => et(u) === et(f));
1508
1520
  i && e.removeInteraction(i);
1509
1521
  }
1510
- e.removeLayer(n), o != null && o.parentNode && o.parentNode.removeChild(o), p != null && p.parentNode && p.parentNode.removeChild(p);
1522
+ e.removeLayer(n), o != null && o.parentNode && o.parentNode.removeChild(o), M != null && M.parentNode && M.parentNode.removeChild(M);
1511
1523
  };
1512
1524
  return {
1513
1525
  open: x,
1514
1526
  close: B,
1515
1527
  deleteLine: X,
1516
1528
  setUnit: a,
1517
- getState: () => f.value
1529
+ getState: () => v.value
1518
1530
  };
1519
- }, gt = (e, l) => {
1531
+ }, gt = (e, r) => {
1520
1532
  const s = Be(e);
1521
1533
  let a = "";
1522
- switch (l) {
1534
+ switch (r) {
1523
1535
  case "m":
1524
1536
  a = `${Math.round(s * 100) / 100} m`;
1525
1537
  break;
@@ -1531,17 +1543,17 @@ const nt = (e, l) => {
1531
1543
  break;
1532
1544
  }
1533
1545
  return a;
1534
- }, Lo = (e, l) => {
1535
- let r, s;
1546
+ }, Eo = (e, r) => {
1547
+ let l, s;
1536
1548
  const a = () => {
1537
1549
  o(), Ve(e, "crosshair");
1538
1550
  }, o = () => {
1539
- t(), p(), W(), S();
1551
+ t(), M(), Y(), C();
1540
1552
  };
1541
- let f = null, x = null;
1553
+ let v = null, x = null;
1542
1554
  const t = () => {
1543
- if (f && x) return;
1544
- const O = new ae(), D = new ve({
1555
+ if (v && x) return;
1556
+ const O = new ae(), Z = new ve({
1545
1557
  source: O,
1546
1558
  style: new H({
1547
1559
  stroke: new fe({
@@ -1550,43 +1562,43 @@ const nt = (e, l) => {
1550
1562
  })
1551
1563
  })
1552
1564
  });
1553
- f = D, x = O, e.on("pointermove", m), e.addLayer(D), e.on(["dblclick"], function(i) {
1554
- h && (i.stopPropagation(), i.preventDefault());
1565
+ v = Z, x = O, e.on("pointermove", m), e.addLayer(Z), e.on(["dblclick"], function(i) {
1566
+ y && (i.stopPropagation(), i.preventDefault());
1555
1567
  });
1556
1568
  };
1557
1569
  let n;
1558
1570
  const m = (O) => {
1559
1571
  if (O.dragging) return;
1560
- const D = n ? "单击继续,双击结束" : "点击选择起点";
1561
- b && (b.innerHTML = D, G.setPosition(O.coordinate));
1572
+ const Z = n ? "单击继续,双击结束" : "点击选择起点";
1573
+ b && (b.innerHTML = Z, G.setPosition(O.coordinate));
1562
1574
  };
1563
- let h, P = !1;
1564
- const S = () => {
1565
- if (r) {
1575
+ let y, S = !1;
1576
+ const C = () => {
1577
+ if (l) {
1566
1578
  b != null && b.parentNode && b.parentNode.removeChild(b);
1567
- const O = r.getGeometry();
1579
+ const O = l.getGeometry();
1568
1580
  if (!O) return;
1569
- const D = y(O, "nm");
1581
+ const Z = f(O, "nm");
1570
1582
  w && (w.innerHTML = `
1571
- <span class="text">面积:${D}${P ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1583
+ <span class="text">面积:${Z}${S ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1572
1584
  `), w && (w.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
1573
1585
  const i = O.getCoordinates(), u = i[0][i[0].length - 2];
1574
- if (L.setPosition(u), f) {
1575
- const C = f.getSource();
1576
- C && r && (C.clear(), C.addFeature(r));
1586
+ if (P.setPosition(u), v) {
1587
+ const L = v.getSource();
1588
+ L && l && (L.clear(), L.addFeature(l));
1577
1589
  }
1578
1590
  setTimeout(() => {
1579
- var C;
1580
- (C = document.querySelector(".delete-icon")) == null || C.addEventListener("click", () => {
1591
+ var L;
1592
+ (L = document.querySelector(".delete-icon")) == null || L.addEventListener("click", () => {
1581
1593
  var k, N;
1582
- console.log("delete"), B(), (N = (k = l.getProps()) == null ? void 0 : k.areaDrawEnd) == null || N.call(k, []);
1594
+ console.log("delete"), B(), (N = (k = r.getProps()) == null ? void 0 : k.areaDrawEnd) == null || N.call(k, []);
1583
1595
  });
1584
1596
  }, 0);
1585
- const v = Ht(r.getGeometry().getExtent());
1586
- e == null || e.getView().setCenter(v);
1597
+ const h = Xt(l.getGeometry().getExtent());
1598
+ e == null || e.getView().setCenter(h);
1587
1599
  return;
1588
1600
  }
1589
- h = new Ne({
1601
+ y = new Se({
1590
1602
  type: "Polygon",
1591
1603
  source: x,
1592
1604
  trace: !0,
@@ -1600,35 +1612,35 @@ const nt = (e, l) => {
1600
1612
  color: "rgba(255, 255, 255, 0.25)"
1601
1613
  })
1602
1614
  }), new H({
1603
- image: new Se({
1615
+ image: new Ne({
1604
1616
  radius: 5,
1605
1617
  fill: new Q({
1606
1618
  color: "rgb(51,112,255, 1)"
1607
1619
  })
1608
1620
  }),
1609
1621
  geometry: function(O) {
1610
- const D = O.getGeometry().getCoordinates();
1611
- return new Xt(D);
1622
+ const Z = O.getGeometry().getCoordinates();
1623
+ return new jt(Z);
1612
1624
  }
1613
1625
  })]
1614
- }), e == null || e.addInteraction(h), h.on("drawstart", (O) => {
1615
- var D;
1616
- n = O.feature, s = (D = n.getGeometry()) == null ? void 0 : D.on("change", (i) => {
1617
- const u = i.target, v = y(u, "nm"), k = u.getCoordinates()[0], N = new Pe([k[k.length - 2], k[k.length - 1]]), z = gt(N, "nm");
1618
- if (P = Number(Be(N) / 1e3) > 150, !v) return;
1619
- const Z = '<span class="error pl-4">超出可以绘画的距离</span>';
1626
+ }), e == null || e.addInteraction(y), y.on("drawstart", (O) => {
1627
+ var Z;
1628
+ n = O.feature, s = (Z = n.getGeometry()) == null ? void 0 : Z.on("change", (i) => {
1629
+ const u = i.target, h = f(u, "nm"), k = u.getCoordinates()[0], N = new Pe([k[k.length - 2], k[k.length - 1]]), z = gt(N, "nm");
1630
+ if (S = Number(Be(N) / 1e3) > 150, !h) return;
1631
+ const A = '<span class="error pl-4">超出可以绘画的距离</span>';
1620
1632
  w && (w.innerHTML = `
1621
1633
  <div class="text">
1622
- 面积:${v}
1623
- ${P ? Z : ""}
1634
+ 面积:${h}
1635
+ ${S ? A : ""}
1624
1636
  </div>
1625
1637
  `), b && (b.innerHTML = `
1626
1638
  <div class="text">
1627
- 面积:${v}
1639
+ 面积:${h}
1628
1640
  </div>
1629
- <div class="text ${P ? "error" : ""}">
1641
+ <div class="text ${S ? "error" : ""}">
1630
1642
  线段 ${k.length - 2}: ${z}
1631
- ${P ? Z : ""}
1643
+ ${S ? A : ""}
1632
1644
 
1633
1645
  </div>
1634
1646
  <div>
@@ -1636,89 +1648,91 @@ const nt = (e, l) => {
1636
1648
  </div>
1637
1649
  `);
1638
1650
  });
1639
- }), h.on("drawend", (O) => {
1640
- var v, C, k, N;
1651
+ }), y.on("drawend", (O) => {
1652
+ var h, L, k, N;
1641
1653
  if (!O.feature.getGeometry()) return;
1642
- r = O.feature, w && (w.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), L.setOffset([10, 0]);
1654
+ l = O.feature, w && (w.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), P.setOffset([10, 0]);
1643
1655
  const i = O.feature.getGeometry().getCoordinates(), u = i[0][i[0].length - 2];
1644
- if (L.setPosition(u), b != null && b.parentNode && b.parentNode.removeChild(b), (v = l.getProps()) != null && v.areaDrawEnd) {
1645
- const z = i[0].map((Z) => xe(Z, J.mercator, J.data));
1646
- (k = (C = l.getProps()) == null ? void 0 : C.areaDrawEnd) == null || k.call(C, z);
1656
+ if (P.setPosition(u), b != null && b.parentNode && b.parentNode.removeChild(b), (h = r.getProps()) != null && h.areaDrawEnd) {
1657
+ const z = i[0].map((A) => xe(A, J.mercator, J.data));
1658
+ (k = (L = r.getProps()) == null ? void 0 : L.areaDrawEnd) == null || k.call(L, z);
1647
1659
  }
1648
- h && (h.setActive(!1), e == null || e.removeInteraction(h), (e == null ? void 0 : e.getInteractions()).forEach((Z) => {
1649
- Z instanceof Ne && (Z.setActive(!1), e == null || e.removeInteraction(Z));
1650
- })), s && Ge(s), (N = document.querySelector(".delete-icon")) == null || N.addEventListener("click", () => {
1651
- var z, Z;
1652
- B(), (Z = (z = l.getProps()) == null ? void 0 : z.areaDrawEnd) == null || Z.call(z, []);
1660
+ y && (y.setActive(!1), e == null || e.removeInteraction(y), (e == null ? void 0 : e.getInteractions()).forEach((A) => {
1661
+ A instanceof Se && (A.setActive(!1), e == null || e.removeInteraction(A));
1662
+ })), s && De(s), (N = document.querySelector(".delete-icon")) == null || N.addEventListener("click", () => {
1663
+ var z, A;
1664
+ B(), (A = (z = r.getProps()) == null ? void 0 : z.areaDrawEnd) == null || A.call(z, []);
1653
1665
  });
1654
1666
  });
1655
- }, y = (O, D) => {
1656
- const i = qt(O);
1657
- switch (D) {
1667
+ }, f = (O, Z) => {
1668
+ const i = Ht(O);
1669
+ switch (Z) {
1658
1670
  case "km":
1659
1671
  return i > 1e4 ? Math.round(i / 1e6 * 100) / 100 + " km<sup>2</sup>" : Math.round(i * 100) / 100 + " m<sup>2</sup>";
1660
1672
  case "nm":
1661
1673
  return i > 1e4 ? Math.round(i / 1e6 / Math.pow(1.852, 2) * 100) / 100 + " nm<sup>2</sup>" : Math.round(i * 100) / 100 + " m<sup>2</sup>";
1662
1674
  }
1663
1675
  };
1664
- let w, L;
1665
- const p = () => {
1666
- w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.style.display = "flex", w.className = "ol-tooltip ol-tooltip-draw-polygon", L = new ie({
1676
+ let w, P;
1677
+ const M = () => {
1678
+ w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.style.display = "flex", w.className = "ol-tooltip ol-tooltip-draw-polygon", P = new ie({
1667
1679
  element: w,
1668
1680
  offset: [0, -15],
1669
1681
  positioning: "bottom-center",
1670
1682
  stopEvent: !1,
1671
1683
  insertFirst: !1
1672
- }), e == null || e.addOverlay(L);
1684
+ }), e == null || e.addOverlay(P);
1673
1685
  };
1674
1686
  let b, G;
1675
- const W = () => {
1687
+ const Y = () => {
1676
1688
  b != null && b.parentNode && b.parentNode.removeChild(b), b = document.createElement("div"), b.className = "ol-tooltip ol-help-tooltip", G = new ie({
1677
1689
  element: b,
1678
1690
  offset: [15, 0],
1679
1691
  positioning: "center-left"
1680
1692
  }), e == null || e.addOverlay(G);
1681
1693
  }, B = () => {
1682
- x == null || x.clear(), r = null, p(), W(), S();
1694
+ x == null || x.clear(), l = null, M(), Y(), C();
1683
1695
  };
1684
1696
  return {
1685
1697
  open: a,
1686
1698
  close: () => {
1687
- x == null || x.clear(), x = null, f && (e.removeLayer(f), f = null), n = null, h && (h.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((D) => {
1688
- D instanceof Ne && (D.setActive(!1), e == null || e.removeInteraction(D));
1689
- }), h = null), s && Ge(s), b != null && b.parentElement && b.parentElement.removeChild(b), w != null && w.parentElement && w.parentElement.removeChild(w), G && e.removeOverlay(G), L && e.removeOverlay(L), Ve(e, "pointer");
1699
+ x == null || x.clear(), x = null, v && (e.removeLayer(v), v = null), n = null, y && (y.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((Z) => {
1700
+ Z instanceof Se && (Z.setActive(!1), e == null || e.removeInteraction(Z));
1701
+ }), y = null), s && De(s), b != null && b.parentElement && b.parentElement.removeChild(b), w != null && w.parentElement && w.parentElement.removeChild(w), G && e.removeOverlay(G), P && e.removeOverlay(P), Ve(e, "pointer");
1690
1702
  },
1691
1703
  reset: B
1692
1704
  };
1693
- }, Eo = "zh-map-port-layer", To = (e) => {
1694
- const l = e.getInstall(), r = new ae(), s = new ve({
1695
- className: Eo,
1705
+ }, To = "zh-map-port-layer", Fo = (e) => {
1706
+ const r = new ae(), l = new ve({
1707
+ className: To,
1696
1708
  source: r,
1697
- zIndex: 100
1709
+ zIndex: 100,
1710
+ updateWhileInteracting: !1,
1711
+ updateWhileAnimating: !1
1698
1712
  });
1699
- l == null || l.addLayer(s);
1700
- let a = null, o = null;
1701
- const f = (y, w = !0) => {
1702
- if (!(!y || y.length === 0)) {
1703
- if (r.clear(), o) {
1704
- const L = y.find((p) => p.id === o.id);
1705
- L ? o = L : y.push(o);
1713
+ e == null || e.addLayer(l);
1714
+ let s = null, a = null;
1715
+ const o = (C, f = !0) => {
1716
+ if (!(!C || C.length === 0)) {
1717
+ if (r.clear(), a) {
1718
+ const w = C.find((P) => P.id === a.id);
1719
+ w ? a = w : C.push(a);
1706
1720
  }
1707
- y.forEach((L) => {
1708
- x(L, w);
1721
+ C.forEach((w) => {
1722
+ v(w, f);
1709
1723
  });
1710
1724
  }
1711
- }, x = (y, w = !0) => {
1712
- const L = e.getZoom(), [p, b] = y.latLon.split(","), G = new se({
1713
- geometry: new ne(I([Number(p), Number(b)])),
1714
- portData: y,
1715
- select: y.id === (o == null ? void 0 : o.id),
1716
- showTitle: y.id === (o == null ? void 0 : o.id) || w
1717
- }), W = t(G, L);
1718
- console.log("point-styles--------", W), G.setStyle(W), r.addFeature(G);
1719
- }, t = (y, w) => {
1720
- const { select: L, showTitle: p } = y.getProperties(), b = (B) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
1721
- <path fill-rule="evenodd" clip-rule="evenodd" d="M22.6563 44.9304C22.5453 44.8844 22.4445 44.817 22.3595 44.7321C22.3595 44.7321 9.36986 31.7424 9.32952 31.6913C7.09059 29.0791 5.64794 25.8802 5.17255 22.4736C4.69716 19.0671 5.20896 15.5957 6.64728 12.471C8.08561 9.34625 10.3902 6.69909 13.2878 4.84325C16.1855 2.98741 19.5548 2.00068 22.9965 2C26.4381 1.99932 29.8078 2.98473 32.7062 4.83943C35.6046 6.69414 37.9102 9.34039 39.3498 12.4646C40.7893 15.5888 41.3025 19.0599 40.8284 22.4666C40.3544 25.8734 38.913 29.0729 36.6751 31.686C36.6401 31.737 23.6531 44.7321 23.6531 44.7321C23.5682 44.817 23.4674 44.8844 23.3564 44.9304C23.2454 44.9763 23.1265 45 23.0063 45C22.8862 45 22.7673 44.9763 22.6563 44.9304Z" fill="${B}"/>
1725
+ }, v = (C, f = !0) => {
1726
+ const [w, P] = C.latLon.split(","), M = new se({
1727
+ geometry: new re(I([Number(w), Number(P)])),
1728
+ portData: C,
1729
+ select: C.id === (a == null ? void 0 : a.id),
1730
+ showTitle: C.id === (a == null ? void 0 : a.id) || f
1731
+ }), b = x(M);
1732
+ console.log("point-styles--------", b), M.setStyle(b), r.addFeature(M);
1733
+ }, x = (C) => {
1734
+ const { select: f, showTitle: w } = C.getProperties(), P = (X) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
1735
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M22.6563 44.9304C22.5453 44.8844 22.4445 44.817 22.3595 44.7321C22.3595 44.7321 9.36986 31.7424 9.32952 31.6913C7.09059 29.0791 5.64794 25.8802 5.17255 22.4736C4.69716 19.0671 5.20896 15.5957 6.64728 12.471C8.08561 9.34625 10.3902 6.69909 13.2878 4.84325C16.1855 2.98741 19.5548 2.00068 22.9965 2C26.4381 1.99932 29.8078 2.98473 32.7062 4.83943C35.6046 6.69414 37.9102 9.34039 39.3498 12.4646C40.7893 15.5888 41.3025 19.0599 40.8284 22.4666C40.3544 25.8734 38.913 29.0729 36.6751 31.686C36.6401 31.737 23.6531 44.7321 23.6531 44.7321C23.5682 44.817 23.4674 44.8844 23.3564 44.9304C23.2454 44.9763 23.1265 45 23.0063 45C22.8862 45 22.7673 44.9763 22.6563 44.9304Z" fill="${X}"/>
1722
1736
  <g clip-path="url(#clip0_10059_122082)">
1723
1737
  <path d="M34.8624 22.8687L32.5874 25.6313L33.4812 25.7125C33.4812 25.7125 30.5562 28.0687 27.9562 28.2312C25.3562 28.3937 24.1374 24.9 24.1374 24.9V19.1312H27.6312V17.425H24.2999V15.15C25.7624 14.6625 26.7374 13.2812 26.7374 11.6562C26.7374 9.625 25.1124 8 23.0812 8H22.9999C20.9687 8 19.3437 9.625 19.3437 11.6562C19.3437 13.2812 20.3999 14.6625 21.7812 15.15V17.425H18.4499V19.1312H21.9437V24.9C21.9437 24.9 20.6437 28.3125 18.0437 28.2312C15.4437 28.0687 12.5187 25.7125 12.5187 25.7125L13.4124 25.6313L11.0562 22.8687L10.2437 26.2812L11.2187 26.0375C11.2187 26.0375 13.1687 29.5313 16.1749 30.8313C19.1812 32.2125 22.1874 33.9187 22.8374 34C23.4874 33.9187 26.4937 32.2125 29.4187 30.8313C32.3437 29.45 34.3749 26.0375 34.3749 26.0375L35.3499 26.2812L34.8624 22.8687ZM23.0812 13.6875C21.9437 13.6875 21.0499 12.7937 21.0499 11.6562C21.0499 10.6 21.9437 9.70625 22.9999 9.70625H23.0812C24.1374 9.70625 25.0312 10.6 25.0312 11.6562C25.1124 12.7937 24.1374 13.6875 23.0812 13.6875Z" fill="white"/>
1724
1738
  </g>
@@ -1728,142 +1742,147 @@ const nt = (e, l) => {
1728
1742
  </clipPath>
1729
1743
  </defs>
1730
1744
  </svg>
1731
- `, G = () => `data:image/svg+xml;utf8,${encodeURIComponent(b(L ? "#FF5733" : "#3370FF"))}`, W = y.get("portData");
1732
- return !p && !L ? new H({
1733
- image: new be({
1734
- src: G(),
1735
- scale: 0.5 * w / 10
1736
- }),
1737
- zIndex: L ? 110 : 100
1738
- }) : (console.log("showTitle", p, W.shortName, "选中", L), new H({
1745
+ `, M = () => `data:image/svg+xml;utf8,${encodeURIComponent(P(f ? "#FF5733" : "#3370FF"))}`, b = e.getView().getZoom(), G = C.get("portData");
1746
+ if (!w && !f)
1747
+ return new H({
1748
+ image: new be({
1749
+ src: M(),
1750
+ scale: 0.5 * b / 10
1751
+ }),
1752
+ zIndex: f ? 110 : 100
1753
+ });
1754
+ console.log("showTitle", w, G.shortName, "选中", f, b);
1755
+ const Y = new H({
1739
1756
  text: new ue({
1740
- text: W.shortName,
1757
+ text: G.shortName,
1741
1758
  font: "12px sans-serif",
1742
1759
  fill: new Q({
1743
- color: L ? "#ffffff" : "#000000"
1760
+ color: f ? "#ffffff" : "#000000"
1744
1761
  }),
1745
1762
  backgroundFill: new Q({
1746
- color: L ? "#FF5733" : "#FFFFFF"
1763
+ color: f ? "#FF5733" : "#FFFFFF"
1747
1764
  }),
1748
1765
  offsetY: 30
1749
1766
  }),
1767
+ zIndex: f ? 110 : 100
1768
+ });
1769
+ return [new H({
1750
1770
  image: new be({
1751
- src: G(),
1752
- scale: 0.5 * w / 10
1771
+ src: M(),
1772
+ scale: 0.5 * b / 10
1753
1773
  }),
1754
- zIndex: L ? 110 : 100
1755
- }));
1756
- }, n = () => {
1774
+ zIndex: f ? 110 : 100
1775
+ }), Y];
1776
+ }, t = () => {
1757
1777
  if (r)
1758
- if (a) {
1778
+ if (s) {
1759
1779
  console.log("清除非选中的港口");
1760
- const y = a.get("portData").id;
1761
- r.getFeatures().forEach((w) => {
1762
- w.get("portData").id !== y && r.removeFeature(w);
1780
+ const C = s.get("portData").id;
1781
+ r.getFeatures().forEach((f) => {
1782
+ f.get("portData").id !== C && r.removeFeature(f);
1763
1783
  });
1764
1784
  } else
1765
1785
  console.log("清除所有港口", r), r == null || r.clear();
1766
- }, m = (y) => {
1786
+ }, n = (C) => {
1767
1787
  if (r) {
1768
- if (!y)
1769
- return h();
1770
- (a == null ? void 0 : a.get("portData").id) !== y.id && (h(), P(y));
1788
+ if (!C)
1789
+ return m();
1790
+ (s == null ? void 0 : s.get("portData").id) !== C.id && (m(), y(C));
1771
1791
  }
1772
- }, h = () => {
1773
- if (a) {
1774
- const y = a == null ? void 0 : a.get("portData"), w = e.getZoom();
1775
- r.getFeatures().forEach((p) => {
1776
- p.get("portData").id === y.id && (p.setStyle(t(p, w)), p.set("select", !1), a = null);
1792
+ }, m = () => {
1793
+ if (s) {
1794
+ const C = s == null ? void 0 : s.get("portData");
1795
+ r.getFeatures().forEach((w) => {
1796
+ w.get("portData").id === C.id && (w.setStyle(x(w)), w.set("select", !1), s = null);
1777
1797
  });
1778
1798
  }
1779
- }, P = (y) => {
1799
+ }, y = (C) => {
1780
1800
  if (!r) return;
1781
- const w = r.getFeatures();
1782
- o = y, a = w.find((L) => L.get("portData").id === y.id), a && (a.set("select", !0), a.setStyle(t(a, e.getZoom())));
1801
+ const f = r.getFeatures();
1802
+ a = C, s = f.find((w) => w.get("portData").id === C.id), s && (s.set("select", !0), s.setStyle(x(s)));
1783
1803
  };
1784
1804
  return {
1785
- render: f,
1786
- clear: n,
1787
- selected: m,
1788
- handlePortHover: (y) => {
1789
- const w = l == null ? void 0 : l.getTargetElement();
1790
- y && y.get("portData") && w && (w.style.cursor = "pointer");
1805
+ render: o,
1806
+ clear: t,
1807
+ selected: n,
1808
+ handlePortHover: (C) => {
1809
+ const f = e == null ? void 0 : e.getTargetElement();
1810
+ C && C.get("portData") && f && (f.style.cursor = "pointer");
1791
1811
  }
1792
1812
  };
1793
- }, Fo = (e, l, r, s, a, o) => {
1794
- const f = e.getInstall();
1795
- f.on("moveend", () => {
1813
+ }, Po = (e, r, l, s, a, o) => {
1814
+ const v = e.getInstall();
1815
+ v.on("moveend", () => {
1796
1816
  var x, t;
1797
1817
  try {
1798
1818
  const n = e.getZoom();
1799
- (t = (x = l.getProps()).mapMoveEnd) == null || t.call(x, n), r.reRenderTrackLine(), n <= ee.shipModelMax && n >= ee.shipTriggleMin && s.changeShipScale("end");
1819
+ (t = (x = r.getProps()).mapMoveEnd) == null || t.call(x, n), l.reRenderTrackLine(), s.changeShipScale("end");
1800
1820
  } catch (n) {
1801
1821
  console.log("moveend---catch", n);
1802
1822
  }
1803
- }), f.on("pointermove", (x) => {
1823
+ }), v.on("pointermove", (x) => {
1804
1824
  try {
1805
- const t = f == null ? void 0 : f.getEventPixel(x.originalEvent);
1806
- if (!t || !f) return;
1807
- const n = f == null ? void 0 : f.forEachFeatureAtPixel(t, (m) => m, {
1825
+ const t = v == null ? void 0 : v.getEventPixel(x.originalEvent);
1826
+ if (!t || !v) return;
1827
+ const n = v == null ? void 0 : v.forEachFeatureAtPixel(t, (m) => m, {
1808
1828
  layerFilter: (m) => m.getVisible()
1809
1829
  });
1810
- s == null || s.handleShipMapEvent(n, "hover"), r == null || r.handleTrackMapEvent(n, "hover", x), n && (a == null || a.handlePortHover(n));
1830
+ s == null || s.handleShipMapEvent(n, "hover"), l == null || l.handleTrackMapEvent(n, "hover", x), n && (a == null || a.handlePortHover(n));
1811
1831
  } catch (t) {
1812
1832
  console.log("pointermove---catch", t);
1813
1833
  }
1814
- }), f.on("movestart", () => {
1834
+ }), v.on("movestart", () => {
1815
1835
  try {
1816
- const x = f == null ? void 0 : f.getView().getZoom();
1817
- x && x <= ee.shipModelMax && x >= ee.shipTriggleMin && s.changeShipScale("start");
1836
+ const x = v == null ? void 0 : v.getView().getZoom();
1837
+ x && x <= ne.shipModelMax && x >= ne.shipTriggleMin && s.changeShipScale("start");
1818
1838
  } catch (x) {
1819
1839
  console.log("movestart---catch", x);
1820
1840
  }
1821
- }), f.on("click", qe((x) => {
1841
+ }), v.on("singleclick", qe((x) => {
1822
1842
  var t, n, m;
1823
1843
  try {
1824
1844
  if (console.log("1", o.getState()), o.getState()) return;
1825
- const h = f.getEventPixel(x.originalEvent), P = f.forEachFeatureAtPixel(
1826
- h,
1827
- (S) => {
1828
- if (S != null && S.get("shipData") || S != null && S.get("portData"))
1829
- return S;
1830
- }
1831
- );
1832
- if (console.log("2", P), !P) return;
1833
- if (P.get("shipData"))
1834
- s.handleShipMapEvent(P, "click", (t = l.getProps()) == null ? void 0 : t.selectShip);
1835
- else if (P.get("portData")) {
1836
- const S = P.get("portData");
1837
- a.selected(S), (m = (n = l.getProps()) == null ? void 0 : n.selectPort) == null || m.call(n, S);
1845
+ const y = v.getFeaturesAtPixel(x.pixel);
1846
+ if (!y && y.length === 0) return;
1847
+ console.log("features------------", y);
1848
+ let S = null, C = null;
1849
+ if (y == null || y.forEach((f) => {
1850
+ f.get("shipData") && (S = f), f.get("portData") && (C = f);
1851
+ }), S)
1852
+ s.handleShipMapEvent(S, "click", (t = r.getProps()) == null ? void 0 : t.selectShip);
1853
+ else if (C) {
1854
+ const f = C.get("portData");
1855
+ a.selected(f), (m = (n = r.getProps()) == null ? void 0 : n.selectPort) == null || m.call(n, f);
1838
1856
  }
1839
- } catch (h) {
1840
- console.log("click---catch", h);
1857
+ x.preventDefault(), x.stopPropagation();
1858
+ } catch (y) {
1859
+ console.log("click---catch", y);
1841
1860
  }
1842
1861
  }, 150));
1843
- }, Po = () => {
1844
- const e = St([]);
1862
+ }, So = () => {
1863
+ const e = Nt([]);
1845
1864
  return {
1846
1865
  createInstance: (s, a) => {
1847
- const o = to();
1866
+ const o = oo();
1848
1867
  o.initMap(s, a);
1849
- const f = o.getInstall(), x = xo(f), t = bo();
1868
+ const v = o.getInstall(), x = bo(v), t = ko();
1850
1869
  t.setProps(a), x.setShowLayerType(a.layerType), x.setGreenTileVisible(a.showGreenLayer);
1851
- const n = io(f), m = so(f, n), h = wo(f), P = ko(f), S = Co(f, t), y = Lo(f, t), w = To(o);
1852
- Fo(o, t, n, h, w, S);
1853
- const L = () => {
1854
- const b = f.getView().calculateExtent(o.getSize()), G = xe([b[0], b[1]], J.mercator, J.data), W = xe([b[2], b[3]], J.mercator, J.data);
1855
- return [G[0], G[1], W[0], W[1]];
1856
- }, p = {
1870
+ const n = co(v), m = io(v, n), y = xo(v), S = po(v), C = Lo(v, t), f = Eo(v, t), w = Fo(v);
1871
+ Po(o, t, n, y, w, C);
1872
+ const P = () => {
1873
+ const b = v.getView().calculateExtent(o.getSize()), G = xe([b[0], b[1]], J.mercator, J.data), Y = xe([b[2], b[3]], J.mercator, J.data);
1874
+ return [G[0], G[1], Y[0], Y[1]];
1875
+ }, M = {
1857
1876
  id: Symbol("map-instance"),
1858
1877
  innerMap: null,
1859
1878
  map: o.getInstall(),
1860
1879
  destroy: () => {
1861
- e.splice(e.indexOf(p), 1);
1880
+ e.splice(e.indexOf(M), 1);
1862
1881
  },
1863
1882
  methods: {
1864
1883
  ...o,
1865
1884
  layer: x,
1866
- ship: h,
1885
+ ship: y,
1867
1886
  track: n,
1868
1887
  carTrack: m,
1869
1888
  port: {
@@ -1871,18 +1890,18 @@ const nt = (e, l) => {
1871
1890
  clear: w.clear,
1872
1891
  selected: w.selected
1873
1892
  },
1874
- position: P,
1875
- drawLine: S,
1876
- drawPolygon: y,
1893
+ position: S,
1894
+ drawLine: C,
1895
+ drawPolygon: f,
1877
1896
  // 子模块
1878
1897
  utils: {
1879
- getCalculateExtent: L,
1898
+ getCalculateExtent: P,
1880
1899
  convertSixHundredThousandToLatLng: Xe,
1881
- calculateCirclePoints: oo
1900
+ calculateCirclePoints: ro
1882
1901
  }
1883
1902
  }
1884
1903
  };
1885
- return e.push(p), p;
1904
+ return e.push(M), M;
1886
1905
  },
1887
1906
  destroyInstance: (s) => {
1888
1907
  const a = e.findIndex((o) => o.id === s);
@@ -1893,11 +1912,11 @@ const nt = (e, l) => {
1893
1912
  },
1894
1913
  getAllInstances: () => [...e]
1895
1914
  };
1896
- }, No = { class: "zh-map-box" }, So = /* @__PURE__ */ Ae({
1915
+ }, No = { class: "zh-map-box" }, $o = /* @__PURE__ */ Ge({
1897
1916
  __name: "Map",
1898
1917
  props: {
1899
- zoom: { default: ee.default },
1900
- center: { default: eo },
1918
+ zoom: { default: ne.default },
1919
+ center: { default: to },
1901
1920
  layerType: { default: "vector" },
1902
1921
  showGreenLayer: { type: Boolean, default: !1 },
1903
1922
  showScale: { type: Boolean, default: !0 },
@@ -1912,18 +1931,18 @@ const nt = (e, l) => {
1912
1931
  selectPort: { type: Function, default: () => {
1913
1932
  } }
1914
1933
  },
1915
- setup(e, { expose: l }) {
1916
- const r = U(), s = U(), a = Po(), o = U(), f = e, x = U({
1934
+ setup(e, { expose: r }) {
1935
+ const l = U(), s = U(), a = So(), o = U(), v = e, x = U({
1917
1936
  getInstall() {
1918
1937
  }
1919
1938
  });
1920
1939
  return $t(() => {
1921
1940
  var t;
1922
- o.value = a.createInstance(r.value, f), x.value = o.value.methods, (t = s.value) == null || t.setScaleLine(o.value.map, f.scaleLineUnit);
1941
+ o.value = a.createInstance(l.value, v), x.value = o.value.methods, (t = s.value) == null || t.setScaleLine(o.value.map, v.scaleLineUnit);
1923
1942
  }), Vt(() => {
1924
1943
  var t, n;
1925
1944
  a.destroyInstance((t = o == null ? void 0 : o.value) == null ? void 0 : t.id), (n = o.value) == null || n.destroy();
1926
- }), l({
1945
+ }), r({
1927
1946
  getZoom: () => {
1928
1947
  var t;
1929
1948
  return (t = o.value) == null ? void 0 : t.methods.getZoom();
@@ -2131,20 +2150,20 @@ const nt = (e, l) => {
2131
2150
  Ze("div", {
2132
2151
  id: "map",
2133
2152
  ref_key: "zhMapRef",
2134
- ref: r,
2153
+ ref: l,
2135
2154
  class: "zh-map"
2136
2155
  }, null, 512),
2137
- De(Kt, {
2156
+ Ae(_t, {
2138
2157
  ref_key: "scaleLineRef",
2139
2158
  ref: s
2140
2159
  }, null, 512),
2141
- De(It, {
2160
+ Ae(eo, {
2142
2161
  ref: "zoomControlRef",
2143
2162
  "map-instance": o.value
2144
2163
  }, null, 8, ["map-instance"])
2145
2164
  ]));
2146
2165
  }
2147
- }), $o = /* @__PURE__ */ He(So, [["__scopeId", "data-v-5724a05d"]]), Do = jt($o);
2166
+ }), Vo = /* @__PURE__ */ He($o, [["__scopeId", "data-v-9c5af6bb"]]), Do = Qt(Vo);
2148
2167
  export {
2149
2168
  Do as Z
2150
2169
  };