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