zhihao-ui 1.3.9 → 1.3.10
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-DFEg4oWo.js → BaseInfo-Bhin5Xqy.js} +1 -1
- package/dist/es/{BaseItem-BvdMV2Gu.js → BaseItem-BoLcxB-U.js} +3 -3
- package/dist/es/{Button-NgQ5sHIG.js → Button-DdMNoo0g.js} +2 -2
- package/dist/es/{DatePicker-B2pu6NJQ.js → DatePicker-sUXbd9V4.js} +3 -3
- package/dist/es/{DetailHeader-DDDbFDig.js → DetailHeader--0WANmGX.js} +3 -3
- package/dist/es/{DetailSubTitle-IqUKEU6D.js → DetailSubTitle-BUqZQxrl.js} +2 -2
- package/dist/es/{Dialog-DzTqitsD.js → Dialog-BKHohBv4.js} +3 -3
- package/dist/es/{DiyDataTable-DlgBshaZ.js → DiyDataTable-GuaKFrG5.js} +4 -4
- package/dist/es/{EditInfoPair-DQQoCmp8.js → EditInfoPair-CajUIoGj.js} +3 -3
- package/dist/es/{FileWrapper-pzSCoy4C.js → FileWrapper-CvYOVYx4.js} +4 -4
- package/dist/es/{Grid-D3sfvKjP.js → Grid-eLpow9Qb.js} +2 -2
- package/dist/es/{InfoPair-O3-tZH-B.js → InfoPair-BoTzSjD8.js} +3 -3
- package/dist/es/{Input-m8a-UuQp.js → Input-BKzWwcsD.js} +3 -3
- package/dist/es/{Loading-5WuhZO5j.js → Loading-3Cz4Wb5p.js} +2 -2
- package/dist/es/{Map-CCtm5zBi.js → Map-Dw2qcOkb.js} +224 -222
- package/dist/es/{MessageBox-3q9YfNRL.js → MessageBox--A4VqZyI.js} +2 -2
- package/dist/es/{MoneyInput-DddMW7cV.js → MoneyInput-DeYknAkX.js} +5 -5
- package/dist/es/{PageHeadPanel-BLvPIfGZ.js → PageHeadPanel-8pDHbfnc.js} +2 -2
- package/dist/es/{Table-iJRuASc3.js → Table-DcnAnAAU.js} +5 -5
- package/dist/es/{ToolTips-Cv8eNWyC.js → ToolTips-xwoX6Ww8.js} +3 -3
- package/dist/es/index.js +22 -22
- package/dist/es/{utils-DSw1USoH.js → utils-pSjFFegY.js} +1 -1
- package/dist/es/{vendor-Cc_TVxUO.js → vendor-CINc7P9P.js} +8 -8
- package/dist/index.css +1 -1
- package/dist/types/components/Map/Map.vue.d.ts +1 -1
- package/dist/types/components/Map/function/shipTrack.d.ts +7 -4
- package/dist/types/components/Map/index.d.ts +3 -3
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +7 -7
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref, computed, watch, onMounted, onBeforeUnmount, h, nextTick, createVNode, render as render$1, defineComponent, openBlock, createElementBlock,
|
|
2
|
-
import { h as hooks, p as fromLonLat, t as transformExtent, T as Text, F as Fill, S as Style,
|
|
3
|
-
import { _ as _export_sfc } from "./Button-
|
|
4
|
-
import { w as withInstall } from "./utils-
|
|
1
|
+
import { ref, computed, watch, onMounted, onBeforeUnmount, h, nextTick, createVNode, render as render$1, defineComponent, openBlock, createElementBlock, createElementVNode } from "vue";
|
|
2
|
+
import { h as hooks, p as fromLonLat, t as transformExtent, q as getLength, T as Text, F as Fill, S as Style, O as Overlay, r as debounce, P as Polyline, L as LineString, s as Feature, u as Point, V as VectorLayer, v as VectorSource, i as cloneDeep, w as buffer, x as Stroke, y as transform, C as CircleStyle, z as getVectorContext, R as RBush$1, I as Icon, D as DoubleClickZoom, A as Draw, B as unByKey, G as getUid, M as Map$2, H as TileLayer, X as XYZ, J as View, K as defaults, N as toLonLat, Q as ScaleLine$1, U as getArea, W as getCenter$1, Y as MultiPoint } from "./vendor-CINc7P9P.js";
|
|
3
|
+
import { _ as _export_sfc } from "./Button-DdMNoo0g.js";
|
|
4
|
+
import { w as withInstall } from "./utils-pSjFFegY.js";
|
|
5
5
|
const TIAN_DI_TU_KEY = "a6e8f78974f2581f2ca00485b40c948f", MAP_ZOOM = {
|
|
6
6
|
// 地图默认层级
|
|
7
7
|
default: 13,
|
|
@@ -93,7 +93,7 @@ const popupEle = document.createElement("div"), popupOverlay = new Overlay({
|
|
|
93
93
|
stopEvent: !1,
|
|
94
94
|
className: "track-label-popup"
|
|
95
95
|
});
|
|
96
|
-
let polyline, linePath, startMarker, position$1, geoMarker, trackAnimating = !1, lastTime = Date.now(), vectorLayer$4, distance = 0, routeFeature = null
|
|
96
|
+
let polyline, linePath, startMarker, position$1, geoMarker, trackAnimating = !1, lastTime = Date.now(), vectorLayer$4, distance = 0, routeFeature = null;
|
|
97
97
|
const MAX_CACHED_LAYERS = 5, usedIds = [], manageLayerCache = (e) => {
|
|
98
98
|
var n;
|
|
99
99
|
const t = getInstall();
|
|
@@ -103,27 +103,27 @@ const MAX_CACHED_LAYERS = 5, usedIds = [], manageLayerCache = (e) => {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
let trackColor = "";
|
|
106
|
-
const colors = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], reRenderTrackLine = () => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
}, preprocessTrackData = (e, t) => {
|
|
106
|
+
const colors = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], reRenderTrackLine = debounce(() => {
|
|
107
|
+
if (console.log("reRenderTrackLine------------"), activeTrackId && allTracks[activeTrackId] && trackLayers.get(activeTrackId).getVisible()) {
|
|
108
|
+
const e = cloneDeep(preprocessTrackData(activeTrackId, allTracks[activeTrackId]));
|
|
109
|
+
createPointFeature(activeTrackId, e);
|
|
110
|
+
}
|
|
111
|
+
}, 300), preprocessTrackData = (e, t) => {
|
|
112
112
|
let n = [];
|
|
113
113
|
return n = t.map((o, r) => {
|
|
114
114
|
if (Number(o.lon) > 180 || Number(o.lat) > 180) {
|
|
115
115
|
const [l, a] = convertSixHundredThousandToLatLng(o.lon, o.lat);
|
|
116
116
|
o.lon = l, o.lat = a;
|
|
117
117
|
}
|
|
118
|
-
return o.center = [o.lon, o.lat], o.centerPoint = lonLatToMercator(o.center), o.time = hooks(o.createdAt).format("YYYY-MM-DD HH:mm:ss"), o.id = e, o.index = r, o
|
|
118
|
+
return o.center = [o.lon, o.lat], o.centerPoint = lonLatToMercator(o.center), o.time = hooks(o.createdAt).format("YYYY-MM-DD HH:mm:ss"), o.id = e, o.index = r, o;
|
|
119
119
|
}), n;
|
|
120
|
-
}, renderTrackLine = async (e, t, n, o = "ship"
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
120
|
+
}, renderTrackLine = async (e, t, n, o = "ship") => {
|
|
121
|
+
const r = getInstall();
|
|
122
|
+
if (!r || (t = t == null ? void 0 : t.reverse(), popupOverlay && o === "ship" && (r != null && r.getOverlays().getArray().includes(popupOverlay) || r.addOverlay(popupOverlay)), (t == null ? void 0 : t.length) < 2))
|
|
123
123
|
return;
|
|
124
124
|
manageLayerCache(e), activeTrackId = e, allTracks[e] = t;
|
|
125
|
-
const
|
|
126
|
-
trackColor = n || colors[
|
|
125
|
+
const l = Object.keys(allTracks).findIndex((a) => a === e) || 0;
|
|
126
|
+
trackColor = n || colors[l > 10 ? 10 : l], await handlerRenderLine(), await setTrackViewCenter(activeTrackId);
|
|
127
127
|
}, createTrackLayer = (e) => {
|
|
128
128
|
const t = new VectorSource();
|
|
129
129
|
return new VectorLayer({
|
|
@@ -144,19 +144,16 @@ const colors = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080"
|
|
|
144
144
|
}, handlerRenderLine = async () => {
|
|
145
145
|
const e = activeTrackId;
|
|
146
146
|
if (!trackLayers.has(e)) {
|
|
147
|
-
const
|
|
148
|
-
trackLayers.set(e,
|
|
147
|
+
const l = createTrackLayer(e);
|
|
148
|
+
trackLayers.set(e, l);
|
|
149
149
|
}
|
|
150
|
-
setActiveLayer(e);
|
|
151
|
-
const t =
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const r =
|
|
156
|
-
|
|
157
|
-
a = preprocessTrackData(e, l);
|
|
158
|
-
const s = a.map((c) => c.centerPoint);
|
|
159
|
-
console.log("processedList", a.length), removeAllLabel(), a.length >= 2 && (await createTrackLineFeature(e, s, n), await createPointFeature(e, a, n));
|
|
150
|
+
await setActiveLayer(e);
|
|
151
|
+
const t = trackColor || "", n = allTracks[e] || [];
|
|
152
|
+
if (!(n && n.length > 1)) return [];
|
|
153
|
+
let o = [];
|
|
154
|
+
o = cloneDeep(preprocessTrackData(e, n));
|
|
155
|
+
const r = o.map((l) => l.centerPoint);
|
|
156
|
+
o.length >= 2 && await createTrackLineFeature(e, r, t);
|
|
160
157
|
}, createTrackLineFeature = (e, t, n) => {
|
|
161
158
|
const o = new LineString(t), r = trackLayers.get(e).getSource(), l = r.getFeatureById(e);
|
|
162
159
|
if (l)
|
|
@@ -219,83 +216,83 @@ const colors = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080"
|
|
|
219
216
|
</div>
|
|
220
217
|
${t ?? t}
|
|
221
218
|
</div>`;
|
|
222
|
-
},
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
o.addOverlay(g);
|
|
239
|
-
});
|
|
240
|
-
return;
|
|
219
|
+
}, filterPoints = (e) => {
|
|
220
|
+
const t = getInstall(), n = 100, o = e.map((i) => {
|
|
221
|
+
const d = t.getPixelFromCoordinate(fromLonLat(i.center));
|
|
222
|
+
return {
|
|
223
|
+
...i,
|
|
224
|
+
original: i,
|
|
225
|
+
pixel: d,
|
|
226
|
+
distance: 0
|
|
227
|
+
// 先初始化,后续计算
|
|
228
|
+
};
|
|
229
|
+
});
|
|
230
|
+
let r = 0;
|
|
231
|
+
o[0].distance = 0;
|
|
232
|
+
for (let i = 1; i < o.length; i++) {
|
|
233
|
+
const d = o[i - 1].pixel, u = o[i].pixel, c = u[0] - d[0], p = u[1] - d[1];
|
|
234
|
+
r += Math.sqrt(c * c + p * p), o[i].distance = r;
|
|
241
235
|
}
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
236
|
+
const l = o.filter(
|
|
237
|
+
(i, d) => d === 0 || d === o.length - 1
|
|
238
|
+
// || point.state
|
|
239
|
+
), a = [];
|
|
240
|
+
for (let i = 0; i < l.length; i++) {
|
|
241
|
+
const d = l[i];
|
|
242
|
+
if (a.push(d), i < l.length - 1) {
|
|
243
|
+
const u = l[i + 1], c = u.distance - d.distance, p = Math.floor(c / n);
|
|
244
|
+
for (let m = 1; m <= p; m++) {
|
|
245
|
+
const g = d.distance + m * n;
|
|
246
|
+
if (g >= u.distance) break;
|
|
247
|
+
const f = interpolateBetweenPoints(
|
|
248
|
+
o,
|
|
249
|
+
g
|
|
250
|
+
);
|
|
251
|
+
f && a.push(f);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
250
254
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
return Array.from(
|
|
256
|
+
new Map(a.map((i) => [i.distance.toFixed(2), i])).values()
|
|
257
|
+
).map((i) => ({
|
|
258
|
+
...i.original,
|
|
259
|
+
// 优先保留原始数据
|
|
260
|
+
...i,
|
|
261
|
+
// 覆盖坐标等计算属性
|
|
262
|
+
coord: i.coord,
|
|
263
|
+
// 确保使用插值后的坐标
|
|
264
|
+
pixel: i.pixel,
|
|
265
|
+
distance: i.distance
|
|
266
|
+
}));
|
|
257
267
|
};
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
let r = 0;
|
|
274
|
-
if (t < n) {
|
|
275
|
-
const l = e[t], a = e[n];
|
|
276
|
-
let s = 0;
|
|
277
|
-
for (let c = t + 1; c < n; c++) {
|
|
278
|
-
const d = pointToLineDistance(e[c], l, a);
|
|
279
|
-
d > s && (s = d, r = c);
|
|
268
|
+
function interpolateBetweenPoints(e, t) {
|
|
269
|
+
const n = getInstall();
|
|
270
|
+
for (let o = 1; o < e.length; o++) {
|
|
271
|
+
const r = e[o - 1], l = e[o];
|
|
272
|
+
if (t >= r.distance && t <= l.distance) {
|
|
273
|
+
const a = (t - r.distance) / (l.distance - r.distance), s = r.pixel[0] + a * (l.pixel[0] - r.pixel[0]), i = r.pixel[1] + a * (l.pixel[1] - r.pixel[1]), d = n.getCoordinateFromPixel([s, i]);
|
|
274
|
+
return {
|
|
275
|
+
...r,
|
|
276
|
+
// 继承前一个点的属性(可调整)
|
|
277
|
+
coord: d,
|
|
278
|
+
pixel: [s, i],
|
|
279
|
+
distance: t,
|
|
280
|
+
original: void 0
|
|
281
|
+
// 明确标记为插值生成点
|
|
282
|
+
};
|
|
280
283
|
}
|
|
281
|
-
if (s > 1e-4) {
|
|
282
|
-
const c = douglasPeuckerIndex(e, t, r), d = douglasPeuckerIndex(e, r, n);
|
|
283
|
-
o.push(...c.slice(1), ...d.slice(1));
|
|
284
|
-
} else
|
|
285
|
-
o.push(n);
|
|
286
284
|
}
|
|
287
|
-
return
|
|
285
|
+
return null;
|
|
288
286
|
}
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
const createPointFeatureWithStyle = (e) => {
|
|
287
|
+
const createPointFeature = async (e, t) => {
|
|
288
|
+
const n = getInstall();
|
|
289
|
+
await removeAllLabel(), await removeAllFetaure(e);
|
|
290
|
+
const o = filterPoints(t), r = o.map((a) => createPointFeatureWithStyle(a));
|
|
291
|
+
trackLayers.get(e).getSource().addFeatures(r), createArrowFetaure(e, o, t, trackColor), o.forEach((a) => {
|
|
292
|
+
const s = createPointLabelOverlay(e, trackColor, a);
|
|
293
|
+
n.addOverlay(s);
|
|
294
|
+
});
|
|
295
|
+
}, createPointFeatureWithStyle = (e) => {
|
|
299
296
|
const t = new Feature({
|
|
300
297
|
geometry: new Point(e.centerPoint),
|
|
301
298
|
data: e
|
|
@@ -334,6 +331,11 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
334
331
|
n && n.length > 0 && n.forEach((o) => {
|
|
335
332
|
o.setPosition(void 0), e.removeOverlay(o), o.dispose();
|
|
336
333
|
});
|
|
334
|
+
}, removeAllFetaure = (e) => {
|
|
335
|
+
const t = trackLayers.get(e).getSource();
|
|
336
|
+
t.forEachFeature((n) => {
|
|
337
|
+
n.get("type") !== "line" && t.removeFeature(n);
|
|
338
|
+
});
|
|
337
339
|
}, createPointStyle = (e) => [
|
|
338
340
|
new Style({
|
|
339
341
|
// 扩大交互热区
|
|
@@ -361,29 +363,29 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
361
363
|
})
|
|
362
364
|
}),
|
|
363
365
|
zIndex: 99
|
|
364
|
-
}), a = getIconStyle(""),
|
|
365
|
-
return Number(e.state) === 0 ? d.push(a) : Number(e.state) === 1 && d.push(
|
|
366
|
+
}), a = getIconStyle(""), i = getIconStyle(""), d = [];
|
|
367
|
+
return Number(e.state) === 0 ? d.push(a) : Number(e.state) === 1 && d.push(i), d.push(r), d;
|
|
366
368
|
}, createArrowFetaure = (e, t, n, o) => {
|
|
367
369
|
const r = t || [], l = t.length;
|
|
368
370
|
l || (r.push(n[0]), r.push(n[n.length - 1]));
|
|
369
371
|
const a = [];
|
|
370
|
-
for (let
|
|
372
|
+
for (let i = 0; i < l - 1; i++) {
|
|
371
373
|
let d;
|
|
372
|
-
const
|
|
373
|
-
if (
|
|
374
|
-
d = n[
|
|
374
|
+
const u = t[i], c = (t[i + 1].index + u.index) / 2;
|
|
375
|
+
if (c % 2 === 0)
|
|
376
|
+
d = n[c].centerPoint;
|
|
375
377
|
else {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const [g, f] =
|
|
378
|
+
const p = n[Math.floor(c)], m = n[Math.ceil(c)];
|
|
379
|
+
if (p && m) {
|
|
380
|
+
const [g, f] = p.centerPoint, [y, v] = m.centerPoint;
|
|
379
381
|
d = [(g + y) / 2, (f + v) / 2];
|
|
380
382
|
}
|
|
381
383
|
}
|
|
382
384
|
if (d) {
|
|
383
|
-
const
|
|
385
|
+
const p = new Feature({
|
|
384
386
|
geometry: new Point(d)
|
|
385
387
|
});
|
|
386
|
-
|
|
388
|
+
p.set("type", "track_arrow"), p.setStyle(
|
|
387
389
|
new Style({
|
|
388
390
|
text: new Text({
|
|
389
391
|
font: "700 12px map-iconfont",
|
|
@@ -391,12 +393,12 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
391
393
|
fill: new Fill({ color: o }),
|
|
392
394
|
// 设置箭头旋转 角度转为弧度
|
|
393
395
|
rotation: getRotation(
|
|
394
|
-
t[
|
|
395
|
-
t[
|
|
396
|
+
t[i].center,
|
|
397
|
+
t[i + 1].center
|
|
396
398
|
) * (Math.PI / 180)
|
|
397
399
|
})
|
|
398
400
|
})
|
|
399
|
-
), a.push(
|
|
401
|
+
), a.push(p);
|
|
400
402
|
}
|
|
401
403
|
}
|
|
402
404
|
const s = trackLayers.get(e).getSource();
|
|
@@ -444,7 +446,7 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
444
446
|
}, r = (allTracks[e] || []).map(
|
|
445
447
|
(a) => transform([a.lon, a.lat], projection.data, projection.mercator)
|
|
446
448
|
), l = new LineString(r);
|
|
447
|
-
return n.length = formatLength(l, t) || "--",
|
|
449
|
+
return n.length = formatLength(l, t) || "--", n;
|
|
448
450
|
}, playShipTrack = (e, t) => {
|
|
449
451
|
handlePlay(String(e), t);
|
|
450
452
|
}, handlePlay = (e, t) => {
|
|
@@ -459,8 +461,8 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
459
461
|
// 初始旋转角度
|
|
460
462
|
})
|
|
461
463
|
}), moveFeature = (e, t) => {
|
|
462
|
-
var
|
|
463
|
-
const n = getInstall(), o = Number(50 * t), r = ((
|
|
464
|
+
var p, m;
|
|
465
|
+
const n = getInstall(), o = Number(50 * t), r = ((p = e.frameState) == null ? void 0 : p.time) ?? Date.now(), l = r - lastTime;
|
|
464
466
|
if (distance = (distance + o * l / 1e6) % 2, lastTime = r, distance >= 1) {
|
|
465
467
|
stopAnimation();
|
|
466
468
|
return;
|
|
@@ -469,15 +471,15 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
469
471
|
distance > 1 ? 2 - distance : distance
|
|
470
472
|
), s = linePath.getCoordinateAt(
|
|
471
473
|
distance > 1 ? distance - 0.01 : distance
|
|
472
|
-
),
|
|
474
|
+
), i = linePath.getCoordinateAt(
|
|
473
475
|
distance > 1 ? 2 - distance : distance + 0.01
|
|
474
|
-
),
|
|
476
|
+
), u = getRotation(
|
|
475
477
|
mercatorToLonLat(s, "array"),
|
|
476
|
-
mercatorToLonLat(
|
|
478
|
+
mercatorToLonLat(i, "array")
|
|
477
479
|
) * Math.PI / 180;
|
|
478
|
-
(m = geoMarkerStyle.getText()) == null || m.setRotation(
|
|
479
|
-
const
|
|
480
|
-
|
|
480
|
+
(m = geoMarkerStyle.getText()) == null || m.setRotation(u), position$1.setCoordinates(a);
|
|
481
|
+
const c = getVectorContext(e);
|
|
482
|
+
c.setStyle(geoMarkerStyle), c.drawGeometry(position$1), n == null || n.render();
|
|
481
483
|
}, startAnimation = () => {
|
|
482
484
|
var e;
|
|
483
485
|
trackAnimating = !0, lastTime = Date.now(), distance = 0, position$1 = ((e = startMarker.getGeometry()) == null ? void 0 : e.clone()) || new Point([0, 0]), moveFeatureHandler && (vectorLayer$4 == null || vectorLayer$4.on("postrender", moveFeatureHandler)), geoMarker == null || geoMarker.setGeometry(void 0);
|
|
@@ -509,41 +511,41 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
509
511
|
const o = getInstall();
|
|
510
512
|
o == null || o.addLayer(vectorLayer$4), moveFeatureHandler = (r) => moveFeature(r, t), startAnimation();
|
|
511
513
|
}, getRotation = (e, t, n) => {
|
|
512
|
-
function o(
|
|
513
|
-
return 180 * (
|
|
514
|
+
function o(c) {
|
|
515
|
+
return 180 * (c % (2 * Math.PI)) / Math.PI;
|
|
514
516
|
}
|
|
515
|
-
function r(
|
|
516
|
-
return
|
|
517
|
+
function r(c) {
|
|
518
|
+
return c % 360 * Math.PI / 180;
|
|
517
519
|
}
|
|
518
|
-
function l(
|
|
519
|
-
var
|
|
520
|
-
if (!
|
|
521
|
-
if (!Array.isArray(
|
|
522
|
-
if ((
|
|
523
|
-
return
|
|
524
|
-
if (
|
|
520
|
+
function l(c) {
|
|
521
|
+
var p;
|
|
522
|
+
if (!c) throw new Error("Coordinate is required");
|
|
523
|
+
if (!Array.isArray(c)) {
|
|
524
|
+
if ((c == null ? void 0 : c.type) === "Feature" && (c == null ? void 0 : c.geometry) !== null && ((p = c == null ? void 0 : c.geometry) == null ? void 0 : p.type) === "Point")
|
|
525
|
+
return c == null ? void 0 : c.geometry.coordinates;
|
|
526
|
+
if (c.type === "Point") return (c == null ? void 0 : c.coordinates) || [];
|
|
525
527
|
}
|
|
526
|
-
if (Array.isArray(
|
|
527
|
-
return
|
|
528
|
+
if (Array.isArray(c) && c.length >= 2 && !Array.isArray(c[0]) && !Array.isArray(c[1]))
|
|
529
|
+
return c;
|
|
528
530
|
throw new Error(
|
|
529
531
|
"Coordinate must be GeoJSON Point or an Array of numbers"
|
|
530
532
|
);
|
|
531
533
|
}
|
|
532
|
-
function a(
|
|
534
|
+
function a(c, p, m = {}) {
|
|
533
535
|
if (m.final)
|
|
534
536
|
return function(S, k) {
|
|
535
537
|
return (a(k, S) + 180) % 360;
|
|
536
|
-
}(
|
|
537
|
-
const g = l(
|
|
538
|
+
}(c, p);
|
|
539
|
+
const g = l(c), f = l(p), y = r(g[0]), v = r(f[0]), L = r(g[1]), T = r(f[1]), w = Math.sin(v - y) * Math.cos(T), E = Math.cos(L) * Math.sin(T) - Math.sin(L) * Math.cos(T) * Math.cos(v - y);
|
|
538
540
|
return o(Math.atan2(w, E));
|
|
539
541
|
}
|
|
540
|
-
function s(
|
|
541
|
-
return !isNaN(
|
|
542
|
+
function s(c) {
|
|
543
|
+
return !isNaN(c) && c !== null && !Array.isArray(c);
|
|
542
544
|
}
|
|
543
|
-
function c
|
|
544
|
-
return
|
|
545
|
+
function i(c, p = {}, m = {}) {
|
|
546
|
+
return c || console.log("Coordinates are required"), Array.isArray(c) || console.log("Coordinates must be an Array"), c.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!s(c[0]) || !s(c[1])) && console.log("Coordinates must contain numbers"), d({ type: "Point", coordinates: c }, p, m);
|
|
545
547
|
}
|
|
546
|
-
function d(
|
|
548
|
+
function d(c, p = {}, m = {}) {
|
|
547
549
|
const g = {
|
|
548
550
|
type: "Feature",
|
|
549
551
|
id: "",
|
|
@@ -551,10 +553,10 @@ const createPointFeatureWithStyle = (e) => {
|
|
|
551
553
|
bbox: {},
|
|
552
554
|
geometry: {}
|
|
553
555
|
};
|
|
554
|
-
return m.id !== void 0 && (g.id = m.id), m.bbox && (g.bbox = m.bbox), g.properties =
|
|
556
|
+
return m.id !== void 0 && (g.id = m.id), m.bbox && (g.bbox = m.bbox), g.properties = p, g.geometry = c, g;
|
|
555
557
|
}
|
|
556
|
-
const
|
|
557
|
-
return
|
|
558
|
+
const u = a(i(e), i(t), n);
|
|
559
|
+
return u < 0 ? 360 + u : u;
|
|
558
560
|
}, getRightIcons = (e) => {
|
|
559
561
|
const t = [];
|
|
560
562
|
return e.existDevice && t.push(""), e.existMobile && t.push(""), e.existWaterGauge && t.push(""), t;
|
|
@@ -598,24 +600,24 @@ function useShipOverlay(e) {
|
|
|
598
600
|
overflow: "visible"
|
|
599
601
|
}));
|
|
600
602
|
let s = null;
|
|
601
|
-
const
|
|
603
|
+
const i = () => {
|
|
602
604
|
d(), s = window.setInterval(() => {
|
|
603
605
|
if (t.value) {
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
606
|
+
const c = t.value.querySelector(".ship-overlay-content");
|
|
607
|
+
c && c.style && (c.style.backgroundColor = e.color, c.style.color = "#FFF", setTimeout(() => {
|
|
608
|
+
c && c.style && (c.style.backgroundColor = "#ffffff", c.style.color = "#000");
|
|
607
609
|
}, 500));
|
|
608
610
|
}
|
|
609
611
|
}, 1e3);
|
|
610
612
|
}, d = () => {
|
|
611
613
|
s && (clearInterval(s), s = null);
|
|
612
|
-
},
|
|
614
|
+
}, u = () => {
|
|
613
615
|
n.value && n.value.setPosition(fromLonLat(e.position));
|
|
614
616
|
};
|
|
615
|
-
return watch(() => e.selected, (
|
|
616
|
-
|
|
617
|
+
return watch(() => e.selected, (c) => {
|
|
618
|
+
c ? i() : d();
|
|
617
619
|
}, { immediate: !0 }), watch(() => e.position, () => {
|
|
618
|
-
|
|
620
|
+
u();
|
|
619
621
|
}, { deep: !0 }), onMounted(() => {
|
|
620
622
|
}), onBeforeUnmount(() => {
|
|
621
623
|
d();
|
|
@@ -751,12 +753,14 @@ function setLinePath(e) {
|
|
|
751
753
|
n && o === "top-right" && (n.style.right = "-20px"), n && o === "top-left" && (n.style.left = "-20px");
|
|
752
754
|
const l = POSITION_PRIORITY.filter((s) => s.positioning === o && s.offset === r), a = t == null ? void 0 : t.querySelector(".ship-overlay-line line");
|
|
753
755
|
if (l.length > 0) {
|
|
754
|
-
const { x1: s, y1:
|
|
755
|
-
a && (a.setAttribute("x1", s), a.setAttribute("y1",
|
|
756
|
+
const { x1: s, y1: i, x2: d, y2: u } = l[0].line;
|
|
757
|
+
a && (a.setAttribute("x1", s), a.setAttribute("y1", i), a.setAttribute("x2", d), a.setAttribute("y2", u));
|
|
756
758
|
}
|
|
757
759
|
}
|
|
758
760
|
function removeLabelOverlay(e) {
|
|
759
|
-
existingOverlays.value = []
|
|
761
|
+
existingOverlays.value = [];
|
|
762
|
+
const n = e.getOverlays().getArray().filter((o) => o.get("class") === "zh-map-ship-overlay");
|
|
763
|
+
console.log("labelOverlays--------", n), n.forEach((o) => {
|
|
760
764
|
o.setPosition(void 0), o.setElement(void 0), e.removeOverlay(o), o.dispose();
|
|
761
765
|
});
|
|
762
766
|
}
|
|
@@ -771,22 +775,22 @@ const getShipDirectPath = (e) => {
|
|
|
771
775
|
return e <= MAP_ZOOM.shipModelMax && e >= MAP_ZOOM.shipTriggleMin ? "ship" : "triangle";
|
|
772
776
|
}, getShipScale = (e, t) => {
|
|
773
777
|
if (t === "ship") {
|
|
774
|
-
const { len: n, wid: o } = e, r = 97, l = 20, s = 1 / getView().getResolution(),
|
|
775
|
-
return Math.max(
|
|
778
|
+
const { len: n, wid: o } = e, r = 97, l = 20, s = 1 / getView().getResolution(), i = n * s / r, d = o * s / l;
|
|
779
|
+
return Math.max(i, d);
|
|
776
780
|
}
|
|
777
781
|
return MAP_ZOOM.scaleNum;
|
|
778
782
|
}, initShipStyle = (e, t, n) => {
|
|
779
783
|
const { color: o, direct: r, isHighlight: l, shipData: a } = e.getProperties(), s = (a.cog - 90 + 360) % 360;
|
|
780
784
|
return new Style({
|
|
781
785
|
image: new Icon({
|
|
782
|
-
src:
|
|
786
|
+
src: i(),
|
|
783
787
|
scale: t || MAP_ZOOM.scaleNum,
|
|
784
788
|
anchor: [0.5, 0.5],
|
|
785
789
|
rotation: s * Math.PI / 180,
|
|
786
790
|
rotateWithView: !1
|
|
787
791
|
})
|
|
788
792
|
});
|
|
789
|
-
function
|
|
793
|
+
function i() {
|
|
790
794
|
return `data:image/svg+xml;utf8,${encodeURIComponent(d())}`;
|
|
791
795
|
}
|
|
792
796
|
function d() {
|
|
@@ -840,10 +844,10 @@ const getShipDirectPath = (e) => {
|
|
|
840
844
|
}, createLabelElement = (e) => {
|
|
841
845
|
const t = document.createElement("div");
|
|
842
846
|
t.className = "ship-overlay-box", t.style.position = "relative";
|
|
843
|
-
const n = e.getProperties(), { shipData: o, blinking: r, blinkingColor: l, name: a } = n, { lon: s, lat:
|
|
847
|
+
const n = e.getProperties(), { shipData: o, blinking: r, blinkingColor: l, name: a } = n, { lon: s, lat: i } = o, d = createVNode({
|
|
844
848
|
setup() {
|
|
845
849
|
return useShipOverlay({
|
|
846
|
-
position: [s + 2e-3,
|
|
850
|
+
position: [s + 2e-3, i + 2e-3],
|
|
847
851
|
selected: r,
|
|
848
852
|
name: a,
|
|
849
853
|
color: l,
|
|
@@ -866,12 +870,11 @@ const shipsSource = new VectorSource(), shipsLayer = new VectorLayer({
|
|
|
866
870
|
});
|
|
867
871
|
let hoveredShipId = "", attentionShips = {}, attentionShipsColor = {};
|
|
868
872
|
const renderShipList = (e) => {
|
|
869
|
-
console.log("renderShipList", e);
|
|
870
873
|
const t = getInstall();
|
|
871
874
|
if (!e || !t) return;
|
|
872
|
-
removeSelectedOverlay(), t.getLayers().getArray().includes(shipsLayer) || t.addLayer(shipsLayer);
|
|
875
|
+
removeSelectedOverlay(), removeLabelOverlay(t), t.getLayers().getArray().includes(shipsLayer) || t.addLayer(shipsLayer);
|
|
873
876
|
const n = (selectedShip == null ? void 0 : selectedShip.id) || (selectedShipFeature == null ? void 0 : selectedShipFeature.get("id"));
|
|
874
|
-
|
|
877
|
+
shipsSource && shipsSource.clear();
|
|
875
878
|
const o = [];
|
|
876
879
|
if (selectedShip) {
|
|
877
880
|
const l = e.filter((a) => a.id === n);
|
|
@@ -906,18 +909,20 @@ const renderShipList = (e) => {
|
|
|
906
909
|
isHighlight: !1
|
|
907
910
|
});
|
|
908
911
|
return o.setStyle(createShipStyle(o)), o;
|
|
909
|
-
}, handleChangeSelected = () => {
|
|
910
|
-
var r;
|
|
912
|
+
}, handleChangeSelected = async () => {
|
|
911
913
|
if (!selectedShip) return;
|
|
912
914
|
const e = getInstall();
|
|
913
915
|
if (!e) return;
|
|
914
|
-
let o = cloneDeep(e.getOverlays().getArray()).find((
|
|
915
|
-
if (o) {
|
|
916
|
-
const
|
|
917
|
-
o.setElement(
|
|
916
|
+
let o = cloneDeep(e.getOverlays().getArray()).find((r) => r.get("class") == "ship-overlay-selected");
|
|
917
|
+
if (console.log("selected----------", o), o) {
|
|
918
|
+
const r = selectedShipElement(selectedShip);
|
|
919
|
+
await o.setElement(r), await o.setPosition(fromLonLat([selectedShip.lon, selectedShip.lat]));
|
|
918
920
|
} else
|
|
919
921
|
o = selectedShipStyle(selectedShip), e.addOverlay(o);
|
|
920
|
-
|
|
922
|
+
setTimeout(() => {
|
|
923
|
+
var r;
|
|
924
|
+
o && ((r = o.get("element")) != null && r.parentElement) && (o.get("element").parentElement.style.display = "block");
|
|
925
|
+
}, 20);
|
|
921
926
|
}, clearShipList = () => {
|
|
922
927
|
const e = getInstall();
|
|
923
928
|
if (!e || !shipsSource) return;
|
|
@@ -934,11 +939,11 @@ const renderShipList = (e) => {
|
|
|
934
939
|
attentionShips = e, attentionShipsColor = t;
|
|
935
940
|
const o = cloneDeep(n.getOverlays().getArray()), r = cloneDeep(shipsSource.getFeatures());
|
|
936
941
|
for (const l in attentionShips) {
|
|
937
|
-
const a = attentionShips[l], s = o.find((d) => d.getId() === "label-" + l),
|
|
938
|
-
if (s &&
|
|
939
|
-
|
|
940
|
-
const d = s.getElement(),
|
|
941
|
-
d && d !==
|
|
942
|
+
const a = attentionShips[l], s = o.find((d) => d.getId() === "label-" + l), i = r.find((d) => l === d.get("id"));
|
|
943
|
+
if (s && i) {
|
|
944
|
+
i.set("blinking", a), i.set("blinkingColor", attentionShipsColor[l] || "");
|
|
945
|
+
const d = s.getElement(), u = createLabelElement(i), c = u.querySelector(".ship-overlay-line"), p = d == null ? void 0 : d.querySelector(".ship-overlay-line");
|
|
946
|
+
d && d !== u && (p && c && c.replaceWith(p), s.setElement(u));
|
|
942
947
|
}
|
|
943
948
|
}
|
|
944
949
|
}, filterShipShow = (e) => {
|
|
@@ -950,13 +955,13 @@ const renderShipList = (e) => {
|
|
|
950
955
|
});
|
|
951
956
|
const a = cloneDeep(t.getOverlays().getArray());
|
|
952
957
|
r.forEach((s) => {
|
|
953
|
-
const
|
|
954
|
-
if (!l.has(
|
|
958
|
+
const i = s.get("id"), d = a.find((u) => u.getId() === "label-" + i);
|
|
959
|
+
if (!l.has(i))
|
|
955
960
|
s.setStyle([]), d && (d.get("element").style.visibility = "hidden");
|
|
956
961
|
else {
|
|
957
962
|
d && (d.get("element").style.visibility = "visible");
|
|
958
|
-
const
|
|
959
|
-
(
|
|
963
|
+
const u = s.getStyle();
|
|
964
|
+
(u == null ? void 0 : u.length) == 0 && s.setStyle(createShipStyle(s));
|
|
960
965
|
}
|
|
961
966
|
});
|
|
962
967
|
}, renderShipSelected = (e) => {
|
|
@@ -981,6 +986,7 @@ const renderShipList = (e) => {
|
|
|
981
986
|
const e = hoveredShipId ? shipsSource.getFeatures().find((t) => t.get("id") === hoveredShipId) : null;
|
|
982
987
|
hoveredShipId = null, e == null || e.set("isHighlight", !1), e == null || e.setStyle(createShipStyle(e));
|
|
983
988
|
}, removeSelectedOverlay = () => {
|
|
989
|
+
console.log("removeSelectedOverlay-------");
|
|
984
990
|
try {
|
|
985
991
|
const e = getInstall(), n = cloneDeep(e.getOverlays().getArray()).find((o) => o.get("class") == "ship-overlay-selected");
|
|
986
992
|
n && n.setPosition(void 0);
|
|
@@ -1049,8 +1055,8 @@ const renderPortList = (e) => {
|
|
|
1049
1055
|
} else
|
|
1050
1056
|
console.log("清除所有港口"), vectorSource$3.clear();
|
|
1051
1057
|
}, clearSelectedPort$1 = () => {
|
|
1052
|
-
const e = selectedPortFeature$1.get("portData"), t = getZoom();
|
|
1053
|
-
vectorSource$3.getFeatures().forEach((o) => {
|
|
1058
|
+
const e = selectedPortFeature$1 == null ? void 0 : selectedPortFeature$1.get("portData"), t = getZoom();
|
|
1059
|
+
e && vectorSource$3.getFeatures().forEach((o) => {
|
|
1054
1060
|
o.get("portData").id === e.id && (o == null || o.setStyle(setPortStyle$1(e, t, !1)));
|
|
1055
1061
|
}), selectedPortData = null, selectedPortFeature$1 = null;
|
|
1056
1062
|
};
|
|
@@ -1059,7 +1065,7 @@ const selectedPort = (e) => {
|
|
|
1059
1065
|
e ? (clearPrevSelectedPort$1(), addSelectedPortStyle$1(e)) : clearSelectedPort$1();
|
|
1060
1066
|
}, clearPrevSelectedPort$1 = () => {
|
|
1061
1067
|
if (selectedPortFeature$1) {
|
|
1062
|
-
const e = selectedPortFeature$1.get("portData"), t = getZoom();
|
|
1068
|
+
const e = selectedPortFeature$1 == null ? void 0 : selectedPortFeature$1.get("portData"), t = getZoom();
|
|
1063
1069
|
selectedPortFeature$1.setStyle(setPortStyle$1(e, t, !1));
|
|
1064
1070
|
}
|
|
1065
1071
|
}, addSelectedPortStyle$1 = (e) => {
|
|
@@ -1327,7 +1333,7 @@ const createMeasureTooltip$1 = () => {
|
|
|
1327
1333
|
}
|
|
1328
1334
|
}
|
|
1329
1335
|
}, 150));
|
|
1330
|
-
}, _hoisted_1$
|
|
1336
|
+
}, _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1331
1337
|
__name: "scaleLine",
|
|
1332
1338
|
setup(e, { expose: t }) {
|
|
1333
1339
|
return t({
|
|
@@ -1338,36 +1344,32 @@ const createMeasureTooltip$1 = () => {
|
|
|
1338
1344
|
}), l = document.getElementById("scale-line-container");
|
|
1339
1345
|
l && (r.setTarget(l), getInstall().addControl(r));
|
|
1340
1346
|
}
|
|
1341
|
-
}), (o, r) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1347
|
+
}), (o, r) => (openBlock(), createElementBlock("div", _hoisted_1$2));
|
|
1342
1348
|
}
|
|
1343
|
-
}), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-31ff8293"]]), _hoisted_1 = { class: "zoom" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1349
|
+
}), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-31ff8293"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1344
1350
|
__name: "zoomControl",
|
|
1345
1351
|
setup(e) {
|
|
1346
|
-
const t =
|
|
1347
|
-
if (
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
const r = getZoom();
|
|
1355
|
-
if (!r) return;
|
|
1356
|
-
setZoom(r - 1);
|
|
1357
|
-
}
|
|
1352
|
+
const t = () => {
|
|
1353
|
+
if (!getInstall()) return;
|
|
1354
|
+
const r = getZoom();
|
|
1355
|
+
r && setZoom(r + 1);
|
|
1356
|
+
}, n = () => {
|
|
1357
|
+
if (!getInstall()) return;
|
|
1358
|
+
const r = getZoom();
|
|
1359
|
+
r && setZoom(r - 1);
|
|
1358
1360
|
};
|
|
1359
|
-
return (
|
|
1361
|
+
return (o, r) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1360
1362
|
createElementVNode("div", {
|
|
1361
1363
|
class: "button big-button",
|
|
1362
|
-
onClick:
|
|
1364
|
+
onClick: t
|
|
1363
1365
|
}, " + "),
|
|
1364
1366
|
createElementVNode("div", {
|
|
1365
1367
|
class: "button small-button",
|
|
1366
|
-
onClick:
|
|
1368
|
+
onClick: n
|
|
1367
1369
|
}, " - ")
|
|
1368
1370
|
]));
|
|
1369
1371
|
}
|
|
1370
|
-
}), ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
1372
|
+
}), ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-2b7e25f2"]]), getLayers = () => {
|
|
1371
1373
|
var e;
|
|
1372
1374
|
return (e = getInstall()) == null ? void 0 : e.getLayers();
|
|
1373
1375
|
}, layerType = ref("vector"), getShowLayerType = () => layerType.value, setShowLayerType = (e) => {
|
|
@@ -1482,13 +1484,13 @@ const initDraw = () => {
|
|
|
1482
1484
|
draw.on("drawstart", (t) => {
|
|
1483
1485
|
var n;
|
|
1484
1486
|
sketch = t.feature, e = (n = sketch.getGeometry()) == null ? void 0 : n.on("change", (o) => {
|
|
1485
|
-
const r = o.target, l = computedArea(r, "nm"), s = r.getCoordinates()[0],
|
|
1486
|
-
if (lineLimitError = Number(getLength(
|
|
1487
|
-
const
|
|
1487
|
+
const r = o.target, l = computedArea(r, "nm"), s = r.getCoordinates()[0], i = new LineString([s[s.length - 2], s[s.length - 1]]), d = computedDistance(i, "nm");
|
|
1488
|
+
if (lineLimitError = Number(getLength(i) / 1e3) > 150, !l) return;
|
|
1489
|
+
const u = '<span class="error pl-4">超出可以绘画的距离</span>';
|
|
1488
1490
|
measureTooltipElement && (measureTooltipElement.innerHTML = `
|
|
1489
1491
|
<div class="text">
|
|
1490
1492
|
面积:${l}
|
|
1491
|
-
${lineLimitError ?
|
|
1493
|
+
${lineLimitError ? u : ""}
|
|
1492
1494
|
</div>
|
|
1493
1495
|
`), helpTooltipElement && (helpTooltipElement.innerHTML = `
|
|
1494
1496
|
<div class="text">
|
|
@@ -1496,7 +1498,7 @@ const initDraw = () => {
|
|
|
1496
1498
|
</div>
|
|
1497
1499
|
<div class="text ${lineLimitError ? "error" : ""}">
|
|
1498
1500
|
线段 ${s.length - 2}: ${d}
|
|
1499
|
-
${lineLimitError ?
|
|
1501
|
+
${lineLimitError ? u : ""}
|
|
1500
1502
|
|
|
1501
1503
|
</div>
|
|
1502
1504
|
<div>
|
|
@@ -1511,14 +1513,14 @@ const initDraw = () => {
|
|
|
1511
1513
|
const n = t.feature.getGeometry(), o = n.getCoordinates(), r = o[0][o[0].length - 2];
|
|
1512
1514
|
if (measureTooltip.setPosition(r), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement), (l = getProps()) != null && l.areaDrawEnd) {
|
|
1513
1515
|
n.getInteriorPoint().getCoordinates();
|
|
1514
|
-
const
|
|
1515
|
-
(a = getProps()) == null || a.areaDrawEnd(
|
|
1516
|
+
const i = o[0].map((d) => transform(d, projection.mercator, projection.data));
|
|
1517
|
+
(a = getProps()) == null || a.areaDrawEnd(i);
|
|
1516
1518
|
}
|
|
1517
1519
|
draw && (draw.setActive(!1), getInstall().removeInteraction(draw), getInstall().getInteractions().forEach((d) => {
|
|
1518
1520
|
d instanceof Draw && (d.setActive(!1), getInstall().removeInteraction(d));
|
|
1519
1521
|
})), e && unByKey(e), (s = document.querySelector(".delete-icon")) == null || s.addEventListener("click", () => {
|
|
1520
|
-
var
|
|
1521
|
-
reset(), (
|
|
1522
|
+
var i;
|
|
1523
|
+
reset(), (i = getProps()) == null || i.areaDrawEnd([]);
|
|
1522
1524
|
});
|
|
1523
1525
|
});
|
|
1524
1526
|
}, computedArea = (e, t) => {
|
|
@@ -1580,7 +1582,7 @@ const locationTruck = async (e) => {
|
|
|
1580
1582
|
const l = (e == null ? void 0 : e.drc) || "";
|
|
1581
1583
|
r.style.transform = `rotate(${l}deg)`, r.style.backgroundSize = "cover", currentTruckOverlay == null || currentTruckOverlay.setPosition(t);
|
|
1582
1584
|
}, renderTruckTrack = (e, t, n, o = 1e3) => {
|
|
1583
|
-
renderTrackLine(e, t, n, LENGTH_UNIT.KM
|
|
1585
|
+
renderTrackLine(e, t, n, LENGTH_UNIT.KM);
|
|
1584
1586
|
}, closeTruckTrack = () => {
|
|
1585
1587
|
closeTrack();
|
|
1586
1588
|
}, removeTruckIcon = () => {
|
|
@@ -1658,7 +1660,7 @@ const render = (e) => {
|
|
|
1658
1660
|
selected: selectedLocation,
|
|
1659
1661
|
clearSelected,
|
|
1660
1662
|
clear: clearList
|
|
1661
|
-
}, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1663
|
+
}, _hoisted_1 = { class: "zh-map-box" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1662
1664
|
__name: "Map",
|
|
1663
1665
|
props: {
|
|
1664
1666
|
zoom: { default: MAP_ZOOM.default },
|
|
@@ -1679,7 +1681,7 @@ const render = (e) => {
|
|
|
1679
1681
|
},
|
|
1680
1682
|
setup(e, { expose: t }) {
|
|
1681
1683
|
const n = ref(), o = ref(), r = e;
|
|
1682
|
-
return
|
|
1684
|
+
return onMounted(() => {
|
|
1683
1685
|
var a;
|
|
1684
1686
|
initMap(r), setProps(r), setShowLayerType(r.layerType), setGreenTileVisible(r.showGreenLayer), (a = o.value) == null || a.setScaleLine(r.scaleLineUnit);
|
|
1685
1687
|
}), t({
|
|
@@ -1729,13 +1731,13 @@ const render = (e) => {
|
|
|
1729
1731
|
},
|
|
1730
1732
|
utils: {
|
|
1731
1733
|
getCalculateExtent: () => {
|
|
1732
|
-
const a = getView().calculateExtent(getSize()), s = transform([a[0], a[1]], projection.mercator, projection.data),
|
|
1733
|
-
return [s[0], s[1],
|
|
1734
|
+
const a = getView().calculateExtent(getSize()), s = transform([a[0], a[1]], projection.mercator, projection.data), i = transform([a[2], a[3]], projection.mercator, projection.data);
|
|
1735
|
+
return [s[0], s[1], i[0], i[1]];
|
|
1734
1736
|
},
|
|
1735
1737
|
convertSixHundredThousandToLatLng,
|
|
1736
1738
|
calculateCirclePoints
|
|
1737
1739
|
}
|
|
1738
|
-
}), (a, s) => (openBlock(), createElementBlock(
|
|
1740
|
+
}), (a, s) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1739
1741
|
createElementVNode("div", {
|
|
1740
1742
|
id: "map",
|
|
1741
1743
|
ref_key: "zhMapRef",
|
|
@@ -1747,9 +1749,9 @@ const render = (e) => {
|
|
|
1747
1749
|
ref: o
|
|
1748
1750
|
}, null, 512),
|
|
1749
1751
|
createVNode(ZoomControl, { ref: "zoomControlRef" }, null, 512)
|
|
1750
|
-
]
|
|
1752
|
+
]));
|
|
1751
1753
|
}
|
|
1752
|
-
}), Map$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1754
|
+
}), Map$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d813907c"]]), ZhMap = withInstall(Map$1);
|
|
1753
1755
|
export {
|
|
1754
1756
|
ZhMap as Z
|
|
1755
1757
|
};
|