zhihao-ui 1.3.59-alpha.2 → 1.3.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/{BaseInfo-Bx3C9ZBL.js → BaseInfo-D-Mw1tTN.js} +2 -2
- package/dist/es/{BaseItem-B1E_ckBc.js → BaseItem-BbqMOHus.js} +3 -3
- package/dist/es/{Button-BFA52ivn.js → Button-CeZhW1QC.js} +2 -2
- package/dist/es/{CascaderLoadMore-C6micaqI.js → CascaderLoadMore-CCflOhPX.js} +2 -2
- package/dist/es/{DatePicker-BxalhOJm.js → DatePicker-DMtsF75M.js} +3 -3
- package/dist/es/{DetailHeader-CTHrhLa3.js → DetailHeader-Cny3MSRT.js} +3 -3
- package/dist/es/{DetailSubTitle-CeXkvL12.js → DetailSubTitle-BaYkpGpn.js} +2 -2
- package/dist/es/{Dialog-BptDzN8n.js → Dialog-wslff2i5.js} +3 -3
- package/dist/es/{DiyDataTable-BIwNu91S.js → DiyDataTable-DxhbDTeX.js} +4 -4
- package/dist/es/{EditInfoPair-BuNjky_P.js → EditInfoPair-BjkWUWdC.js} +3 -3
- package/dist/es/{FileWrapper-SNPju9Db.js → FileWrapper-CACEIzz1.js} +4 -4
- package/dist/es/{Grid-8CT6JVvo.js → Grid-DUbA9lXj.js} +2 -2
- package/dist/es/{InfoPair-W4cuHn-N.js → InfoPair-Cc7jd_QY.js} +3 -3
- package/dist/es/{Input-FPnMJc-X.js → Input-CPgzYhQB.js} +3 -3
- package/dist/es/{Loading-D1OYqPWU.js → Loading-C6gDlpzy.js} +2 -2
- package/dist/es/{Map-B7b_QqZC.js → Map-DWbVaRRC.js} +921 -916
- package/dist/es/{MessageBox-BIQVuTBY.js → MessageBox-C7mSYITB.js} +2 -2
- package/dist/es/{MoneyInput-CSzkTtxb.js → MoneyInput-3Er5p9I5.js} +5 -5
- package/dist/es/{PageHeadPanel-BV5qQLDj.js → PageHeadPanel-BUKAi2go.js} +2 -2
- package/dist/es/{Table-BnXX6Zcr.js → Table-C2uGAC4q.js} +6 -6
- package/dist/es/{ToolTips-B9Z_U4WM.js → ToolTips-CDOUTy7Q.js} +3 -3
- package/dist/es/index.js +23 -23
- package/dist/es/{utils-COxKH46Q.js → utils-mwRDbm3z.js} +1 -1
- package/dist/es/{vendor-CbeG2C4c.js → vendor-BcKYsh5g.js} +5 -5
- package/dist/types/components/Map/function/carTrack.d.ts +2 -4
- package/dist/types/components/Map/function/renderPolygon.d.ts +1 -2
- package/dist/umd/index.umd.cjs +23 -23
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as ft, openBlock as ht, createElementBlock as vt, createElementVNode as dt, ref as ge, computed as
|
|
2
|
-
import { S as
|
|
3
|
-
import { _ as wt } from "./Button-
|
|
4
|
-
import { w as io } from "./utils-
|
|
1
|
+
import { defineComponent as ft, openBlock as ht, createElementBlock as vt, createElementVNode as dt, ref as ge, computed as Qe, h as we, createVNode as ut, render as Yt, reactive as Bt, onMounted as qt, onUnmounted as Xt } from "vue";
|
|
2
|
+
import { S as Kt, M as pt, T as Oe, X as Ae, t as fe, V as _t, u as jt, D as mt, v as Qt, j as $t, w as yt, x as Jt, y as Ze, F as ue, z as te, O as Ce, P as de, A as Be, B as Nt, L as Ue, G as Ut, H as Ct, I as me, J as Me, K as be, N as $e, Q as et, R as Ne, U as It, W as Ie, Y as gt, Z as Mt, _ as eo, $ as to, a0 as oo, a1 as no, a2 as ro, a3 as lo } from "./vendor-BcKYsh5g.js";
|
|
3
|
+
import { _ as wt } from "./Button-CeZhW1QC.js";
|
|
4
|
+
import { w as io } from "./utils-mwRDbm3z.js";
|
|
5
5
|
const so = { id: "scale-line-container" }, co = /* @__PURE__ */ ft({
|
|
6
6
|
__name: "scaleLine",
|
|
7
7
|
setup(e, { expose: l }) {
|
|
8
8
|
return l({
|
|
9
|
-
setScaleLine: (r,
|
|
10
|
-
|
|
11
|
-
const s = new
|
|
12
|
-
units:
|
|
9
|
+
setScaleLine: (r, a) => {
|
|
10
|
+
a || (a = "metric");
|
|
11
|
+
const s = new Kt({
|
|
12
|
+
units: a
|
|
13
13
|
}), o = document.getElementById("scale-line-container");
|
|
14
14
|
o && (s.setTarget(o), r.addControl(s));
|
|
15
15
|
}
|
|
16
|
-
}), (r,
|
|
16
|
+
}), (r, a) => (ht(), vt("div", so));
|
|
17
17
|
}
|
|
18
18
|
}), ao = /* @__PURE__ */ wt(co, [["__scopeId", "data-v-2bc5dee8"]]), uo = { class: "zoom" }, go = /* @__PURE__ */ ft({
|
|
19
19
|
__name: "zoomControl",
|
|
@@ -28,17 +28,17 @@ const so = { id: "scale-line-container" }, co = /* @__PURE__ */ ft({
|
|
|
28
28
|
console.log("props", l);
|
|
29
29
|
const c = () => {
|
|
30
30
|
console.log("props");
|
|
31
|
-
const { setZoom:
|
|
31
|
+
const { setZoom: a, getZoom: s, getInstall: o } = l.mapInstance.methods;
|
|
32
32
|
if (!o()) return;
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const x = s();
|
|
34
|
+
x && a(x + 1);
|
|
35
35
|
}, r = () => {
|
|
36
|
-
const { setZoom:
|
|
36
|
+
const { setZoom: a, getZoom: s, getInstall: o } = l.mapInstance.methods;
|
|
37
37
|
if (!o()) return;
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const x = s();
|
|
39
|
+
x && a(x - 1);
|
|
40
40
|
};
|
|
41
|
-
return (
|
|
41
|
+
return (a, s) => (ht(), vt("div", uo, [
|
|
42
42
|
dt("div", {
|
|
43
43
|
class: "button big-button",
|
|
44
44
|
onClick: c
|
|
@@ -49,7 +49,7 @@ const so = { id: "scale-line-container" }, co = /* @__PURE__ */ ft({
|
|
|
49
49
|
}, " - ")
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
|
-
}), fo = /* @__PURE__ */ wt(go, [["__scopeId", "data-v-78a81741"]]),
|
|
52
|
+
}), fo = /* @__PURE__ */ wt(go, [["__scopeId", "data-v-78a81741"]]), Je = "a6e8f78974f2581f2ca00485b40c948f", ce = {
|
|
53
53
|
// 地图默认层级
|
|
54
54
|
default: 13,
|
|
55
55
|
// 地图缩放最小层级
|
|
@@ -69,32 +69,32 @@ const so = { id: "scale-line-container" }, co = /* @__PURE__ */ ft({
|
|
|
69
69
|
data: "EPSG:4326",
|
|
70
70
|
// 墨卡托投影坐标 渲染坐标
|
|
71
71
|
mercator: "EPSG:3857"
|
|
72
|
-
}, ho = [114.84, 30.52],
|
|
73
|
-
var
|
|
72
|
+
}, ho = [114.84, 30.52], Rt = "https://static.zhihaoscm.cn/", tt = 2003750834e-2;
|
|
73
|
+
var Se = ((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=${Je}`, 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=${Je}`, 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=${Je}`, 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=${Je}`, e.greenTile = `${Rt}/map/tile/{z}/{x}/{y}.png`, e))(Se || {}), De = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(De || {}), le = /* @__PURE__ */ ((e) => (e.PORT = "port", e.SHIP = "ship", e.TRACK = "track", e.DELETE = "delete", e.PATH = "path", e))(le || {});
|
|
74
74
|
function vo() {
|
|
75
|
-
const e = ge(), l = ge(!0), c = () => e.value, r = () => c().getView(),
|
|
76
|
-
l.value =
|
|
75
|
+
const e = ge(), l = ge(!0), c = () => e.value, r = () => c().getView(), a = (p) => {
|
|
76
|
+
l.value = p;
|
|
77
77
|
}, s = () => l.value, o = () => {
|
|
78
|
-
var
|
|
79
|
-
return (
|
|
80
|
-
}, h = (
|
|
78
|
+
var p;
|
|
79
|
+
return (p = r()) == null ? void 0 : p.getZoom();
|
|
80
|
+
}, h = (p) => {
|
|
81
81
|
var i;
|
|
82
|
-
(i = r()) == null || i.setZoom(
|
|
83
|
-
},
|
|
82
|
+
(i = r()) == null || i.setZoom(p);
|
|
83
|
+
}, x = (p, i) => {
|
|
84
84
|
var u;
|
|
85
|
-
(u = r()) == null || u.setCenter(fe([
|
|
85
|
+
(u = r()) == null || u.setCenter(fe([p, i]));
|
|
86
86
|
}, M = () => {
|
|
87
87
|
var i;
|
|
88
|
-
const
|
|
89
|
-
return Qt(
|
|
88
|
+
const p = (i = r()) == null ? void 0 : i.getCenter();
|
|
89
|
+
return Qt(p);
|
|
90
90
|
}, t = () => {
|
|
91
|
-
var
|
|
92
|
-
return (
|
|
91
|
+
var p;
|
|
92
|
+
return (p = c()) == null ? void 0 : p.getSize();
|
|
93
93
|
}, n = () => {
|
|
94
|
-
const
|
|
95
|
-
return i && (u ||
|
|
96
|
-
},
|
|
97
|
-
|
|
94
|
+
const p = window.navigator.userAgent, i = /iPad|iPhone|iPod/.test(p), u = /Safari/.test(p) && !/CriOS/.test(p), b = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(p);
|
|
95
|
+
return i && (u || b);
|
|
96
|
+
}, w = new pt(), $ = (p, i) => {
|
|
97
|
+
A(i);
|
|
98
98
|
const u = {
|
|
99
99
|
zoom: i.zoom,
|
|
100
100
|
center: fe(i.center),
|
|
@@ -104,27 +104,27 @@ function vo() {
|
|
|
104
104
|
enableRotation: !1,
|
|
105
105
|
multiWorld: !0
|
|
106
106
|
};
|
|
107
|
-
let
|
|
108
|
-
target:
|
|
107
|
+
let b = {
|
|
108
|
+
target: p,
|
|
109
109
|
controls: jt({
|
|
110
110
|
zoom: !1
|
|
111
111
|
}),
|
|
112
112
|
layers: [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
w.get("vectorTile"),
|
|
114
|
+
w.get("vectorTileMark"),
|
|
115
|
+
w.get("satelliteImgTile"),
|
|
116
|
+
w.get("satelliteImgTileMark")
|
|
117
117
|
],
|
|
118
|
-
view: new
|
|
118
|
+
view: new _t(u)
|
|
119
119
|
};
|
|
120
|
-
const f = new
|
|
120
|
+
const f = new pt(b);
|
|
121
121
|
if (n()) {
|
|
122
122
|
const L = new mt({
|
|
123
|
-
handleEvent: function(
|
|
124
|
-
if (
|
|
125
|
-
console.log("IOS Browser---dblclick"),
|
|
126
|
-
const z = f.getView(),
|
|
127
|
-
return z.setZoom(
|
|
123
|
+
handleEvent: function(O) {
|
|
124
|
+
if (O.type === "dblclick") {
|
|
125
|
+
console.log("IOS Browser---dblclick"), O.originalEvent.preventDefault();
|
|
126
|
+
const z = f.getView(), K = z.getZoom();
|
|
127
|
+
return z.setZoom(K + 1), !1;
|
|
128
128
|
}
|
|
129
129
|
return !0;
|
|
130
130
|
}
|
|
@@ -132,34 +132,34 @@ function vo() {
|
|
|
132
132
|
f.addInteraction(L);
|
|
133
133
|
}
|
|
134
134
|
e.value = f;
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
source: new
|
|
138
|
-
visible:
|
|
135
|
+
}, A = (p) => {
|
|
136
|
+
w.set("vectorTile", new Oe({
|
|
137
|
+
source: new Ae({ url: Se.vectorTile }),
|
|
138
|
+
visible: p.layerType === "vector",
|
|
139
139
|
zIndex: 0,
|
|
140
140
|
preload: 1,
|
|
141
141
|
className: "vector"
|
|
142
|
-
})),
|
|
143
|
-
source: new
|
|
144
|
-
visible:
|
|
142
|
+
})), w.set("vectorTileMark", new Oe({
|
|
143
|
+
source: new Ae({ url: Se.vectorTileMark }),
|
|
144
|
+
visible: p.layerType === "vector",
|
|
145
145
|
zIndex: 1,
|
|
146
146
|
preload: 1,
|
|
147
147
|
className: "vector"
|
|
148
|
-
})),
|
|
149
|
-
source: new
|
|
150
|
-
visible:
|
|
148
|
+
})), w.set("satelliteImgTile", new Oe({
|
|
149
|
+
source: new Ae({ url: Se.satelliteImgTile }),
|
|
150
|
+
visible: p.layerType === "satellite",
|
|
151
151
|
zIndex: 0,
|
|
152
152
|
preload: 1,
|
|
153
153
|
className: "satellite"
|
|
154
|
-
})),
|
|
155
|
-
source: new
|
|
156
|
-
visible:
|
|
154
|
+
})), w.set("satelliteImgTileMark", new Oe({
|
|
155
|
+
source: new Ae({ url: Se.satelliteImgTileMark }),
|
|
156
|
+
visible: p.layerType === "satellite",
|
|
157
157
|
zIndex: 1,
|
|
158
158
|
preload: 1,
|
|
159
159
|
className: "satellite"
|
|
160
|
-
})),
|
|
161
|
-
source: new
|
|
162
|
-
visible:
|
|
160
|
+
})), w.set("greenMark", new Oe({
|
|
161
|
+
source: new Ae({ url: Se.greenTile }),
|
|
162
|
+
visible: p.showGreenLayer,
|
|
163
163
|
zIndex: 2,
|
|
164
164
|
className: "greenTile"
|
|
165
165
|
}));
|
|
@@ -169,12 +169,12 @@ function vo() {
|
|
|
169
169
|
getView: r,
|
|
170
170
|
getZoom: o,
|
|
171
171
|
setZoom: h,
|
|
172
|
-
setCenter:
|
|
172
|
+
setCenter: x,
|
|
173
173
|
getCenter: M,
|
|
174
174
|
getSize: t,
|
|
175
|
-
initMap:
|
|
176
|
-
setBaseLayerMap:
|
|
177
|
-
setMapClick:
|
|
175
|
+
initMap: $,
|
|
176
|
+
setBaseLayerMap: A,
|
|
177
|
+
setMapClick: a,
|
|
178
178
|
getMapClick: s
|
|
179
179
|
};
|
|
180
180
|
}
|
|
@@ -182,12 +182,12 @@ const xt = function(e, l) {
|
|
|
182
182
|
const c = Number(l) / 6e5;
|
|
183
183
|
return [Number(e) / 6e5, c];
|
|
184
184
|
}, mo = (e, l) => {
|
|
185
|
-
const c = fe(e), r = l * 1e3,
|
|
185
|
+
const c = fe(e), r = l * 1e3, a = [
|
|
186
186
|
c[0] - r,
|
|
187
187
|
c[1] - r,
|
|
188
188
|
c[0] + r,
|
|
189
189
|
c[1] + r
|
|
190
|
-
], s = Jt(
|
|
190
|
+
], s = Jt(a, se.mercator, se.data);
|
|
191
191
|
return {
|
|
192
192
|
leftTopPoint: { lng: s[0], lat: s[3] },
|
|
193
193
|
rightTopPoint: { lng: s[2], lat: s[3] },
|
|
@@ -196,231 +196,271 @@ const xt = function(e, l) {
|
|
|
196
196
|
};
|
|
197
197
|
}, yo = function(e, l) {
|
|
198
198
|
const r = yt(e);
|
|
199
|
-
let
|
|
200
|
-
switch (console.log(l,
|
|
201
|
-
case
|
|
202
|
-
|
|
199
|
+
let a = "";
|
|
200
|
+
switch (console.log(l, De), l) {
|
|
201
|
+
case De.M:
|
|
202
|
+
a = Math.round(r * 100) / 100 + " m";
|
|
203
203
|
break;
|
|
204
|
-
case
|
|
205
|
-
|
|
204
|
+
case De.KM:
|
|
205
|
+
a = Math.round(r / 1e3 * 100) / 100 + " km";
|
|
206
206
|
break;
|
|
207
|
-
case
|
|
208
|
-
|
|
207
|
+
case De.NM:
|
|
208
|
+
a = (Math.round(r / 1e3 * 100) / 100 / 1.852).toFixed(2) + " nm";
|
|
209
209
|
break;
|
|
210
210
|
}
|
|
211
|
-
return
|
|
211
|
+
return a;
|
|
212
212
|
};
|
|
213
213
|
function wo(e) {
|
|
214
214
|
const l = e[0] * tt / 180;
|
|
215
215
|
let c = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
|
|
216
216
|
return c = c * tt / 180, [l, c];
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Fe(e = "") {
|
|
219
219
|
let l = e.replace(/&?/g, "&");
|
|
220
220
|
return l = l.replace(/&#x([0-9a-fA-F]+);?/g, (c, r) => {
|
|
221
|
-
const
|
|
222
|
-
return String.fromCodePoint(
|
|
221
|
+
const a = parseInt(r, 16);
|
|
222
|
+
return String.fromCodePoint(a);
|
|
223
223
|
}), l;
|
|
224
224
|
}
|
|
225
225
|
const Lt = (e) => {
|
|
226
|
-
const l = new
|
|
226
|
+
const l = new Ze({
|
|
227
227
|
font: "Normal 14px map-iconfont",
|
|
228
|
-
text:
|
|
228
|
+
text: Fe(e),
|
|
229
229
|
fill: new ue({ color: "#fff" }),
|
|
230
230
|
offsetY: -14
|
|
231
231
|
});
|
|
232
|
-
return new
|
|
232
|
+
return new te({
|
|
233
233
|
text: l,
|
|
234
234
|
zIndex: 100
|
|
235
235
|
});
|
|
236
236
|
}, Et = (e, l = "lonlat") => {
|
|
237
237
|
const c = { lon: 0, lat: 0 }, r = e[0] / tt * 180;
|
|
238
|
-
let
|
|
239
|
-
return
|
|
238
|
+
let a = e[1] / tt * 180;
|
|
239
|
+
return a = 180 / Math.PI * (2 * Math.atan(Math.exp(a * Math.PI / 180)) - Math.PI / 2), c.lon = r, c.lat = a, l === "lonlat" ? c : [r, a];
|
|
240
240
|
}, xo = (e) => {
|
|
241
|
-
const l =
|
|
242
|
-
let s = `${String(
|
|
241
|
+
const l = $t.duration(e, "minutes"), c = Math.floor(l.asDays()), r = l.hours(), a = l.minutes();
|
|
242
|
+
let s = `${String(a).padStart(2, "0")}分`;
|
|
243
243
|
return r !== 0 && (s = `${String(r).padStart(2, "0")}时${s}`), c !== 0 && (s = `${String(c).padStart(2, "0")}天${s}`), s;
|
|
244
|
+
}, bo = (e, l) => {
|
|
245
|
+
let c = null;
|
|
246
|
+
const r = async (t) => {
|
|
247
|
+
if (!e || (console.log("vehicleInfo", t), !(t != null && t.lon && (t != null && t.lat)))) return;
|
|
248
|
+
const n = Math.abs(Number(t.lon)) > 180 ? xt(t.lon, t.lat) : [t.lon, t.lat];
|
|
249
|
+
a(t, fe(n));
|
|
250
|
+
const w = e == null ? void 0 : e.getView(), $ = new de(n);
|
|
251
|
+
w.setCenter(Be($.getCoordinates(), se.data, se.mercator));
|
|
252
|
+
}, a = (t, n) => {
|
|
253
|
+
const w = `${Rt}map/car-icon.gif`;
|
|
254
|
+
c || (c = new Ce({
|
|
255
|
+
element: document.createElement("div"),
|
|
256
|
+
positioning: "center-center",
|
|
257
|
+
stopEvent: !1
|
|
258
|
+
// 允许交互事件穿透
|
|
259
|
+
}), e.addOverlay(c));
|
|
260
|
+
const $ = c.getElement();
|
|
261
|
+
$.style.backgroundImage = `url(${w})`, $.style.width = "80px", $.style.height = "80px";
|
|
262
|
+
const A = (t == null ? void 0 : t.drc) || "";
|
|
263
|
+
$.style.transform = `rotate(${A}deg)`, $.style.backgroundSize = "cover", c == null || c.setPosition(n);
|
|
264
|
+
};
|
|
265
|
+
return {
|
|
266
|
+
location: r,
|
|
267
|
+
remove: () => {
|
|
268
|
+
const t = c == null ? void 0 : c.getElement();
|
|
269
|
+
t && (t.innerHTML = "");
|
|
270
|
+
},
|
|
271
|
+
renderTrack: (t, n, w) => {
|
|
272
|
+
l.render(t, n, w, "truck", 1e3);
|
|
273
|
+
},
|
|
274
|
+
setCenter: (t) => {
|
|
275
|
+
l.setCenter(t);
|
|
276
|
+
},
|
|
277
|
+
closeTrack: () => {
|
|
278
|
+
l.close();
|
|
279
|
+
},
|
|
280
|
+
playTrack: (t, n) => {
|
|
281
|
+
l.play(t, n);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
244
284
|
};
|
|
245
285
|
var zt = /* @__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))(zt || {}), ye = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.front = "front", e.up = "up", e.down = "down", e.back = "back", e))(ye || {});
|
|
246
|
-
const
|
|
286
|
+
const ko = (e) => {
|
|
247
287
|
const l = /* @__PURE__ */ new Map(), c = {};
|
|
248
288
|
let r = null;
|
|
249
|
-
const
|
|
289
|
+
const a = "--";
|
|
250
290
|
let s = null;
|
|
251
291
|
const o = document.createElement("div"), h = new Ce({
|
|
252
292
|
element: o,
|
|
253
293
|
positioning: "top-left",
|
|
254
294
|
className: "track-label-popup"
|
|
255
295
|
});
|
|
256
|
-
let
|
|
257
|
-
const f = 8, L = [],
|
|
258
|
-
var
|
|
259
|
-
for (L.unshift(
|
|
260
|
-
const
|
|
261
|
-
|
|
296
|
+
let x, M, t, n, w, $ = !1, A = Date.now(), p, i = 0, u = null, b = 20;
|
|
297
|
+
const f = 8, L = [], O = (d) => {
|
|
298
|
+
var v;
|
|
299
|
+
for (L.unshift(d); L.length > f; ) {
|
|
300
|
+
const m = L.pop(), k = l.get(m);
|
|
301
|
+
k && ((v = k.getSource()) == null || v.clear(), e == null || e.removeLayer(k), l.delete(m), delete c[m]);
|
|
262
302
|
}
|
|
263
303
|
};
|
|
264
304
|
let z = "";
|
|
265
|
-
const
|
|
305
|
+
const K = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], ee = Nt(async () => {
|
|
266
306
|
if (r && c[r] && l.get(r).getVisible()) {
|
|
267
|
-
console.log("reRenderTrackLine------------"), await
|
|
268
|
-
const
|
|
269
|
-
rt(r,
|
|
307
|
+
console.log("reRenderTrackLine------------"), await I(r);
|
|
308
|
+
const d = C(r, c[r]);
|
|
309
|
+
rt(r, d);
|
|
270
310
|
}
|
|
271
|
-
}, 100), V = () => r && c[r] && l.get(r).getVisible(),
|
|
272
|
-
let
|
|
273
|
-
const
|
|
274
|
-
return
|
|
275
|
-
if (Number(
|
|
276
|
-
const [
|
|
277
|
-
|
|
311
|
+
}, 100), V = () => r && c[r] && l.get(r).getVisible(), C = (d, v) => {
|
|
312
|
+
let m = [];
|
|
313
|
+
const k = Math.max(1, Math.floor(v.length / b));
|
|
314
|
+
return m = v.filter((S, T) => T % k === 0).map((S, T) => {
|
|
315
|
+
if (Number(S.lon) > 180 || Number(S.lat) > 180) {
|
|
316
|
+
const [D, B] = xt(S.lon, S.lat);
|
|
317
|
+
S.lon = D, S.lat = B;
|
|
278
318
|
}
|
|
279
|
-
return
|
|
280
|
-
}),
|
|
281
|
-
(
|
|
282
|
-
(
|
|
319
|
+
return S.center = [S.lon, S.lat], S.centerPoint = wo(S.center), S.time = $t(S.createdAt).format("YYYY-MM-DD HH:mm:ss"), S.id = d, S.index = T, S;
|
|
320
|
+
}), m.filter(
|
|
321
|
+
(S, T, D) => T === D.findIndex(
|
|
322
|
+
(B) => Math.abs(B.lon - S.lon) < 1e-6 && Math.abs(B.lat - S.lat) < 1e-6
|
|
283
323
|
)
|
|
284
324
|
);
|
|
285
|
-
},
|
|
286
|
-
if (!e || JSON.stringify(c[
|
|
325
|
+
}, P = async (d, v, m, k = "ship", y = 200) => {
|
|
326
|
+
if (!e || JSON.stringify(c[d]) === JSON.stringify(v) && r === d || (v = v == null ? void 0 : v.reverse(), h && k === "ship" && (e != null && e.getOverlays().getArray().includes(h) || e.addOverlay(h)), (v == null ? void 0 : v.length) < 2))
|
|
287
327
|
return;
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
z =
|
|
291
|
-
}, G = (
|
|
292
|
-
const
|
|
293
|
-
return new
|
|
294
|
-
source:
|
|
328
|
+
O(d), r = d, c[d] = v, b = y;
|
|
329
|
+
const Z = Object.keys(c).findIndex((S) => S === d) || 0;
|
|
330
|
+
z = m || K[Z > 10 ? 10 : Z], await _(), await ve(r);
|
|
331
|
+
}, G = (d) => {
|
|
332
|
+
const v = new be();
|
|
333
|
+
return new Me({
|
|
334
|
+
source: v,
|
|
295
335
|
visible: !1,
|
|
296
336
|
// 默认隐藏
|
|
297
|
-
className: `track-layer-${
|
|
337
|
+
className: `track-layer-${d}`,
|
|
298
338
|
renderBuffer: 1024,
|
|
299
339
|
properties: { layerType: le.TRACK },
|
|
300
340
|
zIndex: 10
|
|
301
341
|
});
|
|
302
|
-
},
|
|
303
|
-
l.forEach((
|
|
304
|
-
var
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
}), r =
|
|
342
|
+
}, W = (d) => {
|
|
343
|
+
l.forEach((v, m) => {
|
|
344
|
+
var y;
|
|
345
|
+
const k = m === d;
|
|
346
|
+
v.getVisible() !== k && (v.setVisible(k), e.getLayers().getArray().includes(v) || e.addLayer(v), k || (y = v.getSource()) == null || y.clear());
|
|
347
|
+
}), r = d;
|
|
308
348
|
}, _ = async () => {
|
|
309
|
-
const
|
|
310
|
-
if (!l.has(
|
|
311
|
-
const
|
|
312
|
-
l.set(
|
|
349
|
+
const d = r;
|
|
350
|
+
if (!l.has(d)) {
|
|
351
|
+
const Z = G(d);
|
|
352
|
+
l.set(d, Z);
|
|
313
353
|
}
|
|
314
|
-
await
|
|
315
|
-
const
|
|
316
|
-
if (!(
|
|
317
|
-
let
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
}, X = (
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
|
|
354
|
+
await W(d);
|
|
355
|
+
const v = z || "", m = c[d] || [];
|
|
356
|
+
if (!(m && m.length > 1)) return [];
|
|
357
|
+
let k = [];
|
|
358
|
+
k = C(d, m);
|
|
359
|
+
const y = k.map((Z) => Z.centerPoint);
|
|
360
|
+
k.length >= 2 && await X(d, y, v);
|
|
361
|
+
}, X = (d, v, m) => {
|
|
362
|
+
const k = new Ue(v), y = l.get(d).getSource(), Z = y.getFeatureById(d);
|
|
363
|
+
if (Z)
|
|
364
|
+
Z.setGeometry(k), Z.setId(d), Z.setStyle(q(m)), u = Z;
|
|
325
365
|
else {
|
|
326
|
-
const
|
|
327
|
-
|
|
366
|
+
const S = new me({ geometry: k });
|
|
367
|
+
S.setId(d), S.set("type", "line"), S.setStyle(q(m)), y.addFeature(S), u = S;
|
|
328
368
|
}
|
|
329
369
|
return u;
|
|
330
|
-
},
|
|
331
|
-
stroke: new
|
|
332
|
-
color:
|
|
370
|
+
}, q = (d) => new te({
|
|
371
|
+
stroke: new $e({
|
|
372
|
+
color: d,
|
|
333
373
|
width: 2
|
|
334
374
|
})
|
|
335
|
-
}),
|
|
375
|
+
}), oe = (d, v, m) => {
|
|
336
376
|
try {
|
|
337
|
-
const
|
|
338
|
-
if (
|
|
339
|
-
e.getTargetElement().style.cursor =
|
|
340
|
-
const
|
|
341
|
-
|
|
377
|
+
const k = d == null ? void 0 : d.get("data");
|
|
378
|
+
if (d && k && v === "hover") {
|
|
379
|
+
e.getTargetElement().style.cursor = k ? "pointer" : "";
|
|
380
|
+
const y = ke(k), Z = m == null ? void 0 : m.coordinate;
|
|
381
|
+
Z && (o.querySelector(".popup-content"), o.innerHTML = y, h == null || h.setPosition(Z));
|
|
342
382
|
} else
|
|
343
383
|
h && h.setPosition(void 0);
|
|
344
|
-
} catch (
|
|
345
|
-
console.error("handleTrackMapEvent",
|
|
384
|
+
} catch (k) {
|
|
385
|
+
console.error("handleTrackMapEvent", k);
|
|
346
386
|
}
|
|
347
|
-
}, ke = (
|
|
348
|
-
if (!(
|
|
349
|
-
let
|
|
350
|
-
return
|
|
387
|
+
}, ke = (d) => {
|
|
388
|
+
if (!(d != null && d.time)) return;
|
|
389
|
+
let v = "";
|
|
390
|
+
return d != null && d.stayTime && (v = `
|
|
351
391
|
<div class="item w-100">
|
|
352
392
|
<div class="item-label">停泊时间约</div>
|
|
353
|
-
<div class="item-item">${xo(Number(
|
|
393
|
+
<div class="item-item">${xo(Number(d.stayTime))}</div>
|
|
354
394
|
</div>
|
|
355
395
|
`), `
|
|
356
396
|
<div class="track-point-popup">
|
|
357
397
|
<div class="item">
|
|
358
398
|
<div class="item-label">状态</div>
|
|
359
|
-
<div class="item-item">${
|
|
399
|
+
<div class="item-item">${d != null && d.sailStatus ? zt[d.sailStatus] : a}</div>
|
|
360
400
|
</div>
|
|
361
401
|
<div class="item">
|
|
362
402
|
<div class="item-label">航速</div>
|
|
363
|
-
<div class="item-item">${
|
|
403
|
+
<div class="item-item">${d.speed || a}</div>
|
|
364
404
|
</div>
|
|
365
405
|
<div class="item">
|
|
366
406
|
<div class="item-label">艏向</div>
|
|
367
|
-
<div class="item-item">${
|
|
407
|
+
<div class="item-item">${d.hdg || a}</div>
|
|
368
408
|
</div>
|
|
369
409
|
<div class="item">
|
|
370
410
|
<div class="item-label">航向</div>
|
|
371
|
-
<div class="item-item">${
|
|
411
|
+
<div class="item-item">${d.cog || a}</div>
|
|
372
412
|
</div>
|
|
373
413
|
<div class="item">
|
|
374
414
|
<div class="item-label">经度</div>
|
|
375
|
-
<div class="item-item">${
|
|
415
|
+
<div class="item-item">${d.lon || a}</div>
|
|
376
416
|
</div>
|
|
377
417
|
<div class="item">
|
|
378
418
|
<div class="item-label">纬度</div>
|
|
379
|
-
<div class="item-item">${
|
|
419
|
+
<div class="item-item">${d.lat || a}</div>
|
|
380
420
|
</div>
|
|
381
421
|
<div class="item w-100">
|
|
382
422
|
<div class="item-label">时间</div>
|
|
383
|
-
<div class="item-item">${
|
|
423
|
+
<div class="item-item">${d.time}</div>
|
|
384
424
|
</div>
|
|
385
|
-
${
|
|
425
|
+
${v ?? v}
|
|
386
426
|
</div>`;
|
|
387
|
-
}, ie = (
|
|
388
|
-
const
|
|
389
|
-
const
|
|
427
|
+
}, ie = (d) => {
|
|
428
|
+
const m = d.map((T) => {
|
|
429
|
+
const D = e.getPixelFromCoordinate(fe(T.center));
|
|
390
430
|
return {
|
|
391
431
|
...T,
|
|
392
432
|
original: T,
|
|
393
|
-
pixel:
|
|
433
|
+
pixel: D,
|
|
394
434
|
distance: 0
|
|
395
435
|
// 先初始化,后续计算
|
|
396
436
|
};
|
|
397
437
|
});
|
|
398
|
-
let
|
|
399
|
-
|
|
400
|
-
for (let T = 1; T <
|
|
401
|
-
const
|
|
402
|
-
|
|
438
|
+
let k = 0;
|
|
439
|
+
m[0].distance = 0;
|
|
440
|
+
for (let T = 1; T < m.length; T++) {
|
|
441
|
+
const D = m[T - 1].pixel, B = m[T].pixel, re = B[0] - D[0], E = B[1] - D[1];
|
|
442
|
+
k += Math.sqrt(re * re + E * E), m[T].distance = k;
|
|
403
443
|
}
|
|
404
|
-
const
|
|
405
|
-
(T,
|
|
406
|
-
),
|
|
407
|
-
for (let T = 0; T <
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
const
|
|
411
|
-
for (let j = 1; j <=
|
|
412
|
-
const
|
|
413
|
-
if (
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
444
|
+
const y = m.filter(
|
|
445
|
+
(T, D) => D === 0 || D === m.length - 1
|
|
446
|
+
), Z = [];
|
|
447
|
+
for (let T = 0; T < y.length; T++) {
|
|
448
|
+
const D = y[T];
|
|
449
|
+
if (Z.push(D), T < y.length - 1) {
|
|
450
|
+
const B = y[T + 1], re = B.distance - D.distance, E = Math.floor(re / 100);
|
|
451
|
+
for (let j = 1; j <= E; j++) {
|
|
452
|
+
const Q = D.distance + j * 100;
|
|
453
|
+
if (Q >= B.distance) break;
|
|
454
|
+
const ne = ae(
|
|
455
|
+
m,
|
|
456
|
+
Q
|
|
417
457
|
);
|
|
418
|
-
|
|
458
|
+
ne && Z.push(ne);
|
|
419
459
|
}
|
|
420
460
|
}
|
|
421
461
|
}
|
|
422
462
|
return Array.from(
|
|
423
|
-
new Map(
|
|
463
|
+
new Map(Z.map((T) => [T.distance.toFixed(2), T])).values()
|
|
424
464
|
).map((T) => ({
|
|
425
465
|
...T.original,
|
|
426
466
|
// 优先保留原始数据
|
|
@@ -432,17 +472,17 @@ const bo = (e) => {
|
|
|
432
472
|
distance: T.distance
|
|
433
473
|
}));
|
|
434
474
|
};
|
|
435
|
-
function ae(
|
|
436
|
-
for (let
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
const
|
|
475
|
+
function ae(d, v) {
|
|
476
|
+
for (let m = 1; m < d.length; m++) {
|
|
477
|
+
const k = d[m - 1], y = d[m];
|
|
478
|
+
if (v >= k.distance && v <= y.distance) {
|
|
479
|
+
const Z = (v - k.distance) / (y.distance - k.distance), S = k.pixel[0] + Z * (y.pixel[0] - k.pixel[0]), T = k.pixel[1] + Z * (y.pixel[1] - k.pixel[1]), D = e == null ? void 0 : e.getCoordinateFromPixel([S, T]);
|
|
440
480
|
return {
|
|
441
|
-
...
|
|
481
|
+
...k,
|
|
442
482
|
// 继承前一个点的属性(可调整)
|
|
443
|
-
coord:
|
|
444
|
-
pixel: [
|
|
445
|
-
distance:
|
|
483
|
+
coord: D,
|
|
484
|
+
pixel: [S, T],
|
|
485
|
+
distance: v,
|
|
446
486
|
original: void 0
|
|
447
487
|
// 明确标记为插值生成点
|
|
448
488
|
};
|
|
@@ -450,62 +490,59 @@ const bo = (e) => {
|
|
|
450
490
|
}
|
|
451
491
|
return null;
|
|
452
492
|
}
|
|
453
|
-
const rt = async (
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
const m = new me({
|
|
463
|
-
geometry: new de(a.centerPoint),
|
|
464
|
-
data: a
|
|
493
|
+
const rt = async (d, v) => {
|
|
494
|
+
const m = ie(v);
|
|
495
|
+
console.log("simplifiedPoints", m.length, "list", v.length);
|
|
496
|
+
const k = m.map((T) => lt(T)), y = m.map((T) => U(T, z)), Z = he(d, m, v, z);
|
|
497
|
+
l.get(d).getSource().addFeatures([...k, ...y, ...Z]);
|
|
498
|
+
}, lt = (d) => {
|
|
499
|
+
const v = new me({
|
|
500
|
+
geometry: new de(d.centerPoint),
|
|
501
|
+
data: d
|
|
465
502
|
});
|
|
466
|
-
|
|
467
|
-
let
|
|
468
|
-
...Y(z)
|
|
503
|
+
v.set("type", "track_point"), v.set("trackId", d.id), v.set("data", d);
|
|
504
|
+
let m = [
|
|
505
|
+
...Y(d, z)
|
|
469
506
|
];
|
|
470
|
-
return (
|
|
471
|
-
}, g = window.devicePixelRatio || 1,
|
|
472
|
-
let
|
|
473
|
-
function J(
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
return
|
|
477
|
-
if (!
|
|
478
|
-
|
|
507
|
+
return (d.index === 0 || d.index === c[d.id].length - 1) && (m = [...xe(d)], v.set("type", "track_begin")), d.state !== void 0 && d.state !== null && (m = [...R(d)], v.set("type", "track_icon")), v.setStyle(m), v;
|
|
508
|
+
}, g = window.devicePixelRatio || 1, N = /* @__PURE__ */ new Map();
|
|
509
|
+
let F = null, H = null;
|
|
510
|
+
function J(d, v) {
|
|
511
|
+
const m = `${d}`;
|
|
512
|
+
if (N.has(m))
|
|
513
|
+
return N.get(m);
|
|
514
|
+
if (!F) {
|
|
515
|
+
F = document.createElement("canvas");
|
|
479
516
|
try {
|
|
480
|
-
|
|
517
|
+
H = F.getContext("2d", {
|
|
481
518
|
willReadFrequently: !0
|
|
482
519
|
});
|
|
483
520
|
} catch (kt) {
|
|
484
|
-
console.log("e", kt),
|
|
521
|
+
console.log("e", kt), H = F.getContext("2d");
|
|
485
522
|
}
|
|
486
523
|
}
|
|
487
|
-
const
|
|
488
|
-
if (!
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
let
|
|
494
|
-
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
return
|
|
524
|
+
const k = F, y = H;
|
|
525
|
+
if (!y) return "";
|
|
526
|
+
k.width = 0, k.height = 0;
|
|
527
|
+
const Z = 2, S = 8, T = 16, D = window.devicePixelRatio || 1, B = "500 12px Arial";
|
|
528
|
+
y.font = B;
|
|
529
|
+
const E = y.measureText(d).width, j = S + E + S, Q = Z + 14 + Z;
|
|
530
|
+
let ne = 0, pe = 0, Ee = 0, Te = 0, He = 0, Re = 0, Pe = 0, ze = 0;
|
|
531
|
+
ne = T + j, pe = T + Q, Ee = j, Te = Q, He = j + T, Re = 0, Pe = 0, ze = T, k.width = Math.round(ne * D), k.height = Math.round(pe * D), y.scale(D, D), y.clearRect(0, 0, ne, pe), y.beginPath(), y.moveTo(Ee, Te), y.lineTo(He, Re), y.strokeStyle = v || "#FFF", y.lineWidth = 1, y.stroke(), y.fillStyle = "#FFF", y.fillRect(Pe, ze, j, Q), y.strokeStyle = v || "#FFF", y.lineWidth = 1, y.strokeRect(Pe, ze, j, Q), y.font = B, y.textBaseline = "middle";
|
|
532
|
+
const _e = ze + Z / 2 + Q / 2;
|
|
533
|
+
y.strokeStyle = "#ffffff", y.lineWidth = 1, y.strokeText(d, Pe + S, _e), y.fillStyle = "#000000", y.fillText(d, Pe + S, _e);
|
|
534
|
+
const je = k.toDataURL("image/png");
|
|
535
|
+
return N.set(m, je), je;
|
|
499
536
|
}
|
|
500
|
-
const U = (
|
|
501
|
-
const
|
|
502
|
-
geometry: new de(
|
|
503
|
-
data:
|
|
537
|
+
const U = (d, v) => {
|
|
538
|
+
const m = J(d.time, v), k = new me({
|
|
539
|
+
geometry: new de(d.centerPoint),
|
|
540
|
+
data: d
|
|
504
541
|
});
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
image: new
|
|
508
|
-
src:
|
|
542
|
+
k.set("type", "track_point_label");
|
|
543
|
+
const y = new te({
|
|
544
|
+
image: new Ne({
|
|
545
|
+
src: m,
|
|
509
546
|
anchor: [1, 0],
|
|
510
547
|
displacement: [0, 0],
|
|
511
548
|
scale: 1 / g,
|
|
@@ -514,91 +551,99 @@ const bo = (e) => {
|
|
|
514
551
|
}),
|
|
515
552
|
zIndex: 100
|
|
516
553
|
});
|
|
517
|
-
return
|
|
518
|
-
},
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
554
|
+
return k.setStyle(y), k;
|
|
555
|
+
}, I = (d) => {
|
|
556
|
+
const v = l.get(d).getSource();
|
|
557
|
+
v.forEachFeature((m) => {
|
|
558
|
+
m.get("type") !== "line" && v.removeFeature(m);
|
|
522
559
|
});
|
|
523
|
-
}, Y = (
|
|
524
|
-
new
|
|
560
|
+
}, Y = (d, v) => [
|
|
561
|
+
new te({
|
|
525
562
|
// 扩大交互热区
|
|
526
563
|
image: new et({
|
|
527
|
-
stroke: new
|
|
564
|
+
stroke: new $e({ color: "rgba(0, 0, 0, 0.01)", width: 20 }),
|
|
528
565
|
radius: 3
|
|
529
566
|
})
|
|
530
567
|
}),
|
|
531
568
|
// 轨迹点样式
|
|
532
|
-
new
|
|
569
|
+
new te({
|
|
533
570
|
image: new et({
|
|
534
|
-
fill: new ue({ color:
|
|
535
|
-
stroke: new
|
|
571
|
+
fill: new ue({ color: v }),
|
|
572
|
+
stroke: new $e({ color: "#fff", width: 2 }),
|
|
536
573
|
radius: 3
|
|
537
574
|
})
|
|
538
575
|
})
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
576
|
+
// textStyle,
|
|
577
|
+
], R = (d) => {
|
|
578
|
+
const v = "#E31818", m = "#1890FF", k = "", y = new te({
|
|
579
|
+
text: new Ze({
|
|
542
580
|
font: "Normal 22px map-iconfont",
|
|
543
|
-
text:
|
|
581
|
+
text: Fe(k),
|
|
544
582
|
offsetY: -10,
|
|
545
583
|
fill: new ue({
|
|
546
|
-
color: Number(
|
|
584
|
+
color: Number(d.state) === 0 ? v : Number(d.state) === 1 ? m : ""
|
|
547
585
|
})
|
|
548
586
|
}),
|
|
549
587
|
zIndex: 99
|
|
550
|
-
}),
|
|
551
|
-
return Number(
|
|
552
|
-
}, he = (
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
for (let
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
);
|
|
563
|
-
if (
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
588
|
+
}), S = Lt(""), D = Lt(""), B = [];
|
|
589
|
+
return Number(d.state) === 0 ? B.push(S) : Number(d.state) === 1 && B.push(D), B.push(y), B;
|
|
590
|
+
}, he = (d, v, m, k) => {
|
|
591
|
+
const y = v || [], Z = v.length;
|
|
592
|
+
Z || (y.push(m[0]), y.push(m[m.length - 1]));
|
|
593
|
+
const S = new Set(v.map((D) => `${D.centerPoint[0]},${D.centerPoint[1]}`)), T = [];
|
|
594
|
+
for (let D = 0; D < Z - 1; D++) {
|
|
595
|
+
let B;
|
|
596
|
+
const re = v[D], E = (v[D + 1].index + re.index) / 2;
|
|
597
|
+
if (E % 2 === 0)
|
|
598
|
+
B = m[E].centerPoint;
|
|
599
|
+
else {
|
|
600
|
+
const j = m[Math.floor(E)], Q = m[Math.ceil(E)];
|
|
601
|
+
if (j && Q) {
|
|
602
|
+
const [ne, pe] = j.centerPoint, [Ee, Te] = Q.centerPoint;
|
|
603
|
+
B = [(ne + Ee) / 2, (pe + Te) / 2];
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
if (B) {
|
|
607
|
+
const j = `${B[0]},${B[1]}`;
|
|
608
|
+
if (!S.has(j)) {
|
|
609
|
+
const Q = new me({
|
|
610
|
+
geometry: new de(B)
|
|
611
|
+
});
|
|
612
|
+
Q.set("type", "track_arrow"), Q.setStyle(
|
|
613
|
+
new te({
|
|
614
|
+
text: new Ze({
|
|
615
|
+
font: "700 12px map-iconfont",
|
|
616
|
+
text: Fe(""),
|
|
617
|
+
fill: new ue({ color: k }),
|
|
618
|
+
rotation: bt(
|
|
619
|
+
v[D].center,
|
|
620
|
+
v[D + 1].center
|
|
621
|
+
) * (Math.PI / 180)
|
|
622
|
+
})
|
|
577
623
|
})
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
} catch (O) {
|
|
581
|
-
console.warn("Failed to create arrow at distance", O);
|
|
624
|
+
), T.push(Q), S.add(j);
|
|
625
|
+
}
|
|
582
626
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
627
|
+
}
|
|
628
|
+
return T;
|
|
629
|
+
}, ve = (d) => {
|
|
630
|
+
var Z, S;
|
|
631
|
+
const v = e.getView(), m = (Z = l == null ? void 0 : l.get(d)) == null ? void 0 : Z.getSource(), k = u || (d ? m == null ? void 0 : m.getFeatureById(d) : null);
|
|
632
|
+
if (!k) return;
|
|
633
|
+
const y = (S = k == null ? void 0 : k.getGeometry()) == null ? void 0 : S.getExtent();
|
|
634
|
+
if (!y || y[0] === y[2] || y[1] === y[3]) {
|
|
590
635
|
console.warn("Invalid track extent");
|
|
591
636
|
return;
|
|
592
637
|
}
|
|
593
638
|
try {
|
|
594
|
-
const T =
|
|
595
|
-
if (T <
|
|
596
|
-
const
|
|
597
|
-
|
|
639
|
+
const T = y[2] - y[0], D = y[3] - y[1], B = 1e-4;
|
|
640
|
+
if (T < B || D < B) {
|
|
641
|
+
const E = [(y[0] + y[2]) / 2, (y[1] + y[3]) / 2];
|
|
642
|
+
v.setCenter(E);
|
|
598
643
|
return;
|
|
599
644
|
}
|
|
600
|
-
const re = Ut(
|
|
601
|
-
|
|
645
|
+
const re = Ut(y, Math.max(T, D) * 0.1);
|
|
646
|
+
v.fit(re, {
|
|
602
647
|
maxZoom: ce.max,
|
|
603
648
|
padding: [30, 30, 30, 30]
|
|
604
649
|
// 添加边距
|
|
@@ -606,200 +651,160 @@ const bo = (e) => {
|
|
|
606
651
|
} catch (T) {
|
|
607
652
|
console.error("setTrackViewCenter error:", T);
|
|
608
653
|
}
|
|
609
|
-
}, xe = (
|
|
610
|
-
const
|
|
611
|
-
return [new
|
|
612
|
-
text: new
|
|
654
|
+
}, xe = (d) => {
|
|
655
|
+
const v = "", y = d.index === 0 ? "#fcdc3f" : "#ff0000";
|
|
656
|
+
return [new te({
|
|
657
|
+
text: new Ze({
|
|
613
658
|
font: "Normal 14px map-iconfont",
|
|
614
|
-
text:
|
|
615
|
-
fill: new ue({ color:
|
|
659
|
+
text: Fe(v),
|
|
660
|
+
fill: new ue({ color: y })
|
|
616
661
|
}),
|
|
617
662
|
zIndex: 101
|
|
618
663
|
})];
|
|
619
664
|
}, it = () => {
|
|
620
|
-
console.log("清除所有的轨迹-----"), Ke(), l.forEach((
|
|
621
|
-
var
|
|
622
|
-
(
|
|
623
|
-
}), Object.keys(c).forEach((
|
|
624
|
-
l.delete(
|
|
665
|
+
console.log("清除所有的轨迹-----"), Ke(), l.forEach((v) => {
|
|
666
|
+
var m;
|
|
667
|
+
(m = v.getSource()) == null || m.clear(), e == null || e.removeLayer(v);
|
|
668
|
+
}), Object.keys(c).forEach((v) => {
|
|
669
|
+
l.delete(v), delete c[v];
|
|
625
670
|
});
|
|
626
|
-
}, qe = (
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
const
|
|
630
|
-
for (let
|
|
631
|
-
const
|
|
632
|
-
|
|
671
|
+
}, qe = (d) => {
|
|
672
|
+
const v = l.get(d || r);
|
|
673
|
+
v == null || v.setVisible(!1);
|
|
674
|
+
const m = e.getOverlays().getArray();
|
|
675
|
+
for (let k = 0; k < m.length; ) {
|
|
676
|
+
const y = m[k];
|
|
677
|
+
y.get("class") === "track-label-overlay" ? (y.setPosition(void 0), y.dispose()) : k++;
|
|
633
678
|
}
|
|
634
679
|
Ke();
|
|
635
|
-
},
|
|
636
|
-
const
|
|
637
|
-
id:
|
|
680
|
+
}, Xe = (d, v = De.NM) => {
|
|
681
|
+
const m = {
|
|
682
|
+
id: d,
|
|
638
683
|
length: "--"
|
|
639
|
-
},
|
|
640
|
-
(
|
|
641
|
-
),
|
|
642
|
-
return
|
|
643
|
-
}, Zt = (
|
|
644
|
-
Dt(String(
|
|
645
|
-
}, Dt = (
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
}, st = new
|
|
649
|
-
text: new
|
|
684
|
+
}, y = (c[d] || []).map(
|
|
685
|
+
(S) => Be([S.lon, S.lat], se.data, se.mercator)
|
|
686
|
+
), Z = new Ue(y);
|
|
687
|
+
return m.length = yo(Z, v) || "--", m;
|
|
688
|
+
}, Zt = (d, v) => {
|
|
689
|
+
Dt(String(d), v);
|
|
690
|
+
}, Dt = (d, v) => {
|
|
691
|
+
const m = c[String(d)], k = m == null ? void 0 : m.map((y) => [y.lon, y.lat]);
|
|
692
|
+
k && Gt(k, v);
|
|
693
|
+
}, st = new te({
|
|
694
|
+
text: new Ze({
|
|
650
695
|
font: "700 20px map-iconfont",
|
|
651
|
-
text:
|
|
696
|
+
text: Fe(""),
|
|
652
697
|
fill: new ue({ color: "#ff0000" }),
|
|
653
698
|
rotation: 0
|
|
654
699
|
// 初始旋转角度
|
|
655
700
|
})
|
|
656
|
-
}), Ht = (
|
|
657
|
-
var
|
|
658
|
-
const
|
|
659
|
-
if (i = (i +
|
|
701
|
+
}), Ht = (d, v) => {
|
|
702
|
+
var E, j;
|
|
703
|
+
const m = Number(50 * v), k = ((E = d.frameState) == null ? void 0 : E.time) ?? Date.now(), y = k - A;
|
|
704
|
+
if (i = (i + m * y / 1e6) % 2, A = k, i >= 1) {
|
|
660
705
|
Ke();
|
|
661
706
|
return;
|
|
662
707
|
}
|
|
663
|
-
const
|
|
708
|
+
const Z = M.getCoordinateAt(
|
|
664
709
|
i > 1 ? 2 - i : i
|
|
665
|
-
),
|
|
710
|
+
), S = M.getCoordinateAt(
|
|
666
711
|
i > 1 ? i - 0.01 : i
|
|
667
712
|
), T = M.getCoordinateAt(
|
|
668
713
|
i > 1 ? 2 - i : i + 0.01
|
|
669
|
-
),
|
|
670
|
-
Et(
|
|
714
|
+
), B = bt(
|
|
715
|
+
Et(S, "array"),
|
|
671
716
|
Et(T, "array")
|
|
672
717
|
) * Math.PI / 180;
|
|
673
|
-
(j = st.getText()) == null || j.setRotation(
|
|
674
|
-
const re = It(
|
|
718
|
+
(j = st.getText()) == null || j.setRotation(B), n.setCoordinates(Z);
|
|
719
|
+
const re = It(d);
|
|
675
720
|
re.setStyle(st), re.drawGeometry(n), e == null || e.render();
|
|
676
721
|
}, Wt = () => {
|
|
677
|
-
var
|
|
678
|
-
|
|
722
|
+
var d;
|
|
723
|
+
$ = !0, A = Date.now(), i = 0, n = ((d = t.getGeometry()) == null ? void 0 : d.clone()) || new de([0, 0]), s && (p == null || p.on("postrender", s)), w == null || w.setGeometry(void 0);
|
|
679
724
|
}, Ke = () => {
|
|
680
|
-
|
|
681
|
-
}, Gt = (
|
|
682
|
-
|
|
725
|
+
$ && ($ = !1, w == null || w.setGeometry(void 0), s && p && p.un("postrender", s), p && (e == null || e.removeLayer(p)), p = null, w = null);
|
|
726
|
+
}, Gt = (d, v) => {
|
|
727
|
+
$ && Ke(), x = new Ct({
|
|
683
728
|
factor: 1e6
|
|
684
|
-
}).writeGeometry(new
|
|
729
|
+
}).writeGeometry(new Ue(d)), M = new Ct({
|
|
685
730
|
factor: 1e6
|
|
686
|
-
}).readGeometry(
|
|
731
|
+
}).readGeometry(x, {
|
|
687
732
|
dataProjection: se.data,
|
|
688
733
|
featureProjection: se.mercator
|
|
689
734
|
}), t = new me({
|
|
690
735
|
type: "icon",
|
|
691
736
|
geometry: new de(M.getFirstCoordinate())
|
|
692
737
|
});
|
|
693
|
-
const
|
|
694
|
-
n =
|
|
738
|
+
const m = t.getGeometry();
|
|
739
|
+
n = m ? m.clone() : new de([0, 0]), w = new me({
|
|
695
740
|
type: "geoMarker",
|
|
696
741
|
style: st,
|
|
697
742
|
geometry: n
|
|
698
|
-
}),
|
|
743
|
+
}), p = new Me({
|
|
699
744
|
source: new be({
|
|
700
|
-
features: [
|
|
745
|
+
features: [w]
|
|
701
746
|
})
|
|
702
|
-
}), e == null || e.addLayer(
|
|
703
|
-
}, bt = (
|
|
704
|
-
function
|
|
705
|
-
return 180 * (
|
|
747
|
+
}), e == null || e.addLayer(p), s = (k) => Ht(k, v), Wt();
|
|
748
|
+
}, bt = (d, v, m) => {
|
|
749
|
+
function k(E) {
|
|
750
|
+
return 180 * (E % (2 * Math.PI)) / Math.PI;
|
|
706
751
|
}
|
|
707
|
-
function
|
|
708
|
-
return
|
|
752
|
+
function y(E) {
|
|
753
|
+
return E % 360 * Math.PI / 180;
|
|
709
754
|
}
|
|
710
|
-
function
|
|
755
|
+
function Z(E) {
|
|
711
756
|
var j;
|
|
712
|
-
if (!
|
|
713
|
-
if (!Array.isArray(
|
|
714
|
-
if ((
|
|
715
|
-
return
|
|
716
|
-
if (
|
|
757
|
+
if (!E) throw new Error("Coordinate is required");
|
|
758
|
+
if (!Array.isArray(E)) {
|
|
759
|
+
if ((E == null ? void 0 : E.type) === "Feature" && (E == null ? void 0 : E.geometry) !== null && ((j = E == null ? void 0 : E.geometry) == null ? void 0 : j.type) === "Point")
|
|
760
|
+
return E == null ? void 0 : E.geometry.coordinates;
|
|
761
|
+
if (E.type === "Point") return (E == null ? void 0 : E.coordinates) || [];
|
|
717
762
|
}
|
|
718
|
-
if (Array.isArray(
|
|
719
|
-
return
|
|
763
|
+
if (Array.isArray(E) && E.length >= 2 && !Array.isArray(E[0]) && !Array.isArray(E[1]))
|
|
764
|
+
return E;
|
|
720
765
|
throw new Error(
|
|
721
766
|
"Coordinate must be GeoJSON Point or an Array of numbers"
|
|
722
767
|
);
|
|
723
768
|
}
|
|
724
|
-
function E
|
|
725
|
-
if (
|
|
726
|
-
return function(
|
|
727
|
-
return (
|
|
728
|
-
}(
|
|
729
|
-
const
|
|
730
|
-
return
|
|
769
|
+
function S(E, j, Q = {}) {
|
|
770
|
+
if (Q.final)
|
|
771
|
+
return function(_e, je) {
|
|
772
|
+
return (S(je, _e) + 180) % 360;
|
|
773
|
+
}(E, j);
|
|
774
|
+
const ne = Z(E), pe = Z(j), Ee = y(ne[0]), Te = y(pe[0]), He = y(ne[1]), Re = y(pe[1]), Pe = Math.sin(Te - Ee) * Math.cos(Re), ze = Math.cos(He) * Math.sin(Re) - Math.sin(He) * Math.cos(Re) * Math.cos(Te - Ee);
|
|
775
|
+
return k(Math.atan2(Pe, ze));
|
|
731
776
|
}
|
|
732
|
-
function T(
|
|
733
|
-
return !isNaN(
|
|
777
|
+
function T(E) {
|
|
778
|
+
return !isNaN(E) && E !== null && !Array.isArray(E);
|
|
734
779
|
}
|
|
735
|
-
function
|
|
736
|
-
return
|
|
780
|
+
function D(E, j = {}, Q = {}) {
|
|
781
|
+
return E || console.log("Coordinates are required"), Array.isArray(E) || console.log("Coordinates must be an Array"), E.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!T(E[0]) || !T(E[1])) && console.log("Coordinates must contain numbers"), B({ type: "Point", coordinates: E }, j, Q);
|
|
737
782
|
}
|
|
738
|
-
function
|
|
739
|
-
const
|
|
783
|
+
function B(E, j = {}, Q = {}) {
|
|
784
|
+
const ne = {
|
|
740
785
|
type: "Feature",
|
|
741
786
|
id: "",
|
|
742
787
|
properties: {},
|
|
743
788
|
bbox: {},
|
|
744
789
|
geometry: {}
|
|
745
790
|
};
|
|
746
|
-
return
|
|
791
|
+
return Q.id !== void 0 && (ne.id = Q.id), Q.bbox && (ne.bbox = Q.bbox), ne.properties = j, ne.geometry = E, ne;
|
|
747
792
|
}
|
|
748
|
-
const re =
|
|
793
|
+
const re = S(D(d), D(v), m);
|
|
749
794
|
return re < 0 ? 360 + re : re;
|
|
750
795
|
};
|
|
751
796
|
return {
|
|
752
|
-
render:
|
|
797
|
+
render: P,
|
|
753
798
|
remove: it,
|
|
754
799
|
play: Zt,
|
|
755
800
|
setCenter: ve,
|
|
756
801
|
close: qe,
|
|
757
|
-
getLength:
|
|
758
|
-
handleTrackMapEvent:
|
|
759
|
-
reRenderTrackLine:
|
|
802
|
+
getLength: Xe,
|
|
803
|
+
handleTrackMapEvent: oe,
|
|
804
|
+
reRenderTrackLine: ee,
|
|
760
805
|
getTrackStatus: V
|
|
761
806
|
};
|
|
762
|
-
},
|
|
763
|
-
let c = null;
|
|
764
|
-
const r = async (t) => {
|
|
765
|
-
if (!e || (console.log("vehicleInfo", t), !(t != null && t.lon && (t != null && t.lat)))) return;
|
|
766
|
-
const n = Math.abs(Number(t.lon)) > 180 ? xt(t.lon, t.lat) : [t.lon, t.lat];
|
|
767
|
-
d(t, fe(n));
|
|
768
|
-
const y = e == null ? void 0 : e.getView(), F = new de(n);
|
|
769
|
-
y.setCenter(Xe(F.getCoordinates(), se.data, se.mercator));
|
|
770
|
-
}, d = (t, n) => {
|
|
771
|
-
const y = `${$t}map/car-icon.gif`;
|
|
772
|
-
c || (c = new Ce({
|
|
773
|
-
element: document.createElement("div"),
|
|
774
|
-
positioning: "center-center",
|
|
775
|
-
stopEvent: !1
|
|
776
|
-
// 允许交互事件穿透
|
|
777
|
-
}), e.addOverlay(c));
|
|
778
|
-
const F = c.getElement();
|
|
779
|
-
F.style.backgroundImage = `url(${y})`, F.style.width = "80px", F.style.height = "80px";
|
|
780
|
-
const Z = (t == null ? void 0 : t.drc) || "";
|
|
781
|
-
F.style.transform = `rotate(${Z}deg)`, F.style.backgroundSize = "cover", c == null || c.setPosition(n);
|
|
782
|
-
};
|
|
783
|
-
return {
|
|
784
|
-
location: r,
|
|
785
|
-
remove: () => {
|
|
786
|
-
const t = c == null ? void 0 : c.getElement();
|
|
787
|
-
t && (t.innerHTML = "");
|
|
788
|
-
},
|
|
789
|
-
renderTrack: (t, n, y, F) => {
|
|
790
|
-
l.render(t, n, y, "truck", F || 1e3);
|
|
791
|
-
},
|
|
792
|
-
setCenter: (t) => {
|
|
793
|
-
l.setCenter(t);
|
|
794
|
-
},
|
|
795
|
-
closeTrack: () => {
|
|
796
|
-
l.close();
|
|
797
|
-
},
|
|
798
|
-
playTrack: (t, n) => {
|
|
799
|
-
l.play(t, n);
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
}, Co = () => {
|
|
807
|
+
}, po = () => {
|
|
803
808
|
const e = ge();
|
|
804
809
|
return {
|
|
805
810
|
setProps: (r) => {
|
|
@@ -808,8 +813,8 @@ const bo = (e) => {
|
|
|
808
813
|
getProps: () => e.value
|
|
809
814
|
};
|
|
810
815
|
};
|
|
811
|
-
function
|
|
812
|
-
const l = ge(null), c =
|
|
816
|
+
function Co(e) {
|
|
817
|
+
const l = ge(null), c = Qe(() => ({
|
|
813
818
|
"--overlay-color": "#FFF",
|
|
814
819
|
"--bg-color1": e.colors && e.colors[0] ? e.colors[0] : "#ffffff",
|
|
815
820
|
// 默认第一个颜色
|
|
@@ -817,7 +822,7 @@ function po(e) {
|
|
|
817
822
|
"--bg-color": "#ffffff",
|
|
818
823
|
position: "relative",
|
|
819
824
|
"pointer-events": "none"
|
|
820
|
-
})), r =
|
|
825
|
+
})), r = Qe(() => {
|
|
821
826
|
var o;
|
|
822
827
|
return {
|
|
823
828
|
position: "relative",
|
|
@@ -838,12 +843,12 @@ function po(e) {
|
|
|
838
843
|
animation: e.selected ? e.colors && ((o = e.colors) == null ? void 0 : o.length) >= 2 ? "blink-dual 2s ease-in-out infinite" : "blink-single 1.5s ease-in-out infinite" : "none"
|
|
839
844
|
// "animation": props.selected ? 'blink 1.5s ease-in-out infinite' : 'none', // 动画开关
|
|
840
845
|
};
|
|
841
|
-
}),
|
|
846
|
+
}), a = Qe(() => ({
|
|
842
847
|
width: "14px",
|
|
843
848
|
height: "14px",
|
|
844
849
|
margin: "1px 5px 1px 1px",
|
|
845
850
|
"background-color": "var(--attention-bg)"
|
|
846
|
-
})), s =
|
|
851
|
+
})), s = Qe(() => ({
|
|
847
852
|
position: "absolute",
|
|
848
853
|
top: "0px",
|
|
849
854
|
color: "var(--overlay-color)",
|
|
@@ -871,7 +876,7 @@ function po(e) {
|
|
|
871
876
|
[
|
|
872
877
|
we("div", {
|
|
873
878
|
"data-id": e.id,
|
|
874
|
-
style: e.selected ?
|
|
879
|
+
style: e.selected ? a.value : {}
|
|
875
880
|
}, ""),
|
|
876
881
|
we("div", {
|
|
877
882
|
class: "text",
|
|
@@ -939,27 +944,27 @@ const Vt = (e) => {
|
|
|
939
944
|
return l ? c !== null && +c != 511 && r !== null ? r - +c >= 3 ? ye.right : r - +c <= -3 ? ye.left : ye.front : ye.front : "";
|
|
940
945
|
};
|
|
941
946
|
function Mo(e, l) {
|
|
942
|
-
const { isHighlight: c, shipData: r, color:
|
|
947
|
+
const { isHighlight: c, shipData: r, color: a } = e.getProperties(), s = ot(l), o = nt(l, r, s), h = ((r == null ? void 0 : r.cog) - 90 + 360) % 360, x = Vt(r);
|
|
943
948
|
return {
|
|
944
949
|
featureId: r.id,
|
|
945
950
|
shipType: s,
|
|
946
951
|
isHighlight: !!c,
|
|
947
952
|
scale: o,
|
|
948
|
-
fill:
|
|
953
|
+
fill: a,
|
|
949
954
|
deg: h,
|
|
950
|
-
direct:
|
|
955
|
+
direct: x
|
|
951
956
|
};
|
|
952
957
|
}
|
|
953
|
-
const
|
|
958
|
+
const Ge = /* @__PURE__ */ new Map();
|
|
954
959
|
function Lo(e) {
|
|
955
960
|
return `${e.featureId}_${e.shipType}_${e.isHighlight}_${e.scale}_${e.fill}_${e.deg}_${e.direct}`;
|
|
956
961
|
}
|
|
957
|
-
const
|
|
962
|
+
const Ve = (e, l) => {
|
|
958
963
|
const c = Mo(l, e), r = Lo(c);
|
|
959
|
-
if (
|
|
960
|
-
return
|
|
961
|
-
const { shipData:
|
|
962
|
-
return
|
|
964
|
+
if (Ge.has(r))
|
|
965
|
+
return Ge.get(r);
|
|
966
|
+
const { shipData: a } = l.getProperties(), s = ot(e), o = nt(e, a, s), h = Eo(l, o, s);
|
|
967
|
+
return Ge.set(r, h), h;
|
|
963
968
|
}, ot = (e) => {
|
|
964
969
|
const l = e == null ? void 0 : e.getView().getZoom();
|
|
965
970
|
return l && l <= ce.shipModelMax && l >= ce.shipTriggleMin ? "ship" : "triangle";
|
|
@@ -972,22 +977,22 @@ const nt = (e, l, c) => {
|
|
|
972
977
|
if (Tt === r && c === "triangle")
|
|
973
978
|
return ce.scaleNum;
|
|
974
979
|
if (Tt = r, c === "ship") {
|
|
975
|
-
const { len:
|
|
980
|
+
const { len: a, wid: s } = l, o = 97, h = 20, x = 1 / r, M = a * x / o, t = s * x / h, n = Math.min(M, t);
|
|
976
981
|
return Math.max(0.2, Math.min(2, n));
|
|
977
982
|
}
|
|
978
983
|
return ce.scaleNum;
|
|
979
984
|
}, Eo = (e, l, c) => {
|
|
980
|
-
const { color: r, direct:
|
|
981
|
-
return new
|
|
982
|
-
image: new
|
|
983
|
-
src:
|
|
985
|
+
const { color: r, direct: a, isHighlight: s, shipData: o } = e.getProperties(), h = ((o == null ? void 0 : o.cog) - 90 + 360) % 360;
|
|
986
|
+
return new te({
|
|
987
|
+
image: new Ne({
|
|
988
|
+
src: x(),
|
|
984
989
|
scale: l || ce.scaleNum,
|
|
985
990
|
anchor: [0.5, 0.5],
|
|
986
991
|
rotation: h * Math.PI / 180,
|
|
987
992
|
rotateWithView: !1
|
|
988
993
|
})
|
|
989
994
|
});
|
|
990
|
-
function
|
|
995
|
+
function x() {
|
|
991
996
|
return `data:image/svg+xml;utf8,${encodeURIComponent(M())}`;
|
|
992
997
|
}
|
|
993
998
|
function M() {
|
|
@@ -997,53 +1002,53 @@ const nt = (e, l, c) => {
|
|
|
997
1002
|
<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"
|
|
998
1003
|
fill="${r}" stroke="${s ? "#FF2424" : "black"}" stroke-width="${s ? "2" : "0.578947"}" />
|
|
999
1004
|
<!--path船航向左边或者向前-->
|
|
1000
|
-
${
|
|
1005
|
+
${a === ye.left && `<path d="M30 12L40 12L40 8" stroke="${s ? "#FF2424" : "black"}" stroke-width="2"/>`}
|
|
1001
1006
|
<!--path船航向右边-->
|
|
1002
|
-
${
|
|
1007
|
+
${a === ye.right && `<path d="M30 12L40 12L40 16" stroke="${s ? "#FF2424" : "black"}" stroke-width="2"/>`}
|
|
1003
1008
|
<!--path黑线无左右-->
|
|
1004
|
-
${
|
|
1009
|
+
${a === ye.front && `<path d="M30 12L40 12" stroke="${s ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1005
1010
|
</svg>
|
|
1006
1011
|
`;
|
|
1007
1012
|
case "ship":
|
|
1008
1013
|
return `<svg width="97" height="20" viewBox="0 0 97 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1009
1014
|
<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"
|
|
1010
1015
|
fill="${r}" stroke="${s ? "#FF2424" : "black"}" stroke-width="${s ? "4" : "0.578947"}"/>
|
|
1011
|
-
${
|
|
1012
|
-
${
|
|
1013
|
-
${
|
|
1016
|
+
${a === ye.left && `<path d="M86 10L96 10L96 6" stroke="${s ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1017
|
+
${a === ye.right && `<path d="M86 10L96 10L96 14" stroke="${s ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1018
|
+
${a === ye.front && `<path d="M86 10L96 10" stroke="${s ? "#FF2424" : "black"}" stroke-width="1.5"/>`}
|
|
1014
1019
|
</svg>
|
|
1015
1020
|
`;
|
|
1016
1021
|
default:
|
|
1017
1022
|
return "";
|
|
1018
1023
|
}
|
|
1019
1024
|
}
|
|
1020
|
-
},
|
|
1025
|
+
}, Ye = /* @__PURE__ */ new Map();
|
|
1021
1026
|
function To(e, l) {
|
|
1022
1027
|
const c = ot(l), r = nt(l, e, c);
|
|
1023
1028
|
return `${c}_${r}_${c === "ship" ? 109 : 49}`;
|
|
1024
1029
|
}
|
|
1025
1030
|
const Pt = (e, l) => {
|
|
1026
1031
|
const c = To(l, e);
|
|
1027
|
-
if (
|
|
1028
|
-
return
|
|
1029
|
-
const r = ot(e),
|
|
1032
|
+
if (Ye.has(c))
|
|
1033
|
+
return Ye.get(c);
|
|
1034
|
+
const r = ot(e), a = nt(e, l, r), s = r === "ship" ? 109 : 49, o = `
|
|
1030
1035
|
<svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${s}" viewBox="0 0 49 49" fill="none">
|
|
1031
1036
|
<path d="M1.99982 46.9998L1.99982 1.99982L46.9998 1.99982L46.9998 46.9998L1.99982 46.9998Z" fill="#FF2424" fill-opacity="0.2"/>
|
|
1032
1037
|
<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"/>
|
|
1033
1038
|
</svg>
|
|
1034
|
-
`, h = new
|
|
1035
|
-
image: new
|
|
1039
|
+
`, h = new te({
|
|
1040
|
+
image: new Ne({
|
|
1036
1041
|
src: `data:image/svg+xml;utf8,${encodeURIComponent(o)}`,
|
|
1037
|
-
scale:
|
|
1042
|
+
scale: a,
|
|
1038
1043
|
anchorXUnits: "fraction",
|
|
1039
1044
|
anchorYUnits: "fraction"
|
|
1040
1045
|
})
|
|
1041
1046
|
});
|
|
1042
|
-
return
|
|
1047
|
+
return Ye.set(c, h), h;
|
|
1043
1048
|
};
|
|
1044
1049
|
function Po(e, l, c, r) {
|
|
1045
1050
|
if (l) {
|
|
1046
|
-
const
|
|
1051
|
+
const a = new Ce({
|
|
1047
1052
|
element: c,
|
|
1048
1053
|
positioning: "top-left",
|
|
1049
1054
|
id: "label-" + (r == null ? void 0 : r.id),
|
|
@@ -1053,20 +1058,20 @@ function Po(e, l, c, r) {
|
|
|
1053
1058
|
stopEvent: !1,
|
|
1054
1059
|
className: r != null && r.blinking ? "ship-label-overlay-blinking" : "ship-label-overlay"
|
|
1055
1060
|
});
|
|
1056
|
-
|
|
1061
|
+
a.set("class", "zh-map-ship-overlay"), e.addOverlay(a);
|
|
1057
1062
|
}
|
|
1058
1063
|
}
|
|
1059
|
-
const
|
|
1060
|
-
const { lon: c, lat: r, blinking:
|
|
1061
|
-
c && r && Po(e, fe([c, r]), s, { ...l, blinking:
|
|
1064
|
+
const So = (e, l) => {
|
|
1065
|
+
const { lon: c, lat: r, blinking: a } = l, s = Ot(l);
|
|
1066
|
+
c && r && Po(e, fe([c, r]), s, { ...l, blinking: a });
|
|
1062
1067
|
}, Ot = (e) => {
|
|
1063
1068
|
const l = document.createElement("div");
|
|
1064
1069
|
l.className = "ship-overlay-box", l.style.position = "relative";
|
|
1065
|
-
const { lon: c, lat: r, blinking:
|
|
1070
|
+
const { lon: c, lat: r, blinking: a, blinkingColors: s, name: o } = e, h = ut({
|
|
1066
1071
|
setup() {
|
|
1067
|
-
return
|
|
1072
|
+
return Co({
|
|
1068
1073
|
id: e == null ? void 0 : e.id,
|
|
1069
|
-
selected:
|
|
1074
|
+
selected: a,
|
|
1070
1075
|
name: o,
|
|
1071
1076
|
colors: s || [],
|
|
1072
1077
|
existDevice: e == null ? void 0 : e.existDevice,
|
|
@@ -1076,11 +1081,11 @@ const Fo = (e, l) => {
|
|
|
1076
1081
|
}
|
|
1077
1082
|
});
|
|
1078
1083
|
return Yt(h, l), l;
|
|
1079
|
-
},
|
|
1084
|
+
}, St = (e) => {
|
|
1080
1085
|
const l = [];
|
|
1081
1086
|
return e.existDevice && l.push(""), e.existMobile && l.push(""), e.existWaterGauge && l.push(""), l;
|
|
1082
1087
|
};
|
|
1083
|
-
function
|
|
1088
|
+
function Fo() {
|
|
1084
1089
|
const e = [
|
|
1085
1090
|
"left-top",
|
|
1086
1091
|
"left-middle",
|
|
@@ -1091,12 +1096,12 @@ function So() {
|
|
|
1091
1096
|
];
|
|
1092
1097
|
return e[Math.floor(Math.random() * e.length)];
|
|
1093
1098
|
}
|
|
1094
|
-
const
|
|
1099
|
+
const $o = window.devicePixelRatio || 1, ct = /* @__PURE__ */ new Map();
|
|
1095
1100
|
let We = null, at = null;
|
|
1096
|
-
function
|
|
1097
|
-
const
|
|
1098
|
-
if (ct.has(
|
|
1099
|
-
return ct.get(
|
|
1101
|
+
function No(e, l, c = "left-bottom", r = 10) {
|
|
1102
|
+
const a = `${e}-${l.join(",")}-${c}-${r}`;
|
|
1103
|
+
if (ct.has(a))
|
|
1104
|
+
return ct.get(a);
|
|
1100
1105
|
if (!We) {
|
|
1101
1106
|
We = document.createElement("canvas");
|
|
1102
1107
|
try {
|
|
@@ -1110,45 +1115,45 @@ function Ro(e, l, c = "left-bottom", r = 10) {
|
|
|
1110
1115
|
const s = We, o = at;
|
|
1111
1116
|
if (!o) return "";
|
|
1112
1117
|
s.width = 0, s.height = 0;
|
|
1113
|
-
const h = 2,
|
|
1118
|
+
const h = 2, x = 4, M = 16, t = window.devicePixelRatio || 1, n = "500 12px Arial", w = "12px map-iconfont";
|
|
1114
1119
|
o.font = n;
|
|
1115
|
-
const
|
|
1116
|
-
o.font =
|
|
1117
|
-
const
|
|
1118
|
-
let L,
|
|
1119
|
-
switch (L = M +
|
|
1120
|
+
const A = o.measureText(e).width;
|
|
1121
|
+
o.font = w;
|
|
1122
|
+
const p = l.map((q) => ({ width: o.measureText(Fe(q)).width, height: 14 })), i = p.reduce((q, oe) => q + oe.width, 0), u = l.length * r, b = x + A + i + u + x, f = h + 14 + h * 2;
|
|
1123
|
+
let L, O, z = 0, K = 0, ee = 0, V = 0, C = 0, P = 0;
|
|
1124
|
+
switch (L = M + b, c) {
|
|
1120
1125
|
case "right-top":
|
|
1121
|
-
|
|
1126
|
+
O = M + f, z = 0, K = M + f, ee = M, V = 0, C = M, P = 0;
|
|
1122
1127
|
break;
|
|
1123
1128
|
case "right-middle":
|
|
1124
|
-
|
|
1129
|
+
O = f, z = 0, K = f / 2, ee = M, V = f / 2, C = M, P = 0;
|
|
1125
1130
|
break;
|
|
1126
1131
|
case "right-bottom":
|
|
1127
|
-
|
|
1132
|
+
O = M + f, z = 0, K = 0, ee = M, V = M, C = M, P = M;
|
|
1128
1133
|
break;
|
|
1129
1134
|
case "left-top":
|
|
1130
|
-
|
|
1135
|
+
O = M + f, z = b, K = M, ee = b + M, V = f + M, C = 0, P = 0;
|
|
1131
1136
|
break;
|
|
1132
1137
|
case "left-middle":
|
|
1133
|
-
|
|
1138
|
+
O = f, z = b, K = f / 2, ee = b + M, V = f / 2, C = 0, P = 0;
|
|
1134
1139
|
break;
|
|
1135
1140
|
case "left-bottom":
|
|
1136
|
-
|
|
1141
|
+
O = M + f, z = b, K = f, ee = b + M, V = 0, C = 0, P = M;
|
|
1137
1142
|
break;
|
|
1138
1143
|
}
|
|
1139
|
-
|
|
1140
|
-
const G =
|
|
1141
|
-
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e,
|
|
1142
|
-
let
|
|
1143
|
-
const _ =
|
|
1144
|
-
l.length > 0 && l.forEach((
|
|
1145
|
-
o.fillText(
|
|
1144
|
+
O = O + h, s.width = Math.round(L * t), s.height = Math.round(O * t), o.scale(t, t), o.clearRect(0, 0, L, O), o.beginPath(), o.moveTo(z, K), o.lineTo(ee, V), o.strokeStyle = "#FFF", o.lineWidth = 1, o.stroke(), o.fillStyle = "#FFF", o.fillRect(C, P, b, f), o.font = n, o.textBaseline = "middle";
|
|
1145
|
+
const G = P + h / 2 + f / 2;
|
|
1146
|
+
o.strokeStyle = "#ffffff", o.lineWidth = 1, o.strokeText(e, C + x, G), o.fillStyle = "#000000", o.fillText(e, C + x, G), o.font = w, o.fillStyle = "#3370ff";
|
|
1147
|
+
let W = C + x + A + r;
|
|
1148
|
+
const _ = P + f / 2;
|
|
1149
|
+
l.length > 0 && l.forEach((q, oe) => {
|
|
1150
|
+
o.fillText(Fe(q), W, _), W += p[oe].width + r;
|
|
1146
1151
|
});
|
|
1147
1152
|
const X = s.toDataURL("image/png");
|
|
1148
|
-
return ct.set(
|
|
1153
|
+
return ct.set(a, X), X;
|
|
1149
1154
|
}
|
|
1150
|
-
const
|
|
1151
|
-
const { name: c, rightIcons: r, selected:
|
|
1155
|
+
const Ft = (e, l) => {
|
|
1156
|
+
const { name: c, rightIcons: r, selected: a } = e.getProperties(), s = l !== 1 ? Fo() : "right-top", o = No(c, r, s);
|
|
1152
1157
|
let h = [0, 0];
|
|
1153
1158
|
switch (s) {
|
|
1154
1159
|
case "right-top":
|
|
@@ -1170,18 +1175,18 @@ const St = (e, l) => {
|
|
|
1170
1175
|
h = [1, 0];
|
|
1171
1176
|
break;
|
|
1172
1177
|
}
|
|
1173
|
-
return new
|
|
1174
|
-
image: new
|
|
1178
|
+
return new te({
|
|
1179
|
+
image: new Ne({
|
|
1175
1180
|
src: o,
|
|
1176
1181
|
anchor: h,
|
|
1177
1182
|
displacement: [0, 0],
|
|
1178
|
-
scale: 1 /
|
|
1183
|
+
scale: 1 / $o,
|
|
1179
1184
|
anchorXUnits: "fraction",
|
|
1180
1185
|
anchorYUnits: "fraction"
|
|
1181
1186
|
}),
|
|
1182
|
-
zIndex:
|
|
1187
|
+
zIndex: a ? 100 : 10
|
|
1183
1188
|
});
|
|
1184
|
-
},
|
|
1189
|
+
}, Ro = (e) => {
|
|
1185
1190
|
e.getInteractions().forEach((l) => {
|
|
1186
1191
|
l instanceof mt && l.setActive(!1);
|
|
1187
1192
|
});
|
|
@@ -1189,23 +1194,23 @@ const St = (e, l) => {
|
|
|
1189
1194
|
e.getInteractions().forEach((l) => {
|
|
1190
1195
|
l instanceof mt && l.setActive(!0);
|
|
1191
1196
|
});
|
|
1192
|
-
},
|
|
1197
|
+
}, Le = (e, l) => {
|
|
1193
1198
|
const c = e.getViewport();
|
|
1194
1199
|
c && (c.style.cursor = l);
|
|
1195
1200
|
}, Vo = (e, l) => {
|
|
1196
|
-
const c = ge([]), r = ge("km"),
|
|
1201
|
+
const c = ge([]), r = ge("km"), a = (V) => {
|
|
1197
1202
|
r.value = V;
|
|
1198
1203
|
};
|
|
1199
1204
|
let s, o = "close";
|
|
1200
1205
|
const h = () => {
|
|
1201
|
-
|
|
1206
|
+
Le(e, "crosshair"), t(), Ro(e), e.on("pointermove", $), e.getViewport().addEventListener("mouseout", () => {
|
|
1202
1207
|
s && s.classList.add("hidden");
|
|
1203
|
-
}),
|
|
1208
|
+
}), p(), o = "open";
|
|
1204
1209
|
};
|
|
1205
|
-
let
|
|
1210
|
+
let x, M;
|
|
1206
1211
|
const t = () => {
|
|
1207
|
-
|
|
1208
|
-
source:
|
|
1212
|
+
x = new be(), M = new Me({
|
|
1213
|
+
source: x,
|
|
1209
1214
|
zIndex: 1e3,
|
|
1210
1215
|
style: {
|
|
1211
1216
|
"fill-color": "rgba(255, 255, 255, 0.2)",
|
|
@@ -1216,30 +1221,30 @@ const St = (e, l) => {
|
|
|
1216
1221
|
}
|
|
1217
1222
|
}), e == null || e.addLayer(M);
|
|
1218
1223
|
};
|
|
1219
|
-
let n,
|
|
1220
|
-
const
|
|
1224
|
+
let n, w;
|
|
1225
|
+
const $ = (V) => {
|
|
1221
1226
|
if (V.dragging)
|
|
1222
1227
|
return;
|
|
1223
|
-
let
|
|
1224
|
-
n && (
|
|
1228
|
+
let C = "点击选择起点";
|
|
1229
|
+
n && (C = "单击继续,双击结束"), s && (s.innerHTML = C, w.setPosition(V.coordinate), s.classList.remove("hidden"));
|
|
1225
1230
|
};
|
|
1226
|
-
let
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
source:
|
|
1231
|
+
let A;
|
|
1232
|
+
const p = () => {
|
|
1233
|
+
A = new Ie({
|
|
1234
|
+
source: x,
|
|
1230
1235
|
type: "LineString",
|
|
1231
|
-
style: new
|
|
1236
|
+
style: new te({
|
|
1232
1237
|
fill: new ue({
|
|
1233
1238
|
color: "rgba(255, 255, 255, 0.2)"
|
|
1234
1239
|
}),
|
|
1235
|
-
stroke: new
|
|
1240
|
+
stroke: new $e({
|
|
1236
1241
|
color: "rgba(255,204,51)",
|
|
1237
1242
|
lineDash: [10, 10],
|
|
1238
1243
|
width: 2
|
|
1239
1244
|
}),
|
|
1240
1245
|
image: new et({
|
|
1241
1246
|
radius: 5,
|
|
1242
|
-
stroke: new
|
|
1247
|
+
stroke: new $e({
|
|
1243
1248
|
color: "rgba(0, 0, 0, 0.7)"
|
|
1244
1249
|
}),
|
|
1245
1250
|
fill: new ue({
|
|
@@ -1248,151 +1253,151 @@ const St = (e, l) => {
|
|
|
1248
1253
|
})
|
|
1249
1254
|
}),
|
|
1250
1255
|
// 添加条件函数,判断是否应该出发点绘制
|
|
1251
|
-
condition: (
|
|
1252
|
-
const
|
|
1253
|
-
return
|
|
1256
|
+
condition: (C) => {
|
|
1257
|
+
const P = C.originalEvent.target;
|
|
1258
|
+
return P.className !== "ol-tooltip-measure" && P.className !== "ol-tooltip-delete-button";
|
|
1254
1259
|
}
|
|
1255
|
-
}), e == null || e.addInteraction(
|
|
1260
|
+
}), e == null || e.addInteraction(A), f(), L();
|
|
1256
1261
|
let V;
|
|
1257
|
-
|
|
1262
|
+
A.on("drawstart", function(C) {
|
|
1258
1263
|
var G;
|
|
1259
|
-
n =
|
|
1260
|
-
let
|
|
1261
|
-
V = (G = n.getGeometry()) == null ? void 0 : G.on("change", function(
|
|
1262
|
-
const _ =
|
|
1263
|
-
|
|
1264
|
+
n = C.feature, n.set("randomId", i());
|
|
1265
|
+
let P;
|
|
1266
|
+
V = (G = n.getGeometry()) == null ? void 0 : G.on("change", function(W) {
|
|
1267
|
+
const _ = W.target, X = At(_, r.value);
|
|
1268
|
+
P = _.getLastCoordinate(), u && X && (u.innerHTML = X), b.setPosition(P);
|
|
1264
1269
|
});
|
|
1265
|
-
}),
|
|
1266
|
-
var
|
|
1270
|
+
}), A.on("drawend", function() {
|
|
1271
|
+
var C, P, G;
|
|
1267
1272
|
if (u && (u.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), u != null && u.innerHTML) {
|
|
1268
|
-
const
|
|
1269
|
-
c.value.push({ id:
|
|
1273
|
+
const W = (n == null ? void 0 : n.get("randomId")) || i();
|
|
1274
|
+
c.value.push({ id: W, value: u == null ? void 0 : u.innerHTML }), u.innerHTML = `${u.innerHTML}<div class="ol-tooltip-delete-button" data-id="${W}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
1270
1275
|
}
|
|
1271
|
-
(
|
|
1276
|
+
(C = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || C.addEventListener("click", (W) => {
|
|
1272
1277
|
var X;
|
|
1273
|
-
|
|
1274
|
-
const _ = (X =
|
|
1278
|
+
W.preventDefault(), W.stopPropagation();
|
|
1279
|
+
const _ = (X = W.target) == null ? void 0 : X.getAttribute("data-id");
|
|
1275
1280
|
_ && z(_);
|
|
1276
|
-
}),
|
|
1281
|
+
}), b.setOffset([0, -7]), n = null, u = null, f(), V && gt(V), (G = (P = l.getProps()) == null ? void 0 : P.lineDrawEnd) == null || G.call(P, c.value), s.innerHTML = "";
|
|
1277
1282
|
});
|
|
1278
1283
|
}, i = () => Math.random().toString(36).substring(2, 9);
|
|
1279
|
-
let u,
|
|
1284
|
+
let u, b;
|
|
1280
1285
|
const f = () => {
|
|
1281
|
-
u != null && u.parentNode && u.parentNode.removeChild(u), u = document.createElement("div"), u.className = "ol-tooltip ol-tooltip-measure",
|
|
1286
|
+
u != null && u.parentNode && u.parentNode.removeChild(u), u = document.createElement("div"), u.className = "ol-tooltip ol-tooltip-measure", b = new Ce({
|
|
1282
1287
|
element: u,
|
|
1283
1288
|
offset: [0, -15],
|
|
1284
1289
|
positioning: "bottom-center",
|
|
1285
1290
|
stopEvent: !1,
|
|
1286
1291
|
insertFirst: !1
|
|
1287
|
-
}), e == null || e.addOverlay(
|
|
1292
|
+
}), e == null || e.addOverlay(b);
|
|
1288
1293
|
}, L = () => {
|
|
1289
|
-
s != null && s.parentNode && s.parentNode.removeChild(s), s = document.createElement("div"), s.className = "ol-tooltip hidden",
|
|
1294
|
+
s != null && s.parentNode && s.parentNode.removeChild(s), s = document.createElement("div"), s.className = "ol-tooltip hidden", w = new Ce({
|
|
1290
1295
|
element: s,
|
|
1291
1296
|
offset: [15, 0],
|
|
1292
1297
|
positioning: "center-left",
|
|
1293
1298
|
stopEvent: !1
|
|
1294
|
-
}), e == null || e.addOverlay(
|
|
1295
|
-
},
|
|
1296
|
-
c.value.forEach((V,
|
|
1297
|
-
var
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
const G =
|
|
1301
|
-
G[
|
|
1302
|
-
}),
|
|
1299
|
+
}), e == null || e.addOverlay(w);
|
|
1300
|
+
}, O = () => {
|
|
1301
|
+
c.value.forEach((V, C) => {
|
|
1302
|
+
var W, _;
|
|
1303
|
+
const P = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1304
|
+
P[C] && ((_ = (W = P[C]) == null ? void 0 : W.parentNode) == null || _.removeChild(P[C]));
|
|
1305
|
+
const G = x.getFeatures();
|
|
1306
|
+
G[C] && x.removeFeature(G[C]);
|
|
1307
|
+
}), K(), zo(e), o = "close", Le(e, "grab");
|
|
1303
1308
|
}, z = (V) => {
|
|
1304
|
-
var
|
|
1305
|
-
const
|
|
1306
|
-
if (
|
|
1307
|
-
c.value.splice(
|
|
1309
|
+
var P, G, W, _;
|
|
1310
|
+
const C = c.value.findIndex((X) => X.id === V);
|
|
1311
|
+
if (C !== -1) {
|
|
1312
|
+
c.value.splice(C, 1);
|
|
1308
1313
|
const X = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
1309
|
-
X[
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1314
|
+
X[C] && ((G = (P = X[C]) == null ? void 0 : P.parentNode) == null || G.removeChild(X[C]));
|
|
1315
|
+
const q = x.getFeatures();
|
|
1316
|
+
q[C] && x.removeFeature(q[C]);
|
|
1312
1317
|
}
|
|
1313
|
-
(_ = (
|
|
1314
|
-
},
|
|
1318
|
+
(_ = (W = l.getProps()) == null ? void 0 : W.lineDrawEnd) == null || _.call(W, c.value);
|
|
1319
|
+
}, K = () => {
|
|
1315
1320
|
if (c.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((V) => {
|
|
1316
|
-
var
|
|
1317
|
-
(
|
|
1318
|
-
}),
|
|
1319
|
-
const V = e.getInteractions().getArray().find((
|
|
1321
|
+
var C;
|
|
1322
|
+
(C = V == null ? void 0 : V.parentNode) == null || C.removeChild(V);
|
|
1323
|
+
}), x == null || x.clear(), A) {
|
|
1324
|
+
const V = e.getInteractions().getArray().find((C) => Mt(C) === Mt(A));
|
|
1320
1325
|
V && e.removeInteraction(V);
|
|
1321
1326
|
}
|
|
1322
1327
|
e.removeLayer(M), s != null && s.parentNode && s.parentNode.removeChild(s), u != null && u.parentNode && u.parentNode.removeChild(u);
|
|
1323
1328
|
};
|
|
1324
1329
|
return {
|
|
1325
1330
|
open: h,
|
|
1326
|
-
close:
|
|
1331
|
+
close: O,
|
|
1327
1332
|
deleteLine: z,
|
|
1328
|
-
setUnit:
|
|
1333
|
+
setUnit: a,
|
|
1329
1334
|
getState: () => o
|
|
1330
1335
|
};
|
|
1331
1336
|
}, At = (e, l) => {
|
|
1332
1337
|
const r = yt(e);
|
|
1333
|
-
let
|
|
1338
|
+
let a = "";
|
|
1334
1339
|
switch (l) {
|
|
1335
1340
|
case "m":
|
|
1336
|
-
|
|
1341
|
+
a = `${Math.round(r * 100) / 100} m`;
|
|
1337
1342
|
break;
|
|
1338
1343
|
case "km":
|
|
1339
|
-
|
|
1344
|
+
a = `${Math.round(r / 1e3 * 100) / 100} km`;
|
|
1340
1345
|
break;
|
|
1341
1346
|
case "nm":
|
|
1342
|
-
|
|
1347
|
+
a = (Math.round(r / 1e3 * 100) / 100 / 1.852).toFixed(2) + " nm";
|
|
1343
1348
|
break;
|
|
1344
1349
|
}
|
|
1345
|
-
return
|
|
1350
|
+
return a;
|
|
1346
1351
|
}, Oo = (e, l) => {
|
|
1347
|
-
let c, r,
|
|
1352
|
+
let c, r, a = "close";
|
|
1348
1353
|
const s = () => {
|
|
1349
|
-
|
|
1354
|
+
K(), a = "open", o(), Le(e, "crosshair");
|
|
1350
1355
|
}, o = () => {
|
|
1351
|
-
M(),
|
|
1356
|
+
M(), b(), O(), A();
|
|
1352
1357
|
};
|
|
1353
|
-
let h = null,
|
|
1358
|
+
let h = null, x = null;
|
|
1354
1359
|
const M = () => {
|
|
1355
|
-
if (h &&
|
|
1356
|
-
const V = new be(),
|
|
1360
|
+
if (h && x) return;
|
|
1361
|
+
const V = new be(), C = new Me({
|
|
1357
1362
|
source: V,
|
|
1358
|
-
style: new
|
|
1359
|
-
stroke: new
|
|
1363
|
+
style: new te({
|
|
1364
|
+
stroke: new $e({
|
|
1360
1365
|
color: "#fbcc33",
|
|
1361
1366
|
width: 2
|
|
1362
1367
|
})
|
|
1363
1368
|
}),
|
|
1364
1369
|
zIndex: 1e3
|
|
1365
1370
|
});
|
|
1366
|
-
h =
|
|
1367
|
-
|
|
1371
|
+
h = C, x = V, e.on("pointermove", n), e.addLayer(C), e.on(["dblclick"], function(P) {
|
|
1372
|
+
w && (P.stopPropagation(), P.preventDefault());
|
|
1368
1373
|
});
|
|
1369
1374
|
};
|
|
1370
1375
|
let t;
|
|
1371
1376
|
const n = (V) => {
|
|
1372
1377
|
if (V.dragging) return;
|
|
1373
|
-
const
|
|
1374
|
-
f && (f.innerHTML =
|
|
1378
|
+
const C = t ? "单击继续,双击结束" : "点击选择起点";
|
|
1379
|
+
f && (f.innerHTML = C, L.setPosition(V.coordinate));
|
|
1375
1380
|
};
|
|
1376
|
-
let
|
|
1377
|
-
const
|
|
1381
|
+
let w, $ = !1;
|
|
1382
|
+
const A = () => {
|
|
1378
1383
|
if (c) {
|
|
1379
1384
|
f != null && f.parentNode && f.parentNode.removeChild(f);
|
|
1380
|
-
const
|
|
1381
|
-
if (!
|
|
1382
|
-
const
|
|
1385
|
+
const C = c.getGeometry();
|
|
1386
|
+
if (!C) return;
|
|
1387
|
+
const P = p(C, "nm");
|
|
1383
1388
|
i && (i.innerHTML = `
|
|
1384
|
-
<span class="text">面积:${
|
|
1389
|
+
<span class="text">面积:${P}${$ ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1385
1390
|
`), i && (i.innerHTML += '<span class="delete-icon" ><i class="map-iconfont icon-delete" /></div>');
|
|
1386
|
-
const G =
|
|
1387
|
-
if (u.setPosition(
|
|
1391
|
+
const G = C.getCoordinates(), W = G[0][G[0].length - 2];
|
|
1392
|
+
if (u.setPosition(W), h) {
|
|
1388
1393
|
const X = h.getSource();
|
|
1389
1394
|
X && c && (X.clear(), X.addFeature(c));
|
|
1390
1395
|
}
|
|
1391
1396
|
setTimeout(() => {
|
|
1392
1397
|
var X;
|
|
1393
1398
|
(X = document.querySelector(".delete-icon")) == null || X.addEventListener("click", () => {
|
|
1394
|
-
var
|
|
1395
|
-
z(), (
|
|
1399
|
+
var q, oe;
|
|
1400
|
+
z(), (oe = (q = l.getProps()) == null ? void 0 : q.areaDrawEnd) == null || oe.call(q, []);
|
|
1396
1401
|
});
|
|
1397
1402
|
}, 0);
|
|
1398
1403
|
const _ = to(c.getGeometry().getExtent());
|
|
@@ -1402,8 +1407,8 @@ const St = (e, l) => {
|
|
|
1402
1407
|
const V = {
|
|
1403
1408
|
type: "Polygon",
|
|
1404
1409
|
trace: !0,
|
|
1405
|
-
style: [new
|
|
1406
|
-
stroke: new
|
|
1410
|
+
style: [new te({
|
|
1411
|
+
stroke: new $e({
|
|
1407
1412
|
color: "rgba(255, 255, 255, 1)",
|
|
1408
1413
|
width: 1.5,
|
|
1409
1414
|
lineDash: [10, 10]
|
|
@@ -1411,74 +1416,74 @@ const St = (e, l) => {
|
|
|
1411
1416
|
fill: new ue({
|
|
1412
1417
|
color: "rgba(255, 255, 255, 0.25)"
|
|
1413
1418
|
})
|
|
1414
|
-
}), new
|
|
1419
|
+
}), new te({
|
|
1415
1420
|
image: new et({
|
|
1416
1421
|
radius: 5,
|
|
1417
1422
|
fill: new ue({
|
|
1418
1423
|
color: "rgb(51,112,255, 1)"
|
|
1419
1424
|
})
|
|
1420
1425
|
}),
|
|
1421
|
-
geometry: function(
|
|
1422
|
-
const
|
|
1423
|
-
return new oo(
|
|
1426
|
+
geometry: function(C) {
|
|
1427
|
+
const P = C.getGeometry().getCoordinates();
|
|
1428
|
+
return new oo(P);
|
|
1424
1429
|
}
|
|
1425
1430
|
})]
|
|
1426
1431
|
};
|
|
1427
|
-
V.source =
|
|
1428
|
-
var
|
|
1429
|
-
t =
|
|
1430
|
-
const
|
|
1431
|
-
if (
|
|
1432
|
+
V.source = x, w = new Ie(V), e == null || e.addInteraction(w), w.on("drawstart", (C) => {
|
|
1433
|
+
var P;
|
|
1434
|
+
t = C.feature, r = (P = t.getGeometry()) == null ? void 0 : P.on("change", (G) => {
|
|
1435
|
+
const W = G.target, _ = p(W, "nm"), q = W.getCoordinates()[0], oe = new Ue([q[q.length - 2], q[q.length - 1]]), ke = At(oe, "nm");
|
|
1436
|
+
if ($ = Number(yt(oe) / 1e3) > 150, !_) return;
|
|
1432
1437
|
const ie = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1433
1438
|
i && (i.innerHTML = `
|
|
1434
1439
|
<div class="text">
|
|
1435
1440
|
面积:${_}
|
|
1436
|
-
${
|
|
1441
|
+
${$ ? ie : ""}
|
|
1437
1442
|
</div>
|
|
1438
1443
|
`), f && (f.innerHTML = `
|
|
1439
1444
|
<div class="text">
|
|
1440
1445
|
面积:${_}
|
|
1441
1446
|
</div>
|
|
1442
|
-
<div class="text ${
|
|
1443
|
-
线段 ${
|
|
1444
|
-
${
|
|
1447
|
+
<div class="text ${$ ? "error" : ""}">
|
|
1448
|
+
线段 ${q.length - 2}: ${ke}
|
|
1449
|
+
${$ ? ie : ""}
|
|
1445
1450
|
</div>
|
|
1446
1451
|
<div>
|
|
1447
1452
|
<span class="text">单击继续,双击结束</span>
|
|
1448
1453
|
</div>
|
|
1449
1454
|
`);
|
|
1450
1455
|
});
|
|
1451
|
-
}),
|
|
1452
|
-
var X,
|
|
1453
|
-
if (!
|
|
1454
|
-
i && !c && (i.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), c =
|
|
1455
|
-
const
|
|
1456
|
+
}), w.on("drawend", (C) => {
|
|
1457
|
+
var X, q, oe, ke;
|
|
1458
|
+
if (!C.feature.getGeometry()) return;
|
|
1459
|
+
i && !c && (i.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), c = C.feature, u.setOffset([10, 0]);
|
|
1460
|
+
const W = C.feature.getGeometry().getCoordinates(), _ = W[0][W[0].length - 2];
|
|
1456
1461
|
if (u.setPosition(_), f != null && f.parentNode && f.parentNode.removeChild(f), (X = l.getProps()) != null && X.areaDrawEnd) {
|
|
1457
|
-
const ie =
|
|
1458
|
-
(
|
|
1462
|
+
const ie = W[0].map((ae) => Be(ae, se.mercator, se.data));
|
|
1463
|
+
(oe = (q = l.getProps()) == null ? void 0 : q.areaDrawEnd) == null || oe.call(q, ie);
|
|
1459
1464
|
}
|
|
1460
|
-
|
|
1465
|
+
w && (w.setActive(!1), e == null || e.removeInteraction(w), (e == null ? void 0 : e.getInteractions()).forEach((ae) => {
|
|
1461
1466
|
ae instanceof Ie && (ae.setActive(!1), e == null || e.removeInteraction(ae));
|
|
1462
1467
|
})), r && gt(r), (ke = document.querySelector(".delete-icon")) == null || ke.addEventListener("click", () => {
|
|
1463
1468
|
var ie, ae;
|
|
1464
1469
|
z(), (ae = (ie = l.getProps()) == null ? void 0 : ie.areaDrawEnd) == null || ae.call(ie, []);
|
|
1465
1470
|
});
|
|
1466
1471
|
});
|
|
1467
|
-
},
|
|
1468
|
-
const
|
|
1469
|
-
switch (
|
|
1472
|
+
}, p = (V, C) => {
|
|
1473
|
+
const P = eo(V);
|
|
1474
|
+
switch (C) {
|
|
1470
1475
|
case "km":
|
|
1471
|
-
return
|
|
1476
|
+
return P > 1e4 ? Math.round(P / 1e6 * 100) / 100 + " km<sup>2</sup>" : Math.round(P * 100) / 100 + " m<sup>2</sup>";
|
|
1472
1477
|
case "nm": {
|
|
1473
|
-
if (
|
|
1478
|
+
if (P < 0.01)
|
|
1474
1479
|
return "0 nm<sup>2</sup>";
|
|
1475
|
-
const G =
|
|
1476
|
-
return G >= 0.01 ? (Math.round(G * 100) / 100).toFixed(2) + " nm<sup>2</sup>" :
|
|
1480
|
+
const G = P / (1852 * 1852);
|
|
1481
|
+
return G >= 0.01 ? (Math.round(G * 100) / 100).toFixed(2) + " nm<sup>2</sup>" : P >= 1 ? (Math.round(P * 100) / 100).toFixed(2) + " m<sup>2</sup>" : (Math.round(P * 1e4) / 100).toFixed(2) + " cm<sup>2</sup>";
|
|
1477
1482
|
}
|
|
1478
1483
|
}
|
|
1479
1484
|
};
|
|
1480
1485
|
let i, u;
|
|
1481
|
-
const
|
|
1486
|
+
const b = () => {
|
|
1482
1487
|
i != null && i.parentNode && i.parentNode.removeChild(i), i = document.createElement("div"), i.style.display = "flex", i.className = "ol-tooltip ol-tooltip-draw-polygon", u = new Ce({
|
|
1483
1488
|
element: i,
|
|
1484
1489
|
offset: [0, -15],
|
|
@@ -1488,7 +1493,7 @@ const St = (e, l) => {
|
|
|
1488
1493
|
}), e == null || e.addOverlay(u);
|
|
1489
1494
|
};
|
|
1490
1495
|
let f, L;
|
|
1491
|
-
const
|
|
1496
|
+
const O = () => {
|
|
1492
1497
|
f != null && f.parentNode && (f.parentNode.removeChild(f), f.parentNode.addEventListener("click", (V) => {
|
|
1493
1498
|
V.preventDefault(), V.stopPropagation();
|
|
1494
1499
|
})), f = document.createElement("div"), f.className = "ol-tooltip ol-help-tooltip pointer-none", L = new Ce({
|
|
@@ -1499,26 +1504,26 @@ const St = (e, l) => {
|
|
|
1499
1504
|
}), e == null || e.addOverlay(L);
|
|
1500
1505
|
}, z = () => {
|
|
1501
1506
|
c = null, s();
|
|
1502
|
-
},
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
}),
|
|
1507
|
+
}, K = () => {
|
|
1508
|
+
a = "close", e.un("pointermove", n), t = null, w && (w.abortDrawing(), console.log("abortDrawing"), w.setActive(!1), (e == null ? void 0 : e.getInteractions()).forEach((C) => {
|
|
1509
|
+
C instanceof Ie && (C.setActive(!1), e == null || e.removeInteraction(C));
|
|
1510
|
+
}), w = null), r && gt(r), r = void 0, x == null || x.clear(), x = null, h && e.getAllLayers().includes(h) && (e.removeLayer(h), h = null), f != null && f.parentElement && (f.innerHTML = "", f.parentElement.removeChild(f), f = null), i != null && i.parentElement && (i.innerHTML = "", i.parentElement.removeChild(i), i = null), L && e.removeOverlay(L), u && e.removeOverlay(u), Le(e, "grab");
|
|
1506
1511
|
};
|
|
1507
1512
|
return {
|
|
1508
1513
|
open: s,
|
|
1509
|
-
close:
|
|
1514
|
+
close: K,
|
|
1510
1515
|
reset: z,
|
|
1511
|
-
getState: () =>
|
|
1516
|
+
getState: () => a
|
|
1512
1517
|
};
|
|
1513
|
-
}, Ao = (e, l, c, r,
|
|
1518
|
+
}, Ao = (e, l, c, r, a) => {
|
|
1514
1519
|
let s = null, o = null;
|
|
1515
|
-
const h = new be(),
|
|
1520
|
+
const h = new be(), x = new no({
|
|
1516
1521
|
source: h,
|
|
1517
1522
|
className: "zh-map--ship-layer",
|
|
1518
1523
|
renderBuffer: 300,
|
|
1519
1524
|
zIndex: 101,
|
|
1520
1525
|
properties: { layerType: le.SHIP }
|
|
1521
|
-
}), M = new be(), t = new
|
|
1526
|
+
}), M = new be(), t = new Me({
|
|
1522
1527
|
source: M,
|
|
1523
1528
|
className: "zh-map--ship-label-layer",
|
|
1524
1529
|
zIndex: 102,
|
|
@@ -1526,234 +1531,234 @@ const St = (e, l) => {
|
|
|
1526
1531
|
updateWhileAnimating: !1,
|
|
1527
1532
|
properties: { layerType: le.SHIP },
|
|
1528
1533
|
declutter: !0
|
|
1529
|
-
}), n = new be(),
|
|
1534
|
+
}), n = new be(), w = new Me({
|
|
1530
1535
|
source: n,
|
|
1531
1536
|
className: "zh-map--ship-selected-layer",
|
|
1532
1537
|
zIndex: 999
|
|
1533
1538
|
});
|
|
1534
|
-
e == null || e.addLayer(
|
|
1535
|
-
let
|
|
1539
|
+
e == null || e.addLayer(x), e == null || e.addLayer(t), e == null || e.addLayer(w);
|
|
1540
|
+
let $ = null, A = null, p = null, i = "", u = {}, b = {};
|
|
1536
1541
|
const f = (g) => {
|
|
1537
1542
|
if (!g || !e) return;
|
|
1538
|
-
const
|
|
1543
|
+
const N = (o == null ? void 0 : o.id) || (s == null ? void 0 : s.get("id"));
|
|
1539
1544
|
if (o) {
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1545
|
+
const F = g.filter((H) => H.id === N);
|
|
1546
|
+
F.length === 0 ? g.push(o) : o = F[0];
|
|
1542
1547
|
}
|
|
1543
|
-
V(), ie(g),
|
|
1548
|
+
V(), ie(g), K(), L(g);
|
|
1544
1549
|
}, L = (g) => {
|
|
1545
|
-
Array.from(
|
|
1546
|
-
const
|
|
1547
|
-
g.find((J) => J.id ===
|
|
1550
|
+
Array.from(Ge.keys()).forEach((N) => {
|
|
1551
|
+
const F = N.split("_")[0];
|
|
1552
|
+
g.find((J) => J.id === F) || Ge.delete(N);
|
|
1548
1553
|
});
|
|
1549
|
-
},
|
|
1550
|
-
Array.from(
|
|
1551
|
-
|
|
1554
|
+
}, O = () => {
|
|
1555
|
+
Array.from(Ye.keys()).forEach((g) => {
|
|
1556
|
+
Ye.delete(g);
|
|
1552
1557
|
});
|
|
1553
1558
|
}, z = (g) => {
|
|
1554
|
-
var
|
|
1555
|
-
const
|
|
1556
|
-
geometry: new de(
|
|
1559
|
+
var R;
|
|
1560
|
+
const N = (o == null ? void 0 : o.id) || (s == null ? void 0 : s.get("id")), F = fe([g == null ? void 0 : g.lon, g == null ? void 0 : g.lat]), H = ((R = b[g.id]) == null ? void 0 : R.blinkColors) || [], U = H[H.length - 1] || g.fill || "#04C900", I = Vt(g), Y = new me({
|
|
1561
|
+
geometry: new de(F),
|
|
1557
1562
|
// 船舶数据
|
|
1558
1563
|
shipData: g,
|
|
1559
1564
|
id: g.id,
|
|
1560
1565
|
name: g.cnname || g.enname || g.name || g.id || "未命名船舶",
|
|
1561
|
-
selected: g.id ===
|
|
1566
|
+
selected: g.id === N,
|
|
1562
1567
|
// 图标
|
|
1563
|
-
rightIcons:
|
|
1568
|
+
rightIcons: St(g),
|
|
1564
1569
|
// 船舶颜色
|
|
1565
1570
|
color: U,
|
|
1566
1571
|
// 船艏向的方向
|
|
1567
|
-
direct:
|
|
1572
|
+
direct: I,
|
|
1568
1573
|
// 高亮
|
|
1569
1574
|
isHighlight: !1
|
|
1570
1575
|
});
|
|
1571
|
-
return Y.set("clickGeometry", new lo(
|
|
1572
|
-
},
|
|
1576
|
+
return Y.set("clickGeometry", new lo(F)), Y;
|
|
1577
|
+
}, K = () => {
|
|
1573
1578
|
if (o && e && o) {
|
|
1574
1579
|
n.getFeatures().length > 0 && n.clear();
|
|
1575
|
-
const g = fe([o == null ? void 0 : o.lon, o == null ? void 0 : o.lat]),
|
|
1580
|
+
const g = fe([o == null ? void 0 : o.lon, o == null ? void 0 : o.lat]), N = new me({
|
|
1576
1581
|
geometry: new de(g),
|
|
1577
1582
|
id: o.id
|
|
1578
1583
|
});
|
|
1579
|
-
|
|
1584
|
+
N.setStyle(Pt(e, o)), n.addFeature(N);
|
|
1580
1585
|
}
|
|
1581
|
-
},
|
|
1582
|
-
const g = h.getFeatures(),
|
|
1583
|
-
let
|
|
1584
|
-
const
|
|
1585
|
-
const
|
|
1586
|
-
for (;
|
|
1587
|
-
const Y = g[
|
|
1588
|
-
Y.setStyle(
|
|
1586
|
+
}, ee = () => {
|
|
1587
|
+
const g = h.getFeatures(), N = 100;
|
|
1588
|
+
let F = 0;
|
|
1589
|
+
const H = () => {
|
|
1590
|
+
const I = Math.min(F + N, g.length);
|
|
1591
|
+
for (; F < I; F++) {
|
|
1592
|
+
const Y = g[F], R = Ve(e, Y);
|
|
1593
|
+
Y.setStyle(R);
|
|
1589
1594
|
}
|
|
1590
|
-
|
|
1595
|
+
F < g.length && requestAnimationFrame(H);
|
|
1591
1596
|
};
|
|
1592
|
-
|
|
1597
|
+
H();
|
|
1593
1598
|
const U = n.getFeatures()[0];
|
|
1594
1599
|
if (U && o) {
|
|
1595
|
-
const
|
|
1596
|
-
U.setStyle(
|
|
1600
|
+
const I = Pt(e, o);
|
|
1601
|
+
U.setStyle(I);
|
|
1597
1602
|
}
|
|
1598
1603
|
}, V = () => {
|
|
1599
|
-
e && h && (
|
|
1600
|
-
},
|
|
1601
|
-
const g = e.getOverlays().getArray().filter((
|
|
1604
|
+
e && h && (C(), h.clear(), M.clear(), n.clear());
|
|
1605
|
+
}, C = () => {
|
|
1606
|
+
const g = e.getOverlays().getArray().filter((N) => N.get("class") == "zh-map-ship-overlay");
|
|
1602
1607
|
if (g && g.length > 0)
|
|
1603
|
-
for (let
|
|
1604
|
-
const
|
|
1605
|
-
|
|
1608
|
+
for (let N = 0; N < g.length; N++) {
|
|
1609
|
+
const F = g[N];
|
|
1610
|
+
F.setPosition(void 0), e.removeOverlay(F), F.dispose();
|
|
1606
1611
|
}
|
|
1607
|
-
},
|
|
1608
|
-
u = g,
|
|
1609
|
-
const
|
|
1612
|
+
}, P = (g, N) => {
|
|
1613
|
+
u = g, b = N;
|
|
1614
|
+
const F = e.getOverlays().getArray(), H = h.getFeatures();
|
|
1610
1615
|
for (const J in u) {
|
|
1611
|
-
const U = u[J],
|
|
1612
|
-
if (
|
|
1613
|
-
const
|
|
1614
|
-
Y.set("blinking", U),
|
|
1616
|
+
const U = u[J], I = F.find((R) => (R == null ? void 0 : R.getId()) === "label-" + J), Y = H.find((R) => J === R.get("id"));
|
|
1617
|
+
if (I && Y) {
|
|
1618
|
+
const R = N[J].blinkColors || [], { shipData: he, name: ve, color: xe } = Y.getProperties();
|
|
1619
|
+
Y.set("blinking", U), R[(R == null ? void 0 : R.length) - 1] && xe !== R[(R == null ? void 0 : R.length) - 1] && (Y.set("color", R[(R == null ? void 0 : R.length) - 1] || ""), Y.setStyle(Ve(e, Y)));
|
|
1615
1620
|
const it = {
|
|
1616
1621
|
...he,
|
|
1617
1622
|
blinking: U,
|
|
1618
|
-
blinkingColors:
|
|
1619
|
-
name: ve + "(" +
|
|
1620
|
-
}, qe =
|
|
1621
|
-
qe && qe !==
|
|
1623
|
+
blinkingColors: R || [],
|
|
1624
|
+
name: ve + "(" + N[J].shipState + ")"
|
|
1625
|
+
}, qe = I.getElement(), Xe = Ot(it);
|
|
1626
|
+
qe && qe !== Xe && I.setElement(Xe);
|
|
1622
1627
|
}
|
|
1623
1628
|
}
|
|
1624
1629
|
}, G = (g) => {
|
|
1625
1630
|
if (!e) return;
|
|
1626
|
-
const
|
|
1627
|
-
g.forEach((
|
|
1628
|
-
|
|
1631
|
+
const N = h.getFeatures(), F = M.getFeatures(), H = s ? s.get("id") : "", J = N.filter((R) => R.get("id") !== H), U = F == null ? void 0 : F.filter((R) => R.get("id") !== H), I = /* @__PURE__ */ new Map();
|
|
1632
|
+
g.forEach((R) => {
|
|
1633
|
+
I.set(R.id, !0);
|
|
1629
1634
|
});
|
|
1630
1635
|
const Y = e.getOverlays().getArray();
|
|
1631
|
-
J.forEach((
|
|
1632
|
-
const he =
|
|
1633
|
-
if (!
|
|
1634
|
-
|
|
1636
|
+
J.forEach((R) => {
|
|
1637
|
+
const he = R.get("id");
|
|
1638
|
+
if (!I.has(he))
|
|
1639
|
+
R.setStyle([]);
|
|
1635
1640
|
else {
|
|
1636
|
-
const xe =
|
|
1637
|
-
(xe == null ? void 0 : xe.length) == 0 &&
|
|
1641
|
+
const xe = R.getStyle();
|
|
1642
|
+
(xe == null ? void 0 : xe.length) == 0 && R.setStyle(Ve(e, R));
|
|
1638
1643
|
}
|
|
1639
1644
|
const ve = Y.find((xe) => xe.getId() === "label-" + he);
|
|
1640
1645
|
ve && ve.setPosition(void 0);
|
|
1641
|
-
}), U.forEach((
|
|
1642
|
-
const he =
|
|
1643
|
-
if (!
|
|
1644
|
-
|
|
1646
|
+
}), U.forEach((R) => {
|
|
1647
|
+
const he = R.get("id");
|
|
1648
|
+
if (!I.has(he))
|
|
1649
|
+
R.setStyle([]);
|
|
1645
1650
|
else {
|
|
1646
|
-
const ve =
|
|
1647
|
-
(ve == null ? void 0 : ve.length) == 0 &&
|
|
1651
|
+
const ve = R.getStyle();
|
|
1652
|
+
(ve == null ? void 0 : ve.length) == 0 && R.setStyle(Ft(R, g.length));
|
|
1648
1653
|
}
|
|
1649
1654
|
});
|
|
1650
|
-
},
|
|
1655
|
+
}, W = (g) => {
|
|
1651
1656
|
if (g) {
|
|
1652
1657
|
console.log("选中", g);
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1658
|
+
const N = h.getFeatures().find((H) => H.get("id") === g.id), F = M.getFeatures().find((H) => H.get("id") === g.id);
|
|
1659
|
+
N && (s = N), F && F.set("selected", !0), o = g, K();
|
|
1655
1660
|
} else
|
|
1656
|
-
console.log("取消选中"), o = null, s = null,
|
|
1657
|
-
}, _ = (g,
|
|
1658
|
-
|
|
1659
|
-
}, X = ro((g,
|
|
1661
|
+
console.log("取消选中"), o = null, s = null, oe(), O();
|
|
1662
|
+
}, _ = (g, N, F) => {
|
|
1663
|
+
A = g, p = N, $ = F;
|
|
1664
|
+
}, X = ro((g, N, F) => {
|
|
1660
1665
|
try {
|
|
1661
1666
|
if (g) {
|
|
1662
|
-
const
|
|
1663
|
-
if (
|
|
1664
|
-
i && i !== J &&
|
|
1665
|
-
const U = h.getFeatures().find((
|
|
1666
|
-
U == null || U.set("isHighlight", !0), U == null || U.setStyle(
|
|
1667
|
+
const H = g.get("shipData"), J = g.get("id");
|
|
1668
|
+
if (N === "click" && (W(H), F && F(J)), N === "hover") {
|
|
1669
|
+
i && i !== J && q(), i = J;
|
|
1670
|
+
const U = h.getFeatures().find((I) => I.get("id") === i);
|
|
1671
|
+
U == null || U.set("isHighlight", !0), U == null || U.setStyle(Ve(e, U));
|
|
1667
1672
|
}
|
|
1668
1673
|
} else
|
|
1669
|
-
|
|
1670
|
-
} catch (
|
|
1671
|
-
console.log("handleShipMapEvent",
|
|
1674
|
+
q();
|
|
1675
|
+
} catch (H) {
|
|
1676
|
+
console.log("handleShipMapEvent", H);
|
|
1672
1677
|
}
|
|
1673
|
-
}, 10),
|
|
1674
|
-
const g = i ? h.getFeatures().find((
|
|
1675
|
-
i = null, g == null || g.set("isHighlight", !1), g == null || g.setStyle(
|
|
1676
|
-
},
|
|
1678
|
+
}, 10), q = () => {
|
|
1679
|
+
const g = i ? h.getFeatures().find((N) => N.get("id") === i) : null;
|
|
1680
|
+
i = null, g == null || g.set("isHighlight", !1), g == null || g.setStyle(Ve(e, g));
|
|
1681
|
+
}, oe = () => {
|
|
1677
1682
|
try {
|
|
1678
1683
|
n.clear();
|
|
1679
1684
|
} catch (g) {
|
|
1680
1685
|
console.log(g);
|
|
1681
1686
|
}
|
|
1682
|
-
}, ke = (g,
|
|
1683
|
-
const
|
|
1684
|
-
geometry: new de(
|
|
1687
|
+
}, ke = (g, N) => {
|
|
1688
|
+
const F = fe([g == null ? void 0 : g.lon, g == null ? void 0 : g.lat]), H = new me({
|
|
1689
|
+
geometry: new de(F),
|
|
1685
1690
|
name: g.cnname || g.enname || g.name || g.id || "未命名船舶",
|
|
1686
1691
|
// 图标
|
|
1687
|
-
rightIcons:
|
|
1692
|
+
rightIcons: St(g),
|
|
1688
1693
|
selected: (g == null ? void 0 : g.id) === (o == null ? void 0 : o.id),
|
|
1689
1694
|
shipData: g
|
|
1690
1695
|
});
|
|
1691
|
-
|
|
1692
|
-
const J =
|
|
1693
|
-
return
|
|
1696
|
+
H.set("id", g.id);
|
|
1697
|
+
const J = Ft(H, N);
|
|
1698
|
+
return H.setStyle(J), H;
|
|
1694
1699
|
}, ie = (g) => {
|
|
1695
|
-
const
|
|
1700
|
+
const N = e.getView().getZoom(), F = [], H = [];
|
|
1696
1701
|
g.forEach((Y) => {
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1699
|
-
}), (
|
|
1702
|
+
const R = z(Y);
|
|
1703
|
+
R.setStyle(Ve(e, R)), h.addFeature(R), u[Y.id] && F.push(Y), (o == null ? void 0 : o.id) == Y.id && (o = Y), !u[Y.id] && (o == null ? void 0 : o.id) !== Y.id && H.push(Y);
|
|
1704
|
+
}), (p !== null ? p : (o == null ? void 0 : o.id) && u[o == null ? void 0 : o.id] || N && N >= ce.shipModelMin) && F.map((Y) => {
|
|
1700
1705
|
lt(Y);
|
|
1701
|
-
}), o && (
|
|
1706
|
+
}), o && ($ !== null ? $ : !0) && !u[o == null ? void 0 : o.id] && ae(o, g), (A !== null ? A : N && N >= ce.shipModelMin) && H.map((Y) => {
|
|
1702
1707
|
ae(Y, g);
|
|
1703
1708
|
});
|
|
1704
|
-
}, ae = (g,
|
|
1705
|
-
const
|
|
1706
|
-
M.addFeature(
|
|
1709
|
+
}, ae = (g, N) => {
|
|
1710
|
+
const F = ke(g, N.length);
|
|
1711
|
+
M.addFeature(F);
|
|
1707
1712
|
}, rt = (g) => {
|
|
1708
|
-
var
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1713
|
+
var F;
|
|
1714
|
+
const N = h.getFeatures().find((H) => H.get("id") === g);
|
|
1715
|
+
N && X(N, "click", (F = l.getProps()) == null ? void 0 : F.selectShip);
|
|
1711
1716
|
}, lt = (g) => {
|
|
1712
|
-
var
|
|
1713
|
-
if (g.id &&
|
|
1714
|
-
const
|
|
1717
|
+
var N;
|
|
1718
|
+
if (g.id && b[g == null ? void 0 : g.id]) {
|
|
1719
|
+
const F = b[g == null ? void 0 : g.id] || {}, H = (F == null ? void 0 : F.blinkColors) || [], J = (F == null ? void 0 : F.shipState) || "", U = (g.cnname || g.enname || g.name || g.id || "未命名船舶") + "(" + J + ")", I = {
|
|
1715
1720
|
...g,
|
|
1716
1721
|
name: U,
|
|
1717
1722
|
blinking: u[g.id],
|
|
1718
|
-
blinkingColors:
|
|
1723
|
+
blinkingColors: H || []
|
|
1719
1724
|
};
|
|
1720
|
-
|
|
1725
|
+
So(e, I), (N = document.querySelector(".ship-label-overlay-blinking")) == null || N.addEventListener("click", (Y) => {
|
|
1721
1726
|
var he;
|
|
1722
|
-
if (r.getState() === "open" ||
|
|
1723
|
-
const
|
|
1724
|
-
Y.preventDefault(),
|
|
1727
|
+
if (r.getState() === "open" || a.getState() === "open" || !c.getMapClick()) return;
|
|
1728
|
+
const R = (he = Y.target) == null ? void 0 : he.getAttribute("data-id");
|
|
1729
|
+
Y.preventDefault(), R && rt(R);
|
|
1725
1730
|
});
|
|
1726
1731
|
}
|
|
1727
1732
|
};
|
|
1728
1733
|
return {
|
|
1729
1734
|
render: f,
|
|
1730
|
-
selected:
|
|
1735
|
+
selected: W,
|
|
1731
1736
|
filter: G,
|
|
1732
|
-
blinking:
|
|
1737
|
+
blinking: P,
|
|
1733
1738
|
clear: V,
|
|
1734
1739
|
setLableStatus: _,
|
|
1735
1740
|
handleShipMapEvent: X,
|
|
1736
|
-
changeShipScale:
|
|
1741
|
+
changeShipScale: ee
|
|
1737
1742
|
};
|
|
1738
1743
|
}, Zo = (e) => {
|
|
1739
|
-
const l = () => e == null ? void 0 : e.getLayers(), c = ge("vector"), r = () => c.value,
|
|
1740
|
-
c.value =
|
|
1744
|
+
const l = () => e == null ? void 0 : e.getLayers(), c = ge("vector"), r = () => c.value, a = (x) => {
|
|
1745
|
+
c.value = x;
|
|
1741
1746
|
const M = l();
|
|
1742
1747
|
M && (M == null || M.getArray().forEach((t) => {
|
|
1743
|
-
(t.className_ === "vector" || t.className_ === "satellite") && t.setVisible(t.className_ ===
|
|
1748
|
+
(t.className_ === "vector" || t.className_ === "satellite") && t.setVisible(t.className_ === x);
|
|
1744
1749
|
}));
|
|
1745
1750
|
}, s = ge(!1);
|
|
1746
1751
|
return {
|
|
1747
1752
|
getLayers: l,
|
|
1748
1753
|
getGreenTileVisible: () => s.value,
|
|
1749
|
-
setGreenTileVisible: (
|
|
1750
|
-
if (
|
|
1751
|
-
if (
|
|
1754
|
+
setGreenTileVisible: (x) => {
|
|
1755
|
+
if (x !== s.value) {
|
|
1756
|
+
if (x) {
|
|
1752
1757
|
const M = l();
|
|
1753
1758
|
if (!M.getArray().find((n) => n.className_ === "greenTile")) {
|
|
1754
|
-
const n = new
|
|
1755
|
-
source: new
|
|
1756
|
-
visible:
|
|
1759
|
+
const n = new Oe({
|
|
1760
|
+
source: new Ae({ url: Se.greenTile }),
|
|
1761
|
+
visible: x,
|
|
1757
1762
|
zIndex: 2,
|
|
1758
1763
|
className: "greenTile"
|
|
1759
1764
|
});
|
|
@@ -1763,39 +1768,39 @@ const St = (e, l) => {
|
|
|
1763
1768
|
const M = l(), t = M.getArray().find((n) => n.className_ === "greenTile");
|
|
1764
1769
|
t && M.remove(t);
|
|
1765
1770
|
}
|
|
1766
|
-
s.value =
|
|
1771
|
+
s.value = x;
|
|
1767
1772
|
}
|
|
1768
1773
|
},
|
|
1769
1774
|
getShowLayerType: r,
|
|
1770
|
-
setShowLayerType:
|
|
1775
|
+
setShowLayerType: a
|
|
1771
1776
|
};
|
|
1772
1777
|
}, Do = (e) => {
|
|
1773
1778
|
const l = "zh-map-location-layer";
|
|
1774
1779
|
let c;
|
|
1775
1780
|
const r = new be();
|
|
1776
|
-
let
|
|
1781
|
+
let a = null, s = null;
|
|
1777
1782
|
const o = (i) => {
|
|
1778
1783
|
if (!(!i || i.length === 0)) {
|
|
1779
1784
|
if (r.clear(), s) {
|
|
1780
|
-
const u = i.find((
|
|
1785
|
+
const u = i.find((b) => b.id === (s == null ? void 0 : s.id));
|
|
1781
1786
|
u ? s = u : i.push(s);
|
|
1782
1787
|
}
|
|
1783
1788
|
i.forEach((u) => {
|
|
1784
1789
|
h(u);
|
|
1785
|
-
}), c || (c = new
|
|
1790
|
+
}), c || (c = new Me({
|
|
1786
1791
|
className: l,
|
|
1787
1792
|
source: r,
|
|
1788
1793
|
zIndex: 100
|
|
1789
1794
|
}), e == null || e.addLayer(c));
|
|
1790
1795
|
}
|
|
1791
1796
|
}, h = (i) => {
|
|
1792
|
-
const u = e == null ? void 0 : e.getView().getZoom(), [
|
|
1793
|
-
geometry: new de(fe([Number(
|
|
1797
|
+
const u = e == null ? void 0 : e.getView().getZoom(), [b, f] = i.latLon.split(","), L = new me({
|
|
1798
|
+
geometry: new de(fe([Number(b), Number(f)]))
|
|
1794
1799
|
});
|
|
1795
|
-
L.setStyle(
|
|
1796
|
-
},
|
|
1800
|
+
L.setStyle(x(i, u, i.id === (s == null ? void 0 : s.id))), L.set("loactionData", i), r.addFeature(L);
|
|
1801
|
+
}, x = (i, u, b) => {
|
|
1797
1802
|
let f = {
|
|
1798
|
-
src:
|
|
1803
|
+
src: b && i.selectedPath || i.defaultPath
|
|
1799
1804
|
};
|
|
1800
1805
|
i != null && i.width && (i != null && i.height) ? f = {
|
|
1801
1806
|
...f,
|
|
@@ -1806,11 +1811,11 @@ const St = (e, l) => {
|
|
|
1806
1811
|
scale: 0.5 * u / 10
|
|
1807
1812
|
};
|
|
1808
1813
|
let L = {
|
|
1809
|
-
image: new
|
|
1814
|
+
image: new Ne(f)
|
|
1810
1815
|
};
|
|
1811
1816
|
return i.name && (L = {
|
|
1812
1817
|
...L,
|
|
1813
|
-
text: new
|
|
1818
|
+
text: new Ze({
|
|
1814
1819
|
text: i.name,
|
|
1815
1820
|
font: "12px sans-serif",
|
|
1816
1821
|
fill: new ue({
|
|
@@ -1821,10 +1826,10 @@ const St = (e, l) => {
|
|
|
1821
1826
|
}),
|
|
1822
1827
|
offsetY: 30
|
|
1823
1828
|
})
|
|
1824
|
-
}), new
|
|
1829
|
+
}), new te(L);
|
|
1825
1830
|
}, M = () => {
|
|
1826
|
-
if (
|
|
1827
|
-
const i =
|
|
1831
|
+
if (a) {
|
|
1832
|
+
const i = a.get("loactionData").id;
|
|
1828
1833
|
r.getFeatures().forEach((u) => {
|
|
1829
1834
|
u.get("loactionData").id !== i && r.removeFeature(u);
|
|
1830
1835
|
});
|
|
@@ -1832,28 +1837,28 @@ const St = (e, l) => {
|
|
|
1832
1837
|
r.clear();
|
|
1833
1838
|
}, t = () => {
|
|
1834
1839
|
var f;
|
|
1835
|
-
const i =
|
|
1840
|
+
const i = a == null ? void 0 : a.get("loactionData"), u = (f = e == null ? void 0 : e.getView()) == null ? void 0 : f.getZoom();
|
|
1836
1841
|
r.getFeatures().forEach((L) => {
|
|
1837
|
-
L.get("loactionData").id === i.id && (L == null || L.setStyle(
|
|
1838
|
-
}), s = null,
|
|
1842
|
+
L.get("loactionData").id === i.id && (L == null || L.setStyle(x(i, u, !1)));
|
|
1843
|
+
}), s = null, a = null;
|
|
1839
1844
|
}, n = (i) => {
|
|
1840
|
-
i ? (
|
|
1841
|
-
},
|
|
1845
|
+
i ? (w(), $(i)) : t();
|
|
1846
|
+
}, w = () => {
|
|
1842
1847
|
var i;
|
|
1843
|
-
if (
|
|
1844
|
-
const u =
|
|
1845
|
-
|
|
1848
|
+
if (a) {
|
|
1849
|
+
const u = a.get("loactionData"), b = (i = e == null ? void 0 : e.getView()) == null ? void 0 : i.getZoom();
|
|
1850
|
+
a.setStyle(x(u, b, !1));
|
|
1846
1851
|
}
|
|
1847
|
-
},
|
|
1852
|
+
}, $ = (i) => {
|
|
1848
1853
|
const u = r.getFeatures();
|
|
1849
|
-
s = i,
|
|
1854
|
+
s = i, a = u.find((b) => b.get("loactionData").id === i.id);
|
|
1850
1855
|
};
|
|
1851
1856
|
return {
|
|
1852
1857
|
render: o,
|
|
1853
|
-
renderHtml: (i, u,
|
|
1858
|
+
renderHtml: (i, u, b, f) => {
|
|
1854
1859
|
const L = document.createElement("div");
|
|
1855
|
-
L.innerHTML =
|
|
1856
|
-
let
|
|
1860
|
+
L.innerHTML = b;
|
|
1861
|
+
let O = {
|
|
1857
1862
|
element: L,
|
|
1858
1863
|
// 覆盖层的DOM元素
|
|
1859
1864
|
positioning: "top-center",
|
|
@@ -1863,15 +1868,15 @@ const St = (e, l) => {
|
|
|
1863
1868
|
offset: [0, -20],
|
|
1864
1869
|
id: "position-" + i
|
|
1865
1870
|
};
|
|
1866
|
-
f && (
|
|
1867
|
-
...
|
|
1871
|
+
f && (O = {
|
|
1872
|
+
...O,
|
|
1868
1873
|
...f
|
|
1869
1874
|
});
|
|
1870
|
-
const z = new Ce(
|
|
1875
|
+
const z = new Ce(O);
|
|
1871
1876
|
z.setPosition(fe(u)), e.addOverlay(z);
|
|
1872
1877
|
},
|
|
1873
1878
|
removeHtml: (i) => {
|
|
1874
|
-
const u = e.getOverlays().getArray().find((
|
|
1879
|
+
const u = e.getOverlays().getArray().find((b) => b.getId() === "position-" + i);
|
|
1875
1880
|
u && (u.setPosition(void 0), e.removeOverlay(u));
|
|
1876
1881
|
},
|
|
1877
1882
|
selected: n,
|
|
@@ -1879,7 +1884,7 @@ const St = (e, l) => {
|
|
|
1879
1884
|
clear: M
|
|
1880
1885
|
};
|
|
1881
1886
|
}, Ho = "zh-map-port-layer", Wo = (e) => {
|
|
1882
|
-
const l = new be(), c = new
|
|
1887
|
+
const l = new be(), c = new Me({
|
|
1883
1888
|
className: Ho,
|
|
1884
1889
|
source: l,
|
|
1885
1890
|
zIndex: 100,
|
|
@@ -1888,47 +1893,47 @@ const St = (e, l) => {
|
|
|
1888
1893
|
properties: { layerType: le.PORT }
|
|
1889
1894
|
});
|
|
1890
1895
|
e == null || e.addLayer(c);
|
|
1891
|
-
let r = null,
|
|
1896
|
+
let r = null, a = null;
|
|
1892
1897
|
const s = (i, u = !0) => {
|
|
1893
1898
|
if (!i || i.length === 0) return;
|
|
1894
|
-
if (l.clear(),
|
|
1895
|
-
const f = i.find((L) => L.id === (
|
|
1896
|
-
f ?
|
|
1899
|
+
if (l.clear(), a) {
|
|
1900
|
+
const f = i.find((L) => L.id === (a == null ? void 0 : a.id));
|
|
1901
|
+
f ? a = f : i.push(a);
|
|
1897
1902
|
}
|
|
1898
|
-
const
|
|
1903
|
+
const b = [];
|
|
1899
1904
|
i.forEach((f) => {
|
|
1900
|
-
const [L,
|
|
1901
|
-
geometry: new de(fe([Number(L), Number(
|
|
1905
|
+
const [L, O] = f.latLon.split(","), z = new me({
|
|
1906
|
+
geometry: new de(fe([Number(L), Number(O)])),
|
|
1902
1907
|
portData: f,
|
|
1903
1908
|
id: f.id,
|
|
1904
|
-
select: f.id === (
|
|
1905
|
-
showTitle: f.id === (
|
|
1906
|
-
}),
|
|
1907
|
-
z.setStyle(
|
|
1908
|
-
}), l.addFeatures(
|
|
1909
|
+
select: f.id === (a == null ? void 0 : a.id),
|
|
1910
|
+
showTitle: f.id === (a == null ? void 0 : a.id) || u
|
|
1911
|
+
}), K = t(z);
|
|
1912
|
+
z.setStyle(K), b.push(z);
|
|
1913
|
+
}), l.addFeatures(b);
|
|
1909
1914
|
};
|
|
1910
1915
|
let o = null, h = null;
|
|
1911
|
-
const
|
|
1916
|
+
const x = /* @__PURE__ */ new Map(), M = (i, u) => {
|
|
1912
1917
|
o || (o = document.createElement("canvas"), h = o.getContext("2d", {
|
|
1913
1918
|
willReadFrequently: !0
|
|
1914
1919
|
}));
|
|
1915
|
-
const
|
|
1916
|
-
if (
|
|
1917
|
-
return
|
|
1920
|
+
const b = `${i}-${u}`;
|
|
1921
|
+
if (x.has(b))
|
|
1922
|
+
return x.get(b);
|
|
1918
1923
|
const f = o, L = h;
|
|
1919
1924
|
if (!L) return "";
|
|
1920
1925
|
f.width = 0, f.height = 0;
|
|
1921
|
-
const
|
|
1922
|
-
L.font =
|
|
1923
|
-
const
|
|
1924
|
-
f.width = Math.round(
|
|
1925
|
-
const
|
|
1926
|
-
L.strokeStyle = u ? "#000" : "#ffffff", L.lineWidth = 1, L.strokeText(i, z,
|
|
1926
|
+
const O = 2, z = 8, K = window.devicePixelRatio || 1, ee = "12px sans-serif";
|
|
1927
|
+
L.font = ee;
|
|
1928
|
+
const C = L.measureText(i).width, P = z + C + z, G = O + 12 + O * 2;
|
|
1929
|
+
f.width = Math.round(P * K), f.height = Math.round(G * K), L.scale(K, K), L.clearRect(0, 0, P, G), L.fillStyle = u ? "#F32D2D" : "#FFF", L.beginPath(), L.roundRect(0, 0, P, G, 4), L.fill(), L.font = ee, L.textBaseline = "middle";
|
|
1930
|
+
const W = G / 2;
|
|
1931
|
+
L.strokeStyle = u ? "#000" : "#ffffff", L.lineWidth = 1, L.strokeText(i, z, W), L.fillStyle = u ? "#FFF" : "#000000", L.fillText(i, z, W);
|
|
1927
1932
|
const _ = f.toDataURL("image/png");
|
|
1928
|
-
return
|
|
1933
|
+
return x.set(b, _), _;
|
|
1929
1934
|
}, t = (i) => {
|
|
1930
|
-
const { select: u, showTitle:
|
|
1931
|
-
<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="${
|
|
1935
|
+
const { select: u, showTitle: b } = i.getProperties(), f = (C) => `<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1936
|
+
<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="${C}"/>
|
|
1932
1937
|
<g clip-path="url(#clip0_10059_122082)">
|
|
1933
1938
|
<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"/>
|
|
1934
1939
|
</g>
|
|
@@ -1938,18 +1943,18 @@ const St = (e, l) => {
|
|
|
1938
1943
|
</clipPath>
|
|
1939
1944
|
</defs>
|
|
1940
1945
|
</svg>
|
|
1941
|
-
`, L = () => `data:image/svg+xml;utf8,${encodeURIComponent(f(u ? "#F32D2D" : "#3370FF"))}`,
|
|
1942
|
-
image: new
|
|
1946
|
+
`, L = () => `data:image/svg+xml;utf8,${encodeURIComponent(f(u ? "#F32D2D" : "#3370FF"))}`, O = e.getView().getZoom(), z = i.get("portData"), K = window.devicePixelRatio || 1, ee = new te({
|
|
1947
|
+
image: new Ne({
|
|
1943
1948
|
src: L(),
|
|
1944
|
-
scale: 0.5 *
|
|
1949
|
+
scale: 0.5 * O / 10
|
|
1945
1950
|
}),
|
|
1946
1951
|
zIndex: u ? 110 : 100
|
|
1947
|
-
}), V = new
|
|
1948
|
-
image: new
|
|
1952
|
+
}), V = new te({
|
|
1953
|
+
image: new Ne({
|
|
1949
1954
|
src: M(z.shortName, u),
|
|
1950
1955
|
anchor: [0.5, 0.5],
|
|
1951
1956
|
displacement: [0, -30],
|
|
1952
|
-
scale: 1 /
|
|
1957
|
+
scale: 1 / K,
|
|
1953
1958
|
anchorXUnits: "fraction",
|
|
1954
1959
|
anchorYUnits: "fraction"
|
|
1955
1960
|
}),
|
|
@@ -1966,7 +1971,7 @@ const St = (e, l) => {
|
|
|
1966
1971
|
// offsetY: 30,
|
|
1967
1972
|
// }),
|
|
1968
1973
|
});
|
|
1969
|
-
return !
|
|
1974
|
+
return !b && !u ? ee : [ee, V];
|
|
1970
1975
|
}, n = () => {
|
|
1971
1976
|
if (l)
|
|
1972
1977
|
if (r) {
|
|
@@ -1977,56 +1982,56 @@ const St = (e, l) => {
|
|
|
1977
1982
|
});
|
|
1978
1983
|
} else
|
|
1979
1984
|
console.log("清除所有港口", l), l == null || l.clear();
|
|
1980
|
-
},
|
|
1985
|
+
}, w = (i) => {
|
|
1981
1986
|
if (l) {
|
|
1982
1987
|
if (!i)
|
|
1983
|
-
return
|
|
1984
|
-
(r == null ? void 0 : r.get("portData").id) !== i.id && (
|
|
1988
|
+
return $();
|
|
1989
|
+
(r == null ? void 0 : r.get("portData").id) !== i.id && ($(), A(i));
|
|
1985
1990
|
}
|
|
1986
|
-
},
|
|
1991
|
+
}, $ = () => {
|
|
1987
1992
|
var i;
|
|
1988
1993
|
if (r) {
|
|
1989
|
-
const u = r == null ? void 0 : r.get("portData"),
|
|
1990
|
-
|
|
1994
|
+
const u = r == null ? void 0 : r.get("portData"), b = (i = l.getFeatures()) == null ? void 0 : i.find((f) => f.get("portData").id === u.id);
|
|
1995
|
+
b && (b.set("select", !1), b.setStyle(t(b)), r = null, a = null);
|
|
1991
1996
|
}
|
|
1992
|
-
},
|
|
1997
|
+
}, A = (i) => {
|
|
1993
1998
|
if (!l) return;
|
|
1994
1999
|
const u = l.getFeatures();
|
|
1995
|
-
|
|
2000
|
+
a = i, r = u.find((b) => b.get("portData").id === i.id), r && (r.set("select", !0), r.setStyle(t(r)));
|
|
1996
2001
|
};
|
|
1997
2002
|
return {
|
|
1998
2003
|
render: s,
|
|
1999
2004
|
clear: n,
|
|
2000
|
-
selected:
|
|
2005
|
+
selected: w,
|
|
2001
2006
|
handlePortHover: (i) => {
|
|
2002
|
-
i && i.get("portData") ?
|
|
2007
|
+
i && i.get("portData") ? Le(e, "pointer") : Le(e, "grab");
|
|
2003
2008
|
}
|
|
2004
2009
|
};
|
|
2005
|
-
}, Go = (e, l, c, r,
|
|
2010
|
+
}, Go = (e, l, c, r, a, s, o) => {
|
|
2006
2011
|
const h = e.getInstall();
|
|
2007
2012
|
h.on("moveend", () => {
|
|
2008
|
-
var n,
|
|
2013
|
+
var n, w;
|
|
2009
2014
|
try {
|
|
2010
|
-
const
|
|
2011
|
-
(
|
|
2012
|
-
} catch (
|
|
2013
|
-
console.log("moveend---catch",
|
|
2015
|
+
const $ = e.getZoom();
|
|
2016
|
+
(w = (n = l.getProps()).mapMoveEnd) == null || w.call(n, $), $ >= ce.min && $ <= ce.max && c.reRenderTrackLine(), r.changeShipScale();
|
|
2017
|
+
} catch ($) {
|
|
2018
|
+
console.log("moveend---catch", $);
|
|
2014
2019
|
}
|
|
2015
2020
|
});
|
|
2016
|
-
const
|
|
2021
|
+
const x = {
|
|
2017
2022
|
[le.PORT]: null,
|
|
2018
2023
|
[le.SHIP]: null,
|
|
2019
2024
|
[le.TRACK]: null,
|
|
2020
2025
|
[le.DELETE]: null
|
|
2021
|
-
}, M = (n,
|
|
2026
|
+
}, M = (n, w, $) => {
|
|
2022
2027
|
switch (n) {
|
|
2023
2028
|
case le.SHIP:
|
|
2024
|
-
r == null || r.handleShipMapEvent(
|
|
2029
|
+
r == null || r.handleShipMapEvent(w, "hover");
|
|
2025
2030
|
break;
|
|
2026
2031
|
case le.PORT:
|
|
2027
2032
|
break;
|
|
2028
2033
|
case le.TRACK:
|
|
2029
|
-
c == null || c.handleTrackMapEvent(
|
|
2034
|
+
c == null || c.handleTrackMapEvent(w, "hover", $);
|
|
2030
2035
|
break;
|
|
2031
2036
|
}
|
|
2032
2037
|
}, t = (n) => {
|
|
@@ -2044,58 +2049,58 @@ const St = (e, l) => {
|
|
|
2044
2049
|
h.on("pointermove", (n) => {
|
|
2045
2050
|
if (o.getState() !== "open" && s.getState() !== "open" && e.getMapClick() && !h.getView().getAnimating())
|
|
2046
2051
|
try {
|
|
2047
|
-
let
|
|
2048
|
-
const
|
|
2052
|
+
let w = !1, $ = !1;
|
|
2053
|
+
const A = h.getLayers().getArray().filter((p) => p.get("layerType"));
|
|
2049
2054
|
try {
|
|
2050
|
-
|
|
2051
|
-
if (
|
|
2052
|
-
const i = h == null ? void 0 : h.getEventPixel(n.originalEvent), u =
|
|
2053
|
-
layerFilter: (f) => f ===
|
|
2055
|
+
A && A.length > 0 && A.forEach((p) => {
|
|
2056
|
+
if ($) return;
|
|
2057
|
+
const i = h == null ? void 0 : h.getEventPixel(n.originalEvent), u = p == null ? void 0 : p.get("layerType"), b = h == null ? void 0 : h.forEachFeatureAtPixel(i, (f) => f, {
|
|
2058
|
+
layerFilter: (f) => f === p,
|
|
2054
2059
|
// 严格图层过滤
|
|
2055
2060
|
hitTolerance: 5
|
|
2056
2061
|
});
|
|
2057
|
-
|
|
2058
|
-
}),
|
|
2059
|
-
} catch (
|
|
2060
|
-
console.log("pointermove----",
|
|
2062
|
+
b !== x[u] && (x[u] && t(u, x[u]), x[u] = b, b && (M(u, b, n), $ = !0)), b && (w = !0);
|
|
2063
|
+
}), w ? Le(h, "pointer") : Le(h, "grab");
|
|
2064
|
+
} catch (p) {
|
|
2065
|
+
console.log("pointermove----", p);
|
|
2061
2066
|
}
|
|
2062
|
-
} catch (
|
|
2063
|
-
console.log("pointermove----",
|
|
2067
|
+
} catch (w) {
|
|
2068
|
+
console.log("pointermove----", w);
|
|
2064
2069
|
}
|
|
2065
|
-
}), h.on("click",
|
|
2070
|
+
}), h.on("click", Nt((n) => {
|
|
2066
2071
|
if (o.getState() !== "open" && s.getState() !== "open" && e.getMapClick() && !h.getView().getAnimating())
|
|
2067
2072
|
try {
|
|
2068
|
-
let
|
|
2069
|
-
const
|
|
2070
|
-
|
|
2071
|
-
var
|
|
2072
|
-
if (!
|
|
2073
|
+
let w = !1;
|
|
2074
|
+
const $ = h.getLayers().getArray().filter((A) => A.get("layerType"));
|
|
2075
|
+
$ && $.length > 0 && $.forEach((A) => {
|
|
2076
|
+
var p, i, u, b, f;
|
|
2077
|
+
if (!w)
|
|
2073
2078
|
try {
|
|
2074
|
-
if (((i = (
|
|
2075
|
-
const L = h == null ? void 0 : h.getEventPixel(n.originalEvent),
|
|
2079
|
+
if (((i = (p = A == null ? void 0 : A.getSource()) == null ? void 0 : p.getFeatures()) == null ? void 0 : i.length) > 0) {
|
|
2080
|
+
const L = h == null ? void 0 : h.getEventPixel(n.originalEvent), O = h == null ? void 0 : h.forEachFeatureAtPixel(L, (z) => {
|
|
2076
2081
|
if (z.get("shipData") || z.get("portData") || z.get("polygonData") || z.get("pathData"))
|
|
2077
2082
|
return z;
|
|
2078
2083
|
}, {
|
|
2079
|
-
layerFilter: (z) => z ===
|
|
2084
|
+
layerFilter: (z) => z === A,
|
|
2080
2085
|
// 严格图层过滤
|
|
2081
2086
|
hitTolerance: 10
|
|
2082
2087
|
});
|
|
2083
|
-
if (console.log("clickFeature",
|
|
2084
|
-
if (
|
|
2085
|
-
c.getTrackStatus() || r.handleShipMapEvent(
|
|
2086
|
-
else if (
|
|
2087
|
-
const z =
|
|
2088
|
-
|
|
2088
|
+
if (console.log("clickFeature", O), O) {
|
|
2089
|
+
if (O != null && O.get("shipData"))
|
|
2090
|
+
c.getTrackStatus() || r.handleShipMapEvent(O, "click", (u = l.getProps()) == null ? void 0 : u.selectShip);
|
|
2091
|
+
else if (O != null && O.get("portData")) {
|
|
2092
|
+
const z = O == null ? void 0 : O.get("portData");
|
|
2093
|
+
a.selected(z), (f = (b = l.getProps()) == null ? void 0 : b.selectPort) == null || f.call(b, z);
|
|
2089
2094
|
}
|
|
2090
|
-
|
|
2095
|
+
w = !0;
|
|
2091
2096
|
}
|
|
2092
2097
|
}
|
|
2093
2098
|
} catch (L) {
|
|
2094
2099
|
console.log("click--", L);
|
|
2095
2100
|
}
|
|
2096
2101
|
});
|
|
2097
|
-
} catch (
|
|
2098
|
-
console.log("click----",
|
|
2102
|
+
} catch (w) {
|
|
2103
|
+
console.log("click----", w);
|
|
2099
2104
|
}
|
|
2100
2105
|
}, 150)), h.getView().on("change:resolution", () => {
|
|
2101
2106
|
r.changeShipScale();
|
|
@@ -2103,15 +2108,15 @@ const St = (e, l) => {
|
|
|
2103
2108
|
}, Yo = () => {
|
|
2104
2109
|
const e = Bt([]);
|
|
2105
2110
|
return {
|
|
2106
|
-
createInstance: (r,
|
|
2111
|
+
createInstance: (r, a) => {
|
|
2107
2112
|
const s = vo();
|
|
2108
|
-
s.initMap(r,
|
|
2109
|
-
const o = s.getInstall(), h = Zo(o),
|
|
2110
|
-
|
|
2111
|
-
const M =
|
|
2112
|
-
Go(s,
|
|
2113
|
+
s.initMap(r, a);
|
|
2114
|
+
const o = s.getInstall(), h = Zo(o), x = po();
|
|
2115
|
+
x.setProps(a), h.setShowLayerType(a.layerType), h.setGreenTileVisible(a.showGreenLayer);
|
|
2116
|
+
const M = ko(o), t = bo(o, M), n = Vo(o, x), w = Oo(o, x), $ = Ao(o, x, s, w, n), A = Do(o), p = Wo(o);
|
|
2117
|
+
Go(s, x, M, $, p, n, w);
|
|
2113
2118
|
const i = () => {
|
|
2114
|
-
const
|
|
2119
|
+
const b = o.getView().calculateExtent(s.getSize()), f = Be([b[0], b[1]], se.mercator, se.data), L = Be([b[2], b[3]], se.mercator, se.data);
|
|
2115
2120
|
return [f[0], f[1], L[0], L[1]];
|
|
2116
2121
|
}, u = {
|
|
2117
2122
|
id: Symbol("map-instance"),
|
|
@@ -2123,17 +2128,17 @@ const St = (e, l) => {
|
|
|
2123
2128
|
methods: {
|
|
2124
2129
|
...s,
|
|
2125
2130
|
layer: h,
|
|
2126
|
-
ship:
|
|
2131
|
+
ship: $,
|
|
2127
2132
|
track: M,
|
|
2128
2133
|
carTrack: t,
|
|
2129
2134
|
port: {
|
|
2130
|
-
render:
|
|
2131
|
-
clear:
|
|
2132
|
-
selected:
|
|
2135
|
+
render: p.render,
|
|
2136
|
+
clear: p.clear,
|
|
2137
|
+
selected: p.selected
|
|
2133
2138
|
},
|
|
2134
|
-
position:
|
|
2139
|
+
position: A,
|
|
2135
2140
|
drawLine: n,
|
|
2136
|
-
drawPolygon:
|
|
2141
|
+
drawPolygon: w,
|
|
2137
2142
|
// 子模块
|
|
2138
2143
|
utils: {
|
|
2139
2144
|
getCalculateExtent: i,
|
|
@@ -2145,15 +2150,15 @@ const St = (e, l) => {
|
|
|
2145
2150
|
return e.push(u), u;
|
|
2146
2151
|
},
|
|
2147
2152
|
destroyInstance: (r) => {
|
|
2148
|
-
const
|
|
2149
|
-
|
|
2153
|
+
const a = e.findIndex((s) => s.id === r);
|
|
2154
|
+
a > -1 && (e[a].destroy(), e.splice(a, 1));
|
|
2150
2155
|
},
|
|
2151
2156
|
destroyAll: () => {
|
|
2152
2157
|
e.forEach((r) => r.destroy()), e.splice(0, e.length);
|
|
2153
2158
|
},
|
|
2154
2159
|
getAllInstances: () => [...e]
|
|
2155
2160
|
};
|
|
2156
|
-
}, Bo = { class: "zh-map-box" },
|
|
2161
|
+
}, Bo = { class: "zh-map-box" }, qo = /* @__PURE__ */ ft({
|
|
2157
2162
|
__name: "Map",
|
|
2158
2163
|
props: {
|
|
2159
2164
|
zoom: { default: ce.default },
|
|
@@ -2179,24 +2184,24 @@ const St = (e, l) => {
|
|
|
2179
2184
|
});
|
|
2180
2185
|
}
|
|
2181
2186
|
c();
|
|
2182
|
-
const r = ge(),
|
|
2187
|
+
const r = ge(), a = ge(), s = Yo(), o = ge(), h = e, x = ge({
|
|
2183
2188
|
getInstall() {
|
|
2184
2189
|
}
|
|
2185
2190
|
});
|
|
2186
|
-
|
|
2191
|
+
qt(() => {
|
|
2187
2192
|
var t;
|
|
2188
|
-
o.value = s.createInstance(r.value, h),
|
|
2193
|
+
o.value = s.createInstance(r.value, h), x.value = o.value.methods, (t = a.value) == null || t.setScaleLine(o.value.map, h.scaleLineUnit), window.addEventListener("nativeDoubleTap", function() {
|
|
2189
2194
|
M();
|
|
2190
2195
|
});
|
|
2191
2196
|
});
|
|
2192
2197
|
function M() {
|
|
2193
|
-
var n,
|
|
2194
|
-
if (((n = o.value) == null ? void 0 : n.methods.drawPolygon.getState()) === "open" || ((
|
|
2198
|
+
var n, w, $, A, p;
|
|
2199
|
+
if (((n = o.value) == null ? void 0 : n.methods.drawPolygon.getState()) === "open" || ((w = o.value) == null ? void 0 : w.methods.drawLine.getState()) === "open" || !(($ = o.value) != null && $.methods.getMapClick()))
|
|
2195
2200
|
return;
|
|
2196
|
-
let t = (
|
|
2197
|
-
(
|
|
2201
|
+
let t = (A = o.value) == null ? void 0 : A.methods.getZoom();
|
|
2202
|
+
(p = o.value) == null || p.methods.setZoom(t + 1);
|
|
2198
2203
|
}
|
|
2199
|
-
return
|
|
2204
|
+
return Xt(() => {
|
|
2200
2205
|
var t, n;
|
|
2201
2206
|
s.destroyInstance((t = o == null ? void 0 : o.value) == null ? void 0 : t.id), (n = o.value) == null || n.destroy();
|
|
2202
2207
|
}), l({
|
|
@@ -2225,8 +2230,8 @@ const St = (e, l) => {
|
|
|
2225
2230
|
return (t = o.value) == null ? void 0 : t.methods.getView();
|
|
2226
2231
|
},
|
|
2227
2232
|
setCenter: (t, n) => {
|
|
2228
|
-
var
|
|
2229
|
-
return (
|
|
2233
|
+
var w;
|
|
2234
|
+
return (w = o.value) == null ? void 0 : w.methods.setCenter(t, n);
|
|
2230
2235
|
},
|
|
2231
2236
|
getSize: () => {
|
|
2232
2237
|
var t;
|
|
@@ -2334,8 +2339,8 @@ const St = (e, l) => {
|
|
|
2334
2339
|
},
|
|
2335
2340
|
port: {
|
|
2336
2341
|
render: (t, n) => {
|
|
2337
|
-
var
|
|
2338
|
-
return (
|
|
2342
|
+
var w;
|
|
2343
|
+
return (w = o.value) == null ? void 0 : w.methods.port.render(t, n);
|
|
2339
2344
|
},
|
|
2340
2345
|
clear: () => {
|
|
2341
2346
|
var t;
|
|
@@ -2419,8 +2424,8 @@ const St = (e, l) => {
|
|
|
2419
2424
|
return (n = o.value) == null ? void 0 : n.methods.utils.convertSixHundredThousandToLatLng(...t);
|
|
2420
2425
|
},
|
|
2421
2426
|
calculateCirclePoints: (t, n) => {
|
|
2422
|
-
var
|
|
2423
|
-
return (
|
|
2427
|
+
var w;
|
|
2428
|
+
return (w = o.value) == null ? void 0 : w.methods.utils.calculateCirclePoints(t, n);
|
|
2424
2429
|
}
|
|
2425
2430
|
}
|
|
2426
2431
|
}), (t, n) => (ht(), vt("div", Bo, [
|
|
@@ -2432,7 +2437,7 @@ const St = (e, l) => {
|
|
|
2432
2437
|
}, null, 512),
|
|
2433
2438
|
ut(ao, {
|
|
2434
2439
|
ref_key: "scaleLineRef",
|
|
2435
|
-
ref:
|
|
2440
|
+
ref: a
|
|
2436
2441
|
}, null, 512),
|
|
2437
2442
|
ut(fo, {
|
|
2438
2443
|
ref: "zoomControlRef",
|
|
@@ -2440,7 +2445,7 @@ const St = (e, l) => {
|
|
|
2440
2445
|
}, null, 8, ["map-instance"])
|
|
2441
2446
|
]));
|
|
2442
2447
|
}
|
|
2443
|
-
}),
|
|
2448
|
+
}), Xo = /* @__PURE__ */ wt(qo, [["__scopeId", "data-v-d9ec684d"]]), Jo = io(Xo);
|
|
2444
2449
|
export {
|
|
2445
2450
|
Jo as Z
|
|
2446
2451
|
};
|