zhihao-ui 1.2.48 → 1.2.50
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/{BaseItem-D1xoWSGo.js → BaseItem-qQu4m6Ih.js} +1 -1
- package/dist/es/{DatePicker-Dh8sksac.js → DatePicker-_bR7mI8g.js} +1 -1
- package/dist/es/{DetailHeader-CSC9DAQc.js → DetailHeader-pU7uOGPf.js} +1 -1
- package/dist/es/{DetailSubTitle-1ZjJAmet.js → DetailSubTitle-DgBFegpy.js} +1 -1
- package/dist/es/{DiyDataTable-BerDffOX.js → DiyDataTable-CMQoWEUT.js} +1 -1
- package/dist/es/{EditInfoPair-Dx0KRj7O.js → EditInfoPair-BEOvqb8G.js} +1 -1
- package/dist/es/{FileWrapper-CS2RTMEV.js → FileWrapper-yw3kxAUI.js} +1 -1
- package/dist/es/{Grid-BQYUct2W.js → Grid-CqP3xgJk.js} +1 -1
- package/dist/es/{InfoPair-C3sCcJVT.js → InfoPair-C_kvIK27.js} +1 -1
- package/dist/es/{Map-BaIwtuYL.js → Map-BaPP_BZU.js} +962 -909
- package/dist/es/{MoneyInput-DevlnT8p.js → MoneyInput-bnyZa-me.js} +1 -1
- package/dist/es/{Table-BoMGydAp.js → Table-XYMhbMX5.js} +3 -2
- package/dist/es/index.js +14 -14
- package/dist/index.css +1 -1
- package/dist/types/components/Map/Map.vue.d.ts +6 -4
- package/dist/types/components/Map/index.d.ts +12 -6
- package/dist/types/components/Map/render/canvasRender/canvasRender.d.ts +1 -0
- package/dist/types/components/Map/render/drawPolygon.d.ts +1 -0
- package/dist/types/components/Map/render/renderPoint.d.ts +1 -1
- package/dist/types/components/Map/utils/store.d.ts +1 -2
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +17 -17
- package/package.json +1 -1
|
@@ -1,123 +1,128 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent, inject, useModel,
|
|
1
|
+
var G = Object.defineProperty;
|
|
2
|
+
var _ = (e, t, o) => t in e ? G(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
+
var I = (e, t, o) => _(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { ref, defineComponent, inject, useModel, watch, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, Fragment, renderList, toDisplayString, createCommentVNode, mergeModels, nextTick, onMounted, normalizeClass, renderSlot, createBlock, useCssVars, computed, provide } from "vue";
|
|
5
5
|
import { p as getArea, q as getLength, V as VectorSource, r as VectorLayer, S as Style, C as CircleStyle, F as Fill, s as Stroke, D as Draw, O as Overlay, u as unByKey, t as ElSelect, v as ElOption, w as getUid, x as fromLonLat, P as Point, y as transform, z as Feature, T as Text, I as Icon, A as Translate, B as toLonLat, i as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, H as Circle, J as transformExtent, h as hooks, L as LineString, K as Polyline, M as getVectorContext, N as buffer, Q as ScaleLine$1, R as MultiPoint, U as getCenter, X as TileLayer, Y as XYZ, Z as Map$1, _ as View } from "./vendor-DaYdW1_n.js";
|
|
6
6
|
import { _ as _export_sfc } from "./Button-CNEQmoqP.js";
|
|
7
|
-
import { g as getForegroundColor } from "./DatePicker-
|
|
7
|
+
import { g as getForegroundColor } from "./DatePicker-_bR7mI8g.js";
|
|
8
8
|
import { w as withInstall } from "./utils-BSQSj8Ii.js";
|
|
9
9
|
var BaseMapType = /* @__PURE__ */ ((e) => (e[e.vector = 0] = "vector", e[e.satellite = 1] = "satellite", e))(BaseMapType || {}), SEARCH_TYPE = /* @__PURE__ */ ((e) => (e[e.SEARCH_SHIP = 0] = "SEARCH_SHIP", e[e.SEARCH_PORT = 1] = "SEARCH_PORT", e[e.SEARCH_CUSTOM = 2] = "SEARCH_CUSTOM", e))(SEARCH_TYPE || {}), COPY_RIGHT_TYPE = /* @__PURE__ */ ((e) => (e[e.HORIZONTAL = 0] = "HORIZONTAL", e[e.VERTICAL = 1] = "VERTICAL", e))(COPY_RIGHT_TYPE || {}), CAR_COLOR = /* @__PURE__ */ ((e) => (e[e.BLUE = 1] = "BLUE", e[e.YELLOW = 2] = "YELLOW", e[e.Y_GREEN = 3] = "Y_GREEN", e))(CAR_COLOR || {}), DEVICE_TYPE = /* @__PURE__ */ ((e) => (e[e.HOST = 1] = "HOST", e[e.TALK = 2] = "TALK", e[e.STORAGE = 3] = "STORAGE", e[e.INTERNET = 4] = "INTERNET", e[e.CAMERA = 5] = "CAMERA", e[e.LOAD = 6] = "LOAD", e))(DEVICE_TYPE || {}), LENGTH_UNIT = /* @__PURE__ */ ((e) => (e[e.M = 1] = "M", e[e.KM = 2] = "KM", e[e.NM = 3] = "NM", e))(LENGTH_UNIT || {}), SWITCH_BTN = /* @__PURE__ */ ((e) => (e.Camera = "camera", e.Mobile = "mobile", e.WaterGauge = "waterGauge", e))(SWITCH_BTN || {}), SHIP_SAIL_STATUS = /* @__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))(SHIP_SAIL_STATUS || {});
|
|
10
10
|
class ShipMapData {
|
|
11
|
-
constructor(t, n,
|
|
12
|
-
|
|
11
|
+
constructor(t, o, n, l, r, i, c, s, m, d, u, h, p, f, v, g, k, M, b, E, V, F, $, y) {
|
|
12
|
+
I(this, "id");
|
|
13
13
|
// mmsi
|
|
14
|
-
|
|
14
|
+
I(this, "mmsi");
|
|
15
15
|
// 船舶三角形填充色
|
|
16
|
-
|
|
16
|
+
I(this, "fill");
|
|
17
17
|
// 船类型 "7": "货船",
|
|
18
|
-
|
|
18
|
+
I(this, "shipType");
|
|
19
19
|
// 船名
|
|
20
|
-
|
|
20
|
+
I(this, "name");
|
|
21
21
|
// 长度
|
|
22
|
-
|
|
22
|
+
I(this, "length");
|
|
23
23
|
// 宽度
|
|
24
|
-
|
|
24
|
+
I(this, "breadth");
|
|
25
25
|
// 经度
|
|
26
|
-
|
|
26
|
+
I(this, "lon");
|
|
27
27
|
// 纬度
|
|
28
|
-
|
|
28
|
+
I(this, "lat");
|
|
29
29
|
// 时间
|
|
30
|
-
|
|
30
|
+
I(this, "createdAt");
|
|
31
31
|
// 速度
|
|
32
|
-
|
|
32
|
+
I(this, "speed");
|
|
33
33
|
// 来源
|
|
34
|
-
|
|
34
|
+
I(this, "from");
|
|
35
35
|
// 船状态 "stop":"静止","sail":"航行","work":"作业","danger":"危险","other":"其他"
|
|
36
|
-
|
|
36
|
+
I(this, "sailStatus");
|
|
37
37
|
// 船艏向
|
|
38
|
-
|
|
38
|
+
I(this, "hdg");
|
|
39
39
|
// 航迹向
|
|
40
|
-
|
|
40
|
+
I(this, "cog");
|
|
41
41
|
// 设备定位类型
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
I(this, "posType");
|
|
43
|
+
I(this, "type");
|
|
44
44
|
// 航向角度
|
|
45
|
-
|
|
45
|
+
I(this, "angle");
|
|
46
46
|
// 左侧是否显示色块
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.id = t, this.mmsi =
|
|
47
|
+
I(this, "leftIconColor");
|
|
48
|
+
I(this, "existDevice");
|
|
49
|
+
I(this, "existMobile");
|
|
50
|
+
I(this, "existWaterGauge");
|
|
51
|
+
I(this, "selected");
|
|
52
|
+
I(this, "blinkColors");
|
|
53
|
+
this.id = t, this.mmsi = o, this.fill = n, this.shipType = l, this.name = r, this.length = i, this.breadth = c, this.lon = s, this.lat = m, this.createdAt = d, this.speed = u, this.from = h, this.sailStatus = p, this.hdg = f, this.cog = v, this.posType = g, this.type = k, this.angle = M, this.leftIconColor = b, this.existDevice = E, this.existMobile = V, this.existWaterGauge = F, this.selected = $, this.blinkColors = y;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
const formatLength = function(e, t) {
|
|
57
|
-
const
|
|
58
|
-
let
|
|
57
|
+
const n = getLength(e);
|
|
58
|
+
let l = "";
|
|
59
59
|
switch (t) {
|
|
60
60
|
case LENGTH_UNIT.M:
|
|
61
|
-
|
|
61
|
+
l = Math.round(n * 100) / 100 + " m";
|
|
62
62
|
break;
|
|
63
63
|
case LENGTH_UNIT.KM:
|
|
64
|
-
|
|
64
|
+
l = Math.round(n / 1e3 * 100) / 100 + " km";
|
|
65
65
|
break;
|
|
66
66
|
case LENGTH_UNIT.NM:
|
|
67
|
-
|
|
67
|
+
l = (Math.round(n / 1e3 * 100) / 100 / 1.852).toFixed(2) + " nm";
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return l;
|
|
71
71
|
}, convertSixHundredThousandToLatLng = function(e, t) {
|
|
72
|
-
const
|
|
73
|
-
return [Number(e) / 6e5,
|
|
72
|
+
const o = Number(t) / 6e5;
|
|
73
|
+
return [Number(e) / 6e5, o];
|
|
74
74
|
}, formatArea = (e, t) => {
|
|
75
|
-
const
|
|
76
|
-
let
|
|
75
|
+
const n = getArea(e);
|
|
76
|
+
let l;
|
|
77
77
|
switch (t) {
|
|
78
78
|
case LENGTH_UNIT.KM:
|
|
79
|
-
|
|
79
|
+
n > 1e4 ? l = Math.round(n / 1e6 * 100) / 100 + " km<sup>2</sup>" : l = Math.round(n * 100) / 100 + " m<sup>2</sup>";
|
|
80
80
|
break;
|
|
81
81
|
case LENGTH_UNIT.NM:
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const r = Math.pow(1.852, 2);
|
|
83
|
+
n > 1e4 ? l = Math.round(n / 1e6 / r * 100) / 100 + " nm<sup>2</sup>" : l = Math.round(n * 100) / 100 + " m<sup>2</sup>";
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return l;
|
|
87
87
|
}, convertShipMapData = (e) => {
|
|
88
|
-
const t = (
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
const t = (o) => new ShipMapData(
|
|
89
|
+
o.id,
|
|
90
|
+
o.id,
|
|
91
91
|
// 船舶三角形填充色
|
|
92
|
-
|
|
92
|
+
o.fill || "#04C900",
|
|
93
93
|
"70",
|
|
94
|
-
(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
(o.cnname || o.enname || o.name || o.id) + `${o.existName ? o.existName : ""}`,
|
|
95
|
+
o.len || o.length,
|
|
96
|
+
o.wid || o.breadth,
|
|
97
|
+
o.lon,
|
|
98
|
+
o.lat,
|
|
99
99
|
(/* @__PURE__ */ new Date()).getTime(),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
Number(
|
|
104
|
-
|
|
105
|
-
Number(
|
|
100
|
+
o.spd,
|
|
101
|
+
o.from,
|
|
102
|
+
o.status,
|
|
103
|
+
Number(o.hdg),
|
|
104
|
+
o.cog,
|
|
105
|
+
Number(o.postype),
|
|
106
106
|
"other",
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
o.cog,
|
|
108
|
+
o.leftIconColor,
|
|
109
|
+
o.existDevice,
|
|
110
|
+
o.existMobile,
|
|
111
|
+
o.existWaterGauge,
|
|
112
|
+
o.selected,
|
|
113
|
+
o.blinkColors
|
|
114
114
|
);
|
|
115
|
-
return Array.isArray(e) ? e.map((
|
|
115
|
+
return Array.isArray(e) ? e.map((o) => t(o)) : t(e);
|
|
116
116
|
}, formatUtils = {
|
|
117
117
|
formatLength,
|
|
118
118
|
convertSixHundredThousandToLatLng,
|
|
119
119
|
formatArea
|
|
120
|
-
},
|
|
120
|
+
}, mapInstance$9 = ref(), shipsLayer = ref(), largeAmountShipsLayer = ref(), selectShipsLayer = ref(), allShips = ref([]), selectSingleShipData = ref();
|
|
121
|
+
ref();
|
|
122
|
+
const trucksLayer = ref(), shipTrackLineFeatures = ref([]), trackLineVectorSource = ref(), shipTrackVectorLayer = ref();
|
|
123
|
+
ref();
|
|
124
|
+
ref();
|
|
125
|
+
const shipLabels = ref([]), trackLabels = ref([]), showTrackLayer = ref(!1), allTracks = ref([]), currentTrackId = ref(""), showTrackAnimatMarker = ref(!1), hiddenOrther = ref(!1), showDrawLayer = ref(!1), _hoisted_1$4 = {
|
|
121
126
|
key: 0,
|
|
122
127
|
class: "measure-panel"
|
|
123
128
|
}, _hoisted_2$2 = { class: "d-flex justify-content-between align-content-start w-100" }, _hoisted_3$1 = { class: "measure-history-list" }, _hoisted_4 = { class: "left-panel" }, _hoisted_5 = { class: "text index" }, _hoisted_6 = { class: "text" }, _hoisted_7 = ["onClick"], _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
@@ -129,9 +134,9 @@ const formatLength = function(e, t) {
|
|
|
129
134
|
visibleModifiers: {}
|
|
130
135
|
}),
|
|
131
136
|
emits: /* @__PURE__ */ mergeModels(["close"], ["update:visible"]),
|
|
132
|
-
setup(e, { expose: t, emit:
|
|
133
|
-
const
|
|
134
|
-
let d, u,
|
|
137
|
+
setup(e, { expose: t, emit: o }) {
|
|
138
|
+
const n = inject("mapInstance"), l = o, r = useModel(e, "visible"), i = ref("3"), c = ref([]), s = ref(!1), m = new VectorSource();
|
|
139
|
+
let d, u, h, p, f;
|
|
135
140
|
const v = new VectorLayer({
|
|
136
141
|
source: m,
|
|
137
142
|
style: {
|
|
@@ -141,20 +146,20 @@ const formatLength = function(e, t) {
|
|
|
141
146
|
"circle-radius": 7,
|
|
142
147
|
"circle-fill-color": "#ffcc33"
|
|
143
148
|
}
|
|
144
|
-
}),
|
|
145
|
-
if (
|
|
149
|
+
}), g = function(S) {
|
|
150
|
+
if (S.dragging)
|
|
146
151
|
return;
|
|
147
|
-
let
|
|
148
|
-
d && (
|
|
149
|
-
},
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
var
|
|
153
|
-
(
|
|
152
|
+
let T = "点击选择起点";
|
|
153
|
+
d && (T = "单击继续,双击结束"), u && (u.innerHTML = T, h.setPosition(S.coordinate), u.classList.remove("hidden"));
|
|
154
|
+
}, k = () => {
|
|
155
|
+
var S, T;
|
|
156
|
+
n != null && n.value && ((S = n == null ? void 0 : n.value) == null || S.on("pointermove", g), (T = n == null ? void 0 : n.value) == null || T.getViewport().addEventListener("mouseout", function() {
|
|
157
|
+
var C;
|
|
158
|
+
(C = u == null ? void 0 : u.classList) == null || C.add("hidden");
|
|
154
159
|
}), s.value = !0);
|
|
155
160
|
};
|
|
156
161
|
let M;
|
|
157
|
-
const
|
|
162
|
+
const b = new Style({
|
|
158
163
|
fill: new Fill({
|
|
159
164
|
color: "rgba(255, 255, 255, 0.2)"
|
|
160
165
|
}),
|
|
@@ -173,99 +178,106 @@ const formatLength = function(e, t) {
|
|
|
173
178
|
})
|
|
174
179
|
})
|
|
175
180
|
});
|
|
176
|
-
function
|
|
177
|
-
var
|
|
178
|
-
if (
|
|
179
|
-
if (c.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((
|
|
180
|
-
var
|
|
181
|
-
(
|
|
181
|
+
function E() {
|
|
182
|
+
var S, T;
|
|
183
|
+
if (n != null && n.value) {
|
|
184
|
+
if (showDrawLayer.value = !1, c.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((C) => {
|
|
185
|
+
var P;
|
|
186
|
+
(P = C == null ? void 0 : C.parentNode) == null || P.removeChild(C);
|
|
182
187
|
}), m.clear(), M) {
|
|
183
|
-
const
|
|
184
|
-
|
|
188
|
+
const C = n.value.getInteractions().getArray().find((P) => getUid(P) === getUid(M));
|
|
189
|
+
C && ((S = n.value) == null || S.removeInteraction(C));
|
|
185
190
|
}
|
|
186
|
-
(
|
|
191
|
+
(T = n.value) == null || T.removeLayer(v), u != null && u.parentNode && u.parentNode.removeChild(u), p != null && p.parentNode && p.parentNode.removeChild(p);
|
|
187
192
|
}
|
|
188
193
|
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
191
|
-
|
|
194
|
+
function V() {
|
|
195
|
+
var T, C;
|
|
196
|
+
E(), (T = n == null ? void 0 : n.value) == null || T.addLayer(v), showDrawLayer.value = !0, M = new Draw({
|
|
192
197
|
source: m,
|
|
193
198
|
type: "LineString",
|
|
194
199
|
style: function() {
|
|
195
|
-
return
|
|
200
|
+
return b;
|
|
196
201
|
},
|
|
197
202
|
// 添加条件函数,判断是否应该触发绘制
|
|
198
|
-
condition: function(
|
|
199
|
-
return
|
|
203
|
+
condition: function(P) {
|
|
204
|
+
return P.originalEvent.target.tagName !== "DIV";
|
|
200
205
|
}
|
|
201
|
-
}), (
|
|
202
|
-
let
|
|
203
|
-
M.on("drawstart", function(
|
|
206
|
+
}), (C = n == null ? void 0 : n.value) == null || C.addInteraction(M), $(), F();
|
|
207
|
+
let S;
|
|
208
|
+
M.on("drawstart", function(P) {
|
|
204
209
|
var N;
|
|
205
|
-
d =
|
|
210
|
+
d = P.feature, d.set("randomId", w());
|
|
206
211
|
let x;
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
let
|
|
210
|
-
x =
|
|
212
|
+
S = (N = d.getGeometry()) == null ? void 0 : N.on("change", function(R) {
|
|
213
|
+
const B = R.target;
|
|
214
|
+
let D = formatUtils.formatLength(B, Number(i.value));
|
|
215
|
+
x = B.getLastCoordinate(), p && D && (p.innerHTML = D), f.setPosition(x);
|
|
211
216
|
});
|
|
212
217
|
}), M.on("drawend", function() {
|
|
213
|
-
var
|
|
214
|
-
p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML
|
|
218
|
+
var P;
|
|
219
|
+
if (p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML) {
|
|
220
|
+
const x = (d == null ? void 0 : d.get("randomId")) || w();
|
|
221
|
+
c.value.push({ id: x, value: p == null ? void 0 : p.innerHTML }), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-id="${x}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
222
|
+
}
|
|
223
|
+
(P = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || P.addEventListener("click", (x) => {
|
|
215
224
|
var R;
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
}),
|
|
225
|
+
x.preventDefault(), x.stopPropagation();
|
|
226
|
+
const N = (R = x.target) == null ? void 0 : R.getAttribute("data-id");
|
|
227
|
+
N && y(N);
|
|
228
|
+
}), f.setOffset([0, -7]), d = null, p = null, $(), S && unByKey(S);
|
|
220
229
|
});
|
|
221
230
|
}
|
|
222
|
-
function
|
|
223
|
-
var
|
|
224
|
-
u != null && u.parentNode && u.parentNode.removeChild(u), u = document.createElement("div"), u.className = "ol-tooltip hidden",
|
|
231
|
+
function F() {
|
|
232
|
+
var S;
|
|
233
|
+
u != null && u.parentNode && u.parentNode.removeChild(u), u = document.createElement("div"), u.className = "ol-tooltip hidden", h = new Overlay({
|
|
225
234
|
element: u,
|
|
226
235
|
offset: [15, 0],
|
|
227
236
|
positioning: "center-left"
|
|
228
|
-
}), (
|
|
237
|
+
}), (S = n == null ? void 0 : n.value) == null || S.addOverlay(h);
|
|
229
238
|
}
|
|
230
|
-
function
|
|
231
|
-
var
|
|
232
|
-
p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure",
|
|
239
|
+
function $() {
|
|
240
|
+
var S;
|
|
241
|
+
p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure", f = new Overlay({
|
|
233
242
|
element: p,
|
|
234
243
|
offset: [0, -15],
|
|
235
244
|
positioning: "bottom-center",
|
|
236
245
|
stopEvent: !1,
|
|
237
246
|
insertFirst: !1
|
|
238
|
-
}), (
|
|
247
|
+
}), (S = n == null ? void 0 : n.value) == null || S.addOverlay(f);
|
|
239
248
|
}
|
|
240
|
-
const
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
l
|
|
249
|
+
const y = (S) => {
|
|
250
|
+
var C, P;
|
|
251
|
+
const T = c.value.findIndex((x) => x.id === S);
|
|
252
|
+
if (T !== -1) {
|
|
253
|
+
c.value.splice(T, 1);
|
|
254
|
+
const x = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
255
|
+
x[T] && ((P = (C = x[T]) == null ? void 0 : C.parentNode) == null || P.removeChild(x[T]));
|
|
256
|
+
const N = m.getFeatures();
|
|
257
|
+
N[T] && m.removeFeature(N[T]);
|
|
258
|
+
}
|
|
259
|
+
}, L = () => {
|
|
260
|
+
l("close");
|
|
261
|
+
}, w = () => Math.random().toString(36).substring(2, 9);
|
|
262
|
+
return watch(() => r, () => {
|
|
263
|
+
r.value && !s.value && (k(), V());
|
|
252
264
|
}, { deep: !0, immediate: !0 }), t({
|
|
253
|
-
addInteraction:
|
|
254
|
-
removeInteraction:
|
|
255
|
-
}), (
|
|
265
|
+
addInteraction: V,
|
|
266
|
+
removeInteraction: E
|
|
267
|
+
}), (S, T) => r.value && S.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
256
268
|
createElementVNode("div", { class: "header" }, [
|
|
257
|
-
|
|
269
|
+
T[1] || (T[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
|
|
258
270
|
createElementVNode("i", {
|
|
259
|
-
onClick:
|
|
271
|
+
onClick: L,
|
|
260
272
|
class: "map-iconfont icon-close"
|
|
261
273
|
})
|
|
262
274
|
]),
|
|
263
275
|
createElementVNode("div", _hoisted_2$2, [
|
|
264
|
-
|
|
276
|
+
T[2] || (T[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
|
|
265
277
|
createVNode(unref(ElSelect), {
|
|
266
278
|
class: "select-length-unit",
|
|
267
279
|
modelValue: i.value,
|
|
268
|
-
"onUpdate:modelValue":
|
|
280
|
+
"onUpdate:modelValue": T[0] || (T[0] = (C) => i.value = C)
|
|
269
281
|
}, {
|
|
270
282
|
default: withCtx(() => [
|
|
271
283
|
createVNode(unref(ElOption), {
|
|
@@ -285,26 +297,26 @@ const formatLength = function(e, t) {
|
|
|
285
297
|
}, 8, ["modelValue"])
|
|
286
298
|
]),
|
|
287
299
|
createElementVNode("div", _hoisted_3$1, [
|
|
288
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(c.value, (
|
|
300
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(c.value, (C, P) => (openBlock(), createElementBlock("div", {
|
|
289
301
|
class: "measure-history-item",
|
|
290
|
-
key:
|
|
302
|
+
key: C.id
|
|
291
303
|
}, [
|
|
292
304
|
createElementVNode("div", _hoisted_4, [
|
|
293
|
-
|
|
294
|
-
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(
|
|
295
|
-
createElementVNode("span", _hoisted_6, toDisplayString(
|
|
305
|
+
T[3] || (T[3] = createElementVNode("i", { class: "map-iconfont icon-line" }, null, -1)),
|
|
306
|
+
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(P + 1), 1),
|
|
307
|
+
createElementVNode("span", _hoisted_6, toDisplayString(C.value), 1)
|
|
296
308
|
]),
|
|
297
309
|
createElementVNode("div", {
|
|
298
310
|
class: "delete-button",
|
|
299
|
-
onClick: (x) =>
|
|
300
|
-
},
|
|
311
|
+
onClick: (x) => y(C.id)
|
|
312
|
+
}, T[4] || (T[4] = [
|
|
301
313
|
createElementVNode("i", { class: "map-iconfont icon-delete" }, null, -1)
|
|
302
314
|
]), 8, _hoisted_7)
|
|
303
315
|
]))), 128))
|
|
304
316
|
])
|
|
305
317
|
])) : createCommentVNode("", !0);
|
|
306
318
|
}
|
|
307
|
-
}), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
319
|
+
}), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-3277433d"]]), mapInstance$8 = ref(), renderMarkerSetInstance = (e) => mapInstance$8.value = e, markerPosition = ref(""), marker = ref(), createIconStyle = (e) => new Style({
|
|
308
320
|
image: new Icon({
|
|
309
321
|
src: CDN_URL + "map/poi-marker-default.png",
|
|
310
322
|
anchor: [0.5, 1]
|
|
@@ -333,15 +345,15 @@ const formatLength = function(e, t) {
|
|
|
333
345
|
padding: [2, 2, 2, 2]
|
|
334
346
|
// 设置文本背景的内边距
|
|
335
347
|
})
|
|
336
|
-
}), renderMarker = (e, t = !0,
|
|
348
|
+
}), renderMarker = (e, t = !0, o = !0) => {
|
|
337
349
|
var d;
|
|
338
350
|
if (!mapInstance$8.value || !e || e.split(",").length !== 2) return;
|
|
339
|
-
const [
|
|
351
|
+
const [n, l] = e.split(",").map(Number);
|
|
340
352
|
marker.value = new Feature({
|
|
341
|
-
geometry: new Point(fromLonLat([
|
|
353
|
+
geometry: new Point(fromLonLat([n, l]))
|
|
342
354
|
});
|
|
343
|
-
const
|
|
344
|
-
(d = marker.value) == null || d.setStyle(createIconStyle(
|
|
355
|
+
const r = o ? `${n}, ${l}` : "";
|
|
356
|
+
(d = marker.value) == null || d.setStyle(createIconStyle(r));
|
|
345
357
|
const i = new VectorSource({
|
|
346
358
|
features: [marker.value]
|
|
347
359
|
}), c = new VectorLayer({
|
|
@@ -351,21 +363,21 @@ const formatLength = function(e, t) {
|
|
|
351
363
|
const u = new Translate({
|
|
352
364
|
layers: [c]
|
|
353
365
|
});
|
|
354
|
-
u.on("translating", function(
|
|
366
|
+
u.on("translating", function(h) {
|
|
355
367
|
var v;
|
|
356
|
-
const p =
|
|
357
|
-
markerPosition.value = `${
|
|
368
|
+
const p = h.features.item(0).getGeometry().getCoordinates(), f = toLonLat(p);
|
|
369
|
+
markerPosition.value = `${f[0].toFixed(6)}, ${f[1].toFixed(6)}`, (v = marker.value) == null || v.setStyle(createIconStyle(markerPosition.value));
|
|
358
370
|
}), mapInstance$8.value.addInteraction(u);
|
|
359
371
|
}
|
|
360
|
-
const m = new Point([
|
|
372
|
+
const m = new Point([n, l]);
|
|
361
373
|
s.setCenter(transform(m.getCoordinates(), projection.data, projection.mercator)), s.setZoom(mapZoom.findShip);
|
|
362
374
|
}, setMarkerPosition = (e) => {
|
|
363
|
-
var
|
|
375
|
+
var l, r;
|
|
364
376
|
if (!mapInstance$8.value) return;
|
|
365
|
-
const t = mapInstance$8.value.getView(),
|
|
366
|
-
(
|
|
367
|
-
const
|
|
368
|
-
t.setCenter(transform(
|
|
377
|
+
const t = mapInstance$8.value.getView(), o = e.split(",").map(Number);
|
|
378
|
+
(r = (l = marker.value) == null ? void 0 : l.getGeometry()) == null || r.setCoordinates(fromLonLat([o[0], o[1]]));
|
|
379
|
+
const n = new Point([o[0], o[1]]);
|
|
380
|
+
t.setCenter(transform(n.getCoordinates(), projection.data, projection.mercator)), t.setZoom(mapZoom.markerPosition);
|
|
369
381
|
}, CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", zhongkeKey = "15c81cc0a191a232e0a0ca1a51c3ca81", baseMap = {
|
|
370
382
|
// 矢量底图
|
|
371
383
|
// zhongkeTile: `https://api.open.geovisearth.com/map/v1/vec/{z}/{x}/{y}?token=${zhongkeKey}&format=png&tmsIds=w`,
|
|
@@ -408,19 +420,12 @@ const formatLength = function(e, t) {
|
|
|
408
420
|
// 墨卡托投影坐标 渲染坐标
|
|
409
421
|
mercator: "EPSG:3857"
|
|
410
422
|
}, LOG_DATE_FORMAT = "YYYY-MM-DD HH:mm:ss", DEFAULT_VALUE = "--";
|
|
411
|
-
ref();
|
|
412
|
-
const shipsLayer = ref(), largeAmountShipsLayer = ref(), selectShipsLayer = ref(), allShips = ref([]), selectSingleShipData = ref();
|
|
413
|
-
ref();
|
|
414
|
-
const trucksLayer = ref(), shipTrackLineFeatures = ref([]), trackLineVectorSource = ref(), shipTrackVectorLayer = ref();
|
|
415
|
-
ref();
|
|
416
|
-
ref();
|
|
417
|
-
const shipLabels = ref([]), trackLabels = ref([]), showTrackLayer = ref(!1), allTracks = ref([]), currentTrackId = ref(""), showTrackAnimatMarker = ref(!1), hiddenOrther = ref(!1), showMeasure = ref(!1), getShowMeasure = () => showMeasure.value;
|
|
418
423
|
function getIconFont(unicode = "") {
|
|
419
424
|
return unicode.indexOf("&") !== -1 && (unicode = unicode.replace("&", "&")), unicode.indexOf("&") !== -1 && (unicode = unicode.replace("&", "&")), eval('("' + unicode.replace("&#x", "\\u").replace(";", "") + '")');
|
|
420
425
|
}
|
|
421
426
|
const multiplyPixelRatio = (e) => {
|
|
422
427
|
const t = window.devicePixelRatio || 1;
|
|
423
|
-
return e.map((
|
|
428
|
+
return e.map((o) => o.map((n) => n * t));
|
|
424
429
|
}, adjustBounds = (e, t) => t.length === 2 ? [e[0] - t[0], e[1] - t[1], e[2] + t[0], e[3] + t[1]] : [e[0] + t[0], e[1] + t[1], e[2] + t[2], e[3] + t[3]], isOverlapping = (e, t) => e[0] <= t[2] && e[2] >= t[0] && e[1] <= t[3] && e[3] >= t[1], getIconStyle = (e) => new Style({
|
|
425
430
|
text: new Text({
|
|
426
431
|
font: "Normal 14px map-iconfont",
|
|
@@ -429,14 +434,14 @@ const multiplyPixelRatio = (e) => {
|
|
|
429
434
|
offsetY: -14
|
|
430
435
|
}),
|
|
431
436
|
zIndex: 100
|
|
432
|
-
}), getRotation = (e, t,
|
|
433
|
-
function
|
|
437
|
+
}), getRotation = (e, t, o) => {
|
|
438
|
+
function n(u) {
|
|
434
439
|
return 180 * (u % (2 * Math.PI)) / Math.PI;
|
|
435
440
|
}
|
|
436
|
-
function
|
|
441
|
+
function l(u) {
|
|
437
442
|
return u % 360 * Math.PI / 180;
|
|
438
443
|
}
|
|
439
|
-
function
|
|
444
|
+
function r(u) {
|
|
440
445
|
if (!u) throw new Error("Coordinate is required");
|
|
441
446
|
if (!Array.isArray(u)) {
|
|
442
447
|
if (u.type === "Feature" && u.geometry !== null && u.geometry.type === "Point")
|
|
@@ -449,25 +454,25 @@ const multiplyPixelRatio = (e) => {
|
|
|
449
454
|
"Coordinate must be GeoJSON Point or an Array of numbers"
|
|
450
455
|
);
|
|
451
456
|
}
|
|
452
|
-
function i(u,
|
|
457
|
+
function i(u, h, p = {}) {
|
|
453
458
|
if (p.final)
|
|
454
|
-
return function(
|
|
455
|
-
return (i(
|
|
456
|
-
}(u,
|
|
457
|
-
const
|
|
458
|
-
return
|
|
459
|
+
return function(F, $) {
|
|
460
|
+
return (i($, F) + 180) % 360;
|
|
461
|
+
}(u, h);
|
|
462
|
+
const f = r(u), v = r(h), g = l(f[0]), k = l(v[0]), M = l(f[1]), b = l(v[1]), E = Math.sin(k - g) * Math.cos(b), V = Math.cos(M) * Math.sin(b) - Math.sin(M) * Math.cos(b) * Math.cos(k - g);
|
|
463
|
+
return n(Math.atan2(E, V));
|
|
459
464
|
}
|
|
460
465
|
function c(u) {
|
|
461
466
|
return !isNaN(u) && u !== null && !Array.isArray(u);
|
|
462
467
|
}
|
|
463
|
-
function s(u,
|
|
464
|
-
return u || console.log("Coordinates are required"), Array.isArray(u) || console.log("Coordinates must be an Array"), u.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!c(u[0]) || !c(u[1])) && console.log("Coordinates must contain numbers"), m({ type: "Point", coordinates: u },
|
|
468
|
+
function s(u, h = {}, p = {}) {
|
|
469
|
+
return u || console.log("Coordinates are required"), Array.isArray(u) || console.log("Coordinates must be an Array"), u.length < 2 && console.log("Coordinates must be at least 2 numbers long"), (!c(u[0]) || !c(u[1])) && console.log("Coordinates must contain numbers"), m({ type: "Point", coordinates: u }, h, p);
|
|
465
470
|
}
|
|
466
|
-
function m(u,
|
|
467
|
-
const
|
|
468
|
-
return p.id !== void 0 && (
|
|
471
|
+
function m(u, h = {}, p = {}) {
|
|
472
|
+
const f = { type: "Feature" };
|
|
473
|
+
return p.id !== void 0 && (f.id = p.id), p.bbox && (f.bbox = p.bbox), f.properties = h || {}, f.geometry = u, f;
|
|
469
474
|
}
|
|
470
|
-
const d = i(s(e), s(t),
|
|
475
|
+
const d = i(s(e), s(t), o);
|
|
471
476
|
return d < 0 ? 360 + d : d;
|
|
472
477
|
}, triangleModel = multiplyPixelRatio([
|
|
473
478
|
[0, -8],
|
|
@@ -544,86 +549,93 @@ const multiplyPixelRatio = (e) => {
|
|
|
544
549
|
isMapMoving.value = !1, e.render();
|
|
545
550
|
});
|
|
546
551
|
}, speedCondition = [[1, 10], [10, 20], [20, 1 / 0]], drawShipModelByZoom = { 14: [200, 30], 15: [115, 15], 16: [55, 8], 17: [25, 5], 18: [1, 1] }, setShipStyle = (e, t = !1) => new Style({
|
|
547
|
-
renderer: (
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
+
renderer: (o, n) => {
|
|
553
|
+
var c, s;
|
|
554
|
+
o = o;
|
|
555
|
+
const l = n.context, r = n.feature.get("data");
|
|
556
|
+
if (!r) return;
|
|
557
|
+
const i = n.feature.get("index");
|
|
558
|
+
(i === 0 || i === void 0) && (shipLabels.value = []);
|
|
552
559
|
try {
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
560
|
+
const m = drawShipBody(l, r, o, t);
|
|
561
|
+
m && (drawHeading(l, r, m, t), r.selected = e, !isMapMoving.value && e && (drawSelectBounds(l, m), (s = (c = trackLineVectorSource.value) == null ? void 0 : c.getFeatures()) != null && s.some((u) => {
|
|
562
|
+
const h = u.get("data");
|
|
563
|
+
return (h == null ? void 0 : h.id) === r.id;
|
|
564
|
+
}) || setTimeout(() => {
|
|
565
|
+
drawSelectBounds(l, m);
|
|
566
|
+
}, 1))), drawShipLabel(l, r, o), e && setTimeout(() => {
|
|
567
|
+
drawShipLabel(l, r, o);
|
|
568
|
+
}, 1);
|
|
557
569
|
} catch {
|
|
558
570
|
return !1;
|
|
559
571
|
}
|
|
560
572
|
}
|
|
561
|
-
}), drawShipBody = (e, t,
|
|
573
|
+
}), drawShipBody = (e, t, o, n) => {
|
|
562
574
|
if (!mapInstance$7.value) return;
|
|
563
|
-
const
|
|
564
|
-
if (!
|
|
565
|
-
let
|
|
566
|
-
const [i, c] = drawShipModelByZoom[
|
|
567
|
-
if (
|
|
568
|
-
|
|
569
|
-
const [
|
|
570
|
-
return [s +
|
|
575
|
+
const l = Math.round(Number(mapInstance$7.value.getView().getZoom()));
|
|
576
|
+
if (!l) return;
|
|
577
|
+
let r = [];
|
|
578
|
+
const [i, c] = drawShipModelByZoom[l] || [0, 0], [s, m] = o;
|
|
579
|
+
if (l <= mapZoom.shipModelMax && l > mapZoom.shipModelMin && t.length >= i && t.breadth >= c)
|
|
580
|
+
r = rotateShapeModel(drawCurrentShipShapeModel(t, l), t.angle).map((u) => {
|
|
581
|
+
const [h, p] = u;
|
|
582
|
+
return [s + h, m + p];
|
|
571
583
|
});
|
|
572
584
|
else {
|
|
573
585
|
const d = rotateShapeModel(triangleModel, t.angle);
|
|
574
|
-
|
|
575
|
-
const [
|
|
576
|
-
return [s +
|
|
586
|
+
o.length === 2 && (r = d.map((u) => {
|
|
587
|
+
const [h, p] = u;
|
|
588
|
+
return [s + h, m + p];
|
|
577
589
|
}));
|
|
578
590
|
}
|
|
579
|
-
if (!(
|
|
591
|
+
if (!(r.length > 2)) return !1;
|
|
580
592
|
if (t != null && t.length) {
|
|
581
|
-
const d =
|
|
593
|
+
const d = r.length === 3 ? 30 : t.length * 0.4;
|
|
582
594
|
e.beginPath(), e.arc(
|
|
583
|
-
|
|
584
|
-
|
|
595
|
+
o[0],
|
|
596
|
+
o[1],
|
|
585
597
|
d,
|
|
586
598
|
0,
|
|
587
599
|
2 * Math.PI
|
|
588
600
|
), e.fillStyle = "rgba(255, 255, 255, 0.001)", e.fill();
|
|
589
601
|
}
|
|
590
|
-
e.save(), e.beginPath(), e.moveTo(
|
|
591
|
-
for (let d = 1; d <
|
|
592
|
-
e.lineTo(
|
|
593
|
-
return e.closePath(), e.strokeStyle =
|
|
594
|
-
}, drawHeading = (e, t,
|
|
595
|
-
const [
|
|
602
|
+
e.save(), e.beginPath(), e.moveTo(r[0][0], r[0][1]);
|
|
603
|
+
for (let d = 1; d < r.length; d++)
|
|
604
|
+
e.lineTo(r[d][0], r[d][1]);
|
|
605
|
+
return e.closePath(), e.strokeStyle = n ? "#ff0000" : "#000", e.lineWidth = n ? 2 : 1, e.stroke(), e.fillStyle = t.fill, e.fill(), e.restore(), r;
|
|
606
|
+
}, drawHeading = (e, t, o, n) => {
|
|
607
|
+
const [l, r] = o[0], i = getShipDirectPath(t);
|
|
596
608
|
if (i) {
|
|
597
609
|
const c = i.map(function(s) {
|
|
598
610
|
const [m, d] = s;
|
|
599
|
-
return [m +
|
|
611
|
+
return [m + l, d + r];
|
|
600
612
|
});
|
|
601
613
|
if (e.save(), e.beginPath(), t.angle > 0) {
|
|
602
|
-
e.translate(
|
|
614
|
+
e.translate(l, r);
|
|
603
615
|
const s = t.angle * Math.PI / 180;
|
|
604
|
-
e.rotate(s), e.translate(-
|
|
616
|
+
e.rotate(s), e.translate(-l, -r);
|
|
605
617
|
}
|
|
606
|
-
e.moveTo(
|
|
618
|
+
e.moveTo(l, r);
|
|
607
619
|
for (let s = 1; s < c.length; s++) {
|
|
608
620
|
const [m, d] = c[s];
|
|
609
621
|
e.lineTo(m, d);
|
|
610
622
|
}
|
|
611
|
-
e.strokeStyle =
|
|
623
|
+
e.strokeStyle = n ? "#ff0000" : "#000", e.lineWidth = n ? 2 : 1, e.stroke(), e.restore();
|
|
612
624
|
}
|
|
613
625
|
}, drawSelectBounds = (e, t) => {
|
|
614
|
-
let [n,
|
|
626
|
+
let [o, n, l, r] = getPixelFromCoordinate(t);
|
|
615
627
|
const i = window.devicePixelRatio || 1, c = 4;
|
|
616
|
-
|
|
628
|
+
o -= c, n -= c, l += c, r += c, e.save(), e.strokeStyle = "#ff0000", e.lineWidth = 4 * i;
|
|
617
629
|
const s = 8 * i;
|
|
618
|
-
e.beginPath(), e.moveTo(
|
|
619
|
-
}, drawShipLabel = (e, t,
|
|
620
|
-
if (!t.selected && shipLabels.value.find((u) => u.
|
|
621
|
-
const [
|
|
630
|
+
e.beginPath(), e.moveTo(o + s, r), e.lineTo(o, r), e.lineTo(o, r - s), e.moveTo(o, n + s), e.lineTo(o, n), e.lineTo(o + s, n), e.moveTo(l - s, n), e.lineTo(l, n), e.lineTo(l, n + s), e.moveTo(l, r - s), e.lineTo(l, r), e.lineTo(l - s, r), e.stroke(), e.restore();
|
|
631
|
+
}, drawShipLabel = (e, t, o) => {
|
|
632
|
+
if (!t.selected && shipLabels.value.find((u) => u.id === t.id)) return;
|
|
633
|
+
const [n, l] = o, r = n, i = l, c = t.name;
|
|
622
634
|
let s;
|
|
623
635
|
t.leftIconColor && (s = { color: t.leftIconColor, icon: "" });
|
|
624
636
|
const m = getShipCustomIcon(t), d = {
|
|
625
637
|
id: t.id,
|
|
626
|
-
center: [
|
|
638
|
+
center: [r, i],
|
|
627
639
|
text: c,
|
|
628
640
|
fill: t.fill,
|
|
629
641
|
color: "#fff",
|
|
@@ -635,55 +647,55 @@ const multiplyPixelRatio = (e) => {
|
|
|
635
647
|
blinkColors: t.blinkColors,
|
|
636
648
|
type: "ShipName"
|
|
637
649
|
};
|
|
638
|
-
drawLabel(e, d, shipLabels.value, mapInstance$7.value);
|
|
650
|
+
mapInstance$7.value && drawLabel(e, d, shipLabels.value, mapInstance$7.value);
|
|
639
651
|
}, drawCurrentShipShapeModel = (e, t) => {
|
|
640
|
-
let
|
|
641
|
-
t <= 14 ?
|
|
642
|
-
const
|
|
643
|
-
let
|
|
644
|
-
return
|
|
652
|
+
let o = 0;
|
|
653
|
+
t <= 14 ? o = 0.058 : t === 15 ? o = 0.12 : t === 16 ? o = 0.22 : t === 17 ? o = 0.435 : t === 18 && (o = 0.857);
|
|
654
|
+
const n = e.length / 4 * o, l = e.breadth * o;
|
|
655
|
+
let r = cloneDeep(shipShapeModel);
|
|
656
|
+
return r = r.map(([i, c]) => [i * l, c * n]), r;
|
|
645
657
|
}, getShipDirectPath = (e) => {
|
|
646
|
-
const { speed: t, hdg:
|
|
647
|
-
let
|
|
648
|
-
if (t && t > 1 && (
|
|
658
|
+
const { speed: t, hdg: o, cog: n } = e;
|
|
659
|
+
let l = "", r = null;
|
|
660
|
+
if (t && t > 1 && (o !== null && o != 511 && n !== null ? n - o >= 3 ? l = "left" : n - o <= -3 ? l = "right" : l = "front" : l = "front", l && t))
|
|
649
661
|
for (let i = 0; i < speedCondition.length; i++) {
|
|
650
662
|
const c = speedCondition[i];
|
|
651
663
|
if (t >= c[0] && t < c[1]) {
|
|
652
|
-
|
|
664
|
+
r = shipDirectPath[l][i];
|
|
653
665
|
break;
|
|
654
666
|
}
|
|
655
667
|
}
|
|
656
|
-
return
|
|
668
|
+
return r;
|
|
657
669
|
}, getShipCustomIcon = (e) => {
|
|
658
670
|
const t = [];
|
|
659
671
|
return e.existDevice && t.push(""), e.existMobile && t.push(""), e.existWaterGauge && t.push(""), t || [];
|
|
660
672
|
}, mapInstance$6 = ref(), renderShipSetInstance = (e) => mapInstance$6.value = e;
|
|
661
673
|
let shipsMarkerList = [], shipsVectorSource, largeAmountShipsSource;
|
|
662
674
|
const selectedShipData = ref(null), selectedShips = ref([]);
|
|
663
|
-
let selectShipsVectorSource;
|
|
675
|
+
let selectShipsVectorSource, hoveredFeature = null, hoveredFeatures = [];
|
|
664
676
|
const renderShips = (e) => {
|
|
665
|
-
var
|
|
677
|
+
var l, r, i, c;
|
|
666
678
|
if (!mapInstance$6.value || showTrackLayer.value) return;
|
|
667
|
-
const t = e.reduce((s, m) => (s.some((d) => d.id === m.id) || s.push(m), s), []),
|
|
679
|
+
const t = e.reduce((s, m) => (s.some((d) => d.id === m.id) || s.push(m), s), []), o = Math.round(Number(mapInstance$6.value.getView().getZoom()));
|
|
668
680
|
if (selectedShipData.value && nextTick(() => {
|
|
669
681
|
selectSingleShipMarker(selectedShipData.value);
|
|
670
682
|
}).then((s) => {
|
|
671
|
-
}), !
|
|
672
|
-
const
|
|
683
|
+
}), !o || o < mapZoom.shipGreenDotMax) return;
|
|
684
|
+
const n = [...t, ...selectedShips.value].reduce((s, m) => (s.some((d) => d.id === m.id) || s.push(m), s), []);
|
|
673
685
|
if (allShips.value.forEach((s) => {
|
|
674
686
|
var m;
|
|
675
|
-
!
|
|
676
|
-
}), allShips.value =
|
|
677
|
-
return
|
|
687
|
+
!n.some((d) => d.id === s.id) && ((m = s.blinkColors) != null && m.length) && checkBlinkLabelExist(mapInstance$6.value, shipLabels.value, s.id);
|
|
688
|
+
}), allShips.value = n, !hiddenOrther.value)
|
|
689
|
+
return o >= mapZoom.shipGreenDotMax && o < mapZoom.shipModelMin ? ((l = shipsLayer.value) == null || l.setVisible(!1), (r = largeAmountShipsLayer.value) == null || r.setVisible(!0), renderLargeAmountShips(allShips.value)) : ((i = largeAmountShipsLayer.value) == null || i.setVisible(!1), (c = shipsLayer.value) == null || c.setVisible(!0), renderShipsMarker(allShips.value));
|
|
678
690
|
}, renderLargeAmountShips = (e) => {
|
|
679
691
|
if (!mapInstance$6.value) return;
|
|
680
|
-
const t = e.map((
|
|
692
|
+
const t = e.map((o) => ({
|
|
681
693
|
type: "Feature",
|
|
682
694
|
geometry: {
|
|
683
695
|
type: "Point",
|
|
684
|
-
coordinates: [
|
|
696
|
+
coordinates: [o.lon, o.lat]
|
|
685
697
|
},
|
|
686
|
-
properties:
|
|
698
|
+
properties: o
|
|
687
699
|
}));
|
|
688
700
|
return largeAmountShipsSource == null || largeAmountShipsSource.clear(), largeAmountShipsSource = new VectorSource({
|
|
689
701
|
features: new GeoJSON().readFeatures({
|
|
@@ -717,70 +729,86 @@ const renderShips = (e) => {
|
|
|
717
729
|
// 将值旋转 180 度
|
|
718
730
|
],
|
|
719
731
|
"shape-scale": [0.8, 1.2],
|
|
720
|
-
|
|
721
|
-
|
|
732
|
+
// 边框颜色为条件判断,悬浮时显示红色,否则黑色
|
|
733
|
+
"shape-stroke-color": [
|
|
734
|
+
"case",
|
|
735
|
+
["==", ["get", "hover"], 0],
|
|
736
|
+
"#000000",
|
|
737
|
+
["==", ["get", "hover"], 1],
|
|
738
|
+
"#FF0000",
|
|
739
|
+
"#000000"
|
|
740
|
+
// 默认颜色(黑色)
|
|
741
|
+
],
|
|
722
742
|
"shape-stroke-width": 0.5
|
|
723
|
-
// 边框宽度为0.5px
|
|
724
743
|
}
|
|
725
744
|
}), mapInstance$6.value.addLayer(largeAmountShipsLayer.value), largeAmountShipsLayer.value;
|
|
726
745
|
}, renderShipsMarker = (e) => {
|
|
727
|
-
var
|
|
746
|
+
var o;
|
|
728
747
|
if (!mapInstance$6.value) return;
|
|
729
748
|
deleteAllShipMarkers();
|
|
730
749
|
let t = convertShipMapData(e);
|
|
731
750
|
if (t = customFilterShips(t), !!(t != null && t.length))
|
|
732
|
-
return t.forEach((
|
|
733
|
-
const
|
|
734
|
-
geometry: new Point(fromLonLat(
|
|
751
|
+
return t.forEach((n, l) => {
|
|
752
|
+
const r = [n.lon, n.lat], i = new Feature({
|
|
753
|
+
geometry: new Point(fromLonLat(r))
|
|
735
754
|
}), c = 1;
|
|
736
|
-
i.set("clickGeometry", new Circle(fromLonLat(
|
|
755
|
+
i.set("clickGeometry", new Circle(fromLonLat(r), c)), i.set("data", n), i.set("index", l), i.setStyle(
|
|
737
756
|
setShipStyle(!1)
|
|
738
757
|
), shipsMarkerList.push({
|
|
739
|
-
ship:
|
|
740
|
-
lonlat:
|
|
758
|
+
ship: n,
|
|
759
|
+
lonlat: r,
|
|
741
760
|
feature: i
|
|
742
761
|
});
|
|
743
762
|
}), shipsVectorSource = new VectorSource({
|
|
744
|
-
features: shipsMarkerList.map((
|
|
763
|
+
features: shipsMarkerList.map((n) => n.feature)
|
|
745
764
|
}), shipsLayer.value = new VectorLayer({
|
|
746
765
|
source: shipsVectorSource,
|
|
747
766
|
zIndex: 100
|
|
748
|
-
}), (
|
|
767
|
+
}), (o = mapInstance$6.value) == null || o.addLayer(shipsLayer.value), shipsLayer.value;
|
|
749
768
|
}, onShipsMarkerHover = () => {
|
|
750
769
|
var o;
|
|
751
|
-
let e =
|
|
752
|
-
const
|
|
753
|
-
(o = mapInstance$6.value) == null || o.on("pointermove", function(
|
|
754
|
-
var s, m
|
|
770
|
+
let e = 0;
|
|
771
|
+
const t = 300;
|
|
772
|
+
(o = mapInstance$6.value) == null || o.on("pointermove", function(n) {
|
|
773
|
+
var c, s, m;
|
|
774
|
+
if (showDrawLayer.value) return;
|
|
755
775
|
const l = Date.now();
|
|
756
|
-
if (l -
|
|
776
|
+
if (l - e < t)
|
|
757
777
|
return;
|
|
758
|
-
|
|
759
|
-
const
|
|
760
|
-
if (
|
|
761
|
-
if (
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
setShipStyle(
|
|
766
|
-
);
|
|
778
|
+
e = l;
|
|
779
|
+
const r = (c = mapInstance$6.value) == null ? void 0 : c.forEachFeatureAtPixel(n.pixel, (d) => d), i = (s = mapInstance$6.value) == null ? void 0 : s.getTargetElement();
|
|
780
|
+
if (i && (i.style.cursor = r ? "pointer" : ""), hoveredFeature !== r) {
|
|
781
|
+
if (hoveredFeature) {
|
|
782
|
+
hoveredFeature.set("hover", 0);
|
|
783
|
+
const d = hoveredFeature.get("data");
|
|
784
|
+
d != null && d.mmsi && hoveredFeature.setStyle(
|
|
785
|
+
setShipStyle(!1, !1)
|
|
786
|
+
), hoveredFeature = null;
|
|
767
787
|
}
|
|
768
|
-
if (
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
788
|
+
if (r) {
|
|
789
|
+
hoveredFeature = r, r.set("hover", 1);
|
|
790
|
+
const d = r.get("data");
|
|
791
|
+
if (!(d != null && d.mmsi)) return;
|
|
792
|
+
hoveredFeatures.push(r), r.setStyle(
|
|
793
|
+
setShipStyle(((m = selectedShipData.value) == null ? void 0 : m.id) === d.id, !0)
|
|
773
794
|
);
|
|
774
795
|
} else
|
|
775
|
-
|
|
796
|
+
hoveredFeatures.forEach((d) => {
|
|
797
|
+
var h;
|
|
798
|
+
d.set("hover", 0);
|
|
799
|
+
const u = d.get("data");
|
|
800
|
+
u != null && u.mmsi && d.setStyle(
|
|
801
|
+
setShipStyle(((h = selectedShipData.value) == null ? void 0 : h.id) === u.id, !1)
|
|
802
|
+
);
|
|
803
|
+
}), hoveredFeatures = [];
|
|
776
804
|
}
|
|
777
805
|
});
|
|
778
806
|
}, customFilterShips = (e) => {
|
|
779
807
|
let t = cloneDeep(e);
|
|
780
|
-
return t = t.filter((
|
|
781
|
-
var
|
|
782
|
-
const
|
|
783
|
-
return (switchBtnShow.value.camera || switchBtnShow.value.mobile || switchBtnShow.value.waterGauge) && ((
|
|
808
|
+
return t = t.filter((o) => {
|
|
809
|
+
var l;
|
|
810
|
+
const n = getFilterItem(o).every(({ btnShow: r, value: i }) => r ? !!i : !0);
|
|
811
|
+
return (switchBtnShow.value.camera || switchBtnShow.value.mobile || switchBtnShow.value.waterGauge) && ((l = selectedShipData.value) == null ? void 0 : l.id) === o.id && clearSelectFeature(), n;
|
|
784
812
|
}), t;
|
|
785
813
|
}, getFilterItem = (e) => [
|
|
786
814
|
{ btnShow: switchBtnShow.value.camera, value: e == null ? void 0 : e.existDevice },
|
|
@@ -791,40 +819,56 @@ const renderShips = (e) => {
|
|
|
791
819
|
e.feature && (shipsVectorSource == null || shipsVectorSource.removeFeature(e.feature));
|
|
792
820
|
}), clearAllInterval(), shipsMarkerList = [];
|
|
793
821
|
}, selectSingleShipMarker = (e) => {
|
|
794
|
-
var
|
|
822
|
+
var r;
|
|
795
823
|
if (!mapInstance$6.value) return;
|
|
796
824
|
const t = cloneDeep(selectSingleShipData.value);
|
|
797
825
|
selectSingleShipData.value = convertShipMapData(e);
|
|
798
|
-
const
|
|
799
|
-
geometry: new Point(fromLonLat(
|
|
826
|
+
const o = [selectSingleShipData.value.lon, selectSingleShipData.value.lat], n = new Feature({
|
|
827
|
+
geometry: new Point(fromLonLat(o))
|
|
800
828
|
});
|
|
801
|
-
|
|
829
|
+
if (n.set("data", selectSingleShipData.value), shipsLayer.value) {
|
|
830
|
+
const i = shipsLayer.value.getSource();
|
|
831
|
+
i && i.forEachFeature((c) => {
|
|
832
|
+
var s, m;
|
|
833
|
+
((s = c.get("data")) == null ? void 0 : s.id) === ((m = selectSingleShipData.value) == null ? void 0 : m.id) && c.set("data", selectSingleShipData.value);
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
n.setStyle(
|
|
802
837
|
setShipStyle(!0)
|
|
803
838
|
), shipsMarkerList.push({
|
|
804
839
|
ship: selectSingleShipData.value,
|
|
805
|
-
lonlat:
|
|
806
|
-
feature:
|
|
840
|
+
lonlat: o,
|
|
841
|
+
feature: n
|
|
807
842
|
}), selectShipsVectorSource == null || selectShipsVectorSource.clear(), selectShipsVectorSource = new VectorSource({
|
|
808
|
-
features: [
|
|
843
|
+
features: [n]
|
|
809
844
|
}), selectShipsLayer.value = new VectorLayer({
|
|
810
|
-
source: selectShipsVectorSource
|
|
845
|
+
source: selectShipsVectorSource,
|
|
846
|
+
updateWhileInteracting: !0
|
|
811
847
|
}), shipsVectorSource && setVisibleFeatureById(shipsVectorSource, selectSingleShipData.value.id, !0);
|
|
812
|
-
const
|
|
813
|
-
return
|
|
814
|
-
},
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
848
|
+
const l = (r = shipsLayer.value) == null ? void 0 : r.getSource();
|
|
849
|
+
return l && (t && setVisibleFeatureById(l, t.id, !0), setVisibleFeatureById(l, selectSingleShipData.value.id, !1)), mapInstance$6.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!0), hideAllHoveredShips(), selectShipsLayer.value;
|
|
850
|
+
}, hideAllHoveredShips = () => {
|
|
851
|
+
hoveredFeatures == null || hoveredFeatures.forEach((e) => {
|
|
852
|
+
var o;
|
|
853
|
+
const t = e == null ? void 0 : e.get("data");
|
|
854
|
+
t && e && e.setStyle(
|
|
855
|
+
setShipStyle(((o = selectedShipData.value) == null ? void 0 : o.id) === t.id, !1)
|
|
856
|
+
);
|
|
857
|
+
});
|
|
858
|
+
}, setVisibleFeatureById = (e, t, o) => {
|
|
859
|
+
e && e.forEachFeature((n) => {
|
|
860
|
+
const l = n.get("data");
|
|
861
|
+
l && l.id === t && n.setStyle(o ? setShipStyle(!1, !1) : setBlankStyle());
|
|
818
862
|
});
|
|
819
|
-
}, findShip = (e, t,
|
|
820
|
-
var
|
|
863
|
+
}, findShip = (e, t, o = !0) => {
|
|
864
|
+
var l, r, i, c, s;
|
|
821
865
|
if (!e || !mapInstance$6.value) return;
|
|
822
|
-
const
|
|
866
|
+
const n = (i = (r = (l = shipsLayer.value) == null ? void 0 : l.getSource()) == null ? void 0 : r.getFeatures()) == null ? void 0 : i.find((m) => {
|
|
823
867
|
var d;
|
|
824
868
|
return ((d = m.get("data")) == null ? void 0 : d.id) === e;
|
|
825
869
|
});
|
|
826
|
-
if (
|
|
827
|
-
selectedShipData.value =
|
|
870
|
+
if (n)
|
|
871
|
+
selectedShipData.value = n.get("data");
|
|
828
872
|
else if (t && t.lon && t.lat)
|
|
829
873
|
selectedShipData.value = t;
|
|
830
874
|
else {
|
|
@@ -834,15 +878,15 @@ const renderShips = (e) => {
|
|
|
834
878
|
if (selectedShips.value.some((m) => {
|
|
835
879
|
var d;
|
|
836
880
|
return m.id === ((d = selectedShipData.value) == null ? void 0 : d.id);
|
|
837
|
-
}) || selectedShips.value.push(selectedShipData.value),
|
|
881
|
+
}) || selectedShips.value.push(selectedShipData.value), o && ((c = selectedShipData.value) != null && c.lon) && ((s = selectedShipData.value) != null && s.lat)) {
|
|
838
882
|
const m = mapInstance$6.value.getView(), d = new Point([selectedShipData.value.lon, selectedShipData.value.lat]);
|
|
839
883
|
m.setCenter(transform(d.getCoordinates(), projection.data, projection.mercator));
|
|
840
|
-
const u = m.getZoom(),
|
|
841
|
-
m.setZoom(
|
|
884
|
+
const u = m.getZoom(), h = u < mapZoom.findShipMin ? mapZoom.findShip : u;
|
|
885
|
+
m.setZoom(h);
|
|
842
886
|
}
|
|
843
887
|
return setTimeout(() => {
|
|
844
888
|
t && selectSingleShipMarker(t);
|
|
845
|
-
}, 50),
|
|
889
|
+
}, 50), n;
|
|
846
890
|
}, clearSelectFeature = () => {
|
|
847
891
|
var e;
|
|
848
892
|
if (selectedShipData.value && shipsVectorSource && selectSingleShipData.value) {
|
|
@@ -868,146 +912,147 @@ const renderShips = (e) => {
|
|
|
868
912
|
}, rerenderShip = () => {
|
|
869
913
|
renderShips(allShips.value);
|
|
870
914
|
}, clearShipData = (e = !0) => {
|
|
871
|
-
shipsVectorSource == null || shipsVectorSource.clear(), shipsMarkerList = [], e && (selectShipsVectorSource == null || selectShipsVectorSource.clear());
|
|
872
|
-
}, labelAlpha = 0.8, pixelRatio = window.devicePixelRatio || 1, labelFont = `500 ${12 * pixelRatio}px Arial`, labelOutSize = 2 * pixelRatio, labelHeight = 10 * pixelRatio, fillRectRadius = (e, t, n,
|
|
873
|
-
e.beginPath(), e.moveTo(t + i,
|
|
915
|
+
shipsVectorSource == null || shipsVectorSource.clear(), shipsMarkerList = [], selectedShips.value = [], shipLabels.value = [], e && (selectShipsVectorSource == null || selectShipsVectorSource.clear());
|
|
916
|
+
}, labelAlpha = 0.8, pixelRatio = window.devicePixelRatio || 1, labelFont = `500 ${12 * pixelRatio}px Arial`, labelOutSize = 2 * pixelRatio, labelHeight = 10 * pixelRatio, fillRectRadius = (e, t, o, n, l, r, i = 4) => {
|
|
917
|
+
e.beginPath(), e.moveTo(t + i, o), e.arcTo(t + n, o, t + n, o + i, i), e.arcTo(t + n, o + l, t + n - i, o + l, i), e.arcTo(t, o + l, t, o + l - i, i), e.arcTo(t, o, t + i, o, i), e.closePath(), e.fillStyle = r, e.fill();
|
|
874
918
|
}, getPixelFromCoordinate = (e) => {
|
|
875
919
|
if (!e || e.length === 0)
|
|
876
920
|
throw new Error("Points array is empty or invalid.");
|
|
877
|
-
let t = 1 / 0,
|
|
878
|
-
for (const [
|
|
879
|
-
|
|
880
|
-
return [t,
|
|
921
|
+
let t = 1 / 0, o = 1 / 0, n = -1 / 0, l = -1 / 0;
|
|
922
|
+
for (const [r, i] of e)
|
|
923
|
+
r < t && (t = r), i < o && (o = i), r > n && (n = r), i > l && (l = i);
|
|
924
|
+
return [t, o, n, l];
|
|
881
925
|
}, calculatePolygonCentroid = (e) => {
|
|
882
926
|
if (!Array.isArray(e) || e.length < 3)
|
|
883
927
|
throw new Error("A polygon must have at least 3 coordinates.");
|
|
884
|
-
let t = 0,
|
|
885
|
-
const
|
|
886
|
-
for (let c = 0; c <
|
|
887
|
-
const [s, m] = e[c], [d, u] = e[c + 1],
|
|
888
|
-
|
|
928
|
+
let t = 0, o = 0, n = 0;
|
|
929
|
+
const l = e.length;
|
|
930
|
+
for (let c = 0; c < l - 1; c++) {
|
|
931
|
+
const [s, m] = e[c], [d, u] = e[c + 1], h = s * u - d * m;
|
|
932
|
+
n += h, t += (s + d) * h, o += (m + u) * h;
|
|
889
933
|
}
|
|
890
|
-
if (
|
|
934
|
+
if (n *= 0.5, n === 0)
|
|
891
935
|
throw new Error("多边形面积为零");
|
|
892
|
-
const
|
|
893
|
-
return [
|
|
936
|
+
const r = t / (6 * n), i = o / (6 * n);
|
|
937
|
+
return [r, i];
|
|
894
938
|
}, rotateShapeModel = (e, t) => {
|
|
895
|
-
const [
|
|
939
|
+
const [o, n] = calculatePolygonCentroid(e), l = t * Math.PI / 180, r = Math.cos(l), i = Math.sin(l);
|
|
896
940
|
return e.map(([c, s]) => {
|
|
897
|
-
const m = c -
|
|
898
|
-
return [u,
|
|
941
|
+
const m = c - o, d = s - n, u = m * r - d * i + o, h = m * i + d * r + n;
|
|
942
|
+
return [u, h];
|
|
899
943
|
});
|
|
900
944
|
}, getTopLeftPoint = (e) => [e[0], e[3]], getBottomLeftPoint = (e) => [e[2], e[3]], getBottomRightPoint = (e) => [e[2], e[1]], getTopRighttPoint = (e) => [e[0], e[1]];
|
|
901
|
-
function calculateBounds(e, t,
|
|
902
|
-
let
|
|
945
|
+
function calculateBounds(e, t, o, n, l) {
|
|
946
|
+
let r, i, c, s;
|
|
903
947
|
const m = e[0], d = e[1];
|
|
904
948
|
switch (t) {
|
|
905
949
|
case 0:
|
|
906
|
-
|
|
950
|
+
r = m + l, i = r + o, s = d - l, c = s - n;
|
|
907
951
|
break;
|
|
908
952
|
case 1:
|
|
909
|
-
|
|
953
|
+
r = m + l, i = r + o, s = d + n / 2, c = s - n;
|
|
910
954
|
break;
|
|
911
955
|
case 2:
|
|
912
|
-
|
|
956
|
+
r = m + l, i = r + o, s = d + l + n, c = s - n;
|
|
913
957
|
break;
|
|
914
958
|
case 3:
|
|
915
|
-
|
|
959
|
+
r = m - o / 2, i = r + o, s = d + l + n, c = s - n;
|
|
916
960
|
break;
|
|
917
961
|
case 4:
|
|
918
|
-
i = m,
|
|
962
|
+
i = m, r = i - o, s = d + l + n, c = s - n;
|
|
919
963
|
break;
|
|
920
964
|
case 5:
|
|
921
|
-
i = m -
|
|
965
|
+
i = m - l, r = i - o, s = d + n / 2, c = s - n;
|
|
922
966
|
break;
|
|
923
967
|
case 6:
|
|
924
|
-
i = m,
|
|
968
|
+
i = m, r = i - o, s = d - l, c = s - n;
|
|
925
969
|
break;
|
|
926
970
|
case 7:
|
|
927
|
-
|
|
971
|
+
r = m - o / 2, i = r + o, s = d - l, c = s - n;
|
|
928
972
|
}
|
|
929
|
-
if (!(!
|
|
930
|
-
return [Math.min(
|
|
973
|
+
if (!(!r || !c || !i || !s))
|
|
974
|
+
return [Math.min(r, i), Math.min(c, s), Math.max(r, i), Math.max(c, s) + 1];
|
|
931
975
|
}
|
|
932
|
-
function calculateAnchorPoint(e, t,
|
|
933
|
-
const
|
|
976
|
+
function calculateAnchorPoint(e, t, o = 70, n = 20, l = 20) {
|
|
977
|
+
const r = [0, 0];
|
|
934
978
|
switch (t) {
|
|
935
979
|
case 0:
|
|
936
|
-
|
|
980
|
+
r[0] = e[0] + l, r[1] = e[1] - l - n / 2;
|
|
937
981
|
break;
|
|
938
982
|
case 1:
|
|
939
|
-
|
|
983
|
+
r[0] = e[0] + l, r[1] = e[1];
|
|
940
984
|
break;
|
|
941
985
|
case 2:
|
|
942
|
-
|
|
986
|
+
r[0] = e[0] + l, r[1] = e[1] + l + n / 2;
|
|
943
987
|
break;
|
|
944
988
|
case 3:
|
|
945
|
-
|
|
989
|
+
r[0] = e[0], r[1] = e[1] + l + n / 4;
|
|
946
990
|
break;
|
|
947
991
|
case 4:
|
|
948
|
-
|
|
992
|
+
r[0] = Math.max(e[0] - l, e[0] - o / 2), r[1] = e[1] + l + n / 4;
|
|
949
993
|
break;
|
|
950
994
|
case 5:
|
|
951
|
-
|
|
995
|
+
r[0] = e[0] - l, r[1] = e[1];
|
|
952
996
|
break;
|
|
953
997
|
case 6:
|
|
954
|
-
|
|
998
|
+
r[0] = Math.max(e[0] - l, e[0] - o / 2), r[1] = e[1] - l - n / 4;
|
|
955
999
|
break;
|
|
956
1000
|
case 7:
|
|
957
|
-
|
|
1001
|
+
r[0] = e[0], r[1] = e[1] - l - n / 4;
|
|
958
1002
|
}
|
|
959
|
-
return
|
|
1003
|
+
return r;
|
|
960
1004
|
}
|
|
961
|
-
function drawLabelBody(e, t,
|
|
1005
|
+
function drawLabelBody(e, t, o) {
|
|
962
1006
|
if (!e) return;
|
|
963
1007
|
const {
|
|
964
|
-
font:
|
|
965
|
-
labelOutSize:
|
|
966
|
-
labelHeight:
|
|
1008
|
+
font: n,
|
|
1009
|
+
labelOutSize: l = 2,
|
|
1010
|
+
labelHeight: r,
|
|
967
1011
|
center: i,
|
|
968
1012
|
text: c,
|
|
969
1013
|
id: s,
|
|
970
1014
|
leftIcon: m,
|
|
971
1015
|
shipColor: d,
|
|
972
1016
|
lineLength: u = 20,
|
|
973
|
-
selected:
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1017
|
+
selected: h,
|
|
1018
|
+
blinkColors: p
|
|
1019
|
+
} = o;
|
|
1020
|
+
e.save(), n && (e.font = n);
|
|
1021
|
+
let f = e.measureText(c).width + 4 * l;
|
|
1022
|
+
(m || d) && (f += r + 6 * l), e.restore();
|
|
1023
|
+
let v, g = 20, k = -1, M = r + 3 * l;
|
|
979
1024
|
if (u)
|
|
980
|
-
for (let
|
|
981
|
-
|
|
982
|
-
let
|
|
983
|
-
for (let
|
|
984
|
-
let
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1025
|
+
for (let b = 0; b < 8; b++) {
|
|
1026
|
+
v = calculateBounds(i, b, f, M, u);
|
|
1027
|
+
let E = !1;
|
|
1028
|
+
for (let V = 0; V < t.length; ++V) {
|
|
1029
|
+
let F = t[V].bounds, $ = [
|
|
1030
|
+
F[0] - g,
|
|
1031
|
+
F[1] - g,
|
|
1032
|
+
F[2] + g,
|
|
1033
|
+
F[3] + g
|
|
989
1034
|
];
|
|
990
|
-
if (
|
|
991
|
-
|
|
1035
|
+
if (v && isOverlapping(v, $)) {
|
|
1036
|
+
E = !0;
|
|
992
1037
|
break;
|
|
993
1038
|
}
|
|
994
1039
|
}
|
|
995
|
-
if (!
|
|
996
|
-
|
|
1040
|
+
if (!E) {
|
|
1041
|
+
k = b;
|
|
997
1042
|
break;
|
|
998
1043
|
}
|
|
999
1044
|
}
|
|
1000
1045
|
else
|
|
1001
|
-
|
|
1002
|
-
if (
|
|
1003
|
-
let
|
|
1046
|
+
k = 0, v = calculateBounds(i, k, f, M, u);
|
|
1047
|
+
if (((p == null ? void 0 : p.length) > 1 || h) && (k = 0, v = calculateBounds(i, k, f, M, u)), v && k > -1) {
|
|
1048
|
+
let b = getBottomLeftPoint(v), E = getTopRighttPoint(v);
|
|
1004
1049
|
return {
|
|
1005
1050
|
center: i,
|
|
1006
|
-
x: calculateAnchorPoint(i,
|
|
1007
|
-
l:
|
|
1008
|
-
r:
|
|
1009
|
-
bounds:
|
|
1010
|
-
position:
|
|
1051
|
+
x: calculateAnchorPoint(i, k, f, M, u),
|
|
1052
|
+
l: E,
|
|
1053
|
+
r: b,
|
|
1054
|
+
bounds: v,
|
|
1055
|
+
position: k,
|
|
1011
1056
|
name: c,
|
|
1012
1057
|
id: s
|
|
1013
1058
|
};
|
|
@@ -1016,61 +1061,62 @@ function drawLabelBody(e, t, n) {
|
|
|
1016
1061
|
}
|
|
1017
1062
|
const drawText = (e, t) => {
|
|
1018
1063
|
if (!e) return;
|
|
1019
|
-
const { center:
|
|
1064
|
+
const { center: o, text: n, textColor: l, leftIcon: r, rightIcons: i, font: c } = t;
|
|
1020
1065
|
e.save(), e.setTransform(1, 0, 0, 1, 0, 0);
|
|
1021
|
-
let [s, m] =
|
|
1022
|
-
if (
|
|
1066
|
+
let [s, m] = o;
|
|
1067
|
+
if (r) {
|
|
1023
1068
|
e.font = `${18 * pixelRatio}px map-iconfont`;
|
|
1024
|
-
let d = getIconFont(
|
|
1025
|
-
e.fillStyle =
|
|
1069
|
+
let d = getIconFont(r.icon);
|
|
1070
|
+
e.fillStyle = r.color, e.fillText(d, s + labelOutSize - 3 * pixelRatio, m + 2.6 * pixelRatio), s += 23 * pixelRatio;
|
|
1026
1071
|
}
|
|
1027
1072
|
if (i != null && i.length) {
|
|
1028
1073
|
e.font = `${12 * pixelRatio}px map-iconfont`, e.fillStyle = "#3370ff";
|
|
1029
|
-
const d = e.measureText(
|
|
1030
|
-
i.forEach((u,
|
|
1031
|
-
const p = getIconFont(u),
|
|
1032
|
-
e.fillText(p, s + d +
|
|
1074
|
+
const d = e.measureText(n).width + 6 * pixelRatio;
|
|
1075
|
+
i.forEach((u, h) => {
|
|
1076
|
+
const p = getIconFont(u), f = 20 * pixelRatio * h;
|
|
1077
|
+
e.fillText(p, s + d + f, m);
|
|
1033
1078
|
});
|
|
1034
1079
|
}
|
|
1035
|
-
e.font = c || labelFont, e.fillStyle =
|
|
1080
|
+
e.font = c || labelFont, e.fillStyle = l, e.fillText(n, s + 2, m), e.restore();
|
|
1036
1081
|
}, drawPolygon = (e, t) => {
|
|
1037
1082
|
let {
|
|
1038
|
-
points:
|
|
1039
|
-
strokeColor:
|
|
1040
|
-
fillColor:
|
|
1041
|
-
shouldClosePath:
|
|
1083
|
+
points: o,
|
|
1084
|
+
strokeColor: n,
|
|
1085
|
+
fillColor: l,
|
|
1086
|
+
shouldClosePath: r,
|
|
1042
1087
|
translation: i,
|
|
1043
1088
|
rotation: c,
|
|
1044
1089
|
rotationCenter: s,
|
|
1045
1090
|
scale: m,
|
|
1046
1091
|
globalAlpha: d
|
|
1047
1092
|
} = t;
|
|
1048
|
-
if (d || (d = 1),
|
|
1049
|
-
e.save(), e.beginPath(), c && c !== 0 && s == null && e.rotate(c), i && e.translate(i[0], i[1]), c && (s != null && s.length) && e.rotate(c), m && e.scale(m, m), e.moveTo(
|
|
1050
|
-
for (let u = 1; u <
|
|
1051
|
-
e.lineTo(
|
|
1052
|
-
|
|
1093
|
+
if (d || (d = 1), o && e) {
|
|
1094
|
+
e.save(), e.beginPath(), c && c !== 0 && s == null && e.rotate(c), i && e.translate(i[0], i[1]), c && (s != null && s.length) && e.rotate(c), m && e.scale(m, m), e.moveTo(o[0][0], o[0][1]);
|
|
1095
|
+
for (let u = 1; u < o.length; u++)
|
|
1096
|
+
e.lineTo(o[u][0], o[u][1]);
|
|
1097
|
+
r && e.closePath(), n && (e.strokeStyle = n, e.stroke()), l && r && (d && (e.globalAlpha = d), e.fillStyle = l, e.fill()), e.restore();
|
|
1053
1098
|
}
|
|
1054
|
-
}, intervalIds = {}, drawLabel = (e, t,
|
|
1055
|
-
var
|
|
1056
|
-
let { center:
|
|
1057
|
-
if (
|
|
1058
|
-
const
|
|
1099
|
+
}, intervalIds = {}, drawLabel = (e, t, o, n) => {
|
|
1100
|
+
var f, v, g, k, M, b, E, V;
|
|
1101
|
+
let { center: l, id: r, text: i, color: c, textColor: s, bgColor: m, leftIcon: d, rightIcons: u, type: h, blinkColors: p } = t;
|
|
1102
|
+
if (l && i) {
|
|
1103
|
+
const F = {
|
|
1059
1104
|
font: labelFont,
|
|
1060
1105
|
labelOutSize,
|
|
1061
1106
|
labelHeight,
|
|
1062
|
-
center:
|
|
1107
|
+
center: l,
|
|
1063
1108
|
text: i,
|
|
1064
|
-
id:
|
|
1109
|
+
id: r,
|
|
1065
1110
|
leftIcon: d,
|
|
1111
|
+
blinkColors: p,
|
|
1066
1112
|
selected: t.selected
|
|
1067
1113
|
};
|
|
1068
|
-
(
|
|
1069
|
-
const
|
|
1070
|
-
if (
|
|
1071
|
-
const { x:
|
|
1072
|
-
|
|
1073
|
-
points: [
|
|
1114
|
+
(f = t.blinkColors) != null && f.length && t.fill && (m = t.fill, s = getForegroundColor(t.fill));
|
|
1115
|
+
const $ = drawLabelBody(e, o, F);
|
|
1116
|
+
if ($) {
|
|
1117
|
+
const { x: y, bounds: L, l: w } = $, S = [getTopLeftPoint(L), getBottomLeftPoint(L), getBottomRightPoint(L), getTopRighttPoint(L)];
|
|
1118
|
+
o.find((R) => R.name === i) || o.push($), drawPolygon(e, {
|
|
1119
|
+
points: [l, w],
|
|
1074
1120
|
strokeColor: c,
|
|
1075
1121
|
fillColor: "#000",
|
|
1076
1122
|
shouldClosePath: !0,
|
|
@@ -1080,141 +1126,147 @@ const drawText = (e, t) => {
|
|
|
1080
1126
|
scale: void 0,
|
|
1081
1127
|
globalAlpha: labelAlpha
|
|
1082
1128
|
}), u != null && u.length && u.forEach(() => {
|
|
1083
|
-
|
|
1129
|
+
S[1][0] += pixelRatio * 18, S[2][0] += pixelRatio * 18;
|
|
1084
1130
|
});
|
|
1085
|
-
const
|
|
1086
|
-
points:
|
|
1131
|
+
const C = {
|
|
1132
|
+
points: S,
|
|
1087
1133
|
strokeColor: c,
|
|
1088
1134
|
fillColor: m,
|
|
1089
1135
|
shouldClosePath: !0
|
|
1090
|
-
}, [
|
|
1091
|
-
center: [
|
|
1136
|
+
}, [P, x] = w, N = {
|
|
1137
|
+
center: [P, x + labelOutSize + labelHeight + 1],
|
|
1092
1138
|
text: i,
|
|
1093
1139
|
textColor: s,
|
|
1094
1140
|
leftIcon: d,
|
|
1095
1141
|
rightIcons: u,
|
|
1096
1142
|
blinkColors: t.blinkColors
|
|
1097
1143
|
};
|
|
1098
|
-
if (drawPolygon(e,
|
|
1099
|
-
let
|
|
1100
|
-
const
|
|
1101
|
-
!!!((
|
|
1102
|
-
var
|
|
1103
|
-
return ((
|
|
1104
|
-
}) || (
|
|
1105
|
-
var
|
|
1106
|
-
return ((
|
|
1107
|
-
})) || hiddenOrther.value
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1144
|
+
if (drawPolygon(e, C), drawText(e, N), t != null && t.blinkColors && t.blinkColors.length > 0) {
|
|
1145
|
+
let R = Date.now(), B = 0;
|
|
1146
|
+
const D = t.blinkColors;
|
|
1147
|
+
!!!((k = (g = (v = selectShipsLayer.value) == null ? void 0 : v.getSource()) == null ? void 0 : g.getFeatures()) != null && k.find((A) => {
|
|
1148
|
+
var O;
|
|
1149
|
+
return ((O = A.get("data")) == null ? void 0 : O.id) === t.id;
|
|
1150
|
+
}) || (E = (b = (M = shipsLayer.value) == null ? void 0 : M.getSource()) == null ? void 0 : b.getFeatures()) != null && E.find((A) => {
|
|
1151
|
+
var O;
|
|
1152
|
+
return ((O = A.get("data")) == null ? void 0 : O.id) === t.id;
|
|
1153
|
+
})) || hiddenOrther.value && ((V = selectSingleShipData.value) == null ? void 0 : V.id) !== t.id ? deleteLabelFromArray(o, t.id) : (intervalIds[t.id] && clearInterval(intervalIds[t.id]), intervalIds[t.id] = window.setInterval(() => {
|
|
1154
|
+
const A = Date.now();
|
|
1155
|
+
A - R >= 500 && (B = (B + 1) % D.length, R = A, C.fillColor = D[B], drawPolygon(e, C), N.textColor = getForegroundColor(C.fillColor), drawText(e, N)), checkBlinkLabelExist(n, o, t.id);
|
|
1110
1156
|
}, 500));
|
|
1111
1157
|
} else
|
|
1112
|
-
shipLabels.value.find((
|
|
1158
|
+
shipLabels.value.find((B) => B.name === i) && (clearInterval(intervalIds[t.id]), drawPolygon(e, C), drawText(e, N));
|
|
1113
1159
|
}
|
|
1114
1160
|
}
|
|
1115
1161
|
return null;
|
|
1116
|
-
}, checkBlinkLabelExist = (e, t,
|
|
1117
|
-
var i, c, s, m, d, u;
|
|
1118
|
-
const
|
|
1119
|
-
var
|
|
1120
|
-
return ((
|
|
1121
|
-
}),
|
|
1162
|
+
}, checkBlinkLabelExist = (e, t, o) => {
|
|
1163
|
+
var i, c, s, m, d, u, h;
|
|
1164
|
+
const n = shipsMarkerList == null ? void 0 : shipsMarkerList.some((p) => {
|
|
1165
|
+
var f, v, g;
|
|
1166
|
+
return ((f = p.ship) == null ? void 0 : f.id) === o && ((g = (v = p.ship) == null ? void 0 : v.blinkColors) == null ? void 0 : g.length) > 0;
|
|
1167
|
+
}), l = [
|
|
1122
1168
|
...((c = (i = shipsLayer.value) == null ? void 0 : i.getSource()) == null ? void 0 : c.getFeatures()) || [],
|
|
1123
1169
|
...((m = (s = selectShipsLayer.value) == null ? void 0 : s.getSource()) == null ? void 0 : m.getFeatures()) || []
|
|
1124
|
-
].some((
|
|
1125
|
-
const
|
|
1126
|
-
if ((
|
|
1127
|
-
const
|
|
1128
|
-
if (!
|
|
1129
|
-
const
|
|
1130
|
-
return
|
|
1170
|
+
].some((p) => {
|
|
1171
|
+
const f = p.get("data");
|
|
1172
|
+
if ((f == null ? void 0 : f.id) === o) {
|
|
1173
|
+
const v = e == null ? void 0 : e.getView().calculateExtent();
|
|
1174
|
+
if (!v) return !1;
|
|
1175
|
+
const g = fromLonLat([f.lon, f.lat]);
|
|
1176
|
+
return g[0] >= v[0] && g[0] <= v[2] && g[1] >= v[1] && g[1] <= v[3];
|
|
1131
1177
|
}
|
|
1132
1178
|
return !1;
|
|
1179
|
+
}), r = (u = (d = trackLineVectorSource.value) == null ? void 0 : d.getFeatures()) == null ? void 0 : u.some((p) => {
|
|
1180
|
+
const f = p.get("data");
|
|
1181
|
+
return (f == null ? void 0 : f.id) === o;
|
|
1133
1182
|
});
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
return
|
|
1137
|
-
})
|
|
1183
|
+
(((h = shipsLayer.value) == null ? void 0 : h.getVisible()) === !1 && t.some((p) => {
|
|
1184
|
+
var f;
|
|
1185
|
+
return p.id !== ((f = selectSingleShipData.value) == null ? void 0 : f.id) && p.id === o;
|
|
1186
|
+
}) || (!r || !l) && (!l || !n)) && deleteLabelFromArray(e, t, o);
|
|
1138
1187
|
}, clearAllInterval = () => {
|
|
1139
1188
|
Object.keys(intervalIds).forEach((e) => {
|
|
1140
1189
|
clearInterval(e);
|
|
1141
1190
|
});
|
|
1142
|
-
}, deleteLabelFromArray = (e, t,
|
|
1143
|
-
var
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1191
|
+
}, deleteLabelFromArray = (e, t, o) => {
|
|
1192
|
+
var l, r, i, c, s, m, d, u;
|
|
1193
|
+
clearInterval(intervalIds[o]);
|
|
1194
|
+
const n = t.findIndex((h) => h.id === o);
|
|
1195
|
+
if (n !== -1) {
|
|
1196
|
+
t.splice(n, 1);
|
|
1197
|
+
const h = (r = (l = shipsLayer.value) == null ? void 0 : l.getSource()) == null ? void 0 : r.getFeatures().find((f) => {
|
|
1148
1198
|
var v;
|
|
1149
|
-
return ((v =
|
|
1199
|
+
return ((v = f.get("data")) == null ? void 0 : v.id) === o;
|
|
1150
1200
|
});
|
|
1151
|
-
|
|
1152
|
-
const p = (m = (s = selectShipsLayer.value) == null ? void 0 : s.getSource()) == null ? void 0 : m.getFeatures().find((
|
|
1201
|
+
h && ((c = (i = shipsLayer.value) == null ? void 0 : i.getSource()) == null || c.removeFeature(h));
|
|
1202
|
+
const p = (m = (s = selectShipsLayer.value) == null ? void 0 : s.getSource()) == null ? void 0 : m.getFeatures().find((f) => {
|
|
1153
1203
|
var v;
|
|
1154
|
-
return ((v =
|
|
1204
|
+
return ((v = f.get("data")) == null ? void 0 : v.id) === o;
|
|
1155
1205
|
});
|
|
1156
1206
|
p && ((u = (d = selectShipsLayer.value) == null ? void 0 : d.getSource()) == null || u.removeFeature(p)), e && e.render();
|
|
1157
1207
|
}
|
|
1208
|
+
}, deleteLabelFromArrayById = () => {
|
|
1209
|
+
mapInstance$9.value && selectSingleShipData.value && deleteLabelFromArray(mapInstance$9.value, shipLabels.value, selectSingleShipData.value.id);
|
|
1158
1210
|
}, PI = Math.PI, a = 6378245, ee = 0.006693421622965943;
|
|
1159
1211
|
function transformLat(e, t) {
|
|
1160
|
-
let
|
|
1161
|
-
return
|
|
1212
|
+
let o = -100 + 2 * e + 3 * t + 0.2 * t * t + 0.1 * e * t + 0.2 * Math.sqrt(Math.abs(e));
|
|
1213
|
+
return o += (20 * Math.sin(6 * e * PI) + 20 * Math.sin(2 * e * PI)) * 2 / 3, o += (20 * Math.sin(t * PI) + 40 * Math.sin(t / 3 * PI)) * 2 / 3, o += (160 * Math.sin(t / 12 * PI) + 320 * Math.sin(t * PI / 30)) * 2 / 3, o;
|
|
1162
1214
|
}
|
|
1163
1215
|
function transformLng(e, t) {
|
|
1164
|
-
let
|
|
1165
|
-
return
|
|
1216
|
+
let o = 300 + e + 2 * t + 0.1 * e * e + 0.1 * e * t + 0.1 * Math.sqrt(Math.abs(e));
|
|
1217
|
+
return o += (20 * Math.sin(6 * e * PI) + 20 * Math.sin(2 * e * PI)) * 2 / 3, o += (20 * Math.sin(e * PI) + 40 * Math.sin(e / 3 * PI)) * 2 / 3, o += (150 * Math.sin(e / 12 * PI) + 300 * Math.sin(e / 30 * PI)) * 2 / 3, o;
|
|
1166
1218
|
}
|
|
1167
1219
|
function outOfChina(e, t) {
|
|
1168
1220
|
return !(e > 73.66 && e < 135.05 && t > 3.86 && t < 53.55);
|
|
1169
1221
|
}
|
|
1170
1222
|
function gcj02ToWgs84(e) {
|
|
1171
|
-
const [t,
|
|
1172
|
-
if (outOfChina(t,
|
|
1173
|
-
return `${t.toFixed(6)}, ${
|
|
1223
|
+
const [t, o] = e.split(",").map(Number);
|
|
1224
|
+
if (outOfChina(t, o))
|
|
1225
|
+
return `${t.toFixed(6)}, ${o.toFixed(6)}`;
|
|
1174
1226
|
{
|
|
1175
|
-
let
|
|
1176
|
-
const
|
|
1177
|
-
let i = Math.sin(
|
|
1227
|
+
let n = transformLat(t - 105, o - 35), l = transformLng(t - 105, o - 35);
|
|
1228
|
+
const r = o / 180 * PI;
|
|
1229
|
+
let i = Math.sin(r);
|
|
1178
1230
|
i = 1 - ee * i * i;
|
|
1179
1231
|
const c = Math.sqrt(i);
|
|
1180
|
-
|
|
1181
|
-
const s =
|
|
1182
|
-
return `${(t * 2 - m).toFixed(6)}, ${(
|
|
1232
|
+
n = n * 180 / (a * (1 - ee) / (i * c) * PI), l = l * 180 / (a / c * Math.cos(r) * PI);
|
|
1233
|
+
const s = o + n, m = t + l;
|
|
1234
|
+
return `${(t * 2 - m).toFixed(6)}, ${(o * 2 - s).toFixed(6)}`;
|
|
1183
1235
|
}
|
|
1184
1236
|
}
|
|
1185
1237
|
function calculateCirclePoints(e, t) {
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
],
|
|
1238
|
+
const o = fromLonLat(e), n = t * 1e3, l = [
|
|
1239
|
+
o[0] - n,
|
|
1240
|
+
o[1] - n,
|
|
1241
|
+
o[0] + n,
|
|
1242
|
+
o[1] + n
|
|
1243
|
+
], r = transformExtent(l, projection.mercator, projection.data);
|
|
1192
1244
|
return {
|
|
1193
|
-
leftTopPoint: { lng:
|
|
1194
|
-
rightTopPoint: { lng:
|
|
1195
|
-
rightBottomPoint: { lng:
|
|
1196
|
-
leftBottomPoint: { lng:
|
|
1245
|
+
leftTopPoint: { lng: r[0], lat: r[3] },
|
|
1246
|
+
rightTopPoint: { lng: r[2], lat: r[3] },
|
|
1247
|
+
rightBottomPoint: { lng: r[2], lat: r[1] },
|
|
1248
|
+
leftBottomPoint: { lng: r[0], lat: r[1] }
|
|
1197
1249
|
};
|
|
1198
1250
|
}
|
|
1199
1251
|
const equatorialCircumference = 2003750834e-2;
|
|
1200
1252
|
function lonLatToMercator(e) {
|
|
1201
1253
|
const t = e[0] * equatorialCircumference / 180;
|
|
1202
|
-
let
|
|
1203
|
-
return
|
|
1254
|
+
let o = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
|
|
1255
|
+
return o = o * equatorialCircumference / 180, [t, o];
|
|
1204
1256
|
}
|
|
1205
1257
|
function mercatorToLonLat(e, t = "lonlat") {
|
|
1206
|
-
const
|
|
1207
|
-
let
|
|
1208
|
-
return
|
|
1258
|
+
const o = { lon: 0, lat: 0 }, n = e[0] / equatorialCircumference * 180;
|
|
1259
|
+
let l = e[1] / equatorialCircumference * 180;
|
|
1260
|
+
return l = 180 / Math.PI * (2 * Math.atan(Math.exp(l * Math.PI / 180)) - Math.PI / 2), o.lon = n, o.lat = l, t === "lonlat" ? o : [n, l];
|
|
1209
1261
|
}
|
|
1210
1262
|
function calculateBoundingBox(e) {
|
|
1211
|
-
let t = 1 / 0,
|
|
1263
|
+
let t = 1 / 0, o = -1 / 0, n = 1 / 0, l = -1 / 0;
|
|
1212
1264
|
e.forEach((v) => {
|
|
1213
|
-
const [
|
|
1214
|
-
t = Math.min(t,
|
|
1265
|
+
const [g, k] = v;
|
|
1266
|
+
t = Math.min(t, k), o = Math.max(o, k), n = Math.min(n, g), l = Math.max(l, g);
|
|
1215
1267
|
});
|
|
1216
|
-
const
|
|
1217
|
-
return [
|
|
1268
|
+
const r = l - n, i = o - t, c = Math.max(r, i), s = (n + l) / 2, m = (t + o) / 2, d = c / 2, u = s - d, h = s + d, p = m - d, f = m + d;
|
|
1269
|
+
return [h, p, u, f];
|
|
1218
1270
|
}
|
|
1219
1271
|
const transformUtils = {
|
|
1220
1272
|
gcj02ToWgs84,
|
|
@@ -1223,61 +1275,58 @@ const transformUtils = {
|
|
|
1223
1275
|
mercatorToLonLat,
|
|
1224
1276
|
calculateBoundingBox,
|
|
1225
1277
|
transform
|
|
1226
|
-
}, mapInstance$5 = ref(), renderTrackStyleSetInstance = (e) => mapInstance$5.value = e, stopIcon = "", stopColor = "#E31818", slowIcon = "", slowColor = "#1890FF", dropletsIcon = "", trackList$1 = ref([])
|
|
1227
|
-
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
const [u, f] = formatUtils.convertSixHundredThousandToLatLng(m.lon, m.lat);
|
|
1237
|
-
m.lon = u, m.lat = f;
|
|
1278
|
+
}, mapInstance$5 = ref(), renderTrackStyleSetInstance = (e) => mapInstance$5.value = e, stopIcon = "", stopColor = "#E31818", slowIcon = "", slowColor = "#1890FF", dropletsIcon = "", trackList$1 = ref([]), renderTrackLine = (e, t, o) => {
|
|
1279
|
+
var s, m, d;
|
|
1280
|
+
const n = e[t];
|
|
1281
|
+
if (!n) return;
|
|
1282
|
+
allTracks.value[t] = n, trackList$1.value = [];
|
|
1283
|
+
const r = Math.max(1, Math.floor(n.length / 50)), i = n.filter((u, h) => h % r === 0);
|
|
1284
|
+
trackList$1.value = i.map((u, h) => {
|
|
1285
|
+
if (Number(u.lon) > 180 || Number(u.lat) > 180) {
|
|
1286
|
+
const [p, f] = formatUtils.convertSixHundredThousandToLatLng(u.lon, u.lat);
|
|
1287
|
+
u.lon = p, u.lat = f;
|
|
1238
1288
|
}
|
|
1239
|
-
return
|
|
1289
|
+
return u.center = [u.lon, u.lat], u.centerPoint = transformUtils.lonLatToMercator(u.center), u.id = t, u.index = h, u.time = hooks(u.createdAt).format("YYYY-MM-DD HH:mm:ss"), u;
|
|
1240
1290
|
});
|
|
1241
|
-
const
|
|
1242
|
-
if (
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1291
|
+
const c = trackList$1.value.map((u) => u.centerPoint);
|
|
1292
|
+
if (c.length >= 2) {
|
|
1293
|
+
const u = new LineString(c), h = new Feature({ geometry: u });
|
|
1294
|
+
h.setStyle(
|
|
1245
1295
|
new Style({
|
|
1246
1296
|
stroke: new Stroke({
|
|
1247
|
-
color:
|
|
1297
|
+
color: o,
|
|
1248
1298
|
width: 2
|
|
1249
1299
|
})
|
|
1250
1300
|
})
|
|
1251
|
-
),
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1254
|
-
const f = createAnimatedIconFeature(n, l);
|
|
1255
|
-
trackLineVectorSource.value = new VectorSource({
|
|
1301
|
+
), h.setId(t), h.set("type", "line"), (m = (s = shipTrackVectorLayer.value) == null ? void 0 : s.getSource()) == null || m.clear(), shipTrackLineFeatures.value = [];
|
|
1302
|
+
const p = shipTrackLineFeatures.value.findIndex((f) => f.getId() === t);
|
|
1303
|
+
p >= 0 ? shipTrackLineFeatures.value[p] = h : shipTrackLineFeatures.value.push(h), createAnimatedIconFeature(o, c), trackLineVectorSource.value = new VectorSource({
|
|
1256
1304
|
features: [...shipTrackLineFeatures.value]
|
|
1257
|
-
}),
|
|
1305
|
+
}), shipTrackVectorLayer.value = new VectorLayer({
|
|
1258
1306
|
source: trackLineVectorSource.value,
|
|
1259
|
-
zIndex: 102
|
|
1260
|
-
|
|
1307
|
+
zIndex: 102,
|
|
1308
|
+
updateWhileInteracting: !0
|
|
1309
|
+
}), renderPoint(o), (d = mapInstance$5.value) == null || d.addLayer(shipTrackVectorLayer.value);
|
|
1261
1310
|
}
|
|
1262
1311
|
}, handlePlay = (e, t) => {
|
|
1263
|
-
const
|
|
1264
|
-
playAnimation(
|
|
1312
|
+
const o = allTracks.value[String(e)];
|
|
1313
|
+
playAnimation(o.map((n) => [n.lon, n.lat]), t);
|
|
1265
1314
|
}, removeShipTrackLineFeatureByIndex = (e, t) => {
|
|
1266
1315
|
e >= 0 && e < shipTrackLineFeatures.value.length && (shipTrackLineFeatures.value.splice(e, 1), delete allTracks.value[t]), trackLineVectorSource.value = new VectorSource({
|
|
1267
1316
|
features: [...shipTrackLineFeatures.value]
|
|
1268
1317
|
}), shipTrackVectorLayer.value && shipTrackVectorLayer.value.setSource(trackLineVectorSource.value);
|
|
1269
1318
|
}, createAnimatedIconFeature = (e, t) => {
|
|
1270
|
-
const
|
|
1319
|
+
const o = new Feature({
|
|
1271
1320
|
geometry: new Point(fromLonLat([t[0][0], t[0][1]]))
|
|
1272
1321
|
// 初始位置
|
|
1273
|
-
}),
|
|
1322
|
+
}), n = new Style({
|
|
1274
1323
|
text: new Text({
|
|
1275
1324
|
font: "700 14px map-iconfont",
|
|
1276
1325
|
text: getIconFont(""),
|
|
1277
1326
|
fill: new Fill({ color: e })
|
|
1278
1327
|
})
|
|
1279
1328
|
});
|
|
1280
|
-
return
|
|
1329
|
+
return o.setStyle(n), o;
|
|
1281
1330
|
}, geoMarkerStyle = new Style({
|
|
1282
1331
|
text: new Text({
|
|
1283
1332
|
font: "700 20px map-iconfont",
|
|
@@ -1291,13 +1340,13 @@ let polyline, linePath, startMarker, position, geoMarker, vectorLayer;
|
|
|
1291
1340
|
const trackAnimating = ref(!1);
|
|
1292
1341
|
let distance = 0, lastTime = Date.now(), moveFeatureHandler = null;
|
|
1293
1342
|
const moveFeature = (e, t) => {
|
|
1294
|
-
var u,
|
|
1295
|
-
const
|
|
1296
|
-
if (distance = (distance +
|
|
1343
|
+
var u, h, p;
|
|
1344
|
+
const o = Number(50 * t), n = ((u = e.frameState) == null ? void 0 : u.time) ?? Date.now(), l = n - lastTime;
|
|
1345
|
+
if (distance = (distance + o * l / 1e6) % 2, lastTime = n, distance >= 1) {
|
|
1297
1346
|
stopAnimation();
|
|
1298
1347
|
return;
|
|
1299
1348
|
}
|
|
1300
|
-
const
|
|
1349
|
+
const r = linePath.getCoordinateAt(
|
|
1301
1350
|
distance > 1 ? 2 - distance : distance
|
|
1302
1351
|
), i = linePath.getCoordinateAt(
|
|
1303
1352
|
distance > 1 ? distance - 0.01 : distance
|
|
@@ -1307,7 +1356,7 @@ const moveFeature = (e, t) => {
|
|
|
1307
1356
|
transformUtils.mercatorToLonLat(i, "array"),
|
|
1308
1357
|
transformUtils.mercatorToLonLat(c, "array")
|
|
1309
1358
|
) * Math.PI / 180;
|
|
1310
|
-
(
|
|
1359
|
+
(h = geoMarkerStyle.getText()) == null || h.setRotation(m), position.setCoordinates(r);
|
|
1311
1360
|
const d = getVectorContext(e);
|
|
1312
1361
|
d.context_.save(), d.setStyle(geoMarkerStyle), d.drawGeometry(position), d.context_.restore(), (p = mapInstance$5.value) == null || p.render();
|
|
1313
1362
|
}, startAnimation = () => {
|
|
@@ -1317,7 +1366,7 @@ const moveFeature = (e, t) => {
|
|
|
1317
1366
|
var e;
|
|
1318
1367
|
trackAnimating.value && (trackAnimating.value = !1, geoMarker == null || geoMarker.setGeometry(void 0), moveFeatureHandler && vectorLayer && vectorLayer.un("postrender", moveFeatureHandler), vectorLayer && ((e = mapInstance$5.value) == null || e.removeLayer(vectorLayer)), vectorLayer = null, geoMarker = null);
|
|
1319
1368
|
}, playAnimation = (e, t) => {
|
|
1320
|
-
var
|
|
1369
|
+
var n;
|
|
1321
1370
|
trackAnimating.value && stopAnimation(), polyline = new Polyline({
|
|
1322
1371
|
factor: 1e6
|
|
1323
1372
|
}).writeGeometry(new LineString(e)), linePath = new Polyline({
|
|
@@ -1329,8 +1378,8 @@ const moveFeature = (e, t) => {
|
|
|
1329
1378
|
type: "icon",
|
|
1330
1379
|
geometry: new Point(linePath.getFirstCoordinate())
|
|
1331
1380
|
});
|
|
1332
|
-
const
|
|
1333
|
-
position =
|
|
1381
|
+
const o = startMarker.getGeometry();
|
|
1382
|
+
position = o ? o.clone() : new Point([0, 0]), geoMarker = new Feature({
|
|
1334
1383
|
type: "geoMarker",
|
|
1335
1384
|
style: geoMarkerStyle,
|
|
1336
1385
|
geometry: position
|
|
@@ -1338,13 +1387,13 @@ const moveFeature = (e, t) => {
|
|
|
1338
1387
|
source: new VectorSource({
|
|
1339
1388
|
features: [geoMarker]
|
|
1340
1389
|
})
|
|
1341
|
-
}), (
|
|
1390
|
+
}), (n = mapInstance$5.value) == null || n.addLayer(vectorLayer), moveFeatureHandler = (l) => moveFeature(l, t), startAnimation();
|
|
1342
1391
|
}, renderPoint = (e) => {
|
|
1343
1392
|
if (!mapInstance$5.value) return;
|
|
1344
1393
|
const t = trackList$1.value || [];
|
|
1345
1394
|
if (!(t && t.length > 1)) return [];
|
|
1346
|
-
const
|
|
1347
|
-
for (let c = 0; c <
|
|
1395
|
+
const o = { 16: 24, 17: 15, default: 4 }, n = [], l = t.length;
|
|
1396
|
+
for (let c = 0; c < l; c++) {
|
|
1348
1397
|
t[c].index = c;
|
|
1349
1398
|
const s = mapInstance$5.value.getPixelFromCoordinate(t[c].centerPoint);
|
|
1350
1399
|
if (s) {
|
|
@@ -1353,23 +1402,23 @@ const moveFeature = (e, t) => {
|
|
|
1353
1402
|
const d = mapInstance$5.value.getView().getZoom();
|
|
1354
1403
|
if (!d) return;
|
|
1355
1404
|
if (d > 15) {
|
|
1356
|
-
const
|
|
1357
|
-
m = adjustBounds(m, [
|
|
1405
|
+
const h = o[d] || o.default;
|
|
1406
|
+
m = adjustBounds(m, [h, h]);
|
|
1358
1407
|
}
|
|
1359
1408
|
let u = !0;
|
|
1360
1409
|
if (t[c].state !== "0") {
|
|
1361
|
-
for (let
|
|
1362
|
-
if (isOverlapping(m,
|
|
1410
|
+
for (let h = 0; h < n.length; h++)
|
|
1411
|
+
if (isOverlapping(m, n[h].bounds)) {
|
|
1363
1412
|
u = !1;
|
|
1364
1413
|
break;
|
|
1365
1414
|
}
|
|
1366
1415
|
}
|
|
1367
|
-
u && (t[c].bounds = m,
|
|
1416
|
+
u && (t[c].bounds = m, n.push(t[c]));
|
|
1368
1417
|
}
|
|
1369
1418
|
}
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1372
|
-
var u,
|
|
1419
|
+
const r = getIconStyle(stopIcon), i = getIconStyle(slowIcon);
|
|
1420
|
+
n.forEach((c, s) => {
|
|
1421
|
+
var u, h;
|
|
1373
1422
|
const m = new Feature({
|
|
1374
1423
|
geometry: new Point(c.centerPoint)
|
|
1375
1424
|
});
|
|
@@ -1400,7 +1449,7 @@ const moveFeature = (e, t) => {
|
|
|
1400
1449
|
geometry: new Point(c.centerPoint)
|
|
1401
1450
|
});
|
|
1402
1451
|
p.set("type", "track_icon");
|
|
1403
|
-
const
|
|
1452
|
+
const f = new Style({
|
|
1404
1453
|
text: new Text({
|
|
1405
1454
|
font: "Normal 22px map-iconfont",
|
|
1406
1455
|
text: getIconFont(dropletsIcon),
|
|
@@ -1408,27 +1457,27 @@ const moveFeature = (e, t) => {
|
|
|
1408
1457
|
}),
|
|
1409
1458
|
zIndex: 99
|
|
1410
1459
|
}), v = [];
|
|
1411
|
-
Number(c.state) === 0 ? ((u =
|
|
1460
|
+
Number(c.state) === 0 ? ((u = f.getText()) == null || u.setFill(new Fill({ color: stopColor })), v.push(r)) : Number(c.state) === 1 && ((h = f.getText()) == null || h.setFill(new Fill({ color: slowColor })), v.push(i)), v.push(f), p.setStyle(v), trackLineVectorSource.value.addFeature(p);
|
|
1412
1461
|
}
|
|
1413
|
-
}), renderArrow(
|
|
1462
|
+
}), renderArrow(n, e), renderIconPoint();
|
|
1414
1463
|
}, renderArrow = (e, t) => {
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
for (let
|
|
1418
|
-
let
|
|
1419
|
-
const
|
|
1464
|
+
const o = e.length;
|
|
1465
|
+
o || (e.push(trackList$1.value[0]), e.push(trackList$1.value[trackList$1.value.length - 1]));
|
|
1466
|
+
for (let n = 0; n < o - 1; n++) {
|
|
1467
|
+
let l;
|
|
1468
|
+
const r = e[n], i = (e[n + 1].index + r.index) / 2;
|
|
1420
1469
|
if (i % 2 === 0)
|
|
1421
|
-
|
|
1470
|
+
l = trackList$1.value[i].centerPoint;
|
|
1422
1471
|
else {
|
|
1423
1472
|
const c = trackList$1.value[Math.floor(i)], s = trackList$1.value[Math.ceil(i)];
|
|
1424
1473
|
if (c && s) {
|
|
1425
|
-
const [m, d] = c.centerPoint, [u,
|
|
1426
|
-
|
|
1474
|
+
const [m, d] = c.centerPoint, [u, h] = s.centerPoint;
|
|
1475
|
+
l = [(m + u) / 2, (d + h) / 2];
|
|
1427
1476
|
}
|
|
1428
1477
|
}
|
|
1429
|
-
if (
|
|
1478
|
+
if (l) {
|
|
1430
1479
|
const c = new Feature({
|
|
1431
|
-
geometry: new Point(
|
|
1480
|
+
geometry: new Point(l)
|
|
1432
1481
|
});
|
|
1433
1482
|
c.set("type", "track_arrow"), c.setStyle(
|
|
1434
1483
|
new Style({
|
|
@@ -1438,8 +1487,8 @@ const moveFeature = (e, t) => {
|
|
|
1438
1487
|
fill: new Fill({ color: t }),
|
|
1439
1488
|
// 设置箭头旋转 角度转为弧度
|
|
1440
1489
|
rotation: getRotation(
|
|
1441
|
-
e[
|
|
1442
|
-
e[
|
|
1490
|
+
e[n].center,
|
|
1491
|
+
e[n + 1].center
|
|
1443
1492
|
) * (Math.PI / 180)
|
|
1444
1493
|
})
|
|
1445
1494
|
})
|
|
@@ -1447,14 +1496,14 @@ const moveFeature = (e, t) => {
|
|
|
1447
1496
|
}
|
|
1448
1497
|
}
|
|
1449
1498
|
}, renderIconPoint = () => {
|
|
1450
|
-
const e = "", t = "#fcdc3f",
|
|
1451
|
-
(trackList$1.value.length < 2 ? [trackList$1.value[0]] : [trackList$1.value[0], trackList$1.value[trackList$1.value.length - 1]]).forEach((
|
|
1452
|
-
const
|
|
1453
|
-
geometry: new Point(
|
|
1499
|
+
const e = "", t = "#fcdc3f", o = "#ff0000";
|
|
1500
|
+
(trackList$1.value.length < 2 ? [trackList$1.value[0]] : [trackList$1.value[0], trackList$1.value[trackList$1.value.length - 1]]).forEach((l) => {
|
|
1501
|
+
const r = new Feature({
|
|
1502
|
+
geometry: new Point(l.centerPoint)
|
|
1454
1503
|
});
|
|
1455
|
-
|
|
1456
|
-
const i =
|
|
1457
|
-
|
|
1504
|
+
r.set("type", "track_begin"), r.set("data", l);
|
|
1505
|
+
const i = l.index === 0 && trackList$1.value.length >= 2 ? t : o;
|
|
1506
|
+
r.setStyle(
|
|
1458
1507
|
new Style({
|
|
1459
1508
|
text: new Text({
|
|
1460
1509
|
font: "Normal 14px map-iconfont",
|
|
@@ -1463,13 +1512,13 @@ const moveFeature = (e, t) => {
|
|
|
1463
1512
|
}),
|
|
1464
1513
|
zIndex: 101
|
|
1465
1514
|
})
|
|
1466
|
-
), trackLineVectorSource.value.addFeature(
|
|
1515
|
+
), trackLineVectorSource.value.addFeature(r);
|
|
1467
1516
|
});
|
|
1468
1517
|
}, setTrackLabelStyle = (e, t) => new Style({
|
|
1469
|
-
renderer: (
|
|
1470
|
-
const
|
|
1518
|
+
renderer: (o, n) => {
|
|
1519
|
+
const l = n.context, c = {
|
|
1471
1520
|
id: e.id || "",
|
|
1472
|
-
center:
|
|
1521
|
+
center: o,
|
|
1473
1522
|
text: e.time,
|
|
1474
1523
|
color: t,
|
|
1475
1524
|
textColor: "#000",
|
|
@@ -1477,40 +1526,40 @@ const moveFeature = (e, t) => {
|
|
|
1477
1526
|
selected: !0,
|
|
1478
1527
|
type: "TrackTime"
|
|
1479
1528
|
};
|
|
1480
|
-
drawLabel(
|
|
1529
|
+
drawLabel(l, c, trackLabels.value, mapInstance$5.value);
|
|
1481
1530
|
}
|
|
1482
|
-
}), mapInstance$4 = ref(), renderCustomOverlaySetInstance = (e) => mapInstance$4.value = e, drawCustomContent = (e, t,
|
|
1483
|
-
var u,
|
|
1531
|
+
}), mapInstance$4 = ref(), renderCustomOverlaySetInstance = (e) => mapInstance$4.value = e, drawCustomContent = (e, t, o, n = "top-left", l = !1, r = !0) => {
|
|
1532
|
+
var u, h;
|
|
1484
1533
|
if (!t || !mapInstance$4.value) return;
|
|
1485
|
-
|
|
1486
|
-
var
|
|
1487
|
-
return (
|
|
1534
|
+
r && document.querySelectorAll(".truck-custom-content").forEach((p) => {
|
|
1535
|
+
var f;
|
|
1536
|
+
return (f = p.parentNode) == null ? void 0 : f.removeChild(p);
|
|
1488
1537
|
});
|
|
1489
1538
|
const i = document.createElement("div");
|
|
1490
|
-
i.innerHTML =
|
|
1539
|
+
i.innerHTML = o;
|
|
1491
1540
|
const c = new Overlay({
|
|
1492
1541
|
element: i,
|
|
1493
1542
|
position: t,
|
|
1494
1543
|
// 初始位置
|
|
1495
|
-
positioning:
|
|
1496
|
-
stopEvent:
|
|
1544
|
+
positioning: n,
|
|
1545
|
+
stopEvent: l
|
|
1497
1546
|
// 设置不阻拦事件
|
|
1498
1547
|
});
|
|
1499
|
-
if (
|
|
1500
|
-
let p = !1,
|
|
1548
|
+
if (l) {
|
|
1549
|
+
let p = !1, f = [0, 0], v = [0, 0], g = 0, k = 0;
|
|
1501
1550
|
i.addEventListener("mousedown", function(M) {
|
|
1502
|
-
var
|
|
1503
|
-
p = !0,
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1551
|
+
var E;
|
|
1552
|
+
p = !0, g = M.clientX, k = M.clientY;
|
|
1553
|
+
const b = (E = mapInstance$4.value) == null ? void 0 : E.getCoordinateFromPixel([M.clientX - 200, M.clientY - 200]);
|
|
1554
|
+
b && (f = b), v = [
|
|
1506
1555
|
M.clientX - i.getBoundingClientRect().left + 160,
|
|
1507
1556
|
M.clientY - i.getBoundingClientRect().top + 84
|
|
1508
|
-
], M.preventDefault(), console.log(e,
|
|
1557
|
+
], M.preventDefault(), console.log(e, g, k);
|
|
1509
1558
|
}), document.addEventListener("mousemove", function(M) {
|
|
1510
|
-
var
|
|
1559
|
+
var b;
|
|
1511
1560
|
if (p) {
|
|
1512
|
-
const
|
|
1513
|
-
c.setPosition([
|
|
1561
|
+
const E = (b = mapInstance$4.value) == null ? void 0 : b.getCoordinateFromPixel([M.clientX - v[0], M.clientY - v[1]]), V = E[0] - f[0], F = E[1] - f[1];
|
|
1562
|
+
c.setPosition([f[0] + V, f[1] + F]);
|
|
1514
1563
|
}
|
|
1515
1564
|
}), document.addEventListener("mouseup", function() {
|
|
1516
1565
|
p = !1;
|
|
@@ -1519,49 +1568,49 @@ const moveFeature = (e, t) => {
|
|
|
1519
1568
|
(u = mapInstance$4.value) == null || u.addOverlay(c);
|
|
1520
1569
|
const s = i.querySelector(".close-button");
|
|
1521
1570
|
s && s.addEventListener("click", () => {
|
|
1522
|
-
var p,
|
|
1523
|
-
(p = mapInstance$4.value) == null || p.removeOverlay(c), (
|
|
1571
|
+
var p, f;
|
|
1572
|
+
(p = mapInstance$4.value) == null || p.removeOverlay(c), (f = i.parentNode) == null || f.removeChild(i);
|
|
1524
1573
|
});
|
|
1525
|
-
const m = JSON.parse(JSON.stringify(t)), d = (
|
|
1574
|
+
const m = JSON.parse(JSON.stringify(t)), d = (h = mapInstance$4.value) == null ? void 0 : h.getCoordinateFromPixel(m);
|
|
1526
1575
|
return c.setPosition(d), c;
|
|
1527
1576
|
}, mapInstance$3 = ref(), renderTrackSetInstance = (e) => mapInstance$3.value = e, showTracks = ref([]), trackList = ref([]);
|
|
1528
1577
|
ref(null);
|
|
1529
|
-
const trackId = ref(""), cursor = ref(0), renderTrack = (e, t,
|
|
1578
|
+
const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, l = "ship") => {
|
|
1530
1579
|
var d;
|
|
1531
|
-
if (console.log(
|
|
1580
|
+
if (console.log(l), nextTick(() => {
|
|
1532
1581
|
hiddenAllShips(), clearShipData(!1);
|
|
1533
1582
|
}).then((u) => {
|
|
1534
1583
|
}), (t == null ? void 0 : t.length) < 2) {
|
|
1535
1584
|
((d = showTracks.value) == null ? void 0 : d.findIndex((u) => u.id === e)) < 0 && showTracks.value.push({ id: e, length: "" });
|
|
1536
1585
|
return;
|
|
1537
1586
|
}
|
|
1538
|
-
const
|
|
1587
|
+
const r = {};
|
|
1539
1588
|
t.forEach((u) => {
|
|
1540
1589
|
u.state ? u.state = Number(u.state) : delete u.state;
|
|
1541
|
-
}), trackId.value = e,
|
|
1542
|
-
const i = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], c =
|
|
1590
|
+
}), trackId.value = e, r[e] = t, trackList.value = t;
|
|
1591
|
+
const i = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], c = r[e].map(
|
|
1543
1592
|
(u) => transform([u.lon, u.lat], projection.data, projection.mercator)
|
|
1544
|
-
), s = new LineString(c), m = formatUtils.formatLength(s,
|
|
1593
|
+
), s = new LineString(c), m = formatUtils.formatLength(s, n) || "--";
|
|
1545
1594
|
nextTick(() => {
|
|
1546
|
-
var
|
|
1547
|
-
const u = (
|
|
1548
|
-
u < 0 ? showTracks.value.push({ id: e, length: m }) : showTracks.value[u].length = m, ++cursor.value, cursor.value > i.length && (cursor.value = 0), renderTrackLine(
|
|
1595
|
+
var h, p;
|
|
1596
|
+
const u = (h = showTracks.value) == null ? void 0 : h.findIndex((f) => f.id === e);
|
|
1597
|
+
u < 0 ? showTracks.value.push({ id: e, length: m }) : showTracks.value[u].length = m, ++cursor.value, cursor.value > i.length && (cursor.value = 0), renderTrackLine(r, e, o), nextTick(() => {
|
|
1549
1598
|
resetTrackView(e);
|
|
1550
1599
|
}).then(() => {
|
|
1551
1600
|
}), (p = mapInstance$3.value) == null || p.on("moveend", () => {
|
|
1552
|
-
showTrackLayer.value && (trackLabels.value = [], renderTrackLine(
|
|
1553
|
-
}), renderTrackPointPopup();
|
|
1601
|
+
showTrackLayer.value && (trackLabels.value = [], renderTrackLine(r, e, o));
|
|
1602
|
+
}), l === "ship" && renderTrackPointPopup();
|
|
1554
1603
|
}).then(() => {
|
|
1555
1604
|
});
|
|
1556
1605
|
}, renderTrackPointPopup = () => {
|
|
1557
1606
|
var t;
|
|
1558
1607
|
const e = ref(null);
|
|
1559
|
-
(t = mapInstance$3.value) == null || t.on("pointermove", (
|
|
1560
|
-
var
|
|
1561
|
-
e.value && ((
|
|
1562
|
-
const
|
|
1563
|
-
if (
|
|
1564
|
-
const s =
|
|
1608
|
+
(t = mapInstance$3.value) == null || t.on("pointermove", (o) => {
|
|
1609
|
+
var l, r, i, c;
|
|
1610
|
+
e.value && ((l = mapInstance$3.value) == null || l.removeOverlay(e.value));
|
|
1611
|
+
const n = (r = mapInstance$3.value) == null ? void 0 : r.forEachFeatureAtPixel(o.pixel, (s) => s);
|
|
1612
|
+
if (n) {
|
|
1613
|
+
const s = n.get("data");
|
|
1565
1614
|
if (!(s != null && s.time)) return;
|
|
1566
1615
|
let m = "";
|
|
1567
1616
|
s != null && s.stayTime && (m = `
|
|
@@ -1601,10 +1650,10 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1601
1650
|
<div class="item-item">${s.time}</div>
|
|
1602
1651
|
</div>
|
|
1603
1652
|
${m ?? m}
|
|
1604
|
-
</div>`, u = (i = mapInstance$3.value) == null ? void 0 : i.getPixelFromCoordinate(
|
|
1653
|
+
</div>`, u = (i = mapInstance$3.value) == null ? void 0 : i.getPixelFromCoordinate(o.coordinate);
|
|
1605
1654
|
if (u) {
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1655
|
+
const h = drawCustomContent(s.time, u, d, "top-left");
|
|
1656
|
+
h && (e.value = h);
|
|
1608
1657
|
}
|
|
1609
1658
|
} else
|
|
1610
1659
|
e.value && ((c = mapInstance$3.value) == null || c.removeOverlay(e.value));
|
|
@@ -1615,21 +1664,21 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1615
1664
|
}, playTrack = (e, t) => {
|
|
1616
1665
|
handlePlay(String(e), t);
|
|
1617
1666
|
}, resetTrackView = (e) => {
|
|
1618
|
-
var
|
|
1619
|
-
const t = mapInstance$3.value.getView(),
|
|
1620
|
-
if (!
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1667
|
+
var l;
|
|
1668
|
+
const t = mapInstance$3.value.getView(), o = e ? shipTrackLineFeatures.value.find((r) => r.getId() === e) : shipTrackLineFeatures.value[0];
|
|
1669
|
+
if (!o) return;
|
|
1670
|
+
const n = (l = o == null ? void 0 : o.getGeometry()) == null ? void 0 : l.getExtent();
|
|
1671
|
+
if (n != null && n.length)
|
|
1623
1672
|
try {
|
|
1624
|
-
const
|
|
1625
|
-
t.fit(
|
|
1626
|
-
} catch (
|
|
1627
|
-
console.log(
|
|
1673
|
+
const r = buffer(n, Math.max(n[2] - n[0], n[3] - n[1]) * 0.02);
|
|
1674
|
+
t.fit(r);
|
|
1675
|
+
} catch (r) {
|
|
1676
|
+
console.log(r);
|
|
1628
1677
|
}
|
|
1629
1678
|
}, formatMinutesToDDHHMM = (e) => {
|
|
1630
|
-
const t = hooks.duration(e, "minutes"),
|
|
1631
|
-
let
|
|
1632
|
-
return
|
|
1679
|
+
const t = hooks.duration(e, "minutes"), o = Math.floor(t.asDays()), n = t.hours(), l = t.minutes();
|
|
1680
|
+
let r = `${String(l).padStart(2, "0")}分`;
|
|
1681
|
+
return n !== 0 && (r = `${String(n).padStart(2, "0")}时${r}`), o !== 0 && (r = `${String(o).padStart(2, "0")}天${r}`), r;
|
|
1633
1682
|
}, _hoisted_1$3 = {
|
|
1634
1683
|
key: 0,
|
|
1635
1684
|
class: "more-tool-panel"
|
|
@@ -1644,28 +1693,28 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1644
1693
|
},
|
|
1645
1694
|
emits: ["switchGreenDot", "switchMapTile"],
|
|
1646
1695
|
setup(e, { emit: t }) {
|
|
1647
|
-
var p,
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1696
|
+
var p, f;
|
|
1697
|
+
const o = inject("mapInstance"), n = e, l = t, r = ref(((f = (p = o == null ? void 0 : o.value) == null ? void 0 : p.getView()) == null ? void 0 : f.getZoom()) || mapZoom.default), i = ref(!1), c = ref(null), s = ref(!0), m = () => {
|
|
1698
|
+
n.disableGreenDot || r.value >= mapZoom.shipGreenDotMax || (s.value = !s.value, l("switchGreenDot", s.value));
|
|
1650
1699
|
}, d = () => {
|
|
1651
|
-
|
|
1700
|
+
l("switchMapTile", n.mapTileMode === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector);
|
|
1652
1701
|
}, u = () => {
|
|
1653
|
-
var v,
|
|
1654
|
-
i.value ? (
|
|
1655
|
-
},
|
|
1702
|
+
var v, g;
|
|
1703
|
+
i.value ? (v = c.value) == null || v.removeInteraction() : (g = c.value) == null || g.addInteraction(), i.value = !i.value;
|
|
1704
|
+
}, h = () => {
|
|
1656
1705
|
var v;
|
|
1657
1706
|
(v = c.value) == null || v.removeInteraction(), i.value = !1;
|
|
1658
1707
|
};
|
|
1659
1708
|
return onMounted(() => {
|
|
1660
1709
|
nextTick(() => {
|
|
1661
1710
|
var v;
|
|
1662
|
-
(v =
|
|
1663
|
-
var
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1711
|
+
(v = o == null ? void 0 : o.value) == null || v.on("moveend", () => {
|
|
1712
|
+
var k, M;
|
|
1713
|
+
const g = (M = (k = o == null ? void 0 : o.value) == null ? void 0 : k.getView()) == null ? void 0 : M.getZoom();
|
|
1714
|
+
g && (r.value = g);
|
|
1666
1715
|
});
|
|
1667
1716
|
});
|
|
1668
|
-
}), (v,
|
|
1717
|
+
}), (v, g) => (openBlock(), createElementBlock(Fragment, null, [
|
|
1669
1718
|
createElementVNode("div", {
|
|
1670
1719
|
class: normalizeClass(`tool-panel ${v.viewMode}`)
|
|
1671
1720
|
}, [
|
|
@@ -1675,46 +1724,46 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1675
1724
|
key: 0,
|
|
1676
1725
|
class: normalizeClass(["switch-btn", `${i.value && "active"}`]),
|
|
1677
1726
|
onClick: u
|
|
1678
|
-
},
|
|
1727
|
+
}, g[5] || (g[5] = [
|
|
1679
1728
|
createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
|
|
1680
1729
|
createElementVNode("div", { class: "button-text" }, "测距", -1)
|
|
1681
1730
|
]), 2)) : createCommentVNode("", !0),
|
|
1682
1731
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1683
1732
|
key: 1,
|
|
1684
|
-
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot ||
|
|
1733
|
+
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot || r.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
|
|
1685
1734
|
onClick: m
|
|
1686
|
-
},
|
|
1735
|
+
}, g[6] || (g[6] = [
|
|
1687
1736
|
createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
|
|
1688
1737
|
createElementVNode("div", { class: "button-text" }, "绿点", -1)
|
|
1689
1738
|
]), 2)) : createCommentVNode("", !0),
|
|
1690
1739
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1691
1740
|
key: 2,
|
|
1692
1741
|
class: normalizeClass(`switch-btn ${v.mapTileMode === unref(BaseMapType).satellite && "active"}`),
|
|
1693
|
-
onClick:
|
|
1694
|
-
},
|
|
1742
|
+
onClick: g[0] || (g[0] = (k) => d())
|
|
1743
|
+
}, g[7] || (g[7] = [
|
|
1695
1744
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1696
1745
|
createElementVNode("div", { class: "button-text" }, "图层", -1)
|
|
1697
1746
|
]), 2)) : createCommentVNode("", !0),
|
|
1698
1747
|
v.vehicleMode === "truck" ? (openBlock(), createElementBlock("div", {
|
|
1699
1748
|
key: 3,
|
|
1700
1749
|
class: normalizeClass(`switch-btn ${v.mapTileMode === unref(BaseMapType).satellite && "active"}`),
|
|
1701
|
-
onClick:
|
|
1702
|
-
},
|
|
1750
|
+
onClick: g[1] || (g[1] = (k) => d())
|
|
1751
|
+
}, g[8] || (g[8] = [
|
|
1703
1752
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1704
1753
|
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
1705
1754
|
]), 2)) : createCommentVNode("", !0),
|
|
1706
1755
|
v.showTrackLayer ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1707
1756
|
createElementVNode("div", {
|
|
1708
1757
|
class: "switch-btn multiple",
|
|
1709
|
-
onClick:
|
|
1710
|
-
},
|
|
1758
|
+
onClick: g[2] || (g[2] = (k) => unref(playTrack)(unref(currentTrackId), 1))
|
|
1759
|
+
}, g[9] || (g[9] = [
|
|
1711
1760
|
createElementVNode("i", { class: "map-iconfont icon-play" }, null, -1),
|
|
1712
1761
|
createElementVNode("div", { class: "button-text" }, "播放轨迹", -1)
|
|
1713
1762
|
])),
|
|
1714
1763
|
createElementVNode("div", {
|
|
1715
1764
|
class: "switch-btn multiple",
|
|
1716
|
-
onClick:
|
|
1717
|
-
},
|
|
1765
|
+
onClick: g[3] || (g[3] = (k) => unref(resetTrackView)())
|
|
1766
|
+
}, g[10] || (g[10] = [
|
|
1718
1767
|
createElementVNode("i", { class: "map-iconfont icon-center" }, null, -1),
|
|
1719
1768
|
createElementVNode("div", { class: "button-text" }, "轨迹居中", -1)
|
|
1720
1769
|
]))
|
|
@@ -1726,15 +1775,15 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1726
1775
|
createElementVNode("div", {
|
|
1727
1776
|
class: normalizeClass(["switch-btn", `${i.value && "active"}`]),
|
|
1728
1777
|
onClick: u
|
|
1729
|
-
},
|
|
1778
|
+
}, g[11] || (g[11] = [
|
|
1730
1779
|
createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
|
|
1731
1780
|
createElementVNode("div", { class: "button-text" }, "测距", -1)
|
|
1732
1781
|
]), 2),
|
|
1733
1782
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1734
1783
|
key: 0,
|
|
1735
|
-
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot ||
|
|
1784
|
+
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot || r.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
|
|
1736
1785
|
onClick: m
|
|
1737
|
-
},
|
|
1786
|
+
}, g[12] || (g[12] = [
|
|
1738
1787
|
createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
|
|
1739
1788
|
createElementVNode("div", { class: "button-text" }, "绿点", -1)
|
|
1740
1789
|
]), 2)) : createCommentVNode("", !0)
|
|
@@ -1742,7 +1791,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1742
1791
|
createElementVNode("div", {
|
|
1743
1792
|
class: normalizeClass(["switch-btn", { active: v.mapTileMode === unref(BaseMapType).satellite }]),
|
|
1744
1793
|
onClick: d
|
|
1745
|
-
},
|
|
1794
|
+
}, g[13] || (g[13] = [
|
|
1746
1795
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1747
1796
|
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
1748
1797
|
]), 2)
|
|
@@ -1754,27 +1803,27 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1754
1803
|
ref_key: "measureRef",
|
|
1755
1804
|
ref: c,
|
|
1756
1805
|
visible: i.value,
|
|
1757
|
-
"onUpdate:visible":
|
|
1758
|
-
onClose:
|
|
1806
|
+
"onUpdate:visible": g[4] || (g[4] = (k) => i.value = k),
|
|
1807
|
+
onClose: h,
|
|
1759
1808
|
"view-mode": v.viewMode
|
|
1760
1809
|
}, null, 8, ["visible", "view-mode"])) : createCommentVNode("", !0)
|
|
1761
1810
|
])
|
|
1762
1811
|
], 64));
|
|
1763
1812
|
}
|
|
1764
|
-
}), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
1813
|
+
}), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-79266143"]]), _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1765
1814
|
__name: "scaleLine",
|
|
1766
1815
|
setup(e, { expose: t }) {
|
|
1767
|
-
const
|
|
1816
|
+
const o = inject("mapInstance");
|
|
1768
1817
|
return t({
|
|
1769
|
-
setScaleLine: (
|
|
1818
|
+
setScaleLine: (l) => {
|
|
1770
1819
|
var c;
|
|
1771
|
-
|
|
1772
|
-
const
|
|
1773
|
-
units:
|
|
1820
|
+
l || (l = "metric");
|
|
1821
|
+
const r = new ScaleLine$1({
|
|
1822
|
+
units: l
|
|
1774
1823
|
}), i = document.getElementById("scale-line-container");
|
|
1775
|
-
i && (
|
|
1824
|
+
i && (r.setTarget(i), (c = o == null ? void 0 : o.value) == null || c.addControl(r));
|
|
1776
1825
|
}
|
|
1777
|
-
}), (
|
|
1826
|
+
}), (l, r) => (openBlock(), createElementBlock("div", _hoisted_1$2));
|
|
1778
1827
|
}
|
|
1779
1828
|
}), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-d666f80d"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1780
1829
|
__name: "zoomControl",
|
|
@@ -1784,22 +1833,22 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1784
1833
|
}
|
|
1785
1834
|
},
|
|
1786
1835
|
setup(e) {
|
|
1787
|
-
const t = inject("mapInstance"),
|
|
1836
|
+
const t = inject("mapInstance"), o = () => {
|
|
1788
1837
|
if (!t.value) return;
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1791
|
-
},
|
|
1838
|
+
const l = t.value.getView(), r = l.getZoom();
|
|
1839
|
+
r && l.setZoom(r + 1);
|
|
1840
|
+
}, n = () => {
|
|
1792
1841
|
if (!t.value) return;
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1842
|
+
const l = t.value.getView(), r = l.getZoom();
|
|
1843
|
+
r && l.setZoom(r - 1);
|
|
1795
1844
|
};
|
|
1796
|
-
return (
|
|
1845
|
+
return (l, r) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1797
1846
|
createElementVNode("div", {
|
|
1798
|
-
onClick:
|
|
1847
|
+
onClick: o,
|
|
1799
1848
|
class: "button big-button"
|
|
1800
1849
|
}, "+"),
|
|
1801
1850
|
createElementVNode("div", {
|
|
1802
|
-
onClick:
|
|
1851
|
+
onClick: n,
|
|
1803
1852
|
class: "button small-button"
|
|
1804
1853
|
}, "-")
|
|
1805
1854
|
]));
|
|
@@ -1811,14 +1860,14 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1811
1860
|
mapTile: { default: BaseMapType.satellite }
|
|
1812
1861
|
},
|
|
1813
1862
|
setup(e) {
|
|
1814
|
-
useCssVars((
|
|
1815
|
-
"0d38823b":
|
|
1863
|
+
useCssVars((r) => ({
|
|
1864
|
+
"0d38823b": l.value
|
|
1816
1865
|
}));
|
|
1817
|
-
const t = e,
|
|
1818
|
-
return (
|
|
1866
|
+
const t = e, o = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? `map/tdt-copyright-h${t.mapTile === BaseMapType.satellite ? "-w" : ""}.svg` : `map/tdt-copyright-v${t.mapTile === BaseMapType.satellite ? "-w" : ""}.svg`), n = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "400px" : "168px"), l = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "auto auto 0 5px" : "0 auto auto 5px");
|
|
1867
|
+
return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1819
1868
|
createElementVNode("img", {
|
|
1820
|
-
src: unref(CDN_URL) +
|
|
1821
|
-
width:
|
|
1869
|
+
src: unref(CDN_URL) + o.value,
|
|
1870
|
+
width: n.value,
|
|
1822
1871
|
class: "logo",
|
|
1823
1872
|
alt: ""
|
|
1824
1873
|
}, null, 8, _hoisted_2)
|
|
@@ -1836,31 +1885,31 @@ cameraImage.crossOrigin = "anonymous";
|
|
|
1836
1885
|
const loadImage = new Image();
|
|
1837
1886
|
loadImage.src = `${CDN_URL}/map/map-load.svg`;
|
|
1838
1887
|
loadImage.crossOrigin = "anonymous";
|
|
1839
|
-
const setTruckStyle = (e, t,
|
|
1840
|
-
renderer: (
|
|
1841
|
-
const i =
|
|
1888
|
+
const setTruckStyle = (e, t, o, n) => new Style({
|
|
1889
|
+
renderer: (l, r) => {
|
|
1890
|
+
const i = r.context;
|
|
1842
1891
|
i.save();
|
|
1843
1892
|
let c = 1;
|
|
1844
1893
|
i.scale(c, c);
|
|
1845
|
-
let [s, m] =
|
|
1894
|
+
let [s, m] = l;
|
|
1846
1895
|
s = Number(s) / c - 20, m = Number(m) / c;
|
|
1847
1896
|
const d = s - 70, u = m - 68;
|
|
1848
|
-
let
|
|
1849
|
-
const p = 56,
|
|
1897
|
+
let h = 180;
|
|
1898
|
+
const p = 56, f = "#FFFFFF";
|
|
1850
1899
|
let v = 176;
|
|
1851
|
-
const
|
|
1852
|
-
let
|
|
1853
|
-
|
|
1854
|
-
const
|
|
1855
|
-
if (i.fillText(
|
|
1856
|
-
const
|
|
1857
|
-
let
|
|
1858
|
-
|
|
1859
|
-
|
|
1900
|
+
const g = 52;
|
|
1901
|
+
let k = "#164AFF", M = "#FFFFFF";
|
|
1902
|
+
o === CAR_COLOR.YELLOW ? (v = 176, k = "#FFC81E", M = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (h = 200, v = 196, k = "#8FED7C", M = "rgba(0,0,0,0.88)"), n != null && n.length && (h += n.length * 56), fillRectRadius(i, d, u, h, p, f), fillRectRadius(i, d + 2, u + 2, v, g, k), o === CAR_COLOR.Y_GREEN && fillRectRadius(i, d + 2, u + 2, 68, g, "#FFC81E"), i.save(), i.restore(), i.fillStyle = M, i.font = "bold 28px Arial", i.textAlign = "left", i.textBaseline = "middle";
|
|
1903
|
+
const b = `${t.slice(0, 2) + " · " + t.slice(2)}`;
|
|
1904
|
+
if (i.fillText(b, d + 12, u + 32), i.save(), i.restore(), n != null && n.length) {
|
|
1905
|
+
const V = i.measureText(b).width + 12;
|
|
1906
|
+
let F = 0;
|
|
1907
|
+
n.forEach(($) => {
|
|
1908
|
+
$ === DEVICE_TYPE.CAMERA && (i.drawImage(cameraImage, s - 54 + V + F * 56, m - 64, 50, 50), ++F), $ === DEVICE_TYPE.LOAD && (i.drawImage(loadImage, s - 54 + V + F * 56, m - 64, 50, 50), ++F);
|
|
1860
1909
|
});
|
|
1861
1910
|
}
|
|
1862
|
-
const
|
|
1863
|
-
i.drawImage(
|
|
1911
|
+
const E = dotImage;
|
|
1912
|
+
i.drawImage(E, s + h / 2 - 90, m, 50 / c, 50 / c), i.restore();
|
|
1864
1913
|
}
|
|
1865
1914
|
}), mapInstance$2 = ref(), renderDashboardSetInstance = (e) => mapInstance$2.value = e;
|
|
1866
1915
|
ref([]);
|
|
@@ -1868,15 +1917,15 @@ let truckMarkerList = [], trucksVectorSource;
|
|
|
1868
1917
|
const renderTrucksMarker = (e) => {
|
|
1869
1918
|
if (deleteAllTruckMarkers(), !!mapInstance$2.value)
|
|
1870
1919
|
return e.forEach((t) => {
|
|
1871
|
-
const
|
|
1872
|
-
geometry: new Point(fromLonLat(
|
|
1920
|
+
const o = formatUtils.convertSixHundredThousandToLatLng(t.lon, t.lat), n = new Feature({
|
|
1921
|
+
geometry: new Point(fromLonLat(o))
|
|
1873
1922
|
});
|
|
1874
|
-
|
|
1923
|
+
n.set("data", t), n.setStyle(
|
|
1875
1924
|
setTruckStyle(!1, t.vno, t.vclColor ?? 0, t.icons ?? [])
|
|
1876
1925
|
), truckMarkerList.push({
|
|
1877
1926
|
name: t.vno,
|
|
1878
|
-
lonlat:
|
|
1879
|
-
feature:
|
|
1927
|
+
lonlat: o,
|
|
1928
|
+
feature: n
|
|
1880
1929
|
});
|
|
1881
1930
|
}), trucksVectorSource = new VectorSource({
|
|
1882
1931
|
features: truckMarkerList.map((t) => t.feature)
|
|
@@ -1889,31 +1938,31 @@ const renderTrucksMarker = (e) => {
|
|
|
1889
1938
|
}), truckMarkerList = [];
|
|
1890
1939
|
}, mapInstance$1 = ref(), renderTruckSetInstance = (e) => mapInstance$1.value = e, vehicle = ref(null), focusShipData = ref(), currentTruckOverlay = ref(null), findTruck = async (e, t) => {
|
|
1891
1940
|
if (!mapInstance$1.value || (focusShipData.value = e, !(e != null && e.lon && (e != null && e.lat)))) return;
|
|
1892
|
-
const
|
|
1893
|
-
currentTruckOverlay.value = e ? drawTruckIcon(e.vno,
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1941
|
+
const o = Math.abs(Number(e.lon)) > 180 ? formatUtils.convertSixHundredThousandToLatLng(e.lon, e.lat) : [e.lon, e.lat], n = mapInstance$1.value.getPixelFromCoordinate(transform(o, projection.data, projection.mercator));
|
|
1942
|
+
currentTruckOverlay.value = e ? drawTruckIcon(e.vno, n, (e == null ? void 0 : e.drc) ?? "", t) ?? null : null;
|
|
1943
|
+
const l = mapInstance$1.value.getView(), r = new Point(o);
|
|
1944
|
+
l.setCenter(transform(r.getCoordinates(), projection.data, projection.mercator));
|
|
1896
1945
|
}, clearAllTruck = () => {
|
|
1897
1946
|
vehicle.value.clearAllShip();
|
|
1898
|
-
}, drawTruckIcon = (e, t,
|
|
1899
|
-
let
|
|
1947
|
+
}, drawTruckIcon = (e, t, o, n) => {
|
|
1948
|
+
let l = `<div id="${e}" class="ol-custom-content truck-custom-content" style="width: 80px; height: 80px; transform: rotate(${o}deg);">
|
|
1900
1949
|
<img src="${CDN_URL}map/car-icon.gif" width="100%" height="100%" />
|
|
1901
1950
|
</div>`;
|
|
1902
|
-
return
|
|
1951
|
+
return n && (l += n), drawCustomContent(e, t, l, "center-center");
|
|
1903
1952
|
}, removeTruckIcon = () => {
|
|
1904
1953
|
var t;
|
|
1905
1954
|
const e = (t = currentTruckOverlay.value) == null ? void 0 : t.getElement();
|
|
1906
1955
|
e && (e.innerHTML = "");
|
|
1907
1956
|
}, zoomTruckIcon = () => {
|
|
1908
|
-
var
|
|
1957
|
+
var r;
|
|
1909
1958
|
if (!mapInstance$1.value) return;
|
|
1910
|
-
const e = mapInstance$1.value.getView().getZoom(), t = 120,
|
|
1911
|
-
function
|
|
1912
|
-
return i < 14 ?
|
|
1959
|
+
const e = mapInstance$1.value.getView().getZoom(), t = 120, o = 60;
|
|
1960
|
+
function n(i) {
|
|
1961
|
+
return i < 14 ? o : i >= 14 && i <= 18 ? Math.round((i - 14) * (t - o) / 4 + o) : t;
|
|
1913
1962
|
}
|
|
1914
|
-
const
|
|
1915
|
-
(
|
|
1916
|
-
i.style.width = `${
|
|
1963
|
+
const l = n(e);
|
|
1964
|
+
(r = document.querySelectorAll(".truck-custom-content")) == null || r.forEach((i) => {
|
|
1965
|
+
i.style.width = `${l}px`, i.style.height = `${l}px`;
|
|
1917
1966
|
});
|
|
1918
1967
|
}, mapInstance = ref(), drawPolygonSetInstance = (e) => mapInstance.value = e;
|
|
1919
1968
|
let layerState = "drawn", drawnState = "undrawn";
|
|
@@ -1959,96 +2008,96 @@ function createHelpTooltip() {
|
|
|
1959
2008
|
}
|
|
1960
2009
|
let squareLimitError = !1, lineLimitError = !1;
|
|
1961
2010
|
const validateSquareLimit = (e) => {
|
|
1962
|
-
let
|
|
2011
|
+
let o = 1 / 0, n = -1 / 0, l = 1 / 0, r = -1 / 0;
|
|
1963
2012
|
e == null || e.forEach((s) => {
|
|
1964
2013
|
const m = transform(s, projection.mercator, projection.data), d = m[0], u = m[1];
|
|
1965
|
-
|
|
2014
|
+
o = Math.min(o, u), n = Math.max(n, u), l = Math.min(l, d), r = Math.max(r, d);
|
|
1966
2015
|
});
|
|
1967
|
-
const i = (
|
|
2016
|
+
const i = (n - o) * 111, c = (r - l) * 111;
|
|
1968
2017
|
squareLimitError = i > 150 || c > 150;
|
|
1969
2018
|
};
|
|
1970
2019
|
let storeFeature, callbackFunction = null;
|
|
1971
2020
|
const addInteraction = (e) => {
|
|
1972
|
-
var
|
|
1973
|
-
e && (callbackFunction = e), drawVector || init(), drawnState = "undrawn", layerState = "drawn", (
|
|
2021
|
+
var o, n;
|
|
2022
|
+
showDrawLayer.value = !0, e && (callbackFunction = e), drawVector || init(), drawnState = "undrawn", layerState = "drawn", drawVector && ((o = mapInstance.value) == null || o.addLayer(drawVector)), draw = new Draw({
|
|
1974
2023
|
type: "Polygon",
|
|
1975
2024
|
source,
|
|
1976
2025
|
trace: !0,
|
|
1977
2026
|
style: [drawPolygonStyle.drawing, circleStyle]
|
|
1978
|
-
}), (
|
|
2027
|
+
}), storeFeature || ((n = mapInstance.value) == null || n.addInteraction(draw), createHelpTooltip()), createMeasureTooltip();
|
|
1979
2028
|
let t;
|
|
1980
|
-
draw.on("drawstart", function(
|
|
1981
|
-
var
|
|
1982
|
-
layerState = "drawn", sketch =
|
|
1983
|
-
const c = i.target, s = formatUtils.formatArea(c, LENGTH_UNIT.NM), d = c.getCoordinates()[0], u = new LineString([d[d.length - 2], d[d.length - 1]]),
|
|
2029
|
+
draw.on("drawstart", function(l) {
|
|
2030
|
+
var r;
|
|
2031
|
+
layerState = "drawn", sketch = l.feature, t = (r = sketch.getGeometry()) == null ? void 0 : r.on("change", function(i) {
|
|
2032
|
+
const c = i.target, s = formatUtils.formatArea(c, LENGTH_UNIT.NM), d = c.getCoordinates()[0], u = new LineString([d[d.length - 2], d[d.length - 1]]), h = formatUtils.formatLength(u, LENGTH_UNIT.NM);
|
|
1984
2033
|
if (lineLimitError = Number(getLength(u) / 1e3) > 150, validateSquareLimit(d), measureTooltipElement && s && (measureTooltipElement.innerHTML = `
|
|
1985
2034
|
<span class="text">面积:${s}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1986
2035
|
`), helpTooltipElement && s) {
|
|
1987
2036
|
let p = "";
|
|
1988
2037
|
parseFloat(s) > 0 && (p = `
|
|
1989
2038
|
<div class="text ${squareLimitError ? "error" : ""}">面积:${s}${squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</div>`), helpTooltipElement.innerHTML = `${p}
|
|
1990
|
-
<span class="text ${lineLimitError ? "error" : ""}">线段${d.length - 2}:${
|
|
2039
|
+
<span class="text ${lineLimitError ? "error" : ""}">线段${d.length - 2}:${h}${lineLimitError ? '<span class="error pl-4">超出可以绘画的距离</span>' : ""}</span>
|
|
1991
2040
|
<div><span class="text">单击继续,双击结束</span></div>
|
|
1992
2041
|
`;
|
|
1993
2042
|
}
|
|
1994
2043
|
}), drawnState = "drawing";
|
|
1995
|
-
}), draw.on("drawend", function(
|
|
1996
|
-
if (
|
|
1997
|
-
storeFeature =
|
|
1998
|
-
const
|
|
1999
|
-
|
|
2044
|
+
}), draw.on("drawend", function(l) {
|
|
2045
|
+
if (l.feature.getGeometry()) {
|
|
2046
|
+
storeFeature = l.feature;
|
|
2047
|
+
const r = endFn(l.feature);
|
|
2048
|
+
r != null && r.length && callbackFunction && callbackFunction(r);
|
|
2000
2049
|
}
|
|
2001
2050
|
if (sketch = null, measureTooltipElement = null, createMeasureTooltip(), t && unByKey(t), drawnState = "drawend", draw && mapInstance.value) {
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2051
|
+
const r = mapInstance.value.getInteractions().getArray().find((i) => getUid(i) === getUid(draw));
|
|
2052
|
+
r && mapInstance.value.removeInteraction(r), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement);
|
|
2004
2053
|
}
|
|
2005
2054
|
});
|
|
2006
2055
|
}, removeInteraction = () => {
|
|
2007
|
-
var e, t,
|
|
2056
|
+
var e, t, o;
|
|
2008
2057
|
if (mapInstance.value) {
|
|
2009
|
-
if (document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach((
|
|
2010
|
-
var
|
|
2011
|
-
(
|
|
2012
|
-
}), source.clear(), (e = mapInstance.value) == null || e.removeLayer(drawVector), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement), ((t = mapInstance.value) == null ? void 0 : t.getTargetElement()).style.cursor = "", document.querySelector("#map").style.cursor = "", draw) {
|
|
2013
|
-
const
|
|
2014
|
-
|
|
2058
|
+
if (showDrawLayer.value = !1, document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach((n) => {
|
|
2059
|
+
var l;
|
|
2060
|
+
(l = n == null ? void 0 : n.parentNode) == null || l.removeChild(n);
|
|
2061
|
+
}), source.clear(), drawVector && ((e = mapInstance.value) == null || e.removeLayer(drawVector)), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement), ((t = mapInstance.value) == null ? void 0 : t.getTargetElement()).style.cursor = "", document.querySelector("#map").style.cursor = "", draw) {
|
|
2062
|
+
const n = mapInstance.value.getInteractions().getArray().find((l) => getUid(l) === getUid(draw));
|
|
2063
|
+
n && ((o = mapInstance.value) == null || o.removeInteraction(n));
|
|
2015
2064
|
}
|
|
2016
2065
|
drawnState = "undrawn", layerState = "destroyed";
|
|
2017
2066
|
}
|
|
2018
2067
|
}, endFn = (e) => {
|
|
2019
|
-
var t,
|
|
2068
|
+
var t, o, n;
|
|
2020
2069
|
if (e.getGeometry()) {
|
|
2021
|
-
const
|
|
2070
|
+
const l = [], i = e.getGeometry().getCoordinates();
|
|
2022
2071
|
(t = i[0]) == null || t.forEach((s) => {
|
|
2023
|
-
|
|
2072
|
+
l.push(transform(s, projection.mercator, projection.data));
|
|
2024
2073
|
});
|
|
2025
2074
|
const c = i[0][i[0].length - 2];
|
|
2026
|
-
if (c && measureTooltip.setPosition(c), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), (
|
|
2075
|
+
if (c && measureTooltip.setPosition(c), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), (o = document.querySelector(".delete-icon")) == null || o.addEventListener("click", () => {
|
|
2027
2076
|
reset();
|
|
2028
2077
|
}), !lineLimitError && !squareLimitError)
|
|
2029
|
-
return
|
|
2030
|
-
draw && ((
|
|
2078
|
+
return l;
|
|
2079
|
+
draw && ((n = mapInstance.value) == null || n.removeInteraction(draw)), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement);
|
|
2031
2080
|
}
|
|
2032
2081
|
}, initFeature = (e) => {
|
|
2033
|
-
var t,
|
|
2082
|
+
var t, o;
|
|
2034
2083
|
if (e && (callbackFunction = e), layerState = "drawn", storeFeature) {
|
|
2035
|
-
const
|
|
2036
|
-
if (!
|
|
2037
|
-
const
|
|
2084
|
+
const n = storeFeature.getGeometry();
|
|
2085
|
+
if (!n) return;
|
|
2086
|
+
const l = formatUtils.formatArea(n, LENGTH_UNIT.NM);
|
|
2038
2087
|
measureTooltipElement && (measureTooltipElement.innerHTML = `
|
|
2039
|
-
<span class="text">面积:${
|
|
2040
|
-
`), (t = drawVector.getSource()) == null || t.addFeature(storeFeature);
|
|
2041
|
-
const
|
|
2042
|
-
|
|
2088
|
+
<span class="text">面积:${l}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
2089
|
+
`), drawVector && ((t = drawVector.getSource()) == null || t.addFeature(storeFeature));
|
|
2090
|
+
const r = endFn(storeFeature);
|
|
2091
|
+
r != null && r.length && callbackFunction && callbackFunction(r);
|
|
2043
2092
|
const i = getCenter(storeFeature.getGeometry().getExtent());
|
|
2044
|
-
(
|
|
2093
|
+
(o = mapInstance.value) == null || o.getView().setCenter(i);
|
|
2045
2094
|
}
|
|
2046
2095
|
}, pointerMoveHandler = function(e) {
|
|
2047
|
-
var
|
|
2096
|
+
var o;
|
|
2048
2097
|
if (e.dragging)
|
|
2049
2098
|
return;
|
|
2050
2099
|
let t = "点击选择起点";
|
|
2051
|
-
sketch && (t = "单击继续,双击结束"), helpTooltipElement && (helpTooltipElement.innerHTML = t, helpTooltip.setPosition(e.coordinate), helpTooltipElement.classList.remove("hidden")), layerState === "drawn" && (((
|
|
2100
|
+
sketch && (t = "单击继续,双击结束"), helpTooltipElement && (helpTooltipElement.innerHTML = t, helpTooltip.setPosition(e.coordinate), helpTooltipElement.classList.remove("hidden")), layerState === "drawn" && (((o = mapInstance.value) == null ? void 0 : o.getTargetElement()).style.cursor = "crosshair");
|
|
2052
2101
|
}, init = () => {
|
|
2053
2102
|
mapInstance.value && (circleStyle = new Style({
|
|
2054
2103
|
image: new CircleStyle({
|
|
@@ -2070,33 +2119,36 @@ const addInteraction = (e) => {
|
|
|
2070
2119
|
}), mapInstance.value.on(["dblclick"], function(e) {
|
|
2071
2120
|
drawnState !== "undrawn" && (e.stopPropagation(), e.preventDefault());
|
|
2072
2121
|
}));
|
|
2122
|
+
}, destroy = () => {
|
|
2123
|
+
storeFeature = null, drawVector = null, removeInteraction();
|
|
2073
2124
|
}, reset = () => {
|
|
2074
|
-
|
|
2125
|
+
destroy(), addInteraction();
|
|
2075
2126
|
}, drawPolygonTool = {
|
|
2076
2127
|
addInteraction,
|
|
2077
2128
|
removeInteraction,
|
|
2078
2129
|
initFeature,
|
|
2079
|
-
reset
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2130
|
+
reset,
|
|
2131
|
+
destroy
|
|
2132
|
+
}, setPointStyle = (e, t, o) => {
|
|
2133
|
+
const n = new Image();
|
|
2134
|
+
n.crossOrigin = "anonymous";
|
|
2135
|
+
const l = new Image();
|
|
2136
|
+
l.crossOrigin = "anonymous";
|
|
2137
|
+
const { color: r, url: i, activeUrl: c, activeColor: s, imgWidth: m, imgHeight: d } = o;
|
|
2138
|
+
return (c || i) && (e ? l.src = CDN_URL + (c || i) : n.src = CDN_URL + (i || c)), new Style({
|
|
2139
|
+
renderer: (u, h) => {
|
|
2140
|
+
const p = h.context;
|
|
2089
2141
|
p.save();
|
|
2090
|
-
const
|
|
2091
|
-
let [v,
|
|
2092
|
-
if (v = Number(v),
|
|
2093
|
-
p.font = `${12 *
|
|
2094
|
-
const
|
|
2095
|
-
fillRectRadius(p, M,
|
|
2142
|
+
const f = window.devicePixelRatio || 1;
|
|
2143
|
+
let [v, g] = u;
|
|
2144
|
+
if (v = Number(v), g = Number(g), t) {
|
|
2145
|
+
p.font = `${12 * f}px Arial`;
|
|
2146
|
+
const k = p.measureText(t).width, M = v - k / 2 - (f <= 1 ? 10 : -3), b = g + (f <= 1 ? 0 : 10) + 6 * f, E = k + 4, V = 16 * f, F = e && s || r;
|
|
2147
|
+
fillRectRadius(p, M, b + (f <= 1 ? 6 : 13 * f), E, V, F), p.save(), p.restore(), p.fillStyle = e ? "#FFFFFF" : "#000000", p.textAlign = "center", p.textBaseline = "middle", p.fillText(t, M + (k + 4) / 2, b + (f <= 1 ? 15 : 22 * f)), p.save(), p.restore();
|
|
2096
2148
|
}
|
|
2097
2149
|
if (i || c) {
|
|
2098
|
-
const
|
|
2099
|
-
p.drawImage(
|
|
2150
|
+
const k = e ? l : n;
|
|
2151
|
+
p.drawImage(k, v - (m || k.width) / 2, g - (d || k.height) / 2, 30 * f, 30 * f);
|
|
2100
2152
|
}
|
|
2101
2153
|
p.restore();
|
|
2102
2154
|
}
|
|
@@ -2109,39 +2161,39 @@ class PointMarkerClass {
|
|
|
2109
2161
|
* 配置渲染点的样式
|
|
2110
2162
|
* @param options
|
|
2111
2163
|
*/
|
|
2112
|
-
constructor(t,
|
|
2113
|
-
|
|
2164
|
+
constructor(t, o) {
|
|
2165
|
+
I(this, "mapInstance");
|
|
2114
2166
|
// 渲染的数据
|
|
2115
|
-
|
|
2167
|
+
I(this, "pointMarkerList", []);
|
|
2116
2168
|
// 绘制点渲染层数据
|
|
2117
|
-
|
|
2169
|
+
I(this, "pointsVectorSource");
|
|
2118
2170
|
// 当前高亮的数据
|
|
2119
|
-
|
|
2120
|
-
|
|
2171
|
+
I(this, "highlightPoint");
|
|
2172
|
+
I(this, "pointLayer");
|
|
2121
2173
|
// 颜色等其他设置
|
|
2122
|
-
|
|
2174
|
+
I(this, "options");
|
|
2123
2175
|
// 使用坐标点区域自动缩放地图层级
|
|
2124
|
-
|
|
2125
|
-
var
|
|
2176
|
+
I(this, "resetPointsView", (t, o = 0.02) => {
|
|
2177
|
+
var i;
|
|
2126
2178
|
if (!this.mapInstance || t.length === 0) return;
|
|
2127
|
-
const n = (
|
|
2179
|
+
const n = (i = this.mapInstance) == null ? void 0 : i.getView();
|
|
2128
2180
|
if (!n) return;
|
|
2129
2181
|
const r = t.map(
|
|
2130
|
-
(
|
|
2131
|
-
).reduce((
|
|
2132
|
-
Math.min(
|
|
2133
|
-
Math.min(
|
|
2134
|
-
Math.max(
|
|
2135
|
-
Math.max(
|
|
2182
|
+
(c) => transform(c, projection.data, projection.mercator)
|
|
2183
|
+
).reduce((c, s) => [
|
|
2184
|
+
Math.min(c[0], s[0]),
|
|
2185
|
+
Math.min(c[1], s[1]),
|
|
2186
|
+
Math.max(c[2], s[0]),
|
|
2187
|
+
Math.max(c[3], s[1])
|
|
2136
2188
|
], [1 / 0, 1 / 0, -1 / 0, -1 / 0]);
|
|
2137
2189
|
try {
|
|
2138
|
-
const
|
|
2139
|
-
n.fit(
|
|
2140
|
-
} catch (
|
|
2141
|
-
console.error("Failed to zoom to points:",
|
|
2190
|
+
const c = buffer(r, Math.max(r[2] - r[0], r[3] - r[1]) * o);
|
|
2191
|
+
n.fit(c);
|
|
2192
|
+
} catch (c) {
|
|
2193
|
+
console.error("Failed to zoom to points:", c);
|
|
2142
2194
|
}
|
|
2143
2195
|
});
|
|
2144
|
-
this.mapInstance = t, this.options =
|
|
2196
|
+
this.mapInstance = t, this.options = o;
|
|
2145
2197
|
}
|
|
2146
2198
|
/**
|
|
2147
2199
|
* 渲染
|
|
@@ -2159,49 +2211,49 @@ class PointMarkerClass {
|
|
|
2159
2211
|
* pointType
|
|
2160
2212
|
*/
|
|
2161
2213
|
renderPointMarker(t) {
|
|
2162
|
-
if (!this.mapInstance) return;
|
|
2163
|
-
let
|
|
2164
|
-
t.forEach((
|
|
2165
|
-
var
|
|
2166
|
-
const
|
|
2167
|
-
if (((
|
|
2168
|
-
|
|
2169
|
-
id:
|
|
2170
|
-
name:
|
|
2171
|
-
lonlat: [Number(
|
|
2172
|
-
pointType:
|
|
2214
|
+
if (this.deleteAllPointMarkers(), !this.mapInstance) return;
|
|
2215
|
+
let o = {};
|
|
2216
|
+
t.forEach((n) => {
|
|
2217
|
+
var r;
|
|
2218
|
+
const l = [n.lon, n.lat];
|
|
2219
|
+
if (((r = this.highlightPoint) == null ? void 0 : r.id) === n.id)
|
|
2220
|
+
o = {
|
|
2221
|
+
id: n.id,
|
|
2222
|
+
name: n.name,
|
|
2223
|
+
lonlat: [Number(n.lon), Number(n.lat)],
|
|
2224
|
+
pointType: n.pointType
|
|
2173
2225
|
};
|
|
2174
2226
|
else {
|
|
2175
|
-
const i = this.getFeature(
|
|
2227
|
+
const i = this.getFeature(n, l);
|
|
2176
2228
|
this.pointMarkerList.push({
|
|
2177
|
-
id:
|
|
2178
|
-
name:
|
|
2179
|
-
lonlat: [Number(
|
|
2229
|
+
id: n.id,
|
|
2230
|
+
name: n.name,
|
|
2231
|
+
lonlat: [Number(n.lon), Number(n.lat)],
|
|
2180
2232
|
feature: i,
|
|
2181
|
-
pointType:
|
|
2233
|
+
pointType: n.pointType
|
|
2182
2234
|
});
|
|
2183
2235
|
}
|
|
2184
|
-
}),
|
|
2185
|
-
features: [...this.pointMarkerList.map((
|
|
2236
|
+
}), o && o.lonlat && (o.feature = this.getFeature(o, o.lonlat), this.pointMarkerList.push(o)), this.pointsVectorSource = new VectorSource({
|
|
2237
|
+
features: [...this.pointMarkerList.map((n) => n.feature)]
|
|
2186
2238
|
}), this.pointLayer = new VectorLayer({
|
|
2187
2239
|
source: this.pointsVectorSource
|
|
2188
2240
|
}), this.mapInstance.addLayer(this.pointLayer);
|
|
2189
2241
|
}
|
|
2190
2242
|
// 删除 未选中的渲染点
|
|
2191
2243
|
deleteAllPointMarkers(t) {
|
|
2192
|
-
this.pointMarkerList.forEach((
|
|
2193
|
-
var
|
|
2194
|
-
|
|
2244
|
+
this.pointMarkerList.forEach((o) => {
|
|
2245
|
+
var n;
|
|
2246
|
+
o.feature && t !== o.id && ((n = this.pointsVectorSource) == null || n.removeFeature(o.feature));
|
|
2195
2247
|
});
|
|
2196
2248
|
}
|
|
2197
2249
|
// 取消高亮
|
|
2198
2250
|
cancelHighlightTruckMarker() {
|
|
2199
2251
|
if (!this.highlightPoint)
|
|
2200
2252
|
return;
|
|
2201
|
-
const { id: t, name:
|
|
2202
|
-
this.highlightPoint = void 0, this.pointMarkerList.find((
|
|
2203
|
-
|
|
2204
|
-
setPointStyle(!1,
|
|
2253
|
+
const { id: t, name: o } = this.highlightPoint;
|
|
2254
|
+
this.highlightPoint = void 0, this.pointMarkerList.find((n) => {
|
|
2255
|
+
n.id === t && n.feature.setStyle(
|
|
2256
|
+
setPointStyle(!1, o, this.options)
|
|
2205
2257
|
);
|
|
2206
2258
|
});
|
|
2207
2259
|
}
|
|
@@ -2223,24 +2275,24 @@ class PointMarkerClass {
|
|
|
2223
2275
|
*/
|
|
2224
2276
|
highlightPointMarker(t) {
|
|
2225
2277
|
if (!this.mapInstance) return;
|
|
2226
|
-
const { id:
|
|
2278
|
+
const { id: o, name: n, fullName: l, lon: r, lat: i, pointType: c } = t, s = [Number(r), Number(i)];
|
|
2227
2279
|
this.highlightPoint = {
|
|
2228
|
-
id:
|
|
2229
|
-
name:
|
|
2230
|
-
fullName:
|
|
2280
|
+
id: o,
|
|
2281
|
+
name: n,
|
|
2282
|
+
fullName: l,
|
|
2231
2283
|
lonlat: s,
|
|
2232
2284
|
pointType: c
|
|
2233
2285
|
}, this.setPointCenter(s);
|
|
2234
2286
|
}
|
|
2235
2287
|
// 获取feature
|
|
2236
|
-
getFeature(t,
|
|
2237
|
-
var
|
|
2238
|
-
const
|
|
2239
|
-
geometry: new Point(fromLonLat(
|
|
2288
|
+
getFeature(t, o) {
|
|
2289
|
+
var l;
|
|
2290
|
+
const n = new Feature({
|
|
2291
|
+
geometry: new Point(fromLonLat(o))
|
|
2240
2292
|
});
|
|
2241
|
-
return
|
|
2242
|
-
setPointStyle(((
|
|
2243
|
-
),
|
|
2293
|
+
return n.set("data", t), n.setStyle(
|
|
2294
|
+
setPointStyle(((l = this.highlightPoint) == null ? void 0 : l.id) === t.id, t.name, this.options)
|
|
2295
|
+
), n;
|
|
2244
2296
|
}
|
|
2245
2297
|
/**
|
|
2246
2298
|
*
|
|
@@ -2250,12 +2302,12 @@ class PointMarkerClass {
|
|
|
2250
2302
|
* type 0: 不改变地图大小 1: 等于customZoom 2: 地图当前zoom > 传入的customZoom(缩小地图) 3: 地图当前zoom < 传入的customZoom(放大地图)
|
|
2251
2303
|
* }
|
|
2252
2304
|
*/
|
|
2253
|
-
setPointCenter(t,
|
|
2305
|
+
setPointCenter(t, o = { customZoom: mapZoom.findShip, type: 1 }) {
|
|
2254
2306
|
if (!this.mapInstance) return;
|
|
2255
|
-
const { customZoom:
|
|
2256
|
-
(
|
|
2307
|
+
const { customZoom: n = mapZoom.findShip, type: l = 1 } = o, r = this.mapInstance.getView(), i = r.getZoom();
|
|
2308
|
+
(l === 1 || i > n && l === 2 || i < n && l === 3) && r.setZoom(n);
|
|
2257
2309
|
const c = new Point(t);
|
|
2258
|
-
|
|
2310
|
+
r.setCenter(transform(c.getCoordinates(), projection.data, projection.mercator));
|
|
2259
2311
|
}
|
|
2260
2312
|
}
|
|
2261
2313
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -2271,18 +2323,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2271
2323
|
showToolPanel: { type: Boolean }
|
|
2272
2324
|
},
|
|
2273
2325
|
emits: ["zoomChanged", "extentChanged"],
|
|
2274
|
-
setup(e, { expose: t, emit:
|
|
2275
|
-
const
|
|
2276
|
-
provide("mapInstance",
|
|
2277
|
-
const
|
|
2326
|
+
setup(e, { expose: t, emit: o }) {
|
|
2327
|
+
const n = ref();
|
|
2328
|
+
provide("mapInstance", n);
|
|
2329
|
+
const l = ref(null), r = ref(null), i = ref(null), c = o, s = e, m = ref(s.zoom || mapZoom.default), d = ref(!1), u = ref(!0), h = ref(!0), p = ref(!0), f = {
|
|
2278
2330
|
tiandituTile: new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) }),
|
|
2279
2331
|
tiandituTileMark: new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) }),
|
|
2280
2332
|
tiandituImgTile: new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 }),
|
|
2281
2333
|
tiandituImgTileMark: new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 }),
|
|
2282
2334
|
greenMark: new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })
|
|
2283
2335
|
}, v = () => {
|
|
2284
|
-
var
|
|
2285
|
-
const
|
|
2336
|
+
var L, w;
|
|
2337
|
+
const y = {
|
|
2286
2338
|
projection: projection.mercator,
|
|
2287
2339
|
// 地图投影坐标系
|
|
2288
2340
|
zoom: s.zoom || (s.vehicleMode === "ship" ? mapZoom.default : mapZoom.truckDefault),
|
|
@@ -2299,114 +2351,115 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2299
2351
|
// 禁用旋转
|
|
2300
2352
|
multiWorld: !0
|
|
2301
2353
|
};
|
|
2302
|
-
|
|
2354
|
+
n.value = new Map$1({
|
|
2303
2355
|
target: "map",
|
|
2304
2356
|
// 对应页面里 id 为 map 的元素
|
|
2305
2357
|
layers: [
|
|
2306
2358
|
// 图层
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2359
|
+
f.tiandituTile,
|
|
2360
|
+
f.tiandituTileMark,
|
|
2361
|
+
f.tiandituImgTile,
|
|
2362
|
+
f.tiandituImgTileMark,
|
|
2363
|
+
f.greenMark
|
|
2312
2364
|
],
|
|
2313
|
-
view: new View(
|
|
2314
|
-
}),
|
|
2365
|
+
view: new View(y)
|
|
2366
|
+
}), g(), s.showToolPanel === void 0 ? p.value = !0 : p.value = s.showToolPanel, (L = r.value) == null || L.setScaleLine(s.vehicleMode === "ship" ? "nautical" : "metric"), (w = n.value) == null || w.on("moveend", E), k(y.zoom < mapZoom.shipGreenDotMax), b(s.vehicleMode === "ship" || s.viewMode === "findShip" ? BaseMapType.satellite : BaseMapType.vector), s.viewMode === "findShip" && s.mmsi && s.shipData && nextTick(() => {
|
|
2315
2367
|
findShip(String(s.mmsi), s.shipData);
|
|
2316
2368
|
}), onShipsMarkerHover();
|
|
2317
2369
|
};
|
|
2318
2370
|
onMounted(() => {
|
|
2319
2371
|
v();
|
|
2320
2372
|
});
|
|
2321
|
-
const
|
|
2322
|
-
|
|
2323
|
-
},
|
|
2324
|
-
var
|
|
2325
|
-
s.vehicleMode !== "ship" && (
|
|
2326
|
-
getUid(
|
|
2373
|
+
const g = () => {
|
|
2374
|
+
n.value && (renderCustomOverlaySetInstance(n.value), renderTruckSetInstance(n.value), drawPolygonSetInstance(n.value), renderShipStyleSetInstance(n.value), renderTrackStyleSetInstance(n.value), renderDashboardSetInstance(n.value), renderMarkerSetInstance(n.value), renderShipSetInstance(n.value), renderTrackSetInstance(n.value));
|
|
2375
|
+
}, k = (y) => {
|
|
2376
|
+
var L;
|
|
2377
|
+
s.vehicleMode !== "ship" && (y = !1), (L = n.value) == null || L.getLayers().forEach((w) => {
|
|
2378
|
+
getUid(w) === getUid(f.greenMark) && (w.setVisible(y), u.value = y);
|
|
2327
2379
|
});
|
|
2328
|
-
}, M = ref(BaseMapType.satellite),
|
|
2329
|
-
var
|
|
2330
|
-
M.value =
|
|
2331
|
-
(getUid(
|
|
2380
|
+
}, M = ref(BaseMapType.satellite), b = (y) => {
|
|
2381
|
+
var L;
|
|
2382
|
+
M.value = y, (L = n.value) == null || L.getLayers().forEach((w) => {
|
|
2383
|
+
(getUid(w) === getUid(f.tiandituTile) || getUid(w) === getUid(f.tiandituTileMark) || getUid(w) === getUid(f.tiandituImgTile) || getUid(w) === getUid(f.tiandituImgTileMark)) && w.setVisible(!1), (y === BaseMapType.vector && (getUid(w) === getUid(f.tiandituTile) || getUid(w) === getUid(f.tiandituTileMark)) || y === BaseMapType.satellite && (getUid(w) === getUid(f.tiandituImgTile) || getUid(w) === getUid(f.tiandituImgTileMark))) && w.setVisible(!0);
|
|
2332
2384
|
});
|
|
2333
|
-
},
|
|
2334
|
-
const
|
|
2335
|
-
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2338
|
-
},
|
|
2339
|
-
var
|
|
2340
|
-
m.value =
|
|
2341
|
-
const
|
|
2342
|
-
showTrackLayer.value ? (
|
|
2343
|
-
},
|
|
2344
|
-
const
|
|
2345
|
-
c("extentChanged", { extent: [
|
|
2385
|
+
}, E = () => {
|
|
2386
|
+
const y = n.value.getView(), L = y.getZoom();
|
|
2387
|
+
L && V(L);
|
|
2388
|
+
const w = y.calculateExtent(n.value.getSize());
|
|
2389
|
+
w && L && F(w, L);
|
|
2390
|
+
}, V = (y) => {
|
|
2391
|
+
var S, T, C, P, x;
|
|
2392
|
+
m.value = y, k(y < mapZoom.shipGreenDotMax);
|
|
2393
|
+
const L = (S = n.value) == null ? void 0 : S.getLayers(), w = s.vehicleMode === "ship" ? L == null ? void 0 : L.getArray().find((N) => getUid(N) === getUid(f.greenMark)) : void 0;
|
|
2394
|
+
showTrackLayer.value ? (h.value = !1, w == null || w.setVisible(!1), (T = shipsLayer.value) == null || T.setVisible(!1), (C = largeAmountShipsLayer.value) == null || C.setVisible(!1)) : !d.value && u.value && y <= mapZoom.shipGreenDotMax ? (h.value = !0, w == null || w.setVisible(!0), (P = shipsLayer.value) == null || P.setVisible(!1), (x = largeAmountShipsLayer.value) == null || x.setVisible(!1)) : (h.value = !1, w == null || w.setVisible(!1)), c("zoomChanged", y);
|
|
2395
|
+
}, F = (y, L) => {
|
|
2396
|
+
const w = transform([y[0], y[1]], projection.mercator, projection.data), S = transform([y[2], y[3]], projection.mercator, projection.data);
|
|
2397
|
+
c("extentChanged", { extent: [w, S], zoom: L });
|
|
2346
2398
|
};
|
|
2347
2399
|
return t({
|
|
2348
|
-
mapInstance:
|
|
2400
|
+
mapInstance: n,
|
|
2349
2401
|
initMap: v,
|
|
2350
|
-
pointRender: (
|
|
2402
|
+
pointRender: (y, L) => new PointMarkerClass(y, L),
|
|
2351
2403
|
renderTrucksMarker,
|
|
2352
2404
|
renderShip: renderShips,
|
|
2353
|
-
renderTrack: (
|
|
2354
|
-
var
|
|
2355
|
-
currentTrackId.value =
|
|
2405
|
+
renderTrack: (y, L, w) => {
|
|
2406
|
+
var S, T;
|
|
2407
|
+
showDrawLayer.value = !0, currentTrackId.value = y, showTrackLayer.value = !0, d.value = !0, hiddenAllShips(), (T = (S = largeAmountShipsLayer.value) == null ? void 0 : S.getSource()) == null || T.clear(), renderTrack(y, s.vehicleMode === "ship" ? L.reverse() : L, w, LENGTH_UNIT.NM);
|
|
2356
2408
|
},
|
|
2357
2409
|
findTruck,
|
|
2358
2410
|
removeTruckIcon,
|
|
2359
2411
|
clearAllTruck,
|
|
2360
|
-
closeTrack: () => {
|
|
2361
|
-
var w,
|
|
2362
|
-
showTrackLayer.value = !1, (
|
|
2412
|
+
closeTrack: (y = !1) => {
|
|
2413
|
+
var L, w, S;
|
|
2414
|
+
showDrawLayer.value = !1, showTrackLayer.value = !1, (L = shipTrackVectorLayer.value) == null || L.setVisible(!1), (w = selectShipsLayer.value) == null || w.setVisible(!0), d.value = !1, k(m.value < mapZoom.shipGreenDotMax), y && (allTracks.value = [], (S = trackLineVectorSource.value) == null || S.clear()), stopAnimation();
|
|
2363
2415
|
},
|
|
2364
2416
|
closeTruckTrack: () => {
|
|
2365
|
-
var
|
|
2366
|
-
showTrackLayer.value = !1, (
|
|
2417
|
+
var y, L;
|
|
2418
|
+
showTrackLayer.value = !1, (y = shipTrackVectorLayer.value) == null || y.setVisible(!1), (L = selectShipsLayer.value) == null || L.setVisible(!0), stopAnimation();
|
|
2367
2419
|
},
|
|
2368
2420
|
resetTrackView,
|
|
2369
2421
|
playTrack,
|
|
2370
2422
|
clearSelectFeature,
|
|
2371
2423
|
findShip,
|
|
2372
|
-
focusShip: (
|
|
2373
|
-
var
|
|
2374
|
-
hiddenOrther.value =
|
|
2424
|
+
focusShip: (y, L, w = !0) => {
|
|
2425
|
+
var S, T;
|
|
2426
|
+
hiddenOrther.value = w, (S = shipsLayer.value) == null || S.setVisible(!w), w || rerenderShip(), (T = largeAmountShipsLayer.value) == null || T.setVisible(!1), findShip(y, L);
|
|
2375
2427
|
},
|
|
2376
2428
|
clearShipData,
|
|
2377
2429
|
showTracks,
|
|
2378
2430
|
removeAllTrackLayer,
|
|
2379
2431
|
switchFilterItem,
|
|
2380
2432
|
rerenderShip,
|
|
2381
|
-
switchGreenDot: () =>
|
|
2433
|
+
switchGreenDot: () => k(!1),
|
|
2382
2434
|
zoomTruckIcon,
|
|
2383
|
-
renderTruckTrack: (
|
|
2384
|
-
showTrackLayer.value = !0, renderTrack(
|
|
2435
|
+
renderTruckTrack: (y, L, w) => {
|
|
2436
|
+
showTrackLayer.value = !0, renderTrack(y, L, w, LENGTH_UNIT.KM, "truck");
|
|
2385
2437
|
},
|
|
2386
2438
|
drawCustomContent,
|
|
2387
2439
|
removerLayer: removeShipTrackLineFeatureByIndex,
|
|
2388
2440
|
renderMarker,
|
|
2389
|
-
setMarkerPosition: (
|
|
2390
|
-
d.value = !0, setMarkerPosition(
|
|
2441
|
+
setMarkerPosition: (y) => {
|
|
2442
|
+
d.value = !0, setMarkerPosition(y);
|
|
2391
2443
|
},
|
|
2392
2444
|
getZoomAndCenter: () => {
|
|
2393
2445
|
var T;
|
|
2394
|
-
const
|
|
2395
|
-
if (!
|
|
2396
|
-
const
|
|
2397
|
-
return { zoom:
|
|
2446
|
+
const y = (T = n.value) == null ? void 0 : T.getView();
|
|
2447
|
+
if (!y) return null;
|
|
2448
|
+
const L = Math.round(Number(y.getZoom())), { lon: w, lat: S } = transformUtils.mercatorToLonLat(y.getCenter());
|
|
2449
|
+
return { zoom: L, center: [w, S] };
|
|
2398
2450
|
},
|
|
2399
|
-
setCenter: (
|
|
2400
|
-
var
|
|
2401
|
-
const
|
|
2402
|
-
if (!
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2451
|
+
setCenter: (y) => {
|
|
2452
|
+
var S;
|
|
2453
|
+
const L = (S = n.value) == null ? void 0 : S.getView();
|
|
2454
|
+
if (!L) return null;
|
|
2455
|
+
const w = new Point(y);
|
|
2456
|
+
L.setCenter(transform(w.getCoordinates(), projection.data, projection.mercator));
|
|
2405
2457
|
},
|
|
2458
|
+
deleteLabelFromArray: deleteLabelFromArrayById,
|
|
2406
2459
|
drawPolygonTool,
|
|
2407
|
-
setMapInstance:
|
|
2460
|
+
setMapInstance: g,
|
|
2408
2461
|
store: {
|
|
2409
|
-
|
|
2462
|
+
showDrawLayer: () => showDrawLayer.value
|
|
2410
2463
|
},
|
|
2411
2464
|
config: {
|
|
2412
2465
|
mapZoom,
|
|
@@ -2416,34 +2469,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2416
2469
|
transform: transformUtils,
|
|
2417
2470
|
format: formatUtils
|
|
2418
2471
|
}
|
|
2419
|
-
}), (
|
|
2472
|
+
}), (y, L) => (openBlock(), createElementBlock("div", {
|
|
2420
2473
|
class: "map-page map-container",
|
|
2421
2474
|
ref_key: "pageRef",
|
|
2422
|
-
ref:
|
|
2475
|
+
ref: l
|
|
2423
2476
|
}, [
|
|
2424
|
-
|
|
2477
|
+
L[0] || (L[0] = createElementVNode("div", {
|
|
2425
2478
|
id: "map",
|
|
2426
2479
|
class: "map"
|
|
2427
2480
|
}, null, -1)),
|
|
2428
2481
|
p.value ? (openBlock(), createBlock(ToolPanel, {
|
|
2429
2482
|
key: 0,
|
|
2430
|
-
"vehicle-mode":
|
|
2431
|
-
"view-mode":
|
|
2483
|
+
"vehicle-mode": y.vehicleMode,
|
|
2484
|
+
"view-mode": y.viewMode,
|
|
2432
2485
|
"disable-green-dot": d.value,
|
|
2433
2486
|
"show-track-layer": unref(showTrackLayer),
|
|
2434
2487
|
"map-tile-mode": M.value,
|
|
2435
|
-
onSwitchGreenDot:
|
|
2436
|
-
onSwitchMapTile:
|
|
2488
|
+
onSwitchGreenDot: k,
|
|
2489
|
+
onSwitchMapTile: b
|
|
2437
2490
|
}, {
|
|
2438
2491
|
toolPanel: withCtx(() => [
|
|
2439
|
-
renderSlot(
|
|
2492
|
+
renderSlot(y.$slots, "toolPanel", {}, void 0, !0)
|
|
2440
2493
|
]),
|
|
2441
2494
|
_: 3
|
|
2442
2495
|
}, 8, ["vehicle-mode", "view-mode", "disable-green-dot", "show-track-layer", "map-tile-mode"])) : createCommentVNode("", !0),
|
|
2443
|
-
|
|
2496
|
+
y.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2444
2497
|
createVNode(ScaleLine, {
|
|
2445
2498
|
ref_key: "scaleLineControl",
|
|
2446
|
-
ref:
|
|
2499
|
+
ref: r
|
|
2447
2500
|
}, null, 512),
|
|
2448
2501
|
createVNode(ZoomControl, {
|
|
2449
2502
|
ref_key: "zoomControl",
|
|
@@ -2451,12 +2504,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2451
2504
|
}, null, 512)
|
|
2452
2505
|
], 64)) : createCommentVNode("", !0),
|
|
2453
2506
|
createVNode(Copyright, {
|
|
2454
|
-
type:
|
|
2507
|
+
type: y.logoType,
|
|
2455
2508
|
"map-tile": M.value
|
|
2456
2509
|
}, null, 8, ["type", "map-tile"])
|
|
2457
2510
|
], 512));
|
|
2458
2511
|
}
|
|
2459
|
-
}), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
2512
|
+
}), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6751c660"]]), ZhMap = withInstall(Map);
|
|
2460
2513
|
export {
|
|
2461
2514
|
BaseMapType as B,
|
|
2462
2515
|
CDN_URL as C,
|