zhihao-ui 1.2.48 → 1.2.49
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/{Map-BaIwtuYL.js → Map-FGjTLjM5.js} +576 -569
- package/dist/es/index.js +2 -2
- package/dist/index.css +1 -1
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +14 -14
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { g as getForegroundColor } from "./DatePicker-Dh8sksac.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, o, r,
|
|
11
|
+
constructor(t, n, o, r, i, l, c, s, m, d, u, h, p, f, v, g, L, S, I, F, x, P, $, y) {
|
|
12
12
|
b(this, "id");
|
|
13
13
|
// mmsi
|
|
14
14
|
b(this, "mmsi");
|
|
@@ -50,7 +50,7 @@ class ShipMapData {
|
|
|
50
50
|
b(this, "existWaterGauge");
|
|
51
51
|
b(this, "selected");
|
|
52
52
|
b(this, "blinkColors");
|
|
53
|
-
this.id = t, this.mmsi = n, this.fill = o, this.shipType = r, this.name =
|
|
53
|
+
this.id = t, this.mmsi = n, this.fill = o, this.shipType = r, this.name = i, this.length = l, 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 = L, this.angle = S, this.leftIconColor = I, this.existDevice = F, this.existMobile = x, this.existWaterGauge = P, this.selected = $, this.blinkColors = y;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
const formatLength = function(e, t) {
|
|
@@ -79,8 +79,8 @@ const formatLength = function(e, t) {
|
|
|
79
79
|
o > 1e4 ? r = Math.round(o / 1e6 * 100) / 100 + " km<sup>2</sup>" : r = Math.round(o * 100) / 100 + " m<sup>2</sup>";
|
|
80
80
|
break;
|
|
81
81
|
case LENGTH_UNIT.NM:
|
|
82
|
-
const
|
|
83
|
-
o > 1e4 ? r = Math.round(o / 1e6 /
|
|
82
|
+
const i = Math.pow(1.852, 2);
|
|
83
|
+
o > 1e4 ? r = Math.round(o / 1e6 / i * 100) / 100 + " nm<sup>2</sup>" : r = Math.round(o * 100) / 100 + " m<sup>2</sup>";
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
return r;
|
|
@@ -130,8 +130,8 @@ const formatLength = function(e, t) {
|
|
|
130
130
|
}),
|
|
131
131
|
emits: /* @__PURE__ */ mergeModels(["close"], ["update:visible"]),
|
|
132
132
|
setup(e, { expose: t, emit: n }) {
|
|
133
|
-
const o = inject("mapInstance"), r = n,
|
|
134
|
-
let d, u,
|
|
133
|
+
const o = inject("mapInstance"), r = n, i = useModel(e, "visible"), l = ref("3"), c = ref([]), s = ref(!1), m = new VectorSource();
|
|
134
|
+
let d, u, h, p, f;
|
|
135
135
|
const v = new VectorLayer({
|
|
136
136
|
source: m,
|
|
137
137
|
style: {
|
|
@@ -141,19 +141,19 @@ const formatLength = function(e, t) {
|
|
|
141
141
|
"circle-radius": 7,
|
|
142
142
|
"circle-fill-color": "#ffcc33"
|
|
143
143
|
}
|
|
144
|
-
}),
|
|
145
|
-
if (
|
|
144
|
+
}), g = function(M) {
|
|
145
|
+
if (M.dragging)
|
|
146
146
|
return;
|
|
147
|
-
let
|
|
148
|
-
d && (
|
|
149
|
-
},
|
|
150
|
-
var
|
|
151
|
-
o != null && o.value && ((
|
|
152
|
-
var
|
|
153
|
-
(
|
|
147
|
+
let T = "点击选择起点";
|
|
148
|
+
d && (T = "单击继续,双击结束"), u && (u.innerHTML = T, h.setPosition(M.coordinate), u.classList.remove("hidden"));
|
|
149
|
+
}, L = () => {
|
|
150
|
+
var M, T;
|
|
151
|
+
o != null && o.value && ((M = o == null ? void 0 : o.value) == null || M.on("pointermove", g), (T = o == null ? void 0 : o.value) == null || T.getViewport().addEventListener("mouseout", function() {
|
|
152
|
+
var C;
|
|
153
|
+
(C = u == null ? void 0 : u.classList) == null || C.add("hidden");
|
|
154
154
|
}), s.value = !0);
|
|
155
155
|
};
|
|
156
|
-
let
|
|
156
|
+
let S;
|
|
157
157
|
const I = new Style({
|
|
158
158
|
fill: new Fill({
|
|
159
159
|
color: "rgba(255, 255, 255, 0.2)"
|
|
@@ -173,99 +173,106 @@ const formatLength = function(e, t) {
|
|
|
173
173
|
})
|
|
174
174
|
})
|
|
175
175
|
});
|
|
176
|
-
function
|
|
177
|
-
var
|
|
176
|
+
function F() {
|
|
177
|
+
var M, T;
|
|
178
178
|
if (o != null && o.value) {
|
|
179
|
-
if (c.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((
|
|
180
|
-
var
|
|
181
|
-
(
|
|
182
|
-
}), m.clear(),
|
|
183
|
-
const
|
|
184
|
-
|
|
179
|
+
if (c.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((C) => {
|
|
180
|
+
var V;
|
|
181
|
+
(V = C == null ? void 0 : C.parentNode) == null || V.removeChild(C);
|
|
182
|
+
}), m.clear(), S) {
|
|
183
|
+
const C = o.value.getInteractions().getArray().find((V) => getUid(V) === getUid(S));
|
|
184
|
+
C && ((M = o.value) == null || M.removeInteraction(C));
|
|
185
185
|
}
|
|
186
|
-
(
|
|
186
|
+
(T = o.value) == null || T.removeLayer(v), u != null && u.parentNode && u.parentNode.removeChild(u), p != null && p.parentNode && p.parentNode.removeChild(p);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
191
|
-
|
|
189
|
+
function x() {
|
|
190
|
+
var T, C;
|
|
191
|
+
F(), (T = o == null ? void 0 : o.value) == null || T.addLayer(v), S = new Draw({
|
|
192
192
|
source: m,
|
|
193
193
|
type: "LineString",
|
|
194
194
|
style: function() {
|
|
195
195
|
return I;
|
|
196
196
|
},
|
|
197
197
|
// 添加条件函数,判断是否应该触发绘制
|
|
198
|
-
condition: function(
|
|
199
|
-
return
|
|
198
|
+
condition: function(V) {
|
|
199
|
+
return V.originalEvent.target.tagName !== "DIV";
|
|
200
200
|
}
|
|
201
|
-
}), (
|
|
202
|
-
let
|
|
203
|
-
|
|
201
|
+
}), (C = o == null ? void 0 : o.value) == null || C.addInteraction(S), $(), P();
|
|
202
|
+
let M;
|
|
203
|
+
S.on("drawstart", function(V) {
|
|
204
204
|
var N;
|
|
205
|
-
d =
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
let
|
|
210
|
-
|
|
205
|
+
d = V.feature, d.set("randomId", k());
|
|
206
|
+
let E;
|
|
207
|
+
M = (N = d.getGeometry()) == null ? void 0 : N.on("change", function(B) {
|
|
208
|
+
const O = B.target;
|
|
209
|
+
let R = formatUtils.formatLength(O, Number(l.value));
|
|
210
|
+
E = O.getLastCoordinate(), p && R && (p.innerHTML = R), f.setPosition(E);
|
|
211
211
|
});
|
|
212
|
-
}),
|
|
213
|
-
var
|
|
214
|
-
p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
}), S.on("drawend", function() {
|
|
213
|
+
var V;
|
|
214
|
+
if (p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML) {
|
|
215
|
+
const E = (d == null ? void 0 : d.get("randomId")) || k();
|
|
216
|
+
c.value.push({ id: E, value: p == null ? void 0 : p.innerHTML }), p.innerHTML = `${p.innerHTML}<div class="ol-tooltip-delete-button" data-id="${E}"><i class="map-iconfont icon-delete"></i></div>`;
|
|
217
|
+
}
|
|
218
|
+
(V = document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button")) == null || V.addEventListener("click", (E) => {
|
|
219
|
+
var B;
|
|
220
|
+
E.preventDefault(), E.stopPropagation();
|
|
221
|
+
const N = (B = E.target) == null ? void 0 : B.getAttribute("data-id");
|
|
222
|
+
N && y(N);
|
|
223
|
+
}), f.setOffset([0, -7]), d = null, p = null, $(), M && unByKey(M);
|
|
220
224
|
});
|
|
221
225
|
}
|
|
222
|
-
function
|
|
223
|
-
var
|
|
224
|
-
u != null && u.parentNode && u.parentNode.removeChild(u), u = document.createElement("div"), u.className = "ol-tooltip hidden",
|
|
226
|
+
function P() {
|
|
227
|
+
var M;
|
|
228
|
+
u != null && u.parentNode && u.parentNode.removeChild(u), u = document.createElement("div"), u.className = "ol-tooltip hidden", h = new Overlay({
|
|
225
229
|
element: u,
|
|
226
230
|
offset: [15, 0],
|
|
227
231
|
positioning: "center-left"
|
|
228
|
-
}), (
|
|
232
|
+
}), (M = o == null ? void 0 : o.value) == null || M.addOverlay(h);
|
|
229
233
|
}
|
|
230
|
-
function
|
|
231
|
-
var
|
|
232
|
-
p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure",
|
|
234
|
+
function $() {
|
|
235
|
+
var M;
|
|
236
|
+
p != null && p.parentNode && p.parentNode.removeChild(p), p = document.createElement("div"), p.className = "ol-tooltip ol-tooltip-measure", f = new Overlay({
|
|
233
237
|
element: p,
|
|
234
238
|
offset: [0, -15],
|
|
235
239
|
positioning: "bottom-center",
|
|
236
240
|
stopEvent: !1,
|
|
237
241
|
insertFirst: !1
|
|
238
|
-
}), (
|
|
242
|
+
}), (M = o == null ? void 0 : o.value) == null || M.addOverlay(f);
|
|
239
243
|
}
|
|
240
|
-
const
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
const y = (M) => {
|
|
245
|
+
var C, V;
|
|
246
|
+
const T = c.value.findIndex((E) => E.id === M);
|
|
247
|
+
if (T !== -1) {
|
|
248
|
+
c.value.splice(T, 1);
|
|
249
|
+
const E = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
250
|
+
E[T] && ((V = (C = E[T]) == null ? void 0 : C.parentNode) == null || V.removeChild(E[T]));
|
|
251
|
+
const N = m.getFeatures();
|
|
252
|
+
N[T] && m.removeFeature(N[T]);
|
|
253
|
+
}
|
|
254
|
+
}, w = () => {
|
|
248
255
|
r("close");
|
|
249
|
-
};
|
|
250
|
-
return watch(() =>
|
|
251
|
-
|
|
256
|
+
}, k = () => Math.random().toString(36).substring(2, 9);
|
|
257
|
+
return watch(() => i, () => {
|
|
258
|
+
i.value && !s.value && (L(), x());
|
|
252
259
|
}, { deep: !0, immediate: !0 }), t({
|
|
253
|
-
addInteraction:
|
|
254
|
-
removeInteraction:
|
|
255
|
-
}), (
|
|
260
|
+
addInteraction: x,
|
|
261
|
+
removeInteraction: F
|
|
262
|
+
}), (M, T) => i.value && M.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
256
263
|
createElementVNode("div", { class: "header" }, [
|
|
257
|
-
|
|
264
|
+
T[1] || (T[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
|
|
258
265
|
createElementVNode("i", {
|
|
259
|
-
onClick:
|
|
266
|
+
onClick: w,
|
|
260
267
|
class: "map-iconfont icon-close"
|
|
261
268
|
})
|
|
262
269
|
]),
|
|
263
270
|
createElementVNode("div", _hoisted_2$2, [
|
|
264
|
-
|
|
271
|
+
T[2] || (T[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
|
|
265
272
|
createVNode(unref(ElSelect), {
|
|
266
273
|
class: "select-length-unit",
|
|
267
|
-
modelValue:
|
|
268
|
-
"onUpdate:modelValue":
|
|
274
|
+
modelValue: l.value,
|
|
275
|
+
"onUpdate:modelValue": T[0] || (T[0] = (C) => l.value = C)
|
|
269
276
|
}, {
|
|
270
277
|
default: withCtx(() => [
|
|
271
278
|
createVNode(unref(ElOption), {
|
|
@@ -285,26 +292,26 @@ const formatLength = function(e, t) {
|
|
|
285
292
|
}, 8, ["modelValue"])
|
|
286
293
|
]),
|
|
287
294
|
createElementVNode("div", _hoisted_3$1, [
|
|
288
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(c.value, (
|
|
295
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(c.value, (C, V) => (openBlock(), createElementBlock("div", {
|
|
289
296
|
class: "measure-history-item",
|
|
290
|
-
key:
|
|
297
|
+
key: C.id
|
|
291
298
|
}, [
|
|
292
299
|
createElementVNode("div", _hoisted_4, [
|
|
293
|
-
|
|
294
|
-
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(
|
|
295
|
-
createElementVNode("span", _hoisted_6, toDisplayString(
|
|
300
|
+
T[3] || (T[3] = createElementVNode("i", { class: "map-iconfont icon-line" }, null, -1)),
|
|
301
|
+
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(V + 1), 1),
|
|
302
|
+
createElementVNode("span", _hoisted_6, toDisplayString(C.value), 1)
|
|
296
303
|
]),
|
|
297
304
|
createElementVNode("div", {
|
|
298
305
|
class: "delete-button",
|
|
299
|
-
onClick: (
|
|
300
|
-
},
|
|
306
|
+
onClick: (E) => y(C.id)
|
|
307
|
+
}, T[4] || (T[4] = [
|
|
301
308
|
createElementVNode("i", { class: "map-iconfont icon-delete" }, null, -1)
|
|
302
309
|
]), 8, _hoisted_7)
|
|
303
310
|
]))), 128))
|
|
304
311
|
])
|
|
305
312
|
])) : createCommentVNode("", !0);
|
|
306
313
|
}
|
|
307
|
-
}), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
314
|
+
}), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-f04be643"]]), mapInstance$8 = ref(), renderMarkerSetInstance = (e) => mapInstance$8.value = e, markerPosition = ref(""), marker = ref(), createIconStyle = (e) => new Style({
|
|
308
315
|
image: new Icon({
|
|
309
316
|
src: CDN_URL + "map/poi-marker-default.png",
|
|
310
317
|
anchor: [0.5, 1]
|
|
@@ -340,30 +347,30 @@ const formatLength = function(e, t) {
|
|
|
340
347
|
marker.value = new Feature({
|
|
341
348
|
geometry: new Point(fromLonLat([o, r]))
|
|
342
349
|
});
|
|
343
|
-
const
|
|
344
|
-
(d = marker.value) == null || d.setStyle(createIconStyle(
|
|
345
|
-
const
|
|
350
|
+
const i = n ? `${o}, ${r}` : "";
|
|
351
|
+
(d = marker.value) == null || d.setStyle(createIconStyle(i));
|
|
352
|
+
const l = new VectorSource({
|
|
346
353
|
features: [marker.value]
|
|
347
354
|
}), c = new VectorLayer({
|
|
348
|
-
source:
|
|
355
|
+
source: l
|
|
349
356
|
}), s = mapInstance$8.value.getView();
|
|
350
357
|
if (mapInstance$8.value.addLayer(c), t) {
|
|
351
358
|
const u = new Translate({
|
|
352
359
|
layers: [c]
|
|
353
360
|
});
|
|
354
|
-
u.on("translating", function(
|
|
361
|
+
u.on("translating", function(h) {
|
|
355
362
|
var v;
|
|
356
|
-
const p =
|
|
357
|
-
markerPosition.value = `${
|
|
363
|
+
const p = h.features.item(0).getGeometry().getCoordinates(), f = toLonLat(p);
|
|
364
|
+
markerPosition.value = `${f[0].toFixed(6)}, ${f[1].toFixed(6)}`, (v = marker.value) == null || v.setStyle(createIconStyle(markerPosition.value));
|
|
358
365
|
}), mapInstance$8.value.addInteraction(u);
|
|
359
366
|
}
|
|
360
367
|
const m = new Point([o, r]);
|
|
361
368
|
s.setCenter(transform(m.getCoordinates(), projection.data, projection.mercator)), s.setZoom(mapZoom.findShip);
|
|
362
369
|
}, setMarkerPosition = (e) => {
|
|
363
|
-
var r,
|
|
370
|
+
var r, i;
|
|
364
371
|
if (!mapInstance$8.value) return;
|
|
365
372
|
const t = mapInstance$8.value.getView(), n = e.split(",").map(Number);
|
|
366
|
-
(
|
|
373
|
+
(i = (r = marker.value) == null ? void 0 : r.getGeometry()) == null || i.setCoordinates(fromLonLat([n[0], n[1]]));
|
|
367
374
|
const o = new Point([n[0], n[1]]);
|
|
368
375
|
t.setCenter(transform(o.getCoordinates(), projection.data, projection.mercator)), t.setZoom(mapZoom.markerPosition);
|
|
369
376
|
}, CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", zhongkeKey = "15c81cc0a191a232e0a0ca1a51c3ca81", baseMap = {
|
|
@@ -436,7 +443,7 @@ const multiplyPixelRatio = (e) => {
|
|
|
436
443
|
function r(u) {
|
|
437
444
|
return u % 360 * Math.PI / 180;
|
|
438
445
|
}
|
|
439
|
-
function
|
|
446
|
+
function i(u) {
|
|
440
447
|
if (!u) throw new Error("Coordinate is required");
|
|
441
448
|
if (!Array.isArray(u)) {
|
|
442
449
|
if (u.type === "Feature" && u.geometry !== null && u.geometry.type === "Point")
|
|
@@ -449,25 +456,25 @@ const multiplyPixelRatio = (e) => {
|
|
|
449
456
|
"Coordinate must be GeoJSON Point or an Array of numbers"
|
|
450
457
|
);
|
|
451
458
|
}
|
|
452
|
-
function
|
|
459
|
+
function l(u, h, p = {}) {
|
|
453
460
|
if (p.final)
|
|
454
|
-
return function(
|
|
455
|
-
return (
|
|
456
|
-
}(u,
|
|
457
|
-
const
|
|
458
|
-
return o(Math.atan2(
|
|
461
|
+
return function(P, $) {
|
|
462
|
+
return (l($, P) + 180) % 360;
|
|
463
|
+
}(u, h);
|
|
464
|
+
const f = i(u), v = i(h), g = r(f[0]), L = r(v[0]), S = r(f[1]), I = r(v[1]), F = Math.sin(L - g) * Math.cos(I), x = Math.cos(S) * Math.sin(I) - Math.sin(S) * Math.cos(I) * Math.cos(L - g);
|
|
465
|
+
return o(Math.atan2(F, x));
|
|
459
466
|
}
|
|
460
467
|
function c(u) {
|
|
461
468
|
return !isNaN(u) && u !== null && !Array.isArray(u);
|
|
462
469
|
}
|
|
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 },
|
|
470
|
+
function s(u, h = {}, p = {}) {
|
|
471
|
+
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
472
|
}
|
|
466
|
-
function m(u,
|
|
467
|
-
const
|
|
468
|
-
return p.id !== void 0 && (
|
|
473
|
+
function m(u, h = {}, p = {}) {
|
|
474
|
+
const f = { type: "Feature" };
|
|
475
|
+
return p.id !== void 0 && (f.id = p.id), p.bbox && (f.bbox = p.bbox), f.properties = h || {}, f.geometry = u, f;
|
|
469
476
|
}
|
|
470
|
-
const d =
|
|
477
|
+
const d = l(s(e), s(t), n);
|
|
471
478
|
return d < 0 ? 360 + d : d;
|
|
472
479
|
}, triangleModel = multiplyPixelRatio([
|
|
473
480
|
[0, -8],
|
|
@@ -546,14 +553,14 @@ const multiplyPixelRatio = (e) => {
|
|
|
546
553
|
}, 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
554
|
renderer: (n, o) => {
|
|
548
555
|
n = n;
|
|
549
|
-
const r = o.context,
|
|
550
|
-
if (!
|
|
556
|
+
const r = o.context, i = o.feature.get("data");
|
|
557
|
+
if (!i) return;
|
|
551
558
|
o.feature.get("index") === 0 && (shipLabels.value = []);
|
|
552
559
|
try {
|
|
553
|
-
const c = drawShipBody(r,
|
|
554
|
-
c && (drawHeading(r,
|
|
560
|
+
const c = drawShipBody(r, i, n, t);
|
|
561
|
+
c && (drawHeading(r, i, c, t), i.selected = e, !isMapMoving.value && e && setTimeout(() => {
|
|
555
562
|
drawSelectBounds(r, c);
|
|
556
|
-
}, 1)), drawShipLabel(r,
|
|
563
|
+
}, 1)), drawShipLabel(r, i, n);
|
|
557
564
|
} catch {
|
|
558
565
|
return !1;
|
|
559
566
|
}
|
|
@@ -562,23 +569,23 @@ const multiplyPixelRatio = (e) => {
|
|
|
562
569
|
if (!mapInstance$7.value) return;
|
|
563
570
|
const r = Math.round(Number(mapInstance$7.value.getView().getZoom()));
|
|
564
571
|
if (!r) return;
|
|
565
|
-
let
|
|
566
|
-
const [
|
|
567
|
-
if (r <= mapZoom.shipModelMax && r > mapZoom.shipModelMin && t.length >=
|
|
568
|
-
|
|
569
|
-
const [
|
|
570
|
-
return [s +
|
|
572
|
+
let i = [];
|
|
573
|
+
const [l, c] = drawShipModelByZoom[r] || [0, 0], [s, m] = n;
|
|
574
|
+
if (r <= mapZoom.shipModelMax && r > mapZoom.shipModelMin && t.length >= l && t.breadth >= c)
|
|
575
|
+
i = rotateShapeModel(drawCurrentShipShapeModel(t, r), t.angle).map((u) => {
|
|
576
|
+
const [h, p] = u;
|
|
577
|
+
return [s + h, m + p];
|
|
571
578
|
});
|
|
572
579
|
else {
|
|
573
580
|
const d = rotateShapeModel(triangleModel, t.angle);
|
|
574
|
-
n.length === 2 && (
|
|
575
|
-
const [
|
|
576
|
-
return [s +
|
|
581
|
+
n.length === 2 && (i = d.map((u) => {
|
|
582
|
+
const [h, p] = u;
|
|
583
|
+
return [s + h, m + p];
|
|
577
584
|
}));
|
|
578
585
|
}
|
|
579
|
-
if (!(
|
|
586
|
+
if (!(i.length > 2)) return !1;
|
|
580
587
|
if (t != null && t.length) {
|
|
581
|
-
const d =
|
|
588
|
+
const d = i.length === 3 ? 30 : t.length * 0.4;
|
|
582
589
|
e.beginPath(), e.arc(
|
|
583
590
|
n[0],
|
|
584
591
|
n[1],
|
|
@@ -587,23 +594,23 @@ const multiplyPixelRatio = (e) => {
|
|
|
587
594
|
2 * Math.PI
|
|
588
595
|
), e.fillStyle = "rgba(255, 255, 255, 0.001)", e.fill();
|
|
589
596
|
}
|
|
590
|
-
e.save(), e.beginPath(), e.moveTo(
|
|
591
|
-
for (let d = 1; d <
|
|
592
|
-
e.lineTo(
|
|
593
|
-
return e.closePath(), e.strokeStyle = o ? "#ff0000" : "#000", e.lineWidth = o ? 2 : 1, e.stroke(), e.fillStyle = t.fill, e.fill(), e.restore(),
|
|
597
|
+
e.save(), e.beginPath(), e.moveTo(i[0][0], i[0][1]);
|
|
598
|
+
for (let d = 1; d < i.length; d++)
|
|
599
|
+
e.lineTo(i[d][0], i[d][1]);
|
|
600
|
+
return e.closePath(), e.strokeStyle = o ? "#ff0000" : "#000", e.lineWidth = o ? 2 : 1, e.stroke(), e.fillStyle = t.fill, e.fill(), e.restore(), i;
|
|
594
601
|
}, drawHeading = (e, t, n, o) => {
|
|
595
|
-
const [r,
|
|
596
|
-
if (
|
|
597
|
-
const c =
|
|
602
|
+
const [r, i] = n[0], l = getShipDirectPath(t);
|
|
603
|
+
if (l) {
|
|
604
|
+
const c = l.map(function(s) {
|
|
598
605
|
const [m, d] = s;
|
|
599
|
-
return [m + r, d +
|
|
606
|
+
return [m + r, d + i];
|
|
600
607
|
});
|
|
601
608
|
if (e.save(), e.beginPath(), t.angle > 0) {
|
|
602
|
-
e.translate(r,
|
|
609
|
+
e.translate(r, i);
|
|
603
610
|
const s = t.angle * Math.PI / 180;
|
|
604
|
-
e.rotate(s), e.translate(-r, -
|
|
611
|
+
e.rotate(s), e.translate(-r, -i);
|
|
605
612
|
}
|
|
606
|
-
e.moveTo(r,
|
|
613
|
+
e.moveTo(r, i);
|
|
607
614
|
for (let s = 1; s < c.length; s++) {
|
|
608
615
|
const [m, d] = c[s];
|
|
609
616
|
e.lineTo(m, d);
|
|
@@ -611,19 +618,19 @@ const multiplyPixelRatio = (e) => {
|
|
|
611
618
|
e.strokeStyle = o ? "#ff0000" : "#000", e.lineWidth = o ? 2 : 1, e.stroke(), e.restore();
|
|
612
619
|
}
|
|
613
620
|
}, drawSelectBounds = (e, t) => {
|
|
614
|
-
let [n, o, r,
|
|
615
|
-
const
|
|
616
|
-
n -= c, o -= c, r += c,
|
|
617
|
-
const s = 8 *
|
|
618
|
-
e.beginPath(), e.moveTo(n + s,
|
|
621
|
+
let [n, o, r, i] = getPixelFromCoordinate(t);
|
|
622
|
+
const l = window.devicePixelRatio || 1, c = 4;
|
|
623
|
+
n -= c, o -= c, r += c, i += c, e.save(), e.strokeStyle = "#ff0000", e.lineWidth = 4 * l;
|
|
624
|
+
const s = 8 * l;
|
|
625
|
+
e.beginPath(), e.moveTo(n + s, i), e.lineTo(n, i), e.lineTo(n, i - s), e.moveTo(n, o + s), e.lineTo(n, o), e.lineTo(n + s, o), e.moveTo(r - s, o), e.lineTo(r, o), e.lineTo(r, o + s), e.moveTo(r, i - s), e.lineTo(r, i), e.lineTo(r - s, i), e.stroke(), e.restore();
|
|
619
626
|
}, drawShipLabel = (e, t, n) => {
|
|
620
627
|
if (!t.selected && shipLabels.value.find((u) => u.name === t.name)) return;
|
|
621
|
-
const [o, r] = n,
|
|
628
|
+
const [o, r] = n, i = o, l = r, c = t.name;
|
|
622
629
|
let s;
|
|
623
630
|
t.leftIconColor && (s = { color: t.leftIconColor, icon: "" });
|
|
624
631
|
const m = getShipCustomIcon(t), d = {
|
|
625
632
|
id: t.id,
|
|
626
|
-
center: [
|
|
633
|
+
center: [i, l],
|
|
627
634
|
text: c,
|
|
628
635
|
fill: t.fill,
|
|
629
636
|
color: "#fff",
|
|
@@ -640,20 +647,20 @@ const multiplyPixelRatio = (e) => {
|
|
|
640
647
|
let n = 0;
|
|
641
648
|
t <= 14 ? n = 0.058 : t === 15 ? n = 0.12 : t === 16 ? n = 0.22 : t === 17 ? n = 0.435 : t === 18 && (n = 0.857);
|
|
642
649
|
const o = e.length / 4 * n, r = e.breadth * n;
|
|
643
|
-
let
|
|
644
|
-
return
|
|
650
|
+
let i = cloneDeep(shipShapeModel);
|
|
651
|
+
return i = i.map(([l, c]) => [l * r, c * o]), i;
|
|
645
652
|
}, getShipDirectPath = (e) => {
|
|
646
653
|
const { speed: t, hdg: n, cog: o } = e;
|
|
647
|
-
let r = "",
|
|
654
|
+
let r = "", i = null;
|
|
648
655
|
if (t && t > 1 && (n !== null && n != 511 && o !== null ? o - n >= 3 ? r = "left" : o - n <= -3 ? r = "right" : r = "front" : r = "front", r && t))
|
|
649
|
-
for (let
|
|
650
|
-
const c = speedCondition[
|
|
656
|
+
for (let l = 0; l < speedCondition.length; l++) {
|
|
657
|
+
const c = speedCondition[l];
|
|
651
658
|
if (t >= c[0] && t < c[1]) {
|
|
652
|
-
|
|
659
|
+
i = shipDirectPath[r][l];
|
|
653
660
|
break;
|
|
654
661
|
}
|
|
655
662
|
}
|
|
656
|
-
return
|
|
663
|
+
return i;
|
|
657
664
|
}, getShipCustomIcon = (e) => {
|
|
658
665
|
const t = [];
|
|
659
666
|
return e.existDevice && t.push(""), e.existMobile && t.push(""), e.existWaterGauge && t.push(""), t || [];
|
|
@@ -662,7 +669,7 @@ let shipsMarkerList = [], shipsVectorSource, largeAmountShipsSource;
|
|
|
662
669
|
const selectedShipData = ref(null), selectedShips = ref([]);
|
|
663
670
|
let selectShipsVectorSource;
|
|
664
671
|
const renderShips = (e) => {
|
|
665
|
-
var r,
|
|
672
|
+
var r, i, l, c;
|
|
666
673
|
if (!mapInstance$6.value || showTrackLayer.value) return;
|
|
667
674
|
const t = e.reduce((s, m) => (s.some((d) => d.id === m.id) || s.push(m), s), []), n = Math.round(Number(mapInstance$6.value.getView().getZoom()));
|
|
668
675
|
if (selectedShipData.value && nextTick(() => {
|
|
@@ -674,7 +681,7 @@ const renderShips = (e) => {
|
|
|
674
681
|
var m;
|
|
675
682
|
!o.some((d) => d.id === s.id) && ((m = s.blinkColors) != null && m.length) && checkBlinkLabelExist(mapInstance$6.value, shipLabels.value, s.id);
|
|
676
683
|
}), allShips.value = o, !hiddenOrther.value)
|
|
677
|
-
return n >= mapZoom.shipGreenDotMax && n < mapZoom.shipModelMin ? ((r = shipsLayer.value) == null || r.setVisible(!1), (
|
|
684
|
+
return n >= mapZoom.shipGreenDotMax && n < mapZoom.shipModelMin ? ((r = shipsLayer.value) == null || r.setVisible(!1), (i = largeAmountShipsLayer.value) == null || i.setVisible(!0), renderLargeAmountShips(allShips.value)) : ((l = largeAmountShipsLayer.value) == null || l.setVisible(!1), (c = shipsLayer.value) == null || c.setVisible(!0), renderShipsMarker(allShips.value));
|
|
678
685
|
}, renderLargeAmountShips = (e) => {
|
|
679
686
|
if (!mapInstance$6.value) return;
|
|
680
687
|
const t = e.map((n) => ({
|
|
@@ -730,15 +737,15 @@ const renderShips = (e) => {
|
|
|
730
737
|
let t = convertShipMapData(e);
|
|
731
738
|
if (t = customFilterShips(t), !!(t != null && t.length))
|
|
732
739
|
return t.forEach((o, r) => {
|
|
733
|
-
const
|
|
734
|
-
geometry: new Point(fromLonLat(
|
|
740
|
+
const i = [o.lon, o.lat], l = new Feature({
|
|
741
|
+
geometry: new Point(fromLonLat(i))
|
|
735
742
|
}), c = 1;
|
|
736
|
-
|
|
743
|
+
l.set("clickGeometry", new Circle(fromLonLat(i), c)), l.set("data", o), l.set("index", r), l.setStyle(
|
|
737
744
|
setShipStyle(!1)
|
|
738
745
|
), shipsMarkerList.push({
|
|
739
746
|
ship: o,
|
|
740
|
-
lonlat:
|
|
741
|
-
feature:
|
|
747
|
+
lonlat: i,
|
|
748
|
+
feature: l
|
|
742
749
|
});
|
|
743
750
|
}), shipsVectorSource = new VectorSource({
|
|
744
751
|
features: shipsMarkerList.map((o) => o.feature)
|
|
@@ -752,24 +759,24 @@ const renderShips = (e) => {
|
|
|
752
759
|
const n = 100;
|
|
753
760
|
(o = mapInstance$6.value) == null || o.on("pointermove", function(r) {
|
|
754
761
|
var s, m, d, u;
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
762
|
+
const i = Date.now();
|
|
763
|
+
if (i - t < n)
|
|
757
764
|
return;
|
|
758
|
-
t =
|
|
759
|
-
const
|
|
760
|
-
if (c && (c.style.cursor =
|
|
765
|
+
t = i;
|
|
766
|
+
const l = (s = mapInstance$6.value) == null ? void 0 : s.forEachFeatureAtPixel(r.pixel, (h) => h), c = (m = mapInstance$6.value) == null ? void 0 : m.getTargetElement();
|
|
767
|
+
if (c && (c.style.cursor = l ? "pointer" : ""), e !== l) {
|
|
761
768
|
if (e) {
|
|
762
|
-
const
|
|
763
|
-
if (!(
|
|
769
|
+
const h = e.get("data");
|
|
770
|
+
if (!(h != null && h.mmsi)) return;
|
|
764
771
|
e.setStyle(
|
|
765
|
-
setShipStyle(((d = selectedShipData.value) == null ? void 0 : d.id) ===
|
|
772
|
+
setShipStyle(((d = selectedShipData.value) == null ? void 0 : d.id) === h.id, !1)
|
|
766
773
|
);
|
|
767
774
|
}
|
|
768
|
-
if (
|
|
769
|
-
const
|
|
770
|
-
if (!(
|
|
771
|
-
e =
|
|
772
|
-
setShipStyle(((u = selectedShipData.value) == null ? void 0 : u.id) ===
|
|
775
|
+
if (l) {
|
|
776
|
+
const h = l.get("data");
|
|
777
|
+
if (!(h != null && h.mmsi)) return;
|
|
778
|
+
e = l, l.setStyle(
|
|
779
|
+
setShipStyle(((u = selectedShipData.value) == null ? void 0 : u.id) === h.id, !0)
|
|
773
780
|
);
|
|
774
781
|
} else
|
|
775
782
|
e = null;
|
|
@@ -779,7 +786,7 @@ const renderShips = (e) => {
|
|
|
779
786
|
let t = cloneDeep(e);
|
|
780
787
|
return t = t.filter((n) => {
|
|
781
788
|
var r;
|
|
782
|
-
const o = getFilterItem(n).every(({ btnShow:
|
|
789
|
+
const o = getFilterItem(n).every(({ btnShow: i, value: l }) => i ? !!l : !0);
|
|
783
790
|
return (switchBtnShow.value.camera || switchBtnShow.value.mobile || switchBtnShow.value.waterGauge) && ((r = selectedShipData.value) == null ? void 0 : r.id) === n.id && clearSelectFeature(), o;
|
|
784
791
|
}), t;
|
|
785
792
|
}, getFilterItem = (e) => [
|
|
@@ -791,7 +798,7 @@ const renderShips = (e) => {
|
|
|
791
798
|
e.feature && (shipsVectorSource == null || shipsVectorSource.removeFeature(e.feature));
|
|
792
799
|
}), clearAllInterval(), shipsMarkerList = [];
|
|
793
800
|
}, selectSingleShipMarker = (e) => {
|
|
794
|
-
var
|
|
801
|
+
var i;
|
|
795
802
|
if (!mapInstance$6.value) return;
|
|
796
803
|
const t = cloneDeep(selectSingleShipData.value);
|
|
797
804
|
selectSingleShipData.value = convertShipMapData(e);
|
|
@@ -809,7 +816,7 @@ const renderShips = (e) => {
|
|
|
809
816
|
}), selectShipsLayer.value = new VectorLayer({
|
|
810
817
|
source: selectShipsVectorSource
|
|
811
818
|
}), shipsVectorSource && setVisibleFeatureById(shipsVectorSource, selectSingleShipData.value.id, !0);
|
|
812
|
-
const r = (
|
|
819
|
+
const r = (i = shipsLayer.value) == null ? void 0 : i.getSource();
|
|
813
820
|
return r && (t && setVisibleFeatureById(r, t.id, !0), setVisibleFeatureById(r, selectSingleShipData.value.id, !1)), mapInstance$6.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!0), selectShipsLayer.value;
|
|
814
821
|
}, setVisibleFeatureById = (e, t, n) => {
|
|
815
822
|
e && e.forEachFeature((o) => {
|
|
@@ -817,9 +824,9 @@ const renderShips = (e) => {
|
|
|
817
824
|
r && r.id === t && o.setStyle(n ? setShipStyle(!1, r.id) : setBlankStyle());
|
|
818
825
|
});
|
|
819
826
|
}, findShip = (e, t, n = !0) => {
|
|
820
|
-
var r,
|
|
827
|
+
var r, i, l, c, s;
|
|
821
828
|
if (!e || !mapInstance$6.value) return;
|
|
822
|
-
const o = (
|
|
829
|
+
const o = (l = (i = (r = shipsLayer.value) == null ? void 0 : r.getSource()) == null ? void 0 : i.getFeatures()) == null ? void 0 : l.find((m) => {
|
|
823
830
|
var d;
|
|
824
831
|
return ((d = m.get("data")) == null ? void 0 : d.id) === e;
|
|
825
832
|
});
|
|
@@ -837,8 +844,8 @@ const renderShips = (e) => {
|
|
|
837
844
|
}) || selectedShips.value.push(selectedShipData.value), n && ((c = selectedShipData.value) != null && c.lon) && ((s = selectedShipData.value) != null && s.lat)) {
|
|
838
845
|
const m = mapInstance$6.value.getView(), d = new Point([selectedShipData.value.lon, selectedShipData.value.lat]);
|
|
839
846
|
m.setCenter(transform(d.getCoordinates(), projection.data, projection.mercator));
|
|
840
|
-
const u = m.getZoom(),
|
|
841
|
-
m.setZoom(
|
|
847
|
+
const u = m.getZoom(), h = u < mapZoom.findShipMin ? mapZoom.findShip : u;
|
|
848
|
+
m.setZoom(h);
|
|
842
849
|
}
|
|
843
850
|
return setTimeout(() => {
|
|
844
851
|
t && selectSingleShipMarker(t);
|
|
@@ -869,14 +876,14 @@ const renderShips = (e) => {
|
|
|
869
876
|
renderShips(allShips.value);
|
|
870
877
|
}, clearShipData = (e = !0) => {
|
|
871
878
|
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, o, r,
|
|
873
|
-
e.beginPath(), e.moveTo(t +
|
|
879
|
+
}, labelAlpha = 0.8, pixelRatio = window.devicePixelRatio || 1, labelFont = `500 ${12 * pixelRatio}px Arial`, labelOutSize = 2 * pixelRatio, labelHeight = 10 * pixelRatio, fillRectRadius = (e, t, n, o, r, i, l = 4) => {
|
|
880
|
+
e.beginPath(), e.moveTo(t + l, n), e.arcTo(t + o, n, t + o, n + l, l), e.arcTo(t + o, n + r, t + o - l, n + r, l), e.arcTo(t, n + r, t, n + r - l, l), e.arcTo(t, n, t + l, n, l), e.closePath(), e.fillStyle = i, e.fill();
|
|
874
881
|
}, getPixelFromCoordinate = (e) => {
|
|
875
882
|
if (!e || e.length === 0)
|
|
876
883
|
throw new Error("Points array is empty or invalid.");
|
|
877
884
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, r = -1 / 0;
|
|
878
|
-
for (const [
|
|
879
|
-
|
|
885
|
+
for (const [i, l] of e)
|
|
886
|
+
i < t && (t = i), l < n && (n = l), i > o && (o = i), l > r && (r = l);
|
|
880
887
|
return [t, n, o, r];
|
|
881
888
|
}, calculatePolygonCentroid = (e) => {
|
|
882
889
|
if (!Array.isArray(e) || e.length < 3)
|
|
@@ -884,130 +891,130 @@ const renderShips = (e) => {
|
|
|
884
891
|
let t = 0, n = 0, o = 0;
|
|
885
892
|
const r = e.length;
|
|
886
893
|
for (let c = 0; c < r - 1; c++) {
|
|
887
|
-
const [s, m] = e[c], [d, u] = e[c + 1],
|
|
888
|
-
o +=
|
|
894
|
+
const [s, m] = e[c], [d, u] = e[c + 1], h = s * u - d * m;
|
|
895
|
+
o += h, t += (s + d) * h, n += (m + u) * h;
|
|
889
896
|
}
|
|
890
897
|
if (o *= 0.5, o === 0)
|
|
891
898
|
throw new Error("多边形面积为零");
|
|
892
|
-
const
|
|
893
|
-
return [
|
|
899
|
+
const i = t / (6 * o), l = n / (6 * o);
|
|
900
|
+
return [i, l];
|
|
894
901
|
}, rotateShapeModel = (e, t) => {
|
|
895
|
-
const [n, o] = calculatePolygonCentroid(e), r = t * Math.PI / 180,
|
|
902
|
+
const [n, o] = calculatePolygonCentroid(e), r = t * Math.PI / 180, i = Math.cos(r), l = Math.sin(r);
|
|
896
903
|
return e.map(([c, s]) => {
|
|
897
|
-
const m = c - n, d = s - o, u = m *
|
|
898
|
-
return [u,
|
|
904
|
+
const m = c - n, d = s - o, u = m * i - d * l + n, h = m * l + d * i + o;
|
|
905
|
+
return [u, h];
|
|
899
906
|
});
|
|
900
907
|
}, 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
908
|
function calculateBounds(e, t, n, o, r) {
|
|
902
|
-
let
|
|
909
|
+
let i, l, c, s;
|
|
903
910
|
const m = e[0], d = e[1];
|
|
904
911
|
switch (t) {
|
|
905
912
|
case 0:
|
|
906
|
-
|
|
913
|
+
i = m + r, l = i + n, s = d - r, c = s - o;
|
|
907
914
|
break;
|
|
908
915
|
case 1:
|
|
909
|
-
|
|
916
|
+
i = m + r, l = i + n, s = d + o / 2, c = s - o;
|
|
910
917
|
break;
|
|
911
918
|
case 2:
|
|
912
|
-
|
|
919
|
+
i = m + r, l = i + n, s = d + r + o, c = s - o;
|
|
913
920
|
break;
|
|
914
921
|
case 3:
|
|
915
|
-
|
|
922
|
+
i = m - n / 2, l = i + n, s = d + r + o, c = s - o;
|
|
916
923
|
break;
|
|
917
924
|
case 4:
|
|
918
|
-
|
|
925
|
+
l = m, i = l - n, s = d + r + o, c = s - o;
|
|
919
926
|
break;
|
|
920
927
|
case 5:
|
|
921
|
-
|
|
928
|
+
l = m - r, i = l - n, s = d + o / 2, c = s - o;
|
|
922
929
|
break;
|
|
923
930
|
case 6:
|
|
924
|
-
|
|
931
|
+
l = m, i = l - n, s = d - r, c = s - o;
|
|
925
932
|
break;
|
|
926
933
|
case 7:
|
|
927
|
-
|
|
934
|
+
i = m - n / 2, l = i + n, s = d - r, c = s - o;
|
|
928
935
|
}
|
|
929
|
-
if (!(!
|
|
930
|
-
return [Math.min(
|
|
936
|
+
if (!(!i || !c || !l || !s))
|
|
937
|
+
return [Math.min(i, l), Math.min(c, s), Math.max(i, l), Math.max(c, s) + 1];
|
|
931
938
|
}
|
|
932
939
|
function calculateAnchorPoint(e, t, n = 70, o = 20, r = 20) {
|
|
933
|
-
const
|
|
940
|
+
const i = [0, 0];
|
|
934
941
|
switch (t) {
|
|
935
942
|
case 0:
|
|
936
|
-
|
|
943
|
+
i[0] = e[0] + r, i[1] = e[1] - r - o / 2;
|
|
937
944
|
break;
|
|
938
945
|
case 1:
|
|
939
|
-
|
|
946
|
+
i[0] = e[0] + r, i[1] = e[1];
|
|
940
947
|
break;
|
|
941
948
|
case 2:
|
|
942
|
-
|
|
949
|
+
i[0] = e[0] + r, i[1] = e[1] + r + o / 2;
|
|
943
950
|
break;
|
|
944
951
|
case 3:
|
|
945
|
-
|
|
952
|
+
i[0] = e[0], i[1] = e[1] + r + o / 4;
|
|
946
953
|
break;
|
|
947
954
|
case 4:
|
|
948
|
-
|
|
955
|
+
i[0] = Math.max(e[0] - r, e[0] - n / 2), i[1] = e[1] + r + o / 4;
|
|
949
956
|
break;
|
|
950
957
|
case 5:
|
|
951
|
-
|
|
958
|
+
i[0] = e[0] - r, i[1] = e[1];
|
|
952
959
|
break;
|
|
953
960
|
case 6:
|
|
954
|
-
|
|
961
|
+
i[0] = Math.max(e[0] - r, e[0] - n / 2), i[1] = e[1] - r - o / 4;
|
|
955
962
|
break;
|
|
956
963
|
case 7:
|
|
957
|
-
|
|
964
|
+
i[0] = e[0], i[1] = e[1] - r - o / 4;
|
|
958
965
|
}
|
|
959
|
-
return
|
|
966
|
+
return i;
|
|
960
967
|
}
|
|
961
968
|
function drawLabelBody(e, t, n) {
|
|
962
969
|
if (!e) return;
|
|
963
970
|
const {
|
|
964
971
|
font: o,
|
|
965
972
|
labelOutSize: r = 2,
|
|
966
|
-
labelHeight:
|
|
967
|
-
center:
|
|
973
|
+
labelHeight: i,
|
|
974
|
+
center: l,
|
|
968
975
|
text: c,
|
|
969
976
|
id: s,
|
|
970
977
|
leftIcon: m,
|
|
971
978
|
shipColor: d,
|
|
972
979
|
lineLength: u = 20,
|
|
973
|
-
selected:
|
|
980
|
+
selected: h
|
|
974
981
|
} = n;
|
|
975
982
|
e.save(), o && (e.font = o);
|
|
976
983
|
let p = e.measureText(c).width + 4 * r;
|
|
977
|
-
(m || d) && (p +=
|
|
978
|
-
let
|
|
984
|
+
(m || d) && (p += i + 6 * r), e.restore();
|
|
985
|
+
let f, v = 20, g = -1, L = i + 3 * r;
|
|
979
986
|
if (u)
|
|
980
|
-
for (let
|
|
981
|
-
|
|
987
|
+
for (let S = 0; S < 8; S++) {
|
|
988
|
+
f = calculateBounds(l, S, p, L, u);
|
|
982
989
|
let I = !1;
|
|
983
|
-
for (let
|
|
984
|
-
let
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
990
|
+
for (let F = 0; F < t.length; ++F) {
|
|
991
|
+
let x = t[F].bounds, P = [
|
|
992
|
+
x[0] - v,
|
|
993
|
+
x[1] - v,
|
|
994
|
+
x[2] + v,
|
|
995
|
+
x[3] + v
|
|
989
996
|
];
|
|
990
|
-
if (
|
|
997
|
+
if (f && isOverlapping(f, P)) {
|
|
991
998
|
I = !0;
|
|
992
999
|
break;
|
|
993
1000
|
}
|
|
994
1001
|
}
|
|
995
1002
|
if (!I) {
|
|
996
|
-
|
|
1003
|
+
g = S;
|
|
997
1004
|
break;
|
|
998
1005
|
}
|
|
999
1006
|
}
|
|
1000
1007
|
else
|
|
1001
|
-
|
|
1002
|
-
if (
|
|
1003
|
-
let
|
|
1008
|
+
g = 0, f = calculateBounds(l, g, p, L, u);
|
|
1009
|
+
if (h && g === -1 && (g = 0), f && g > -1) {
|
|
1010
|
+
let S = getBottomLeftPoint(f), I = getTopRighttPoint(f);
|
|
1004
1011
|
return {
|
|
1005
|
-
center:
|
|
1006
|
-
x: calculateAnchorPoint(
|
|
1012
|
+
center: l,
|
|
1013
|
+
x: calculateAnchorPoint(l, g, p, L, u),
|
|
1007
1014
|
l: I,
|
|
1008
|
-
r:
|
|
1009
|
-
bounds:
|
|
1010
|
-
position:
|
|
1015
|
+
r: S,
|
|
1016
|
+
bounds: f,
|
|
1017
|
+
position: g,
|
|
1011
1018
|
name: c,
|
|
1012
1019
|
id: s
|
|
1013
1020
|
};
|
|
@@ -1016,20 +1023,20 @@ function drawLabelBody(e, t, n) {
|
|
|
1016
1023
|
}
|
|
1017
1024
|
const drawText = (e, t) => {
|
|
1018
1025
|
if (!e) return;
|
|
1019
|
-
const { center: n, text: o, textColor: r, leftIcon:
|
|
1026
|
+
const { center: n, text: o, textColor: r, leftIcon: i, rightIcons: l, font: c } = t;
|
|
1020
1027
|
e.save(), e.setTransform(1, 0, 0, 1, 0, 0);
|
|
1021
1028
|
let [s, m] = n;
|
|
1022
|
-
if (
|
|
1029
|
+
if (i) {
|
|
1023
1030
|
e.font = `${18 * pixelRatio}px map-iconfont`;
|
|
1024
|
-
let d = getIconFont(
|
|
1025
|
-
e.fillStyle =
|
|
1031
|
+
let d = getIconFont(i.icon);
|
|
1032
|
+
e.fillStyle = i.color, e.fillText(d, s + labelOutSize - 3 * pixelRatio, m + 2.6 * pixelRatio), s += 23 * pixelRatio;
|
|
1026
1033
|
}
|
|
1027
|
-
if (
|
|
1034
|
+
if (l != null && l.length) {
|
|
1028
1035
|
e.font = `${12 * pixelRatio}px map-iconfont`, e.fillStyle = "#3370ff";
|
|
1029
1036
|
const d = e.measureText(o).width + 6 * pixelRatio;
|
|
1030
|
-
|
|
1031
|
-
const p = getIconFont(u),
|
|
1032
|
-
e.fillText(p, s + d +
|
|
1037
|
+
l.forEach((u, h) => {
|
|
1038
|
+
const p = getIconFont(u), f = 20 * pixelRatio * h;
|
|
1039
|
+
e.fillText(p, s + d + f, m);
|
|
1033
1040
|
});
|
|
1034
1041
|
}
|
|
1035
1042
|
e.font = c || labelFont, e.fillStyle = r, e.fillText(o, s + 2, m), e.restore();
|
|
@@ -1038,39 +1045,39 @@ const drawText = (e, t) => {
|
|
|
1038
1045
|
points: n,
|
|
1039
1046
|
strokeColor: o,
|
|
1040
1047
|
fillColor: r,
|
|
1041
|
-
shouldClosePath:
|
|
1042
|
-
translation:
|
|
1048
|
+
shouldClosePath: i,
|
|
1049
|
+
translation: l,
|
|
1043
1050
|
rotation: c,
|
|
1044
1051
|
rotationCenter: s,
|
|
1045
1052
|
scale: m,
|
|
1046
1053
|
globalAlpha: d
|
|
1047
1054
|
} = t;
|
|
1048
1055
|
if (d || (d = 1), n && e) {
|
|
1049
|
-
e.save(), e.beginPath(), c && c !== 0 && s == null && e.rotate(c),
|
|
1056
|
+
e.save(), e.beginPath(), c && c !== 0 && s == null && e.rotate(c), l && e.translate(l[0], l[1]), c && (s != null && s.length) && e.rotate(c), m && e.scale(m, m), e.moveTo(n[0][0], n[0][1]);
|
|
1050
1057
|
for (let u = 1; u < n.length; u++)
|
|
1051
1058
|
e.lineTo(n[u][0], n[u][1]);
|
|
1052
|
-
|
|
1059
|
+
i && e.closePath(), o && (e.strokeStyle = o, e.stroke()), r && i && (d && (e.globalAlpha = d), e.fillStyle = r, e.fill()), e.restore();
|
|
1053
1060
|
}
|
|
1054
1061
|
}, intervalIds = {}, drawLabel = (e, t, n, o) => {
|
|
1055
|
-
var p,
|
|
1056
|
-
let { center: r, id:
|
|
1057
|
-
if (r &&
|
|
1058
|
-
const
|
|
1062
|
+
var p, f, v, g, L, S, I;
|
|
1063
|
+
let { center: r, id: i, text: l, color: c, textColor: s, bgColor: m, leftIcon: d, rightIcons: u, type: h } = t;
|
|
1064
|
+
if (r && l) {
|
|
1065
|
+
const F = {
|
|
1059
1066
|
font: labelFont,
|
|
1060
1067
|
labelOutSize,
|
|
1061
1068
|
labelHeight,
|
|
1062
1069
|
center: r,
|
|
1063
|
-
text:
|
|
1064
|
-
id:
|
|
1070
|
+
text: l,
|
|
1071
|
+
id: i,
|
|
1065
1072
|
leftIcon: d,
|
|
1066
1073
|
selected: t.selected
|
|
1067
1074
|
};
|
|
1068
1075
|
(p = t.blinkColors) != null && p.length && t.fill && (m = t.fill, s = getForegroundColor(t.fill));
|
|
1069
|
-
const
|
|
1070
|
-
if (
|
|
1071
|
-
const { x:
|
|
1072
|
-
n.find((
|
|
1073
|
-
points: [r,
|
|
1076
|
+
const x = drawLabelBody(e, n, F);
|
|
1077
|
+
if (x) {
|
|
1078
|
+
const { x: P, bounds: $, l: y } = x, w = [getTopLeftPoint($), getBottomLeftPoint($), getBottomRightPoint($), getTopRighttPoint($)];
|
|
1079
|
+
n.find((E) => E.name === l) || n.push(x), drawPolygon(e, {
|
|
1080
|
+
points: [r, P],
|
|
1074
1081
|
strokeColor: c,
|
|
1075
1082
|
fillColor: "#000",
|
|
1076
1083
|
shouldClosePath: !0,
|
|
@@ -1080,78 +1087,78 @@ const drawText = (e, t) => {
|
|
|
1080
1087
|
scale: void 0,
|
|
1081
1088
|
globalAlpha: labelAlpha
|
|
1082
1089
|
}), u != null && u.length && u.forEach(() => {
|
|
1083
|
-
|
|
1090
|
+
w[1][0] += pixelRatio * 18, w[2][0] += pixelRatio * 18;
|
|
1084
1091
|
});
|
|
1085
|
-
const
|
|
1086
|
-
points:
|
|
1092
|
+
const M = {
|
|
1093
|
+
points: w,
|
|
1087
1094
|
strokeColor: c,
|
|
1088
1095
|
fillColor: m,
|
|
1089
1096
|
shouldClosePath: !0
|
|
1090
|
-
}, [T,
|
|
1091
|
-
center: [T,
|
|
1092
|
-
text:
|
|
1097
|
+
}, [T, C] = y, V = {
|
|
1098
|
+
center: [T, C + labelOutSize + labelHeight + 1],
|
|
1099
|
+
text: l,
|
|
1093
1100
|
textColor: s,
|
|
1094
1101
|
leftIcon: d,
|
|
1095
1102
|
rightIcons: u,
|
|
1096
1103
|
blinkColors: t.blinkColors
|
|
1097
1104
|
};
|
|
1098
|
-
if (drawPolygon(e,
|
|
1099
|
-
let
|
|
1100
|
-
const
|
|
1101
|
-
!!!((
|
|
1105
|
+
if (drawPolygon(e, M), drawText(e, V), t != null && t.blinkColors && t.blinkColors.length > 0) {
|
|
1106
|
+
let E = Date.now(), N = 0;
|
|
1107
|
+
const B = t.blinkColors;
|
|
1108
|
+
!!!((g = (v = (f = selectShipsLayer.value) == null ? void 0 : f.getSource()) == null ? void 0 : v.getFeatures()) != null && g.find((R) => {
|
|
1102
1109
|
var A;
|
|
1103
|
-
return ((A =
|
|
1104
|
-
}) || (I = (
|
|
1110
|
+
return ((A = R.get("data")) == null ? void 0 : A.id) === t.id;
|
|
1111
|
+
}) || (I = (S = (L = shipsLayer.value) == null ? void 0 : L.getSource()) == null ? void 0 : S.getFeatures()) != null && I.find((R) => {
|
|
1105
1112
|
var A;
|
|
1106
|
-
return ((A =
|
|
1113
|
+
return ((A = R.get("data")) == null ? void 0 : A.id) === t.id;
|
|
1107
1114
|
})) || hiddenOrther.value ? (clearInterval(intervalIds[t.id]), deleteLabelFromArray(n, t.id)) : (intervalIds[t.id] && clearInterval(intervalIds[t.id]), intervalIds[t.id] = window.setInterval(() => {
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1115
|
+
const R = Date.now();
|
|
1116
|
+
R - E >= 500 && (N = (N + 1) % B.length, E = R, M.fillColor = B[N], drawPolygon(e, M), V.textColor = getForegroundColor(M.fillColor), drawText(e, V)), checkBlinkLabelExist(o, n, t.id);
|
|
1110
1117
|
}, 500));
|
|
1111
1118
|
} else
|
|
1112
|
-
shipLabels.value.find((
|
|
1119
|
+
shipLabels.value.find((N) => N.name === l) && (clearInterval(intervalIds[t.id]), drawPolygon(e, M), drawText(e, V));
|
|
1113
1120
|
}
|
|
1114
1121
|
}
|
|
1115
1122
|
return null;
|
|
1116
1123
|
}, checkBlinkLabelExist = (e, t, n) => {
|
|
1117
|
-
var
|
|
1118
|
-
const o = shipsMarkerList == null ? void 0 : shipsMarkerList.some((
|
|
1119
|
-
var
|
|
1120
|
-
return ((
|
|
1124
|
+
var l, c, s, m, d, u, h;
|
|
1125
|
+
const o = shipsMarkerList == null ? void 0 : shipsMarkerList.some((p) => {
|
|
1126
|
+
var f, v, g;
|
|
1127
|
+
return ((f = p.ship) == null ? void 0 : f.id) === n && ((g = (v = p.ship) == null ? void 0 : v.blinkColors) == null ? void 0 : g.length) > 0;
|
|
1121
1128
|
}), r = [
|
|
1122
|
-
...((c = (
|
|
1129
|
+
...((c = (l = shipsLayer.value) == null ? void 0 : l.getSource()) == null ? void 0 : c.getFeatures()) || [],
|
|
1123
1130
|
...((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
|
|
1131
|
+
].some((p) => {
|
|
1132
|
+
const f = p.get("data");
|
|
1133
|
+
if ((f == null ? void 0 : f.id) === n) {
|
|
1134
|
+
const v = e == null ? void 0 : e.getView().calculateExtent();
|
|
1135
|
+
if (!v) return !1;
|
|
1136
|
+
const g = fromLonLat([f.lon, f.lat]);
|
|
1137
|
+
return g[0] >= v[0] && g[0] <= v[2] && g[1] >= v[1] && g[1] <= v[3];
|
|
1131
1138
|
}
|
|
1132
1139
|
return !1;
|
|
1140
|
+
}), i = (u = (d = trackLineVectorSource.value) == null ? void 0 : d.getFeatures()) == null ? void 0 : u.some((p) => {
|
|
1141
|
+
const f = p.get("data");
|
|
1142
|
+
return (f == null ? void 0 : f.id) === n;
|
|
1133
1143
|
});
|
|
1134
|
-
!((
|
|
1135
|
-
const p = f.get("data");
|
|
1136
|
-
return (p == null ? void 0 : p.id) === n;
|
|
1137
|
-
})) && (!r || !o) && (clearInterval(intervalIds[n]), deleteLabelFromArray(e, t, n));
|
|
1144
|
+
(!((h = shipsLayer.value) != null && h.getVisible()) || !i && (!r || !o)) && (clearInterval(intervalIds[n]), deleteLabelFromArray(e, t, n));
|
|
1138
1145
|
}, clearAllInterval = () => {
|
|
1139
1146
|
Object.keys(intervalIds).forEach((e) => {
|
|
1140
1147
|
clearInterval(e);
|
|
1141
1148
|
});
|
|
1142
1149
|
}, deleteLabelFromArray = (e, t, n) => {
|
|
1143
|
-
var r,
|
|
1144
|
-
const o = t.findIndex((
|
|
1150
|
+
var r, i, l, c, s, m, d, u;
|
|
1151
|
+
const o = t.findIndex((h) => h.id === n);
|
|
1145
1152
|
if (o !== -1) {
|
|
1146
1153
|
t.splice(o, 1);
|
|
1147
|
-
const
|
|
1154
|
+
const h = (i = (r = shipsLayer.value) == null ? void 0 : r.getSource()) == null ? void 0 : i.getFeatures().find((f) => {
|
|
1148
1155
|
var v;
|
|
1149
|
-
return ((v =
|
|
1156
|
+
return ((v = f.get("data")) == null ? void 0 : v.id) === n;
|
|
1150
1157
|
});
|
|
1151
|
-
|
|
1152
|
-
const p = (m = (s = selectShipsLayer.value) == null ? void 0 : s.getSource()) == null ? void 0 : m.getFeatures().find((
|
|
1158
|
+
h && ((c = (l = shipsLayer.value) == null ? void 0 : l.getSource()) == null || c.removeFeature(h));
|
|
1159
|
+
const p = (m = (s = selectShipsLayer.value) == null ? void 0 : s.getSource()) == null ? void 0 : m.getFeatures().find((f) => {
|
|
1153
1160
|
var v;
|
|
1154
|
-
return ((v =
|
|
1161
|
+
return ((v = f.get("data")) == null ? void 0 : v.id) === n;
|
|
1155
1162
|
});
|
|
1156
1163
|
p && ((u = (d = selectShipsLayer.value) == null ? void 0 : d.getSource()) == null || u.removeFeature(p)), e && e.render();
|
|
1157
1164
|
}
|
|
@@ -1173,11 +1180,11 @@ function gcj02ToWgs84(e) {
|
|
|
1173
1180
|
return `${t.toFixed(6)}, ${n.toFixed(6)}`;
|
|
1174
1181
|
{
|
|
1175
1182
|
let o = transformLat(t - 105, n - 35), r = transformLng(t - 105, n - 35);
|
|
1176
|
-
const
|
|
1177
|
-
let
|
|
1178
|
-
|
|
1179
|
-
const c = Math.sqrt(
|
|
1180
|
-
o = o * 180 / (a * (1 - ee) / (
|
|
1183
|
+
const i = n / 180 * PI;
|
|
1184
|
+
let l = Math.sin(i);
|
|
1185
|
+
l = 1 - ee * l * l;
|
|
1186
|
+
const c = Math.sqrt(l);
|
|
1187
|
+
o = o * 180 / (a * (1 - ee) / (l * c) * PI), r = r * 180 / (a / c * Math.cos(i) * PI);
|
|
1181
1188
|
const s = n + o, m = t + r;
|
|
1182
1189
|
return `${(t * 2 - m).toFixed(6)}, ${(n * 2 - s).toFixed(6)}`;
|
|
1183
1190
|
}
|
|
@@ -1188,12 +1195,12 @@ function calculateCirclePoints(e, t) {
|
|
|
1188
1195
|
n[1] - o,
|
|
1189
1196
|
n[0] + o,
|
|
1190
1197
|
n[1] + o
|
|
1191
|
-
],
|
|
1198
|
+
], i = transformExtent(r, projection.mercator, projection.data);
|
|
1192
1199
|
return {
|
|
1193
|
-
leftTopPoint: { lng:
|
|
1194
|
-
rightTopPoint: { lng:
|
|
1195
|
-
rightBottomPoint: { lng:
|
|
1196
|
-
leftBottomPoint: { lng:
|
|
1200
|
+
leftTopPoint: { lng: i[0], lat: i[3] },
|
|
1201
|
+
rightTopPoint: { lng: i[2], lat: i[3] },
|
|
1202
|
+
rightBottomPoint: { lng: i[2], lat: i[1] },
|
|
1203
|
+
leftBottomPoint: { lng: i[0], lat: i[1] }
|
|
1197
1204
|
};
|
|
1198
1205
|
}
|
|
1199
1206
|
const equatorialCircumference = 2003750834e-2;
|
|
@@ -1210,11 +1217,11 @@ function mercatorToLonLat(e, t = "lonlat") {
|
|
|
1210
1217
|
function calculateBoundingBox(e) {
|
|
1211
1218
|
let t = 1 / 0, n = -1 / 0, o = 1 / 0, r = -1 / 0;
|
|
1212
1219
|
e.forEach((v) => {
|
|
1213
|
-
const [
|
|
1214
|
-
t = Math.min(t,
|
|
1220
|
+
const [g, L] = v;
|
|
1221
|
+
t = Math.min(t, L), n = Math.max(n, L), o = Math.min(o, g), r = Math.max(r, g);
|
|
1215
1222
|
});
|
|
1216
|
-
const
|
|
1217
|
-
return [
|
|
1223
|
+
const i = r - o, l = n - t, c = Math.max(i, l), s = (o + r) / 2, m = (t + n) / 2, d = c / 2, u = s - d, h = s + d, p = m - d, f = m + d;
|
|
1224
|
+
return [h, p, u, f];
|
|
1218
1225
|
}
|
|
1219
1226
|
const transformUtils = {
|
|
1220
1227
|
gcj02ToWgs84,
|
|
@@ -1226,21 +1233,21 @@ const transformUtils = {
|
|
|
1226
1233
|
}, mapInstance$5 = ref(), renderTrackStyleSetInstance = (e) => mapInstance$5.value = e, stopIcon = "", stopColor = "#E31818", slowIcon = "", slowColor = "#1890FF", dropletsIcon = "", trackList$1 = ref([]);
|
|
1227
1234
|
let animationFeature;
|
|
1228
1235
|
const renderTrackLine = (e, t, n) => {
|
|
1229
|
-
var
|
|
1236
|
+
var l, c, s;
|
|
1230
1237
|
const o = e[t];
|
|
1231
1238
|
if (!o) return;
|
|
1232
1239
|
allTracks.value[t] = o, trackList$1.value = [];
|
|
1233
1240
|
let r = o;
|
|
1234
1241
|
o.length > 5e3 ? o.filter((m, d) => d % 5 === 0) : o.length > 4e3 ? o.filter((m, d) => d % 4 === 0) : o.length > 2e3 && o.filter((m, d) => d % 2 === 0), trackList$1.value = r.map((m, d) => {
|
|
1235
1242
|
if (Number(m.lon) > 180 || Number(m.lat) > 180) {
|
|
1236
|
-
const [u,
|
|
1237
|
-
m.lon = u, m.lat =
|
|
1243
|
+
const [u, h] = formatUtils.convertSixHundredThousandToLatLng(m.lon, m.lat);
|
|
1244
|
+
m.lon = u, m.lat = h;
|
|
1238
1245
|
}
|
|
1239
1246
|
return m.center = [m.lon, m.lat], m.centerPoint = transformUtils.lonLatToMercator(m.center), m.id = t, m.index = d, m.time = hooks(m.createdAt).format("YYYY-MM-DD HH:mm:ss"), m;
|
|
1240
1247
|
});
|
|
1241
|
-
const
|
|
1242
|
-
if (
|
|
1243
|
-
const m = new LineString(
|
|
1248
|
+
const i = trackList$1.value.map((m) => m.centerPoint);
|
|
1249
|
+
if (i.length >= 2) {
|
|
1250
|
+
const m = new LineString(i), d = new Feature({ geometry: m });
|
|
1244
1251
|
d.setStyle(
|
|
1245
1252
|
new Style({
|
|
1246
1253
|
stroke: new Stroke({
|
|
@@ -1248,13 +1255,13 @@ const renderTrackLine = (e, t, n) => {
|
|
|
1248
1255
|
width: 2
|
|
1249
1256
|
})
|
|
1250
1257
|
})
|
|
1251
|
-
), d.setId(t), d.set("type", "line"), (c = (
|
|
1258
|
+
), d.setId(t), d.set("type", "line"), (c = (l = shipTrackVectorLayer.value) == null ? void 0 : l.getSource()) == null || c.clear(), shipTrackLineFeatures.value = [];
|
|
1252
1259
|
const u = shipTrackLineFeatures.value.findIndex((p) => p.getId() === t);
|
|
1253
1260
|
u >= 0 ? shipTrackLineFeatures.value[u] = d : shipTrackLineFeatures.value.push(d);
|
|
1254
|
-
const
|
|
1261
|
+
const h = createAnimatedIconFeature(n, i);
|
|
1255
1262
|
trackLineVectorSource.value = new VectorSource({
|
|
1256
1263
|
features: [...shipTrackLineFeatures.value]
|
|
1257
|
-
}), animationFeature =
|
|
1264
|
+
}), animationFeature = h, console.log(animationFeature), shipTrackVectorLayer.value = new VectorLayer({
|
|
1258
1265
|
source: trackLineVectorSource.value,
|
|
1259
1266
|
zIndex: 102
|
|
1260
1267
|
}), renderPoint(n), (s = mapInstance$5.value) == null || s.addLayer(shipTrackVectorLayer.value);
|
|
@@ -1291,23 +1298,23 @@ let polyline, linePath, startMarker, position, geoMarker, vectorLayer;
|
|
|
1291
1298
|
const trackAnimating = ref(!1);
|
|
1292
1299
|
let distance = 0, lastTime = Date.now(), moveFeatureHandler = null;
|
|
1293
1300
|
const moveFeature = (e, t) => {
|
|
1294
|
-
var u,
|
|
1301
|
+
var u, h, p;
|
|
1295
1302
|
const n = Number(50 * t), o = ((u = e.frameState) == null ? void 0 : u.time) ?? Date.now(), r = o - lastTime;
|
|
1296
1303
|
if (distance = (distance + n * r / 1e6) % 2, lastTime = o, distance >= 1) {
|
|
1297
1304
|
stopAnimation();
|
|
1298
1305
|
return;
|
|
1299
1306
|
}
|
|
1300
|
-
const
|
|
1307
|
+
const i = linePath.getCoordinateAt(
|
|
1301
1308
|
distance > 1 ? 2 - distance : distance
|
|
1302
|
-
),
|
|
1309
|
+
), l = linePath.getCoordinateAt(
|
|
1303
1310
|
distance > 1 ? distance - 0.01 : distance
|
|
1304
1311
|
), c = linePath.getCoordinateAt(
|
|
1305
1312
|
distance > 1 ? 2 - distance : distance + 0.01
|
|
1306
1313
|
), m = getRotation(
|
|
1307
|
-
transformUtils.mercatorToLonLat(
|
|
1314
|
+
transformUtils.mercatorToLonLat(l, "array"),
|
|
1308
1315
|
transformUtils.mercatorToLonLat(c, "array")
|
|
1309
1316
|
) * Math.PI / 180;
|
|
1310
|
-
(
|
|
1317
|
+
(h = geoMarkerStyle.getText()) == null || h.setRotation(m), position.setCoordinates(i);
|
|
1311
1318
|
const d = getVectorContext(e);
|
|
1312
1319
|
d.context_.save(), d.setStyle(geoMarkerStyle), d.drawGeometry(position), d.context_.restore(), (p = mapInstance$5.value) == null || p.render();
|
|
1313
1320
|
}, startAnimation = () => {
|
|
@@ -1353,13 +1360,13 @@ const moveFeature = (e, t) => {
|
|
|
1353
1360
|
const d = mapInstance$5.value.getView().getZoom();
|
|
1354
1361
|
if (!d) return;
|
|
1355
1362
|
if (d > 15) {
|
|
1356
|
-
const
|
|
1357
|
-
m = adjustBounds(m, [
|
|
1363
|
+
const h = n[d] || n.default;
|
|
1364
|
+
m = adjustBounds(m, [h, h]);
|
|
1358
1365
|
}
|
|
1359
1366
|
let u = !0;
|
|
1360
1367
|
if (t[c].state !== "0") {
|
|
1361
|
-
for (let
|
|
1362
|
-
if (isOverlapping(m, o[
|
|
1368
|
+
for (let h = 0; h < o.length; h++)
|
|
1369
|
+
if (isOverlapping(m, o[h].bounds)) {
|
|
1363
1370
|
u = !1;
|
|
1364
1371
|
break;
|
|
1365
1372
|
}
|
|
@@ -1367,9 +1374,9 @@ const moveFeature = (e, t) => {
|
|
|
1367
1374
|
u && (t[c].bounds = m, o.push(t[c]));
|
|
1368
1375
|
}
|
|
1369
1376
|
}
|
|
1370
|
-
const
|
|
1377
|
+
const i = getIconStyle(stopIcon), l = getIconStyle(slowIcon);
|
|
1371
1378
|
o.forEach((c, s) => {
|
|
1372
|
-
var u,
|
|
1379
|
+
var u, h;
|
|
1373
1380
|
const m = new Feature({
|
|
1374
1381
|
geometry: new Point(c.centerPoint)
|
|
1375
1382
|
});
|
|
@@ -1400,7 +1407,7 @@ const moveFeature = (e, t) => {
|
|
|
1400
1407
|
geometry: new Point(c.centerPoint)
|
|
1401
1408
|
});
|
|
1402
1409
|
p.set("type", "track_icon");
|
|
1403
|
-
const
|
|
1410
|
+
const f = new Style({
|
|
1404
1411
|
text: new Text({
|
|
1405
1412
|
font: "Normal 22px map-iconfont",
|
|
1406
1413
|
text: getIconFont(dropletsIcon),
|
|
@@ -1408,7 +1415,7 @@ const moveFeature = (e, t) => {
|
|
|
1408
1415
|
}),
|
|
1409
1416
|
zIndex: 99
|
|
1410
1417
|
}), v = [];
|
|
1411
|
-
Number(c.state) === 0 ? ((u =
|
|
1418
|
+
Number(c.state) === 0 ? ((u = f.getText()) == null || u.setFill(new Fill({ color: stopColor })), v.push(i)) : Number(c.state) === 1 && ((h = f.getText()) == null || h.setFill(new Fill({ color: slowColor })), v.push(l)), v.push(f), p.setStyle(v), trackLineVectorSource.value.addFeature(p);
|
|
1412
1419
|
}
|
|
1413
1420
|
}), renderArrow(o, e), renderIconPoint();
|
|
1414
1421
|
}, renderArrow = (e, t) => {
|
|
@@ -1416,14 +1423,14 @@ const moveFeature = (e, t) => {
|
|
|
1416
1423
|
n || (e.push(trackList$1.value[0]), e.push(trackList$1.value[trackList$1.value.length - 1]));
|
|
1417
1424
|
for (let o = 0; o < n - 1; o++) {
|
|
1418
1425
|
let r;
|
|
1419
|
-
const
|
|
1420
|
-
if (
|
|
1421
|
-
r = trackList$1.value[
|
|
1426
|
+
const i = e[o], l = (e[o + 1].index + i.index) / 2;
|
|
1427
|
+
if (l % 2 === 0)
|
|
1428
|
+
r = trackList$1.value[l].centerPoint;
|
|
1422
1429
|
else {
|
|
1423
|
-
const c = trackList$1.value[Math.floor(
|
|
1430
|
+
const c = trackList$1.value[Math.floor(l)], s = trackList$1.value[Math.ceil(l)];
|
|
1424
1431
|
if (c && s) {
|
|
1425
|
-
const [m, d] = c.centerPoint, [u,
|
|
1426
|
-
r = [(m + u) / 2, (d +
|
|
1432
|
+
const [m, d] = c.centerPoint, [u, h] = s.centerPoint;
|
|
1433
|
+
r = [(m + u) / 2, (d + h) / 2];
|
|
1427
1434
|
}
|
|
1428
1435
|
}
|
|
1429
1436
|
if (r) {
|
|
@@ -1449,21 +1456,21 @@ const moveFeature = (e, t) => {
|
|
|
1449
1456
|
}, renderIconPoint = () => {
|
|
1450
1457
|
const e = "", t = "#fcdc3f", n = "#ff0000";
|
|
1451
1458
|
(trackList$1.value.length < 2 ? [trackList$1.value[0]] : [trackList$1.value[0], trackList$1.value[trackList$1.value.length - 1]]).forEach((r) => {
|
|
1452
|
-
const
|
|
1459
|
+
const i = new Feature({
|
|
1453
1460
|
geometry: new Point(r.centerPoint)
|
|
1454
1461
|
});
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
|
|
1462
|
+
i.set("type", "track_begin"), i.set("data", r);
|
|
1463
|
+
const l = r.index === 0 && trackList$1.value.length >= 2 ? t : n;
|
|
1464
|
+
i.setStyle(
|
|
1458
1465
|
new Style({
|
|
1459
1466
|
text: new Text({
|
|
1460
1467
|
font: "Normal 14px map-iconfont",
|
|
1461
1468
|
text: getIconFont(e),
|
|
1462
|
-
fill: new Fill({ color:
|
|
1469
|
+
fill: new Fill({ color: l })
|
|
1463
1470
|
}),
|
|
1464
1471
|
zIndex: 101
|
|
1465
1472
|
})
|
|
1466
|
-
), trackLineVectorSource.value.addFeature(
|
|
1473
|
+
), trackLineVectorSource.value.addFeature(i);
|
|
1467
1474
|
});
|
|
1468
1475
|
}, setTrackLabelStyle = (e, t) => new Style({
|
|
1469
1476
|
renderer: (n, o) => {
|
|
@@ -1479,17 +1486,17 @@ const moveFeature = (e, t) => {
|
|
|
1479
1486
|
};
|
|
1480
1487
|
drawLabel(r, c, trackLabels.value);
|
|
1481
1488
|
}
|
|
1482
|
-
}), mapInstance$4 = ref(), renderCustomOverlaySetInstance = (e) => mapInstance$4.value = e, drawCustomContent = (e, t, n, o = "top-left", r = !1,
|
|
1483
|
-
var u,
|
|
1489
|
+
}), mapInstance$4 = ref(), renderCustomOverlaySetInstance = (e) => mapInstance$4.value = e, drawCustomContent = (e, t, n, o = "top-left", r = !1, i = !0) => {
|
|
1490
|
+
var u, h;
|
|
1484
1491
|
if (!t || !mapInstance$4.value) return;
|
|
1485
|
-
|
|
1486
|
-
var
|
|
1487
|
-
return (
|
|
1492
|
+
i && document.querySelectorAll(".truck-custom-content").forEach((p) => {
|
|
1493
|
+
var f;
|
|
1494
|
+
return (f = p.parentNode) == null ? void 0 : f.removeChild(p);
|
|
1488
1495
|
});
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1496
|
+
const l = document.createElement("div");
|
|
1497
|
+
l.innerHTML = n;
|
|
1491
1498
|
const c = new Overlay({
|
|
1492
|
-
element:
|
|
1499
|
+
element: l,
|
|
1493
1500
|
position: t,
|
|
1494
1501
|
// 初始位置
|
|
1495
1502
|
positioning: o,
|
|
@@ -1497,32 +1504,32 @@ const moveFeature = (e, t) => {
|
|
|
1497
1504
|
// 设置不阻拦事件
|
|
1498
1505
|
});
|
|
1499
1506
|
if (r) {
|
|
1500
|
-
let p = !1,
|
|
1501
|
-
|
|
1502
|
-
var
|
|
1503
|
-
p = !0,
|
|
1504
|
-
const I = (
|
|
1505
|
-
I && (
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
],
|
|
1509
|
-
}), document.addEventListener("mousemove", function(
|
|
1507
|
+
let p = !1, f = [0, 0], v = [0, 0], g = 0, L = 0;
|
|
1508
|
+
l.addEventListener("mousedown", function(S) {
|
|
1509
|
+
var F;
|
|
1510
|
+
p = !0, g = S.clientX, L = S.clientY;
|
|
1511
|
+
const I = (F = mapInstance$4.value) == null ? void 0 : F.getCoordinateFromPixel([S.clientX - 200, S.clientY - 200]);
|
|
1512
|
+
I && (f = I), v = [
|
|
1513
|
+
S.clientX - l.getBoundingClientRect().left + 160,
|
|
1514
|
+
S.clientY - l.getBoundingClientRect().top + 84
|
|
1515
|
+
], S.preventDefault(), console.log(e, g, L);
|
|
1516
|
+
}), document.addEventListener("mousemove", function(S) {
|
|
1510
1517
|
var I;
|
|
1511
1518
|
if (p) {
|
|
1512
|
-
const
|
|
1513
|
-
c.setPosition([
|
|
1519
|
+
const F = (I = mapInstance$4.value) == null ? void 0 : I.getCoordinateFromPixel([S.clientX - v[0], S.clientY - v[1]]), x = F[0] - f[0], P = F[1] - f[1];
|
|
1520
|
+
c.setPosition([f[0] + x, f[1] + P]);
|
|
1514
1521
|
}
|
|
1515
1522
|
}), document.addEventListener("mouseup", function() {
|
|
1516
1523
|
p = !1;
|
|
1517
1524
|
});
|
|
1518
1525
|
}
|
|
1519
1526
|
(u = mapInstance$4.value) == null || u.addOverlay(c);
|
|
1520
|
-
const s =
|
|
1527
|
+
const s = l.querySelector(".close-button");
|
|
1521
1528
|
s && s.addEventListener("click", () => {
|
|
1522
|
-
var p,
|
|
1523
|
-
(p = mapInstance$4.value) == null || p.removeOverlay(c), (
|
|
1529
|
+
var p, f;
|
|
1530
|
+
(p = mapInstance$4.value) == null || p.removeOverlay(c), (f = l.parentNode) == null || f.removeChild(l);
|
|
1524
1531
|
});
|
|
1525
|
-
const m = JSON.parse(JSON.stringify(t)), d = (
|
|
1532
|
+
const m = JSON.parse(JSON.stringify(t)), d = (h = mapInstance$4.value) == null ? void 0 : h.getCoordinateFromPixel(m);
|
|
1526
1533
|
return c.setPosition(d), c;
|
|
1527
1534
|
}, mapInstance$3 = ref(), renderTrackSetInstance = (e) => mapInstance$3.value = e, showTracks = ref([]), trackList = ref([]);
|
|
1528
1535
|
ref(null);
|
|
@@ -1535,21 +1542,21 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1535
1542
|
((d = showTracks.value) == null ? void 0 : d.findIndex((u) => u.id === e)) < 0 && showTracks.value.push({ id: e, length: "" });
|
|
1536
1543
|
return;
|
|
1537
1544
|
}
|
|
1538
|
-
const
|
|
1545
|
+
const i = {};
|
|
1539
1546
|
t.forEach((u) => {
|
|
1540
1547
|
u.state ? u.state = Number(u.state) : delete u.state;
|
|
1541
|
-
}), trackId.value = e,
|
|
1542
|
-
const
|
|
1548
|
+
}), trackId.value = e, i[e] = t, trackList.value = t;
|
|
1549
|
+
const l = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], c = i[e].map(
|
|
1543
1550
|
(u) => transform([u.lon, u.lat], projection.data, projection.mercator)
|
|
1544
1551
|
), s = new LineString(c), m = formatUtils.formatLength(s, o) || "--";
|
|
1545
1552
|
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 >
|
|
1553
|
+
var h, p;
|
|
1554
|
+
const u = (h = showTracks.value) == null ? void 0 : h.findIndex((f) => f.id === e);
|
|
1555
|
+
u < 0 ? showTracks.value.push({ id: e, length: m }) : showTracks.value[u].length = m, ++cursor.value, cursor.value > l.length && (cursor.value = 0), renderTrackLine(i, e, n), nextTick(() => {
|
|
1549
1556
|
resetTrackView(e);
|
|
1550
1557
|
}).then(() => {
|
|
1551
1558
|
}), (p = mapInstance$3.value) == null || p.on("moveend", () => {
|
|
1552
|
-
showTrackLayer.value && (trackLabels.value = [], renderTrackLine(
|
|
1559
|
+
showTrackLayer.value && (trackLabels.value = [], renderTrackLine(i, e, n));
|
|
1553
1560
|
}), renderTrackPointPopup();
|
|
1554
1561
|
}).then(() => {
|
|
1555
1562
|
});
|
|
@@ -1557,9 +1564,9 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1557
1564
|
var t;
|
|
1558
1565
|
const e = ref(null);
|
|
1559
1566
|
(t = mapInstance$3.value) == null || t.on("pointermove", (n) => {
|
|
1560
|
-
var r,
|
|
1567
|
+
var r, i, l, c;
|
|
1561
1568
|
e.value && ((r = mapInstance$3.value) == null || r.removeOverlay(e.value));
|
|
1562
|
-
const o = (
|
|
1569
|
+
const o = (i = mapInstance$3.value) == null ? void 0 : i.forEachFeatureAtPixel(n.pixel, (s) => s);
|
|
1563
1570
|
if (o) {
|
|
1564
1571
|
const s = o.get("data");
|
|
1565
1572
|
if (!(s != null && s.time)) return;
|
|
@@ -1601,10 +1608,10 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1601
1608
|
<div class="item-item">${s.time}</div>
|
|
1602
1609
|
</div>
|
|
1603
1610
|
${m ?? m}
|
|
1604
|
-
</div>`, u = (
|
|
1611
|
+
</div>`, u = (l = mapInstance$3.value) == null ? void 0 : l.getPixelFromCoordinate(n.coordinate);
|
|
1605
1612
|
if (u) {
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1613
|
+
const h = drawCustomContent(s.time, u, d, "top-left");
|
|
1614
|
+
h && (e.value = h);
|
|
1608
1615
|
}
|
|
1609
1616
|
} else
|
|
1610
1617
|
e.value && ((c = mapInstance$3.value) == null || c.removeOverlay(e.value));
|
|
@@ -1616,20 +1623,20 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1616
1623
|
handlePlay(String(e), t);
|
|
1617
1624
|
}, resetTrackView = (e) => {
|
|
1618
1625
|
var r;
|
|
1619
|
-
const t = mapInstance$3.value.getView(), n = e ? shipTrackLineFeatures.value.find((
|
|
1626
|
+
const t = mapInstance$3.value.getView(), n = e ? shipTrackLineFeatures.value.find((i) => i.getId() === e) : shipTrackLineFeatures.value[0];
|
|
1620
1627
|
if (!n) return;
|
|
1621
1628
|
const o = (r = n == null ? void 0 : n.getGeometry()) == null ? void 0 : r.getExtent();
|
|
1622
1629
|
if (o != null && o.length)
|
|
1623
1630
|
try {
|
|
1624
|
-
const
|
|
1625
|
-
t.fit(
|
|
1626
|
-
} catch (
|
|
1627
|
-
console.log(
|
|
1631
|
+
const i = buffer(o, Math.max(o[2] - o[0], o[3] - o[1]) * 0.02);
|
|
1632
|
+
t.fit(i);
|
|
1633
|
+
} catch (i) {
|
|
1634
|
+
console.log(i);
|
|
1628
1635
|
}
|
|
1629
1636
|
}, formatMinutesToDDHHMM = (e) => {
|
|
1630
1637
|
const t = hooks.duration(e, "minutes"), n = Math.floor(t.asDays()), o = t.hours(), r = t.minutes();
|
|
1631
|
-
let
|
|
1632
|
-
return o !== 0 && (
|
|
1638
|
+
let i = `${String(r).padStart(2, "0")}分`;
|
|
1639
|
+
return o !== 0 && (i = `${String(o).padStart(2, "0")}时${i}`), n !== 0 && (i = `${String(n).padStart(2, "0")}天${i}`), i;
|
|
1633
1640
|
}, _hoisted_1$3 = {
|
|
1634
1641
|
key: 0,
|
|
1635
1642
|
class: "more-tool-panel"
|
|
@@ -1644,28 +1651,28 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1644
1651
|
},
|
|
1645
1652
|
emits: ["switchGreenDot", "switchMapTile"],
|
|
1646
1653
|
setup(e, { emit: t }) {
|
|
1647
|
-
var p,
|
|
1648
|
-
const n = inject("mapInstance"), o = e, r = t,
|
|
1649
|
-
o.disableGreenDot ||
|
|
1654
|
+
var p, f;
|
|
1655
|
+
const n = inject("mapInstance"), o = e, r = t, i = ref(((f = (p = n == null ? void 0 : n.value) == null ? void 0 : p.getView()) == null ? void 0 : f.getZoom()) || mapZoom.default), l = ref(!1), c = ref(null), s = ref(!0), m = () => {
|
|
1656
|
+
o.disableGreenDot || i.value >= mapZoom.shipGreenDotMax || (s.value = !s.value, r("switchGreenDot", s.value));
|
|
1650
1657
|
}, d = () => {
|
|
1651
1658
|
r("switchMapTile", o.mapTileMode === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector);
|
|
1652
1659
|
}, u = () => {
|
|
1653
|
-
var v,
|
|
1654
|
-
|
|
1655
|
-
},
|
|
1660
|
+
var v, g;
|
|
1661
|
+
l.value ? (showMeasure.value = !1, (v = c.value) == null || v.removeInteraction()) : (showMeasure.value = !0, (g = c.value) == null || g.addInteraction()), l.value = !l.value;
|
|
1662
|
+
}, h = () => {
|
|
1656
1663
|
var v;
|
|
1657
|
-
(v = c.value) == null || v.removeInteraction(),
|
|
1664
|
+
(v = c.value) == null || v.removeInteraction(), l.value = !1;
|
|
1658
1665
|
};
|
|
1659
1666
|
return onMounted(() => {
|
|
1660
1667
|
nextTick(() => {
|
|
1661
1668
|
var v;
|
|
1662
1669
|
(v = n == null ? void 0 : n.value) == null || v.on("moveend", () => {
|
|
1663
|
-
var
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1670
|
+
var L, S;
|
|
1671
|
+
const g = (S = (L = n == null ? void 0 : n.value) == null ? void 0 : L.getView()) == null ? void 0 : S.getZoom();
|
|
1672
|
+
g && (i.value = g);
|
|
1666
1673
|
});
|
|
1667
1674
|
});
|
|
1668
|
-
}), (v,
|
|
1675
|
+
}), (v, g) => (openBlock(), createElementBlock(Fragment, null, [
|
|
1669
1676
|
createElementVNode("div", {
|
|
1670
1677
|
class: normalizeClass(`tool-panel ${v.viewMode}`)
|
|
1671
1678
|
}, [
|
|
@@ -1673,48 +1680,48 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1673
1680
|
createElementVNode("div", _hoisted_2$1, [
|
|
1674
1681
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1675
1682
|
key: 0,
|
|
1676
|
-
class: normalizeClass(["switch-btn", `${
|
|
1683
|
+
class: normalizeClass(["switch-btn", `${l.value && "active"}`]),
|
|
1677
1684
|
onClick: u
|
|
1678
|
-
},
|
|
1685
|
+
}, g[5] || (g[5] = [
|
|
1679
1686
|
createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
|
|
1680
1687
|
createElementVNode("div", { class: "button-text" }, "测距", -1)
|
|
1681
1688
|
]), 2)) : createCommentVNode("", !0),
|
|
1682
1689
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1683
1690
|
key: 1,
|
|
1684
|
-
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot ||
|
|
1691
|
+
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot || i.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
|
|
1685
1692
|
onClick: m
|
|
1686
|
-
},
|
|
1693
|
+
}, g[6] || (g[6] = [
|
|
1687
1694
|
createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
|
|
1688
1695
|
createElementVNode("div", { class: "button-text" }, "绿点", -1)
|
|
1689
1696
|
]), 2)) : createCommentVNode("", !0),
|
|
1690
1697
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1691
1698
|
key: 2,
|
|
1692
1699
|
class: normalizeClass(`switch-btn ${v.mapTileMode === unref(BaseMapType).satellite && "active"}`),
|
|
1693
|
-
onClick:
|
|
1694
|
-
},
|
|
1700
|
+
onClick: g[0] || (g[0] = (L) => d())
|
|
1701
|
+
}, g[7] || (g[7] = [
|
|
1695
1702
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1696
1703
|
createElementVNode("div", { class: "button-text" }, "图层", -1)
|
|
1697
1704
|
]), 2)) : createCommentVNode("", !0),
|
|
1698
1705
|
v.vehicleMode === "truck" ? (openBlock(), createElementBlock("div", {
|
|
1699
1706
|
key: 3,
|
|
1700
1707
|
class: normalizeClass(`switch-btn ${v.mapTileMode === unref(BaseMapType).satellite && "active"}`),
|
|
1701
|
-
onClick:
|
|
1702
|
-
},
|
|
1708
|
+
onClick: g[1] || (g[1] = (L) => d())
|
|
1709
|
+
}, g[8] || (g[8] = [
|
|
1703
1710
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1704
1711
|
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
1705
1712
|
]), 2)) : createCommentVNode("", !0),
|
|
1706
1713
|
v.showTrackLayer ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1707
1714
|
createElementVNode("div", {
|
|
1708
1715
|
class: "switch-btn multiple",
|
|
1709
|
-
onClick:
|
|
1710
|
-
},
|
|
1716
|
+
onClick: g[2] || (g[2] = (L) => unref(playTrack)(unref(currentTrackId), 1))
|
|
1717
|
+
}, g[9] || (g[9] = [
|
|
1711
1718
|
createElementVNode("i", { class: "map-iconfont icon-play" }, null, -1),
|
|
1712
1719
|
createElementVNode("div", { class: "button-text" }, "播放轨迹", -1)
|
|
1713
1720
|
])),
|
|
1714
1721
|
createElementVNode("div", {
|
|
1715
1722
|
class: "switch-btn multiple",
|
|
1716
|
-
onClick:
|
|
1717
|
-
},
|
|
1723
|
+
onClick: g[3] || (g[3] = (L) => unref(resetTrackView)())
|
|
1724
|
+
}, g[10] || (g[10] = [
|
|
1718
1725
|
createElementVNode("i", { class: "map-iconfont icon-center" }, null, -1),
|
|
1719
1726
|
createElementVNode("div", { class: "button-text" }, "轨迹居中", -1)
|
|
1720
1727
|
]))
|
|
@@ -1724,17 +1731,17 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1724
1731
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1725
1732
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1726
1733
|
createElementVNode("div", {
|
|
1727
|
-
class: normalizeClass(["switch-btn", `${
|
|
1734
|
+
class: normalizeClass(["switch-btn", `${l.value && "active"}`]),
|
|
1728
1735
|
onClick: u
|
|
1729
|
-
},
|
|
1736
|
+
}, g[11] || (g[11] = [
|
|
1730
1737
|
createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
|
|
1731
1738
|
createElementVNode("div", { class: "button-text" }, "测距", -1)
|
|
1732
1739
|
]), 2),
|
|
1733
1740
|
v.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1734
1741
|
key: 0,
|
|
1735
|
-
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot ||
|
|
1742
|
+
class: normalizeClass(`switch-btn ${s.value && "active"} ${(v.disableGreenDot || i.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
|
|
1736
1743
|
onClick: m
|
|
1737
|
-
},
|
|
1744
|
+
}, g[12] || (g[12] = [
|
|
1738
1745
|
createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
|
|
1739
1746
|
createElementVNode("div", { class: "button-text" }, "绿点", -1)
|
|
1740
1747
|
]), 2)) : createCommentVNode("", !0)
|
|
@@ -1742,20 +1749,20 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1742
1749
|
createElementVNode("div", {
|
|
1743
1750
|
class: normalizeClass(["switch-btn", { active: v.mapTileMode === unref(BaseMapType).satellite }]),
|
|
1744
1751
|
onClick: d
|
|
1745
|
-
},
|
|
1752
|
+
}, g[13] || (g[13] = [
|
|
1746
1753
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1747
1754
|
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
1748
1755
|
]), 2)
|
|
1749
1756
|
], 64))
|
|
1750
1757
|
], 2),
|
|
1751
1758
|
createElementVNode("div", _hoisted_3, [
|
|
1752
|
-
|
|
1759
|
+
l.value ? (openBlock(), createBlock(Measure, {
|
|
1753
1760
|
key: 0,
|
|
1754
1761
|
ref_key: "measureRef",
|
|
1755
1762
|
ref: c,
|
|
1756
|
-
visible:
|
|
1757
|
-
"onUpdate:visible":
|
|
1758
|
-
onClose:
|
|
1763
|
+
visible: l.value,
|
|
1764
|
+
"onUpdate:visible": g[4] || (g[4] = (L) => l.value = L),
|
|
1765
|
+
onClose: h,
|
|
1759
1766
|
"view-mode": v.viewMode
|
|
1760
1767
|
}, null, 8, ["visible", "view-mode"])) : createCommentVNode("", !0)
|
|
1761
1768
|
])
|
|
@@ -1769,12 +1776,12 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1769
1776
|
setScaleLine: (r) => {
|
|
1770
1777
|
var c;
|
|
1771
1778
|
r || (r = "metric");
|
|
1772
|
-
const
|
|
1779
|
+
const i = new ScaleLine$1({
|
|
1773
1780
|
units: r
|
|
1774
|
-
}),
|
|
1775
|
-
|
|
1781
|
+
}), l = document.getElementById("scale-line-container");
|
|
1782
|
+
l && (i.setTarget(l), (c = n == null ? void 0 : n.value) == null || c.addControl(i));
|
|
1776
1783
|
}
|
|
1777
|
-
}), (r,
|
|
1784
|
+
}), (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$2));
|
|
1778
1785
|
}
|
|
1779
1786
|
}), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-d666f80d"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1780
1787
|
__name: "zoomControl",
|
|
@@ -1786,14 +1793,14 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1786
1793
|
setup(e) {
|
|
1787
1794
|
const t = inject("mapInstance"), n = () => {
|
|
1788
1795
|
if (!t.value) return;
|
|
1789
|
-
const r = t.value.getView(),
|
|
1790
|
-
|
|
1796
|
+
const r = t.value.getView(), i = r.getZoom();
|
|
1797
|
+
i && r.setZoom(i + 1);
|
|
1791
1798
|
}, o = () => {
|
|
1792
1799
|
if (!t.value) return;
|
|
1793
|
-
const r = t.value.getView(),
|
|
1794
|
-
|
|
1800
|
+
const r = t.value.getView(), i = r.getZoom();
|
|
1801
|
+
i && r.setZoom(i - 1);
|
|
1795
1802
|
};
|
|
1796
|
-
return (r,
|
|
1803
|
+
return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1797
1804
|
createElementVNode("div", {
|
|
1798
1805
|
onClick: n,
|
|
1799
1806
|
class: "button big-button"
|
|
@@ -1811,11 +1818,11 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1811
1818
|
mapTile: { default: BaseMapType.satellite }
|
|
1812
1819
|
},
|
|
1813
1820
|
setup(e) {
|
|
1814
|
-
useCssVars((
|
|
1821
|
+
useCssVars((i) => ({
|
|
1815
1822
|
"0d38823b": r.value
|
|
1816
1823
|
}));
|
|
1817
1824
|
const t = e, n = 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`), o = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "400px" : "168px"), r = computed(() => t.type === COPY_RIGHT_TYPE.HORIZONTAL ? "auto auto 0 5px" : "0 auto auto 5px");
|
|
1818
|
-
return (
|
|
1825
|
+
return (i, l) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1819
1826
|
createElementVNode("img", {
|
|
1820
1827
|
src: unref(CDN_URL) + n.value,
|
|
1821
1828
|
width: o.value,
|
|
@@ -1837,30 +1844,30 @@ const loadImage = new Image();
|
|
|
1837
1844
|
loadImage.src = `${CDN_URL}/map/map-load.svg`;
|
|
1838
1845
|
loadImage.crossOrigin = "anonymous";
|
|
1839
1846
|
const setTruckStyle = (e, t, n, o) => new Style({
|
|
1840
|
-
renderer: (r,
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1847
|
+
renderer: (r, i) => {
|
|
1848
|
+
const l = i.context;
|
|
1849
|
+
l.save();
|
|
1843
1850
|
let c = 1;
|
|
1844
|
-
|
|
1851
|
+
l.scale(c, c);
|
|
1845
1852
|
let [s, m] = r;
|
|
1846
1853
|
s = Number(s) / c - 20, m = Number(m) / c;
|
|
1847
1854
|
const d = s - 70, u = m - 68;
|
|
1848
|
-
let
|
|
1849
|
-
const p = 56,
|
|
1855
|
+
let h = 180;
|
|
1856
|
+
const p = 56, f = "#FFFFFF";
|
|
1850
1857
|
let v = 176;
|
|
1851
|
-
const
|
|
1852
|
-
let
|
|
1853
|
-
n === CAR_COLOR.YELLOW ? (v = 176,
|
|
1858
|
+
const g = 52;
|
|
1859
|
+
let L = "#164AFF", S = "#FFFFFF";
|
|
1860
|
+
n === CAR_COLOR.YELLOW ? (v = 176, L = "#FFC81E", S = "rgba(0,0,0,0.88)") : n === CAR_COLOR.Y_GREEN && (h = 200, v = 196, L = "#8FED7C", S = "rgba(0,0,0,0.88)"), o != null && o.length && (h += o.length * 56), fillRectRadius(l, d, u, h, p, f), fillRectRadius(l, d + 2, u + 2, v, g, L), n === CAR_COLOR.Y_GREEN && fillRectRadius(l, d + 2, u + 2, 68, g, "#FFC81E"), l.save(), l.restore(), l.fillStyle = S, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
|
|
1854
1861
|
const I = `${t.slice(0, 2) + " · " + t.slice(2)}`;
|
|
1855
|
-
if (
|
|
1856
|
-
const
|
|
1857
|
-
let
|
|
1858
|
-
o.forEach((
|
|
1859
|
-
|
|
1862
|
+
if (l.fillText(I, d + 12, u + 32), l.save(), l.restore(), o != null && o.length) {
|
|
1863
|
+
const x = l.measureText(I).width + 12;
|
|
1864
|
+
let P = 0;
|
|
1865
|
+
o.forEach(($) => {
|
|
1866
|
+
$ === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, s - 54 + x + P * 56, m - 64, 50, 50), ++P), $ === DEVICE_TYPE.LOAD && (l.drawImage(loadImage, s - 54 + x + P * 56, m - 64, 50, 50), ++P);
|
|
1860
1867
|
});
|
|
1861
1868
|
}
|
|
1862
|
-
const
|
|
1863
|
-
|
|
1869
|
+
const F = dotImage;
|
|
1870
|
+
l.drawImage(F, s + h / 2 - 90, m, 50 / c, 50 / c), l.restore();
|
|
1864
1871
|
}
|
|
1865
1872
|
}), mapInstance$2 = ref(), renderDashboardSetInstance = (e) => mapInstance$2.value = e;
|
|
1866
1873
|
ref([]);
|
|
@@ -1891,8 +1898,8 @@ const renderTrucksMarker = (e) => {
|
|
|
1891
1898
|
if (!mapInstance$1.value || (focusShipData.value = e, !(e != null && e.lon && (e != null && e.lat)))) return;
|
|
1892
1899
|
const n = Math.abs(Number(e.lon)) > 180 ? formatUtils.convertSixHundredThousandToLatLng(e.lon, e.lat) : [e.lon, e.lat], o = mapInstance$1.value.getPixelFromCoordinate(transform(n, projection.data, projection.mercator));
|
|
1893
1900
|
currentTruckOverlay.value = e ? drawTruckIcon(e.vno, o, (e == null ? void 0 : e.drc) ?? "", t) ?? null : null;
|
|
1894
|
-
const r = mapInstance$1.value.getView(),
|
|
1895
|
-
r.setCenter(transform(
|
|
1901
|
+
const r = mapInstance$1.value.getView(), i = new Point(n);
|
|
1902
|
+
r.setCenter(transform(i.getCoordinates(), projection.data, projection.mercator));
|
|
1896
1903
|
}, clearAllTruck = () => {
|
|
1897
1904
|
vehicle.value.clearAllShip();
|
|
1898
1905
|
}, drawTruckIcon = (e, t, n, o) => {
|
|
@@ -1905,15 +1912,15 @@ const renderTrucksMarker = (e) => {
|
|
|
1905
1912
|
const e = (t = currentTruckOverlay.value) == null ? void 0 : t.getElement();
|
|
1906
1913
|
e && (e.innerHTML = "");
|
|
1907
1914
|
}, zoomTruckIcon = () => {
|
|
1908
|
-
var
|
|
1915
|
+
var i;
|
|
1909
1916
|
if (!mapInstance$1.value) return;
|
|
1910
1917
|
const e = mapInstance$1.value.getView().getZoom(), t = 120, n = 60;
|
|
1911
|
-
function o(
|
|
1912
|
-
return
|
|
1918
|
+
function o(l) {
|
|
1919
|
+
return l < 14 ? n : l >= 14 && l <= 18 ? Math.round((l - 14) * (t - n) / 4 + n) : t;
|
|
1913
1920
|
}
|
|
1914
1921
|
const r = o(e);
|
|
1915
|
-
(
|
|
1916
|
-
|
|
1922
|
+
(i = document.querySelectorAll(".truck-custom-content")) == null || i.forEach((l) => {
|
|
1923
|
+
l.style.width = `${r}px`, l.style.height = `${r}px`;
|
|
1917
1924
|
});
|
|
1918
1925
|
}, mapInstance = ref(), drawPolygonSetInstance = (e) => mapInstance.value = e;
|
|
1919
1926
|
let layerState = "drawn", drawnState = "undrawn";
|
|
@@ -1959,13 +1966,13 @@ function createHelpTooltip() {
|
|
|
1959
1966
|
}
|
|
1960
1967
|
let squareLimitError = !1, lineLimitError = !1;
|
|
1961
1968
|
const validateSquareLimit = (e) => {
|
|
1962
|
-
let n = 1 / 0, o = -1 / 0, r = 1 / 0,
|
|
1969
|
+
let n = 1 / 0, o = -1 / 0, r = 1 / 0, i = -1 / 0;
|
|
1963
1970
|
e == null || e.forEach((s) => {
|
|
1964
1971
|
const m = transform(s, projection.mercator, projection.data), d = m[0], u = m[1];
|
|
1965
|
-
n = Math.min(n, u), o = Math.max(o, u), r = Math.min(r, d),
|
|
1972
|
+
n = Math.min(n, u), o = Math.max(o, u), r = Math.min(r, d), i = Math.max(i, d);
|
|
1966
1973
|
});
|
|
1967
|
-
const
|
|
1968
|
-
squareLimitError =
|
|
1974
|
+
const l = (o - n) * 111, c = (i - r) * 111;
|
|
1975
|
+
squareLimitError = l > 150 || c > 150;
|
|
1969
1976
|
};
|
|
1970
1977
|
let storeFeature, callbackFunction = null;
|
|
1971
1978
|
const addInteraction = (e) => {
|
|
@@ -1978,16 +1985,16 @@ const addInteraction = (e) => {
|
|
|
1978
1985
|
}), (o = mapInstance.value) == null || o.addInteraction(draw), createMeasureTooltip(), createHelpTooltip();
|
|
1979
1986
|
let t;
|
|
1980
1987
|
draw.on("drawstart", function(r) {
|
|
1981
|
-
var
|
|
1982
|
-
layerState = "drawn", sketch = r.feature, t = (
|
|
1983
|
-
const c =
|
|
1988
|
+
var i;
|
|
1989
|
+
layerState = "drawn", sketch = r.feature, t = (i = sketch.getGeometry()) == null ? void 0 : i.on("change", function(l) {
|
|
1990
|
+
const c = l.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
1991
|
if (lineLimitError = Number(getLength(u) / 1e3) > 150, validateSquareLimit(d), measureTooltipElement && s && (measureTooltipElement.innerHTML = `
|
|
1985
1992
|
<span class="text">面积:${s}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1986
1993
|
`), helpTooltipElement && s) {
|
|
1987
1994
|
let p = "";
|
|
1988
1995
|
parseFloat(s) > 0 && (p = `
|
|
1989
1996
|
<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}:${
|
|
1997
|
+
<span class="text ${lineLimitError ? "error" : ""}">线段${d.length - 2}:${h}${lineLimitError ? '<span class="error pl-4">超出可以绘画的距离</span>' : ""}</span>
|
|
1991
1998
|
<div><span class="text">单击继续,双击结束</span></div>
|
|
1992
1999
|
`;
|
|
1993
2000
|
}
|
|
@@ -1995,12 +2002,12 @@ const addInteraction = (e) => {
|
|
|
1995
2002
|
}), draw.on("drawend", function(r) {
|
|
1996
2003
|
if (r.feature.getGeometry()) {
|
|
1997
2004
|
storeFeature = r.feature;
|
|
1998
|
-
const
|
|
1999
|
-
|
|
2005
|
+
const i = endFn(r.feature);
|
|
2006
|
+
i != null && i.length && callbackFunction && callbackFunction(i);
|
|
2000
2007
|
}
|
|
2001
2008
|
if (sketch = null, measureTooltipElement = null, createMeasureTooltip(), t && unByKey(t), drawnState = "drawend", draw && mapInstance.value) {
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2009
|
+
const i = mapInstance.value.getInteractions().getArray().find((l) => getUid(l) === getUid(draw));
|
|
2010
|
+
i && mapInstance.value.removeInteraction(i), helpTooltipElement != null && helpTooltipElement.parentNode && helpTooltipElement.parentNode.removeChild(helpTooltipElement);
|
|
2004
2011
|
}
|
|
2005
2012
|
});
|
|
2006
2013
|
}, removeInteraction = () => {
|
|
@@ -2018,11 +2025,11 @@ const addInteraction = (e) => {
|
|
|
2018
2025
|
}, endFn = (e) => {
|
|
2019
2026
|
var t, n, o;
|
|
2020
2027
|
if (e.getGeometry()) {
|
|
2021
|
-
const r = [],
|
|
2022
|
-
(t =
|
|
2028
|
+
const r = [], l = e.getGeometry().getCoordinates();
|
|
2029
|
+
(t = l[0]) == null || t.forEach((s) => {
|
|
2023
2030
|
r.push(transform(s, projection.mercator, projection.data));
|
|
2024
2031
|
});
|
|
2025
|
-
const c =
|
|
2032
|
+
const c = l[0][l[0].length - 2];
|
|
2026
2033
|
if (c && measureTooltip.setPosition(c), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'), (n = document.querySelector(".delete-icon")) == null || n.addEventListener("click", () => {
|
|
2027
2034
|
reset();
|
|
2028
2035
|
}), !lineLimitError && !squareLimitError)
|
|
@@ -2038,10 +2045,10 @@ const addInteraction = (e) => {
|
|
|
2038
2045
|
measureTooltipElement && (measureTooltipElement.innerHTML = `
|
|
2039
2046
|
<span class="text">面积:${r}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
2040
2047
|
`), (t = drawVector.getSource()) == null || t.addFeature(storeFeature);
|
|
2041
|
-
const
|
|
2042
|
-
|
|
2043
|
-
const
|
|
2044
|
-
(n = mapInstance.value) == null || n.getView().setCenter(
|
|
2048
|
+
const i = endFn(storeFeature);
|
|
2049
|
+
i != null && i.length && callbackFunction && callbackFunction(i);
|
|
2050
|
+
const l = getCenter(storeFeature.getGeometry().getExtent());
|
|
2051
|
+
(n = mapInstance.value) == null || n.getView().setCenter(l);
|
|
2045
2052
|
}
|
|
2046
2053
|
}, pointerMoveHandler = function(e) {
|
|
2047
2054
|
var n;
|
|
@@ -2082,21 +2089,21 @@ const addInteraction = (e) => {
|
|
|
2082
2089
|
o.crossOrigin = "anonymous";
|
|
2083
2090
|
const r = new Image();
|
|
2084
2091
|
r.crossOrigin = "anonymous";
|
|
2085
|
-
const { color:
|
|
2086
|
-
return (c ||
|
|
2087
|
-
renderer: (u,
|
|
2088
|
-
const p =
|
|
2092
|
+
const { color: i, url: l, activeUrl: c, activeColor: s, imgWidth: m, imgHeight: d } = n;
|
|
2093
|
+
return (c || l) && (e ? r.src = CDN_URL + (c || l) : o.src = CDN_URL + (l || c)), new Style({
|
|
2094
|
+
renderer: (u, h) => {
|
|
2095
|
+
const p = h.context;
|
|
2089
2096
|
p.save();
|
|
2090
|
-
const
|
|
2091
|
-
let [v,
|
|
2092
|
-
if (v = Number(v),
|
|
2093
|
-
p.font = `${12 *
|
|
2094
|
-
const
|
|
2095
|
-
fillRectRadius(p,
|
|
2097
|
+
const f = window.devicePixelRatio || 1;
|
|
2098
|
+
let [v, g] = u;
|
|
2099
|
+
if (v = Number(v), g = Number(g), t) {
|
|
2100
|
+
p.font = `${12 * f}px Arial`;
|
|
2101
|
+
const L = p.measureText(t).width, S = v - L / 2 - (f <= 1 ? 8 : f), I = g + 6 * f, F = L + 4, x = 16 * f, P = e && s || i;
|
|
2102
|
+
fillRectRadius(p, S, I + (f <= 1 ? 6 : 13 * f), F, x, P), p.save(), p.restore(), p.fillStyle = e ? "#FFFFFF" : "#000000", p.textAlign = "center", p.textBaseline = "middle", p.fillText(t, S + (L + 4) / 2, I + (f <= 1 ? 16 : 22 * f)), p.save(), p.restore();
|
|
2096
2103
|
}
|
|
2097
|
-
if (
|
|
2098
|
-
const
|
|
2099
|
-
p.drawImage(
|
|
2104
|
+
if (l || c) {
|
|
2105
|
+
const L = e ? r : o;
|
|
2106
|
+
p.drawImage(L, v - (m || L.width) / 2, g - (d || L.height) / 2, 30 * f, 30 * f);
|
|
2100
2107
|
}
|
|
2101
2108
|
p.restore();
|
|
2102
2109
|
}
|
|
@@ -2122,23 +2129,23 @@ class PointMarkerClass {
|
|
|
2122
2129
|
b(this, "options");
|
|
2123
2130
|
// 使用坐标点区域自动缩放地图层级
|
|
2124
2131
|
b(this, "resetPointsView", (t) => {
|
|
2125
|
-
var
|
|
2132
|
+
var i;
|
|
2126
2133
|
if (!this.mapInstance || t.length === 0) return;
|
|
2127
|
-
const n = (
|
|
2134
|
+
const n = (i = this.mapInstance) == null ? void 0 : i.getView();
|
|
2128
2135
|
if (!n) return;
|
|
2129
2136
|
const r = t.map(
|
|
2130
|
-
(
|
|
2131
|
-
).reduce((
|
|
2132
|
-
Math.min(
|
|
2133
|
-
Math.min(
|
|
2134
|
-
Math.max(
|
|
2135
|
-
Math.max(
|
|
2137
|
+
(l) => transform(l, projection.data, projection.mercator)
|
|
2138
|
+
).reduce((l, c) => [
|
|
2139
|
+
Math.min(l[0], c[0]),
|
|
2140
|
+
Math.min(l[1], c[1]),
|
|
2141
|
+
Math.max(l[2], c[0]),
|
|
2142
|
+
Math.max(l[3], c[1])
|
|
2136
2143
|
], [1 / 0, 1 / 0, -1 / 0, -1 / 0]);
|
|
2137
2144
|
try {
|
|
2138
|
-
const
|
|
2139
|
-
n.fit(
|
|
2140
|
-
} catch (
|
|
2141
|
-
console.error("Failed to zoom to points:",
|
|
2145
|
+
const l = buffer(r, Math.max(r[2] - r[0], r[3] - r[1]) * 0.02);
|
|
2146
|
+
n.fit(l);
|
|
2147
|
+
} catch (l) {
|
|
2148
|
+
console.error("Failed to zoom to points:", l);
|
|
2142
2149
|
}
|
|
2143
2150
|
});
|
|
2144
2151
|
this.mapInstance = t, this.options = n;
|
|
@@ -2162,9 +2169,9 @@ class PointMarkerClass {
|
|
|
2162
2169
|
if (!this.mapInstance) return;
|
|
2163
2170
|
let n = {};
|
|
2164
2171
|
t.forEach((o) => {
|
|
2165
|
-
var
|
|
2172
|
+
var i;
|
|
2166
2173
|
const r = [o.lon, o.lat];
|
|
2167
|
-
if (((
|
|
2174
|
+
if (((i = this.highlightPoint) == null ? void 0 : i.id) === o.id)
|
|
2168
2175
|
n = {
|
|
2169
2176
|
id: o.id,
|
|
2170
2177
|
name: o.name,
|
|
@@ -2172,12 +2179,12 @@ class PointMarkerClass {
|
|
|
2172
2179
|
pointType: o.pointType
|
|
2173
2180
|
};
|
|
2174
2181
|
else {
|
|
2175
|
-
const
|
|
2182
|
+
const l = this.getFeature(o, r);
|
|
2176
2183
|
this.pointMarkerList.push({
|
|
2177
2184
|
id: o.id,
|
|
2178
2185
|
name: o.name,
|
|
2179
2186
|
lonlat: [Number(o.lon), Number(o.lat)],
|
|
2180
|
-
feature:
|
|
2187
|
+
feature: l,
|
|
2181
2188
|
pointType: o.pointType
|
|
2182
2189
|
});
|
|
2183
2190
|
}
|
|
@@ -2223,7 +2230,7 @@ class PointMarkerClass {
|
|
|
2223
2230
|
*/
|
|
2224
2231
|
highlightPointMarker(t) {
|
|
2225
2232
|
if (!this.mapInstance) return;
|
|
2226
|
-
const { id: n, name: o, fullName: r, lon:
|
|
2233
|
+
const { id: n, name: o, fullName: r, lon: i, lat: l, pointType: c } = t, s = [Number(i), Number(l)];
|
|
2227
2234
|
this.highlightPoint = {
|
|
2228
2235
|
id: n,
|
|
2229
2236
|
name: o,
|
|
@@ -2252,10 +2259,10 @@ class PointMarkerClass {
|
|
|
2252
2259
|
*/
|
|
2253
2260
|
setPointCenter(t, n = { customZoom: mapZoom.findShip, type: 1 }) {
|
|
2254
2261
|
if (!this.mapInstance) return;
|
|
2255
|
-
const { customZoom: o = mapZoom.findShip, type: r = 1 } = n,
|
|
2256
|
-
(r === 1 ||
|
|
2262
|
+
const { customZoom: o = mapZoom.findShip, type: r = 1 } = n, i = this.mapInstance.getView(), l = i.getZoom();
|
|
2263
|
+
(r === 1 || l > o && r === 2 || l < o && r === 3) && i.setZoom(o);
|
|
2257
2264
|
const c = new Point(t);
|
|
2258
|
-
|
|
2265
|
+
i.setCenter(transform(c.getCoordinates(), projection.data, projection.mercator));
|
|
2259
2266
|
}
|
|
2260
2267
|
}
|
|
2261
2268
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -2274,15 +2281,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2274
2281
|
setup(e, { expose: t, emit: n }) {
|
|
2275
2282
|
const o = ref();
|
|
2276
2283
|
provide("mapInstance", o);
|
|
2277
|
-
const r = ref(null),
|
|
2284
|
+
const r = ref(null), i = ref(null), l = ref(null), c = n, s = e, m = ref(s.zoom || mapZoom.default), d = ref(!1), u = ref(!0), h = ref(!0), p = ref(!0), f = {
|
|
2278
2285
|
tiandituTile: new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) }),
|
|
2279
2286
|
tiandituTileMark: new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) }),
|
|
2280
2287
|
tiandituImgTile: new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 }),
|
|
2281
2288
|
tiandituImgTileMark: new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 }),
|
|
2282
2289
|
greenMark: new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })
|
|
2283
2290
|
}, v = () => {
|
|
2284
|
-
var
|
|
2285
|
-
const
|
|
2291
|
+
var w, k;
|
|
2292
|
+
const y = {
|
|
2286
2293
|
projection: projection.mercator,
|
|
2287
2294
|
// 地图投影坐标系
|
|
2288
2295
|
zoom: s.zoom || (s.vehicleMode === "ship" ? mapZoom.default : mapZoom.truckDefault),
|
|
@@ -2304,107 +2311,107 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2304
2311
|
// 对应页面里 id 为 map 的元素
|
|
2305
2312
|
layers: [
|
|
2306
2313
|
// 图层
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2314
|
+
f.tiandituTile,
|
|
2315
|
+
f.tiandituTileMark,
|
|
2316
|
+
f.tiandituImgTile,
|
|
2317
|
+
f.tiandituImgTileMark,
|
|
2318
|
+
f.greenMark
|
|
2312
2319
|
],
|
|
2313
|
-
view: new View(
|
|
2314
|
-
}),
|
|
2320
|
+
view: new View(y)
|
|
2321
|
+
}), g(), s.showToolPanel === void 0 ? p.value = !0 : p.value = s.showToolPanel, (w = i.value) == null || w.setScaleLine(s.vehicleMode === "ship" ? "nautical" : "metric"), (k = o.value) == null || k.on("moveend", F), L(y.zoom < mapZoom.shipGreenDotMax), I(s.vehicleMode === "ship" || s.viewMode === "findShip" ? BaseMapType.satellite : BaseMapType.vector), s.viewMode === "findShip" && s.mmsi && s.shipData && nextTick(() => {
|
|
2315
2322
|
findShip(String(s.mmsi), s.shipData);
|
|
2316
2323
|
}), onShipsMarkerHover();
|
|
2317
2324
|
};
|
|
2318
2325
|
onMounted(() => {
|
|
2319
2326
|
v();
|
|
2320
2327
|
});
|
|
2321
|
-
const
|
|
2328
|
+
const g = () => {
|
|
2322
2329
|
o.value && (renderCustomOverlaySetInstance(o.value), renderTruckSetInstance(o.value), drawPolygonSetInstance(o.value), renderShipStyleSetInstance(o.value), renderTrackStyleSetInstance(o.value), renderDashboardSetInstance(o.value), renderMarkerSetInstance(o.value), renderShipSetInstance(o.value), renderTrackSetInstance(o.value));
|
|
2323
|
-
},
|
|
2324
|
-
var
|
|
2325
|
-
s.vehicleMode !== "ship" && (
|
|
2326
|
-
getUid(
|
|
2330
|
+
}, L = (y) => {
|
|
2331
|
+
var w;
|
|
2332
|
+
s.vehicleMode !== "ship" && (y = !1), (w = o.value) == null || w.getLayers().forEach((k) => {
|
|
2333
|
+
getUid(k) === getUid(f.greenMark) && (k.setVisible(y), u.value = y);
|
|
2327
2334
|
});
|
|
2328
|
-
},
|
|
2329
|
-
var
|
|
2330
|
-
|
|
2331
|
-
(getUid(
|
|
2335
|
+
}, S = ref(BaseMapType.satellite), I = (y) => {
|
|
2336
|
+
var w;
|
|
2337
|
+
S.value = y, (w = o.value) == null || w.getLayers().forEach((k) => {
|
|
2338
|
+
(getUid(k) === getUid(f.tiandituTile) || getUid(k) === getUid(f.tiandituTileMark) || getUid(k) === getUid(f.tiandituImgTile) || getUid(k) === getUid(f.tiandituImgTileMark)) && k.setVisible(!1), (y === BaseMapType.vector && (getUid(k) === getUid(f.tiandituTile) || getUid(k) === getUid(f.tiandituTileMark)) || y === BaseMapType.satellite && (getUid(k) === getUid(f.tiandituImgTile) || getUid(k) === getUid(f.tiandituImgTileMark))) && k.setVisible(!0);
|
|
2332
2339
|
});
|
|
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: [
|
|
2340
|
+
}, F = () => {
|
|
2341
|
+
const y = o.value.getView(), w = y.getZoom();
|
|
2342
|
+
w && x(w);
|
|
2343
|
+
const k = y.calculateExtent(o.value.getSize());
|
|
2344
|
+
k && w && P(k, w);
|
|
2345
|
+
}, x = (y) => {
|
|
2346
|
+
var M, T, C, V, E;
|
|
2347
|
+
m.value = y, L(y < mapZoom.shipGreenDotMax);
|
|
2348
|
+
const w = (M = o.value) == null ? void 0 : M.getLayers(), k = s.vehicleMode === "ship" ? w == null ? void 0 : w.getArray().find((N) => getUid(N) === getUid(f.greenMark)) : void 0;
|
|
2349
|
+
showTrackLayer.value ? (h.value = !1, k == null || k.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, k == null || k.setVisible(!0), (V = shipsLayer.value) == null || V.setVisible(!1), (E = largeAmountShipsLayer.value) == null || E.setVisible(!1)) : (h.value = !1, k == null || k.setVisible(!1)), c("zoomChanged", y);
|
|
2350
|
+
}, P = (y, w) => {
|
|
2351
|
+
const k = transform([y[0], y[1]], projection.mercator, projection.data), M = transform([y[2], y[3]], projection.mercator, projection.data);
|
|
2352
|
+
c("extentChanged", { extent: [k, M], zoom: w });
|
|
2346
2353
|
};
|
|
2347
2354
|
return t({
|
|
2348
2355
|
mapInstance: o,
|
|
2349
2356
|
initMap: v,
|
|
2350
|
-
pointRender: (
|
|
2357
|
+
pointRender: (y, w) => new PointMarkerClass(y, w),
|
|
2351
2358
|
renderTrucksMarker,
|
|
2352
2359
|
renderShip: renderShips,
|
|
2353
|
-
renderTrack: (w, k
|
|
2354
|
-
var
|
|
2355
|
-
currentTrackId.value =
|
|
2360
|
+
renderTrack: (y, w, k) => {
|
|
2361
|
+
var M, T;
|
|
2362
|
+
currentTrackId.value = y, showTrackLayer.value = !0, d.value = !0, hiddenAllShips(), (T = (M = largeAmountShipsLayer.value) == null ? void 0 : M.getSource()) == null || T.clear(), renderTrack(y, s.vehicleMode === "ship" ? w.reverse() : w, k, LENGTH_UNIT.NM);
|
|
2356
2363
|
},
|
|
2357
2364
|
findTruck,
|
|
2358
2365
|
removeTruckIcon,
|
|
2359
2366
|
clearAllTruck,
|
|
2360
2367
|
closeTrack: () => {
|
|
2361
|
-
var
|
|
2362
|
-
showTrackLayer.value = !1, (
|
|
2368
|
+
var y, w;
|
|
2369
|
+
showTrackLayer.value = !1, (y = shipTrackVectorLayer.value) == null || y.setVisible(!1), (w = selectShipsLayer.value) == null || w.setVisible(!0), d.value = !1, L(m.value < mapZoom.shipGreenDotMax), allTracks.value = [], stopAnimation();
|
|
2363
2370
|
},
|
|
2364
2371
|
closeTruckTrack: () => {
|
|
2365
|
-
var
|
|
2366
|
-
showTrackLayer.value = !1, (
|
|
2372
|
+
var y, w;
|
|
2373
|
+
showTrackLayer.value = !1, (y = shipTrackVectorLayer.value) == null || y.setVisible(!1), (w = selectShipsLayer.value) == null || w.setVisible(!0), stopAnimation();
|
|
2367
2374
|
},
|
|
2368
2375
|
resetTrackView,
|
|
2369
2376
|
playTrack,
|
|
2370
2377
|
clearSelectFeature,
|
|
2371
2378
|
findShip,
|
|
2372
|
-
focusShip: (w, k
|
|
2373
|
-
var
|
|
2374
|
-
hiddenOrther.value =
|
|
2379
|
+
focusShip: (y, w, k = !0) => {
|
|
2380
|
+
var M, T;
|
|
2381
|
+
hiddenOrther.value = k, (M = shipsLayer.value) == null || M.setVisible(!k), (T = largeAmountShipsLayer.value) == null || T.setVisible(!1), findShip(y, w);
|
|
2375
2382
|
},
|
|
2376
2383
|
clearShipData,
|
|
2377
2384
|
showTracks,
|
|
2378
2385
|
removeAllTrackLayer,
|
|
2379
2386
|
switchFilterItem,
|
|
2380
2387
|
rerenderShip,
|
|
2381
|
-
switchGreenDot: () =>
|
|
2388
|
+
switchGreenDot: () => L(!1),
|
|
2382
2389
|
zoomTruckIcon,
|
|
2383
|
-
renderTruckTrack: (w, k
|
|
2384
|
-
showTrackLayer.value = !0, renderTrack(w, k,
|
|
2390
|
+
renderTruckTrack: (y, w, k) => {
|
|
2391
|
+
showTrackLayer.value = !0, renderTrack(y, w, k, LENGTH_UNIT.KM, "truck");
|
|
2385
2392
|
},
|
|
2386
2393
|
drawCustomContent,
|
|
2387
2394
|
removerLayer: removeShipTrackLineFeatureByIndex,
|
|
2388
2395
|
renderMarker,
|
|
2389
|
-
setMarkerPosition: (
|
|
2390
|
-
d.value = !0, setMarkerPosition(
|
|
2396
|
+
setMarkerPosition: (y) => {
|
|
2397
|
+
d.value = !0, setMarkerPosition(y);
|
|
2391
2398
|
},
|
|
2392
2399
|
getZoomAndCenter: () => {
|
|
2393
2400
|
var T;
|
|
2394
|
-
const
|
|
2395
|
-
if (!
|
|
2396
|
-
const
|
|
2397
|
-
return { zoom:
|
|
2401
|
+
const y = (T = o.value) == null ? void 0 : T.getView();
|
|
2402
|
+
if (!y) return null;
|
|
2403
|
+
const w = Math.round(Number(y.getZoom())), { lon: k, lat: M } = transformUtils.mercatorToLonLat(y.getCenter());
|
|
2404
|
+
return { zoom: w, center: [k, M] };
|
|
2398
2405
|
},
|
|
2399
|
-
setCenter: (
|
|
2400
|
-
var
|
|
2401
|
-
const
|
|
2402
|
-
if (!
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2406
|
+
setCenter: (y) => {
|
|
2407
|
+
var M;
|
|
2408
|
+
const w = (M = o.value) == null ? void 0 : M.getView();
|
|
2409
|
+
if (!w) return null;
|
|
2410
|
+
const k = new Point(y);
|
|
2411
|
+
w.setCenter(transform(k.getCoordinates(), projection.data, projection.mercator));
|
|
2405
2412
|
},
|
|
2406
2413
|
drawPolygonTool,
|
|
2407
|
-
setMapInstance:
|
|
2414
|
+
setMapInstance: g,
|
|
2408
2415
|
store: {
|
|
2409
2416
|
getShowMeasure: getShowMeasure()
|
|
2410
2417
|
},
|
|
@@ -2416,43 +2423,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2416
2423
|
transform: transformUtils,
|
|
2417
2424
|
format: formatUtils
|
|
2418
2425
|
}
|
|
2419
|
-
}), (
|
|
2426
|
+
}), (y, w) => (openBlock(), createElementBlock("div", {
|
|
2420
2427
|
class: "map-page map-container",
|
|
2421
2428
|
ref_key: "pageRef",
|
|
2422
2429
|
ref: r
|
|
2423
2430
|
}, [
|
|
2424
|
-
|
|
2431
|
+
w[0] || (w[0] = createElementVNode("div", {
|
|
2425
2432
|
id: "map",
|
|
2426
2433
|
class: "map"
|
|
2427
2434
|
}, null, -1)),
|
|
2428
2435
|
p.value ? (openBlock(), createBlock(ToolPanel, {
|
|
2429
2436
|
key: 0,
|
|
2430
|
-
"vehicle-mode":
|
|
2431
|
-
"view-mode":
|
|
2437
|
+
"vehicle-mode": y.vehicleMode,
|
|
2438
|
+
"view-mode": y.viewMode,
|
|
2432
2439
|
"disable-green-dot": d.value,
|
|
2433
2440
|
"show-track-layer": unref(showTrackLayer),
|
|
2434
|
-
"map-tile-mode":
|
|
2435
|
-
onSwitchGreenDot:
|
|
2441
|
+
"map-tile-mode": S.value,
|
|
2442
|
+
onSwitchGreenDot: L,
|
|
2436
2443
|
onSwitchMapTile: I
|
|
2437
2444
|
}, {
|
|
2438
2445
|
toolPanel: withCtx(() => [
|
|
2439
|
-
renderSlot(
|
|
2446
|
+
renderSlot(y.$slots, "toolPanel", {}, void 0, !0)
|
|
2440
2447
|
]),
|
|
2441
2448
|
_: 3
|
|
2442
2449
|
}, 8, ["vehicle-mode", "view-mode", "disable-green-dot", "show-track-layer", "map-tile-mode"])) : createCommentVNode("", !0),
|
|
2443
|
-
|
|
2450
|
+
y.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2444
2451
|
createVNode(ScaleLine, {
|
|
2445
2452
|
ref_key: "scaleLineControl",
|
|
2446
|
-
ref:
|
|
2453
|
+
ref: i
|
|
2447
2454
|
}, null, 512),
|
|
2448
2455
|
createVNode(ZoomControl, {
|
|
2449
2456
|
ref_key: "zoomControl",
|
|
2450
|
-
ref:
|
|
2457
|
+
ref: l
|
|
2451
2458
|
}, null, 512)
|
|
2452
2459
|
], 64)) : createCommentVNode("", !0),
|
|
2453
2460
|
createVNode(Copyright, {
|
|
2454
|
-
type:
|
|
2455
|
-
"map-tile":
|
|
2461
|
+
type: y.logoType,
|
|
2462
|
+
"map-tile": S.value
|
|
2456
2463
|
}, null, 8, ["type", "map-tile"])
|
|
2457
2464
|
], 512));
|
|
2458
2465
|
}
|