zhihao-ui 1.2.26 → 1.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/{BaseInfo-DCB7xgRw.js → BaseInfo-XETJaruy.js} +1 -1
- package/dist/es/{Button-Va8xfPJd.js → Button-CzjgaPIL.js} +2 -2
- package/dist/es/{DatePicker-BrD1XS6-.js → DatePicker-DNgii92T.js} +2 -2
- package/dist/es/{DetailHeader-C13bJw_K.js → DetailHeader-C7L01g9Z.js} +3 -3
- package/dist/es/{DetailSubTitle-BgbefcLD.js → DetailSubTitle-ChWfR3qA.js} +2 -2
- package/dist/es/{Dialog-D1K_vH8I.js → Dialog-Cky8TKRM.js} +3 -3
- package/dist/es/{DiyDataTable-Chu357SY.js → DiyDataTable-D1s7-cdV.js} +4 -4
- package/dist/es/{EditInfoPair-XiseN2F2.js → EditInfoPair-C0EG8kUd.js} +3 -3
- package/dist/es/{FileWrapper-CAwHicjK.js → FileWrapper-CmvheBNp.js} +4 -4
- package/dist/es/{Grid-CshEwvAH.js → Grid-CfJ_U3gi.js} +1 -1
- package/dist/es/{InfoPair-DhVT8u-f.js → InfoPair-JA1pAAyP.js} +3 -3
- package/dist/es/{Input-CeiPnMtt.js → Input-12ajHBoj.js} +3 -3
- package/dist/es/{Loading-bv2DpqBO.js → Loading-CHji9tKE.js} +2 -2
- package/dist/es/{Map-DhceUygQ.js → Map-Drzg1DDm.js} +65 -63
- package/dist/es/{MessageBox-2Vpy3Mva.js → MessageBox-1NCCwju7.js} +2 -2
- package/dist/es/{MoneyInput-Deg1aj66.js → MoneyInput-PI2K9BeH.js} +9 -9
- package/dist/es/{PageHeadPanel-BWjWkx8n.js → PageHeadPanel-CBDItYUC.js} +2 -2
- package/dist/es/{Table-9BngZpmt.js → Table-BBWU5wYF.js} +5 -5
- package/dist/es/{ToolTips-Bw2lHQxC.js → ToolTips-BBCd543g.js} +3 -3
- package/dist/es/index.js +21 -21
- package/dist/es/{utils-D-zYpBSZ.js → utils-BIGjF-zg.js} +3 -3
- package/dist/es/{vendor-gTOtiVzA.js → vendor-BhAIOWbw.js} +39 -38
- package/dist/umd/index.umd.cjs +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as h, ref as o, provide as n, watch as i, resolveComponent as p, openBlock as m, createBlock as W, withCtx as v, renderSlot as b } from "vue";
|
|
2
|
-
import { w as g } from "./utils-
|
|
2
|
+
import { w as g } from "./utils-BIGjF-zg.js";
|
|
3
3
|
const C = /* @__PURE__ */ h({
|
|
4
4
|
name: "ZhBaseInfo",
|
|
5
5
|
__name: "BaseInfo",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as r, openBlock as a, createBlock as p, unref as u, mergeProps as c, withCtx as l, renderSlot as i } from "vue";
|
|
2
|
-
import { E as m, a as d } from "./vendor-
|
|
3
|
-
import { w as _ } from "./utils-
|
|
2
|
+
import { E as m, a as d } from "./vendor-BhAIOWbw.js";
|
|
3
|
+
import { w as _ } from "./utils-BIGjF-zg.js";
|
|
4
4
|
const h = /* @__PURE__ */ r({
|
|
5
5
|
name: "ZhButton",
|
|
6
6
|
inheritAttrs: !1,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as d, openBlock as u, createElementBlock as h, normalizeClass as f, createVNode as D, unref as M, mergeProps as _ } from "vue";
|
|
2
|
-
import { h as g, b as Y } from "./vendor-
|
|
3
|
-
import { w as A } from "./utils-
|
|
2
|
+
import { h as g, b as Y } from "./vendor-BhAIOWbw.js";
|
|
3
|
+
import { w as A } from "./utils-BIGjF-zg.js";
|
|
4
4
|
const p = "--", m = "YYYY-MM-DDTHH:mm:ss", T = "YYYY-MM-DDT23:59:59", E = "YYYY-MM-DD", C = "https://static.zhihaoscm.cn/", i = (e, l = E) => e ? g(e).format(l).replace("Invalid date", p) : p, N = (e) => typeof e == "number" ? !0 : typeof e == "string" ? !isNaN(parseFloat(e)) : !1;
|
|
5
5
|
function U(e) {
|
|
6
6
|
const l = ["角", "分"], c = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"], s = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as p, useSlots as _, openBlock as a, createElementBlock as o, createElementVNode as t, renderSlot as l, toDisplayString as i, Fragment as m, renderList as u, unref as n, normalizeClass as D, createCommentVNode as g } from "vue";
|
|
2
|
-
import { D as v } from "./DatePicker-
|
|
3
|
-
import { _ as k } from "./Button-
|
|
4
|
-
import { w as y } from "./utils-
|
|
2
|
+
import { D as v } from "./DatePicker-DNgii92T.js";
|
|
3
|
+
import { _ as k } from "./Button-CzjgaPIL.js";
|
|
4
|
+
import { w as y } from "./utils-BIGjF-zg.js";
|
|
5
5
|
const I = { class: "common-card" }, b = { class: "detail-header" }, E = { class: "detail-header--left" }, H = { class: "title common-title" }, M = { class: "info-pair--label" }, $ = { class: "info-pair--value" }, C = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "detail-header--right"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as r, openBlock as o, createElementBlock as s, createElementVNode as l, createTextVNode as a, toDisplayString as t, createCommentVNode as p, normalizeClass as c, renderSlot as m, unref as d } from "vue";
|
|
2
|
-
import { D as u } from "./DatePicker-
|
|
3
|
-
import { w as f } from "./utils-
|
|
2
|
+
import { D as u } from "./DatePicker-DNgii92T.js";
|
|
3
|
+
import { w as f } from "./utils-BIGjF-zg.js";
|
|
4
4
|
const _ = { class: "info-pair" }, v = { class: "info-pair--title" }, h = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "info-pair--title--tip"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as k, useModel as w, computed as T, openBlock as r, createBlock as v, unref as D, mergeProps as M, withCtx as o, renderSlot as s, createElementVNode as c, createVNode as u, createTextVNode as m, toDisplayString as l, createElementBlock as Z, createCommentVNode as z, mergeModels as p } from "vue";
|
|
2
|
-
import { Z as f } from "./Button-
|
|
3
|
-
import { c as E } from "./vendor-
|
|
4
|
-
import { w as I } from "./utils-
|
|
2
|
+
import { Z as f } from "./Button-CzjgaPIL.js";
|
|
3
|
+
import { c as E } from "./vendor-BhAIOWbw.js";
|
|
4
|
+
import { w as I } from "./utils-BIGjF-zg.js";
|
|
5
5
|
const N = { class: "title" }, O = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "sub-title"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as Z, useModel as z, ref as D, openBlock as n, createBlock as v, unref as s, withCtx as p, createVNode as g, createElementBlock as h, Fragment as C, renderList as P, normalizeClass as V, toDisplayString as c, renderSlot as R, createTextVNode as x, createCommentVNode as k, createElementVNode as w, mergeModels as X } from "vue";
|
|
2
|
-
import { D as $ } from "./DatePicker-
|
|
3
|
-
import { d as E, e as A, f as j, g as K, i as b, j as T, k as G, l as F, E as M } from "./vendor-
|
|
4
|
-
import { _ as J } from "./Button-
|
|
5
|
-
import { w as Q } from "./utils-
|
|
2
|
+
import { D as $ } from "./DatePicker-DNgii92T.js";
|
|
3
|
+
import { d as E, e as A, f as j, g as K, i as b, j as T, k as G, l as F, E as M } from "./vendor-BhAIOWbw.js";
|
|
4
|
+
import { _ as J } from "./Button-CzjgaPIL.js";
|
|
5
|
+
import { w as Q } from "./utils-BIGjF-zg.js";
|
|
6
6
|
var m = /* @__PURE__ */ ((f) => (f.AUTOCOMPLETE = "autocomplete", f.FORMAT = "format", f.TEXT = "text", f))(m || {});
|
|
7
7
|
const Y = { key: 0 }, ee = {
|
|
8
8
|
key: 1,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as l, openBlock as o, createElementBlock as s, createElementVNode as a, createTextVNode as r, toDisplayString as t, createCommentVNode as p, normalizeClass as c, renderSlot as d, unref as m } from "vue";
|
|
2
|
-
import { D as f } from "./DatePicker-
|
|
3
|
-
import { _ } from "./Button-
|
|
4
|
-
import { w as u } from "./utils-
|
|
2
|
+
import { D as f } from "./DatePicker-DNgii92T.js";
|
|
3
|
+
import { _ } from "./Button-CzjgaPIL.js";
|
|
4
|
+
import { w as u } from "./utils-BIGjF-zg.js";
|
|
5
5
|
const v = { class: "info-pair" }, h = { class: "info-pair--title" }, E = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "info-pair--title--tip"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as f, openBlock as i, createElementBlock as o, toDisplayString as n, createCommentVNode as s, createElementVNode as t, createVNode as p, unref as m, withCtx as _, createTextVNode as u } from "vue";
|
|
2
|
-
import { D as w } from "./DatePicker-
|
|
3
|
-
import { m as y } from "./vendor-
|
|
4
|
-
import { _ as h } from "./Button-
|
|
5
|
-
import { w as v } from "./utils-
|
|
2
|
+
import { D as w } from "./DatePicker-DNgii92T.js";
|
|
3
|
+
import { m as y } from "./vendor-BhAIOWbw.js";
|
|
4
|
+
import { _ as h } from "./Button-CzjgaPIL.js";
|
|
5
|
+
import { w as v } from "./utils-BIGjF-zg.js";
|
|
6
6
|
const k = { class: "file_wrapper" }, x = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "header"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as $, onBeforeMount as B, useSlots as C, ref as k, computed as f, onMounted as L, onActivated as S, onUnmounted as j, onDeactivated as M, provide as p, watch as z, openBlock as P, createElementBlock as R, normalizeStyle as Z, renderSlot as D } from "vue";
|
|
2
|
-
import { w as H } from "./utils-
|
|
2
|
+
import { w as H } from "./utils-BIGjF-zg.js";
|
|
3
3
|
const N = /* @__PURE__ */ $({
|
|
4
4
|
name: "zh-grid",
|
|
5
5
|
__name: "Grid",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as l, openBlock as i, createElementBlock as s, createElementVNode as a, createTextVNode as r, toDisplayString as t, createCommentVNode as p, normalizeClass as c, renderSlot as m, unref as f } from "vue";
|
|
2
|
-
import { D as d } from "./DatePicker-
|
|
3
|
-
import { _ } from "./Button-
|
|
4
|
-
import { w as u } from "./utils-
|
|
2
|
+
import { D as d } from "./DatePicker-DNgii92T.js";
|
|
3
|
+
import { _ } from "./Button-CzjgaPIL.js";
|
|
4
|
+
import { w as u } from "./utils-BIGjF-zg.js";
|
|
5
5
|
const v = { class: "info-pair" }, h = { class: "info-pair--title" }, I = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "info-pair--title--tip"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as b, useAttrs as v, useModel as k, openBlock as h, createElementBlock as I, normalizeClass as z, createVNode as S, unref as $, mergeProps as N, createSlots as x, renderList as _, withCtx as y, renderSlot as B, normalizeProps as M, guardReactiveProps as C, mergeModels as E, normalizeStyle as j } from "vue";
|
|
2
|
-
import { l as P } from "./vendor-
|
|
3
|
-
import { _ as U } from "./Button-
|
|
4
|
-
import { w as Z } from "./utils-
|
|
2
|
+
import { l as P } from "./vendor-BhAIOWbw.js";
|
|
3
|
+
import { _ as U } from "./Button-CzjgaPIL.js";
|
|
4
|
+
import { w as Z } from "./utils-BIGjF-zg.js";
|
|
5
5
|
const A = /* @__PURE__ */ b({
|
|
6
6
|
name: "zh-input",
|
|
7
7
|
__name: "Input",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as t, openBlock as a, createElementBlock as s, createElementVNode as o } from "vue";
|
|
2
|
-
import { _ as e } from "./Button-
|
|
3
|
-
import { w as i } from "./utils-
|
|
2
|
+
import { _ as e } from "./Button-CzjgaPIL.js";
|
|
3
|
+
import { w as i } from "./utils-BIGjF-zg.js";
|
|
4
4
|
const r = { class: "loading-box" }, c = /* @__PURE__ */ t({
|
|
5
5
|
name: "zh-loading",
|
|
6
6
|
__name: "Loading",
|
|
@@ -2,12 +2,12 @@ var B = Object.defineProperty;
|
|
|
2
2
|
var R = (e, t, o) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
3
|
var I = (e, t, o) => R(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
4
|
import { defineComponent, inject, useModel, ref, watch, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, Fragment, renderList, toDisplayString, createCommentVNode, mergeModels, nextTick, onMounted, normalizeClass, renderSlot, createBlock, provide } from "vue";
|
|
5
|
-
import { n as getArea, o as getLength, V as VectorSource, p as VectorLayer, S as Style, C as CircleStyle, F as Fill, q as Stroke, D as Draw, O as Overlay, u as unByKey, r as ElSelect, s as ElOption, T as Text, t as fromLonLat, v as transformExtent, h as hooks, L as LineString, w as Feature, P as Point, x as Polyline, y as getVectorContext, e as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, z as
|
|
6
|
-
import { _ as _export_sfc } from "./Button-
|
|
7
|
-
import { w as withInstall } from "./utils-
|
|
5
|
+
import { n as getArea, o as getLength, V as VectorSource, p as VectorLayer, S as Style, C as CircleStyle, F as Fill, q as Stroke, D as Draw, O as Overlay, u as unByKey, r as ElSelect, s as ElOption, T as Text, t as fromLonLat, v as transformExtent, h as hooks, L as LineString, w as Feature, P as Point, x as Polyline, y as getVectorContext, e as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, z as Circle, A as transform, B as buffer, H as ScaleLine$1, I as Icon, J as Translate, K as toLonLat, M as MultiPoint, N as getCenter, Q as TileLayer, X as XYZ, R as Map$1, U as View } from "./vendor-BhAIOWbw.js";
|
|
6
|
+
import { _ as _export_sfc } from "./Button-CzjgaPIL.js";
|
|
7
|
+
import { w as withInstall } from "./utils-BIGjF-zg.js";
|
|
8
8
|
var BaseMapType = /* @__PURE__ */ ((e) => (e[e.vector = 0] = "vector", e[e.satellite = 1] = "satellite", e))(BaseMapType || {}), 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 || {});
|
|
9
9
|
class ShipMapData {
|
|
10
|
-
constructor(t, o, n, r, l, i, s, c, d, m, u, f, p, y, h, g, L, T, b, C,
|
|
10
|
+
constructor(t, o, n, r, l, i, s, c, d, m, u, f, p, y, h, g, L, T, b, C, x, v, S) {
|
|
11
11
|
I(this, "id");
|
|
12
12
|
// mmsi
|
|
13
13
|
I(this, "mmsi");
|
|
@@ -48,7 +48,7 @@ class ShipMapData {
|
|
|
48
48
|
I(this, "existMobile");
|
|
49
49
|
I(this, "existWaterGauge");
|
|
50
50
|
I(this, "selected");
|
|
51
|
-
this.id = t, this.mmsi = o, this.fill = n, this.shipType = r, this.name = l, this.length = i, this.breadth = s, this.lon = c, this.lat = d, this.createdAt = m, this.speed = u, this.from = f, this.sailStatus = p, this.hdg = y, this.cog = h, this.posType = g, this.type = L, this.angle = T, this.leftIconColor = b, this.existDevice = C, this.existMobile =
|
|
51
|
+
this.id = t, this.mmsi = o, this.fill = n, this.shipType = r, this.name = l, this.length = i, this.breadth = s, this.lon = c, this.lat = d, this.createdAt = m, this.speed = u, this.from = f, this.sailStatus = p, this.hdg = y, this.cog = h, this.posType = g, this.type = L, this.angle = T, this.leftIconColor = b, this.existDevice = C, this.existMobile = x, this.existWaterGauge = v, this.selected = S;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
const formatLength = function(e, t) {
|
|
@@ -172,16 +172,16 @@ const formatLength = function(e, t) {
|
|
|
172
172
|
var k, M;
|
|
173
173
|
if (n.value) {
|
|
174
174
|
if (s.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((E) => {
|
|
175
|
-
var
|
|
176
|
-
(
|
|
175
|
+
var F;
|
|
176
|
+
(F = E == null ? void 0 : E.parentNode) == null || F.removeChild(E);
|
|
177
177
|
}), d.clear(), T) {
|
|
178
|
-
const E = n.value.getInteractions().getArray().find((
|
|
178
|
+
const E = n.value.getInteractions().getArray().find((F) => F.ol_uid === T.ol_uid);
|
|
179
179
|
E && ((k = n.value) == null || k.removeInteraction(E));
|
|
180
180
|
}
|
|
181
181
|
(M = n.value) == null || M.removeLayer(h), u != null && u.parentNode && u.parentNode.removeChild(u), p != null && p.parentNode && p.parentNode.removeChild(p);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function x() {
|
|
185
185
|
var M, E;
|
|
186
186
|
C(), (M = n.value) == null || M.addLayer(h), T = new Draw({
|
|
187
187
|
source: d,
|
|
@@ -191,9 +191,9 @@ const formatLength = function(e, t) {
|
|
|
191
191
|
}
|
|
192
192
|
}), (E = n.value) == null || E.addInteraction(T), S(), v();
|
|
193
193
|
let k;
|
|
194
|
-
T.on("drawstart", function(
|
|
194
|
+
T.on("drawstart", function(F) {
|
|
195
195
|
var N;
|
|
196
|
-
m =
|
|
196
|
+
m = F.feature;
|
|
197
197
|
let P;
|
|
198
198
|
k = (N = m.getGeometry()) == null ? void 0 : N.on("change", function(A) {
|
|
199
199
|
const $ = A.target;
|
|
@@ -223,19 +223,19 @@ const formatLength = function(e, t) {
|
|
|
223
223
|
}), (k = n.value) == null || k.addOverlay(y);
|
|
224
224
|
}
|
|
225
225
|
const w = (k) => {
|
|
226
|
-
var
|
|
226
|
+
var F, P;
|
|
227
227
|
s.value[k] && s.value.splice(k, 1);
|
|
228
228
|
const M = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
229
|
-
M[k] && ((P = (
|
|
229
|
+
M[k] && ((P = (F = M[k]) == null ? void 0 : F.parentNode) == null || P.removeChild(M[k]));
|
|
230
230
|
const E = d.getFeatures();
|
|
231
231
|
E[k] && d.removeFeature(E[k]);
|
|
232
232
|
}, V = () => {
|
|
233
233
|
r("close");
|
|
234
234
|
};
|
|
235
235
|
return watch(() => l, () => {
|
|
236
|
-
l && !c.value && (L(),
|
|
236
|
+
l && !c.value && (L(), x());
|
|
237
237
|
}, { deep: !0, immediate: !0 }), t({
|
|
238
|
-
addInteraction:
|
|
238
|
+
addInteraction: x,
|
|
239
239
|
removeInteraction: C
|
|
240
240
|
}), (k, M) => l.value && k.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
241
241
|
createElementVNode("div", { class: "header" }, [
|
|
@@ -270,18 +270,18 @@ const formatLength = function(e, t) {
|
|
|
270
270
|
}, 8, ["modelValue"])
|
|
271
271
|
]),
|
|
272
272
|
createElementVNode("div", _hoisted_3$2, [
|
|
273
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (E,
|
|
273
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (E, F) => (openBlock(), createElementBlock("div", {
|
|
274
274
|
class: "measure-history-item",
|
|
275
|
-
key:
|
|
275
|
+
key: F
|
|
276
276
|
}, [
|
|
277
277
|
createElementVNode("div", _hoisted_4, [
|
|
278
278
|
M[3] || (M[3] = createElementVNode("i", { class: "map-iconfont icon-line" }, null, -1)),
|
|
279
|
-
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(
|
|
279
|
+
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(F + 1), 1),
|
|
280
280
|
createElementVNode("span", _hoisted_6, toDisplayString(E), 1)
|
|
281
281
|
]),
|
|
282
282
|
createElementVNode("div", {
|
|
283
283
|
class: "delete-button",
|
|
284
|
-
onClick: (P) => w(
|
|
284
|
+
onClick: (P) => w(F)
|
|
285
285
|
}, M[4] || (M[4] = [
|
|
286
286
|
createElementVNode("i", { class: "map-iconfont icon-delete" }, null, -1)
|
|
287
287
|
]), 8, _hoisted_7)
|
|
@@ -291,13 +291,13 @@ const formatLength = function(e, t) {
|
|
|
291
291
|
}
|
|
292
292
|
}), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-d566fd81"]]), CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", baseMap = {
|
|
293
293
|
// 矢量底图
|
|
294
|
-
tiandituTile: `
|
|
294
|
+
tiandituTile: `https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,
|
|
295
295
|
// 矢量注记
|
|
296
|
-
tiandituTileMark: `
|
|
296
|
+
tiandituTileMark: `https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,
|
|
297
297
|
// 影像底图
|
|
298
|
-
tiandituImgTile: `
|
|
298
|
+
tiandituImgTile: `https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,
|
|
299
299
|
// 影像注记
|
|
300
|
-
tiandituImgTileMark: `
|
|
300
|
+
tiandituImgTileMark: `https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,
|
|
301
301
|
// 绿点图
|
|
302
302
|
greenTile: `${CDN_URL}/map/tile/{z}/{x}/{y}.png`
|
|
303
303
|
}, mapZoom = {
|
|
@@ -322,7 +322,7 @@ const formatLength = function(e, t) {
|
|
|
322
322
|
shipModelMin: 13,
|
|
323
323
|
// 船形图标最大渲染层级
|
|
324
324
|
shipModelMax: 18
|
|
325
|
-
},
|
|
325
|
+
}, mapDefaultCenter = [114.84, 30.52], projection = {
|
|
326
326
|
// 经纬度 源数据 地理坐标 WGS84
|
|
327
327
|
data: "EPSG:4326",
|
|
328
328
|
// 墨卡托投影坐标 渲染坐标
|
|
@@ -374,8 +374,8 @@ const multiplyPixelRatio = (e) => {
|
|
|
374
374
|
return function(v, S) {
|
|
375
375
|
return (i(S, v) + 180) % 360;
|
|
376
376
|
}(u, f);
|
|
377
|
-
const y = l(u), h = l(f), g = r(y[0]), L = r(h[0]), T = r(y[1]), b = r(h[1]), C = Math.sin(L - g) * Math.cos(b),
|
|
378
|
-
return n(Math.atan2(C,
|
|
377
|
+
const y = l(u), h = l(f), g = r(y[0]), L = r(h[0]), T = r(y[1]), b = r(h[1]), C = Math.sin(L - g) * Math.cos(b), x = Math.cos(T) * Math.sin(b) - Math.sin(T) * Math.cos(b) * Math.cos(L - g);
|
|
378
|
+
return n(Math.atan2(C, x));
|
|
379
379
|
}
|
|
380
380
|
function s(u) {
|
|
381
381
|
return !isNaN(u) && u !== null && !Array.isArray(u);
|
|
@@ -499,13 +499,13 @@ function drawLabelBody(e, t, o) {
|
|
|
499
499
|
p = calculateBounds(i, L, f, g, m);
|
|
500
500
|
let T = !1;
|
|
501
501
|
for (let b = 0; b < t.length; ++b) {
|
|
502
|
-
let C = t[b].bounds,
|
|
502
|
+
let C = t[b].bounds, x = [
|
|
503
503
|
C[0] - y,
|
|
504
504
|
C[1] - y,
|
|
505
505
|
C[2] + y,
|
|
506
506
|
C[3] + y
|
|
507
507
|
];
|
|
508
|
-
if (p && isOverlapping(p,
|
|
508
|
+
if (p && isOverlapping(p, x)) {
|
|
509
509
|
T = !0;
|
|
510
510
|
break;
|
|
511
511
|
}
|
|
@@ -601,14 +601,14 @@ const drawText = (e, t) => {
|
|
|
601
601
|
fillColor: s,
|
|
602
602
|
shouldClosePath: !0
|
|
603
603
|
});
|
|
604
|
-
const [b, C] = h,
|
|
604
|
+
const [b, C] = h, x = {
|
|
605
605
|
center: [b, C + labelOutSize + labelHeight + 1],
|
|
606
606
|
text: r,
|
|
607
607
|
textColor: i,
|
|
608
608
|
leftIcon: c,
|
|
609
609
|
rightIcons: d
|
|
610
610
|
};
|
|
611
|
-
drawText(e,
|
|
611
|
+
drawText(e, x);
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
return null;
|
|
@@ -1080,39 +1080,40 @@ const renderShips = (e) => {
|
|
|
1080
1080
|
selectSingleShipMarker(selectedShipData.value);
|
|
1081
1081
|
}).then((i) => {
|
|
1082
1082
|
}), !(!t || t < mapZoom.shipGreenDotMax) && (allShips.value = e, !hiddenOrther.value))
|
|
1083
|
-
return t >= mapZoom.shipGreenDotMax && t < mapZoom.shipModelMin
|
|
1083
|
+
return t >= mapZoom.shipGreenDotMax && t < mapZoom.shipModelMin ? ((o = shipsLayer.value) == null || o.setVisible(!1), (n = largeAmountShipsLayer.value) == null || n.setVisible(!0), renderLargeAmountShips(e)) : ((r = largeAmountShipsLayer.value) == null || r.setVisible(!1), (l = shipsLayer.value) == null || l.setVisible(!0), renderShipsMarker(e));
|
|
1084
1084
|
}, renderLargeAmountShips = (e) => {
|
|
1085
1085
|
if (!mapInstance$6.value) return;
|
|
1086
|
-
const t = e.map((
|
|
1086
|
+
const t = e.map((o) => ({
|
|
1087
1087
|
type: "Feature",
|
|
1088
1088
|
geometry: {
|
|
1089
1089
|
type: "Point",
|
|
1090
|
-
coordinates: [
|
|
1090
|
+
coordinates: [o.lon, o.lat]
|
|
1091
1091
|
},
|
|
1092
|
-
properties:
|
|
1092
|
+
properties: o
|
|
1093
1093
|
}));
|
|
1094
|
-
largeAmountShipsSource == null || largeAmountShipsSource.clear(), largeAmountShipsSource = new VectorSource({
|
|
1094
|
+
return largeAmountShipsSource == null || largeAmountShipsSource.clear(), largeAmountShipsSource = new VectorSource({
|
|
1095
1095
|
features: new GeoJSON().readFeatures({
|
|
1096
1096
|
type: "FeatureCollection",
|
|
1097
1097
|
features: t
|
|
1098
1098
|
}, {
|
|
1099
1099
|
featureProjection: projection.mercator
|
|
1100
1100
|
})
|
|
1101
|
-
})
|
|
1102
|
-
const o = [
|
|
1103
|
-
"case",
|
|
1104
|
-
["==", ["get", "existMobile"], 1],
|
|
1105
|
-
// 假设 type1 对应红色
|
|
1106
|
-
"#D9001C",
|
|
1107
|
-
"#04C900"
|
|
1108
|
-
];
|
|
1109
|
-
return largeAmountShipsLayer.value = new WebGLPointsLayer({
|
|
1101
|
+
}), largeAmountShipsLayer.value = new WebGLPointsLayer({
|
|
1110
1102
|
source: largeAmountShipsSource,
|
|
1111
1103
|
style: {
|
|
1112
1104
|
"shape-points": 3,
|
|
1113
1105
|
"shape-radius": 9,
|
|
1114
|
-
"shape-fill-color":
|
|
1115
|
-
|
|
1106
|
+
"shape-fill-color": [
|
|
1107
|
+
"case",
|
|
1108
|
+
["==", ["get", "fill"], "#D9001C"],
|
|
1109
|
+
"#D9001C",
|
|
1110
|
+
// 如果 fill 是 #D9001C,返回红色
|
|
1111
|
+
["==", ["get", "fill"], "#04C900"],
|
|
1112
|
+
"#04C900",
|
|
1113
|
+
// 如果 fill 是 #04C900,返回绿色
|
|
1114
|
+
"#04C900"
|
|
1115
|
+
// 默认颜色(绿色)
|
|
1116
|
+
],
|
|
1116
1117
|
"shape-rotate-with-view": !1,
|
|
1117
1118
|
"shape-rotation": [
|
|
1118
1119
|
"+",
|
|
@@ -1129,26 +1130,27 @@ const renderShips = (e) => {
|
|
|
1129
1130
|
}
|
|
1130
1131
|
}), mapInstance$6.value.addLayer(largeAmountShipsLayer.value), largeAmountShipsLayer.value;
|
|
1131
1132
|
}, renderShipsMarker = (e) => {
|
|
1133
|
+
var o;
|
|
1132
1134
|
if (!mapInstance$6.value) return;
|
|
1133
1135
|
deleteAllShipMarkers();
|
|
1134
1136
|
let t = convertShipMapData(e);
|
|
1135
1137
|
if (t = customFilterShips(t), !!(t != null && t.length))
|
|
1136
|
-
return t.forEach((
|
|
1137
|
-
const
|
|
1138
|
-
geometry: new Point(fromLonLat(
|
|
1139
|
-
});
|
|
1140
|
-
l.set("data",
|
|
1141
|
-
setShipStyle(!1
|
|
1138
|
+
return t.forEach((n, r) => {
|
|
1139
|
+
const l = [n.lon, n.lat], i = new Feature({
|
|
1140
|
+
geometry: new Point(fromLonLat(l))
|
|
1141
|
+
}), s = 1;
|
|
1142
|
+
i.set("clickGeometry", new Circle(fromLonLat(l), s)), i.set("data", n), i.set("index", r), i.setStyle(
|
|
1143
|
+
setShipStyle(!1)
|
|
1142
1144
|
), shipsMarkerList.push({
|
|
1143
|
-
ship:
|
|
1144
|
-
lonlat:
|
|
1145
|
-
feature:
|
|
1145
|
+
ship: n,
|
|
1146
|
+
lonlat: l,
|
|
1147
|
+
feature: i
|
|
1146
1148
|
});
|
|
1147
1149
|
}), shipsVectorSource = new VectorSource({
|
|
1148
|
-
features: shipsMarkerList.map((
|
|
1150
|
+
features: shipsMarkerList.map((n) => n.feature)
|
|
1149
1151
|
}), shipsLayer.value = new VectorLayer({
|
|
1150
1152
|
source: shipsVectorSource
|
|
1151
|
-
}), mapInstance$6.value.addLayer(shipsLayer.value), shipsLayer.value;
|
|
1153
|
+
}), (o = mapInstance$6.value) == null || o.addLayer(shipsLayer.value), shipsLayer.value;
|
|
1152
1154
|
}, customFilterShips = (e) => {
|
|
1153
1155
|
let t = cloneDeep(e);
|
|
1154
1156
|
return t = t.filter((o) => {
|
|
@@ -1500,10 +1502,10 @@ const setTruckStyle = (e, t, o, n) => new Style({
|
|
|
1500
1502
|
o === CAR_COLOR.YELLOW ? (h = 176, L = "#FFC81E", T = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (f = 200, h = 196, L = "#8FED7C", T = "rgba(0,0,0,0.88)"), n != null && n.length && (f += n.length * 56), fillRectRadius(i, m, u, f, p, y), fillRectRadius(i, m + 2, u + 2, h, g, L), o === CAR_COLOR.Y_GREEN && fillRectRadius(i, m + 2, u + 2, 68, g, "#FFC81E"), i.save(), i.restore(), i.fillStyle = T, i.font = "bold 28px Arial", i.textAlign = "left", i.textBaseline = "middle";
|
|
1501
1503
|
const b = `${t.slice(0, 2) + " · " + t.slice(2)}`;
|
|
1502
1504
|
if (i.fillText(b, m + 12, u + 32), i.save(), i.restore(), n != null && n.length) {
|
|
1503
|
-
const
|
|
1505
|
+
const x = i.measureText(b).width + 12;
|
|
1504
1506
|
let v = 0;
|
|
1505
1507
|
n.forEach((S) => {
|
|
1506
|
-
S === DEVICE_TYPE.CAMERA && (i.drawImage(cameraImage, c - 54 +
|
|
1508
|
+
S === DEVICE_TYPE.CAMERA && (i.drawImage(cameraImage, c - 54 + x + v * 56, d - 64, 50, 50), ++v), S === DEVICE_TYPE.LOAD && (i.drawImage(loadImage, c - 54 + x + v * 56, d - 64, 50, 50), ++v);
|
|
1507
1509
|
});
|
|
1508
1510
|
}
|
|
1509
1511
|
const C = dotImage;
|
|
@@ -1904,13 +1906,13 @@ const addInteraction = (e) => {
|
|
|
1904
1906
|
const v = n.value.getView(), S = v.getZoom();
|
|
1905
1907
|
S && C(S);
|
|
1906
1908
|
const w = v.calculateExtent(n.value.getSize());
|
|
1907
|
-
w && S &&
|
|
1909
|
+
w && S && x(w, S);
|
|
1908
1910
|
}, C = (v) => {
|
|
1909
|
-
var V, k, M, E,
|
|
1911
|
+
var V, k, M, E, F;
|
|
1910
1912
|
d.value = v, g(v < mapZoom.shipGreenDotMax);
|
|
1911
1913
|
const S = (V = n.value) == null ? void 0 : V.getLayers(), w = c.vehicleMode === "ship" ? S == null ? void 0 : S.getArray().find((P) => P.ol_uid === p.greenMark.ol_uid) : void 0;
|
|
1912
|
-
showTrackLayer.value ? (f.value = !1, w == null || w.setVisible(!1), (k = shipsLayer.value) == null || k.setVisible(!1), (M = largeAmountShipsLayer.value) == null || M.setVisible(!1)) : !m.value && u.value && v <= mapZoom.shipGreenDotMax ? (f.value = !0, w == null || w.setVisible(!0), (E = shipsLayer.value) == null || E.setVisible(!1), (
|
|
1913
|
-
},
|
|
1914
|
+
showTrackLayer.value ? (f.value = !1, w == null || w.setVisible(!1), (k = shipsLayer.value) == null || k.setVisible(!1), (M = largeAmountShipsLayer.value) == null || M.setVisible(!1)) : !m.value && u.value && v <= mapZoom.shipGreenDotMax ? (f.value = !0, w == null || w.setVisible(!0), (E = shipsLayer.value) == null || E.setVisible(!1), (F = largeAmountShipsLayer.value) == null || F.setVisible(!1)) : (f.value = !1, w == null || w.setVisible(!1)), s("zoomChanged", v);
|
|
1915
|
+
}, x = (v, S) => {
|
|
1914
1916
|
const w = transform([v[0], v[1]], projection.mercator, projection.data), V = transform([v[2], v[3]], projection.mercator, projection.data);
|
|
1915
1917
|
s("extentChanged", { extent: [w, V], zoom: S });
|
|
1916
1918
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as d, useModel as i, computed as f, ref as v, openBlock as c, createBlock as y, unref as V, withCtx as n, createVNode as b, mergeProps as I, createSlots as M, renderList as w, renderSlot as B, normalizeProps as N, guardReactiveProps as g, mergeModels as m } from "vue";
|
|
2
|
-
import { v as k, d as P } from "./DatePicker-
|
|
3
|
-
import {
|
|
4
|
-
import { I as
|
|
5
|
-
import { _
|
|
6
|
-
import { w as
|
|
7
|
-
const
|
|
2
|
+
import { v as k, d as P } from "./DatePicker-DNgii92T.js";
|
|
3
|
+
import { Z as T } from "./vendor-BhAIOWbw.js";
|
|
4
|
+
import { I as Z } from "./Input-12ajHBoj.js";
|
|
5
|
+
import { _ } from "./Button-CzjgaPIL.js";
|
|
6
|
+
import { w as $ } from "./utils-BIGjF-zg.js";
|
|
7
|
+
const z = /* @__PURE__ */ d({
|
|
8
8
|
name: "zh-money-input",
|
|
9
9
|
__name: "MoneyInput",
|
|
10
10
|
props: /* @__PURE__ */ m({
|
|
@@ -16,7 +16,7 @@ const C = /* @__PURE__ */ d({
|
|
|
16
16
|
modelModifiers: {}
|
|
17
17
|
}),
|
|
18
18
|
emits: /* @__PURE__ */ m(["update:modelValue"], ["update:modelValue"]),
|
|
19
|
-
setup(s, { emit:
|
|
19
|
+
setup(s, { emit: S }) {
|
|
20
20
|
const a = s, e = i(s, "modelValue"), u = f(() => {
|
|
21
21
|
if (e.value)
|
|
22
22
|
return k(e.value) && Number(e.value) >= 1e3 ? P(Number(e.value)) : "";
|
|
@@ -28,7 +28,7 @@ const C = /* @__PURE__ */ d({
|
|
|
28
28
|
visible: t.showTooltip && r.value && !!u.value
|
|
29
29
|
}, {
|
|
30
30
|
default: n(() => [
|
|
31
|
-
b(
|
|
31
|
+
b(Z, I(t.$attrs, {
|
|
32
32
|
modelValue: e.value,
|
|
33
33
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => e.value = l),
|
|
34
34
|
style: a.style,
|
|
@@ -47,7 +47,7 @@ const C = /* @__PURE__ */ d({
|
|
|
47
47
|
_: 3
|
|
48
48
|
}, 8, ["content", "visible"]));
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
50
|
+
}), C = /* @__PURE__ */ _(z, [["__scopeId", "data-v-d97e0edf"]]), L = $(C);
|
|
51
51
|
export {
|
|
52
52
|
L as Z
|
|
53
53
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as i, toRefs as m, openBlock as h, createElementBlock as u, createElementVNode as e, toDisplayString as s, unref as a, renderSlot as f } from "vue";
|
|
2
|
-
import { _ as g } from "./Button-
|
|
3
|
-
import { w as v } from "./utils-
|
|
2
|
+
import { _ as g } from "./Button-CzjgaPIL.js";
|
|
3
|
+
import { w as v } from "./utils-BIGjF-zg.js";
|
|
4
4
|
const P = { class: "page-head" }, x = { class: "left-wrap" }, b = { class: "page-name" }, S = { class: "value" }, w = { class: "other-inform" }, H = { class: "label" }, k = { class: "value mg-r-24" }, B = { class: "status" }, E = /* @__PURE__ */ i({
|
|
5
5
|
name: "zh-page-head-panel",
|
|
6
6
|
__name: "PageHeadPanel",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { reactive as X, computed as O, toRefs as Ae, ref as M, defineComponent as ne, useCssVars as dt, inject as Ke, openBlock as S, createElementBlock as L, createBlock as F, resolveDynamicComponent as de, mergeProps as J, withKeys as pt, unref as p, createSlots as pe, withCtx as C, Fragment as H, renderList as he, renderSlot as A, createElementVNode as B, toDisplayString as Q, createVNode as w, withModifiers as ht, normalizeClass as Ue, createCommentVNode as I, createTextVNode as Z, useSlots as je, isVNode as ft, normalizeProps as Ne, guardReactiveProps as We, nextTick as fe, onMounted as mt, onActivated as gt, onDeactivated as vt, onUnmounted as bt, watch as yt, provide as Ct, resolveDirective as St, withDirectives as Ce, vShow as wt, toHandlers as _t } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import { D as ee, C as Wt } from "./DatePicker-
|
|
4
|
-
import { _ as le, Z as we } from "./Button-
|
|
5
|
-
import { _ as xt } from "./Dialog-
|
|
6
|
-
import { w as qt } from "./utils-
|
|
2
|
+
import { _ as xe, $ as kt, a0 as Pt, a1 as qe, a2 as Tt, f as $t, a3 as Et, j as Bt, a4 as zt, Z as me, E as ke, a5 as ge, a6 as It, a7 as Mt, i as oe, a8 as Lt, a9 as Dt, aa as Ft, ab as He, ac as Ze, e as q, g as Ge, ad as De, ae as Ot, af as Je, ag as Vt, ah as Rt, ai as At, aj as Kt, m as Se, ak as Ut, d as jt, al as Nt, am as Fe, an as Oe } from "./vendor-BhAIOWbw.js";
|
|
3
|
+
import { D as ee, C as Wt } from "./DatePicker-DNgii92T.js";
|
|
4
|
+
import { _ as le, Z as we } from "./Button-CzjgaPIL.js";
|
|
5
|
+
import { _ as xt } from "./Dialog-Cky8TKRM.js";
|
|
6
|
+
import { w as qt } from "./utils-BIGjF-zg.js";
|
|
7
7
|
const Ht = (g, c = {}, a = !0, f, m, y = (t) => t) => {
|
|
8
8
|
const t = X({
|
|
9
9
|
// 表格数据
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as p, openBlock as r, createBlock as l, unref as s, withCtx as a, renderSlot as c, createElementVNode as i } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as f } from "./Button-
|
|
4
|
-
import { w as d } from "./utils-
|
|
2
|
+
import { Z as m } from "./vendor-BhAIOWbw.js";
|
|
3
|
+
import { _ as f } from "./Button-CzjgaPIL.js";
|
|
4
|
+
import { w as d } from "./utils-BIGjF-zg.js";
|
|
5
5
|
const u = /* @__PURE__ */ p({
|
|
6
6
|
name: "zh-tool-tips",
|
|
7
7
|
__name: "ToolTips",
|
package/dist/es/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { m as o } from "./utils-
|
|
2
|
-
import { a as r, b as a } from "./Button-
|
|
3
|
-
import { Z as m } from "./DatePicker-
|
|
4
|
-
import { Z as t } from "./DetailSubTitle-
|
|
5
|
-
import { Z } from "./Dialog-
|
|
6
|
-
import { Z as s } from "./EditInfoPair-
|
|
7
|
-
import { Z as i } from "./FileWrapper-
|
|
8
|
-
import { Z as p } from "./Grid-
|
|
9
|
-
import { Z as e } from "./InfoPair-
|
|
10
|
-
import { Z as f, a as h } from "./Input-
|
|
11
|
-
import { Z as n } from "./Loading-
|
|
12
|
-
import { Z as l, a as u, b as D, c as I } from "./MessageBox-
|
|
13
|
-
import { Z as P } from "./MoneyInput-
|
|
14
|
-
import { Z as T } from "./PageHeadPanel-
|
|
15
|
-
import { Z as b } from "./ToolTips-
|
|
16
|
-
import { Z as d } from "./BaseInfo-
|
|
17
|
-
import { Z as c } from "./DetailHeader-
|
|
18
|
-
import { Z as g } from "./DiyDataTable-
|
|
19
|
-
import { D as R } from "./DiyDataTable-
|
|
20
|
-
import { Z as B } from "./Map-
|
|
21
|
-
import { Z as x } from "./Table-
|
|
1
|
+
import { m as o } from "./utils-BIGjF-zg.js";
|
|
2
|
+
import { a as r, b as a } from "./Button-CzjgaPIL.js";
|
|
3
|
+
import { Z as m } from "./DatePicker-DNgii92T.js";
|
|
4
|
+
import { Z as t } from "./DetailSubTitle-ChWfR3qA.js";
|
|
5
|
+
import { Z } from "./Dialog-Cky8TKRM.js";
|
|
6
|
+
import { Z as s } from "./EditInfoPair-C0EG8kUd.js";
|
|
7
|
+
import { Z as i } from "./FileWrapper-CmvheBNp.js";
|
|
8
|
+
import { Z as p } from "./Grid-CfJ_U3gi.js";
|
|
9
|
+
import { Z as e } from "./InfoPair-JA1pAAyP.js";
|
|
10
|
+
import { Z as f, a as h } from "./Input-12ajHBoj.js";
|
|
11
|
+
import { Z as n } from "./Loading-CHji9tKE.js";
|
|
12
|
+
import { Z as l, a as u, b as D, c as I } from "./MessageBox-1NCCwju7.js";
|
|
13
|
+
import { Z as P } from "./MoneyInput-PI2K9BeH.js";
|
|
14
|
+
import { Z as T } from "./PageHeadPanel-CBDItYUC.js";
|
|
15
|
+
import { Z as b } from "./ToolTips-BBCd543g.js";
|
|
16
|
+
import { Z as d } from "./BaseInfo-XETJaruy.js";
|
|
17
|
+
import { Z as c } from "./DetailHeader-C7L01g9Z.js";
|
|
18
|
+
import { Z as g } from "./DiyDataTable-D1s7-cdV.js";
|
|
19
|
+
import { D as R } from "./DiyDataTable-D1s7-cdV.js";
|
|
20
|
+
import { Z as B } from "./Map-Drzg1DDm.js";
|
|
21
|
+
import { Z as x } from "./Table-BBWU5wYF.js";
|
|
22
22
|
const A = [
|
|
23
23
|
d,
|
|
24
24
|
r,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { ao as t } from "./vendor-BhAIOWbw.js";
|
|
2
|
+
function n(a) {
|
|
3
3
|
return (s) => t(a, (r) => {
|
|
4
4
|
s.use(r);
|
|
5
5
|
});
|
|
@@ -9,6 +9,6 @@ const e = (a) => (a.install = (l) => {
|
|
|
9
9
|
l.component(s, a);
|
|
10
10
|
}, a);
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
n as m,
|
|
13
13
|
e as w
|
|
14
14
|
};
|
|
@@ -51014,59 +51014,60 @@ ms(Av, {
|
|
|
51014
51014
|
Ve.mount(new tV());
|
|
51015
51015
|
Ve.mount(Av, kv);
|
|
51016
51016
|
export {
|
|
51017
|
-
|
|
51018
|
-
|
|
51019
|
-
|
|
51017
|
+
Dr as $,
|
|
51018
|
+
xh as A,
|
|
51019
|
+
_h as B,
|
|
51020
51020
|
$u as C,
|
|
51021
51021
|
LV as D,
|
|
51022
51022
|
No as E,
|
|
51023
51023
|
Bo as F,
|
|
51024
51024
|
VV as G,
|
|
51025
|
-
|
|
51025
|
+
HV as H,
|
|
51026
51026
|
Ah as I,
|
|
51027
|
-
|
|
51028
|
-
|
|
51027
|
+
NV as J,
|
|
51028
|
+
OV as K,
|
|
51029
51029
|
hr as L,
|
|
51030
51030
|
Lu as M,
|
|
51031
|
-
|
|
51031
|
+
eo as N,
|
|
51032
51032
|
GV as O,
|
|
51033
51033
|
us as P,
|
|
51034
|
-
|
|
51035
|
-
|
|
51034
|
+
YV as Q,
|
|
51035
|
+
BV as R,
|
|
51036
51036
|
or as S,
|
|
51037
51037
|
nv as T,
|
|
51038
|
-
|
|
51038
|
+
es as U,
|
|
51039
51039
|
V8 as V,
|
|
51040
51040
|
WV as W,
|
|
51041
51041
|
jV as X,
|
|
51042
|
-
|
|
51043
|
-
|
|
51044
|
-
|
|
51042
|
+
DV as Y,
|
|
51043
|
+
ol as Z,
|
|
51044
|
+
er as _,
|
|
51045
51045
|
_V as a,
|
|
51046
|
-
|
|
51047
|
-
|
|
51048
|
-
|
|
51049
|
-
|
|
51050
|
-
|
|
51051
|
-
|
|
51052
|
-
|
|
51053
|
-
|
|
51054
|
-
|
|
51055
|
-
|
|
51056
|
-
|
|
51057
|
-
|
|
51058
|
-
|
|
51059
|
-
|
|
51060
|
-
|
|
51061
|
-
|
|
51062
|
-
|
|
51063
|
-
|
|
51064
|
-
|
|
51065
|
-
|
|
51066
|
-
|
|
51067
|
-
|
|
51068
|
-
|
|
51069
|
-
|
|
51046
|
+
xb as a0,
|
|
51047
|
+
Xn as a1,
|
|
51048
|
+
hp as a2,
|
|
51049
|
+
lV as a3,
|
|
51050
|
+
RV as a4,
|
|
51051
|
+
$e as a5,
|
|
51052
|
+
hV as a6,
|
|
51053
|
+
TV as a7,
|
|
51054
|
+
EV as a8,
|
|
51055
|
+
CV as a9,
|
|
51056
|
+
wV as aa,
|
|
51057
|
+
ZA as ab,
|
|
51058
|
+
Ve as ac,
|
|
51059
|
+
$a as ad,
|
|
51060
|
+
dV as ae,
|
|
51061
|
+
SV as af,
|
|
51062
|
+
gV as ag,
|
|
51063
|
+
KV as ah,
|
|
51064
|
+
fV as ai,
|
|
51065
|
+
cV as aj,
|
|
51066
|
+
AP as ak,
|
|
51067
|
+
Ks as al,
|
|
51068
|
+
uV as am,
|
|
51069
|
+
Yd as an,
|
|
51070
|
+
aV as ao,
|
|
51070
51071
|
yV as b,
|
|
51071
51072
|
bV as c,
|
|
51072
51073
|
MV as d,
|
|
@@ -51091,5 +51092,5 @@ export {
|
|
|
51091
51092
|
Qi as w,
|
|
51092
51093
|
UV as x,
|
|
51093
51094
|
$V as y,
|
|
51094
|
-
|
|
51095
|
+
Rh as z
|
|
51095
51096
|
};
|
package/dist/umd/index.umd.cjs
CHANGED
|
@@ -652,8 +652,8 @@ void main(void) {
|
|
|
652
652
|
samplePos = clamp(samplePos, vec2(0.5), sampleSize - vec2(0.5));
|
|
653
653
|
samplePos.y = sampleSize.y - samplePos.y; // invert y axis so that images appear upright
|
|
654
654
|
return texture2D(texture, (samplePos + textureOffset) / textureSize);
|
|
655
|
-
}`;const $=`u_texture${g}`;let V="1.";"fill-color"in t&&(V=e.getFillColorExpression()),e.setFillColorExpression(`${V} * sampleFillPattern(${$}, ${y}, ${L}, ${k}, pxOrigin, pxPos)`)}}function parseLiteralStyle(t,e){const n=newCompilationContext(),r={...newCompilationContext(),inFragmentShader:!0,variables:n.variables},i=new ShaderBuilder,g={};if("icon-src"in t?parseIconProperties(t,i,g,n,r):"shape-points"in t?parseShapeProperties(t,i,g,n,r):"circle-radius"in t&&parseCircleProperties(t,i,g,n,r),parseStrokeProperties(t,i,g,n,r),parseFillProperties(t,i,g,n,r),t.filter){const L=expressionToGlsl(r,t.filter,BooleanType);i.setFragmentDiscardExpression(`!${L}`)}for(const L in r.variables){const $=r.variables[L],V=uniformNameForVariable($.name);let z=getGlslTypeFromType($.type);$.type===ColorType&&(z="vec4"),i.addUniform(`${z} ${V}`),g[V]=()=>{const j=e[$.name];return typeof j=="number"?j:typeof j=="boolean"?j?1:0:$.type===ColorType?asArray(j||"#eee"):typeof j=="string"?getStringNumberEquivalent(j):j}}for(const L in r.properties){const $=r.properties[L];n.properties[L]||(n.properties[L]=$);let V=getGlslTypeFromType($.type),z=`a_prop_${$.name}`;$.type===ColorType&&(V="vec4",z=`unpackColor(${z})`,i.addVertexShaderFunction(UNPACK_COLOR_FN)),i.addVarying(`v_prop_${$.name}`,V,z)}for(const L in n.properties){const $=n.properties[L];i.addAttribute(`${getGlslTypeFromType($.type)} a_prop_${$.name}`)}for(const L in n.functions)i.addVertexShaderFunction(n.functions[L]);for(const L in r.functions)i.addFragmentShaderFunction(r.functions[L]);const y={};for(const L in n.properties){const $=n.properties[L],V=z=>{const j=z.get($.name);return $.type===ColorType?packColor([...asArray(j||"#eee")]):typeof j=="string"?getStringNumberEquivalent(j):typeof j=="boolean"?j?1:0:j};y[`prop_${$.name}`]={size:getGlslSizeFromType($.type),callback:V}}function k(L,$,V,z){const j=n[L],oe=r[L];if(!j&&!oe)return;const re=getGlslTypeFromType(V),ie=getGlslSizeFromType(V);i.addAttribute(`${re} a_${$}`),oe&&i.addVarying(`v_${$}`,re,`a_${$}`),y[$]={size:ie,callback:z}}return k("geometryType",GEOMETRY_TYPE_PROPERTY_NAME,StringType,L=>getStringNumberEquivalent(computeGeometryType(L.getGeometry()))),k("featureId",FEATURE_ID_PROPERTY_NAME,StringType|NumberType,L=>{const $=L.getId()??null;return typeof $=="string"?getStringNumberEquivalent($):$}),{builder:i,attributes:y,uniforms:g}}class WebGLPointsLayer extends Layer{constructor(e){const n=Object.assign({},e);super(n),this.styleVariables_=e.variables||{},this.parseResult_=parseLiteralStyle(e.style,this.styleVariables_),this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){const e=Object.keys(this.parseResult_.attributes).map(n=>({name:n,...this.parseResult_.attributes[n]}));return new WebGLPointsLayerRenderer(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:e})}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}}var CAR_COLOR=(t=>(t[t.BLUE=1]="BLUE",t[t.YELLOW=2]="YELLOW",t[t.Y_GREEN=3]="Y_GREEN",t))(CAR_COLOR||{}),DEVICE_TYPE=(t=>(t[t.HOST=1]="HOST",t[t.TALK=2]="TALK",t[t.STORAGE=3]="STORAGE",t[t.INTERNET=4]="INTERNET",t[t.CAMERA=5]="CAMERA",t[t.LOAD=6]="LOAD",t))(DEVICE_TYPE||{}),LENGTH_UNIT=(t=>(t[t.M=1]="M",t[t.KM=2]="KM",t[t.NM=3]="NM",t))(LENGTH_UNIT||{}),SWITCH_BTN=(t=>(t.Camera="camera",t.Mobile="mobile",t.WaterGauge="waterGauge",t))(SWITCH_BTN||{});class ShipMapData{constructor(e,n,r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae,ue,de,pe,le,he,_e,Ce){tr(this,"id");tr(this,"mmsi");tr(this,"fill");tr(this,"shipType");tr(this,"name");tr(this,"length");tr(this,"breadth");tr(this,"lon");tr(this,"lat");tr(this,"createdAt");tr(this,"speed");tr(this,"from");tr(this,"sailStatus");tr(this,"hdg");tr(this,"cog");tr(this,"posType");tr(this,"type");tr(this,"angle");tr(this,"leftIconColor");tr(this,"existDevice");tr(this,"existMobile");tr(this,"existWaterGauge");tr(this,"selected");this.id=e,this.mmsi=n,this.fill=r,this.shipType=i,this.name=g,this.length=y,this.breadth=k,this.lon=L,this.lat=$,this.createdAt=V,this.speed=z,this.from=j,this.sailStatus=oe,this.hdg=re,this.cog=ie,this.posType=ae,this.type=ue,this.angle=de,this.leftIconColor=pe,this.existDevice=le,this.existMobile=he,this.existWaterGauge=_e,this.selected=Ce}}const formatLength=function(t,e){const r=getLength(t);let i="";switch(e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i},convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},formatArea=(t,e)=>{const r=getArea(t);let i;switch(e){case LENGTH_UNIT.KM:r>1e4?i=Math.round(r/1e6*100)/100+" km<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break;case LENGTH_UNIT.NM:const g=Math.pow(1.852,2);r>1e4?i=Math.round(r/1e6/g*100)/100+" nm<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break}return i},convertShipMapData=t=>{const e=n=>new ShipMapData(n.id,n.id,n.fill||"#04C900","70",(n.cnname||n.enname||n.name)+`${n.existName?n.existName:""}`,n.len||n.length,n.wid||n.breadth,n.lon,n.lat,new Date().getTime(),n.spd,n.from,n.status,Number(n.hdg),n.cog,Number(n.postype),"other",n.cog,n.leftIconColor,n.existDevice,n.existMobile,n.existWaterGauge);return Array.isArray(t)?t.map(n=>e(n)):e(t)},formatUtils={formatLength,convertSixHundredThousandToLatLng,formatArea},_hoisted_1$9={key:0,class:"measure-panel"},_hoisted_2$5={class:"d-flex justify-content-between align-content-start w-100"},_hoisted_3$5={class:"measure-history-list"},_hoisted_4$2={class:"left-panel"},_hoisted_5$2={class:"text index"},_hoisted_6$2={class:"text"},_hoisted_7$2=["onClick"],_sfc_main$b=vue.defineComponent({__name:"measure",props:vue.mergeModels({viewMode:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:vue.mergeModels(["close"],["update:visible"]),setup(t,{expose:e,emit:n}){const r=vue.inject("mapInstance"),i=n,g=vue.useModel(t,"visible"),y=vue.ref("3"),k=vue.ref([]),L=vue.ref(!1),$=new VectorSource;let V,z,j,oe,re;const ie=new VectorLayer({source:$,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),ae=function(Oe){if(Oe.dragging)return;let Ve="点击选择起点";V&&(Ve="单击继续,双击结束"),z&&(z.innerHTML=Ve,j.setPosition(Oe.coordinate),z.classList.remove("hidden"))},ue=()=>{r.value&&(r.value.on("pointermove",ae),r.value.getViewport().addEventListener("mouseout",function(){var Oe;(Oe=z==null?void 0:z.classList)==null||Oe.add("hidden")}),L.value=!0)};let de;const pe=new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})});function le(){var Oe,Ve;if(r.value){if(k.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(qe=>{var Pt;(Pt=qe==null?void 0:qe.parentNode)==null||Pt.removeChild(qe)}),$.clear(),de){const qe=r.value.getInteractions().getArray().find(Pt=>Pt.ol_uid===de.ol_uid);qe&&((Oe=r.value)==null||Oe.removeInteraction(qe))}(Ve=r.value)==null||Ve.removeLayer(ie),z!=null&&z.parentNode&&z.parentNode.removeChild(z),oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe)}}function he(){var Ve,qe;le(),(Ve=r.value)==null||Ve.addLayer(ie),de=new Draw({source:$,type:"LineString",style:function(){return pe}}),(qe=r.value)==null||qe.addInteraction(de),Ce(),_e();let Oe;de.on("drawstart",function(Pt){var $e;V=Pt.feature;let Lt;Oe=($e=V.getGeometry())==null?void 0:$e.on("change",function(Fe){const ze=Fe.target;let Ue=formatUtils.formatLength(ze,Number(y.value));Lt=ze.getLastCoordinate(),oe&&Ue&&(oe.innerHTML=Ue),re.setPosition(Lt)})}),de.on("drawend",function(){oe&&(oe.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),oe!=null&&oe.innerHTML&&k.value.push(oe==null?void 0:oe.innerHTML),re.setOffset([0,-7]),V=null,oe=null,Ce(),Oe&&unByKey(Oe)})}function _e(){var Oe;z!=null&&z.parentNode&&z.parentNode.removeChild(z),z=document.createElement("div"),z.className="ol-tooltip hidden",j=new Overlay({element:z,offset:[15,0],positioning:"center-left"}),(Oe=r.value)==null||Oe.addOverlay(j)}function Ce(){var Oe;oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe),oe=document.createElement("div"),oe.className="ol-tooltip ol-tooltip-measure",re=new Overlay({element:oe,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(Oe=r.value)==null||Oe.addOverlay(re)}const xe=Oe=>{var Pt,Lt;k.value[Oe]&&k.value.splice(Oe,1);const Ve=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");Ve[Oe]&&((Lt=(Pt=Ve[Oe])==null?void 0:Pt.parentNode)==null||Lt.removeChild(Ve[Oe]));const qe=$.getFeatures();qe[Oe]&&$.removeFeature(qe[Oe])},Ie=()=>{i("close")};return vue.watch(()=>g,()=>{g&&!L.value&&(ue(),he())},{deep:!0,immediate:!0}),e({addInteraction:he,removeInteraction:le}),(Oe,Ve)=>g.value&&Oe.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",{class:"header"},[Ve[1]||(Ve[1]=vue.createElementVNode("div",{class:"title"},"测量",-1)),vue.createElementVNode("i",{onClick:Ie,class:"map-iconfont icon-close"})]),vue.createElementVNode("div",_hoisted_2$5,[Ve[2]||(Ve[2]=vue.createElementVNode("div",{class:"tips"},"在地图上点击多个点测量距离,距离单位",-1)),vue.createVNode(vue.unref(ElSelect),{class:"select-length-unit",modelValue:y.value,"onUpdate:modelValue":Ve[0]||(Ve[0]=qe=>y.value=qe)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{label:"m",value:"1"}),vue.createVNode(vue.unref(ElOption),{label:"km",value:"2"}),vue.createVNode(vue.unref(ElOption),{label:"nm",value:"3"})]),_:1},8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.value,(qe,Pt)=>(vue.openBlock(),vue.createElementBlock("div",{class:"measure-history-item",key:Pt},[vue.createElementVNode("div",_hoisted_4$2,[Ve[3]||(Ve[3]=vue.createElementVNode("i",{class:"map-iconfont icon-line"},null,-1)),vue.createElementVNode("span",_hoisted_5$2,"线段"+vue.toDisplayString(Pt+1),1),vue.createElementVNode("span",_hoisted_6$2,vue.toDisplayString(qe),1)]),vue.createElementVNode("div",{class:"delete-button",onClick:Lt=>xe(Pt)},Ve[4]||(Ve[4]=[vue.createElementVNode("i",{class:"map-iconfont icon-delete"},null,-1)]),8,_hoisted_7$2)]))),128))])])):vue.createCommentVNode("",!0)}}),Measure=_export_sfc(_sfc_main$b,[["__scopeId","data-v-d566fd81"]]),CDN_URL="https://static.zhihaoscm.cn/",tiandituKey="a6e8f78974f2581f2ca00485b40c948f",baseMap={tiandituTile:`http://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituTileMark:`http://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTile:`http://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTileMark:`http://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,greenTile:`${CDN_URL}/map/tile/{z}/{x}/{y}.png`},mapZoom={default:6,min:3,max:18,findShipMin:10,findShip:13,findTruck:14,shipGreenDotMax:11,truckDefault:14,truckStatistics:8,shipModelMin:13,shipModelMax:18},renderShipsLimit=200,mapDefaultCenter=[114.84,30.52],projection={data:"EPSG:4326",mercator:"EPSG:3857"};vue.ref();const shipsLayer=vue.ref(),largeAmountShipsLayer=vue.ref(),selectShipsLayer=vue.ref(),allShips=vue.ref([]),selectSingleShipData=vue.ref();vue.ref();const trucksLayer=vue.ref(),shipTrackLineFeatures=vue.ref([]),trackLineVectorSource=vue.ref(),shipTrackVectorLayer=vue.ref();vue.ref(),vue.ref();const shipLabels=vue.ref([]),trackLabels=vue.ref([]),showTrackLayer=vue.ref(!1),allTracks=vue.ref([]),currentTrackId=vue.ref(""),showTrackAnimatMarker=vue.ref(!1),hiddenOrther=vue.ref(!1);function getIconFont(unicode=""){return unicode.indexOf("&")!==-1&&(unicode=unicode.replace("&","&")),unicode.indexOf("&")!==-1&&(unicode=unicode.replace("&","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const multiplyPixelRatio=t=>{const e=window.devicePixelRatio||1;return t.map(n=>n.map(r=>r*e))},adjustBounds=(t,e)=>e.length===2?[t[0]-e[0],t[1]-e[1],t[2]+e[0],t[3]+e[1]]:[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]],isOverlapping=(t,e)=>t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1],getIconStyle=t=>new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14}),zIndex:100}),getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if(z.type==="Feature"&&z.geometry!==null&&z.geometry.type==="Point")return z.geometry.coordinates;if(z.type==="Point")return z.coordinates}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,j,oe={}){if(oe.final)return function(_e,Ce){return(y(Ce,_e)+180)%360}(z,j);const re=g(z),ie=g(j),ae=i(re[0]),ue=i(ie[0]),de=i(re[1]),pe=i(ie[1]),le=Math.sin(ue-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(ue-ae);return r(Math.atan2(le,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,j={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},j,oe)}function $(z,j={},oe={}){const re={type:"Feature"};return oe.id!==void 0&&(re.id=oe.id),oe.bbox&&(re.bbox=oe.bbox),re.properties=j||{},re.geometry=z,re}const V=y(L(t),L(e),n);return V<0?360+V:V},labelAlpha=.8,labelFont="500 12px Arial",labelOutSize=2,labelHeight=10,fillRectRadius=(t,e,n,r,i,g,y=4)=>{t.beginPath(),t.moveTo(e+y,n),t.arcTo(e+r,n,e+r,n+y,y),t.arcTo(e+r,n+i,e+r-y,n+i,y),t.arcTo(e,n+i,e,n+i-y,y),t.arcTo(e,n,e+y,n,y),t.closePath(),t.fillStyle=g,t.fill()},getPixelFromCoordinate=t=>{if(!t||t.length===0)throw new Error("Points array is empty or invalid.");let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const[g,y]of t)g<e&&(e=g),y<n&&(n=y),g>r&&(r=g),y>i&&(i=y);return[e,n,r,i]},calculatePolygonCentroid=t=>{if(!Array.isArray(t)||t.length<3)throw new Error("A polygon must have at least 3 coordinates.");let e=0,n=0,r=0;const i=t.length;for(let k=0;k<i-1;k++){const[L,$]=t[k],[V,z]=t[k+1],j=L*z-V*$;r+=j,e+=(L+V)*j,n+=($+z)*j}if(r*=.5,r===0)throw new Error("多边形面积为零");const g=e/(6*r),y=n/(6*r);return[g,y]},rotateShapeModel=(t,e)=>{const[n,r]=calculatePolygonCentroid(t),i=e*Math.PI/180,g=Math.cos(i),y=Math.sin(i);return t.map(([k,L])=>{const $=k-n,V=L-r,z=$*g-V*y+n,j=$*y+V*g+r;return[z,j]})},getTopLeftPoint=t=>[t[0],t[3]],getBottomLeftPoint=t=>[t[2],t[3]],getBottomRightPoint=t=>[t[2],t[1]],getTopRighttPoint=t=>[t[0],t[1]];function calculateBounds(t,e,n,r,i){let g,y,k,L,$=t[0],V=t[1];switch(e){case 0:g=$+i,y=g+n,L=V-i,k=L-r;break;case 1:g=$+i,y=g+n,L=V+r/2,k=L-r;break;case 2:g=$+i,y=g+n,L=V+i+r,k=L-r;break;case 3:g=$-n/2,y=g+n,L=V+i+r,k=L-r;break;case 4:y=$,g=y-n,L=V+i+r,k=L-r;break;case 5:y=$-i,g=y-n,L=V+r/2,k=L-r;break;case 6:y=$,g=y-n,L=V-i,k=L-r;break;case 7:g=$-n/2,y=g+n,L=V-i,k=L-r}if(!(!g||!k||!y||!L))return[Math.min(g,y),Math.min(k,L),Math.max(g,y),Math.max(k,L)+1]}function calculateAnchorPoint(t,e,n=70,r=20,i=20){let g=[0,0];switch(e){case 0:g[0]=t[0]+i,g[1]=t[1]-i-r/2;break;case 1:g[0]=t[0]+i,g[1]=t[1];break;case 2:g[0]=t[0]+i,g[1]=t[1]+i+r/2;break;case 3:g[0]=t[0],g[1]=t[1]+i+r/4;break;case 4:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]+i+r/4;break;case 5:g[0]=t[0]-i,g[1]=t[1];break;case 6:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]-i-r/4;break;case 7:g[0]=t[0],g[1]=t[1]-i-r/4}return g}function drawLabelBody(t,e,n){if(!t)return;const{font:r,labelOutSize:i=2,labelHeight:g,center:y,text:k,leftIcon:L,shipColor:$,lineLength:V=20,selected:z}=n;t.save(),r&&(t.font=r);let j=t.measureText(k).width+2*i;(L||$)&&(j+=g+4*i),t.restore();let oe,re=20,ie=-1,ae=g+3*i;if(V)for(let ue=0;ue<8;ue++){oe=calculateBounds(y,ue,j,ae,V);let de=!1;for(let pe=0;pe<e.length;++pe){let le=e[pe].bounds,he=[le[0]-re,le[1]-re,le[2]+re,le[3]+re];if(oe&&isOverlapping(oe,he)){de=!0;break}}if(!de){ie=ue;break}}else ie=0,oe=calculateBounds(y,ie,j,ae,V);if(z&&ie===-1&&(ie=0),oe&&ie>-1){let ue=getBottomLeftPoint(oe),de=getTopRighttPoint(oe);return{center:y,x:calculateAnchorPoint(y,ie,j,ae,V),l:de,r:ue,bounds:oe,position:ie,name:k}}else return null}const drawText=(t,e)=>{if(!t)return;const{center:n,text:r,textColor:i,leftIcon:g,rightIcons:y,font:k}=e;t.save(),t.setTransform(1,0,0,1,0,0);let[L,$]=n;if(g){t.font="22px map-iconfont";let V=getIconFont(g.icon);t.fillStyle=g.color,t.fillText(V,L+labelOutSize-4,$+4),L+=22}if(y!=null&&y.length){t.font="12px map-iconfont",t.fillStyle="#3370ff";let V=t.measureText(r).width+6;y.forEach((z,j)=>{let oe=getIconFont(z),re=20*j;t.fillText(oe,L+V+re,$)})}t.font=k||labelFont,t.fillStyle=i,t.fillText(r,L,$),t.restore()},drawPolygon=(t,e)=>{let{points:n,strokeColor:r,fillColor:i,shouldClosePath:g,translation:y,rotation:k,rotationCenter:L,scale:$,globalAlpha:V}=e;if(V||(V=1),n&&t){t.save(),t.beginPath(),k&&k!==0&&L==null&&t.rotate(k),y&&t.translate(y[0],y[1]),k&&(L!=null&&L.length)&&t.rotate(k),$&&t.scale($,$),t.moveTo(n[0][0],n[0][1]);for(let z=1;z<n.length;z++)t.lineTo(n[z][0],n[z][1]);g&&t.closePath(),r&&(t.strokeStyle=r,t.stroke()),i&&g&&(V&&(t.globalAlpha=V),t.fillStyle=i,t.fill()),t.restore()}},drawLabel=(t,e,n)=>{const{center:r,text:i,color:g,textColor:y,bgColor:k,leftIcon:L,rightIcons:$,type:V}=e;if(r&&i){let z={font:labelFont,labelOutSize,labelHeight,center:r,text:i,leftIcon:L,selected:e.selected},j=drawLabelBody(t,n,z);if(j){const{x:oe,bounds:re,l:ie}=j;let ae=[getTopLeftPoint(re),getBottomLeftPoint(re),getBottomRightPoint(re),getTopRighttPoint(re)];n.find(_e=>_e.name===i)||n.push(j),drawPolygon(t,{points:[r,oe],strokeColor:g,fillColor:"#000",shouldClosePath:!0,translation:void 0,rotation:void 0,rotationCenter:void 0,scale:void 0,globalAlpha:labelAlpha}),$!=null&&$.length&&$.forEach(()=>{ae[1][0]+=20,ae[2][0]+=20}),drawPolygon(t,{points:ae,strokeColor:g,fillColor:k,shouldClosePath:!0});const[pe,le]=ie,he={center:[pe,le+labelOutSize+labelHeight+1],text:i,textColor:y,leftIcon:L,rightIcons:$};drawText(t,he)}}return null},PI=Math.PI,a=6378245,ee=.006693421622965943;function transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(e*PI)+40*Math.sin(e/3*PI))*2/3,n+=(160*Math.sin(e/12*PI)+320*Math.sin(e*PI/30))*2/3,n}function transformLng(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(t*PI)+40*Math.sin(t/3*PI))*2/3,n+=(150*Math.sin(t/12*PI)+300*Math.sin(t/30*PI))*2/3,n}function outOfChina(t,e){return!(t>73.66&&t<135.05&&e>3.86&&e<53.55)}function gcj02ToWgs84(t){const[e,n]=t.split(",").map(Number);if(outOfChina(e,n))return`${e.toFixed(6)}, ${n.toFixed(6)}`;{let r=transformLat(e-105,n-35),i=transformLng(e-105,n-35),g=n/180*PI,y=Math.sin(g);y=1-ee*y*y;let k=Math.sqrt(y);r=r*180/(a*(1-ee)/(y*k)*PI),i=i*180/(a/k*Math.cos(g)*PI);let L=n+r,$=e+i;return`${(e*2-$).toFixed(6)}, ${(n*2-L).toFixed(6)}`}}function calculateCirclePoints(t,e){const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}}const equatorialCircumference=2003750834e-2;function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function mercatorToLonLat(t,e="lonlat"){let n={lon:0,lat:0},r=t[0]/equatorialCircumference*180,i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]}function calculateBoundingBox(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;t.forEach(ie=>{const[ae,ue]=ie;e=Math.min(e,ue),n=Math.max(n,ue),r=Math.min(r,ae),i=Math.max(i,ae)});const g=i-r,y=n-e,k=Math.max(g,y),L=(r+i)/2,$=(e+n)/2,V=k/2,z=L-V,j=L+V,oe=$-V,re=$+V;return[j,oe,z,re]}const transformUtils={gcj02ToWgs84,calculateCirclePoints,lonLatToMercator,mercatorToLonLat,calculateBoundingBox};class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}const GeometryConstructor={Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon};function orientFlatCoordinates(t,e,n){return Array.isArray(e[0])?(linearRingssAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRingsArray(t,0,e,n)),t):(linearRingsAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRings(t,0,e,n)),t)}function createRenderFeature(t,e){var g;const n=t.geometry;if(!n)return[];if(Array.isArray(n))return n.map(y=>createRenderFeature({...t,geometry:y})).flat();const r=n.type==="MultiPolygon"?"Polygon":n.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const i=n.layout.length;return transformGeometryWithOptions(new RenderFeature(r,r==="Polygon"?orientFlatCoordinates(n.flatCoordinates,n.ends,i):n.flatCoordinates,(g=n.ends)==null?void 0:g.flat(),i,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function createGeometry(t,e){if(!t)return null;if(Array.isArray(t)){const r=t.map(i=>createGeometry(i,e));return new GeometryCollection(r)}const n=GeometryConstructor[t.type];return transformGeometryWithOptions(new n(t.flatCoordinates,t.layout,t.ends),!1,e)}class JSONFeature extends FeatureFormat{constructor(){super()}getType(){return"json"}readFeature(e,n){return this.readFeatureFromObject(getObject(e),this.getReadOptions(e,n))}readFeatures(e,n){return this.readFeaturesFromObject(getObject(e),this.getReadOptions(e,n))}readFeatureFromObject(e,n){return abstract()}readFeaturesFromObject(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromObject(getObject(e),this.getReadOptions(e,n))}readGeometryFromObject(e,n){return abstract()}readProjection(e){return this.readProjectionFromObject(getObject(e))}readProjectionFromObject(e){return abstract()}writeFeature(e,n){return JSON.stringify(this.writeFeatureObject(e,n))}writeFeatureObject(e,n){return abstract()}writeFeatures(e,n){return JSON.stringify(this.writeFeaturesObject(e,n))}writeFeaturesObject(e,n){return abstract()}writeGeometry(e,n){return JSON.stringify(this.writeGeometryObject(e,n))}writeGeometryObject(e,n){return abstract()}}function getObject(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class GeoJSON extends JSONFeature{constructor(e){e=e||{},super(),this.dataProjection=get$1(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=get$1(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,n){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const i=readGeometryInternal(r.geometry);if(this.featureClass===RenderFeature)return createRenderFeature({geometry:i,id:r.id,properties:r.properties},n);const g=new Feature;return this.geometryName_?g.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&g.setGeometryName(r.geometry_name),g.setGeometry(createGeometry(i,n)),"id"in r&&g.setId(r.id),r.properties&&g.setProperties(r.properties,!0),g}readFeaturesFromObject(e,n){const r=e;let i=null;if(r.type==="FeatureCollection"){const g=e;i=[];const y=g.features;for(let k=0,L=y.length;k<L;++k){const $=this.readFeatureFromObject(y[k],n);$&&i.push($)}}else i=[this.readFeatureFromObject(e,n)];return i.flat()}readGeometryFromObject(e,n){return readGeometry(e,n)}readProjectionFromObject(e){const n=e.crs;let r;if(n)if(n.type=="name")r=get$1(n.properties.name);else if(n.type==="EPSG")r=get$1("EPSG:"+n.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,n){n=this.adaptOptions(n);const r={type:"Feature",geometry:null,properties:null},i=e.getId();if(i!==void 0&&(r.id=i),!e.hasProperties())return r;const g=e.getProperties(),y=e.getGeometry();return y&&(r.geometry=writeGeometry(y,n),delete g[e.getGeometryName()]),isEmpty$1(g)||(r.properties=g),r}writeFeaturesObject(e,n){n=this.adaptOptions(n);const r=[];for(let i=0,g=e.length;i<g;++i)r.push(this.writeFeatureObject(e[i],n));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,n){return writeGeometry(e,this.adaptOptions(n))}}function readGeometryInternal(t,e){if(!t)return null;let n;switch(t.type){case"Point":{n=readPointGeometry(t);break}case"LineString":{n=readLineStringGeometry(t);break}case"Polygon":{n=readPolygonGeometry(t);break}case"MultiPoint":{n=readMultiPointGeometry(t);break}case"MultiLineString":{n=readMultiLineStringGeometry(t);break}case"MultiPolygon":{n=readMultiPolygonGeometry(t);break}case"GeometryCollection":{n=readGeometryCollectionGeometry(t);break}default:throw new Error("Unsupported GeoJSON type: "+t.type)}return n}function readGeometry(t,e){const n=readGeometryInternal(t);return createGeometry(n,e)}function readGeometryCollectionGeometry(t,e){return t.geometries.map(function(r){return readGeometryInternal(r)})}function readPointGeometry(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:getLayoutForStride(e.length)}}function readLineStringGeometry(t){var r;const e=t.coordinates,n=e.flat();return{type:"LineString",flatCoordinates:n,ends:[n.length],layout:getLayoutForStride(((r=e[0])==null?void 0:r.length)||2)}}function readMultiLineStringGeometry(t){var g,y;const e=t.coordinates,n=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length)||2,r=[],i=deflateCoordinatesArray(r,0,e,n);return{type:"MultiLineString",flatCoordinates:r,ends:i,layout:getLayoutForStride(n)}}function readMultiPointGeometry(t){var n;const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:getLayoutForStride(((n=e[0])==null?void 0:n.length)||2)}}function readMultiPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y[0].length)||2,i=deflateMultiCoordinatesArray(n,0,e,r);return{type:"MultiPolygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function readPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=(y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length,i=deflateCoordinatesArray(n,0,e,r);return{type:"Polygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function writeGeometry(t,e){t=transformGeometryWithOptions(t,!0,e);const n=t.getType();let r;switch(n){case"Point":{r=writePointGeometry(t);break}case"LineString":{r=writeLineStringGeometry(t);break}case"Polygon":{r=writePolygonGeometry(t,e);break}case"MultiPoint":{r=writeMultiPointGeometry(t);break}case"MultiLineString":{r=writeMultiLineStringGeometry(t);break}case"MultiPolygon":{r=writeMultiPolygonGeometry(t,e);break}case"GeometryCollection":{r=writeGeometryCollectionGeometry(t,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+n)}return r}function writeGeometryCollectionGeometry(t,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(r){return writeGeometry(r,e)})}}function writeLineStringGeometry(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}function writeMultiLineStringGeometry(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}function writeMultiPointGeometry(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}function writeMultiPolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}function writePointGeometry(t,e){return{type:"Point",coordinates:t.getCoordinates()}}function writePolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}const mapInstance$8=vue.ref(),renderTrackStyleSetInstance=t=>mapInstance$8.value=t,stopIcon="",stopColor="#E31818",slowIcon="",slowColor="#1890FF",dropletsIcon="",trackList$1=vue.ref([]),renderTrackLine=(t,e,n)=>{var g,y,k;const r=t[e];if(!r)return;allTracks.value[e]=r,trackList$1.value=[],trackList$1.value=r.map((L,$)=>(L.center=[L.lon,L.lat],L.centerPoint=transformUtils.lonLatToMercator(L.center),L.id=e,L.index=$,L.time=hooks(L.createdAt).format("YYYY-MM-DD HH:mm:ss"),L));let i=trackList$1.value.map(L=>L.centerPoint);if(i.length>=2){let L=new LineString(i);const $=new Feature({geometry:L});$.setStyle(new Style({stroke:new Stroke({color:n,width:2})})),$.setId(e),$.set("type","line"),(y=(g=shipTrackVectorLayer.value)==null?void 0:g.getSource())==null||y.clear(),shipTrackLineFeatures.value=[];const V=shipTrackLineFeatures.value.findIndex(z=>z.getId()===e);V>=0?shipTrackLineFeatures.value[V]=$:shipTrackLineFeatures.value.push($),createAnimatedIconFeature(n,i),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value=new VectorLayer({source:trackLineVectorSource.value}),renderPoint(n),(k=mapInstance$8.value)==null||k.addLayer(shipTrackVectorLayer.value)}},handlePlay=(t,e)=>{const n=allTracks.value[t];playAnimation(n.map(r=>[r.lon,r.lat]),e)},removeShipTrackLineFeatureByIndex=t=>{t>=0&&t<shipTrackLineFeatures.value.length&&(shipTrackLineFeatures.value.splice(t,1),allTracks.value.splice(t,1)),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value&&shipTrackVectorLayer.value.setSource(trackLineVectorSource.value)},createAnimatedIconFeature=(t,e)=>{const n=new Feature({geometry:new Point(fromLonLat([e[0][0],e[0][1]]))}),r=new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont(""),fill:new Fill({color:t})})});return n.setStyle(r),n},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont(""),fill:new Fill({color:"#ff0000"}),rotation:0})});let polyline,linePath,startMarker,position,geoMarker,vectorLayer;const trackAnimating=vue.ref(!1);let distance=0,lastTime=Date.now(),moveFeatureHandler=null;const moveFeature=(t,e)=>{var z;const n=Number(50*e),r=t.frameState.time,i=r-lastTime;if(distance=(distance+n*i/1e6)%2,lastTime=r,distance>=1){stopAnimation();return}const g=linePath.getCoordinateAt(distance>1?2-distance:distance),y=linePath.getCoordinateAt(distance>1?distance-.01:distance),k=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),$=getRotation(transformUtils.mercatorToLonLat(y,"array"),transformUtils.mercatorToLonLat(k,"array"))*Math.PI/180;geoMarkerStyle.getText().setRotation($),position.setCoordinates(g);const V=getVectorContext(t);V.context_.save(),V.setStyle(geoMarkerStyle),V.drawGeometry(position),V.context_.restore(),(z=mapInstance$8.value)==null||z.render()},startAnimation=()=>{trackAnimating.value=!0,showTrackAnimatMarker.value=!0,lastTime=Date.now(),distance=0,position=startMarker.getGeometry().clone(),vectorLayer.on("postrender",moveFeatureHandler),geoMarker.setGeometry(null)},stopAnimation=()=>{var t;trackAnimating.value&&(trackAnimating.value=!1,geoMarker.setGeometry(null),vectorLayer.un("postrender",moveFeatureHandler),(t=mapInstance$8.value)==null||t.removeLayer(vectorLayer),vectorLayer=null,geoMarker=null)},playAnimation=(t,e)=>{var n;trackAnimating.value&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())}),position=startMarker.getGeometry().clone(),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position}),vectorLayer=new VectorLayer({source:new VectorSource({features:[geoMarker]})}),(n=mapInstance$8.value)==null||n.addLayer(vectorLayer),moveFeatureHandler=r=>moveFeature(r,e),startAnimation()},renderPoint=t=>{if(!mapInstance$8.value)return;let e=trackList$1.value||[];if(!(e&&e.length>1))return[];let n={16:24,17:15,default:4},r=[],i=e.length;for(let k=0;k<i;k++){e[k].index=k;let L=mapInstance$8.value.getPixelFromCoordinate(e[k].centerPoint);if(L){let $=L.concat(L);$=adjustBounds($,[20,20]);let V=mapInstance$8.value.getView().getZoom();if(!V)return;if(V>15){let j=n[V]||n.default;$=adjustBounds($,[j,j])}let z=!0;if(e[k].state!=="0"){for(let j=0;j<r.length;j++)if(isOverlapping($,r[j].bounds)){z=!1;break}}z&&(e[k].bounds=$,r.push(e[k]))}}const g=getIconStyle(stopIcon),y=getIconStyle(slowIcon);r.forEach((k,L)=>{var z,j;let $=new Feature({geometry:new Point(k.centerPoint)});$.set("type","track_point"),$.set("data",k),$.setStyle(new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})),trackLineVectorSource.value.addFeature($);const V=new Feature({geometry:new Point(fromLonLat(k.center))});if(V.set("type","track_label"),V.set("track_label_index",L),V.setStyle(setTrackLabelStyle(k,t)),trackLineVectorSource.value.addFeature(V),typeof k=="object"&&k.hasOwnProperty("state")){let oe=new Feature({geometry:new Point(k.centerPoint)});oe.set("type","track_icon");let re=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(dropletsIcon),offsetY:-10}),zIndex:99}),ie=[];k.state==="0"?((z=re.getText())==null||z.setFill(new Fill({color:stopColor})),ie.push(g)):((j=re.getText())==null||j.setFill(new Fill({color:slowColor})),ie.push(y)),ie.push(re),oe.setStyle(ie),trackLineVectorSource.value.addFeature(oe)}}),renderArrow(r,t),renderIconPoint()},renderArrow=(t,e)=>{const n=t.length;n||(t.push(trackList$1.value[0]),t.push(trackList$1.value[trackList$1.value.length-1]));for(let r=0;r<n-1;r++){let i,g=t[r],y=(t[r+1].index+g.index)/2;if(y%2===0)i=trackList$1.value[y].centerPoint;else{let k=trackList$1.value[Math.floor(y)],L=trackList$1.value[Math.ceil(y)];if(k&&L){let[$,V]=k.centerPoint,[z,j]=L.centerPoint;i=[($+z)/2,(V+j)/2]}}if(i){let k=new Feature({geometry:new Point(i)});k.set("type","track_arrow"),k.setStyle(new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont(""),fill:new Fill({color:e}),rotation:getRotation(t[r].center,t[r+1].center)*(Math.PI/180)})})),trackLineVectorSource.value.addFeature(k)}}},renderIconPoint=()=>{const t="",e="#fcdc3f",n="#ff0000";(trackList$1.value.length<2?[trackList$1.value[0]]:[trackList$1.value[0],trackList$1.value[trackList$1.value.length-1]]).forEach(i=>{let g=new Feature({geometry:new Point(i.centerPoint)});g.set("type","track_begin"),g.set("data",i);const y=i.index===0&&trackList$1.value.length>=2?e:n;g.setStyle(new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:y})}),zIndex:101})),trackLineVectorSource.value.addFeature(g)})},setTrackLabelStyle=(t,e)=>new Style({renderer:(n,r)=>{const i=r.context,k={center:n,text:t.time,color:e,textColor:"#000",bgColor:"rgba(255,255,255,.8)",selected:!0,type:"TrackTime"};drawLabel(i,k,trackLabels.value)}}),triangleModel=multiplyPixelRatio([[0,-8],[5,8],[-5,8]]),shipShapeModel=multiplyPixelRatio([[0,-4.545],[-.56,-3.909],[-1,-2.727],[-1,3.636],[-.8,4.545],[.8,4.545],[1,3.636],[1,-2.727],[.56,-3.909],[0,-4.545]]),shipDirectPath={left:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},right:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},front:{0:[[0,0],[0,-8]],1:[[0,0],[0,-16]],2:[[0,0],[0,-24]]}},setBlankStyle=()=>new Style({image:new CircleStyle({radius:0})}),mapInstance$7=vue.ref(),renderShipStyleSetInstance=t=>mapInstance$7.value=t,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=t=>new Style({renderer:(e,n)=>{const r=n.context,i=n.feature.get("data");n.feature.get("index")===0&&(shipLabels.value=[]);try{const y=drawShipBody(r,i,e);y&&(drawHeading(r,i,y),t&&(drawSelectBounds(r,y),i.selected=!0)),drawShipLabel(r,i,e)}catch{return!1}}}),drawShipBody=(t,e,n)=>{if(!mapInstance$7.value)return;const r=Math.round(Number(mapInstance$7.value.getView().getZoom()));if(!r)return;let i=[];const[g,y]=drawShipModelByZoom[r]||[0,0],[k,L]=n;if(r<=mapZoom.shipModelMax&&r>mapZoom.shipModelMin&&e.length>=g&&e.breadth>=y)i=rotateShapeModel(drawCurrentShipShapeModel(e,r),e.angle).map(V=>{const[z,j]=V;return[k+z,L+j]});else{const $=rotateShapeModel(triangleModel,e.angle);n.length===2&&(i=$.map(V=>{const[z,j]=V;return[k+z,L+j]}))}if(!(i.length>2))return!1;t.save(),t.beginPath(),t.moveTo(i[0][0],i[0][1]);for(let $=1;$<i.length;$++)t.lineTo(i[$][0],i[$][1]);return t.closePath(),t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.fillStyle=e.fill,t.fill(),t.restore(),i},drawHeading=(t,e,n)=>{const[r,i]=n[0],g=getShipDirectPath(e);if(g){let y=g.map(function(k){let[L,$]=k;return[L+r,$+i]});if(t.save(),t.beginPath(),e.angle>0){t.translate(r,i);const k=e.angle*Math.PI/180;t.rotate(k),t.translate(-r,-i)}t.moveTo(r,i);for(let k=1;k<y.length;k++){let[L,$]=y[k];t.lineTo(L,$)}t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.restore()}},drawSelectBounds=(t,e)=>{let[n,r,i,g]=getPixelFromCoordinate(e);const y=4;n-=y,r-=y,i+=y,g+=y,t.save(),t.strokeStyle="#ff0000",t.lineWidth=4;const k=8;t.beginPath(),t.moveTo(n+k,g),t.lineTo(n,g),t.lineTo(n,g-k),t.moveTo(n,r+k),t.lineTo(n,r),t.lineTo(n+k,r),t.moveTo(i-k,r),t.lineTo(i,r),t.lineTo(i,r+k),t.moveTo(i,g-k),t.lineTo(i,g),t.lineTo(i-k,g),t.stroke(),t.restore()},drawShipLabel=(t,e,n)=>{const[r,i]=n,g=r-0,y=i-0,k=e.name;let L;e.leftIconColor&&(L={color:e.leftIconColor,icon:""});let $=getShipCustomIcon(e);const V={center:[g,y],text:k,color:"#fff",textColor:"#000",bgColor:"#fff",leftIcon:L,rightIcons:$,selected:e.selected,type:"ShipName"};drawLabel(t,V,shipLabels.value)},drawCurrentShipShapeModel=(t,e)=>{let n=0;e<=14?n=.058:e===15?n=.12:e===16?n=.22:e===17?n=.435:e===18&&(n=.857);const r=t.length/4*n,i=t.breadth*n;let g=cloneDeep(shipShapeModel);return g=g.map(([y,k])=>[y*i,k*r]),g},getShipDirectPath=t=>{let{speed:e,hdg:n,cog:r}=t,i="",g=null;if(e&&e>1&&(n!==null&&n!=511&&r!==null?r-n>=3?i="left":r-n<=-3?i="right":i="front":i="front",i&&e))for(let y in speedCondition){let k=speedCondition[y];if(e>=k[0]&&e<k[1]){g=shipDirectPath[i][y];break}}return g},getShipCustomIcon=t=>{let e=[];return t.existDevice&&e.push(""),t.existMobile&&e.push(""),t.existWaterGauge&&e.push(""),e||[]},TileEventType={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},tmpTileCoord=[0,0,0],DECIMALS=5;class TileGrid{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,assert(isSorted(this.resolutions_,(i,g)=>g-i),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let i=0,g=this.resolutions_.length-1;i<g;++i)if(!n)n=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,assert(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=getTopLeft(r)),assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,assert(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:DEFAULT_TILE_SIZE,assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,g)=>{const y=new TileRange(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const k=this.getTileRangeForExtentAndZ(r,g);y.minX=Math.max(k.minX,y.minX),y.maxX=Math.min(k.maxX,y.maxX),y.minY=Math.max(k.minY,y.minY),y.maxY=Math.min(k.maxY,y.maxY)}return y}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,n,r){const i=this.getTileRangeForExtentAndZ(e,n);for(let g=i.minX,y=i.maxX;g<=y;++g)for(let k=i.minY,L=i.maxY;k<=L;++k)r([n,g,k])}forEachTileCoordParentTileRange(e,n,r,i){let g,y,k,L=null,$=e[0]-1;for(this.zoomFactor_===2?(y=e[1],k=e[2]):L=this.getTileCoordExtent(e,i);$>=this.minZoom;){if(y!==void 0&&k!==void 0?(y=Math.floor(y/2),k=Math.floor(k/2),g=createOrUpdate(y,y,k,k,r)):g=this.getTileRangeForExtentAndZ(L,$,r),n($,g))return!0;--$}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const g=e[1]*2,y=e[2]*2;return createOrUpdate(g,g+1,y,y+1,n)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;const i=e[0],g=e[1],y=e[2];if(n===i)return createOrUpdate(g,y,g,y,r);if(this.zoomFactor_){const L=Math.pow(this.zoomFactor_,n-i),$=Math.floor(g*L),V=Math.floor(y*L);if(n<i)return createOrUpdate($,$,V,V,r);const z=Math.floor(L*(g+1))-1,j=Math.floor(L*(y+1))-1;return createOrUpdate($,z,V,j,r)}const k=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(k,n,r)}getTileRangeForExtentAndZ(e,n,r){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,tmpTileCoord);const i=tmpTileCoord[1],g=tmpTileCoord[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,tmpTileCoord);const y=tmpTileCoord[1],k=tmpTileCoord[2];return createOrUpdate(i,y,g,k,r)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=toSize(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,n){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),g=toSize(this.getTileSize(e[0]),this.tmpSize_),y=r[0]+e[1]*g[0]*i,k=r[1]-(e[2]+1)*g[1]*i,L=y+g[0]*i,$=k+g[1]*i;return createOrUpdate$2(y,k,L,$,n)}getTileCoordForCoordAndResolution(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)}getTileCoordForXYAndResolution_(e,n,r,i,g){const y=this.getZForResolution(r),k=r/this.getResolution(y),L=this.getOrigin(y),$=toSize(this.getTileSize(y),this.tmpSize_);let V=k*(e-L[0])/r/$[0],z=k*(L[1]-n)/r/$[1];return i?(V=ceil(V,DECIMALS)-1,z=ceil(z,DECIMALS)-1):(V=floor(V,DECIMALS),z=floor(z,DECIMALS)),createOrUpdate$1(y,V,z,g)}getTileCoordForXYAndZ_(e,n,r,i,g){const y=this.getOrigin(r),k=this.getResolution(r),L=toSize(this.getTileSize(r),this.tmpSize_);let $=(e-y[0])/k/L[0],V=(y[1]-n)/k/L[1];return i?($=ceil($,DECIMALS)-1,V=ceil(V,DECIMALS)-1):($=floor($,DECIMALS),V=floor(V,DECIMALS)),createOrUpdate$1(r,$,V,g)}getTileCoordForCoordAndZ(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const r=linearFindNearest(this.resolutions_,e,n||0);return clamp(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return intersectsLinearRing(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,r=new Array(n);for(let i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}function getForProjection(t){let e=t.getDefaultTileGrid();return e||(e=createForProjection(t),t.setDefaultTileGrid(e)),e}function wrapX(t,e,n){const r=e[0],i=t.getTileCoordCenter(e),g=extentFromProjection(n);if(!containsCoordinate(g,i)){const y=getWidth(g),k=Math.ceil((g[0]-i[0])/y);return i[0]+=y*k,t.getTileCoordForCoordAndZ(i,r)}return e}function createForExtent(t,e,n,r){r=r!==void 0?r:"top-left";const i=resolutionsFromExtent(t,e,n);return new TileGrid({extent:t,origin:getCorner(t,r),resolutions:i,tileSize:n})}function createXYZ(t){const e=t||{},n=e.extent||get$1("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:resolutionsFromExtent(n,e.maxZoom,e.tileSize,e.maxResolution)};return new TileGrid(r)}function resolutionsFromExtent(t,e,n,r){e=e!==void 0?e:DEFAULT_MAX_ZOOM,n=toSize(n!==void 0?n:DEFAULT_TILE_SIZE);const i=getHeight(t),g=getWidth(t);r=r>0?r:Math.max(g/n[0],i/n[1]);const y=e+1,k=new Array(y);for(let L=0;L<y;++L)k[L]=r/Math.pow(2,L);return k}function createForProjection(t,e,n,r){const i=extentFromProjection(t);return createForExtent(i,e,n,r)}function extentFromProjection(t){t=get$1(t);let e=t.getExtent();if(!e){const n=180*METERS_PER_UNIT$1.degrees/t.getMetersPerUnit();e=createOrUpdate$2(-n,-n,n,n)}return e}class TileSource extends Source{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&toSize(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||getUid(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,r,i,g){return abstract()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:getForProjection(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,r){const i=this.getTileGridForProjection(r),g=this.getTilePixelRatio(n),y=toSize(i.getTileSize(e),this.tmpSize);return g==1?y:scale$1(y,g,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const r=n!==void 0?n:this.getProjection(),i=n!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=wrapX(i,e,r)),withinExtentAndZ(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class TileSourceEvent extends BaseEvent{constructor(e,n){super(e),this.tile=n}}const zRegEx=/\{z\}/g,xRegEx=/\{x\}/g,yRegEx=/\{y\}/g,dashYRegEx=/\{-y\}/g;function renderXYZTemplate(t,e,n,r,i){return t.replace(zRegEx,e.toString()).replace(xRegEx,n.toString()).replace(yRegEx,r.toString()).replace(dashYRegEx,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function expandUrl(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let g;for(g=r;g<=i;++g)e.push(t.replace(n[0],String.fromCharCode(g)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)e.push(t.replace(n[0],i.toString()));return e}return e.push(t),e}function createFromTemplate(t,e){return function(n,r,i){if(!n)return;let g;const y=n[0];if(e){const k=e.getFullTileRange(y);k&&(g=k.getHeight()-1)}return renderXYZTemplate(t,y,n[1],n[2],g)}}function createFromTemplates(t,e){const n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=createFromTemplate(t[i],e);return createFromTileUrlFunctions(r)}function createFromTileUrlFunctions(t){return t.length===1?t[0]:function(e,n,r){if(!e)return;const i=hash(e),g=modulo(i,t.length);return t[g](e,n,r)}}class UrlTile extends TileSource{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===UrlTile.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,r=getUid(n),i=n.getState();let g;i==TileState.LOADING?(this.tileLoadingKeys_[r]=!0,g=TileEventType.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],g=i==TileState.ERROR?TileEventType.TILELOADERROR:i==TileState.LOADED?TileEventType.TILELOADEND:void 0),g!=null&&this.dispatchEvent(new TileSourceEvent(g,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=expandUrl(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
|
|
656
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(createFromTemplates(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,r){}}class TileImage extends UrlTile{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:defaultTileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ImageTile,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!equivalent(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||equivalent(n,e)))return this.tileGrid;const r=getUid(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=getForProjection(e)),this.tileGridForProjection[r]}createTile_(e,n,r,i,g,y){const k=[e,n,r],L=this.getTileCoordForTileUrlFunction(k,g),$=L?this.tileUrlFunction(L,i,g):void 0,V=new this.tileClass(k,$!==void 0?TileState.IDLE:TileState.EMPTY,$!==void 0?$:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return V.key=y,V.addEventListener(EventType.CHANGE,this.handleTileChange.bind(this)),V}getTile(e,n,r,i,g){const y=this.getProjection();if(!y||!g||equivalent(y,g))return this.getTileInternal(e,n,r,i,y||g);const k=[e,n,r],L=this.getKey(),$=this.getTileGridForProjection(y),V=this.getTileGridForProjection(g),z=this.getTileCoordForTileUrlFunction(k,g),j=new ReprojTile(y,$,g,V,k,z,this.getTilePixelRatio(i),this.getGutter(),(oe,re,ie,ae)=>this.getTileInternal(oe,re,ie,ae,y),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return j.key=L,j}getTileInternal(e,n,r,i,g){const y=this.getKey();return this.createTile_(e,n,r,i,g,y)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const r=get$1(e);if(r){const i=getUid(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=n)}}}function defaultTileLoadFunction(t,e){t.getImage().src=e}class XYZ extends TileImage{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:createXYZ({extent:extentFromProjection(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const mapInstance$6=vue.ref(),renderShipSetInstance=t=>mapInstance$6.value=t;let shipsMarkerList=[],shipsVectorSource,largeAmountShipsSource;const selectedShipData=vue.ref(null);let selectShipsVectorSource;const renderShips=t=>{var n,r,i,g;if(!mapInstance$6.value||showTrackLayer.value)return;const e=Math.round(Number(mapInstance$6.value.getView().getZoom()));if(selectedShipData.value&&vue.nextTick(()=>{selectSingleShipMarker(selectedShipData.value)}).then(y=>{}),!(!e||e<mapZoom.shipGreenDotMax)&&(allShips.value=t,!hiddenOrther.value))return e>=mapZoom.shipGreenDotMax&&e<mapZoom.shipModelMin||t.length>renderShipsLimit?((n=shipsLayer.value)==null||n.setVisible(!1),(r=largeAmountShipsLayer.value)==null||r.setVisible(!0),renderLargeAmountShips(t)):((i=largeAmountShipsLayer.value)==null||i.setVisible(!1),(g=shipsLayer.value)==null||g.setVisible(!0),renderShipsMarker(t))},renderLargeAmountShips=t=>{if(!mapInstance$6.value)return;const e=t.map(r=>({type:"Feature",geometry:{type:"Point",coordinates:[r.lon,r.lat]},properties:r}));largeAmountShipsSource==null||largeAmountShipsSource.clear(),largeAmountShipsSource=new VectorSource({features:new GeoJSON().readFeatures({type:"FeatureCollection",features:e},{featureProjection:projection.mercator})});const n=["case",["==",["get","existMobile"],1],"#D9001C","#04C900"];return largeAmountShipsLayer.value=new WebGLPointsLayer({source:largeAmountShipsSource,style:{"shape-points":3,"shape-radius":9,"shape-fill-color":n,"shape-rotate-with-view":!1,"shape-rotation":["+",["get","cog"],180],"shape-scale":[.8,1.2],"shape-stroke-color":"#000000","shape-stroke-width":.5}}),mapInstance$6.value.addLayer(largeAmountShipsLayer.value),largeAmountShipsLayer.value},renderShipsMarker=t=>{if(!mapInstance$6.value)return;deleteAllShipMarkers();let e=convertShipMapData(t);if(e=customFilterShips(e),!!(e!=null&&e.length))return e.forEach((n,r)=>{const i=[n.lon,n.lat],g=new Feature({geometry:new Point(fromLonLat(i))});g.set("data",n),g.set("index",r),g.setStyle(setShipStyle(!1,n.id)),shipsMarkerList.push({ship:n,lonlat:i,feature:g})}),shipsVectorSource=new VectorSource({features:shipsMarkerList.map(n=>n.feature)}),shipsLayer.value=new VectorLayer({source:shipsVectorSource}),mapInstance$6.value.addLayer(shipsLayer.value),shipsLayer.value},customFilterShips=t=>{let e=cloneDeep(t);return e=e.filter(n=>{var i;let r=getFilterItem(n).every(({btnShow:g,value:y})=>g?!!y:!0);return(switchBtnShow.value.camera||switchBtnShow.value.mobile||switchBtnShow.value.waterGauge)&&((i=selectedShipData.value)==null?void 0:i.id)===n.id&&clearSelectFeature(),r}),e},getFilterItem=t=>[{btnShow:switchBtnShow.value.camera,value:t==null?void 0:t.existDevice},{btnShow:switchBtnShow.value.mobile,value:t==null?void 0:t.existMobile},{btnShow:switchBtnShow.value.waterGauge,value:t==null?void 0:t.existWaterGauge}],deleteAllShipMarkers=()=>{shipsMarkerList.forEach(t=>{t.feature&&(shipsVectorSource==null||shipsVectorSource.removeFeature(t.feature))}),shipsMarkerList=[]},selectSingleShipMarker=t=>{var g;if(!mapInstance$6.value)return;const e=cloneDeep(selectSingleShipData.value);selectSingleShipData.value=convertShipMapData(t);const n=[selectSingleShipData.value.lon,selectSingleShipData.value.lat],r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",selectSingleShipData.value),r.setStyle(setShipStyle(!0)),shipsMarkerList.push({ship:selectSingleShipData.value,lonlat:n,feature:r}),selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsVectorSource=new VectorSource({features:[r]}),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!0);const i=(g=shipsLayer.value)==null?void 0:g.getSource();return i&&(e&&setVisibleFeatureById(i,e.id,!0),setVisibleFeatureById(i,selectSingleShipData.value.id,!1)),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!0),selectShipsLayer.value},setVisibleFeatureById=(t,e,n)=>{t&&t.forEachFeature(r=>{const i=r.get("data");i&&i.id===e&&r.setStyle(n?setShipStyle(!1,i.id):setBlankStyle())})},findShip=(t,e,n=!0)=>{var i,g,y,k,L;if(console.log(mapInstance$6.value.ol_uid),!t||!mapInstance$6.value)return;const r=(y=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures())==null?void 0:y.find($=>{var V;return((V=$.get("data"))==null?void 0:V.id)===t});if(r?selectedShipData.value=r.get("data"):e&&(selectedShipData.value=e),!e){console.error("找不到船舶");return}if(n&&((k=selectedShipData.value)!=null&&k.lon)&&((L=selectedShipData.value)!=null&&L.lat)){const $=mapInstance$6.value.getView(),V=new Point([selectedShipData.value.lon,selectedShipData.value.lat]);$.setCenter(transform(V.getCoordinates(),projection.data,projection.mercator));const z=$.getZoom(),j=z<mapZoom.findShipMin?mapZoom.findShip:z;$.setZoom(j)}return selectSingleShipMarker(e),r},clearSelectFeature=()=>{var t;if(selectedShipData.value){setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!1);const e=(t=shipsLayer.value)==null?void 0:t.getSource();e&&setVisibleFeatureById(e,selectSingleShipData.value.id,!0)}selectedShipData.value=null,mapInstance$6.value&&(selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!1))},hiddenAllShips=()=>{var t,e;(t=shipsLayer.value)==null||t.setVisible(!1),(e=largeAmountShipsLayer.value)==null||e.setVisible(!1)},switchBtnShow=vue.ref({[SWITCH_BTN.Camera]:!1,[SWITCH_BTN.Mobile]:!1,[SWITCH_BTN.WaterGauge]:!1}),switchFilterItem=(t,e)=>{switchBtnShow.value[t]=e,renderShips(allShips.value)},rerenderShip=()=>{renderShips(allShips.value)},mapInstance$5=vue.ref(),renderTrackSetInstance=t=>mapInstance$5.value=t,showTracks=vue.ref([]),trackList=vue.ref([]);vue.ref(null);const trackId=vue.ref(""),cursor=vue.ref(0),renderTrack=(t,e,n,r,i="ship")=>{var V;if(vue.nextTick(()=>{hiddenAllShips()}).then(z=>{}),(e==null?void 0:e.length)<2){((V=showTracks.value)==null?void 0:V.findIndex(z=>z.id===t))<0&&showTracks.value.push({id:t,length:""});return}let g={};e.forEach(z=>{z.state?z.state=Number(z.state):delete z.state}),trackId.value=t,g[t]=e,trackList.value=e;const y=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],k=g[t].map(z=>transform([z.lon,z.lat],projection.data,projection.mercator)),L=new LineString(k),$=formatUtils.formatLength(L,r)||"--";vue.nextTick(()=>{var j,oe;const z=(j=showTracks.value)==null?void 0:j.findIndex(re=>re.id===t);z<0?showTracks.value.push({id:t,length:$}):showTracks.value[z].length=$,++cursor.value,cursor.value>y.length&&(cursor.value=0),renderTrackLine(g,t,n),vue.nextTick(()=>{resetTrackView(t)}).then(()=>{}),(oe=mapInstance$5.value)==null||oe.on("moveend",()=>{showTrackLayer.value&&(trackLabels.value=[],renderTrackLine(g,t,n))})}).then(()=>{})},removeAllTrackLayer=()=>{var t;showTracks.value=[],(t=trackLineVectorSource.value)==null||t.clear()},playTrack=(t,e)=>{handlePlay(String(t),e)},resetTrackView=t=>{var i;const e=mapInstance$5.value.getView(),n=t?shipTrackLineFeatures.value.find(g=>g.getId()===t):shipTrackLineFeatures.value[0];if(!n)return;const r=(i=n==null?void 0:n.getGeometry())==null?void 0:i.getExtent();if(r!=null&&r.length)try{const g=buffer(r,Math.max(r[2]-r[0],r[3]-r[1])*.02);e.fit(g)}catch(g){console.log(g)}},_hoisted_1$8={key:0,class:"more-tool-panel"},_hoisted_2$4={class:"switch-buttons"},_hoisted_3$4={class:"tool-components"},_sfc_main$a=vue.defineComponent({__name:"toolPanel",props:{vehicleMode:{},viewMode:{},disableGreenDot:{type:Boolean},showTrackLayer:{type:Boolean},mapTileMode:{}},emits:["switchGreenDot","switchMapTile"],setup(t,{emit:e}){var oe,re;const n=vue.inject("mapInstance"),r=t,i=e,g=vue.ref(((re=(oe=n.value)==null?void 0:oe.getView())==null?void 0:re.getZoom())||mapZoom.default),y=vue.ref(!1),k=vue.ref(null),L=vue.ref(!0),$=()=>{r.disableGreenDot||g.value>=mapZoom.shipGreenDotMax||(L.value=!L.value,i("switchGreenDot",L.value))},V=()=>{i("switchMapTile",r.mapTileMode===BaseMapType.vector?BaseMapType.satellite:BaseMapType.vector)},z=()=>{var ie,ae;y.value?(ie=k.value)==null||ie.removeInteraction():(ae=k.value)==null||ae.addInteraction(),y.value=!y.value},j=()=>{var ie;(ie=k.value)==null||ie.removeInteraction(),y.value=!1};return vue.onMounted(()=>{vue.nextTick(()=>{var ie;(ie=n.value)==null||ie.on("moveend",()=>{var ue,de;const ae=(de=(ue=n.value)==null?void 0:ue.getView())==null?void 0:de.getZoom();ae&&(g.value=ae)})})}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:vue.normalizeClass(`tool-panel ${ie.viewMode}`)},[ie.viewMode==="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[vue.createElementVNode("div",_hoisted_2$4,[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[5]||(ae[5]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[6]||(ae[6]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[0]||(ae[0]=ue=>V())},ae[7]||(ae[7]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"图层",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="truck"?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[1]||(ae[1]=ue=>V())},ae[8]||(ae[8]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)):vue.createCommentVNode("",!0),ie.showTrackLayer?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[2]||(ae[2]=ue=>vue.unref(playTrack)(vue.unref(currentTrackId),1))},ae[9]||(ae[9]=[vue.createElementVNode("i",{class:"map-iconfont icon-play"},null,-1),vue.createElementVNode("div",{class:"button-text"},"播放轨迹",-1)])),vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[3]||(ae[3]=ue=>vue.unref(resetTrackView)())},ae[10]||(ae[10]=[vue.createElementVNode("i",{class:"map-iconfont icon-center"},null,-1),vue.createElementVNode("div",{class:"button-text"},"轨迹居中",-1)]))],64)):vue.createCommentVNode("",!0),vue.renderSlot(ie.$slots,"toolPanel",{},void 0,!0)])])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[11]||(ae[11]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[12]||(ae[12]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",{active:ie.mapTileMode===vue.unref(BaseMapType).satellite}]),onClick:V},ae[13]||(ae[13]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)],64))],2),vue.createElementVNode("div",_hoisted_3$4,[y.value?(vue.openBlock(),vue.createBlock(Measure,{key:0,ref_key:"measureRef",ref:k,visible:y.value,"onUpdate:visible":ae[4]||(ae[4]=ue=>y.value=ue),onClose:j,"view-mode":ie.viewMode},null,8,["visible","view-mode"])):vue.createCommentVNode("",!0)])],64))}}),ToolPanel=_export_sfc(_sfc_main$a,[["__scopeId","data-v-ef931f65"]]),UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),j,oe,re,ie,ae,ue;for(;;){re=Math.floor(z/3);const pe=Math.pow(10,re);if(j=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(j/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){j=ie,oe=ae,re=ue;break}else if(oe>=k)break;ie=j,ae=oe,ue=re,++z}const de=this.scaleBar_?this.createScaleBar(oe,j,V):j.toFixed(re<0?-re:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const _hoisted_1$7={id:"scale-line-container"},_sfc_main$9=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){const n=vue.inject("mapInstance");return e({setScaleLine:i=>{var k;const g=new ScaleLine$1({units:i||"metric"}),y=document.getElementById("scale-line-container");y&&(g.setTarget(y),(k=n.value)==null||k.addControl(g))}}),(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7))}}),ScaleLine=_export_sfc(_sfc_main$9,[["__scopeId","data-v-46a928b4"]]),_hoisted_1$6={class:"zoom"},_sfc_main$8=vue.defineComponent({__name:"zoomControl",props:{map:{type:Object}},setup(t){const e=vue.inject("mapInstance"),n=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g+1)},r=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g-1)};return(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",{onClick:n,class:"button big-button"},"+"),vue.createElementVNode("div",{onClick:r,class:"button small-button"},"-")]))}}),ZoomControl=_export_sfc(_sfc_main$8,[["__scopeId","data-v-602b1c0f"]]),_hoisted_1$5={class:"copyright"},_hoisted_2$3={class:"tdt-control-copyright tdt-control"},_hoisted_3$3=["src"],_sfc_main$7=vue.defineComponent({__name:"copyright",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[vue.createElementVNode("img",{src:vue.unref(CDN_URL)+"map/tdt-logo.png",width:"53px",height:"22px",class:"logo",alt:""},null,8,_hoisted_3$3),n[0]||(n[0]=vue.createElementVNode("div",{class:"copyright-text"},"GS(2024)0568号 - 甲测资字1100471",-1))]),n[1]||(n[1]=vue.createElementVNode("div",{id:"dataSource",class:"tdt-control data-source"},"数据来源:自然资源部 & NavInfo",-1))]))}}),Copyright=_export_sfc(_sfc_main$7,[["__scopeId","data-v-9c5c2f7b"]]),dotImage=new Image;dotImage.src=`${CDN_URL}/map/truck-dot.svg`,dotImage.crossOrigin="anonymous";const dotActiveImage=new Image;dotActiveImage.src=`${CDN_URL}/map/truck-dot-active.svg`,dotActiveImage.crossOrigin="anonymous";const cameraImage=new Image;cameraImage.src=`${CDN_URL}/map/map-camera.svg`,cameraImage.crossOrigin="anonymous";const loadImage=new Image;loadImage.src=`${CDN_URL}/map/map-load.svg`,loadImage.crossOrigin="anonymous";const setTruckStyle=(t,e,n,r)=>new Style({renderer:(i,g)=>{const y=g.context;y.save();let k=1;y.scale(k,k);let[L,$]=i;L=L/k-20,$=$/k;const V=L-70,z=$-68;let j=180;const oe=56,re="#FFFFFF";let ie=176;const ae=52;let ue="#164AFF",de="#FFFFFF";n===CAR_COLOR.YELLOW?(ie=176,ue="#FFC81E",de="rgba(0,0,0,0.88)"):n===CAR_COLOR.Y_GREEN&&(j=200,ie=196,ue="#8FED7C",de="rgba(0,0,0,0.88)"),r!=null&&r.length&&(j+=r.length*56),fillRectRadius(y,V,z,j,oe,re),fillRectRadius(y,V+2,z+2,ie,ae,ue),n===CAR_COLOR.Y_GREEN&&fillRectRadius(y,V+2,z+2,68,ae,"#FFC81E"),y.save(),y.restore(),y.fillStyle=de,y.font="bold 28px Arial",y.textAlign="left",y.textBaseline="middle";const pe=`${e.slice(0,2)+" · "+e.slice(2)}`;if(y.fillText(pe,V+12,z+32),y.save(),y.restore(),r!=null&&r.length){const he=y.measureText(pe).width+12;let _e=0;r.forEach(Ce=>{Ce===DEVICE_TYPE.CAMERA&&(y.drawImage(cameraImage,L-54+he+_e*56,$-64,50,50),++_e),Ce===DEVICE_TYPE.LOAD&&(y.drawImage(loadImage,L-54+he+_e*56,$-64,50,50),++_e)})}const le=dotImage;y.drawImage(le,L+j/2-90,$,50/k,50/k),y.restore()}}),mapInstance$4=vue.ref(),renderDashboardSetInstance=t=>mapInstance$4.value=t;vue.ref([]);let truckMarkerList=[],trucksVectorSource;const renderTrucksMarker=t=>{if(deleteAllTruckMarkers(),!!mapInstance$4.value)return t.forEach(e=>{const n=formatUtils.convertSixHundredThousandToLatLng(e.lon,e.lat),r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",e),r.setStyle(setTruckStyle(!1,e.vno,e==null?void 0:e.vclColor,e==null?void 0:e.icons)),truckMarkerList.push({name:e.vno,lonlat:n,feature:r})}),trucksVectorSource=new VectorSource({features:truckMarkerList.map(e=>e.feature)}),trucksLayer.value=new VectorLayer({source:trucksVectorSource}),mapInstance$4.value.addLayer(trucksLayer.value),trucksLayer.value},deleteAllTruckMarkers=()=>{truckMarkerList.forEach(t=>{t.feature&&(trucksVectorSource==null||trucksVectorSource.removeFeature(t.feature))}),truckMarkerList=[]},mapInstance$3=vue.ref(),renderCustomOverlaySetInstance=t=>mapInstance$3.value=t,drawCustomContent=(t,e,n,r="top-left",i=!1)=>{var V,z;if(!e||!mapInstance$3.value)return;document.querySelectorAll(".truck-custom-content").forEach(j=>j.parentNode.removeChild(j));const g=document.createElement("div");g.innerHTML=n;const y=new Overlay({element:g,position:e,positioning:r,stopEvent:i});if(i){let j=!1,oe=[0,0],re=[0,0];g.addEventListener("mousedown",function(ie){var ae;j=!0,ie.clientX,ie.clientY,oe=(ae=mapInstance$3.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-200,ie.clientY-200]),re=[ie.clientX-g.getBoundingClientRect().left+160,ie.clientY-g.getBoundingClientRect().top+84],ie.preventDefault()}),document.addEventListener("mousemove",function(ie){var ae;if(j){let ue=(ae=mapInstance$3.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-re[0],ie.clientY-re[1]]),de=ue[0]-oe[0],pe=ue[1]-oe[1];y.setPosition([oe[0]+de,oe[1]+pe])}}),document.addEventListener("mouseup",function(){j=!1})}(V=mapInstance$3.value)==null||V.addOverlay(y);const k=g.querySelector(".close-button");k&&k.addEventListener("click",()=>{var j,oe;(j=mapInstance$3.value)==null||j.removeOverlay(y),(oe=g.parentNode)==null||oe.removeChild(g)});let L=JSON.parse(JSON.stringify(e));const $=(z=mapInstance$3.value)==null?void 0:z.getCoordinateFromPixel(L);return y.setPosition($),y},mapInstance$2=vue.ref(),renderTruckSetInstance=t=>mapInstance$2.value=t,vehicle=vue.ref(null),focusShipData=vue.ref(),currentTruckOverlay=vue.ref(null),findTruck=async t=>{if(!mapInstance$2.value)return;focusShipData.value=t;const e=formatUtils.convertSixHundredThousandToLatLng(t.lon,t.lat),n=mapInstance$2.value.getPixelFromCoordinate(transform(e,projection.data,projection.mercator));currentTruckOverlay.value=drawTruckIcon(t.vno,n,t==null?void 0:t.drc);const r=mapInstance$2.value.getView(),i=new Point(e);r.setCenter(transform(i.getCoordinates(),projection.data,projection.mercator))},clearAllTruck=()=>{vehicle.value.clearAllShip()},drawTruckIcon=(t,e,n)=>{const r=`<div id="${t}" class="ol-custom-content truck-custom-content" style="width: 80px; height: 80px; transform: rotate(${n}deg);">
|
|
655
|
+
}`;const $=`u_texture${g}`;let V="1.";"fill-color"in t&&(V=e.getFillColorExpression()),e.setFillColorExpression(`${V} * sampleFillPattern(${$}, ${y}, ${L}, ${k}, pxOrigin, pxPos)`)}}function parseLiteralStyle(t,e){const n=newCompilationContext(),r={...newCompilationContext(),inFragmentShader:!0,variables:n.variables},i=new ShaderBuilder,g={};if("icon-src"in t?parseIconProperties(t,i,g,n,r):"shape-points"in t?parseShapeProperties(t,i,g,n,r):"circle-radius"in t&&parseCircleProperties(t,i,g,n,r),parseStrokeProperties(t,i,g,n,r),parseFillProperties(t,i,g,n,r),t.filter){const L=expressionToGlsl(r,t.filter,BooleanType);i.setFragmentDiscardExpression(`!${L}`)}for(const L in r.variables){const $=r.variables[L],V=uniformNameForVariable($.name);let z=getGlslTypeFromType($.type);$.type===ColorType&&(z="vec4"),i.addUniform(`${z} ${V}`),g[V]=()=>{const j=e[$.name];return typeof j=="number"?j:typeof j=="boolean"?j?1:0:$.type===ColorType?asArray(j||"#eee"):typeof j=="string"?getStringNumberEquivalent(j):j}}for(const L in r.properties){const $=r.properties[L];n.properties[L]||(n.properties[L]=$);let V=getGlslTypeFromType($.type),z=`a_prop_${$.name}`;$.type===ColorType&&(V="vec4",z=`unpackColor(${z})`,i.addVertexShaderFunction(UNPACK_COLOR_FN)),i.addVarying(`v_prop_${$.name}`,V,z)}for(const L in n.properties){const $=n.properties[L];i.addAttribute(`${getGlslTypeFromType($.type)} a_prop_${$.name}`)}for(const L in n.functions)i.addVertexShaderFunction(n.functions[L]);for(const L in r.functions)i.addFragmentShaderFunction(r.functions[L]);const y={};for(const L in n.properties){const $=n.properties[L],V=z=>{const j=z.get($.name);return $.type===ColorType?packColor([...asArray(j||"#eee")]):typeof j=="string"?getStringNumberEquivalent(j):typeof j=="boolean"?j?1:0:j};y[`prop_${$.name}`]={size:getGlslSizeFromType($.type),callback:V}}function k(L,$,V,z){const j=n[L],oe=r[L];if(!j&&!oe)return;const re=getGlslTypeFromType(V),ie=getGlslSizeFromType(V);i.addAttribute(`${re} a_${$}`),oe&&i.addVarying(`v_${$}`,re,`a_${$}`),y[$]={size:ie,callback:z}}return k("geometryType",GEOMETRY_TYPE_PROPERTY_NAME,StringType,L=>getStringNumberEquivalent(computeGeometryType(L.getGeometry()))),k("featureId",FEATURE_ID_PROPERTY_NAME,StringType|NumberType,L=>{const $=L.getId()??null;return typeof $=="string"?getStringNumberEquivalent($):$}),{builder:i,attributes:y,uniforms:g}}class WebGLPointsLayer extends Layer{constructor(e){const n=Object.assign({},e);super(n),this.styleVariables_=e.variables||{},this.parseResult_=parseLiteralStyle(e.style,this.styleVariables_),this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){const e=Object.keys(this.parseResult_.attributes).map(n=>({name:n,...this.parseResult_.attributes[n]}));return new WebGLPointsLayerRenderer(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:e})}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}}var CAR_COLOR=(t=>(t[t.BLUE=1]="BLUE",t[t.YELLOW=2]="YELLOW",t[t.Y_GREEN=3]="Y_GREEN",t))(CAR_COLOR||{}),DEVICE_TYPE=(t=>(t[t.HOST=1]="HOST",t[t.TALK=2]="TALK",t[t.STORAGE=3]="STORAGE",t[t.INTERNET=4]="INTERNET",t[t.CAMERA=5]="CAMERA",t[t.LOAD=6]="LOAD",t))(DEVICE_TYPE||{}),LENGTH_UNIT=(t=>(t[t.M=1]="M",t[t.KM=2]="KM",t[t.NM=3]="NM",t))(LENGTH_UNIT||{}),SWITCH_BTN=(t=>(t.Camera="camera",t.Mobile="mobile",t.WaterGauge="waterGauge",t))(SWITCH_BTN||{});class ShipMapData{constructor(e,n,r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae,ue,de,pe,le,he,_e,Ce){tr(this,"id");tr(this,"mmsi");tr(this,"fill");tr(this,"shipType");tr(this,"name");tr(this,"length");tr(this,"breadth");tr(this,"lon");tr(this,"lat");tr(this,"createdAt");tr(this,"speed");tr(this,"from");tr(this,"sailStatus");tr(this,"hdg");tr(this,"cog");tr(this,"posType");tr(this,"type");tr(this,"angle");tr(this,"leftIconColor");tr(this,"existDevice");tr(this,"existMobile");tr(this,"existWaterGauge");tr(this,"selected");this.id=e,this.mmsi=n,this.fill=r,this.shipType=i,this.name=g,this.length=y,this.breadth=k,this.lon=L,this.lat=$,this.createdAt=V,this.speed=z,this.from=j,this.sailStatus=oe,this.hdg=re,this.cog=ie,this.posType=ae,this.type=ue,this.angle=de,this.leftIconColor=pe,this.existDevice=le,this.existMobile=he,this.existWaterGauge=_e,this.selected=Ce}}const formatLength=function(t,e){const r=getLength(t);let i="";switch(e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i},convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},formatArea=(t,e)=>{const r=getArea(t);let i;switch(e){case LENGTH_UNIT.KM:r>1e4?i=Math.round(r/1e6*100)/100+" km<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break;case LENGTH_UNIT.NM:const g=Math.pow(1.852,2);r>1e4?i=Math.round(r/1e6/g*100)/100+" nm<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break}return i},convertShipMapData=t=>{const e=n=>new ShipMapData(n.id,n.id,n.fill||"#04C900","70",(n.cnname||n.enname||n.name)+`${n.existName?n.existName:""}`,n.len||n.length,n.wid||n.breadth,n.lon,n.lat,new Date().getTime(),n.spd,n.from,n.status,Number(n.hdg),n.cog,Number(n.postype),"other",n.cog,n.leftIconColor,n.existDevice,n.existMobile,n.existWaterGauge);return Array.isArray(t)?t.map(n=>e(n)):e(t)},formatUtils={formatLength,convertSixHundredThousandToLatLng,formatArea},_hoisted_1$9={key:0,class:"measure-panel"},_hoisted_2$5={class:"d-flex justify-content-between align-content-start w-100"},_hoisted_3$5={class:"measure-history-list"},_hoisted_4$2={class:"left-panel"},_hoisted_5$2={class:"text index"},_hoisted_6$2={class:"text"},_hoisted_7$2=["onClick"],_sfc_main$b=vue.defineComponent({__name:"measure",props:vue.mergeModels({viewMode:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:vue.mergeModels(["close"],["update:visible"]),setup(t,{expose:e,emit:n}){const r=vue.inject("mapInstance"),i=n,g=vue.useModel(t,"visible"),y=vue.ref("3"),k=vue.ref([]),L=vue.ref(!1),$=new VectorSource;let V,z,j,oe,re;const ie=new VectorLayer({source:$,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),ae=function(Oe){if(Oe.dragging)return;let Ve="点击选择起点";V&&(Ve="单击继续,双击结束"),z&&(z.innerHTML=Ve,j.setPosition(Oe.coordinate),z.classList.remove("hidden"))},ue=()=>{r.value&&(r.value.on("pointermove",ae),r.value.getViewport().addEventListener("mouseout",function(){var Oe;(Oe=z==null?void 0:z.classList)==null||Oe.add("hidden")}),L.value=!0)};let de;const pe=new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})});function le(){var Oe,Ve;if(r.value){if(k.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(qe=>{var Pt;(Pt=qe==null?void 0:qe.parentNode)==null||Pt.removeChild(qe)}),$.clear(),de){const qe=r.value.getInteractions().getArray().find(Pt=>Pt.ol_uid===de.ol_uid);qe&&((Oe=r.value)==null||Oe.removeInteraction(qe))}(Ve=r.value)==null||Ve.removeLayer(ie),z!=null&&z.parentNode&&z.parentNode.removeChild(z),oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe)}}function he(){var Ve,qe;le(),(Ve=r.value)==null||Ve.addLayer(ie),de=new Draw({source:$,type:"LineString",style:function(){return pe}}),(qe=r.value)==null||qe.addInteraction(de),Ce(),_e();let Oe;de.on("drawstart",function(Pt){var $e;V=Pt.feature;let Lt;Oe=($e=V.getGeometry())==null?void 0:$e.on("change",function(Fe){const ze=Fe.target;let Ue=formatUtils.formatLength(ze,Number(y.value));Lt=ze.getLastCoordinate(),oe&&Ue&&(oe.innerHTML=Ue),re.setPosition(Lt)})}),de.on("drawend",function(){oe&&(oe.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),oe!=null&&oe.innerHTML&&k.value.push(oe==null?void 0:oe.innerHTML),re.setOffset([0,-7]),V=null,oe=null,Ce(),Oe&&unByKey(Oe)})}function _e(){var Oe;z!=null&&z.parentNode&&z.parentNode.removeChild(z),z=document.createElement("div"),z.className="ol-tooltip hidden",j=new Overlay({element:z,offset:[15,0],positioning:"center-left"}),(Oe=r.value)==null||Oe.addOverlay(j)}function Ce(){var Oe;oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe),oe=document.createElement("div"),oe.className="ol-tooltip ol-tooltip-measure",re=new Overlay({element:oe,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(Oe=r.value)==null||Oe.addOverlay(re)}const xe=Oe=>{var Pt,Lt;k.value[Oe]&&k.value.splice(Oe,1);const Ve=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");Ve[Oe]&&((Lt=(Pt=Ve[Oe])==null?void 0:Pt.parentNode)==null||Lt.removeChild(Ve[Oe]));const qe=$.getFeatures();qe[Oe]&&$.removeFeature(qe[Oe])},Ie=()=>{i("close")};return vue.watch(()=>g,()=>{g&&!L.value&&(ue(),he())},{deep:!0,immediate:!0}),e({addInteraction:he,removeInteraction:le}),(Oe,Ve)=>g.value&&Oe.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",{class:"header"},[Ve[1]||(Ve[1]=vue.createElementVNode("div",{class:"title"},"测量",-1)),vue.createElementVNode("i",{onClick:Ie,class:"map-iconfont icon-close"})]),vue.createElementVNode("div",_hoisted_2$5,[Ve[2]||(Ve[2]=vue.createElementVNode("div",{class:"tips"},"在地图上点击多个点测量距离,距离单位",-1)),vue.createVNode(vue.unref(ElSelect),{class:"select-length-unit",modelValue:y.value,"onUpdate:modelValue":Ve[0]||(Ve[0]=qe=>y.value=qe)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{label:"m",value:"1"}),vue.createVNode(vue.unref(ElOption),{label:"km",value:"2"}),vue.createVNode(vue.unref(ElOption),{label:"nm",value:"3"})]),_:1},8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.value,(qe,Pt)=>(vue.openBlock(),vue.createElementBlock("div",{class:"measure-history-item",key:Pt},[vue.createElementVNode("div",_hoisted_4$2,[Ve[3]||(Ve[3]=vue.createElementVNode("i",{class:"map-iconfont icon-line"},null,-1)),vue.createElementVNode("span",_hoisted_5$2,"线段"+vue.toDisplayString(Pt+1),1),vue.createElementVNode("span",_hoisted_6$2,vue.toDisplayString(qe),1)]),vue.createElementVNode("div",{class:"delete-button",onClick:Lt=>xe(Pt)},Ve[4]||(Ve[4]=[vue.createElementVNode("i",{class:"map-iconfont icon-delete"},null,-1)]),8,_hoisted_7$2)]))),128))])])):vue.createCommentVNode("",!0)}}),Measure=_export_sfc(_sfc_main$b,[["__scopeId","data-v-d566fd81"]]),CDN_URL="https://static.zhihaoscm.cn/",tiandituKey="a6e8f78974f2581f2ca00485b40c948f",baseMap={tiandituTile:`https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituTileMark:`https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTile:`https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTileMark:`https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,greenTile:`${CDN_URL}/map/tile/{z}/{x}/{y}.png`},mapZoom={default:6,min:3,max:18,findShipMin:10,findShip:13,findTruck:14,shipGreenDotMax:11,truckDefault:14,truckStatistics:8,shipModelMin:13,shipModelMax:18},mapDefaultCenter=[114.84,30.52],projection={data:"EPSG:4326",mercator:"EPSG:3857"};vue.ref();const shipsLayer=vue.ref(),largeAmountShipsLayer=vue.ref(),selectShipsLayer=vue.ref(),allShips=vue.ref([]),selectSingleShipData=vue.ref();vue.ref();const trucksLayer=vue.ref(),shipTrackLineFeatures=vue.ref([]),trackLineVectorSource=vue.ref(),shipTrackVectorLayer=vue.ref();vue.ref(),vue.ref();const shipLabels=vue.ref([]),trackLabels=vue.ref([]),showTrackLayer=vue.ref(!1),allTracks=vue.ref([]),currentTrackId=vue.ref(""),showTrackAnimatMarker=vue.ref(!1),hiddenOrther=vue.ref(!1);function getIconFont(unicode=""){return unicode.indexOf("&")!==-1&&(unicode=unicode.replace("&","&")),unicode.indexOf("&")!==-1&&(unicode=unicode.replace("&","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const multiplyPixelRatio=t=>{const e=window.devicePixelRatio||1;return t.map(n=>n.map(r=>r*e))},adjustBounds=(t,e)=>e.length===2?[t[0]-e[0],t[1]-e[1],t[2]+e[0],t[3]+e[1]]:[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]],isOverlapping=(t,e)=>t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1],getIconStyle=t=>new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14}),zIndex:100}),getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if(z.type==="Feature"&&z.geometry!==null&&z.geometry.type==="Point")return z.geometry.coordinates;if(z.type==="Point")return z.coordinates}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,j,oe={}){if(oe.final)return function(_e,Ce){return(y(Ce,_e)+180)%360}(z,j);const re=g(z),ie=g(j),ae=i(re[0]),ue=i(ie[0]),de=i(re[1]),pe=i(ie[1]),le=Math.sin(ue-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(ue-ae);return r(Math.atan2(le,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,j={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},j,oe)}function $(z,j={},oe={}){const re={type:"Feature"};return oe.id!==void 0&&(re.id=oe.id),oe.bbox&&(re.bbox=oe.bbox),re.properties=j||{},re.geometry=z,re}const V=y(L(t),L(e),n);return V<0?360+V:V},labelAlpha=.8,labelFont="500 12px Arial",labelOutSize=2,labelHeight=10,fillRectRadius=(t,e,n,r,i,g,y=4)=>{t.beginPath(),t.moveTo(e+y,n),t.arcTo(e+r,n,e+r,n+y,y),t.arcTo(e+r,n+i,e+r-y,n+i,y),t.arcTo(e,n+i,e,n+i-y,y),t.arcTo(e,n,e+y,n,y),t.closePath(),t.fillStyle=g,t.fill()},getPixelFromCoordinate=t=>{if(!t||t.length===0)throw new Error("Points array is empty or invalid.");let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const[g,y]of t)g<e&&(e=g),y<n&&(n=y),g>r&&(r=g),y>i&&(i=y);return[e,n,r,i]},calculatePolygonCentroid=t=>{if(!Array.isArray(t)||t.length<3)throw new Error("A polygon must have at least 3 coordinates.");let e=0,n=0,r=0;const i=t.length;for(let k=0;k<i-1;k++){const[L,$]=t[k],[V,z]=t[k+1],j=L*z-V*$;r+=j,e+=(L+V)*j,n+=($+z)*j}if(r*=.5,r===0)throw new Error("多边形面积为零");const g=e/(6*r),y=n/(6*r);return[g,y]},rotateShapeModel=(t,e)=>{const[n,r]=calculatePolygonCentroid(t),i=e*Math.PI/180,g=Math.cos(i),y=Math.sin(i);return t.map(([k,L])=>{const $=k-n,V=L-r,z=$*g-V*y+n,j=$*y+V*g+r;return[z,j]})},getTopLeftPoint=t=>[t[0],t[3]],getBottomLeftPoint=t=>[t[2],t[3]],getBottomRightPoint=t=>[t[2],t[1]],getTopRighttPoint=t=>[t[0],t[1]];function calculateBounds(t,e,n,r,i){let g,y,k,L,$=t[0],V=t[1];switch(e){case 0:g=$+i,y=g+n,L=V-i,k=L-r;break;case 1:g=$+i,y=g+n,L=V+r/2,k=L-r;break;case 2:g=$+i,y=g+n,L=V+i+r,k=L-r;break;case 3:g=$-n/2,y=g+n,L=V+i+r,k=L-r;break;case 4:y=$,g=y-n,L=V+i+r,k=L-r;break;case 5:y=$-i,g=y-n,L=V+r/2,k=L-r;break;case 6:y=$,g=y-n,L=V-i,k=L-r;break;case 7:g=$-n/2,y=g+n,L=V-i,k=L-r}if(!(!g||!k||!y||!L))return[Math.min(g,y),Math.min(k,L),Math.max(g,y),Math.max(k,L)+1]}function calculateAnchorPoint(t,e,n=70,r=20,i=20){let g=[0,0];switch(e){case 0:g[0]=t[0]+i,g[1]=t[1]-i-r/2;break;case 1:g[0]=t[0]+i,g[1]=t[1];break;case 2:g[0]=t[0]+i,g[1]=t[1]+i+r/2;break;case 3:g[0]=t[0],g[1]=t[1]+i+r/4;break;case 4:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]+i+r/4;break;case 5:g[0]=t[0]-i,g[1]=t[1];break;case 6:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]-i-r/4;break;case 7:g[0]=t[0],g[1]=t[1]-i-r/4}return g}function drawLabelBody(t,e,n){if(!t)return;const{font:r,labelOutSize:i=2,labelHeight:g,center:y,text:k,leftIcon:L,shipColor:$,lineLength:V=20,selected:z}=n;t.save(),r&&(t.font=r);let j=t.measureText(k).width+2*i;(L||$)&&(j+=g+4*i),t.restore();let oe,re=20,ie=-1,ae=g+3*i;if(V)for(let ue=0;ue<8;ue++){oe=calculateBounds(y,ue,j,ae,V);let de=!1;for(let pe=0;pe<e.length;++pe){let le=e[pe].bounds,he=[le[0]-re,le[1]-re,le[2]+re,le[3]+re];if(oe&&isOverlapping(oe,he)){de=!0;break}}if(!de){ie=ue;break}}else ie=0,oe=calculateBounds(y,ie,j,ae,V);if(z&&ie===-1&&(ie=0),oe&&ie>-1){let ue=getBottomLeftPoint(oe),de=getTopRighttPoint(oe);return{center:y,x:calculateAnchorPoint(y,ie,j,ae,V),l:de,r:ue,bounds:oe,position:ie,name:k}}else return null}const drawText=(t,e)=>{if(!t)return;const{center:n,text:r,textColor:i,leftIcon:g,rightIcons:y,font:k}=e;t.save(),t.setTransform(1,0,0,1,0,0);let[L,$]=n;if(g){t.font="22px map-iconfont";let V=getIconFont(g.icon);t.fillStyle=g.color,t.fillText(V,L+labelOutSize-4,$+4),L+=22}if(y!=null&&y.length){t.font="12px map-iconfont",t.fillStyle="#3370ff";let V=t.measureText(r).width+6;y.forEach((z,j)=>{let oe=getIconFont(z),re=20*j;t.fillText(oe,L+V+re,$)})}t.font=k||labelFont,t.fillStyle=i,t.fillText(r,L,$),t.restore()},drawPolygon=(t,e)=>{let{points:n,strokeColor:r,fillColor:i,shouldClosePath:g,translation:y,rotation:k,rotationCenter:L,scale:$,globalAlpha:V}=e;if(V||(V=1),n&&t){t.save(),t.beginPath(),k&&k!==0&&L==null&&t.rotate(k),y&&t.translate(y[0],y[1]),k&&(L!=null&&L.length)&&t.rotate(k),$&&t.scale($,$),t.moveTo(n[0][0],n[0][1]);for(let z=1;z<n.length;z++)t.lineTo(n[z][0],n[z][1]);g&&t.closePath(),r&&(t.strokeStyle=r,t.stroke()),i&&g&&(V&&(t.globalAlpha=V),t.fillStyle=i,t.fill()),t.restore()}},drawLabel=(t,e,n)=>{const{center:r,text:i,color:g,textColor:y,bgColor:k,leftIcon:L,rightIcons:$,type:V}=e;if(r&&i){let z={font:labelFont,labelOutSize,labelHeight,center:r,text:i,leftIcon:L,selected:e.selected},j=drawLabelBody(t,n,z);if(j){const{x:oe,bounds:re,l:ie}=j;let ae=[getTopLeftPoint(re),getBottomLeftPoint(re),getBottomRightPoint(re),getTopRighttPoint(re)];n.find(_e=>_e.name===i)||n.push(j),drawPolygon(t,{points:[r,oe],strokeColor:g,fillColor:"#000",shouldClosePath:!0,translation:void 0,rotation:void 0,rotationCenter:void 0,scale:void 0,globalAlpha:labelAlpha}),$!=null&&$.length&&$.forEach(()=>{ae[1][0]+=20,ae[2][0]+=20}),drawPolygon(t,{points:ae,strokeColor:g,fillColor:k,shouldClosePath:!0});const[pe,le]=ie,he={center:[pe,le+labelOutSize+labelHeight+1],text:i,textColor:y,leftIcon:L,rightIcons:$};drawText(t,he)}}return null},PI=Math.PI,a=6378245,ee=.006693421622965943;function transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(e*PI)+40*Math.sin(e/3*PI))*2/3,n+=(160*Math.sin(e/12*PI)+320*Math.sin(e*PI/30))*2/3,n}function transformLng(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(t*PI)+40*Math.sin(t/3*PI))*2/3,n+=(150*Math.sin(t/12*PI)+300*Math.sin(t/30*PI))*2/3,n}function outOfChina(t,e){return!(t>73.66&&t<135.05&&e>3.86&&e<53.55)}function gcj02ToWgs84(t){const[e,n]=t.split(",").map(Number);if(outOfChina(e,n))return`${e.toFixed(6)}, ${n.toFixed(6)}`;{let r=transformLat(e-105,n-35),i=transformLng(e-105,n-35),g=n/180*PI,y=Math.sin(g);y=1-ee*y*y;let k=Math.sqrt(y);r=r*180/(a*(1-ee)/(y*k)*PI),i=i*180/(a/k*Math.cos(g)*PI);let L=n+r,$=e+i;return`${(e*2-$).toFixed(6)}, ${(n*2-L).toFixed(6)}`}}function calculateCirclePoints(t,e){const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}}const equatorialCircumference=2003750834e-2;function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function mercatorToLonLat(t,e="lonlat"){let n={lon:0,lat:0},r=t[0]/equatorialCircumference*180,i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]}function calculateBoundingBox(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;t.forEach(ie=>{const[ae,ue]=ie;e=Math.min(e,ue),n=Math.max(n,ue),r=Math.min(r,ae),i=Math.max(i,ae)});const g=i-r,y=n-e,k=Math.max(g,y),L=(r+i)/2,$=(e+n)/2,V=k/2,z=L-V,j=L+V,oe=$-V,re=$+V;return[j,oe,z,re]}const transformUtils={gcj02ToWgs84,calculateCirclePoints,lonLatToMercator,mercatorToLonLat,calculateBoundingBox};class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}const GeometryConstructor={Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon};function orientFlatCoordinates(t,e,n){return Array.isArray(e[0])?(linearRingssAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRingsArray(t,0,e,n)),t):(linearRingsAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRings(t,0,e,n)),t)}function createRenderFeature(t,e){var g;const n=t.geometry;if(!n)return[];if(Array.isArray(n))return n.map(y=>createRenderFeature({...t,geometry:y})).flat();const r=n.type==="MultiPolygon"?"Polygon":n.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const i=n.layout.length;return transformGeometryWithOptions(new RenderFeature(r,r==="Polygon"?orientFlatCoordinates(n.flatCoordinates,n.ends,i):n.flatCoordinates,(g=n.ends)==null?void 0:g.flat(),i,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function createGeometry(t,e){if(!t)return null;if(Array.isArray(t)){const r=t.map(i=>createGeometry(i,e));return new GeometryCollection(r)}const n=GeometryConstructor[t.type];return transformGeometryWithOptions(new n(t.flatCoordinates,t.layout,t.ends),!1,e)}class JSONFeature extends FeatureFormat{constructor(){super()}getType(){return"json"}readFeature(e,n){return this.readFeatureFromObject(getObject(e),this.getReadOptions(e,n))}readFeatures(e,n){return this.readFeaturesFromObject(getObject(e),this.getReadOptions(e,n))}readFeatureFromObject(e,n){return abstract()}readFeaturesFromObject(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromObject(getObject(e),this.getReadOptions(e,n))}readGeometryFromObject(e,n){return abstract()}readProjection(e){return this.readProjectionFromObject(getObject(e))}readProjectionFromObject(e){return abstract()}writeFeature(e,n){return JSON.stringify(this.writeFeatureObject(e,n))}writeFeatureObject(e,n){return abstract()}writeFeatures(e,n){return JSON.stringify(this.writeFeaturesObject(e,n))}writeFeaturesObject(e,n){return abstract()}writeGeometry(e,n){return JSON.stringify(this.writeGeometryObject(e,n))}writeGeometryObject(e,n){return abstract()}}function getObject(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class GeoJSON extends JSONFeature{constructor(e){e=e||{},super(),this.dataProjection=get$1(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=get$1(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,n){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const i=readGeometryInternal(r.geometry);if(this.featureClass===RenderFeature)return createRenderFeature({geometry:i,id:r.id,properties:r.properties},n);const g=new Feature;return this.geometryName_?g.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&g.setGeometryName(r.geometry_name),g.setGeometry(createGeometry(i,n)),"id"in r&&g.setId(r.id),r.properties&&g.setProperties(r.properties,!0),g}readFeaturesFromObject(e,n){const r=e;let i=null;if(r.type==="FeatureCollection"){const g=e;i=[];const y=g.features;for(let k=0,L=y.length;k<L;++k){const $=this.readFeatureFromObject(y[k],n);$&&i.push($)}}else i=[this.readFeatureFromObject(e,n)];return i.flat()}readGeometryFromObject(e,n){return readGeometry(e,n)}readProjectionFromObject(e){const n=e.crs;let r;if(n)if(n.type=="name")r=get$1(n.properties.name);else if(n.type==="EPSG")r=get$1("EPSG:"+n.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,n){n=this.adaptOptions(n);const r={type:"Feature",geometry:null,properties:null},i=e.getId();if(i!==void 0&&(r.id=i),!e.hasProperties())return r;const g=e.getProperties(),y=e.getGeometry();return y&&(r.geometry=writeGeometry(y,n),delete g[e.getGeometryName()]),isEmpty$1(g)||(r.properties=g),r}writeFeaturesObject(e,n){n=this.adaptOptions(n);const r=[];for(let i=0,g=e.length;i<g;++i)r.push(this.writeFeatureObject(e[i],n));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,n){return writeGeometry(e,this.adaptOptions(n))}}function readGeometryInternal(t,e){if(!t)return null;let n;switch(t.type){case"Point":{n=readPointGeometry(t);break}case"LineString":{n=readLineStringGeometry(t);break}case"Polygon":{n=readPolygonGeometry(t);break}case"MultiPoint":{n=readMultiPointGeometry(t);break}case"MultiLineString":{n=readMultiLineStringGeometry(t);break}case"MultiPolygon":{n=readMultiPolygonGeometry(t);break}case"GeometryCollection":{n=readGeometryCollectionGeometry(t);break}default:throw new Error("Unsupported GeoJSON type: "+t.type)}return n}function readGeometry(t,e){const n=readGeometryInternal(t);return createGeometry(n,e)}function readGeometryCollectionGeometry(t,e){return t.geometries.map(function(r){return readGeometryInternal(r)})}function readPointGeometry(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:getLayoutForStride(e.length)}}function readLineStringGeometry(t){var r;const e=t.coordinates,n=e.flat();return{type:"LineString",flatCoordinates:n,ends:[n.length],layout:getLayoutForStride(((r=e[0])==null?void 0:r.length)||2)}}function readMultiLineStringGeometry(t){var g,y;const e=t.coordinates,n=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length)||2,r=[],i=deflateCoordinatesArray(r,0,e,n);return{type:"MultiLineString",flatCoordinates:r,ends:i,layout:getLayoutForStride(n)}}function readMultiPointGeometry(t){var n;const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:getLayoutForStride(((n=e[0])==null?void 0:n.length)||2)}}function readMultiPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y[0].length)||2,i=deflateMultiCoordinatesArray(n,0,e,r);return{type:"MultiPolygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function readPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=(y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length,i=deflateCoordinatesArray(n,0,e,r);return{type:"Polygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function writeGeometry(t,e){t=transformGeometryWithOptions(t,!0,e);const n=t.getType();let r;switch(n){case"Point":{r=writePointGeometry(t);break}case"LineString":{r=writeLineStringGeometry(t);break}case"Polygon":{r=writePolygonGeometry(t,e);break}case"MultiPoint":{r=writeMultiPointGeometry(t);break}case"MultiLineString":{r=writeMultiLineStringGeometry(t);break}case"MultiPolygon":{r=writeMultiPolygonGeometry(t,e);break}case"GeometryCollection":{r=writeGeometryCollectionGeometry(t,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+n)}return r}function writeGeometryCollectionGeometry(t,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(r){return writeGeometry(r,e)})}}function writeLineStringGeometry(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}function writeMultiLineStringGeometry(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}function writeMultiPointGeometry(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}function writeMultiPolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}function writePointGeometry(t,e){return{type:"Point",coordinates:t.getCoordinates()}}function writePolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}const mapInstance$8=vue.ref(),renderTrackStyleSetInstance=t=>mapInstance$8.value=t,stopIcon="",stopColor="#E31818",slowIcon="",slowColor="#1890FF",dropletsIcon="",trackList$1=vue.ref([]),renderTrackLine=(t,e,n)=>{var g,y,k;const r=t[e];if(!r)return;allTracks.value[e]=r,trackList$1.value=[],trackList$1.value=r.map((L,$)=>(L.center=[L.lon,L.lat],L.centerPoint=transformUtils.lonLatToMercator(L.center),L.id=e,L.index=$,L.time=hooks(L.createdAt).format("YYYY-MM-DD HH:mm:ss"),L));let i=trackList$1.value.map(L=>L.centerPoint);if(i.length>=2){let L=new LineString(i);const $=new Feature({geometry:L});$.setStyle(new Style({stroke:new Stroke({color:n,width:2})})),$.setId(e),$.set("type","line"),(y=(g=shipTrackVectorLayer.value)==null?void 0:g.getSource())==null||y.clear(),shipTrackLineFeatures.value=[];const V=shipTrackLineFeatures.value.findIndex(z=>z.getId()===e);V>=0?shipTrackLineFeatures.value[V]=$:shipTrackLineFeatures.value.push($),createAnimatedIconFeature(n,i),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value=new VectorLayer({source:trackLineVectorSource.value}),renderPoint(n),(k=mapInstance$8.value)==null||k.addLayer(shipTrackVectorLayer.value)}},handlePlay=(t,e)=>{const n=allTracks.value[t];playAnimation(n.map(r=>[r.lon,r.lat]),e)},removeShipTrackLineFeatureByIndex=t=>{t>=0&&t<shipTrackLineFeatures.value.length&&(shipTrackLineFeatures.value.splice(t,1),allTracks.value.splice(t,1)),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value&&shipTrackVectorLayer.value.setSource(trackLineVectorSource.value)},createAnimatedIconFeature=(t,e)=>{const n=new Feature({geometry:new Point(fromLonLat([e[0][0],e[0][1]]))}),r=new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont(""),fill:new Fill({color:t})})});return n.setStyle(r),n},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont(""),fill:new Fill({color:"#ff0000"}),rotation:0})});let polyline,linePath,startMarker,position,geoMarker,vectorLayer;const trackAnimating=vue.ref(!1);let distance=0,lastTime=Date.now(),moveFeatureHandler=null;const moveFeature=(t,e)=>{var z;const n=Number(50*e),r=t.frameState.time,i=r-lastTime;if(distance=(distance+n*i/1e6)%2,lastTime=r,distance>=1){stopAnimation();return}const g=linePath.getCoordinateAt(distance>1?2-distance:distance),y=linePath.getCoordinateAt(distance>1?distance-.01:distance),k=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),$=getRotation(transformUtils.mercatorToLonLat(y,"array"),transformUtils.mercatorToLonLat(k,"array"))*Math.PI/180;geoMarkerStyle.getText().setRotation($),position.setCoordinates(g);const V=getVectorContext(t);V.context_.save(),V.setStyle(geoMarkerStyle),V.drawGeometry(position),V.context_.restore(),(z=mapInstance$8.value)==null||z.render()},startAnimation=()=>{trackAnimating.value=!0,showTrackAnimatMarker.value=!0,lastTime=Date.now(),distance=0,position=startMarker.getGeometry().clone(),vectorLayer.on("postrender",moveFeatureHandler),geoMarker.setGeometry(null)},stopAnimation=()=>{var t;trackAnimating.value&&(trackAnimating.value=!1,geoMarker.setGeometry(null),vectorLayer.un("postrender",moveFeatureHandler),(t=mapInstance$8.value)==null||t.removeLayer(vectorLayer),vectorLayer=null,geoMarker=null)},playAnimation=(t,e)=>{var n;trackAnimating.value&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())}),position=startMarker.getGeometry().clone(),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position}),vectorLayer=new VectorLayer({source:new VectorSource({features:[geoMarker]})}),(n=mapInstance$8.value)==null||n.addLayer(vectorLayer),moveFeatureHandler=r=>moveFeature(r,e),startAnimation()},renderPoint=t=>{if(!mapInstance$8.value)return;let e=trackList$1.value||[];if(!(e&&e.length>1))return[];let n={16:24,17:15,default:4},r=[],i=e.length;for(let k=0;k<i;k++){e[k].index=k;let L=mapInstance$8.value.getPixelFromCoordinate(e[k].centerPoint);if(L){let $=L.concat(L);$=adjustBounds($,[20,20]);let V=mapInstance$8.value.getView().getZoom();if(!V)return;if(V>15){let j=n[V]||n.default;$=adjustBounds($,[j,j])}let z=!0;if(e[k].state!=="0"){for(let j=0;j<r.length;j++)if(isOverlapping($,r[j].bounds)){z=!1;break}}z&&(e[k].bounds=$,r.push(e[k]))}}const g=getIconStyle(stopIcon),y=getIconStyle(slowIcon);r.forEach((k,L)=>{var z,j;let $=new Feature({geometry:new Point(k.centerPoint)});$.set("type","track_point"),$.set("data",k),$.setStyle(new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})),trackLineVectorSource.value.addFeature($);const V=new Feature({geometry:new Point(fromLonLat(k.center))});if(V.set("type","track_label"),V.set("track_label_index",L),V.setStyle(setTrackLabelStyle(k,t)),trackLineVectorSource.value.addFeature(V),typeof k=="object"&&k.hasOwnProperty("state")){let oe=new Feature({geometry:new Point(k.centerPoint)});oe.set("type","track_icon");let re=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(dropletsIcon),offsetY:-10}),zIndex:99}),ie=[];k.state==="0"?((z=re.getText())==null||z.setFill(new Fill({color:stopColor})),ie.push(g)):((j=re.getText())==null||j.setFill(new Fill({color:slowColor})),ie.push(y)),ie.push(re),oe.setStyle(ie),trackLineVectorSource.value.addFeature(oe)}}),renderArrow(r,t),renderIconPoint()},renderArrow=(t,e)=>{const n=t.length;n||(t.push(trackList$1.value[0]),t.push(trackList$1.value[trackList$1.value.length-1]));for(let r=0;r<n-1;r++){let i,g=t[r],y=(t[r+1].index+g.index)/2;if(y%2===0)i=trackList$1.value[y].centerPoint;else{let k=trackList$1.value[Math.floor(y)],L=trackList$1.value[Math.ceil(y)];if(k&&L){let[$,V]=k.centerPoint,[z,j]=L.centerPoint;i=[($+z)/2,(V+j)/2]}}if(i){let k=new Feature({geometry:new Point(i)});k.set("type","track_arrow"),k.setStyle(new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont(""),fill:new Fill({color:e}),rotation:getRotation(t[r].center,t[r+1].center)*(Math.PI/180)})})),trackLineVectorSource.value.addFeature(k)}}},renderIconPoint=()=>{const t="",e="#fcdc3f",n="#ff0000";(trackList$1.value.length<2?[trackList$1.value[0]]:[trackList$1.value[0],trackList$1.value[trackList$1.value.length-1]]).forEach(i=>{let g=new Feature({geometry:new Point(i.centerPoint)});g.set("type","track_begin"),g.set("data",i);const y=i.index===0&&trackList$1.value.length>=2?e:n;g.setStyle(new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:y})}),zIndex:101})),trackLineVectorSource.value.addFeature(g)})},setTrackLabelStyle=(t,e)=>new Style({renderer:(n,r)=>{const i=r.context,k={center:n,text:t.time,color:e,textColor:"#000",bgColor:"rgba(255,255,255,.8)",selected:!0,type:"TrackTime"};drawLabel(i,k,trackLabels.value)}}),triangleModel=multiplyPixelRatio([[0,-8],[5,8],[-5,8]]),shipShapeModel=multiplyPixelRatio([[0,-4.545],[-.56,-3.909],[-1,-2.727],[-1,3.636],[-.8,4.545],[.8,4.545],[1,3.636],[1,-2.727],[.56,-3.909],[0,-4.545]]),shipDirectPath={left:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},right:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},front:{0:[[0,0],[0,-8]],1:[[0,0],[0,-16]],2:[[0,0],[0,-24]]}},setBlankStyle=()=>new Style({image:new CircleStyle({radius:0})}),mapInstance$7=vue.ref(),renderShipStyleSetInstance=t=>mapInstance$7.value=t,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=t=>new Style({renderer:(e,n)=>{const r=n.context,i=n.feature.get("data");n.feature.get("index")===0&&(shipLabels.value=[]);try{const y=drawShipBody(r,i,e);y&&(drawHeading(r,i,y),t&&(drawSelectBounds(r,y),i.selected=!0)),drawShipLabel(r,i,e)}catch{return!1}}}),drawShipBody=(t,e,n)=>{if(!mapInstance$7.value)return;const r=Math.round(Number(mapInstance$7.value.getView().getZoom()));if(!r)return;let i=[];const[g,y]=drawShipModelByZoom[r]||[0,0],[k,L]=n;if(r<=mapZoom.shipModelMax&&r>mapZoom.shipModelMin&&e.length>=g&&e.breadth>=y)i=rotateShapeModel(drawCurrentShipShapeModel(e,r),e.angle).map(V=>{const[z,j]=V;return[k+z,L+j]});else{const $=rotateShapeModel(triangleModel,e.angle);n.length===2&&(i=$.map(V=>{const[z,j]=V;return[k+z,L+j]}))}if(!(i.length>2))return!1;t.save(),t.beginPath(),t.moveTo(i[0][0],i[0][1]);for(let $=1;$<i.length;$++)t.lineTo(i[$][0],i[$][1]);return t.closePath(),t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.fillStyle=e.fill,t.fill(),t.restore(),i},drawHeading=(t,e,n)=>{const[r,i]=n[0],g=getShipDirectPath(e);if(g){let y=g.map(function(k){let[L,$]=k;return[L+r,$+i]});if(t.save(),t.beginPath(),e.angle>0){t.translate(r,i);const k=e.angle*Math.PI/180;t.rotate(k),t.translate(-r,-i)}t.moveTo(r,i);for(let k=1;k<y.length;k++){let[L,$]=y[k];t.lineTo(L,$)}t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.restore()}},drawSelectBounds=(t,e)=>{let[n,r,i,g]=getPixelFromCoordinate(e);const y=4;n-=y,r-=y,i+=y,g+=y,t.save(),t.strokeStyle="#ff0000",t.lineWidth=4;const k=8;t.beginPath(),t.moveTo(n+k,g),t.lineTo(n,g),t.lineTo(n,g-k),t.moveTo(n,r+k),t.lineTo(n,r),t.lineTo(n+k,r),t.moveTo(i-k,r),t.lineTo(i,r),t.lineTo(i,r+k),t.moveTo(i,g-k),t.lineTo(i,g),t.lineTo(i-k,g),t.stroke(),t.restore()},drawShipLabel=(t,e,n)=>{const[r,i]=n,g=r-0,y=i-0,k=e.name;let L;e.leftIconColor&&(L={color:e.leftIconColor,icon:""});let $=getShipCustomIcon(e);const V={center:[g,y],text:k,color:"#fff",textColor:"#000",bgColor:"#fff",leftIcon:L,rightIcons:$,selected:e.selected,type:"ShipName"};drawLabel(t,V,shipLabels.value)},drawCurrentShipShapeModel=(t,e)=>{let n=0;e<=14?n=.058:e===15?n=.12:e===16?n=.22:e===17?n=.435:e===18&&(n=.857);const r=t.length/4*n,i=t.breadth*n;let g=cloneDeep(shipShapeModel);return g=g.map(([y,k])=>[y*i,k*r]),g},getShipDirectPath=t=>{let{speed:e,hdg:n,cog:r}=t,i="",g=null;if(e&&e>1&&(n!==null&&n!=511&&r!==null?r-n>=3?i="left":r-n<=-3?i="right":i="front":i="front",i&&e))for(let y in speedCondition){let k=speedCondition[y];if(e>=k[0]&&e<k[1]){g=shipDirectPath[i][y];break}}return g},getShipCustomIcon=t=>{let e=[];return t.existDevice&&e.push(""),t.existMobile&&e.push(""),t.existWaterGauge&&e.push(""),e||[]},TileEventType={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},tmpTileCoord=[0,0,0],DECIMALS=5;class TileGrid{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,assert(isSorted(this.resolutions_,(i,g)=>g-i),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let i=0,g=this.resolutions_.length-1;i<g;++i)if(!n)n=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,assert(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=getTopLeft(r)),assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,assert(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:DEFAULT_TILE_SIZE,assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,g)=>{const y=new TileRange(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const k=this.getTileRangeForExtentAndZ(r,g);y.minX=Math.max(k.minX,y.minX),y.maxX=Math.min(k.maxX,y.maxX),y.minY=Math.max(k.minY,y.minY),y.maxY=Math.min(k.maxY,y.maxY)}return y}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,n,r){const i=this.getTileRangeForExtentAndZ(e,n);for(let g=i.minX,y=i.maxX;g<=y;++g)for(let k=i.minY,L=i.maxY;k<=L;++k)r([n,g,k])}forEachTileCoordParentTileRange(e,n,r,i){let g,y,k,L=null,$=e[0]-1;for(this.zoomFactor_===2?(y=e[1],k=e[2]):L=this.getTileCoordExtent(e,i);$>=this.minZoom;){if(y!==void 0&&k!==void 0?(y=Math.floor(y/2),k=Math.floor(k/2),g=createOrUpdate(y,y,k,k,r)):g=this.getTileRangeForExtentAndZ(L,$,r),n($,g))return!0;--$}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const g=e[1]*2,y=e[2]*2;return createOrUpdate(g,g+1,y,y+1,n)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;const i=e[0],g=e[1],y=e[2];if(n===i)return createOrUpdate(g,y,g,y,r);if(this.zoomFactor_){const L=Math.pow(this.zoomFactor_,n-i),$=Math.floor(g*L),V=Math.floor(y*L);if(n<i)return createOrUpdate($,$,V,V,r);const z=Math.floor(L*(g+1))-1,j=Math.floor(L*(y+1))-1;return createOrUpdate($,z,V,j,r)}const k=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(k,n,r)}getTileRangeForExtentAndZ(e,n,r){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,tmpTileCoord);const i=tmpTileCoord[1],g=tmpTileCoord[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,tmpTileCoord);const y=tmpTileCoord[1],k=tmpTileCoord[2];return createOrUpdate(i,y,g,k,r)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=toSize(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,n){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),g=toSize(this.getTileSize(e[0]),this.tmpSize_),y=r[0]+e[1]*g[0]*i,k=r[1]-(e[2]+1)*g[1]*i,L=y+g[0]*i,$=k+g[1]*i;return createOrUpdate$2(y,k,L,$,n)}getTileCoordForCoordAndResolution(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)}getTileCoordForXYAndResolution_(e,n,r,i,g){const y=this.getZForResolution(r),k=r/this.getResolution(y),L=this.getOrigin(y),$=toSize(this.getTileSize(y),this.tmpSize_);let V=k*(e-L[0])/r/$[0],z=k*(L[1]-n)/r/$[1];return i?(V=ceil(V,DECIMALS)-1,z=ceil(z,DECIMALS)-1):(V=floor(V,DECIMALS),z=floor(z,DECIMALS)),createOrUpdate$1(y,V,z,g)}getTileCoordForXYAndZ_(e,n,r,i,g){const y=this.getOrigin(r),k=this.getResolution(r),L=toSize(this.getTileSize(r),this.tmpSize_);let $=(e-y[0])/k/L[0],V=(y[1]-n)/k/L[1];return i?($=ceil($,DECIMALS)-1,V=ceil(V,DECIMALS)-1):($=floor($,DECIMALS),V=floor(V,DECIMALS)),createOrUpdate$1(r,$,V,g)}getTileCoordForCoordAndZ(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const r=linearFindNearest(this.resolutions_,e,n||0);return clamp(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return intersectsLinearRing(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,r=new Array(n);for(let i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}function getForProjection(t){let e=t.getDefaultTileGrid();return e||(e=createForProjection(t),t.setDefaultTileGrid(e)),e}function wrapX(t,e,n){const r=e[0],i=t.getTileCoordCenter(e),g=extentFromProjection(n);if(!containsCoordinate(g,i)){const y=getWidth(g),k=Math.ceil((g[0]-i[0])/y);return i[0]+=y*k,t.getTileCoordForCoordAndZ(i,r)}return e}function createForExtent(t,e,n,r){r=r!==void 0?r:"top-left";const i=resolutionsFromExtent(t,e,n);return new TileGrid({extent:t,origin:getCorner(t,r),resolutions:i,tileSize:n})}function createXYZ(t){const e=t||{},n=e.extent||get$1("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:resolutionsFromExtent(n,e.maxZoom,e.tileSize,e.maxResolution)};return new TileGrid(r)}function resolutionsFromExtent(t,e,n,r){e=e!==void 0?e:DEFAULT_MAX_ZOOM,n=toSize(n!==void 0?n:DEFAULT_TILE_SIZE);const i=getHeight(t),g=getWidth(t);r=r>0?r:Math.max(g/n[0],i/n[1]);const y=e+1,k=new Array(y);for(let L=0;L<y;++L)k[L]=r/Math.pow(2,L);return k}function createForProjection(t,e,n,r){const i=extentFromProjection(t);return createForExtent(i,e,n,r)}function extentFromProjection(t){t=get$1(t);let e=t.getExtent();if(!e){const n=180*METERS_PER_UNIT$1.degrees/t.getMetersPerUnit();e=createOrUpdate$2(-n,-n,n,n)}return e}class TileSource extends Source{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&toSize(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||getUid(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,r,i,g){return abstract()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:getForProjection(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,r){const i=this.getTileGridForProjection(r),g=this.getTilePixelRatio(n),y=toSize(i.getTileSize(e),this.tmpSize);return g==1?y:scale$1(y,g,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const r=n!==void 0?n:this.getProjection(),i=n!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=wrapX(i,e,r)),withinExtentAndZ(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class TileSourceEvent extends BaseEvent{constructor(e,n){super(e),this.tile=n}}const zRegEx=/\{z\}/g,xRegEx=/\{x\}/g,yRegEx=/\{y\}/g,dashYRegEx=/\{-y\}/g;function renderXYZTemplate(t,e,n,r,i){return t.replace(zRegEx,e.toString()).replace(xRegEx,n.toString()).replace(yRegEx,r.toString()).replace(dashYRegEx,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function expandUrl(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let g;for(g=r;g<=i;++g)e.push(t.replace(n[0],String.fromCharCode(g)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)e.push(t.replace(n[0],i.toString()));return e}return e.push(t),e}function createFromTemplate(t,e){return function(n,r,i){if(!n)return;let g;const y=n[0];if(e){const k=e.getFullTileRange(y);k&&(g=k.getHeight()-1)}return renderXYZTemplate(t,y,n[1],n[2],g)}}function createFromTemplates(t,e){const n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=createFromTemplate(t[i],e);return createFromTileUrlFunctions(r)}function createFromTileUrlFunctions(t){return t.length===1?t[0]:function(e,n,r){if(!e)return;const i=hash(e),g=modulo(i,t.length);return t[g](e,n,r)}}class UrlTile extends TileSource{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===UrlTile.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,r=getUid(n),i=n.getState();let g;i==TileState.LOADING?(this.tileLoadingKeys_[r]=!0,g=TileEventType.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],g=i==TileState.ERROR?TileEventType.TILELOADERROR:i==TileState.LOADED?TileEventType.TILELOADEND:void 0),g!=null&&this.dispatchEvent(new TileSourceEvent(g,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=expandUrl(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
|
|
656
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(createFromTemplates(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,r){}}class TileImage extends UrlTile{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:defaultTileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ImageTile,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!equivalent(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||equivalent(n,e)))return this.tileGrid;const r=getUid(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=getForProjection(e)),this.tileGridForProjection[r]}createTile_(e,n,r,i,g,y){const k=[e,n,r],L=this.getTileCoordForTileUrlFunction(k,g),$=L?this.tileUrlFunction(L,i,g):void 0,V=new this.tileClass(k,$!==void 0?TileState.IDLE:TileState.EMPTY,$!==void 0?$:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return V.key=y,V.addEventListener(EventType.CHANGE,this.handleTileChange.bind(this)),V}getTile(e,n,r,i,g){const y=this.getProjection();if(!y||!g||equivalent(y,g))return this.getTileInternal(e,n,r,i,y||g);const k=[e,n,r],L=this.getKey(),$=this.getTileGridForProjection(y),V=this.getTileGridForProjection(g),z=this.getTileCoordForTileUrlFunction(k,g),j=new ReprojTile(y,$,g,V,k,z,this.getTilePixelRatio(i),this.getGutter(),(oe,re,ie,ae)=>this.getTileInternal(oe,re,ie,ae,y),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return j.key=L,j}getTileInternal(e,n,r,i,g){const y=this.getKey();return this.createTile_(e,n,r,i,g,y)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const r=get$1(e);if(r){const i=getUid(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=n)}}}function defaultTileLoadFunction(t,e){t.getImage().src=e}class XYZ extends TileImage{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:createXYZ({extent:extentFromProjection(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const mapInstance$6=vue.ref(),renderShipSetInstance=t=>mapInstance$6.value=t;let shipsMarkerList=[],shipsVectorSource,largeAmountShipsSource;const selectedShipData=vue.ref(null);let selectShipsVectorSource;const renderShips=t=>{var n,r,i,g;if(!mapInstance$6.value||showTrackLayer.value)return;const e=Math.round(Number(mapInstance$6.value.getView().getZoom()));if(selectedShipData.value&&vue.nextTick(()=>{selectSingleShipMarker(selectedShipData.value)}).then(y=>{}),!(!e||e<mapZoom.shipGreenDotMax)&&(allShips.value=t,!hiddenOrther.value))return e>=mapZoom.shipGreenDotMax&&e<mapZoom.shipModelMin?((n=shipsLayer.value)==null||n.setVisible(!1),(r=largeAmountShipsLayer.value)==null||r.setVisible(!0),renderLargeAmountShips(t)):((i=largeAmountShipsLayer.value)==null||i.setVisible(!1),(g=shipsLayer.value)==null||g.setVisible(!0),renderShipsMarker(t))},renderLargeAmountShips=t=>{if(!mapInstance$6.value)return;const e=t.map(n=>({type:"Feature",geometry:{type:"Point",coordinates:[n.lon,n.lat]},properties:n}));return largeAmountShipsSource==null||largeAmountShipsSource.clear(),largeAmountShipsSource=new VectorSource({features:new GeoJSON().readFeatures({type:"FeatureCollection",features:e},{featureProjection:projection.mercator})}),largeAmountShipsLayer.value=new WebGLPointsLayer({source:largeAmountShipsSource,style:{"shape-points":3,"shape-radius":9,"shape-fill-color":["case",["==",["get","fill"],"#D9001C"],"#D9001C",["==",["get","fill"],"#04C900"],"#04C900","#04C900"],"shape-rotate-with-view":!1,"shape-rotation":["+",["get","cog"],180],"shape-scale":[.8,1.2],"shape-stroke-color":"#000000","shape-stroke-width":.5}}),mapInstance$6.value.addLayer(largeAmountShipsLayer.value),largeAmountShipsLayer.value},renderShipsMarker=t=>{var n;if(!mapInstance$6.value)return;deleteAllShipMarkers();let e=convertShipMapData(t);if(e=customFilterShips(e),!!(e!=null&&e.length))return e.forEach((r,i)=>{const g=[r.lon,r.lat],y=new Feature({geometry:new Point(fromLonLat(g))}),k=1;y.set("clickGeometry",new Circle(fromLonLat(g),k)),y.set("data",r),y.set("index",i),y.setStyle(setShipStyle(!1)),shipsMarkerList.push({ship:r,lonlat:g,feature:y})}),shipsVectorSource=new VectorSource({features:shipsMarkerList.map(r=>r.feature)}),shipsLayer.value=new VectorLayer({source:shipsVectorSource}),(n=mapInstance$6.value)==null||n.addLayer(shipsLayer.value),shipsLayer.value},customFilterShips=t=>{let e=cloneDeep(t);return e=e.filter(n=>{var i;let r=getFilterItem(n).every(({btnShow:g,value:y})=>g?!!y:!0);return(switchBtnShow.value.camera||switchBtnShow.value.mobile||switchBtnShow.value.waterGauge)&&((i=selectedShipData.value)==null?void 0:i.id)===n.id&&clearSelectFeature(),r}),e},getFilterItem=t=>[{btnShow:switchBtnShow.value.camera,value:t==null?void 0:t.existDevice},{btnShow:switchBtnShow.value.mobile,value:t==null?void 0:t.existMobile},{btnShow:switchBtnShow.value.waterGauge,value:t==null?void 0:t.existWaterGauge}],deleteAllShipMarkers=()=>{shipsMarkerList.forEach(t=>{t.feature&&(shipsVectorSource==null||shipsVectorSource.removeFeature(t.feature))}),shipsMarkerList=[]},selectSingleShipMarker=t=>{var g;if(!mapInstance$6.value)return;const e=cloneDeep(selectSingleShipData.value);selectSingleShipData.value=convertShipMapData(t);const n=[selectSingleShipData.value.lon,selectSingleShipData.value.lat],r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",selectSingleShipData.value),r.setStyle(setShipStyle(!0)),shipsMarkerList.push({ship:selectSingleShipData.value,lonlat:n,feature:r}),selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsVectorSource=new VectorSource({features:[r]}),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!0);const i=(g=shipsLayer.value)==null?void 0:g.getSource();return i&&(e&&setVisibleFeatureById(i,e.id,!0),setVisibleFeatureById(i,selectSingleShipData.value.id,!1)),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!0),selectShipsLayer.value},setVisibleFeatureById=(t,e,n)=>{t&&t.forEachFeature(r=>{const i=r.get("data");i&&i.id===e&&r.setStyle(n?setShipStyle(!1,i.id):setBlankStyle())})},findShip=(t,e,n=!0)=>{var i,g,y,k,L;if(console.log(mapInstance$6.value.ol_uid),!t||!mapInstance$6.value)return;const r=(y=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures())==null?void 0:y.find($=>{var V;return((V=$.get("data"))==null?void 0:V.id)===t});if(r?selectedShipData.value=r.get("data"):e&&(selectedShipData.value=e),!e){console.error("找不到船舶");return}if(n&&((k=selectedShipData.value)!=null&&k.lon)&&((L=selectedShipData.value)!=null&&L.lat)){const $=mapInstance$6.value.getView(),V=new Point([selectedShipData.value.lon,selectedShipData.value.lat]);$.setCenter(transform(V.getCoordinates(),projection.data,projection.mercator));const z=$.getZoom(),j=z<mapZoom.findShipMin?mapZoom.findShip:z;$.setZoom(j)}return selectSingleShipMarker(e),r},clearSelectFeature=()=>{var t;if(selectedShipData.value){setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!1);const e=(t=shipsLayer.value)==null?void 0:t.getSource();e&&setVisibleFeatureById(e,selectSingleShipData.value.id,!0)}selectedShipData.value=null,mapInstance$6.value&&(selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!1))},hiddenAllShips=()=>{var t,e;(t=shipsLayer.value)==null||t.setVisible(!1),(e=largeAmountShipsLayer.value)==null||e.setVisible(!1)},switchBtnShow=vue.ref({[SWITCH_BTN.Camera]:!1,[SWITCH_BTN.Mobile]:!1,[SWITCH_BTN.WaterGauge]:!1}),switchFilterItem=(t,e)=>{switchBtnShow.value[t]=e,renderShips(allShips.value)},rerenderShip=()=>{renderShips(allShips.value)},mapInstance$5=vue.ref(),renderTrackSetInstance=t=>mapInstance$5.value=t,showTracks=vue.ref([]),trackList=vue.ref([]);vue.ref(null);const trackId=vue.ref(""),cursor=vue.ref(0),renderTrack=(t,e,n,r,i="ship")=>{var V;if(vue.nextTick(()=>{hiddenAllShips()}).then(z=>{}),(e==null?void 0:e.length)<2){((V=showTracks.value)==null?void 0:V.findIndex(z=>z.id===t))<0&&showTracks.value.push({id:t,length:""});return}let g={};e.forEach(z=>{z.state?z.state=Number(z.state):delete z.state}),trackId.value=t,g[t]=e,trackList.value=e;const y=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],k=g[t].map(z=>transform([z.lon,z.lat],projection.data,projection.mercator)),L=new LineString(k),$=formatUtils.formatLength(L,r)||"--";vue.nextTick(()=>{var j,oe;const z=(j=showTracks.value)==null?void 0:j.findIndex(re=>re.id===t);z<0?showTracks.value.push({id:t,length:$}):showTracks.value[z].length=$,++cursor.value,cursor.value>y.length&&(cursor.value=0),renderTrackLine(g,t,n),vue.nextTick(()=>{resetTrackView(t)}).then(()=>{}),(oe=mapInstance$5.value)==null||oe.on("moveend",()=>{showTrackLayer.value&&(trackLabels.value=[],renderTrackLine(g,t,n))})}).then(()=>{})},removeAllTrackLayer=()=>{var t;showTracks.value=[],(t=trackLineVectorSource.value)==null||t.clear()},playTrack=(t,e)=>{handlePlay(String(t),e)},resetTrackView=t=>{var i;const e=mapInstance$5.value.getView(),n=t?shipTrackLineFeatures.value.find(g=>g.getId()===t):shipTrackLineFeatures.value[0];if(!n)return;const r=(i=n==null?void 0:n.getGeometry())==null?void 0:i.getExtent();if(r!=null&&r.length)try{const g=buffer(r,Math.max(r[2]-r[0],r[3]-r[1])*.02);e.fit(g)}catch(g){console.log(g)}},_hoisted_1$8={key:0,class:"more-tool-panel"},_hoisted_2$4={class:"switch-buttons"},_hoisted_3$4={class:"tool-components"},_sfc_main$a=vue.defineComponent({__name:"toolPanel",props:{vehicleMode:{},viewMode:{},disableGreenDot:{type:Boolean},showTrackLayer:{type:Boolean},mapTileMode:{}},emits:["switchGreenDot","switchMapTile"],setup(t,{emit:e}){var oe,re;const n=vue.inject("mapInstance"),r=t,i=e,g=vue.ref(((re=(oe=n.value)==null?void 0:oe.getView())==null?void 0:re.getZoom())||mapZoom.default),y=vue.ref(!1),k=vue.ref(null),L=vue.ref(!0),$=()=>{r.disableGreenDot||g.value>=mapZoom.shipGreenDotMax||(L.value=!L.value,i("switchGreenDot",L.value))},V=()=>{i("switchMapTile",r.mapTileMode===BaseMapType.vector?BaseMapType.satellite:BaseMapType.vector)},z=()=>{var ie,ae;y.value?(ie=k.value)==null||ie.removeInteraction():(ae=k.value)==null||ae.addInteraction(),y.value=!y.value},j=()=>{var ie;(ie=k.value)==null||ie.removeInteraction(),y.value=!1};return vue.onMounted(()=>{vue.nextTick(()=>{var ie;(ie=n.value)==null||ie.on("moveend",()=>{var ue,de;const ae=(de=(ue=n.value)==null?void 0:ue.getView())==null?void 0:de.getZoom();ae&&(g.value=ae)})})}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:vue.normalizeClass(`tool-panel ${ie.viewMode}`)},[ie.viewMode==="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[vue.createElementVNode("div",_hoisted_2$4,[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[5]||(ae[5]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[6]||(ae[6]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[0]||(ae[0]=ue=>V())},ae[7]||(ae[7]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"图层",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="truck"?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[1]||(ae[1]=ue=>V())},ae[8]||(ae[8]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)):vue.createCommentVNode("",!0),ie.showTrackLayer?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[2]||(ae[2]=ue=>vue.unref(playTrack)(vue.unref(currentTrackId),1))},ae[9]||(ae[9]=[vue.createElementVNode("i",{class:"map-iconfont icon-play"},null,-1),vue.createElementVNode("div",{class:"button-text"},"播放轨迹",-1)])),vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[3]||(ae[3]=ue=>vue.unref(resetTrackView)())},ae[10]||(ae[10]=[vue.createElementVNode("i",{class:"map-iconfont icon-center"},null,-1),vue.createElementVNode("div",{class:"button-text"},"轨迹居中",-1)]))],64)):vue.createCommentVNode("",!0),vue.renderSlot(ie.$slots,"toolPanel",{},void 0,!0)])])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[11]||(ae[11]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[12]||(ae[12]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",{active:ie.mapTileMode===vue.unref(BaseMapType).satellite}]),onClick:V},ae[13]||(ae[13]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)],64))],2),vue.createElementVNode("div",_hoisted_3$4,[y.value?(vue.openBlock(),vue.createBlock(Measure,{key:0,ref_key:"measureRef",ref:k,visible:y.value,"onUpdate:visible":ae[4]||(ae[4]=ue=>y.value=ue),onClose:j,"view-mode":ie.viewMode},null,8,["visible","view-mode"])):vue.createCommentVNode("",!0)])],64))}}),ToolPanel=_export_sfc(_sfc_main$a,[["__scopeId","data-v-ef931f65"]]),UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),j,oe,re,ie,ae,ue;for(;;){re=Math.floor(z/3);const pe=Math.pow(10,re);if(j=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(j/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){j=ie,oe=ae,re=ue;break}else if(oe>=k)break;ie=j,ae=oe,ue=re,++z}const de=this.scaleBar_?this.createScaleBar(oe,j,V):j.toFixed(re<0?-re:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const _hoisted_1$7={id:"scale-line-container"},_sfc_main$9=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){const n=vue.inject("mapInstance");return e({setScaleLine:i=>{var k;const g=new ScaleLine$1({units:i||"metric"}),y=document.getElementById("scale-line-container");y&&(g.setTarget(y),(k=n.value)==null||k.addControl(g))}}),(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7))}}),ScaleLine=_export_sfc(_sfc_main$9,[["__scopeId","data-v-46a928b4"]]),_hoisted_1$6={class:"zoom"},_sfc_main$8=vue.defineComponent({__name:"zoomControl",props:{map:{type:Object}},setup(t){const e=vue.inject("mapInstance"),n=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g+1)},r=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g-1)};return(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",{onClick:n,class:"button big-button"},"+"),vue.createElementVNode("div",{onClick:r,class:"button small-button"},"-")]))}}),ZoomControl=_export_sfc(_sfc_main$8,[["__scopeId","data-v-602b1c0f"]]),_hoisted_1$5={class:"copyright"},_hoisted_2$3={class:"tdt-control-copyright tdt-control"},_hoisted_3$3=["src"],_sfc_main$7=vue.defineComponent({__name:"copyright",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[vue.createElementVNode("img",{src:vue.unref(CDN_URL)+"map/tdt-logo.png",width:"53px",height:"22px",class:"logo",alt:""},null,8,_hoisted_3$3),n[0]||(n[0]=vue.createElementVNode("div",{class:"copyright-text"},"GS(2024)0568号 - 甲测资字1100471",-1))]),n[1]||(n[1]=vue.createElementVNode("div",{id:"dataSource",class:"tdt-control data-source"},"数据来源:自然资源部 & NavInfo",-1))]))}}),Copyright=_export_sfc(_sfc_main$7,[["__scopeId","data-v-9c5c2f7b"]]),dotImage=new Image;dotImage.src=`${CDN_URL}/map/truck-dot.svg`,dotImage.crossOrigin="anonymous";const dotActiveImage=new Image;dotActiveImage.src=`${CDN_URL}/map/truck-dot-active.svg`,dotActiveImage.crossOrigin="anonymous";const cameraImage=new Image;cameraImage.src=`${CDN_URL}/map/map-camera.svg`,cameraImage.crossOrigin="anonymous";const loadImage=new Image;loadImage.src=`${CDN_URL}/map/map-load.svg`,loadImage.crossOrigin="anonymous";const setTruckStyle=(t,e,n,r)=>new Style({renderer:(i,g)=>{const y=g.context;y.save();let k=1;y.scale(k,k);let[L,$]=i;L=L/k-20,$=$/k;const V=L-70,z=$-68;let j=180;const oe=56,re="#FFFFFF";let ie=176;const ae=52;let ue="#164AFF",de="#FFFFFF";n===CAR_COLOR.YELLOW?(ie=176,ue="#FFC81E",de="rgba(0,0,0,0.88)"):n===CAR_COLOR.Y_GREEN&&(j=200,ie=196,ue="#8FED7C",de="rgba(0,0,0,0.88)"),r!=null&&r.length&&(j+=r.length*56),fillRectRadius(y,V,z,j,oe,re),fillRectRadius(y,V+2,z+2,ie,ae,ue),n===CAR_COLOR.Y_GREEN&&fillRectRadius(y,V+2,z+2,68,ae,"#FFC81E"),y.save(),y.restore(),y.fillStyle=de,y.font="bold 28px Arial",y.textAlign="left",y.textBaseline="middle";const pe=`${e.slice(0,2)+" · "+e.slice(2)}`;if(y.fillText(pe,V+12,z+32),y.save(),y.restore(),r!=null&&r.length){const he=y.measureText(pe).width+12;let _e=0;r.forEach(Ce=>{Ce===DEVICE_TYPE.CAMERA&&(y.drawImage(cameraImage,L-54+he+_e*56,$-64,50,50),++_e),Ce===DEVICE_TYPE.LOAD&&(y.drawImage(loadImage,L-54+he+_e*56,$-64,50,50),++_e)})}const le=dotImage;y.drawImage(le,L+j/2-90,$,50/k,50/k),y.restore()}}),mapInstance$4=vue.ref(),renderDashboardSetInstance=t=>mapInstance$4.value=t;vue.ref([]);let truckMarkerList=[],trucksVectorSource;const renderTrucksMarker=t=>{if(deleteAllTruckMarkers(),!!mapInstance$4.value)return t.forEach(e=>{const n=formatUtils.convertSixHundredThousandToLatLng(e.lon,e.lat),r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",e),r.setStyle(setTruckStyle(!1,e.vno,e==null?void 0:e.vclColor,e==null?void 0:e.icons)),truckMarkerList.push({name:e.vno,lonlat:n,feature:r})}),trucksVectorSource=new VectorSource({features:truckMarkerList.map(e=>e.feature)}),trucksLayer.value=new VectorLayer({source:trucksVectorSource}),mapInstance$4.value.addLayer(trucksLayer.value),trucksLayer.value},deleteAllTruckMarkers=()=>{truckMarkerList.forEach(t=>{t.feature&&(trucksVectorSource==null||trucksVectorSource.removeFeature(t.feature))}),truckMarkerList=[]},mapInstance$3=vue.ref(),renderCustomOverlaySetInstance=t=>mapInstance$3.value=t,drawCustomContent=(t,e,n,r="top-left",i=!1)=>{var V,z;if(!e||!mapInstance$3.value)return;document.querySelectorAll(".truck-custom-content").forEach(j=>j.parentNode.removeChild(j));const g=document.createElement("div");g.innerHTML=n;const y=new Overlay({element:g,position:e,positioning:r,stopEvent:i});if(i){let j=!1,oe=[0,0],re=[0,0];g.addEventListener("mousedown",function(ie){var ae;j=!0,ie.clientX,ie.clientY,oe=(ae=mapInstance$3.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-200,ie.clientY-200]),re=[ie.clientX-g.getBoundingClientRect().left+160,ie.clientY-g.getBoundingClientRect().top+84],ie.preventDefault()}),document.addEventListener("mousemove",function(ie){var ae;if(j){let ue=(ae=mapInstance$3.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-re[0],ie.clientY-re[1]]),de=ue[0]-oe[0],pe=ue[1]-oe[1];y.setPosition([oe[0]+de,oe[1]+pe])}}),document.addEventListener("mouseup",function(){j=!1})}(V=mapInstance$3.value)==null||V.addOverlay(y);const k=g.querySelector(".close-button");k&&k.addEventListener("click",()=>{var j,oe;(j=mapInstance$3.value)==null||j.removeOverlay(y),(oe=g.parentNode)==null||oe.removeChild(g)});let L=JSON.parse(JSON.stringify(e));const $=(z=mapInstance$3.value)==null?void 0:z.getCoordinateFromPixel(L);return y.setPosition($),y},mapInstance$2=vue.ref(),renderTruckSetInstance=t=>mapInstance$2.value=t,vehicle=vue.ref(null),focusShipData=vue.ref(),currentTruckOverlay=vue.ref(null),findTruck=async t=>{if(!mapInstance$2.value)return;focusShipData.value=t;const e=formatUtils.convertSixHundredThousandToLatLng(t.lon,t.lat),n=mapInstance$2.value.getPixelFromCoordinate(transform(e,projection.data,projection.mercator));currentTruckOverlay.value=drawTruckIcon(t.vno,n,t==null?void 0:t.drc);const r=mapInstance$2.value.getView(),i=new Point(e);r.setCenter(transform(i.getCoordinates(),projection.data,projection.mercator))},clearAllTruck=()=>{vehicle.value.clearAllShip()},drawTruckIcon=(t,e,n)=>{const r=`<div id="${t}" class="ol-custom-content truck-custom-content" style="width: 80px; height: 80px; transform: rotate(${n}deg);">
|
|
657
657
|
<img src="${CDN_URL}map/car-icon.gif" width="100%" height="100%" />
|
|
658
658
|
</div>`;return drawCustomContent(t,e,r,"center-center")},removeTruckIcon=()=>{var e;const t=(e=currentTruckOverlay.value)==null?void 0:e.getElement();t&&(t.innerHTML="")},zoomTruckIcon=()=>{var g;if(!mapInstance$2.value)return;const t=mapInstance$2.value.getView().getZoom(),e=120,n=60;function r(y){return y<14?n:y>=14&&y<=18?Math.round((y-14)*(e-n)/4+n):e}const i=r(t);(g=document.querySelectorAll(".truck-custom-content"))==null||g.forEach(y=>{y.style.width=`${i}px`,y.style.height=`${i}px`})},mapInstance$1=vue.ref(),renderMarkerSetInstance=t=>mapInstance$1.value=t,markerPosition=vue.ref(""),marker=vue.ref(),createIconStyle=t=>new Style({image:new Icon({src:CDN_URL+"map/poi-marker-default.png",anchor:[.5,1]}),text:new Text({text:t,offsetY:-90,font:"12px",fill:new Fill({color:"#000"}),stroke:new Stroke({color:"#fff",width:2}),backgroundFill:new Fill({color:"#fff"}),backgroundStroke:new Stroke({color:"#000",width:1}),padding:[2,2,2,2]})}),renderMarker=(t,e=!0,n=!0)=>{var V;if(!mapInstance$1.value||!t||t.split(",").length!==2)return;const[r,i]=t.split(",").map(Number);marker.value=new Feature({geometry:new Point(fromLonLat([r,i]))});const g=n?`${r}, ${i}`:"";(V=marker.value)==null||V.setStyle(createIconStyle(g));const y=new VectorSource({features:[marker.value]}),k=new VectorLayer({source:y}),L=mapInstance$1.value.getView();if(mapInstance$1.value.addLayer(k),e){const z=new Translate({layers:[k]});z.on("translating",function(j){var ie;const oe=j.features.item(0).getGeometry().getCoordinates(),re=toLonLat(oe);markerPosition.value=`${re[0].toFixed(6)}, ${re[1].toFixed(6)}`,(ie=marker.value)==null||ie.setStyle(createIconStyle(markerPosition.value))}),mapInstance$1.value.addInteraction(z)}const $=new Point([r,i]);L.setCenter(transform($.getCoordinates(),projection.data,projection.mercator)),L.setZoom(mapZoom.findShip)},setMarkerPosition=t=>{var i,g;if(!mapInstance$1.value)return;const e=mapInstance$1.value.getView(),n=t.split(",").map(Number);(g=(i=marker.value)==null?void 0:i.getGeometry())==null||g.setCoordinates(fromLonLat([n[0],n[1]]));const r=new Point([n[0],n[1]]);e.setCenter(transform(r.getCoordinates(),projection.data,projection.mercator))},mapInstance=vue.ref(),drawPolygonSetInstance=t=>mapInstance.value=t;let layerState="drawn",drawnState="undrawn";const source=new VectorSource;let sketch,helpTooltipElement,helpTooltip,measureTooltipElement,measureTooltip,circleStyle,drawVector,draw;function createMeasureTooltip(){var t;measureTooltipElement!=null&&measureTooltipElement.parentNode&&measureTooltipElement.parentNode.removeChild(measureTooltipElement),measureTooltipElement=document.createElement("div"),measureTooltipElement.className="ol-tooltip ol-tooltip-draw-polygon",measureTooltip=new Overlay({element:measureTooltipElement,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(t=mapInstance.value)==null||t.addOverlay(measureTooltip)}function createHelpTooltip(){var t;helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),helpTooltipElement=document.createElement("div"),helpTooltipElement.className="ol-tooltip ol-help-tooltip hidden",helpTooltip=new Overlay({element:helpTooltipElement,offset:[15,0],positioning:"center-left"}),(t=mapInstance.value)==null||t.addOverlay(helpTooltip)}let squareLimitError=!1,lineLimitError=!1;const validateSquareLimit=t=>{let n=1/0,r=-1/0,i=1/0,g=-1/0;t==null||t.forEach(L=>{const $=transform(L,projection.mercator,projection.data),V=$[0],z=$[1];n=Math.min(n,z),r=Math.max(r,z),i=Math.min(i,V),g=Math.max(g,V)});const y=(r-n)*111,k=(g-i)*111;squareLimitError=y>150||k>150};let storeFeature;const addInteraction=t=>{var r,i;drawVector||init(),drawnState="undrawn",layerState="drawn",(r=mapInstance.value)==null||r.addLayer(drawVector);const e=new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:1.5,lineDash:[10,10]}),fill:new Fill({color:"rgba(255, 255, 255, 0.25)"})});draw=new Draw({type:"Polygon",source,trace:!0,style:[e,circleStyle]}),(i=mapInstance.value)==null||i.addInteraction(draw),createMeasureTooltip(),createHelpTooltip();let n;draw.on("drawstart",function(g){var y;layerState="drawn",sketch=g.feature,n=(y=sketch.getGeometry())==null?void 0:y.on("change",function(k){const L=k.target;let $=formatUtils.formatArea(L,LENGTH_UNIT.NM);const z=L.getCoordinates()[0],j=new LineString([z[z.length-2],z[z.length-1]]);let oe=formatUtils.formatLength(j,LENGTH_UNIT.NM);if(lineLimitError=Number(getLength(j)/1e3)>150,validateSquareLimit(z),measureTooltipElement&&$&&(measureTooltipElement.innerHTML=`
|
|
659
659
|
<span class="text">面积:${$}${lineLimitError||squareLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</span>
|