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