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