zhihao-ui 1.3.42-alpha.4 → 1.3.42-alpha.5

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.
@@ -73,34 +73,34 @@ const Kt = { id: "scale-line-container" }, _t = /* @__PURE__ */ je({
73
73
  var fe = ((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=${Ve}`, 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=${Ve}`, 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=${Ve}`, 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=${Ve}`, e.greenTile = `${gt}/map/tile/{z}/{x}/{y}.png`, e))(fe || {}), ke = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(ke || {});
74
74
  function ro() {
75
75
  const e = oe(), n = () => e.value, s = () => n().getView(), l = () => {
76
- var y;
77
- return (y = s()) == null ? void 0 : y.getZoom();
78
- }, i = (y) => {
79
- var E;
80
- (E = s()) == null || E.setZoom(y);
81
- }, o = (y, E) => {
82
- var z;
83
- (z = s()) == null || z.setCenter(ee([y, E]));
76
+ var x;
77
+ return (x = s()) == null ? void 0 : x.getZoom();
78
+ }, i = (x) => {
79
+ var M;
80
+ (M = s()) == null || M.setZoom(x);
81
+ }, o = (x, M) => {
82
+ var V;
83
+ (V = s()) == null || V.setCenter(ee([x, M]));
84
84
  }, f = () => {
85
- var E;
86
- const y = (E = s()) == null ? void 0 : E.getCenter();
87
- return At(y);
85
+ var M;
86
+ const x = (M = s()) == null ? void 0 : M.getCenter();
87
+ return At(x);
88
88
  }, v = () => {
89
- var y;
90
- return (y = n()) == null ? void 0 : y.getSize();
91
- }, t = new rt(), r = (y, E) => {
92
- g(E);
93
- const z = {
94
- zoom: E.zoom,
95
- center: ee(E.center),
89
+ var x;
90
+ return (x = n()) == null ? void 0 : x.getSize();
91
+ }, t = new rt(), r = (x, M) => {
92
+ g(M);
93
+ const V = {
94
+ zoom: M.zoom,
95
+ center: ee(M.center),
96
96
  minZoom: re.min,
97
97
  maxZoom: re.max,
98
98
  constrainResolution: !0,
99
99
  enableRotation: !1,
100
100
  multiWorld: !0
101
101
  };
102
- let M = {
103
- target: y,
102
+ let C = {
103
+ target: x,
104
104
  controls: Dt({
105
105
  zoom: !1
106
106
  }),
@@ -110,38 +110,38 @@ function ro() {
110
110
  t.get("satelliteImgTile"),
111
111
  t.get("satelliteImgTileMark")
112
112
  ],
113
- view: new Zt(z)
113
+ view: new Zt(V)
114
114
  };
115
- const b = new rt(M);
115
+ const b = new rt(C);
116
116
  e.value = b;
117
- }, g = (y) => {
117
+ }, g = (x) => {
118
118
  t.set("vectorTile", new we({
119
119
  source: new xe({ url: fe.vectorTile }),
120
- visible: y.layerType === "vector",
120
+ visible: x.layerType === "vector",
121
121
  zIndex: 0,
122
122
  preload: 1,
123
123
  className: "vector"
124
124
  })), t.set("vectorTileMark", new we({
125
125
  source: new xe({ url: fe.vectorTileMark }),
126
- visible: y.layerType === "vector",
126
+ visible: x.layerType === "vector",
127
127
  zIndex: 1,
128
128
  preload: 1,
129
129
  className: "vector"
130
130
  })), t.set("satelliteImgTile", new we({
131
131
  source: new xe({ url: fe.satelliteImgTile }),
132
- visible: y.layerType === "satellite",
132
+ visible: x.layerType === "satellite",
133
133
  zIndex: 0,
134
134
  preload: 1,
135
135
  className: "satellite"
136
136
  })), t.set("satelliteImgTileMark", new we({
137
137
  source: new xe({ url: fe.satelliteImgTileMark }),
138
- visible: y.layerType === "satellite",
138
+ visible: x.layerType === "satellite",
139
139
  zIndex: 1,
140
140
  preload: 1,
141
141
  className: "satellite"
142
142
  })), t.set("greenMark", new we({
143
143
  source: new xe({ url: fe.greenTile }),
144
- visible: y.showGreenLayer,
144
+ visible: x.showGreenLayer,
145
145
  zIndex: 2,
146
146
  className: "greenTile"
147
147
  }));
@@ -225,22 +225,22 @@ const st = (e) => {
225
225
  let s = null;
226
226
  const l = async (g) => {
227
227
  if (!e || (console.log("vehicleInfo", g), !(g != null && g.lon && (g != null && g.lat)))) return;
228
- const y = Math.abs(Number(g.lon)) > 180 ? Ue(g.lon, g.lat) : [g.lon, g.lat];
229
- i(g, ee(y));
230
- const E = e == null ? void 0 : e.getView(), z = new ce(y);
231
- E.setCenter(Me(z.getCoordinates(), _.data, _.mercator));
232
- }, i = (g, y) => {
233
- const E = `${gt}map/car-icon.gif`;
228
+ const x = Math.abs(Number(g.lon)) > 180 ? Ue(g.lon, g.lat) : [g.lon, g.lat];
229
+ i(g, ee(x));
230
+ const M = e == null ? void 0 : e.getView(), V = new ce(x);
231
+ M.setCenter(Me(V.getCoordinates(), _.data, _.mercator));
232
+ }, i = (g, x) => {
233
+ const M = `${gt}map/car-icon.gif`;
234
234
  s || (s = new de({
235
235
  element: document.createElement("div"),
236
236
  positioning: "center-center",
237
237
  stopEvent: !1
238
238
  // 允许交互事件穿透
239
239
  }), e.addOverlay(s));
240
- const z = s.getElement();
241
- z.style.backgroundImage = `url(${E})`, z.style.width = "80px", z.style.height = "80px";
242
- const M = (g == null ? void 0 : g.drc) || "";
243
- z.style.transform = `rotate(${M}deg)`, z.style.backgroundSize = "cover", s == null || s.setPosition(y);
240
+ const V = s.getElement();
241
+ V.style.backgroundImage = `url(${M})`, V.style.width = "80px", V.style.height = "80px";
242
+ const C = (g == null ? void 0 : g.drc) || "";
243
+ V.style.transform = `rotate(${C}deg)`, V.style.backgroundSize = "cover", s == null || s.setPosition(x);
244
244
  };
245
245
  return {
246
246
  location: l,
@@ -248,8 +248,8 @@ const st = (e) => {
248
248
  const g = s == null ? void 0 : s.getElement();
249
249
  g && (g.innerHTML = "");
250
250
  },
251
- renderTrack: (g, y, E) => {
252
- n.render(g, y, E, "truck", 1e3);
251
+ renderTrack: (g, x, M) => {
252
+ n.render(g, x, M, "truck", 1e3);
253
253
  },
254
254
  setCenter: (g) => {
255
255
  n.setCenter(g);
@@ -257,8 +257,8 @@ const st = (e) => {
257
257
  closeTrack: () => {
258
258
  n.close();
259
259
  },
260
- playTrack: (g, y) => {
261
- n.play(g, y);
260
+ playTrack: (g, x) => {
261
+ n.play(g, x);
262
262
  }
263
263
  };
264
264
  };
@@ -273,10 +273,10 @@ const ao = (e) => {
273
273
  positioning: "top-left",
274
274
  className: "track-label-popup"
275
275
  });
276
- let t, r, g, y, E, z = !1, M = Date.now(), b, w = 0, k = null, T = 20;
277
- const L = 8, D = [], W = (c) => {
276
+ let t, r, g, x, M, V = !1, C = Date.now(), b, m = 0, k = null, T = 20;
277
+ const E = 8, D = [], W = (c) => {
278
278
  var d;
279
- for (D.unshift(c); D.length > L; ) {
279
+ for (D.unshift(c); D.length > E; ) {
280
280
  const h = D.pop(), p = n.get(h);
281
281
  p && ((d = p.getSource()) == null || d.clear(), e == null || e.removeLayer(p), n.delete(h), delete s[h]);
282
282
  }
@@ -298,12 +298,12 @@ const ao = (e) => {
298
298
  }
299
299
  return S.center = [S.lon, S.lat], S.centerPoint = so(S.center), S.time = dt(S.createdAt).format("YYYY-MM-DD HH:mm:ss"), S.id = c, S.index = Z, S;
300
300
  }), h;
301
- }, C = async (c, d, h, p = "ship", P = 200) => {
301
+ }, L = async (c, d, h, p = "ship", P = 200) => {
302
302
  if (!e || JSON.stringify(s[c]) === JSON.stringify(d) && l === c || (d = d == null ? void 0 : d.reverse(), v && p === "ship" && (e != null && e.getOverlays().getArray().includes(v) || e.addOverlay(v)), (d == null ? void 0 : d.length) < 2))
303
303
  return;
304
304
  W(c), l = c, s[c] = d, T = P;
305
305
  const S = Object.keys(s).findIndex((Z) => Z === c) || 0;
306
- A = h || H[S > 10 ? 10 : S], await m(), await et(l);
306
+ A = h || H[S > 10 ? 10 : S], await y(), await et(l);
307
307
  }, $ = (c) => {
308
308
  const d = new ge();
309
309
  return new ye({
@@ -320,7 +320,7 @@ const ao = (e) => {
320
320
  const p = h === c;
321
321
  d.getVisible() !== p && (d.setVisible(p), e.getLayers().getArray().includes(d) || e.addLayer(d), p || (P = d.getSource()) == null || P.clear());
322
322
  }), l = c;
323
- }, m = async () => {
323
+ }, y = async () => {
324
324
  const c = l;
325
325
  if (!n.has(c)) {
326
326
  const S = $(c);
@@ -336,18 +336,18 @@ const ao = (e) => {
336
336
  }, u = (c, d, h) => {
337
337
  const p = new ze(d), P = n.get(c).getSource(), S = P.getFeatureById(c);
338
338
  if (S)
339
- S.setGeometry(p), S.setId(c), S.setStyle(x(h)), k = S;
339
+ S.setGeometry(p), S.setId(c), S.setStyle(w(h)), k = S;
340
340
  else {
341
341
  const Z = new ae({ geometry: p });
342
- Z.setId(c), Z.set("type", "line"), Z.setStyle(x(h)), P.addFeature(Z), k = Z;
342
+ Z.setId(c), Z.set("type", "line"), Z.setStyle(w(h)), P.addFeature(Z), k = Z;
343
343
  }
344
344
  return k;
345
- }, x = (c) => new Q({
345
+ }, w = (c) => new Q({
346
346
  stroke: new ve({
347
347
  color: c,
348
348
  width: 2
349
349
  })
350
- }), V = (c, d, h) => {
350
+ }), z = (c, d, h) => {
351
351
  try {
352
352
  const p = c == null ? void 0 : c.get("data");
353
353
  if (console.log("trackId-data", p), c && p && d === "hover") {
@@ -645,31 +645,31 @@ const ao = (e) => {
645
645
  })
646
646
  }), Lt = (c, d) => {
647
647
  var N, q;
648
- const h = Number(50 * d), p = ((N = c.frameState) == null ? void 0 : N.time) ?? Date.now(), P = p - M;
649
- if (w = (w + h * P / 1e6) % 2, M = p, w >= 1) {
648
+ const h = Number(50 * d), p = ((N = c.frameState) == null ? void 0 : N.time) ?? Date.now(), P = p - C;
649
+ if (m = (m + h * P / 1e6) % 2, C = p, m >= 1) {
650
650
  Fe();
651
651
  return;
652
652
  }
653
653
  const S = r.getCoordinateAt(
654
- w > 1 ? 2 - w : w
654
+ m > 1 ? 2 - m : m
655
655
  ), Z = r.getCoordinateAt(
656
- w > 1 ? w - 0.01 : w
656
+ m > 1 ? m - 0.01 : m
657
657
  ), O = r.getCoordinateAt(
658
- w > 1 ? 2 - w : w + 0.01
658
+ m > 1 ? 2 - m : m + 0.01
659
659
  ), X = tt(
660
660
  it(Z, "array"),
661
661
  it(O, "array")
662
662
  ) * Math.PI / 180;
663
- (q = Ge.getText()) == null || q.setRotation(X), y.setCoordinates(S);
663
+ (q = Ge.getText()) == null || q.setRotation(X), x.setCoordinates(S);
664
664
  const U = Bt(c);
665
- U.setStyle(Ge), U.drawGeometry(y), e == null || e.render();
665
+ U.setStyle(Ge), U.drawGeometry(x), e == null || e.render();
666
666
  }, Et = () => {
667
667
  var c;
668
- z = !0, M = Date.now(), w = 0, y = ((c = g.getGeometry()) == null ? void 0 : c.clone()) || new ce([0, 0]), o && (b == null || b.on("postrender", o)), E == null || E.setGeometry(void 0);
668
+ V = !0, C = Date.now(), m = 0, x = ((c = g.getGeometry()) == null ? void 0 : c.clone()) || new ce([0, 0]), o && (b == null || b.on("postrender", o)), M == null || M.setGeometry(void 0);
669
669
  }, Fe = () => {
670
- z && (z = !1, E == null || E.setGeometry(void 0), o && b && b.un("postrender", o), b && (e == null || e.removeLayer(b)), b = null, E = null);
670
+ V && (V = !1, M == null || M.setGeometry(void 0), o && b && b.un("postrender", o), b && (e == null || e.removeLayer(b)), b = null, M = null);
671
671
  }, Tt = (c, d) => {
672
- z && Fe(), t = new nt({
672
+ V && Fe(), t = new nt({
673
673
  factor: 1e6
674
674
  }).writeGeometry(new ze(c)), r = new nt({
675
675
  factor: 1e6
@@ -681,13 +681,13 @@ const ao = (e) => {
681
681
  geometry: new ce(r.getFirstCoordinate())
682
682
  });
683
683
  const h = g.getGeometry();
684
- y = h ? h.clone() : new ce([0, 0]), E = new ae({
684
+ x = h ? h.clone() : new ce([0, 0]), M = new ae({
685
685
  type: "geoMarker",
686
686
  style: Ge,
687
- geometry: y
687
+ geometry: x
688
688
  }), b = new ye({
689
689
  source: new ge({
690
- features: [E]
690
+ features: [M]
691
691
  })
692
692
  }), e == null || e.addLayer(b), o = (p) => Lt(p, d), Et();
693
693
  }, tt = (c, d, h) => {
@@ -739,13 +739,13 @@ const ao = (e) => {
739
739
  return U < 0 ? 360 + U : U;
740
740
  };
741
741
  return {
742
- render: C,
742
+ render: L,
743
743
  remove: bt,
744
744
  play: Mt,
745
745
  setCenter: et,
746
746
  close: kt,
747
747
  getLength: pt,
748
- handleTrackMapEvent: V,
748
+ handleTrackMapEvent: z,
749
749
  reRenderTrackLine: j
750
750
  };
751
751
  };
@@ -875,8 +875,8 @@ const go = (e) => {
875
875
  return n <= re.shipModelMax && n >= re.shipTriggleMin ? "ship" : "triangle";
876
876
  }, Ie = (e, n, s) => {
877
877
  if (s === "ship") {
878
- const { len: l, wid: i } = n, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), r = l * t / o, g = i * t / f, y = Math.min(r, g);
879
- return y < 0.2 ? 0.2 : y > 2 ? 2 : y;
878
+ const { len: l, wid: i } = n, o = 97, f = 20, t = 1 / (e == null ? void 0 : e.getView().getResolution()), r = l * t / o, g = i * t / f, x = Math.min(r, g);
879
+ return x < 0.2 ? 0.2 : x > 2 ? 2 : x;
880
880
  }
881
881
  return re.scaleNum;
882
882
  }, fo = (e, n, s) => {
@@ -1007,39 +1007,39 @@ function xo(e, n, s = "left-bottom", l = 2) {
1007
1007
  const o = pe, f = Be;
1008
1008
  if (!f) return "";
1009
1009
  o.width = 0, o.height = 0;
1010
- const v = 2, t = 8, r = 16, g = window.devicePixelRatio || 1, y = "500 12px Arial", E = "14px map-iconfont";
1011
- f.font = y;
1012
- const M = f.measureText(e).width;
1013
- f.font = E;
1014
- const b = n.map((x) => ({ width: f.measureText(he(x)).width, height: 14 })), w = b.reduce((x, V) => x + V.width, 0), k = (n.length - 1) * l, T = t + M + w + k + t, L = v + 14 + v;
1015
- let D, W, A = 0, H = 0, j = 0, F = 0, C = 0, $ = 0;
1010
+ const v = 2, t = 8, r = 16, g = window.devicePixelRatio || 1, x = "500 12px Arial", M = "14px map-iconfont";
1011
+ f.font = x;
1012
+ const C = f.measureText(e).width;
1013
+ f.font = M;
1014
+ const b = n.map((w) => ({ width: f.measureText(he(w)).width, height: 14 })), m = b.reduce((w, z) => w + z.width, 0), k = (n.length - 1) * l, T = t + C + m + k + t, E = v + 14 + v;
1015
+ let D, W, A = 0, H = 0, j = 0, F = 0, L = 0, $ = 0;
1016
1016
  switch (D = r + T, s) {
1017
1017
  case "right-top":
1018
- W = r + L, A = 0, H = r + L, j = r, F = 0, C = r, $ = 0;
1018
+ W = r + E, A = 0, H = r + E, j = r, F = 0, L = r, $ = 0;
1019
1019
  break;
1020
1020
  case "right-middle":
1021
- W = L, A = 0, H = L / 2, j = r, F = L / 2, C = r, $ = 0;
1021
+ W = E, A = 0, H = E / 2, j = r, F = E / 2, L = r, $ = 0;
1022
1022
  break;
1023
1023
  case "right-bottom":
1024
- W = r + L, A = 0, H = 0, j = r, F = r, C = r, $ = r;
1024
+ W = r + E, A = 0, H = 0, j = r, F = r, L = r, $ = r;
1025
1025
  break;
1026
1026
  case "left-top":
1027
- W = r + L, A = T, H = r, j = T + r, F = L + r, C = 0, $ = 0;
1027
+ W = r + E, A = T, H = r, j = T + r, F = E + r, L = 0, $ = 0;
1028
1028
  break;
1029
1029
  case "left-middle":
1030
- W = L, A = T, H = L / 2, j = T + r, F = L / 2, C = 0, $ = 0;
1030
+ W = E, A = T, H = E / 2, j = T + r, F = E / 2, L = 0, $ = 0;
1031
1031
  break;
1032
1032
  case "left-bottom":
1033
- W = r + L, A = T, H = L, j = T + r, F = 0, C = 0, $ = r;
1033
+ W = r + E, A = T, H = E, j = T + r, F = 0, L = 0, $ = r;
1034
1034
  break;
1035
1035
  }
1036
- W = W + v, o.width = Math.round(D * g), o.height = Math.round(W * g), f.scale(g, g), f.clearRect(0, 0, D, W), f.beginPath(), f.moveTo(A, H), f.lineTo(j, F), f.strokeStyle = "#FFF", f.lineWidth = 1, f.stroke(), f.fillStyle = "#FFF", f.fillRect(C, $, T, L), f.font = y, f.textBaseline = "middle";
1037
- const a = $ + v + L / 2;
1038
- f.strokeStyle = "#ffffff", f.lineWidth = 1, f.strokeText(e, C + t, a), f.fillStyle = "#000000", f.fillText(e, C + t, a), f.font = E, f.fillStyle = "#3370ff";
1039
- let m = C + t + M + l;
1040
- n.length > 0 && n.forEach((x, V) => {
1041
- const G = $ + v + L / 2;
1042
- f.fillText(he(x), m, G), m += b[V].width + l;
1036
+ W = W + v, o.width = Math.round(D * g), o.height = Math.round(W * g), f.scale(g, g), f.clearRect(0, 0, D, W), f.beginPath(), f.moveTo(A, H), f.lineTo(j, F), f.strokeStyle = "#FFF", f.lineWidth = 1, f.stroke(), f.fillStyle = "#FFF", f.fillRect(L, $, T, E), f.font = x, f.textBaseline = "middle";
1037
+ const a = $ + v + E / 2;
1038
+ f.strokeStyle = "#ffffff", f.lineWidth = 1, f.strokeText(e, L + t, a), f.fillStyle = "#000000", f.fillText(e, L + t, a), f.font = M, f.fillStyle = "#3370ff";
1039
+ let y = L + t + C + l;
1040
+ n.length > 0 && n.forEach((w, z) => {
1041
+ const G = $ + v + E / 2;
1042
+ f.fillText(he(w), y, G), y += b[z].width + l;
1043
1043
  });
1044
1044
  const u = o.toDataURL("image/png");
1045
1045
  return Ye.set(i, u), u;
@@ -1100,23 +1100,23 @@ const at = (e, n) => {
1100
1100
  });
1101
1101
  e == null || e.addLayer(i), e == null || e.addLayer(f);
1102
1102
  let v = null, t = "", r = {}, g = {};
1103
- const y = (a) => {
1103
+ const x = (a) => {
1104
1104
  if (!a || !e) return;
1105
- const m = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id"));
1105
+ const y = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id"));
1106
1106
  if (s) {
1107
- const u = a.filter((x) => x.id === m);
1107
+ const u = a.filter((w) => w.id === y);
1108
1108
  u.length === 0 ? a.push(s) : s = u[0];
1109
1109
  }
1110
- w(), $(a), z(), D();
1111
- }, E = (a) => {
1110
+ m(), $(a), V(), D();
1111
+ }, M = (a) => {
1112
1112
  var R;
1113
- const m = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id")), u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), x = ((R = g[a.id]) == null ? void 0 : R.blinkColors) || [], G = x[x.length - 1] || a.fill || "#04C900", B = go(a), J = new ae({
1113
+ const y = (s == null ? void 0 : s.id) || (n == null ? void 0 : n.get("id")), u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), w = ((R = g[a.id]) == null ? void 0 : R.blinkColors) || [], G = w[w.length - 1] || a.fill || "#04C900", B = go(a), J = new ae({
1114
1114
  geometry: new ce(u),
1115
1115
  // 船舶数据
1116
1116
  shipData: a,
1117
1117
  id: a.id,
1118
1118
  name: a.cnname || a.enname || a.name || a.id || "未命名船舶",
1119
- selected: a.id === m,
1119
+ selected: a.id === y,
1120
1120
  // 图标
1121
1121
  rightIcons: ct(a),
1122
1122
  // 船舶颜色
@@ -1127,90 +1127,90 @@ const at = (e, n) => {
1127
1127
  isHighlight: !1
1128
1128
  });
1129
1129
  return J.set("clickGeometry", new Ht(u)), J;
1130
- }, z = async () => {
1130
+ }, V = async () => {
1131
1131
  if (!s || !e) return;
1132
- let m = e.getOverlays().getArray().find((u) => u.get("class") == "ship-overlay-selected");
1133
- if (m) {
1132
+ let y = e.getOverlays().getArray().find((u) => u.get("class") == "ship-overlay-selected");
1133
+ if (y) {
1134
1134
  const u = vt(e, s);
1135
- await m.setElement(u), await m.setPosition(ee([s.lon, s.lat]));
1135
+ await y.setElement(u), await y.setPosition(ee([s.lon, s.lat]));
1136
1136
  } else
1137
- m = ho(e, s), m && e.addOverlay(m);
1137
+ y = ho(e, s), y && e.addOverlay(y);
1138
1138
  setTimeout(() => {
1139
1139
  var u;
1140
- m && ((u = m.get("element")) != null && u.parentElement) && (m.get("element").parentElement.style.display = "block");
1140
+ y && ((u = y.get("element")) != null && u.parentElement) && (y.get("element").parentElement.style.display = "block");
1141
1141
  }, 20);
1142
- }, M = (a) => {
1142
+ }, C = (a) => {
1143
1143
  if (a === "start") {
1144
- const m = () => {
1144
+ const y = () => {
1145
1145
  l.getFeatures().forEach((u) => {
1146
1146
  u.setStyle(me(e, u));
1147
- }), v = requestAnimationFrame(m);
1147
+ }), v = requestAnimationFrame(y);
1148
1148
  };
1149
- m();
1149
+ y();
1150
1150
  }
1151
1151
  a === "end" && v && (cancelAnimationFrame(v), v = null);
1152
1152
  }, b = () => {
1153
- const m = (e == null ? void 0 : e.getOverlays().getArray()).find((u) => u.get("class") == "ship-overlay-selected");
1154
- if (m) {
1155
- const u = m.getElement(), x = Ie(e, s, "ship"), V = u.querySelector("svg");
1156
- console.log(V), V && (V.style.transform = `scale(${x})`);
1153
+ const y = (e == null ? void 0 : e.getOverlays().getArray()).find((u) => u.get("class") == "ship-overlay-selected");
1154
+ if (y) {
1155
+ const u = y.getElement(), w = Ie(e, s, "ship"), z = u.querySelector("svg");
1156
+ console.log(z), z && (z.style.transform = `scale(${w})`);
1157
1157
  }
1158
- }, w = () => {
1159
- e && l && (k(), l.clear(), o.clear(), M("end"));
1158
+ }, m = () => {
1159
+ e && l && (k(), l.clear(), o.clear(), C("end"));
1160
1160
  }, k = (a) => {
1161
- const m = e.getOverlays().getArray().filter((u) => u.get("class") == "zh-map-ship-overlay");
1162
- if (m && m.length > 0) {
1163
- for (let u = 0; u < m.length; u++)
1164
- if (m[u].get("class") !== "ship-overlay-selected") {
1165
- const x = m[u];
1166
- console.log("overlay---", x), x.setPosition(void 0), e.removeOverlay(x), x.dispose();
1161
+ const y = e.getOverlays().getArray().filter((u) => u.get("class") == "zh-map-ship-overlay");
1162
+ if (y && y.length > 0) {
1163
+ for (let u = 0; u < y.length; u++)
1164
+ if (y[u].get("class") !== "ship-overlay-selected") {
1165
+ const w = y[u];
1166
+ console.log("overlay---", w), w.setPosition(void 0), e.removeOverlay(w), w.dispose();
1167
1167
  }
1168
1168
  }
1169
- }, T = (a, m) => {
1170
- r = a, g = m;
1171
- const u = e.getOverlays().getArray(), x = l.getFeatures();
1172
- for (const V in r) {
1173
- const G = r[V], B = u.find((R) => R.getId() === "label-" + V), J = x.find((R) => V === R.get("id"));
1169
+ }, T = (a, y) => {
1170
+ r = a, g = y;
1171
+ const u = e.getOverlays().getArray(), w = l.getFeatures();
1172
+ for (const z in r) {
1173
+ const G = r[z], B = u.find((R) => R.getId() === "label-" + z), J = w.find((R) => z === R.get("id"));
1174
1174
  if (B && J) {
1175
- const R = m[V].blinkColors || [], { shipData: ue, name: le, color: se } = J.getProperties();
1175
+ const R = y[z].blinkColors || [], { shipData: ue, name: le, color: se } = J.getProperties();
1176
1176
  J.set("blinking", G), R[(R == null ? void 0 : R.length) - 1] && se !== R[(R == null ? void 0 : R.length) - 1] && (J.set("color", R[(R == null ? void 0 : R.length) - 1] || ""), J.setStyle(me(e, J)));
1177
1177
  const Ae = {
1178
1178
  ...ue,
1179
1179
  blinking: G,
1180
1180
  blinkingColors: R || [],
1181
- name: le + "(" + m[V].shipState + ")"
1181
+ name: le + "(" + y[z].shipState + ")"
1182
1182
  }, Ee = B.getElement(), Te = yt(Ae);
1183
1183
  Ee && Ee !== Te && B.setElement(Te);
1184
1184
  }
1185
1185
  }
1186
- }, L = () => {
1186
+ }, E = () => {
1187
1187
  const a = e.getOverlays().getArray();
1188
1188
  if (r)
1189
- for (const m in r) {
1190
- const u = a.find((x) => x.getId() === "label-" + m);
1189
+ for (const y in r) {
1190
+ const u = a.find((w) => w.getId() === "label-" + y);
1191
1191
  if (u) {
1192
- const x = u.getElement();
1193
- x && (x.style.opacity = 0);
1192
+ const w = u.getElement();
1193
+ w && (w.style.opacity = 0);
1194
1194
  }
1195
1195
  }
1196
1196
  }, D = () => {
1197
1197
  const a = e.getOverlays().getArray();
1198
1198
  if (r)
1199
- for (const m in r) {
1200
- const u = a.find((x) => x.getId() === "label-" + m);
1199
+ for (const y in r) {
1200
+ const u = a.find((w) => w.getId() === "label-" + y);
1201
1201
  if (u) {
1202
- const x = u.getElement();
1203
- x && (x.style.opacity = 1);
1202
+ const w = u.getElement();
1203
+ w && (w.style.opacity = 1);
1204
1204
  }
1205
1205
  }
1206
1206
  }, W = (a) => {
1207
1207
  if (!e) return;
1208
- const m = l.getFeatures(), u = o.getFeatures(), x = n ? n.get("id") : "", V = m.filter((R) => R.get("id") !== x), G = u == null ? void 0 : u.filter((R) => R.get("id") !== x), B = /* @__PURE__ */ new Map();
1208
+ const y = l.getFeatures(), u = o.getFeatures(), w = n ? n.get("id") : "", z = y.filter((R) => R.get("id") !== w), G = u == null ? void 0 : u.filter((R) => R.get("id") !== w), B = /* @__PURE__ */ new Map();
1209
1209
  a.forEach((R) => {
1210
1210
  B.set(R.id, !0);
1211
1211
  });
1212
1212
  const J = e.getOverlays().getArray();
1213
- V.forEach((R) => {
1213
+ z.forEach((R) => {
1214
1214
  const ue = R.get("id");
1215
1215
  if (!B.has(ue))
1216
1216
  R.setStyle([]);
@@ -1232,36 +1232,36 @@ const at = (e, n) => {
1232
1232
  }, A = (a) => {
1233
1233
  if (a) {
1234
1234
  console.log("选中", a);
1235
- const m = l.getFeatures().find((x) => x.get("id") === a.id), u = o.getFeatures().find((x) => x.get("id") === a.id);
1236
- m && (n = m), u && u.set("selected", !0), s = a, z();
1235
+ const y = l.getFeatures().find((w) => w.get("id") === a.id), u = o.getFeatures().find((w) => w.get("id") === a.id);
1236
+ y && (n = y), u && u.set("selected", !0), s = a, V();
1237
1237
  } else
1238
1238
  console.log("取消选中"), s = null, n = null, F();
1239
- }, H = Re((a, m, u) => {
1239
+ }, H = Re((a, y, u) => {
1240
1240
  try {
1241
1241
  if (a) {
1242
- const x = a.get("shipData"), V = a.get("id");
1243
- if (e.getTargetElement().style.cursor = V ? "pointer" : "", m === "click" && (A(x), u && u(V)), m === "hover") {
1244
- t && t !== V && j(), t = V;
1242
+ const w = a.get("shipData"), z = a.get("id");
1243
+ if (e.getTargetElement().style.cursor = z ? "pointer" : "", y === "click" && (A(w), u && u(z)), y === "hover") {
1244
+ t && t !== z && j(), t = z;
1245
1245
  const G = l.getFeatures().find((B) => B.get("id") === t);
1246
1246
  G == null || G.set("isHighlight", !0), G == null || G.setStyle(me(e, G));
1247
1247
  }
1248
1248
  } else
1249
1249
  e.getTargetElement().style.cursor = "", j();
1250
- } catch (x) {
1251
- console.log("handleShipMapEvent", x);
1250
+ } catch (w) {
1251
+ console.log("handleShipMapEvent", w);
1252
1252
  }
1253
1253
  }, 10), j = () => {
1254
- const a = t ? l.getFeatures().find((m) => m.get("id") === t) : null;
1254
+ const a = t ? l.getFeatures().find((y) => y.get("id") === t) : null;
1255
1255
  t = null, a == null || a.set("isHighlight", !1), a == null || a.setStyle(me(e, a));
1256
1256
  }, F = () => {
1257
1257
  try {
1258
- const m = e.getOverlays().getArray().find((u) => u.get("class") == "ship-overlay-selected");
1259
- m && m.setPosition(void 0);
1258
+ const y = e.getOverlays().getArray().find((u) => u.get("class") == "ship-overlay-selected");
1259
+ y && y.setPosition(void 0);
1260
1260
  } catch (a) {
1261
1261
  console.log(a);
1262
1262
  }
1263
- }, C = (a, m) => {
1264
- const u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), x = new ae({
1263
+ }, L = (a, y) => {
1264
+ const u = ee([a == null ? void 0 : a.lon, a == null ? void 0 : a.lat]), w = new ae({
1265
1265
  geometry: new ce(u),
1266
1266
  name: a.cnname || a.enname || a.name || a.id || "未命名船舶",
1267
1267
  // 图标
@@ -1269,17 +1269,17 @@ const at = (e, n) => {
1269
1269
  selected: (a == null ? void 0 : a.id) === (s == null ? void 0 : s.id),
1270
1270
  shipData: a
1271
1271
  });
1272
- x.set("id", a.id);
1273
- const V = at(x, m);
1274
- return x.setStyle(V), x;
1272
+ w.set("id", a.id);
1273
+ const z = at(w, y);
1274
+ return w.setStyle(z), w;
1275
1275
  }, $ = (a) => {
1276
- const m = e.getView().getZoom();
1276
+ const y = e.getView().getZoom();
1277
1277
  a.forEach((u) => {
1278
- const x = E(u);
1279
- if (x.setStyle(me(e, x)), l.addFeature(x), (s == null ? void 0 : s.id) == u.id || m >= re.shipModelMin)
1278
+ const w = M(u);
1279
+ if (w.setStyle(me(e, w)), l.addFeature(w), (s == null ? void 0 : s.id) == u.id || y >= re.shipModelMin)
1280
1280
  if (r[u.id]) {
1281
1281
  if (u.id && g[u == null ? void 0 : u.id]) {
1282
- const V = g[u == null ? void 0 : u.id] || {}, G = (V == null ? void 0 : V.blinkColors) || [], B = (V == null ? void 0 : V.shipState) || "", J = (u.cnname || u.enname || u.name || u.id || "未命名船舶") + "(" + B + ")", R = {
1282
+ const z = g[u == null ? void 0 : u.id] || {}, G = (z == null ? void 0 : z.blinkColors) || [], B = (z == null ? void 0 : z.shipState) || "", J = (u.cnname || u.enname || u.name || u.id || "未命名船舶") + "(" + B + ")", R = {
1283
1283
  ...u,
1284
1284
  name: J,
1285
1285
  blinking: r[u.id],
@@ -1288,21 +1288,21 @@ const at = (e, n) => {
1288
1288
  yo(e, R);
1289
1289
  }
1290
1290
  } else {
1291
- const V = C(u, a.length);
1292
- o.addFeature(V);
1291
+ const z = L(u, a.length);
1292
+ o.addFeature(z);
1293
1293
  }
1294
1294
  });
1295
1295
  };
1296
1296
  return {
1297
- render: y,
1297
+ render: x,
1298
1298
  selected: A,
1299
1299
  filter: W,
1300
1300
  blinking: T,
1301
- clear: w,
1301
+ clear: m,
1302
1302
  handleShipMapEvent: H,
1303
- changeShipScale: M,
1303
+ changeShipScale: C,
1304
1304
  changeSelectedScale: b,
1305
- hiddenShipBlink: L,
1305
+ hiddenShipBlink: E,
1306
1306
  showShipBlink: D
1307
1307
  };
1308
1308
  }, ko = (e) => {
@@ -1320,17 +1320,17 @@ const at = (e, n) => {
1320
1320
  if (t !== o.value) {
1321
1321
  if (t) {
1322
1322
  const r = n();
1323
- if (!r.getArray().find((y) => y.className_ === "greenTile")) {
1324
- const y = new we({
1323
+ if (!r.getArray().find((x) => x.className_ === "greenTile")) {
1324
+ const x = new we({
1325
1325
  source: new xe({ url: fe.greenTile }),
1326
1326
  visible: t,
1327
1327
  zIndex: 2,
1328
1328
  className: "greenTile"
1329
1329
  });
1330
- r.push(y);
1330
+ r.push(x);
1331
1331
  }
1332
1332
  } else {
1333
- const r = n(), g = r.getArray().find((y) => y.className_ === "greenTile");
1333
+ const r = n(), g = r.getArray().find((x) => x.className_ === "greenTile");
1334
1334
  g && r.remove(g);
1335
1335
  }
1336
1336
  o.value = t;
@@ -1350,13 +1350,13 @@ const at = (e, n) => {
1350
1350
  }, Mo = (e) => {
1351
1351
  const n = "zh-map-location-layer";
1352
1352
  let s, l, i = null, o = null;
1353
- const f = (M) => {
1354
- if (!(!M || M.length === 0)) {
1353
+ const f = (C) => {
1354
+ if (!(!C || C.length === 0)) {
1355
1355
  if (l || (l = new ge()), l.clear(), o) {
1356
- const b = M.find((w) => w.id === o.id);
1357
- b ? o = b : M.push(o);
1356
+ const b = C.find((m) => m.id === o.id);
1357
+ b ? o = b : C.push(o);
1358
1358
  }
1359
- M.forEach((b) => {
1359
+ C.forEach((b) => {
1360
1360
  v(b);
1361
1361
  }), s || (s = new ye({
1362
1362
  className: n,
@@ -1364,20 +1364,20 @@ const at = (e, n) => {
1364
1364
  zIndex: 100
1365
1365
  }), e == null || e.addLayer(s));
1366
1366
  }
1367
- }, v = (M) => {
1368
- const b = e == null ? void 0 : e.getView().getZoom(), [w, k] = M.latLon.split(","), T = new ae({
1369
- geometry: new ce(ee([Number(w), Number(k)]))
1367
+ }, v = (C) => {
1368
+ const b = e == null ? void 0 : e.getView().getZoom(), [m, k] = C.latLon.split(","), T = new ae({
1369
+ geometry: new ce(ee([Number(m), Number(k)]))
1370
1370
  });
1371
- T.setStyle(t(M, b, M.id === (o == null ? void 0 : o.id))), T.set("loactionData", M), l.addFeature(T);
1372
- }, t = (M, b, w) => {
1371
+ T.setStyle(t(C, b, C.id === (o == null ? void 0 : o.id))), T.set("loactionData", C), l.addFeature(T);
1372
+ }, t = (C, b, m) => {
1373
1373
  const k = {
1374
1374
  image: new Ce({
1375
- src: w && M.selectedPath || M.defaultPath,
1375
+ src: m && C.selectedPath || C.defaultPath,
1376
1376
  scale: 0.5 * b / 10
1377
1377
  })
1378
1378
  };
1379
- return M.name && (k.text = new be({
1380
- text: M.name,
1379
+ return C.name && (k.text = new be({
1380
+ text: C.name,
1381
1381
  font: "12px sans-serif",
1382
1382
  fill: new te({
1383
1383
  color: "#000000"
@@ -1389,33 +1389,33 @@ const at = (e, n) => {
1389
1389
  })), new Q(k);
1390
1390
  }, r = () => {
1391
1391
  if (i) {
1392
- const M = i.get("loactionData").id;
1392
+ const C = i.get("loactionData").id;
1393
1393
  l.getFeatures().forEach((b) => {
1394
- b.get("loactionData").id !== M && l.removeFeature(b);
1394
+ b.get("loactionData").id !== C && l.removeFeature(b);
1395
1395
  });
1396
1396
  } else
1397
1397
  l.clear();
1398
1398
  }, g = () => {
1399
1399
  var k;
1400
- const M = i.get("loactionData"), b = (k = e == null ? void 0 : e.getView()) == null ? void 0 : k.getZoom();
1400
+ const C = i.get("loactionData"), b = (k = e == null ? void 0 : e.getView()) == null ? void 0 : k.getZoom();
1401
1401
  l.getFeatures().forEach((T) => {
1402
- T.get("loactionData").id === M.id && (T == null || T.setStyle(t(M, b, !1)));
1402
+ T.get("loactionData").id === C.id && (T == null || T.setStyle(t(C, b, !1)));
1403
1403
  }), o = null, i = null;
1404
- }, y = (M) => {
1405
- M ? (E(), z(M)) : clearSelectedPort();
1406
- }, E = () => {
1407
- var M;
1404
+ }, x = (C) => {
1405
+ C ? (M(), V(C)) : clearSelectedPort();
1406
+ }, M = () => {
1407
+ var C;
1408
1408
  if (i) {
1409
- const b = i.get("loactionData"), w = (M = e == null ? void 0 : e.getView()) == null ? void 0 : M.getZoom();
1410
- i.setStyle(t(b, w, !1));
1409
+ const b = i.get("loactionData"), m = (C = e == null ? void 0 : e.getView()) == null ? void 0 : C.getZoom();
1410
+ i.setStyle(t(b, m, !1));
1411
1411
  }
1412
- }, z = (M) => {
1412
+ }, V = (C) => {
1413
1413
  const b = l.getFeatures();
1414
- o = M, i = b.find((w) => w.get("loactionData").id === M.id);
1414
+ o = C, i = b.find((m) => m.get("loactionData").id === C.id);
1415
1415
  };
1416
1416
  return {
1417
1417
  render: f,
1418
- selected: y,
1418
+ selected: x,
1419
1419
  clearSelected: g,
1420
1420
  clear: r
1421
1421
  };
@@ -1436,7 +1436,7 @@ const at = (e, n) => {
1436
1436
  };
1437
1437
  let o;
1438
1438
  const f = oe(!1), v = () => {
1439
- Le(e, "crosshair"), g(), Co(e), e.on("pointermove", z), e.getViewport().addEventListener("mouseout", () => {
1439
+ Le(e, "crosshair"), g(), Co(e), e.on("pointermove", V), e.getViewport().addEventListener("mouseout", () => {
1440
1440
  o && o.classList.add("hidden");
1441
1441
  }), b(), f.value = !0;
1442
1442
  };
@@ -1454,16 +1454,16 @@ const at = (e, n) => {
1454
1454
  }
1455
1455
  }), e == null || e.addLayer(r);
1456
1456
  };
1457
- let y, E;
1458
- const z = (F) => {
1457
+ let x, M;
1458
+ const V = (F) => {
1459
1459
  if (F.dragging)
1460
1460
  return;
1461
- let C = "点击选择起点";
1462
- y && (C = "单击继续,双击结束"), o && (o.innerHTML = C, E.setPosition(F.coordinate), o.classList.remove("hidden"));
1461
+ let L = "点击选择起点";
1462
+ x && (L = "单击继续,双击结束"), o && (o.innerHTML = L, M.setPosition(F.coordinate), o.classList.remove("hidden"));
1463
1463
  };
1464
- let M;
1464
+ let C;
1465
1465
  const b = () => {
1466
- M = new Oe({
1466
+ C = new Oe({
1467
1467
  source: t,
1468
1468
  type: "LineString",
1469
1469
  style: new Q({
@@ -1486,33 +1486,33 @@ const at = (e, n) => {
1486
1486
  })
1487
1487
  }),
1488
1488
  // 添加条件函数,判断是否应该出发点绘制
1489
- condition: (C) => C.originalEvent.target.tagName !== "DIV"
1490
- }), e == null || e.addInteraction(M), L(), D();
1489
+ condition: (L) => L.originalEvent.target.tagName !== "DIV"
1490
+ }), e == null || e.addInteraction(C), E(), D();
1491
1491
  let F;
1492
- M.on("drawstart", function(C) {
1492
+ C.on("drawstart", function(L) {
1493
1493
  var a;
1494
- y = C.feature, y.set("randomId", w());
1494
+ x = L.feature, x.set("randomId", m());
1495
1495
  let $;
1496
- F = (a = y.getGeometry()) == null ? void 0 : a.on("change", function(m) {
1497
- const u = m.target, x = mt(u, l.value);
1498
- $ = u.getLastCoordinate(), k && x && (k.innerHTML = x), T.setPosition($);
1496
+ F = (a = x.getGeometry()) == null ? void 0 : a.on("change", function(y) {
1497
+ const u = y.target, w = mt(u, l.value);
1498
+ $ = u.getLastCoordinate(), k && w && (k.innerHTML = w), T.setPosition($);
1499
1499
  });
1500
- }), M.on("drawend", function() {
1501
- var C, $, a;
1500
+ }), C.on("drawend", function() {
1501
+ var L, $, a;
1502
1502
  if (k && (k.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), k != null && k.innerHTML) {
1503
- const m = (y == null ? void 0 : y.get("randomId")) || w();
1504
- s.value.push({ id: m, value: k == null ? void 0 : k.innerHTML }), k.innerHTML = `${k.innerHTML}<div class="ol-tooltip-delete-button" data-id="${m}"><i class="map-iconfont icon-delete"></i></div>`;
1503
+ const y = (x == null ? void 0 : x.get("randomId")) || m();
1504
+ s.value.push({ id: y, value: k == null ? void 0 : k.innerHTML }), k.innerHTML = `${k.innerHTML}<div class="ol-tooltip-delete-button" data-id="${y}"><i class="map-iconfont icon-delete"></i></div>`;
1505
1505
  }
1506
- (C = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || C.addEventListener("click", (m) => {
1507
- var x;
1508
- m.preventDefault(), m.stopPropagation();
1509
- const u = (x = m.target) == null ? void 0 : x.getAttribute("data-id");
1506
+ (L = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || L.addEventListener("click", (y) => {
1507
+ var w;
1508
+ y.preventDefault(), y.stopPropagation();
1509
+ const u = (w = y.target) == null ? void 0 : w.getAttribute("data-id");
1510
1510
  u && A(u);
1511
- }), T.setOffset([0, -7]), y = null, k = null, L(), F && Xe(F), (a = ($ = n.getProps()) == null ? void 0 : $.lineDrawEnd) == null || a.call($, s.value);
1511
+ }), T.setOffset([0, -7]), x = null, k = null, E(), F && Xe(F), (a = ($ = n.getProps()) == null ? void 0 : $.lineDrawEnd) == null || a.call($, s.value);
1512
1512
  });
1513
- }, w = () => Math.random().toString(36).substring(2, 9);
1513
+ }, m = () => Math.random().toString(36).substring(2, 9);
1514
1514
  let k, T;
1515
- const L = () => {
1515
+ const E = () => {
1516
1516
  k != null && k.parentNode && k.parentNode.removeChild(k), k = document.createElement("div"), k.className = "ol-tooltip ol-tooltip-measure", T = new de({
1517
1517
  element: k,
1518
1518
  offset: [0, -15],
@@ -1521,36 +1521,36 @@ const at = (e, n) => {
1521
1521
  insertFirst: !1
1522
1522
  }), e == null || e.addOverlay(T);
1523
1523
  }, D = () => {
1524
- o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", E = new de({
1524
+ o != null && o.parentNode && o.parentNode.removeChild(o), o = document.createElement("div"), o.className = "ol-tooltip hidden", M = new de({
1525
1525
  element: o,
1526
1526
  offset: [15, 0],
1527
1527
  positioning: "center-left"
1528
- }), e == null || e.addOverlay(E);
1528
+ }), e == null || e.addOverlay(M);
1529
1529
  }, W = () => {
1530
- s.value.forEach((F, C) => {
1531
- var m, u;
1530
+ s.value.forEach((F, L) => {
1531
+ var y, u;
1532
1532
  const $ = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
1533
- $[C] && ((u = (m = $[C]) == null ? void 0 : m.parentNode) == null || u.removeChild($[C]));
1533
+ $[L] && ((u = (y = $[L]) == null ? void 0 : y.parentNode) == null || u.removeChild($[L]));
1534
1534
  const a = t.getFeatures();
1535
- a[C] && t.removeFeature(a[C]);
1535
+ a[L] && t.removeFeature(a[L]);
1536
1536
  }), H(), Lo(e), f.value = !1, Le(e, "pointer");
1537
1537
  }, A = (F) => {
1538
- var $, a, m, u;
1539
- const C = s.value.findIndex((x) => x.id === F);
1540
- if (C !== -1) {
1541
- s.value.splice(C, 1);
1542
- const x = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
1543
- x[C] && ((a = ($ = x[C]) == null ? void 0 : $.parentNode) == null || a.removeChild(x[C]));
1544
- const V = t.getFeatures();
1545
- V[C] && t.removeFeature(V[C]);
1538
+ var $, a, y, u;
1539
+ const L = s.value.findIndex((w) => w.id === F);
1540
+ if (L !== -1) {
1541
+ s.value.splice(L, 1);
1542
+ const w = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
1543
+ w[L] && ((a = ($ = w[L]) == null ? void 0 : $.parentNode) == null || a.removeChild(w[L]));
1544
+ const z = t.getFeatures();
1545
+ z[L] && t.removeFeature(z[L]);
1546
1546
  }
1547
- (u = (m = n.getProps()) == null ? void 0 : m.lineDrawEnd) == null || u.call(m, s.value);
1547
+ (u = (y = n.getProps()) == null ? void 0 : y.lineDrawEnd) == null || u.call(y, s.value);
1548
1548
  }, H = () => {
1549
1549
  if (s.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((F) => {
1550
- var C;
1551
- (C = F == null ? void 0 : F.parentNode) == null || C.removeChild(F);
1552
- }), t == null || t.clear(), M) {
1553
- const F = e.getInteractions().getArray().find((C) => lt(C) === lt(M));
1550
+ var L;
1551
+ (L = F == null ? void 0 : F.parentNode) == null || L.removeChild(F);
1552
+ }), t == null || t.clear(), C) {
1553
+ const F = e.getInteractions().getArray().find((L) => lt(L) === lt(C));
1554
1554
  F && e.removeInteraction(F);
1555
1555
  }
1556
1556
  e.removeLayer(r), o != null && o.parentNode && o.parentNode.removeChild(o), k != null && k.parentNode && k.parentNode.removeChild(k);
@@ -1582,12 +1582,12 @@ const at = (e, n) => {
1582
1582
  const o = () => {
1583
1583
  H(), i = "open", f(), Le(e, "crosshair");
1584
1584
  }, f = () => {
1585
- r(), T(), W(), M();
1585
+ r(), T(), W(), C();
1586
1586
  };
1587
1587
  let v = null, t = null;
1588
1588
  const r = () => {
1589
1589
  if (v && t) return;
1590
- const F = new ge(), C = new ye({
1590
+ const F = new ge(), L = new ye({
1591
1591
  source: F,
1592
1592
  style: new Q({
1593
1593
  stroke: new ve({
@@ -1597,26 +1597,26 @@ const at = (e, n) => {
1597
1597
  }),
1598
1598
  zIndex: 1e3
1599
1599
  });
1600
- v = C, t = F, e.on("pointermove", y), e.addLayer(C), e.on(["dblclick"], function($) {
1601
- E && ($.stopPropagation(), $.preventDefault());
1600
+ v = L, t = F, e.on("pointermove", x), e.addLayer(L), e.on(["dblclick"], function($) {
1601
+ M && ($.stopPropagation(), $.preventDefault());
1602
1602
  });
1603
1603
  };
1604
1604
  let g;
1605
- const y = (F) => {
1605
+ const x = (F) => {
1606
1606
  if (F.dragging) return;
1607
- const C = g ? "单击继续,双击结束" : "点击选择起点";
1608
- L && (L.innerHTML = C, D.setPosition(F.coordinate));
1607
+ const L = g ? "单击继续,双击结束" : "点击选择起点";
1608
+ E && (E.innerHTML = L, D.setPosition(F.coordinate));
1609
1609
  };
1610
- let E, z = !1;
1611
- const M = () => {
1610
+ let M, V = !1;
1611
+ const C = () => {
1612
1612
  if (s) {
1613
- L != null && L.parentNode && L.parentNode.removeChild(L);
1613
+ E != null && E.parentNode && E.parentNode.removeChild(E);
1614
1614
  const F = s.getGeometry();
1615
1615
  if (!F) return;
1616
- const C = b(F, "nm");
1617
- w && (w.innerHTML = `
1618
- <span class="text">面积:${C}${z ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1619
- `), w && (w.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
1616
+ const L = b(F, "nm");
1617
+ m && (m.innerHTML = `
1618
+ <span class="text">面积:${L}${V ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
1619
+ `), m && (m.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
1620
1620
  const $ = F.getCoordinates(), a = $[0][$[0].length - 2];
1621
1621
  if (k.setPosition(a), v) {
1622
1622
  const u = v.getSource();
@@ -1625,15 +1625,15 @@ const at = (e, n) => {
1625
1625
  setTimeout(() => {
1626
1626
  var u;
1627
1627
  (u = document.querySelector(".delete-icon")) == null || u.addEventListener("click", () => {
1628
- var x, V;
1629
- console.log("delete"), A(), (V = (x = n.getProps()) == null ? void 0 : x.areaDrawEnd) == null || V.call(x, []);
1628
+ var w, z;
1629
+ console.log("delete"), A(), (z = (w = n.getProps()) == null ? void 0 : w.areaDrawEnd) == null || z.call(w, []);
1630
1630
  });
1631
1631
  }, 0);
1632
- const m = jt(s.getGeometry().getExtent());
1633
- e == null || e.getView().setCenter(m);
1632
+ const y = jt(s.getGeometry().getExtent());
1633
+ e == null || e.getView().setCenter(y);
1634
1634
  return;
1635
1635
  }
1636
- E = new Oe({
1636
+ M = new Oe({
1637
1637
  type: "Polygon",
1638
1638
  source: t,
1639
1639
  trace: !0,
@@ -1654,28 +1654,28 @@ const at = (e, n) => {
1654
1654
  })
1655
1655
  }),
1656
1656
  geometry: function(F) {
1657
- const C = F.getGeometry().getCoordinates();
1658
- return new Qt(C);
1657
+ const L = F.getGeometry().getCoordinates();
1658
+ return new Qt(L);
1659
1659
  }
1660
1660
  })]
1661
- }), e == null || e.addInteraction(E), E.on("drawstart", (F) => {
1662
- var C;
1663
- g = F.feature, l = (C = g.getGeometry()) == null ? void 0 : C.on("change", ($) => {
1664
- const a = $.target, m = b(a, "nm"), x = a.getCoordinates()[0], V = new ze([x[x.length - 2], x[x.length - 1]]), G = mt(V, "nm");
1665
- if (z = Number(Ke(V) / 1e3) > 150, !m) return;
1661
+ }), e == null || e.addInteraction(M), M.on("drawstart", (F) => {
1662
+ var L;
1663
+ g = F.feature, l = (L = g.getGeometry()) == null ? void 0 : L.on("change", ($) => {
1664
+ const a = $.target, y = b(a, "nm"), w = a.getCoordinates()[0], z = new ze([w[w.length - 2], w[w.length - 1]]), G = mt(z, "nm");
1665
+ if (V = Number(Ke(z) / 1e3) > 150, !y) return;
1666
1666
  const B = '<span class="error pl-4">超出可以绘画的距离</span>';
1667
- w && (w.innerHTML = `
1667
+ m && (m.innerHTML = `
1668
1668
  <div class="text">
1669
- 面积:${m}
1670
- ${z ? B : ""}
1669
+ 面积:${y}
1670
+ ${V ? B : ""}
1671
1671
  </div>
1672
- `), L && (L.innerHTML = `
1672
+ `), E && (E.innerHTML = `
1673
1673
  <div class="text">
1674
- 面积:${m}
1674
+ 面积:${y}
1675
1675
  </div>
1676
- <div class="text ${z ? "error" : ""}">
1677
- 线段 ${x.length - 2}: ${G}
1678
- ${z ? B : ""}
1676
+ <div class="text ${V ? "error" : ""}">
1677
+ 线段 ${w.length - 2}: ${G}
1678
+ ${V ? B : ""}
1679
1679
 
1680
1680
  </div>
1681
1681
  <div>
@@ -1683,54 +1683,54 @@ const at = (e, n) => {
1683
1683
  </div>
1684
1684
  `);
1685
1685
  });
1686
- }), E.on("drawend", (F) => {
1687
- var m, u, x, V;
1686
+ }), M.on("drawend", (F) => {
1687
+ var y, u, w, z;
1688
1688
  if (!F.feature.getGeometry()) return;
1689
- w && !s && (w.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), s = F.feature, k.setOffset([10, 0]);
1689
+ m && !s && (m.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), s = F.feature, k.setOffset([10, 0]);
1690
1690
  const $ = F.feature.getGeometry().getCoordinates(), a = $[0][$[0].length - 2];
1691
- if (k.setPosition(a), L != null && L.parentNode && L.parentNode.removeChild(L), (m = n.getProps()) != null && m.areaDrawEnd) {
1691
+ if (k.setPosition(a), E != null && E.parentNode && E.parentNode.removeChild(E), (y = n.getProps()) != null && y.areaDrawEnd) {
1692
1692
  const G = $[0].map((B) => Me(B, _.mercator, _.data));
1693
- (x = (u = n.getProps()) == null ? void 0 : u.areaDrawEnd) == null || x.call(u, G);
1693
+ (w = (u = n.getProps()) == null ? void 0 : u.areaDrawEnd) == null || w.call(u, G);
1694
1694
  }
1695
- E && (E.setActive(!1), e == null || e.removeInteraction(E), (e == null ? void 0 : e.getInteractions()).forEach((B) => {
1695
+ M && (M.setActive(!1), e == null || e.removeInteraction(M), (e == null ? void 0 : e.getInteractions()).forEach((B) => {
1696
1696
  B instanceof Oe && (B.setActive(!1), e == null || e.removeInteraction(B));
1697
- })), l && Xe(l), (V = document.querySelector(".delete-icon")) == null || V.addEventListener("click", () => {
1697
+ })), l && Xe(l), (z = document.querySelector(".delete-icon")) == null || z.addEventListener("click", () => {
1698
1698
  var G, B;
1699
1699
  A(), (B = (G = n.getProps()) == null ? void 0 : G.areaDrawEnd) == null || B.call(G, []);
1700
1700
  });
1701
1701
  });
1702
- }, b = (F, C) => {
1702
+ }, b = (F, L) => {
1703
1703
  const $ = Xt(F);
1704
- switch (C) {
1704
+ switch (L) {
1705
1705
  case "km":
1706
1706
  return $ > 1e4 ? Math.round($ / 1e6 * 100) / 100 + " km<sup>2</sup>" : Math.round($ * 100) / 100 + " m<sup>2</sup>";
1707
1707
  case "nm":
1708
1708
  return $ > 1e4 ? Math.round($ / 1e6 / Math.pow(1.852, 2) * 100) / 100 + " nm<sup>2</sup>" : Math.round($ * 100) / 100 + " m<sup>2</sup>";
1709
1709
  }
1710
1710
  };
1711
- let w, k;
1711
+ let m, k;
1712
1712
  const T = () => {
1713
- w != null && w.parentNode && w.parentNode.removeChild(w), w = document.createElement("div"), w.style.display = "flex", w.className = "ol-tooltip ol-tooltip-draw-polygon", k = new de({
1714
- element: w,
1713
+ m != null && m.parentNode && m.parentNode.removeChild(m), m = document.createElement("div"), m.style.display = "flex", m.className = "ol-tooltip ol-tooltip-draw-polygon", k = new de({
1714
+ element: m,
1715
1715
  offset: [0, -15],
1716
1716
  positioning: "bottom-center",
1717
1717
  stopEvent: !1,
1718
1718
  insertFirst: !1
1719
1719
  }), e == null || e.addOverlay(k);
1720
1720
  };
1721
- let L, D;
1721
+ let E, D;
1722
1722
  const W = () => {
1723
- L != null && L.parentNode && L.parentNode.removeChild(L), L = document.createElement("div"), L.className = "ol-tooltip ol-help-tooltip", D = new de({
1724
- element: L,
1723
+ E != null && E.parentNode && E.parentNode.removeChild(E), E = document.createElement("div"), E.className = "ol-tooltip ol-help-tooltip", D = new de({
1724
+ element: E,
1725
1725
  offset: [15, 0],
1726
1726
  positioning: "center-left"
1727
1727
  }), e == null || e.addOverlay(D);
1728
1728
  }, A = () => {
1729
1729
  s = null, o();
1730
1730
  }, H = () => {
1731
- i = "close", e.un("pointermove", y), g = null, E && (E.abortDrawing(), console.log("abortDrawing"), E.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((C) => {
1732
- C instanceof Oe && (C.setActive(!1), e == null || e.removeInteraction(C));
1733
- }), E = null), l && Xe(l), l = void 0, t == null || t.clear(), t = null, v && e.getAllLayers().includes(v) && (e.removeLayer(v), v = null), L != null && L.parentElement && (L.innerHTML = "", L.parentElement.removeChild(L), L = null), w != null && w.parentElement && (w.innerHTML = "", w.parentElement.removeChild(w), w = null), D && e.removeOverlay(D), k && e.removeOverlay(k), Le(e, "pointer");
1731
+ i = "close", e.un("pointermove", x), g = null, M && (M.abortDrawing(), console.log("abortDrawing"), M.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((L) => {
1732
+ L instanceof Oe && (L.setActive(!1), e == null || e.removeInteraction(L));
1733
+ }), M = null), l && Xe(l), l = void 0, t == null || t.clear(), t = null, v && e.getAllLayers().includes(v) && (e.removeLayer(v), v = null), E != null && E.parentElement && (E.innerHTML = "", E.parentElement.removeChild(E), E = null), m != null && m.parentElement && (m.innerHTML = "", m.parentElement.removeChild(m), m = null), D && e.removeOverlay(D), k && e.removeOverlay(k), Le(e, "pointer");
1734
1734
  };
1735
1735
  return {
1736
1736
  open: o,
@@ -1748,40 +1748,40 @@ const at = (e, n) => {
1748
1748
  });
1749
1749
  e == null || e.addLayer(s);
1750
1750
  let l = null, i = null;
1751
- const o = (b, w = !0) => {
1751
+ const o = (b, m = !0) => {
1752
1752
  if (!b || b.length === 0) return;
1753
1753
  if (n.clear(), i) {
1754
- const T = b.find((L) => L.id === (i == null ? void 0 : i.id));
1754
+ const T = b.find((E) => E.id === (i == null ? void 0 : i.id));
1755
1755
  T ? i = T : b.push(i);
1756
1756
  }
1757
1757
  const k = [];
1758
1758
  b.forEach((T) => {
1759
- const [L, D] = T.latLon.split(","), W = new ae({
1760
- geometry: new ce(ee([Number(L), Number(D)])),
1759
+ const [E, D] = T.latLon.split(","), W = new ae({
1760
+ geometry: new ce(ee([Number(E), Number(D)])),
1761
1761
  portData: T,
1762
1762
  id: T.id,
1763
1763
  select: T.id === (i == null ? void 0 : i.id),
1764
- showTitle: T.id === (i == null ? void 0 : i.id) || w
1764
+ showTitle: T.id === (i == null ? void 0 : i.id) || m
1765
1765
  }), A = r(W);
1766
1766
  W.setStyle(A), k.push(W);
1767
1767
  }), n.addFeatures(k);
1768
1768
  };
1769
1769
  let f = null, v = null;
1770
- const t = (b, w) => {
1770
+ const t = (b, m) => {
1771
1771
  f || (f = document.createElement("canvas"), v = f.getContext("2d", {
1772
1772
  willReadFrequently: !0
1773
1773
  }));
1774
1774
  const k = f, T = v;
1775
1775
  if (!T) return "";
1776
1776
  k.width = 0, k.height = 0;
1777
- const L = 2, D = 8, W = window.devicePixelRatio || 1, A = "12px sans-serif";
1777
+ const E = 2, D = 8, W = window.devicePixelRatio || 1, A = "12px sans-serif";
1778
1778
  T.font = A;
1779
- const j = T.measureText(b).width, F = D + j + D, C = L + 12 + L * 2;
1780
- k.width = Math.round(F * W), k.height = Math.round(C * W), T.scale(W, W), T.clearRect(0, 0, F, C), T.fillStyle = w ? "#FF5733" : "#FFF", T.fillRect(0, 0, F, C), T.font = A, T.textBaseline = "middle";
1781
- const $ = C / 2;
1782
- return T.strokeStyle = w ? "#000" : "#ffffff", T.lineWidth = 1, T.strokeText(b, D, $), T.fillStyle = w ? "#FFF" : "#000000", T.fillText(b, D, $), k.toDataURL("image/png");
1779
+ const j = T.measureText(b).width, F = D + j + D, L = E + 12 + E * 2;
1780
+ k.width = Math.round(F * W), k.height = Math.round(L * W), T.scale(W, W), T.clearRect(0, 0, F, L), T.fillStyle = m ? "#FF5733" : "#FFF", T.fillRect(0, 0, F, L), T.font = A, T.textBaseline = "middle";
1781
+ const $ = L / 2;
1782
+ return T.strokeStyle = m ? "#000" : "#ffffff", T.lineWidth = 1, T.strokeText(b, D, $), T.fillStyle = m ? "#FFF" : "#000000", T.fillText(b, D, $), k.toDataURL("image/png");
1783
1783
  }, r = (b) => {
1784
- const { select: w, showTitle: k } = b.getProperties(), T = (F) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
1784
+ const { select: m, showTitle: k } = b.getProperties(), T = (F) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
1785
1785
  <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="${F}"/>
1786
1786
  <g clip-path="url(#clip0_10059_122082)">
1787
1787
  <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"/>
@@ -1792,22 +1792,22 @@ const at = (e, n) => {
1792
1792
  </clipPath>
1793
1793
  </defs>
1794
1794
  </svg>
1795
- `, L = () => `data:image/svg+xml;utf8,${encodeURIComponent(T(w ? "#FF5733" : "#3370FF"))}`, D = e.getView().getZoom(), W = b.get("portData"), A = window.devicePixelRatio || 1, H = new Q({
1795
+ `, E = () => `data:image/svg+xml;utf8,${encodeURIComponent(T(m ? "#FF5733" : "#3370FF"))}`, D = e.getView().getZoom(), W = b.get("portData"), A = window.devicePixelRatio || 1, H = new Q({
1796
1796
  image: new Ce({
1797
- src: L(),
1797
+ src: E(),
1798
1798
  scale: 0.5 * D / 10
1799
1799
  }),
1800
- zIndex: w ? 110 : 100
1800
+ zIndex: m ? 110 : 100
1801
1801
  }), j = new Q({
1802
1802
  image: new Ce({
1803
- src: t(W.shortName, w),
1803
+ src: t(W.shortName, m),
1804
1804
  anchor: [0.5, 0.5],
1805
1805
  displacement: [0, -26],
1806
1806
  scale: 1 / A,
1807
1807
  anchorXUnits: "fraction",
1808
1808
  anchorYUnits: "fraction"
1809
1809
  }),
1810
- zIndex: w ? 110 : 100
1810
+ zIndex: m ? 110 : 100
1811
1811
  // text: new Text({
1812
1812
  // text: port.shortName,
1813
1813
  // font: '12px sans-serif',
@@ -1820,38 +1820,38 @@ const at = (e, n) => {
1820
1820
  // offsetY: 30,
1821
1821
  // }),
1822
1822
  });
1823
- return !k && !w ? H : [H, j];
1823
+ return !k && !m ? H : [H, j];
1824
1824
  }, g = () => {
1825
1825
  if (n)
1826
1826
  if (l) {
1827
1827
  console.log("清除非选中的港口");
1828
1828
  const b = l.get("portData").id;
1829
- n.getFeatures().forEach((w) => {
1830
- w.get("portData").id !== b && n.removeFeature(w);
1829
+ n.getFeatures().forEach((m) => {
1830
+ m.get("portData").id !== b && n.removeFeature(m);
1831
1831
  });
1832
1832
  } else
1833
1833
  console.log("清除所有港口", n), n == null || n.clear();
1834
- }, y = (b) => {
1834
+ }, x = (b) => {
1835
1835
  if (n) {
1836
1836
  if (!b)
1837
- return E();
1838
- (l == null ? void 0 : l.get("portData").id) !== b.id && (E(), z(b));
1837
+ return M();
1838
+ (l == null ? void 0 : l.get("portData").id) !== b.id && (M(), V(b));
1839
1839
  }
1840
- }, E = () => {
1840
+ }, M = () => {
1841
1841
  var b;
1842
1842
  if (l) {
1843
- const w = l == null ? void 0 : l.get("portData"), k = (b = n.getFeatures()) == null ? void 0 : b.find((T) => T.get("portData").id === w.id);
1843
+ const m = l == null ? void 0 : l.get("portData"), k = (b = n.getFeatures()) == null ? void 0 : b.find((T) => T.get("portData").id === m.id);
1844
1844
  k && (k.set("select", !1), k.setStyle(r(k)), l = null, i = null);
1845
1845
  }
1846
- }, z = (b) => {
1846
+ }, V = (b) => {
1847
1847
  if (!n) return;
1848
- const w = n.getFeatures();
1849
- i = b, l = w.find((k) => k.get("portData").id === b.id), l && (l.set("select", !0), l.setStyle(r(l)));
1848
+ const m = n.getFeatures();
1849
+ i = b, l = m.find((k) => k.get("portData").id === b.id), l && (l.set("select", !0), l.setStyle(r(l)));
1850
1850
  };
1851
1851
  return {
1852
1852
  render: o,
1853
1853
  clear: g,
1854
- selected: y,
1854
+ selected: x,
1855
1855
  handlePortHover: (b) => {
1856
1856
  b && b.get("portData") && (e != null && e.getTargetElement()) && Le(e, "pointer");
1857
1857
  }
@@ -1867,18 +1867,31 @@ const at = (e, n) => {
1867
1867
  console.log("moveend---catch", g);
1868
1868
  }
1869
1869
  }), v.on("pointermove", (t) => {
1870
- const r = v == null ? void 0 : v.getEventPixel(t.originalEvent);
1871
- if (!r || !v) return;
1872
- const g = v.getSize();
1873
- if (!(r[0] < 0 || r[0] > g[0] || r[1] < 0 || r[1] > g[1])) {
1874
- console.log(v), console.log(v == null ? void 0 : v.forEachFeatureAtPixel), console.log(v == null ? void 0 : v.forEachFeatureAtPixel(r, (y) => (console.log(y), y)));
1870
+ if (t.dragging) return;
1871
+ const r = v.forEachFeatureAtPixel(
1872
+ t.pixel,
1873
+ function(M) {
1874
+ return M;
1875
+ },
1876
+ {
1877
+ hitTolerance: 3,
1878
+ // 3像素的容差范围
1879
+ layerFilter: function(M) {
1880
+ return M.get("interactive") === !0;
1881
+ }
1882
+ }
1883
+ );
1884
+ console.log("pointermove", r);
1885
+ const g = v == null ? void 0 : v.getEventPixel(t.originalEvent);
1886
+ if (!g || !v) return;
1887
+ const x = v.getSize();
1888
+ if (!(g[0] < 0 || g[0] > x[0] || g[1] < 0 || g[1] > x[1]))
1875
1889
  try {
1876
- const y = v == null ? void 0 : v.forEachFeatureAtPixel(r, (E) => E);
1877
- s == null || s.handleTrackMapEvent(y, "hover", t), l == null || l.handleShipMapEvent(y, "hover"), y && (i == null || i.handlePortHover(y));
1878
- } catch (y) {
1879
- console.log("pointermove---catch", y);
1890
+ const M = v == null ? void 0 : v.forEachFeatureAtPixel(g, (V) => V);
1891
+ s == null || s.handleTrackMapEvent(M, "hover", t), l == null || l.handleShipMapEvent(M, "hover"), M && (i == null || i.handlePortHover(M));
1892
+ } catch (M) {
1893
+ console.log("pointermove---catch", M);
1880
1894
  }
1881
- }
1882
1895
  }), v.on("movestart", () => {
1883
1896
  try {
1884
1897
  const t = v == null ? void 0 : v.getView().getZoom();
@@ -1887,26 +1900,26 @@ const at = (e, n) => {
1887
1900
  console.log("movestart---catch", t);
1888
1901
  }
1889
1902
  }), v.on("click", Re((t) => {
1890
- var r, g, y;
1903
+ var r, g, x;
1891
1904
  if (f.getState() !== "open")
1892
1905
  try {
1893
1906
  if (console.log("1", o.getState()), o.getState()) return;
1894
- const E = v.getEventPixel(t.originalEvent), z = v.forEachFeatureAtPixel(
1895
- E,
1896
- (M) => {
1897
- if (M != null && M.get("shipData") || M != null && M.get("portData"))
1898
- return M;
1907
+ const M = v.getEventPixel(t.originalEvent), V = v.forEachFeatureAtPixel(
1908
+ M,
1909
+ (C) => {
1910
+ if (C != null && C.get("shipData") || C != null && C.get("portData"))
1911
+ return C;
1899
1912
  }
1900
1913
  );
1901
- if (z != null && z.get("shipData"))
1902
- l.handleShipMapEvent(z, "click", (r = n.getProps()) == null ? void 0 : r.selectShip);
1903
- else if (z != null && z.get("portData")) {
1904
- const M = z.get("portData");
1905
- i.selected(M), (y = (g = n.getProps()) == null ? void 0 : g.selectPort) == null || y.call(g, M);
1914
+ if (V != null && V.get("shipData"))
1915
+ l.handleShipMapEvent(V, "click", (r = n.getProps()) == null ? void 0 : r.selectShip);
1916
+ else if (V != null && V.get("portData")) {
1917
+ const C = V.get("portData");
1918
+ i.selected(C), (x = (g = n.getProps()) == null ? void 0 : g.selectPort) == null || x.call(g, C);
1906
1919
  }
1907
1920
  t.preventDefault(), t.stopPropagation();
1908
- } catch (E) {
1909
- console.log("click---catch", E);
1921
+ } catch (M) {
1922
+ console.log("click---catch", M);
1910
1923
  }
1911
1924
  }, 150)), v.getView().on("change:resolution", Re(() => {
1912
1925
  const t = v == null ? void 0 : v.getView().getZoom();
@@ -1920,11 +1933,11 @@ const at = (e, n) => {
1920
1933
  o.initMap(l, i);
1921
1934
  const f = o.getInstall(), v = ko(f), t = po();
1922
1935
  t.setProps(i), v.setShowLayerType(i.layerType), v.setGreenTileVisible(i.showGreenLayer);
1923
- const r = ao(f), g = co(f, r), y = bo(f), E = Mo(f), z = Eo(f, t), M = To(f, t), b = Po(f);
1924
- So(o, t, r, y, b, z, M);
1925
- const w = () => {
1926
- const T = f.getView().calculateExtent(o.getSize()), L = Me([T[0], T[1]], _.mercator, _.data), D = Me([T[2], T[3]], _.mercator, _.data);
1927
- return [L[0], L[1], D[0], D[1]];
1936
+ const r = ao(f), g = co(f, r), x = bo(f), M = Mo(f), V = Eo(f, t), C = To(f, t), b = Po(f);
1937
+ So(o, t, r, x, b, V, C);
1938
+ const m = () => {
1939
+ const T = f.getView().calculateExtent(o.getSize()), E = Me([T[0], T[1]], _.mercator, _.data), D = Me([T[2], T[3]], _.mercator, _.data);
1940
+ return [E[0], E[1], D[0], D[1]];
1928
1941
  }, k = {
1929
1942
  id: Symbol("map-instance"),
1930
1943
  innerMap: null,
@@ -1935,7 +1948,7 @@ const at = (e, n) => {
1935
1948
  methods: {
1936
1949
  ...o,
1937
1950
  layer: v,
1938
- ship: y,
1951
+ ship: x,
1939
1952
  track: r,
1940
1953
  carTrack: g,
1941
1954
  port: {
@@ -1943,12 +1956,12 @@ const at = (e, n) => {
1943
1956
  clear: b.clear,
1944
1957
  selected: b.selected
1945
1958
  },
1946
- position: E,
1947
- drawLine: z,
1948
- drawPolygon: M,
1959
+ position: M,
1960
+ drawLine: V,
1961
+ drawPolygon: C,
1949
1962
  // 子模块
1950
1963
  utils: {
1951
- getCalculateExtent: w,
1964
+ getCalculateExtent: m,
1952
1965
  convertSixHundredThousandToLatLng: Ue,
1953
1966
  calculateCirclePoints: no
1954
1967
  }