zhihao-ui 1.2.11 → 1.2.12
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-Dv-eon6t.js → BaseInfo-CX8jhSiU.js} +1 -1
- package/dist/es/{Button-DBbUF88w.js → Button-Dayz-XVx.js} +2 -2
- package/dist/es/{DatePicker-CWQoV03Q.js → DatePicker-vfIj425T.js} +2 -2
- package/dist/es/{DetailHeader-C_mAB8-2.js → DetailHeader-DrlhwY52.js} +3 -3
- package/dist/es/{DetailSubTitle-DD7Yllhf.js → DetailSubTitle-QEEHnjR_.js} +2 -2
- package/dist/es/{Dialog-DyDSVm-6.js → Dialog-CLQwwXs6.js} +3 -3
- package/dist/es/{DiyDataTable-CpkKeWkY.js → DiyDataTable-CjU8lE1d.js} +4 -4
- package/dist/es/{EditInfoPair-D0b5jY5Y.js → EditInfoPair-BAkhPrrp.js} +3 -3
- package/dist/es/{FileWrapper-CMSYWmEz.js → FileWrapper-WvZK7e6H.js} +4 -4
- package/dist/es/{Grid-B5O9dZNI.js → Grid-B8GjLkPJ.js} +1 -1
- package/dist/es/{InfoPair-Do3sSVw-.js → InfoPair-CVRcV6zN.js} +3 -3
- package/dist/es/{Input-DVpd0Yte.js → Input-D3aG3Fqg.js} +3 -3
- package/dist/es/{Loading-DwtfOhMD.js → Loading-CJ0YVxxE.js} +2 -2
- package/dist/es/{Map-B8_d8utt.js → Map-CjPsc0XI.js} +827 -712
- package/dist/es/{MessageBox-BowhqMYW.js → MessageBox-CMjFYHiw.js} +2 -2
- package/dist/es/{MoneyInput-CaTrJLi1.js → MoneyInput-Ctz5oyHG.js} +5 -5
- package/dist/es/{PageHeadPanel-_mKu2rMQ.js → PageHeadPanel-B13UDwTh.js} +2 -2
- package/dist/es/{ToolTips-BTCP0N--.js → ToolTips-ZGKTR5KG.js} +3 -3
- package/dist/es/index.js +21 -21
- package/dist/es/{utils-DZ8-2Fg2.js → utils-DR-4CNcy.js} +1 -1
- package/dist/es/{vendor-BY-fHNA3.js → vendor-qv9XzgYI.js} +1595 -1595
- package/dist/index.css +1 -1
- package/dist/types/components/Map/Map.vue.d.ts +7 -3
- package/dist/types/components/Map/components/toolPanel.vue.d.ts +16 -1
- package/dist/types/components/Map/index.d.ts +30 -12
- package/dist/types/components/Map/render/canvasRender/renderTrackStyle.d.ts +1 -0
- package/dist/types/components/Map/render/drawPolygon.d.ts +2 -2
- package/dist/types/components/Map/render/renderTrack.d.ts +2 -2
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +16 -16
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var A = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref, defineComponent, useModel, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, Fragment, renderList, unref, createBlock, toDisplayString, createCommentVNode, mergeModels, normalizeClass,
|
|
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 ElOption,
|
|
6
|
-
import { _ as _export_sfc } from "./Button-
|
|
7
|
-
import { w as withInstall } from "./utils-
|
|
2
|
+
var B = (e, t, o) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
+
var k = (e, t, o) => B(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
+
import { ref, defineComponent, useModel, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, Fragment, renderList, unref, createBlock, toDisplayString, createCommentVNode, mergeModels, nextTick, normalizeClass, renderSlot, onMounted } 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 ElOption, T as Text, h as hooks, L as LineString, s as Feature, P as Point, t as fromLonLat, e as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, v as transform, w as ScaleLine$1, I as Icon, x as Translate, y as toLonLat, M as MultiPoint, z as getCenter, A as TileLayer, X as XYZ, B as Map$1, H as View } from "./vendor-qv9XzgYI.js";
|
|
6
|
+
import { _ as _export_sfc } from "./Button-Dayz-XVx.js";
|
|
7
|
+
import { w as withInstall } from "./utils-DR-4CNcy.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 || {});
|
|
9
9
|
const LENGTH_UNIT_LABEL = {
|
|
10
10
|
1: "M",
|
|
@@ -16,47 +16,47 @@ const LENGTH_UNIT_LABEL = {
|
|
|
16
16
|
};
|
|
17
17
|
var SWITCH_BTN = /* @__PURE__ */ ((e) => (e.Camera = "camera", e.Mobile = "mobile", e.WaterGauge = "waterGauge", e))(SWITCH_BTN || {});
|
|
18
18
|
class ShipMapData {
|
|
19
|
-
constructor(t, o, n, a, r, l,
|
|
20
|
-
|
|
19
|
+
constructor(t, o, n, a, r, l, i, s, u, c, m, d, f, g, p, T, L, E, b, h, y, v) {
|
|
20
|
+
k(this, "id");
|
|
21
21
|
// mmsi
|
|
22
|
-
|
|
22
|
+
k(this, "mmsi");
|
|
23
23
|
// 船舶三角形填充色
|
|
24
|
-
|
|
24
|
+
k(this, "fill");
|
|
25
25
|
// 船类型 "7": "货船",
|
|
26
|
-
|
|
26
|
+
k(this, "shipType");
|
|
27
27
|
// 船名
|
|
28
|
-
|
|
28
|
+
k(this, "name");
|
|
29
29
|
// 长度
|
|
30
|
-
|
|
30
|
+
k(this, "length");
|
|
31
31
|
// 宽度
|
|
32
|
-
|
|
32
|
+
k(this, "breadth");
|
|
33
33
|
// 经度
|
|
34
|
-
|
|
34
|
+
k(this, "lon");
|
|
35
35
|
// 纬度
|
|
36
|
-
|
|
36
|
+
k(this, "lat");
|
|
37
37
|
// 时间
|
|
38
|
-
|
|
38
|
+
k(this, "createdAt");
|
|
39
39
|
// 速度
|
|
40
|
-
|
|
40
|
+
k(this, "speed");
|
|
41
41
|
// 来源
|
|
42
|
-
|
|
42
|
+
k(this, "from");
|
|
43
43
|
// 船状态 "stop":"静止","sail":"航行","work":"作业","danger":"危险","other":"其他"
|
|
44
|
-
|
|
44
|
+
k(this, "sailStatus");
|
|
45
45
|
// 船艏向
|
|
46
|
-
|
|
46
|
+
k(this, "hdg");
|
|
47
47
|
// 航迹向
|
|
48
|
-
|
|
48
|
+
k(this, "cog");
|
|
49
49
|
// 设备定位类型
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
k(this, "posType");
|
|
51
|
+
k(this, "type");
|
|
52
52
|
// 航向角度
|
|
53
|
-
|
|
53
|
+
k(this, "angle");
|
|
54
54
|
// 左侧是否显示色块
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.id = t, this.mmsi = o, this.fill = n, this.shipType = a, this.name = r, this.length = l, this.breadth =
|
|
55
|
+
k(this, "leftIconColor");
|
|
56
|
+
k(this, "existDevice");
|
|
57
|
+
k(this, "existMobile");
|
|
58
|
+
k(this, "existWaterGauge");
|
|
59
|
+
this.id = t, this.mmsi = o, this.fill = n, this.shipType = a, this.name = r, this.length = l, this.breadth = i, this.lon = s, this.lat = u, this.createdAt = c, this.speed = m, this.from = d, this.sailStatus = f, this.hdg = g, this.cog = p, this.posType = T, this.type = L, this.angle = E, this.leftIconColor = b, this.existDevice = h, this.existMobile = y, this.existWaterGauge = v;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
const formatLength = function(e, t) {
|
|
@@ -125,7 +125,7 @@ ref();
|
|
|
125
125
|
const labels = ref([]), _hoisted_1$4 = {
|
|
126
126
|
key: 0,
|
|
127
127
|
class: "measure-panel"
|
|
128
|
-
}, _hoisted_2$2 = { class: "d-flex justify-content-between align-content-start w-100" }, _hoisted_3$
|
|
128
|
+
}, _hoisted_2$2 = { class: "d-flex justify-content-between align-content-start w-100" }, _hoisted_3$2 = { class: "measure-history-list" }, _hoisted_4$1 = { class: "left-panel" }, _hoisted_5 = { class: "text index" }, _hoisted_6 = { class: "text" }, _hoisted_7 = ["onClick"], _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
129
129
|
__name: "measure",
|
|
130
130
|
props: {
|
|
131
131
|
visible: { type: Boolean },
|
|
@@ -133,10 +133,10 @@ const labels = ref([]), _hoisted_1$4 = {
|
|
|
133
133
|
},
|
|
134
134
|
emits: /* @__PURE__ */ mergeModels(["close"], ["update:visible"]),
|
|
135
135
|
setup(e, { expose: t, emit: o }) {
|
|
136
|
-
const n = o, a = useModel(e, "visible"), r = ref(LENGTH_UNIT.NM), l = ref([]),
|
|
137
|
-
let
|
|
138
|
-
const
|
|
139
|
-
source:
|
|
136
|
+
const n = o, a = useModel(e, "visible"), r = ref(LENGTH_UNIT.NM), l = ref([]), i = ref(!1), s = new VectorSource();
|
|
137
|
+
let u, c, m, d, f;
|
|
138
|
+
const g = new VectorLayer({
|
|
139
|
+
source: s,
|
|
140
140
|
style: {
|
|
141
141
|
"fill-color": "rgba(255, 255, 255, 0.2)",
|
|
142
142
|
"stroke-color": "#ffcc33",
|
|
@@ -144,16 +144,16 @@ const labels = ref([]), _hoisted_1$4 = {
|
|
|
144
144
|
"circle-radius": 7,
|
|
145
145
|
"circle-fill-color": "#ffcc33"
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
148
|
-
if (
|
|
147
|
+
}), p = function(w) {
|
|
148
|
+
if (w.dragging)
|
|
149
149
|
return;
|
|
150
|
-
let
|
|
151
|
-
|
|
152
|
-
},
|
|
153
|
-
mapInstance.value && (mapInstance.value.on("pointermove",
|
|
154
|
-
var
|
|
155
|
-
(
|
|
156
|
-
}),
|
|
150
|
+
let S = "点击选择起点";
|
|
151
|
+
u && (S = "单击继续,双击结束"), c && (c.innerHTML = S, m.setPosition(w.coordinate), c.classList.remove("hidden"));
|
|
152
|
+
}, T = () => {
|
|
153
|
+
mapInstance.value && (mapInstance.value.on("pointermove", p), mapInstance.value.getViewport().addEventListener("mouseout", function() {
|
|
154
|
+
var w;
|
|
155
|
+
(w = c == null ? void 0 : c.classList) == null || w.add("hidden");
|
|
156
|
+
}), i.value = !0);
|
|
157
157
|
};
|
|
158
158
|
let L;
|
|
159
159
|
const E = new Style({
|
|
@@ -175,110 +175,110 @@ const labels = ref([]), _hoisted_1$4 = {
|
|
|
175
175
|
})
|
|
176
176
|
})
|
|
177
177
|
});
|
|
178
|
-
function
|
|
179
|
-
var
|
|
180
|
-
l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((
|
|
181
|
-
var
|
|
182
|
-
(
|
|
183
|
-
}),
|
|
178
|
+
function b() {
|
|
179
|
+
var w, S;
|
|
180
|
+
l.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((M) => {
|
|
181
|
+
var I;
|
|
182
|
+
(I = M == null ? void 0 : M.parentNode) == null || I.removeChild(M);
|
|
183
|
+
}), s.clear(), (w = mapInstance.value) == null || w.removeInteraction(L), (S = mapInstance.value) == null || S.removeLayer(g), c != null && c.parentNode && c.parentNode.removeChild(c);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
source:
|
|
185
|
+
function h() {
|
|
186
|
+
var S, M;
|
|
187
|
+
b(), (S = mapInstance.value) == null || S.addLayer(g), L = new Draw({
|
|
188
|
+
source: s,
|
|
189
189
|
type: "LineString",
|
|
190
190
|
style: function() {
|
|
191
191
|
return E;
|
|
192
192
|
}
|
|
193
|
-
}), (
|
|
194
|
-
let
|
|
195
|
-
L.on("drawstart", function(
|
|
196
|
-
var
|
|
197
|
-
|
|
198
|
-
let
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
let x = formatLength(
|
|
202
|
-
|
|
193
|
+
}), (M = mapInstance.value) == null || M.addInteraction(L), v(), y();
|
|
194
|
+
let w;
|
|
195
|
+
L.on("drawstart", function(I) {
|
|
196
|
+
var N;
|
|
197
|
+
u = I.feature;
|
|
198
|
+
let _;
|
|
199
|
+
w = (N = u.getGeometry()) == null ? void 0 : N.on("change", function(P) {
|
|
200
|
+
const F = P.target;
|
|
201
|
+
let x = formatLength(F, r.value);
|
|
202
|
+
_ = F.getLastCoordinate(), d && x && (d.innerHTML = x), f.setPosition(_);
|
|
203
203
|
});
|
|
204
204
|
}), L.on("drawend", function() {
|
|
205
|
-
|
|
205
|
+
d && (d.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), d != null && d.innerHTML && l.value.push(d == null ? void 0 : d.innerHTML), f.setOffset([0, -7]), u = null, d = null, v(), w && unByKey(w);
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
element:
|
|
208
|
+
function y() {
|
|
209
|
+
var w;
|
|
210
|
+
c != null && c.parentNode && c.parentNode.removeChild(c), c = document.createElement("div"), c.className = "ol-tooltip hidden", m = new Overlay({
|
|
211
|
+
element: c,
|
|
212
212
|
offset: [15, 0],
|
|
213
213
|
positioning: "center-left"
|
|
214
|
-
}), (
|
|
214
|
+
}), (w = mapInstance.value) == null || w.addOverlay(m);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
element:
|
|
216
|
+
function v() {
|
|
217
|
+
var w;
|
|
218
|
+
d != null && d.parentNode && d.parentNode.removeChild(d), d = document.createElement("div"), d.className = "ol-tooltip ol-tooltip-measure", f = new Overlay({
|
|
219
|
+
element: d,
|
|
220
220
|
offset: [0, -15],
|
|
221
221
|
positioning: "bottom-center",
|
|
222
222
|
stopEvent: !1,
|
|
223
223
|
insertFirst: !1
|
|
224
|
-
}), (
|
|
224
|
+
}), (w = mapInstance.value) == null || w.addOverlay(f);
|
|
225
225
|
}
|
|
226
|
-
const C = (
|
|
227
|
-
var
|
|
228
|
-
l.value[
|
|
229
|
-
const
|
|
230
|
-
w
|
|
231
|
-
const
|
|
232
|
-
|
|
226
|
+
const C = (w) => {
|
|
227
|
+
var I, _;
|
|
228
|
+
l.value[w] && l.value.splice(w, 1);
|
|
229
|
+
const S = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
230
|
+
S[w] && ((_ = (I = S[w]) == null ? void 0 : I.parentNode) == null || _.removeChild(S[w]));
|
|
231
|
+
const M = s.getFeatures();
|
|
232
|
+
M[w] && s.removeFeature(M[w]);
|
|
233
233
|
}, V = () => {
|
|
234
234
|
n("close");
|
|
235
235
|
};
|
|
236
236
|
return watch(() => a, () => {
|
|
237
|
-
a && !
|
|
237
|
+
a && !i.value && (T(), h());
|
|
238
238
|
}, { deep: !0, immediate: !0 }), t({
|
|
239
|
-
addInteraction:
|
|
240
|
-
removeInteraction:
|
|
241
|
-
}), (
|
|
242
|
-
const
|
|
239
|
+
addInteraction: h,
|
|
240
|
+
removeInteraction: b
|
|
241
|
+
}), (w, S) => {
|
|
242
|
+
const M = resolveComponent("el-select");
|
|
243
243
|
return a.value ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
244
244
|
createElementVNode("div", { class: "header" }, [
|
|
245
|
-
|
|
245
|
+
S[1] || (S[1] = createElementVNode("div", { class: "title" }, "测量", -1)),
|
|
246
246
|
createElementVNode("i", {
|
|
247
247
|
onClick: V,
|
|
248
248
|
class: "map-iconfont icon-close"
|
|
249
249
|
})
|
|
250
250
|
]),
|
|
251
251
|
createElementVNode("div", _hoisted_2$2, [
|
|
252
|
-
|
|
253
|
-
createVNode(
|
|
252
|
+
S[2] || (S[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
|
|
253
|
+
createVNode(M, {
|
|
254
254
|
class: "select-length-unit",
|
|
255
255
|
modelValue: r.value,
|
|
256
|
-
"onUpdate:modelValue":
|
|
256
|
+
"onUpdate:modelValue": S[0] || (S[0] = (I) => r.value = I)
|
|
257
257
|
}, {
|
|
258
258
|
default: withCtx(() => [
|
|
259
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(LENGTH_UNIT_LABEL), (
|
|
260
|
-
key: unref(LENGTH_UNIT)[
|
|
261
|
-
label:
|
|
262
|
-
value: unref(LENGTH_UNIT)[
|
|
259
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(LENGTH_UNIT_LABEL), (I) => (openBlock(), createBlock(unref(ElOption), {
|
|
260
|
+
key: unref(LENGTH_UNIT)[I],
|
|
261
|
+
label: I,
|
|
262
|
+
value: unref(LENGTH_UNIT)[I]
|
|
263
263
|
}, null, 8, ["label", "value"]))), 128))
|
|
264
264
|
]),
|
|
265
265
|
_: 1
|
|
266
266
|
}, 8, ["modelValue"])
|
|
267
267
|
]),
|
|
268
|
-
createElementVNode("div", _hoisted_3$
|
|
269
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (
|
|
268
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
269
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (I, _) => (openBlock(), createElementBlock("div", {
|
|
270
270
|
class: "measure-history-item",
|
|
271
|
-
key:
|
|
271
|
+
key: _
|
|
272
272
|
}, [
|
|
273
|
-
createElementVNode("div", _hoisted_4, [
|
|
274
|
-
|
|
275
|
-
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(
|
|
276
|
-
createElementVNode("span", _hoisted_6, toDisplayString(
|
|
273
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
274
|
+
S[3] || (S[3] = createElementVNode("i", { class: "map-iconfont icon-a-Frame-11" }, null, -1)),
|
|
275
|
+
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(_ + 1), 1),
|
|
276
|
+
createElementVNode("span", _hoisted_6, toDisplayString(I), 1)
|
|
277
277
|
]),
|
|
278
278
|
createElementVNode("div", {
|
|
279
279
|
class: "delete-button",
|
|
280
|
-
onClick: (
|
|
281
|
-
},
|
|
280
|
+
onClick: (N) => C(_)
|
|
281
|
+
}, S[4] || (S[4] = [
|
|
282
282
|
createElementVNode("i", { class: "map-iconfont icon-a-delete1" }, null, -1)
|
|
283
283
|
]), 8, _hoisted_7)
|
|
284
284
|
]))), 128))
|
|
@@ -286,103 +286,7 @@ const labels = ref([]), _hoisted_1$4 = {
|
|
|
286
286
|
])) : createCommentVNode("", !0);
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
}), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-650abf6f"]]),
|
|
290
|
-
__name: "toolPanel",
|
|
291
|
-
props: {
|
|
292
|
-
vehicleMode: {}
|
|
293
|
-
},
|
|
294
|
-
emits: ["switchGreenDot", "switchMapTile"],
|
|
295
|
-
setup(e, { emit: t }) {
|
|
296
|
-
const o = t, n = ref(!1), a = ref(null), r = ref(!0), l = () => {
|
|
297
|
-
r.value = !r.value, o("switchGreenDot", r.value);
|
|
298
|
-
}, s = ref(BaseMapType.vector), i = () => {
|
|
299
|
-
s.value = s.value === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector, o("switchMapTile", s.value);
|
|
300
|
-
}, d = () => {
|
|
301
|
-
var p, c;
|
|
302
|
-
n.value ? (p = a.value) == null || p.removeInteraction() : (c = a.value) == null || c.addInteraction(), n.value = !n.value;
|
|
303
|
-
}, u = () => {
|
|
304
|
-
var p;
|
|
305
|
-
(p = a.value) == null || p.removeInteraction(), n.value = !1;
|
|
306
|
-
};
|
|
307
|
-
return (p, c) => (openBlock(), createElementBlock(Fragment, null, [
|
|
308
|
-
createElementVNode("div", _hoisted_1$3, [
|
|
309
|
-
p.vehicleMode === "ship" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
310
|
-
createElementVNode("div", {
|
|
311
|
-
class: normalizeClass(["switch-btn", `${n.value && "active"}`]),
|
|
312
|
-
onClick: d
|
|
313
|
-
}, c[1] || (c[1] = [
|
|
314
|
-
createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
|
|
315
|
-
createElementVNode("div", { class: "button-text" }, "测距", -1)
|
|
316
|
-
]), 2),
|
|
317
|
-
createElementVNode("div", {
|
|
318
|
-
class: normalizeClass(["switch-btn", { active: r.value }]),
|
|
319
|
-
onClick: l
|
|
320
|
-
}, c[2] || (c[2] = [
|
|
321
|
-
createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
|
|
322
|
-
createElementVNode("div", { class: "button-text" }, "绿点", -1)
|
|
323
|
-
]), 2)
|
|
324
|
-
], 64)) : createCommentVNode("", !0),
|
|
325
|
-
createElementVNode("div", {
|
|
326
|
-
class: normalizeClass(["switch-btn", { active: s.value === unref(BaseMapType).satellite }]),
|
|
327
|
-
onClick: i
|
|
328
|
-
}, c[3] || (c[3] = [
|
|
329
|
-
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
330
|
-
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
331
|
-
]), 2)
|
|
332
|
-
]),
|
|
333
|
-
createElementVNode("div", _hoisted_2$1, [
|
|
334
|
-
n.value ? (openBlock(), createBlock(Measure, {
|
|
335
|
-
key: 0,
|
|
336
|
-
ref_key: "measureRef",
|
|
337
|
-
ref: a,
|
|
338
|
-
visible: n.value,
|
|
339
|
-
"onUpdate:visible": c[0] || (c[0] = (f) => n.value = f),
|
|
340
|
-
onClose: u
|
|
341
|
-
}, null, 8, ["visible"])) : createCommentVNode("", !0)
|
|
342
|
-
])
|
|
343
|
-
], 64));
|
|
344
|
-
}
|
|
345
|
-
}), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-9c83c550"]]), _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
346
|
-
__name: "scaleLine",
|
|
347
|
-
setup(e, { expose: t }) {
|
|
348
|
-
const o = new ScaleLine$1({
|
|
349
|
-
units: "nautical"
|
|
350
|
-
});
|
|
351
|
-
return t({
|
|
352
|
-
setScaleLine: () => {
|
|
353
|
-
o.setTarget(document.getElementById("scale-line-container")), mapInstance.value.addControl(o);
|
|
354
|
-
}
|
|
355
|
-
}), (a, r) => (openBlock(), createElementBlock("div", _hoisted_1$2));
|
|
356
|
-
}
|
|
357
|
-
}), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-e51b19b1"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
358
|
-
__name: "zoomControl",
|
|
359
|
-
props: {
|
|
360
|
-
map: {
|
|
361
|
-
type: Object
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
setup(e) {
|
|
365
|
-
const t = () => {
|
|
366
|
-
if (!mapInstance.value) return;
|
|
367
|
-
const n = mapInstance.value.getView(), a = n.getZoom();
|
|
368
|
-
a && n.setZoom(a + 1);
|
|
369
|
-
}, o = () => {
|
|
370
|
-
if (!mapInstance.value) return;
|
|
371
|
-
const n = mapInstance.value.getView(), a = n.getZoom();
|
|
372
|
-
a && n.setZoom(a - 1);
|
|
373
|
-
};
|
|
374
|
-
return (n, a) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
375
|
-
createElementVNode("div", {
|
|
376
|
-
onClick: t,
|
|
377
|
-
class: "button big-button"
|
|
378
|
-
}, "+"),
|
|
379
|
-
createElementVNode("div", {
|
|
380
|
-
onClick: o,
|
|
381
|
-
class: "button small-button"
|
|
382
|
-
}, "-")
|
|
383
|
-
]));
|
|
384
|
-
}
|
|
385
|
-
}), ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f2b62b21"]]), CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", baseMap = {
|
|
289
|
+
}), Measure = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-650abf6f"]]), CDN_URL = "https://static.zhihaoscm.cn/", tiandituKey = "a6e8f78974f2581f2ca00485b40c948f", baseMap = {
|
|
386
290
|
// 矢量底图
|
|
387
291
|
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}`,
|
|
388
292
|
// 矢量注记
|
|
@@ -402,10 +306,14 @@ const labels = ref([]), _hoisted_1$4 = {
|
|
|
402
306
|
max: 18,
|
|
403
307
|
// 查看船舶详情时地图缩放层级
|
|
404
308
|
findShip: 13,
|
|
309
|
+
// 查看车辆详情时地图缩放层级
|
|
310
|
+
findTruck: 14,
|
|
405
311
|
// 船舶绿点图最大显示层级
|
|
406
312
|
shipGreenDotMax: 11,
|
|
407
313
|
// 查车图标显示层级
|
|
408
314
|
truckDefault: 14,
|
|
315
|
+
// 统计图标显示层级
|
|
316
|
+
truckStatistics: 8,
|
|
409
317
|
// 船形图标最小渲染层级
|
|
410
318
|
shipModelMin: 16,
|
|
411
319
|
// 船形图标最大渲染层级
|
|
@@ -415,49 +323,7 @@ const labels = ref([]), _hoisted_1$4 = {
|
|
|
415
323
|
data: "EPSG:4326",
|
|
416
324
|
// 墨卡托投影坐标 渲染坐标
|
|
417
325
|
mercator: "EPSG:3857"
|
|
418
|
-
},
|
|
419
|
-
__name: "copyright",
|
|
420
|
-
setup(e) {
|
|
421
|
-
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
422
|
-
createElementVNode("div", _hoisted_2, [
|
|
423
|
-
createElementVNode("img", {
|
|
424
|
-
src: unref(CDN_URL) + "map/tdt-logo.png",
|
|
425
|
-
width: "53px",
|
|
426
|
-
height: "22px",
|
|
427
|
-
class: "logo",
|
|
428
|
-
alt: ""
|
|
429
|
-
}, null, 8, _hoisted_3),
|
|
430
|
-
o[0] || (o[0] = createElementVNode("div", { class: "copyright-text" }, "GS(2024)0568号 - 甲测资字1100471", -1))
|
|
431
|
-
]),
|
|
432
|
-
o[1] || (o[1] = createElementVNode("div", {
|
|
433
|
-
id: "dataSource",
|
|
434
|
-
class: "tdt-control data-source"
|
|
435
|
-
}, "数据来源:自然资源部 & NavInfo", -1))
|
|
436
|
-
]));
|
|
437
|
-
}
|
|
438
|
-
}), Copyright = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-9c5c2f7b"]]), _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
439
|
-
__name: "fullscreen",
|
|
440
|
-
props: {
|
|
441
|
-
pageRef: {
|
|
442
|
-
type: Object,
|
|
443
|
-
default: () => ({})
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
setup(e) {
|
|
447
|
-
const t = e, o = ref(!1), n = () => {
|
|
448
|
-
var a;
|
|
449
|
-
o.value ? document.exitFullscreen() : (console.log(t.pageRef), (a = t.pageRef) == null || a.requestFullscreen()), o.value = !o.value;
|
|
450
|
-
};
|
|
451
|
-
return (a, r) => (openBlock(), createElementBlock("div", {
|
|
452
|
-
class: "fullscreen-btn",
|
|
453
|
-
onClick: n
|
|
454
|
-
}, [
|
|
455
|
-
createElementVNode("i", {
|
|
456
|
-
class: normalizeClass(`map-iconfont ${o.value ? "icon-quxiaoquanping" : "icon-quanping"} `)
|
|
457
|
-
}, null, 2)
|
|
458
|
-
]));
|
|
459
|
-
}
|
|
460
|
-
}), Fullscreen = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ed59d7cb"]]), equatorialCircumference = 2003750834e-2;
|
|
326
|
+
}, equatorialCircumference = 2003750834e-2;
|
|
461
327
|
function lonLatToMercator(e) {
|
|
462
328
|
const t = e[0] * equatorialCircumference / 180;
|
|
463
329
|
let o = Math.log(Math.tan((90 + e[1]) * Math.PI / 360)) / (Math.PI / 180);
|
|
@@ -504,8 +370,8 @@ function createPoint(e, t, o) {
|
|
|
504
370
|
}, t, o);
|
|
505
371
|
}
|
|
506
372
|
function calculateAngle(e, t, o) {
|
|
507
|
-
const n = convertToRadians(e), a = convertToRadians(t), r = n[0] % 360 * (Math.PI / 180), l = a[0] % 360 * (Math.PI / 180),
|
|
508
|
-
return 180 * Math.atan2(
|
|
373
|
+
const n = convertToRadians(e), a = convertToRadians(t), r = n[0] % 360 * (Math.PI / 180), l = a[0] % 360 * (Math.PI / 180), i = n[1] % 360 * (Math.PI / 180), s = a[1] % 360 * (Math.PI / 180), u = Math.sin(l - r) * Math.cos(s), c = Math.cos(i) * Math.sin(s) - Math.sin(i) * Math.cos(s) * Math.cos(l - r);
|
|
374
|
+
return 180 * Math.atan2(u, c) % (2 * Math.PI) / Math.PI;
|
|
509
375
|
}
|
|
510
376
|
const getAngle = (e, t) => {
|
|
511
377
|
let o = calculateAngle(createPoint(e), createPoint(t));
|
|
@@ -524,9 +390,9 @@ const getAngle = (e, t) => {
|
|
|
524
390
|
throw new Error("A polygon must have at least 3 coordinates.");
|
|
525
391
|
let t = 0, o = 0, n = 0;
|
|
526
392
|
const a = e.length;
|
|
527
|
-
for (let
|
|
528
|
-
const [
|
|
529
|
-
n +=
|
|
393
|
+
for (let i = 0; i < a - 1; i++) {
|
|
394
|
+
const [s, u] = e[i], [c, m] = e[i + 1], d = s * m - c * u;
|
|
395
|
+
n += d, t += (s + c) * d, o += (u + m) * d;
|
|
530
396
|
}
|
|
531
397
|
if (n *= 0.5, n === 0)
|
|
532
398
|
throw new Error("多边形面积为零");
|
|
@@ -534,40 +400,40 @@ const getAngle = (e, t) => {
|
|
|
534
400
|
return [r, l];
|
|
535
401
|
}, rotateShapeModel = (e, t) => {
|
|
536
402
|
const [o, n] = calculatePolygonCentroid(e), a = t * Math.PI / 180, r = Math.cos(a), l = Math.sin(a);
|
|
537
|
-
return e.map(([
|
|
538
|
-
const
|
|
539
|
-
return [
|
|
403
|
+
return e.map(([i, s]) => {
|
|
404
|
+
const u = i - o, c = s - n, m = u * r - c * l + o, d = u * l + c * r + n;
|
|
405
|
+
return [m, d];
|
|
540
406
|
});
|
|
541
407
|
}, getTopLeftPoint = (e) => [e[0], e[3]], getBottomLeftPoint = (e) => [e[2], e[3]], getBottomRightPoint = (e) => [e[2], e[1]], getTopRighttPoint = (e) => [e[0], e[1]];
|
|
542
408
|
function calculateBounds(e, t, o, n, a) {
|
|
543
|
-
let r, l,
|
|
409
|
+
let r, l, i, s, u = e[0], c = e[1];
|
|
544
410
|
switch (t) {
|
|
545
411
|
case 0:
|
|
546
|
-
r =
|
|
412
|
+
r = u + a, l = r + o, s = c - a, i = s - n;
|
|
547
413
|
break;
|
|
548
414
|
case 1:
|
|
549
|
-
r =
|
|
415
|
+
r = u + a, l = r + o, s = c + n / 2, i = s - n;
|
|
550
416
|
break;
|
|
551
417
|
case 2:
|
|
552
|
-
r =
|
|
418
|
+
r = u + a, l = r + o, s = c + a + n, i = s - n;
|
|
553
419
|
break;
|
|
554
420
|
case 3:
|
|
555
|
-
r =
|
|
421
|
+
r = u - o / 2, l = r + o, s = c + a + n, i = s - n;
|
|
556
422
|
break;
|
|
557
423
|
case 4:
|
|
558
|
-
l =
|
|
424
|
+
l = u, r = l - o, s = c + a + n, i = s - n;
|
|
559
425
|
break;
|
|
560
426
|
case 5:
|
|
561
|
-
l =
|
|
427
|
+
l = u - a, r = l - o, s = c + n / 2, i = s - n;
|
|
562
428
|
break;
|
|
563
429
|
case 6:
|
|
564
|
-
l =
|
|
430
|
+
l = u, r = l - o, s = c - a, i = s - n;
|
|
565
431
|
break;
|
|
566
432
|
case 7:
|
|
567
|
-
r =
|
|
433
|
+
r = u - o / 2, l = r + o, s = c - a, i = s - n;
|
|
568
434
|
}
|
|
569
|
-
if (!(!r || !
|
|
570
|
-
return [Math.min(r, l), Math.min(
|
|
435
|
+
if (!(!r || !i || !l || !s))
|
|
436
|
+
return [Math.min(r, l), Math.min(i, s), Math.max(r, l), Math.max(i, s) + 1];
|
|
571
437
|
}
|
|
572
438
|
function calculateAnchorPoint(e, t, o = 70, n = 20, a = 20) {
|
|
573
439
|
let r = [0, 0];
|
|
@@ -605,23 +471,23 @@ function drawLabelBody(e, t, o) {
|
|
|
605
471
|
labelOutSize: a = 2,
|
|
606
472
|
labelHeight: r,
|
|
607
473
|
center: l,
|
|
608
|
-
text:
|
|
609
|
-
leftIcon:
|
|
610
|
-
shipColor:
|
|
611
|
-
lineLength:
|
|
474
|
+
text: i,
|
|
475
|
+
leftIcon: s,
|
|
476
|
+
shipColor: u,
|
|
477
|
+
lineLength: c = 20
|
|
612
478
|
} = o;
|
|
613
479
|
e.save(), n && (e.font = n);
|
|
614
|
-
let
|
|
615
|
-
(
|
|
616
|
-
let
|
|
617
|
-
if (f = 0,
|
|
618
|
-
let
|
|
480
|
+
let m = e.measureText(i).width + 2 * a;
|
|
481
|
+
(s || u) && (m += r + 4 * a), e.restore();
|
|
482
|
+
let d, f = -1, g = r + 3 * a;
|
|
483
|
+
if (f = 0, d = calculateBounds(l, f, m, g, c), d && f > -1) {
|
|
484
|
+
let p = getBottomLeftPoint(d), T = getTopRighttPoint(d);
|
|
619
485
|
return {
|
|
620
486
|
center: l,
|
|
621
|
-
x: calculateAnchorPoint(l, f,
|
|
622
|
-
l:
|
|
623
|
-
r:
|
|
624
|
-
bounds:
|
|
487
|
+
x: calculateAnchorPoint(l, f, m, g, c),
|
|
488
|
+
l: T,
|
|
489
|
+
r: p,
|
|
490
|
+
bounds: d,
|
|
625
491
|
position: f
|
|
626
492
|
};
|
|
627
493
|
}
|
|
@@ -629,23 +495,23 @@ function drawLabelBody(e, t, o) {
|
|
|
629
495
|
}
|
|
630
496
|
const drawText = (e, t) => {
|
|
631
497
|
if (!e) return;
|
|
632
|
-
const { center: o, text: n, textColor: a, leftIcon: r, rightIcons: l, font:
|
|
498
|
+
const { center: o, text: n, textColor: a, leftIcon: r, rightIcons: l, font: i } = t;
|
|
633
499
|
e.save();
|
|
634
|
-
let [
|
|
500
|
+
let [s, u] = o;
|
|
635
501
|
if (r) {
|
|
636
502
|
e.font = "21px map-iconfont";
|
|
637
|
-
let
|
|
638
|
-
e.fillStyle = r.color, e.fillText(
|
|
503
|
+
let c = getIconFont(r.icon);
|
|
504
|
+
e.fillStyle = r.color, e.fillText(c, s + labelOutSize - 4, u + 3), s += 22;
|
|
639
505
|
}
|
|
640
506
|
if (l != null && l.length) {
|
|
641
507
|
e.font = "12px map-iconfont", e.fillStyle = "#3370ff";
|
|
642
|
-
let
|
|
643
|
-
l.forEach((
|
|
644
|
-
let f = getIconFont(
|
|
645
|
-
e.fillText(f,
|
|
508
|
+
let c = e.measureText(n).width + 6;
|
|
509
|
+
l.forEach((m, d) => {
|
|
510
|
+
let f = getIconFont(m), g = 20 * d;
|
|
511
|
+
e.fillText(f, s + c + g, u);
|
|
646
512
|
});
|
|
647
513
|
}
|
|
648
|
-
e.font =
|
|
514
|
+
e.font = i || labelFont, e.fillStyle = a, e.fillText(n, s, u), e.restore();
|
|
649
515
|
}, drawPolygon = (e, t) => {
|
|
650
516
|
let {
|
|
651
517
|
points: o,
|
|
@@ -653,33 +519,33 @@ const drawText = (e, t) => {
|
|
|
653
519
|
fillColor: a,
|
|
654
520
|
shouldClosePath: r,
|
|
655
521
|
translation: l,
|
|
656
|
-
rotation:
|
|
657
|
-
rotationCenter:
|
|
658
|
-
scale:
|
|
659
|
-
globalAlpha:
|
|
522
|
+
rotation: i,
|
|
523
|
+
rotationCenter: s,
|
|
524
|
+
scale: u,
|
|
525
|
+
globalAlpha: c
|
|
660
526
|
} = t;
|
|
661
|
-
if (
|
|
662
|
-
e.save(), e.beginPath(),
|
|
663
|
-
for (let
|
|
664
|
-
e.lineTo(o[
|
|
665
|
-
r && e.closePath(), n && (e.strokeStyle = n, e.stroke()), a && r && (
|
|
527
|
+
if (c || (c = 1), o && e) {
|
|
528
|
+
e.save(), e.beginPath(), i && i !== 0 && s == null && e.rotate(i), l && e.translate(l[0], l[1]), i && (s != null && s.length) && e.rotate(i), u && e.scale(u, u), e.moveTo(o[0][0], o[0][1]);
|
|
529
|
+
for (let m = 1; m < o.length; m++)
|
|
530
|
+
e.lineTo(o[m][0], o[m][1]);
|
|
531
|
+
r && e.closePath(), n && (e.strokeStyle = n, e.stroke()), a && r && (c && (e.globalAlpha = c), e.fillStyle = a, e.fill()), e.restore();
|
|
666
532
|
}
|
|
667
533
|
}, drawLabel = (e, t) => {
|
|
668
|
-
const { center: o, text: n, color: a, textColor: r, bgColor: l, leftIcon:
|
|
534
|
+
const { center: o, text: n, color: a, textColor: r, bgColor: l, leftIcon: i, rightIcons: s } = t;
|
|
669
535
|
if (o && n) {
|
|
670
|
-
let
|
|
536
|
+
let u = {
|
|
671
537
|
font: labelFont,
|
|
672
538
|
labelOutSize,
|
|
673
539
|
labelHeight,
|
|
674
540
|
center: o,
|
|
675
541
|
text: n,
|
|
676
|
-
leftIcon:
|
|
677
|
-
},
|
|
678
|
-
if (
|
|
679
|
-
const { x:
|
|
680
|
-
let
|
|
681
|
-
labels.value.push(
|
|
682
|
-
points: [o,
|
|
542
|
+
leftIcon: i
|
|
543
|
+
}, c = drawLabelBody(e, labels.value, u);
|
|
544
|
+
if (c) {
|
|
545
|
+
const { x: m, bounds: d, l: f } = c;
|
|
546
|
+
let g = [getTopLeftPoint(d), getBottomLeftPoint(d), getBottomRightPoint(d), getTopRighttPoint(d)];
|
|
547
|
+
labels.value.push(c), drawPolygon(e, {
|
|
548
|
+
points: [o, m],
|
|
683
549
|
strokeColor: a,
|
|
684
550
|
fillColor: "#000",
|
|
685
551
|
shouldClosePath: !0,
|
|
@@ -688,89 +554,213 @@ const drawText = (e, t) => {
|
|
|
688
554
|
rotationCenter: void 0,
|
|
689
555
|
scale: void 0,
|
|
690
556
|
globalAlpha: labelAlpha
|
|
691
|
-
}),
|
|
692
|
-
|
|
557
|
+
}), s != null && s.length && s.forEach(() => {
|
|
558
|
+
g[1][0] += 20, g[2][0] += 20;
|
|
693
559
|
}), drawPolygon(e, {
|
|
694
|
-
points:
|
|
560
|
+
points: g,
|
|
695
561
|
strokeColor: a,
|
|
696
562
|
fillColor: l,
|
|
697
563
|
shouldClosePath: !0
|
|
698
564
|
});
|
|
699
|
-
const [L, E] = f,
|
|
565
|
+
const [L, E] = f, b = {
|
|
700
566
|
center: [L, E + labelOutSize + labelHeight + 1],
|
|
701
567
|
text: n,
|
|
702
568
|
textColor: r,
|
|
703
|
-
leftIcon:
|
|
704
|
-
rightIcons:
|
|
569
|
+
leftIcon: i,
|
|
570
|
+
rightIcons: s
|
|
705
571
|
};
|
|
706
|
-
drawText(e,
|
|
572
|
+
drawText(e, b);
|
|
707
573
|
}
|
|
708
574
|
}
|
|
709
575
|
return null;
|
|
710
|
-
},
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
576
|
+
}, stopIcon = "", stopColor = "#E31818", slowIcon = "", slowColor = "#1890FF", dropletsIcon = "", trackList$1 = ref([]);
|
|
577
|
+
let animationFeature, animationId;
|
|
578
|
+
const renderTrackLine = (e, t, o) => {
|
|
579
|
+
var r, l;
|
|
580
|
+
const n = e[t];
|
|
581
|
+
if (!n) return;
|
|
582
|
+
(r = trackLineVectorSource.value) == null || r.clear(), trackList$1.value = [], trackList$1.value = n.reverse().map((i, s) => (i.center = [i.lon, i.lat], i.centerPoint = lonLatToMercator(i.center), i.id = t, i.index = s, i.time = hooks(i.createdAt).format("YYYY-MM-DD HH:mm:ss"), i));
|
|
583
|
+
let a = trackList$1.value.map((i) => i.centerPoint);
|
|
584
|
+
if (a.length >= 2) {
|
|
585
|
+
let i = new LineString(a);
|
|
586
|
+
const s = new Feature({ geometry: i });
|
|
587
|
+
s.setStyle(
|
|
588
|
+
new Style({
|
|
589
|
+
stroke: new Stroke({
|
|
590
|
+
color: o,
|
|
591
|
+
width: 2
|
|
592
|
+
})
|
|
593
|
+
})
|
|
594
|
+
), s.setId(t), s.set("type", "line");
|
|
595
|
+
const u = shipTrackLineFeatures.value.findIndex((m) => m.getId() === t);
|
|
596
|
+
u >= 0 ? shipTrackLineFeatures.value[u] = s : shipTrackLineFeatures.value.push(s);
|
|
597
|
+
const c = createAnimatedIconFeature(o, a);
|
|
598
|
+
trackLineVectorSource.value = new VectorSource({
|
|
599
|
+
features: [...shipTrackLineFeatures.value, c]
|
|
600
|
+
}), animationFeature = c, shipTrackVectorLayer.value = new VectorLayer({
|
|
601
|
+
source: trackLineVectorSource.value
|
|
602
|
+
}), setTimeout(() => {
|
|
603
|
+
renderPoint(o);
|
|
604
|
+
}, 500), (l = mapInstance.value) == null || l.addLayer(shipTrackVectorLayer.value);
|
|
605
|
+
}
|
|
606
|
+
}, handlePlay = (e) => {
|
|
607
|
+
const t = trackLineVectorSource.value.getFeatures().filter((o) => {
|
|
608
|
+
var n;
|
|
609
|
+
return !!((n = o.get("data")) != null && n.lon);
|
|
610
|
+
}).map((o) => lonLatToMercator([o.get("data").lon, o.get("data").lat]));
|
|
611
|
+
startAnimation(t);
|
|
612
|
+
}, createAnimatedIconFeature = (e, t) => {
|
|
613
|
+
const o = new Feature({
|
|
614
|
+
geometry: new Point(fromLonLat([t[0][0], t[0][1]]))
|
|
615
|
+
// 初始位置
|
|
616
|
+
}), n = new Style({
|
|
617
|
+
text: new Text({
|
|
618
|
+
font: "700 14px map-iconfont",
|
|
619
|
+
text: getIconFont(""),
|
|
620
|
+
fill: new Fill({ color: e })
|
|
621
|
+
})
|
|
622
|
+
});
|
|
623
|
+
return o.setStyle(n), o;
|
|
624
|
+
}, startAnimation = (e) => {
|
|
625
|
+
if (!animationFeature || !(e != null && e.length)) return;
|
|
626
|
+
let t = 0;
|
|
627
|
+
const o = e.length;
|
|
628
|
+
function n() {
|
|
629
|
+
if (t < o) {
|
|
630
|
+
const [a, r] = e[t];
|
|
631
|
+
animationFeature.getGeometry().setCoordinates(fromLonLat([a, r])), t++, animationId = requestAnimationFrame(n);
|
|
632
|
+
} else
|
|
633
|
+
cancelAnimationFrame(animationId), t = 0, startAnimation();
|
|
634
|
+
}
|
|
635
|
+
n();
|
|
636
|
+
}, renderPoint = (e) => {
|
|
637
|
+
if (!mapInstance.value) return;
|
|
638
|
+
let t = trackList$1.value || [];
|
|
639
|
+
if (!(t && t.length > 2)) return [];
|
|
640
|
+
let o = { 16: 24, 17: 15, default: 4 }, n = [], a = t.length;
|
|
641
|
+
for (let i = 0; i < a; i++) {
|
|
642
|
+
t[i].index = i;
|
|
643
|
+
let s = mapInstance.value.getPixelFromCoordinate(t[i].centerPoint);
|
|
644
|
+
if (s) {
|
|
645
|
+
let u = s.concat(s);
|
|
646
|
+
u = adjustBounds(u, [20, 20]);
|
|
647
|
+
let c = mapInstance.value.getView().getZoom();
|
|
648
|
+
if (!c) return;
|
|
649
|
+
if (c > 15) {
|
|
650
|
+
let d = o[c] || o.default;
|
|
651
|
+
u = adjustBounds(u, [d, d]);
|
|
652
|
+
}
|
|
653
|
+
let m = !0;
|
|
654
|
+
if (t[i].state !== "0") {
|
|
655
|
+
for (let d = 0; d < n.length; d++)
|
|
656
|
+
if (isOverlapping(u, n[d].bounds)) {
|
|
657
|
+
m = !1;
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
m && (t[i].bounds = u, n.push(t[i]));
|
|
744
662
|
}
|
|
745
|
-
const g = dotImage;
|
|
746
|
-
l.drawImage(g, i + c / 2 - 90, d, 50 / s, 50 / s), l.restore();
|
|
747
663
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
664
|
+
const r = getIconStyle(stopIcon), l = getIconStyle(slowIcon);
|
|
665
|
+
n.forEach((i) => {
|
|
666
|
+
var c, m;
|
|
667
|
+
let s = new Feature({
|
|
668
|
+
geometry: new Point(i.centerPoint)
|
|
669
|
+
});
|
|
670
|
+
s.set("type", "track_point"), s.set("data", i), s.setStyle(
|
|
671
|
+
new Style({
|
|
672
|
+
image: new CircleStyle({
|
|
673
|
+
fill: new Fill({ color: e }),
|
|
674
|
+
stroke: new Stroke({ color: "#fff", width: 2 }),
|
|
675
|
+
radius: 3
|
|
676
|
+
})
|
|
677
|
+
})
|
|
678
|
+
), trackLineVectorSource.value.addFeature(s);
|
|
679
|
+
const u = new Feature({
|
|
680
|
+
geometry: new Point(fromLonLat(i.center))
|
|
681
|
+
});
|
|
682
|
+
if (u.set("type", "track_label"), u.setStyle(
|
|
683
|
+
setTrackLabelStyle(i, e)
|
|
684
|
+
), console.log("trackLabelFeature"), trackLineVectorSource.value.addFeature(u), typeof i == "object" && i.hasOwnProperty("state")) {
|
|
685
|
+
let d = new Feature({
|
|
686
|
+
geometry: new Point(i.centerPoint)
|
|
756
687
|
});
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
688
|
+
d.set("type", "track_icon");
|
|
689
|
+
let f = new Style({
|
|
690
|
+
text: new Text({
|
|
691
|
+
font: "Normal 22px map-iconfont",
|
|
692
|
+
text: getIconFont(dropletsIcon),
|
|
693
|
+
offsetY: -10
|
|
694
|
+
}),
|
|
695
|
+
zIndex: 99
|
|
696
|
+
}), g = [];
|
|
697
|
+
i.state === "0" ? ((c = f.getText()) == null || c.setFill(new Fill({ color: stopColor })), g.push(r)) : ((m = f.getText()) == null || m.setFill(new Fill({ color: slowColor })), g.push(l)), g.push(f), d.setStyle(g), trackLineVectorSource.value.addFeature(d);
|
|
698
|
+
}
|
|
699
|
+
}), renderArrow(n, e), renderIconPoint();
|
|
700
|
+
}, renderArrow = (e, t) => {
|
|
701
|
+
const o = e.length;
|
|
702
|
+
o || (e.push(trackList$1.value[0]), e.push(trackList$1.value[trackList$1.value.length - 1]));
|
|
703
|
+
for (let n = 0; n < o - 1; n++) {
|
|
704
|
+
let a, r = e[n], l = (e[n + 1].index + r.index) / 2;
|
|
705
|
+
if (l % 2 === 0)
|
|
706
|
+
a = trackList$1.value[l].centerPoint;
|
|
707
|
+
else {
|
|
708
|
+
let i = trackList$1.value[Math.floor(l)], s = trackList$1.value[Math.ceil(l)];
|
|
709
|
+
if (i && s) {
|
|
710
|
+
let [u, c] = i.centerPoint, [m, d] = s.centerPoint;
|
|
711
|
+
a = [(u + m) / 2, (c + d) / 2];
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
if (a) {
|
|
715
|
+
let i = new Feature({
|
|
716
|
+
geometry: new Point(a)
|
|
763
717
|
});
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
718
|
+
i.set("type", "track_arrow"), i.setStyle(
|
|
719
|
+
new Style({
|
|
720
|
+
text: new Text({
|
|
721
|
+
font: "700 14px map-iconfont",
|
|
722
|
+
text: getIconFont(""),
|
|
723
|
+
fill: new Fill({ color: t }),
|
|
724
|
+
rotation: getAngle(
|
|
725
|
+
e[n].center,
|
|
726
|
+
e[n + 1].center
|
|
727
|
+
)
|
|
728
|
+
})
|
|
729
|
+
})
|
|
730
|
+
), trackLineVectorSource.value.addFeature(i);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}, renderIconPoint = () => {
|
|
734
|
+
const e = "", t = "#fcdc3f", o = "#ff0000";
|
|
735
|
+
(trackList$1.value.length < 2 ? [trackList$1.value[0]] : [trackList$1.value[0], trackList$1.value[trackList$1.value.length - 1]]).forEach((a) => {
|
|
736
|
+
let r = new Feature({
|
|
737
|
+
geometry: new Point(a.centerPoint)
|
|
738
|
+
});
|
|
739
|
+
r.set("type", "track_begin"), r.set("data", a);
|
|
740
|
+
const l = a.index === 0 && trackList$1.value.length >= 2 ? t : o;
|
|
741
|
+
r.setStyle(
|
|
742
|
+
new Style({
|
|
743
|
+
text: new Text({
|
|
744
|
+
font: "Normal 14px map-iconfont",
|
|
745
|
+
text: getIconFont(e),
|
|
746
|
+
fill: new Fill({ color: l })
|
|
747
|
+
}),
|
|
748
|
+
zIndex: 101
|
|
749
|
+
})
|
|
750
|
+
), trackLineVectorSource.value.addFeature(r);
|
|
751
|
+
});
|
|
752
|
+
}, setTrackLabelStyle = (e, t) => new Style({
|
|
753
|
+
renderer: (o, n) => {
|
|
754
|
+
const a = n.context, i = {
|
|
755
|
+
center: o,
|
|
756
|
+
text: e.time,
|
|
757
|
+
color: t,
|
|
758
|
+
textColor: "#000",
|
|
759
|
+
bgColor: "rgba(255,255,255,.8)"
|
|
760
|
+
};
|
|
761
|
+
drawLabel(a, i);
|
|
762
|
+
}
|
|
763
|
+
}), triangleModel = multiplyPixelRatio([
|
|
774
764
|
[0, -8],
|
|
775
765
|
[5, 8],
|
|
776
766
|
[-5, 8]
|
|
@@ -849,40 +839,40 @@ const renderTrucksMarker = (e) => {
|
|
|
849
839
|
const n = mapInstance.value.getView().getZoom();
|
|
850
840
|
if (!n) return;
|
|
851
841
|
let a = [];
|
|
852
|
-
const [r, l] = drawShipModelByZoom[n] || [0, 0], [
|
|
842
|
+
const [r, l] = drawShipModelByZoom[n] || [0, 0], [i, s] = o;
|
|
853
843
|
if (n <= mapZoom.shipModelMax && n > mapZoom.shipModelMin && t.length >= r && t.breadth >= l)
|
|
854
|
-
a = rotateShapeModel(drawCurrentShipShapeModel(t, n), t.angle).map((
|
|
855
|
-
const [
|
|
856
|
-
return [
|
|
844
|
+
a = rotateShapeModel(drawCurrentShipShapeModel(t, n), t.angle).map((c) => {
|
|
845
|
+
const [m, d] = c;
|
|
846
|
+
return [i + m, s + d];
|
|
857
847
|
});
|
|
858
848
|
else {
|
|
859
|
-
const
|
|
860
|
-
o.length === 2 && (a =
|
|
861
|
-
const [
|
|
862
|
-
return [
|
|
849
|
+
const u = rotateShapeModel(triangleModel, t.angle);
|
|
850
|
+
o.length === 2 && (a = u.map((c) => {
|
|
851
|
+
const [m, d] = c;
|
|
852
|
+
return [i + m, s + d];
|
|
863
853
|
}));
|
|
864
854
|
}
|
|
865
855
|
if (!(a.length > 2)) return !1;
|
|
866
856
|
e.save(), e.beginPath(), e.moveTo(a[0][0], a[0][1]);
|
|
867
|
-
for (let
|
|
868
|
-
e.lineTo(a[
|
|
857
|
+
for (let u = 1; u < a.length; u++)
|
|
858
|
+
e.lineTo(a[u][0], a[u][1]);
|
|
869
859
|
return e.closePath(), e.strokeStyle = "#000", e.lineWidth = 1, e.stroke(), e.fillStyle = t.fill, e.fill(), e.restore(), a;
|
|
870
860
|
}, drawHeading = (e, t, o) => {
|
|
871
861
|
const [n, a] = o[0], r = getShipDirectPath(t);
|
|
872
862
|
if (r) {
|
|
873
|
-
let l = r.map(function(
|
|
874
|
-
let [
|
|
875
|
-
return [
|
|
863
|
+
let l = r.map(function(i) {
|
|
864
|
+
let [s, u] = i;
|
|
865
|
+
return [s + n, u + a];
|
|
876
866
|
});
|
|
877
867
|
if (e.save(), e.beginPath(), t.angle > 0) {
|
|
878
868
|
e.translate(n, a);
|
|
879
|
-
const
|
|
880
|
-
e.rotate(
|
|
869
|
+
const i = t.angle * Math.PI / 180;
|
|
870
|
+
e.rotate(i), e.translate(-n, -a);
|
|
881
871
|
}
|
|
882
872
|
e.moveTo(n, a);
|
|
883
|
-
for (let
|
|
884
|
-
let [
|
|
885
|
-
e.lineTo(
|
|
873
|
+
for (let i = 1; i < l.length; i++) {
|
|
874
|
+
let [s, u] = l[i];
|
|
875
|
+
e.lineTo(s, u);
|
|
886
876
|
}
|
|
887
877
|
e.strokeStyle = "#000", e.lineWidth = 1, e.stroke(), e.restore();
|
|
888
878
|
}
|
|
@@ -890,34 +880,34 @@ const renderTrucksMarker = (e) => {
|
|
|
890
880
|
let [o, n, a, r] = getPixelFromCoordinate(t);
|
|
891
881
|
const l = 4;
|
|
892
882
|
o -= l, n -= l, a += l, r += l, e.save(), e.strokeStyle = "#ff0000", e.lineWidth = 4;
|
|
893
|
-
const
|
|
894
|
-
e.beginPath(), e.moveTo(o +
|
|
883
|
+
const i = 8;
|
|
884
|
+
e.beginPath(), e.moveTo(o + i, r), e.lineTo(o, r), e.lineTo(o, r - i), e.moveTo(o, n + i), e.lineTo(o, n), e.lineTo(o + i, n), e.moveTo(a - i, n), e.lineTo(a, n), e.lineTo(a, n + i), e.moveTo(a, r - i), e.lineTo(a, r), e.lineTo(a - i, r), e.stroke(), e.restore();
|
|
895
885
|
}, drawShipLabel = (e, t, o) => {
|
|
896
|
-
const [n, a] = o, r = n - 0, l = a - 0,
|
|
897
|
-
let
|
|
898
|
-
t.leftIconColor && (
|
|
899
|
-
let
|
|
886
|
+
const [n, a] = o, r = n - 0, l = a - 0, i = t.name;
|
|
887
|
+
let s;
|
|
888
|
+
t.leftIconColor && (s = { color: t.leftIconColor, icon: "" });
|
|
889
|
+
let u = getShipCustomIcon(t);
|
|
900
890
|
drawLabel(e, {
|
|
901
891
|
center: [r, l],
|
|
902
|
-
text:
|
|
892
|
+
text: i,
|
|
903
893
|
color: "#fff",
|
|
904
894
|
textColor: "#000",
|
|
905
895
|
bgColor: "#fff",
|
|
906
|
-
leftIcon:
|
|
907
|
-
rightIcons:
|
|
896
|
+
leftIcon: s,
|
|
897
|
+
rightIcons: u
|
|
908
898
|
});
|
|
909
899
|
}, drawCurrentShipShapeModel = (e, t) => {
|
|
910
900
|
let o = 0;
|
|
911
901
|
t === 17 ? o = 0.425 : t === 18 && (o = 0.857);
|
|
912
902
|
const n = e.length / 4 * o, a = e.breadth * o;
|
|
913
903
|
let r = cloneDeep(shipShapeModel);
|
|
914
|
-
return r = r.map(([l,
|
|
904
|
+
return r = r.map(([l, i]) => [l * a, i * n]), r;
|
|
915
905
|
}, getShipDirectPath = (e) => {
|
|
916
906
|
let { speed: t, hdg: o, cog: n } = e, a = "", r = null;
|
|
917
907
|
if (t && t > 1 && (o !== null && o != 511 && n !== null ? n - o >= 3 ? a = "left" : n - o <= -3 ? a = "right" : a = "front" : a = "front", a && t))
|
|
918
908
|
for (let l in speedCondition) {
|
|
919
|
-
let
|
|
920
|
-
if (t >=
|
|
909
|
+
let i = speedCondition[l];
|
|
910
|
+
if (t >= i[0] && t < i[1]) {
|
|
921
911
|
r = shipDirectPath[a][l];
|
|
922
912
|
break;
|
|
923
913
|
}
|
|
@@ -997,7 +987,7 @@ const renderShips = (e) => {
|
|
|
997
987
|
let t = cloneDeep(e);
|
|
998
988
|
return t = t.filter((o) => {
|
|
999
989
|
var a, r, l;
|
|
1000
|
-
let n = getFilterItem(o).every(({ btnShow:
|
|
990
|
+
let n = getFilterItem(o).every(({ btnShow: i, value: s }) => i ? !!s : !0);
|
|
1001
991
|
return switchBtnShow.value.camera || switchBtnShow.value.mobile || switchBtnShow.value.waterGauge ? ((a = selectedShipData.value) == null ? void 0 : a.id) === o.id && clearSelectFeature() : (r = selectedShipData.value) != null && r.id && findShip((l = selectedShipData.value) == null ? void 0 : l.id, selectedShipData.value, !1), n;
|
|
1002
992
|
}), t;
|
|
1003
993
|
}, getFilterItem = (e) => [
|
|
@@ -1025,11 +1015,11 @@ const renderShips = (e) => {
|
|
|
1025
1015
|
source: selectShipsVectorSource
|
|
1026
1016
|
}), mapInstance.value.addLayer(selectShipsLayer.value), selectShipsLayer.value.setVisible(!0), selectShipsLayer.value;
|
|
1027
1017
|
}, findShip = (e, t, o = !0) => {
|
|
1028
|
-
var a, r, l,
|
|
1018
|
+
var a, r, l, i, s;
|
|
1029
1019
|
if (!e || !mapInstance.value) return;
|
|
1030
|
-
const n = (l = (r = (a = shipsLayer.value) == null ? void 0 : a.getSource()) == null ? void 0 : r.getFeatures()) == null ? void 0 : l.find((
|
|
1031
|
-
var
|
|
1032
|
-
return ((
|
|
1020
|
+
const n = (l = (r = (a = shipsLayer.value) == null ? void 0 : a.getSource()) == null ? void 0 : r.getFeatures()) == null ? void 0 : l.find((u) => {
|
|
1021
|
+
var c;
|
|
1022
|
+
return ((c = u.get("data")) == null ? void 0 : c.id) === e;
|
|
1033
1023
|
});
|
|
1034
1024
|
if (n)
|
|
1035
1025
|
selectedShipData.value = n;
|
|
@@ -1039,11 +1029,11 @@ const renderShips = (e) => {
|
|
|
1039
1029
|
console.error("找不到船舶");
|
|
1040
1030
|
return;
|
|
1041
1031
|
}
|
|
1042
|
-
if (selectSingleShipMarker(t), o && ((
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1032
|
+
if (selectSingleShipMarker(t), o && ((i = selectedShipData.value) != null && i.lon) && ((s = selectedShipData.value) != null && s.lat)) {
|
|
1033
|
+
const u = mapInstance.value.getView(), c = new Point([selectedShipData.value.lon, selectedShipData.value.lat]);
|
|
1034
|
+
u.setCenter(transform(c.getCoordinates(), projection.data, projection.mercator));
|
|
1035
|
+
const m = u.getZoom(), d = m < mapZoom.findShip ? mapZoom.findShip : m;
|
|
1036
|
+
u.setZoom(d);
|
|
1047
1037
|
}
|
|
1048
1038
|
return n;
|
|
1049
1039
|
}, clearSelectFeature = () => {
|
|
@@ -1064,199 +1054,313 @@ const renderShips = (e) => {
|
|
|
1064
1054
|
switchBtnShow.value[e] = t, renderShips(allShips.value);
|
|
1065
1055
|
}, rerenderShip = () => {
|
|
1066
1056
|
renderShips(allShips.value);
|
|
1067
|
-
},
|
|
1068
|
-
var r, l;
|
|
1069
|
-
const n = e[t];
|
|
1070
|
-
if (!n) return;
|
|
1071
|
-
(r = trackLineVectorSource.value) == null || r.clear(), trackList$1.value = [], trackList$1.value = n.reverse().map((s, i) => (s.center = [s.lon, s.lat], s.centerPoint = lonLatToMercator(s.center), s.id = t, s.index = i, s.time = hooks(s.createdAt).format("YYYY-MM-DD HH:mm:ss"), s));
|
|
1072
|
-
let a = trackList$1.value.map((s) => s.centerPoint);
|
|
1073
|
-
if (a.length >= 2) {
|
|
1074
|
-
let s = new LineString(a);
|
|
1075
|
-
const i = new Feature({ geometry: s });
|
|
1076
|
-
i.setStyle(
|
|
1077
|
-
new Style({
|
|
1078
|
-
stroke: new Stroke({
|
|
1079
|
-
color: o,
|
|
1080
|
-
width: 2
|
|
1081
|
-
})
|
|
1082
|
-
})
|
|
1083
|
-
), i.setId(t), i.set("type", "line");
|
|
1084
|
-
const d = shipTrackLineFeatures.value.findIndex((u) => u.getId() === t);
|
|
1085
|
-
d >= 0 ? shipTrackLineFeatures.value[d] = i : shipTrackLineFeatures.value.push(i), trackLineVectorSource.value = new VectorSource({
|
|
1086
|
-
features: shipTrackLineFeatures.value
|
|
1087
|
-
}), shipTrackVectorLayer.value = new VectorLayer({
|
|
1088
|
-
source: trackLineVectorSource.value
|
|
1089
|
-
}), setTimeout(() => {
|
|
1090
|
-
renderPoint(o);
|
|
1091
|
-
}, 500), (l = mapInstance.value) == null || l.addLayer(shipTrackVectorLayer.value);
|
|
1092
|
-
}
|
|
1093
|
-
}, renderPoint = (e) => {
|
|
1094
|
-
if (!mapInstance.value) return;
|
|
1095
|
-
let t = trackList$1.value || [];
|
|
1096
|
-
if (!(t && t.length > 2)) return [];
|
|
1097
|
-
let o = { 16: 24, 17: 15, default: 4 }, n = [], a = t.length;
|
|
1098
|
-
for (let s = 0; s < a; s++) {
|
|
1099
|
-
t[s].index = s;
|
|
1100
|
-
let i = mapInstance.value.getPixelFromCoordinate(t[s].centerPoint);
|
|
1101
|
-
if (i) {
|
|
1102
|
-
let d = i.concat(i);
|
|
1103
|
-
d = adjustBounds(d, [20, 20]);
|
|
1104
|
-
let u = mapInstance.value.getView().getZoom();
|
|
1105
|
-
if (!u) return;
|
|
1106
|
-
if (u > 15) {
|
|
1107
|
-
let c = o[u] || o.default;
|
|
1108
|
-
d = adjustBounds(d, [c, c]);
|
|
1109
|
-
}
|
|
1110
|
-
let p = !0;
|
|
1111
|
-
if (t[s].state !== "0") {
|
|
1112
|
-
for (let c = 0; c < n.length; c++)
|
|
1113
|
-
if (isOverlapping(d, n[c].bounds)) {
|
|
1114
|
-
p = !1;
|
|
1115
|
-
break;
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
p && (t[s].bounds = d, n.push(t[s]));
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
const r = getIconStyle(stopIcon), l = getIconStyle(slowIcon);
|
|
1122
|
-
n.forEach((s) => {
|
|
1123
|
-
var u, p;
|
|
1124
|
-
let i = new Feature({
|
|
1125
|
-
geometry: new Point(s.centerPoint)
|
|
1126
|
-
});
|
|
1127
|
-
i.set("type", "track_point"), i.set("data", s), i.setStyle(
|
|
1128
|
-
new Style({
|
|
1129
|
-
image: new CircleStyle({
|
|
1130
|
-
fill: new Fill({ color: e }),
|
|
1131
|
-
stroke: new Stroke({ color: "#fff", width: 2 }),
|
|
1132
|
-
radius: 3
|
|
1133
|
-
})
|
|
1134
|
-
})
|
|
1135
|
-
), trackLineVectorSource.value.addFeature(i);
|
|
1136
|
-
const d = new Feature({
|
|
1137
|
-
geometry: new Point(fromLonLat(s.center))
|
|
1138
|
-
});
|
|
1139
|
-
if (d.set("type", "track_label"), d.setStyle(
|
|
1140
|
-
setTrackLabelStyle(s, e)
|
|
1141
|
-
), console.log("trackLabelFeature"), trackLineVectorSource.value.addFeature(d), typeof s == "object" && s.hasOwnProperty("state")) {
|
|
1142
|
-
let c = new Feature({
|
|
1143
|
-
geometry: new Point(s.centerPoint)
|
|
1144
|
-
});
|
|
1145
|
-
c.set("type", "track_icon");
|
|
1146
|
-
let f = new Style({
|
|
1147
|
-
text: new Text({
|
|
1148
|
-
font: "Normal 22px map-iconfont",
|
|
1149
|
-
text: getIconFont(dropletsIcon),
|
|
1150
|
-
offsetY: -10
|
|
1151
|
-
}),
|
|
1152
|
-
zIndex: 99
|
|
1153
|
-
}), v = [];
|
|
1154
|
-
s.state === "0" ? ((u = f.getText()) == null || u.setFill(new Fill({ color: stopColor })), v.push(r)) : ((p = f.getText()) == null || p.setFill(new Fill({ color: slowColor })), v.push(l)), v.push(f), c.setStyle(v), trackLineVectorSource.value.addFeature(c);
|
|
1155
|
-
}
|
|
1156
|
-
}), renderArrow(n, e), renderIconPoint();
|
|
1157
|
-
}, renderArrow = (e, t) => {
|
|
1158
|
-
const o = e.length;
|
|
1159
|
-
o || (e.push(trackList$1.value[0]), e.push(trackList$1.value[trackList$1.value.length - 1]));
|
|
1160
|
-
for (let n = 0; n < o - 1; n++) {
|
|
1161
|
-
let a, r = e[n], l = (e[n + 1].index + r.index) / 2;
|
|
1162
|
-
if (l % 2 === 0)
|
|
1163
|
-
a = trackList$1.value[l].centerPoint;
|
|
1164
|
-
else {
|
|
1165
|
-
let s = trackList$1.value[Math.floor(l)], i = trackList$1.value[Math.ceil(l)];
|
|
1166
|
-
if (s && i) {
|
|
1167
|
-
let [d, u] = s.centerPoint, [p, c] = i.centerPoint;
|
|
1168
|
-
a = [(d + p) / 2, (u + c) / 2];
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
if (a) {
|
|
1172
|
-
let s = new Feature({
|
|
1173
|
-
geometry: new Point(a)
|
|
1174
|
-
});
|
|
1175
|
-
s.set("type", "track_arrow"), s.setStyle(
|
|
1176
|
-
new Style({
|
|
1177
|
-
text: new Text({
|
|
1178
|
-
font: "700 14px map-iconfont",
|
|
1179
|
-
text: getIconFont(""),
|
|
1180
|
-
fill: new Fill({ color: t }),
|
|
1181
|
-
rotation: getAngle(
|
|
1182
|
-
e[n].center,
|
|
1183
|
-
e[n + 1].center
|
|
1184
|
-
)
|
|
1185
|
-
})
|
|
1186
|
-
})
|
|
1187
|
-
), trackLineVectorSource.value.addFeature(s);
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
}, renderIconPoint = () => {
|
|
1191
|
-
const e = "", t = "#fcdc3f", o = "#ff0000";
|
|
1192
|
-
(trackList$1.value.length < 2 ? [trackList$1.value[0]] : [trackList$1.value[0], trackList$1.value[trackList$1.value.length - 1]]).forEach((a) => {
|
|
1193
|
-
let r = new Feature({
|
|
1194
|
-
geometry: new Point(a.centerPoint)
|
|
1195
|
-
});
|
|
1196
|
-
r.set("type", "track_begin"), r.set("data", a);
|
|
1197
|
-
const l = a.index === 0 && trackList$1.value.length >= 2 ? t : o;
|
|
1198
|
-
r.setStyle(
|
|
1199
|
-
new Style({
|
|
1200
|
-
text: new Text({
|
|
1201
|
-
font: "Normal 14px map-iconfont",
|
|
1202
|
-
text: getIconFont(e),
|
|
1203
|
-
fill: new Fill({ color: l })
|
|
1204
|
-
}),
|
|
1205
|
-
zIndex: 101
|
|
1206
|
-
})
|
|
1207
|
-
), trackLineVectorSource.value.addFeature(r);
|
|
1208
|
-
});
|
|
1209
|
-
}, setTrackLabelStyle = (e, t) => new Style({
|
|
1210
|
-
renderer: (o, n) => {
|
|
1211
|
-
const a = n.context, s = {
|
|
1212
|
-
center: o,
|
|
1213
|
-
text: e.time,
|
|
1214
|
-
color: t,
|
|
1215
|
-
textColor: "#000",
|
|
1216
|
-
bgColor: "rgba(255,255,255,.8)"
|
|
1217
|
-
};
|
|
1218
|
-
drawLabel(a, s);
|
|
1219
|
-
}
|
|
1220
|
-
}), showTracks = ref([]), trackList = ref([]);
|
|
1057
|
+
}, showTracks = ref([]), trackList = ref([]);
|
|
1221
1058
|
ref(null);
|
|
1222
1059
|
const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship") => {
|
|
1223
|
-
var
|
|
1060
|
+
var c;
|
|
1224
1061
|
if (nextTick(() => {
|
|
1225
1062
|
hiddenAllShips();
|
|
1226
|
-
}).then((
|
|
1063
|
+
}).then((m) => {
|
|
1227
1064
|
}), (t == null ? void 0 : t.length) < 2) {
|
|
1228
|
-
((
|
|
1065
|
+
((c = showTracks.value) == null ? void 0 : c.findIndex((m) => m.id === e)) < 0 && showTracks.value.push({ id: e, length: "" });
|
|
1229
1066
|
return;
|
|
1230
1067
|
}
|
|
1231
1068
|
let r = {};
|
|
1232
|
-
t.forEach((
|
|
1233
|
-
|
|
1069
|
+
t.forEach((m) => {
|
|
1070
|
+
m.state ? m.state = Number(m.state) : delete m.state;
|
|
1234
1071
|
}), trackId.value = e, r[e] = t, trackList.value = t;
|
|
1235
|
-
const l = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"],
|
|
1236
|
-
(
|
|
1237
|
-
),
|
|
1072
|
+
const l = ["#ff0000", "#00ff00", "#0079ff", "#ffa500", "#800080", "#008080", "#ffc0cb", "#800000", "#000080", "#808000"], i = r[e].map(
|
|
1073
|
+
(m) => transform([m.lon, m.lat], projection.data, projection.mercator)
|
|
1074
|
+
), s = new LineString(i), u = formatLength(s, n) || "--";
|
|
1238
1075
|
nextTick(() => {
|
|
1239
|
-
var
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1076
|
+
var d;
|
|
1077
|
+
const m = (d = showTracks.value) == null ? void 0 : d.findIndex((f) => f.id === e);
|
|
1078
|
+
m < 0 ? showTracks.value.push({ id: e, length: u }) : showTracks.value[m].length = u, renderTrackLine(r, e, o), ++cursor.value, cursor.value > l.length && (cursor.value = 0), resetTrackView(e);
|
|
1242
1079
|
}).then(() => {
|
|
1243
1080
|
});
|
|
1244
1081
|
}, removeAllTrackLayer = () => {
|
|
1245
1082
|
var e;
|
|
1246
1083
|
showTracks.value = [], (e = trackLineVectorSource.value) == null || e.clear();
|
|
1084
|
+
}, playTrack = (e, t) => {
|
|
1085
|
+
handlePlay();
|
|
1247
1086
|
}, resetTrackView = (e) => {
|
|
1248
|
-
var
|
|
1249
|
-
const t = mapInstance.value.getView(), o =
|
|
1250
|
-
if (o
|
|
1087
|
+
var a;
|
|
1088
|
+
const t = mapInstance.value.getView(), o = e ? shipTrackLineFeatures.value.find((r) => r.getId() === e) : shipTrackLineFeatures.value[0];
|
|
1089
|
+
if (!o) return;
|
|
1090
|
+
const n = (a = o == null ? void 0 : o.getGeometry()) == null ? void 0 : a.getExtent();
|
|
1091
|
+
if (n != null && n.length)
|
|
1251
1092
|
try {
|
|
1252
|
-
t.fit(
|
|
1093
|
+
t.fit(n);
|
|
1253
1094
|
} catch (r) {
|
|
1254
1095
|
console.log(r);
|
|
1255
1096
|
}
|
|
1097
|
+
}, _hoisted_1$3 = { class: "tool-panel" }, _hoisted_2$1 = {
|
|
1098
|
+
key: 0,
|
|
1099
|
+
class: "more-tool-panel"
|
|
1100
|
+
}, _hoisted_3$1 = { class: "switch-buttons" }, _hoisted_4 = { class: "tool-components" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1101
|
+
__name: "toolPanel",
|
|
1102
|
+
props: {
|
|
1103
|
+
vehicleMode: {},
|
|
1104
|
+
viewMode: {},
|
|
1105
|
+
disableGreenDot: { type: Boolean },
|
|
1106
|
+
showTrackLayer: { type: Boolean }
|
|
1107
|
+
},
|
|
1108
|
+
emits: ["switchGreenDot", "switchMapTile"],
|
|
1109
|
+
setup(e, { emit: t }) {
|
|
1110
|
+
var d, f;
|
|
1111
|
+
const o = t, n = ref(((f = (d = mapInstance.value) == null ? void 0 : d.getView()) == null ? void 0 : f.getZoom()) || mapZoom.default), a = ref(!1), r = ref(null), l = ref(!0), i = () => {
|
|
1112
|
+
l.value = !l.value, o("switchGreenDot", l.value);
|
|
1113
|
+
}, s = ref(BaseMapType.vector), u = () => {
|
|
1114
|
+
s.value = s.value === BaseMapType.vector ? BaseMapType.satellite : BaseMapType.vector, o("switchMapTile", s.value);
|
|
1115
|
+
}, c = () => {
|
|
1116
|
+
var g, p;
|
|
1117
|
+
a.value ? (g = r.value) == null || g.removeInteraction() : (p = r.value) == null || p.addInteraction(), a.value = !a.value;
|
|
1118
|
+
}, m = () => {
|
|
1119
|
+
var g;
|
|
1120
|
+
(g = r.value) == null || g.removeInteraction(), a.value = !1;
|
|
1121
|
+
};
|
|
1122
|
+
return (g, p) => (openBlock(), createElementBlock(Fragment, null, [
|
|
1123
|
+
createElementVNode("div", _hoisted_1$3, [
|
|
1124
|
+
g.viewMode === "WxMiniprogram" ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
1125
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
1126
|
+
g.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1127
|
+
key: 0,
|
|
1128
|
+
class: normalizeClass(["switch-btn", `${a.value && "active"}`]),
|
|
1129
|
+
onClick: c
|
|
1130
|
+
}, p[5] || (p[5] = [
|
|
1131
|
+
createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
|
|
1132
|
+
createElementVNode("div", { class: "button-text" }, "测距", -1)
|
|
1133
|
+
]), 2)) : createCommentVNode("", !0),
|
|
1134
|
+
g.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1135
|
+
key: 1,
|
|
1136
|
+
"<div": "",
|
|
1137
|
+
class: normalizeClass(`switch-btn ${l.value && "active"} ${(g.disableGreenDot || n.value >= unref(mapZoom).shipGreenDotMax) && "disabled"}`),
|
|
1138
|
+
onClick: i
|
|
1139
|
+
}, p[6] || (p[6] = [
|
|
1140
|
+
createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
|
|
1141
|
+
createElementVNode("div", { class: "button-text" }, "绿点", -1)
|
|
1142
|
+
]), 2)) : createCommentVNode("", !0),
|
|
1143
|
+
g.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1144
|
+
key: 2,
|
|
1145
|
+
class: normalizeClass(`switch-btn ${s.value === unref(BaseMapType).vector && "active"}`),
|
|
1146
|
+
onClick: p[0] || (p[0] = (T) => u())
|
|
1147
|
+
}, p[7] || (p[7] = [
|
|
1148
|
+
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1149
|
+
createElementVNode("div", { class: "button-text" }, "图层", -1)
|
|
1150
|
+
]), 2)) : createCommentVNode("", !0),
|
|
1151
|
+
g.vehicleMode === "truck" ? (openBlock(), createElementBlock("div", {
|
|
1152
|
+
key: 3,
|
|
1153
|
+
class: normalizeClass(`switch-btn ${s.value === unref(BaseMapType).satellite && "active"}`),
|
|
1154
|
+
onClick: p[1] || (p[1] = (T) => u())
|
|
1155
|
+
}, p[8] || (p[8] = [
|
|
1156
|
+
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1157
|
+
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
1158
|
+
]), 2)) : createCommentVNode("", !0),
|
|
1159
|
+
g.showTrackLayer ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1160
|
+
createElementVNode("div", {
|
|
1161
|
+
class: "switch-btn multiple",
|
|
1162
|
+
onClick: p[2] || (p[2] = (T) => unref(playTrack)(0, 1))
|
|
1163
|
+
}, p[9] || (p[9] = [
|
|
1164
|
+
createElementVNode("i", { class: "iconfont icon-play" }, null, -1),
|
|
1165
|
+
createElementVNode("div", { class: "button-text" }, "播放轨迹", -1)
|
|
1166
|
+
])),
|
|
1167
|
+
createElementVNode("div", {
|
|
1168
|
+
class: "switch-btn multiple",
|
|
1169
|
+
onClick: p[3] || (p[3] = (T) => unref(resetTrackView)())
|
|
1170
|
+
}, p[10] || (p[10] = [
|
|
1171
|
+
createElementVNode("i", { class: "iconfont icon-center" }, null, -1),
|
|
1172
|
+
createElementVNode("div", { class: "button-text" }, "轨迹居中", -1)
|
|
1173
|
+
]))
|
|
1174
|
+
], 64)) : createCommentVNode("", !0),
|
|
1175
|
+
renderSlot(g.$slots, "toolPanel", {}, void 0, !0)
|
|
1176
|
+
])
|
|
1177
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1178
|
+
g.vehicleMode === "ship" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1179
|
+
createElementVNode("div", {
|
|
1180
|
+
class: normalizeClass(["switch-btn", `${a.value && "active"}`]),
|
|
1181
|
+
onClick: c
|
|
1182
|
+
}, p[11] || (p[11] = [
|
|
1183
|
+
createElementVNode("i", { class: "map-iconfont icon-measure" }, null, -1),
|
|
1184
|
+
createElementVNode("div", { class: "button-text" }, "测距", -1)
|
|
1185
|
+
]), 2),
|
|
1186
|
+
createElementVNode("div", {
|
|
1187
|
+
class: normalizeClass(["switch-btn", { active: l.value }]),
|
|
1188
|
+
onClick: i
|
|
1189
|
+
}, p[12] || (p[12] = [
|
|
1190
|
+
createElementVNode("i", { class: "map-iconfont icon-ship" }, null, -1),
|
|
1191
|
+
createElementVNode("div", { class: "button-text" }, "绿点", -1)
|
|
1192
|
+
]), 2)
|
|
1193
|
+
], 64)) : createCommentVNode("", !0),
|
|
1194
|
+
createElementVNode("div", {
|
|
1195
|
+
class: normalizeClass(["switch-btn", { active: s.value === unref(BaseMapType).satellite }]),
|
|
1196
|
+
onClick: u
|
|
1197
|
+
}, p[13] || (p[13] = [
|
|
1198
|
+
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1199
|
+
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
1200
|
+
]), 2)
|
|
1201
|
+
], 64))
|
|
1202
|
+
]),
|
|
1203
|
+
createElementVNode("div", _hoisted_4, [
|
|
1204
|
+
a.value ? (openBlock(), createBlock(Measure, {
|
|
1205
|
+
key: 0,
|
|
1206
|
+
ref_key: "measureRef",
|
|
1207
|
+
ref: r,
|
|
1208
|
+
visible: a.value,
|
|
1209
|
+
"onUpdate:visible": p[4] || (p[4] = (T) => a.value = T),
|
|
1210
|
+
onClose: m
|
|
1211
|
+
}, null, 8, ["visible"])) : createCommentVNode("", !0)
|
|
1212
|
+
])
|
|
1213
|
+
], 64));
|
|
1214
|
+
}
|
|
1215
|
+
}), ToolPanel = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-ddfa6649"]]), _hoisted_1$2 = { id: "scale-line-container" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1216
|
+
__name: "scaleLine",
|
|
1217
|
+
setup(e, { expose: t }) {
|
|
1218
|
+
const o = new ScaleLine$1({
|
|
1219
|
+
units: "nautical"
|
|
1220
|
+
});
|
|
1221
|
+
return t({
|
|
1222
|
+
setScaleLine: () => {
|
|
1223
|
+
o.setTarget(document.getElementById("scale-line-container")), mapInstance.value.addControl(o);
|
|
1224
|
+
}
|
|
1225
|
+
}), (a, r) => (openBlock(), createElementBlock("div", _hoisted_1$2));
|
|
1226
|
+
}
|
|
1227
|
+
}), ScaleLine = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-e51b19b1"]]), _hoisted_1$1 = { class: "zoom" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1228
|
+
__name: "zoomControl",
|
|
1229
|
+
props: {
|
|
1230
|
+
map: {
|
|
1231
|
+
type: Object
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
setup(e) {
|
|
1235
|
+
const t = () => {
|
|
1236
|
+
if (!mapInstance.value) return;
|
|
1237
|
+
const n = mapInstance.value.getView(), a = n.getZoom();
|
|
1238
|
+
a && n.setZoom(a + 1);
|
|
1239
|
+
}, o = () => {
|
|
1240
|
+
if (!mapInstance.value) return;
|
|
1241
|
+
const n = mapInstance.value.getView(), a = n.getZoom();
|
|
1242
|
+
a && n.setZoom(a - 1);
|
|
1243
|
+
};
|
|
1244
|
+
return (n, a) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1245
|
+
createElementVNode("div", {
|
|
1246
|
+
onClick: t,
|
|
1247
|
+
class: "button big-button"
|
|
1248
|
+
}, "+"),
|
|
1249
|
+
createElementVNode("div", {
|
|
1250
|
+
onClick: o,
|
|
1251
|
+
class: "button small-button"
|
|
1252
|
+
}, "-")
|
|
1253
|
+
]));
|
|
1254
|
+
}
|
|
1255
|
+
}), ZoomControl = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f2b62b21"]]), _hoisted_1 = { class: "copyright" }, _hoisted_2 = { class: "tdt-control-copyright tdt-control" }, _hoisted_3 = ["src"], _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1256
|
+
__name: "copyright",
|
|
1257
|
+
setup(e) {
|
|
1258
|
+
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1259
|
+
createElementVNode("div", _hoisted_2, [
|
|
1260
|
+
createElementVNode("img", {
|
|
1261
|
+
src: unref(CDN_URL) + "map/tdt-logo.png",
|
|
1262
|
+
width: "53px",
|
|
1263
|
+
height: "22px",
|
|
1264
|
+
class: "logo",
|
|
1265
|
+
alt: ""
|
|
1266
|
+
}, null, 8, _hoisted_3),
|
|
1267
|
+
o[0] || (o[0] = createElementVNode("div", { class: "copyright-text" }, "GS(2024)0568号 - 甲测资字1100471", -1))
|
|
1268
|
+
]),
|
|
1269
|
+
o[1] || (o[1] = createElementVNode("div", {
|
|
1270
|
+
id: "dataSource",
|
|
1271
|
+
class: "tdt-control data-source"
|
|
1272
|
+
}, "数据来源:自然资源部 & NavInfo", -1))
|
|
1273
|
+
]));
|
|
1274
|
+
}
|
|
1275
|
+
}), Copyright = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-9c5c2f7b"]]), _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1276
|
+
__name: "fullscreen",
|
|
1277
|
+
props: {
|
|
1278
|
+
pageRef: {
|
|
1279
|
+
type: Object,
|
|
1280
|
+
default: () => ({})
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
setup(e) {
|
|
1284
|
+
const t = e, o = ref(!1), n = () => {
|
|
1285
|
+
var a;
|
|
1286
|
+
o.value ? document.exitFullscreen() : (console.log(t.pageRef), (a = t.pageRef) == null || a.requestFullscreen()), o.value = !o.value;
|
|
1287
|
+
};
|
|
1288
|
+
return (a, r) => (openBlock(), createElementBlock("div", {
|
|
1289
|
+
class: "fullscreen-btn",
|
|
1290
|
+
onClick: n
|
|
1291
|
+
}, [
|
|
1292
|
+
createElementVNode("i", {
|
|
1293
|
+
class: normalizeClass(`map-iconfont ${o.value ? "icon-quxiaoquanping" : "icon-quanping"} `)
|
|
1294
|
+
}, null, 2)
|
|
1295
|
+
]));
|
|
1296
|
+
}
|
|
1297
|
+
}), Fullscreen = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ed59d7cb"]]), dotImage = new Image();
|
|
1298
|
+
dotImage.src = `${CDN_URL}/map/truck-dot.svg`;
|
|
1299
|
+
dotImage.crossOrigin = "anonymous";
|
|
1300
|
+
const dotActiveImage = new Image();
|
|
1301
|
+
dotActiveImage.src = `${CDN_URL}/map/truck-dot-active.svg`;
|
|
1302
|
+
dotActiveImage.crossOrigin = "anonymous";
|
|
1303
|
+
const cameraImage = new Image();
|
|
1304
|
+
cameraImage.src = `${CDN_URL}/map/map-camera.svg`;
|
|
1305
|
+
cameraImage.crossOrigin = "anonymous";
|
|
1306
|
+
const loadImage = new Image();
|
|
1307
|
+
loadImage.src = `${CDN_URL}/map/map-load.svg`;
|
|
1308
|
+
loadImage.crossOrigin = "anonymous";
|
|
1309
|
+
const setTruckStyle = (e, t, o, n) => new Style({
|
|
1310
|
+
renderer: (a, r) => {
|
|
1311
|
+
const l = r.context;
|
|
1312
|
+
l.save();
|
|
1313
|
+
let i = 1;
|
|
1314
|
+
l.scale(i, i);
|
|
1315
|
+
let [s, u] = a;
|
|
1316
|
+
s = s / i - 20, u = u / i;
|
|
1317
|
+
const c = s - 70, m = u - 68;
|
|
1318
|
+
let d = 180;
|
|
1319
|
+
const f = 56, g = "#FFFFFF";
|
|
1320
|
+
let p = 176;
|
|
1321
|
+
const T = 52;
|
|
1322
|
+
let L = "#164AFF", E = "#FFFFFF";
|
|
1323
|
+
o === CAR_COLOR.YELLOW ? (p = 176, L = "#FFC81E", E = "rgba(0,0,0,0.88)") : o === CAR_COLOR.Y_GREEN && (d = 200, p = 196, L = "#8FED7C", E = "rgba(0,0,0,0.88)"), n != null && n.length && (d += n.length * 56), fillRectRadius(l, c, m, d, f, g), fillRectRadius(l, c + 2, m + 2, p, T, L), o === CAR_COLOR.Y_GREEN && fillRectRadius(l, c + 2, m + 2, 68, T, "#FFC81E"), l.save(), l.restore(), l.fillStyle = E, l.font = "bold 28px Arial", l.textAlign = "left", l.textBaseline = "middle";
|
|
1324
|
+
const b = `${t.slice(0, 2) + " · " + t.slice(2)}`;
|
|
1325
|
+
if (l.fillText(b, c + 12, m + 32), l.save(), l.restore(), n != null && n.length) {
|
|
1326
|
+
const y = l.measureText(b).width + 12;
|
|
1327
|
+
let v = 0;
|
|
1328
|
+
n.forEach((C) => {
|
|
1329
|
+
C === DEVICE_TYPE.CAMERA && (l.drawImage(cameraImage, s - 54 + y + v * 56, u - 64, 50, 50), ++v), C === DEVICE_TYPE.LOAD && (l.drawImage(loadImage, s - 54 + y + v * 56, u - 64, 50, 50), ++v);
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
const h = dotImage;
|
|
1333
|
+
l.drawImage(h, s + d / 2 - 90, u, 50 / i, 50 / i), l.restore();
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1336
|
+
ref([]);
|
|
1337
|
+
let truckMarkerList = [], trucksVectorSource;
|
|
1338
|
+
const renderTrucksMarker = (e) => {
|
|
1339
|
+
if (deleteAllTruckMarkers(), !!mapInstance.value)
|
|
1340
|
+
return e.forEach((t) => {
|
|
1341
|
+
const o = convertSixHundredThousandToLatLng(t.lon, t.lat), n = new Feature({
|
|
1342
|
+
geometry: new Point(fromLonLat(o))
|
|
1343
|
+
});
|
|
1344
|
+
n.set("data", t), n.setStyle(
|
|
1345
|
+
setTruckStyle(!1, t.vno, t == null ? void 0 : t.vclColor, t == null ? void 0 : t.icons)
|
|
1346
|
+
), truckMarkerList.push({
|
|
1347
|
+
name: t.vno,
|
|
1348
|
+
lonlat: o,
|
|
1349
|
+
feature: n
|
|
1350
|
+
});
|
|
1351
|
+
}), trucksVectorSource = new VectorSource({
|
|
1352
|
+
features: truckMarkerList.map((t) => t.feature)
|
|
1353
|
+
}), trucksLayer.value = new VectorLayer({
|
|
1354
|
+
source: trucksVectorSource
|
|
1355
|
+
}), mapInstance.value.addLayer(trucksLayer.value), trucksLayer.value;
|
|
1356
|
+
}, deleteAllTruckMarkers = () => {
|
|
1357
|
+
truckMarkerList.forEach((e) => {
|
|
1358
|
+
e.feature && (trucksVectorSource == null || trucksVectorSource.removeFeature(e.feature));
|
|
1359
|
+
}), truckMarkerList = [];
|
|
1256
1360
|
}, drawCustomContent = (e, t, o, n = "top-left", a = !1) => {
|
|
1257
|
-
var
|
|
1361
|
+
var c, m;
|
|
1258
1362
|
if (!t || !mapInstance.value) return;
|
|
1259
|
-
document.querySelectorAll(".truck-custom-content").forEach((
|
|
1363
|
+
document.querySelectorAll(".truck-custom-content").forEach((d) => d.parentNode.removeChild(d));
|
|
1260
1364
|
const r = document.createElement("div");
|
|
1261
1365
|
r.innerHTML = o;
|
|
1262
1366
|
const l = new Overlay({
|
|
@@ -1268,32 +1372,32 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
|
|
|
1268
1372
|
// 设置不阻拦事件
|
|
1269
1373
|
});
|
|
1270
1374
|
if (a) {
|
|
1271
|
-
let
|
|
1272
|
-
r.addEventListener("mousedown", function(
|
|
1273
|
-
var
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1278
|
-
}), document.addEventListener("mousemove", function(
|
|
1279
|
-
var
|
|
1280
|
-
if (
|
|
1281
|
-
let L = (
|
|
1282
|
-
l.setPosition([f[0] + E, f[1] +
|
|
1375
|
+
let d = !1, f = [0, 0], g = [0, 0];
|
|
1376
|
+
r.addEventListener("mousedown", function(p) {
|
|
1377
|
+
var T;
|
|
1378
|
+
d = !0, p.clientX, p.clientY, f = (T = mapInstance.value) == null ? void 0 : T.getCoordinateFromPixel([p.clientX - 200, p.clientY - 200]), g = [
|
|
1379
|
+
p.clientX - r.getBoundingClientRect().left + 160,
|
|
1380
|
+
p.clientY - r.getBoundingClientRect().top + 84
|
|
1381
|
+
], p.preventDefault();
|
|
1382
|
+
}), document.addEventListener("mousemove", function(p) {
|
|
1383
|
+
var T;
|
|
1384
|
+
if (d) {
|
|
1385
|
+
let L = (T = mapInstance.value) == null ? void 0 : T.getCoordinateFromPixel([p.clientX - g[0], p.clientY - g[1]]), E = L[0] - f[0], b = L[1] - f[1];
|
|
1386
|
+
l.setPosition([f[0] + E, f[1] + b]);
|
|
1283
1387
|
}
|
|
1284
1388
|
}), document.addEventListener("mouseup", function() {
|
|
1285
|
-
|
|
1389
|
+
d = !1;
|
|
1286
1390
|
});
|
|
1287
1391
|
}
|
|
1288
|
-
(
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
var
|
|
1292
|
-
(
|
|
1392
|
+
(c = mapInstance.value) == null || c.addOverlay(l);
|
|
1393
|
+
const i = r.querySelector(".close-button");
|
|
1394
|
+
i && i.addEventListener("click", () => {
|
|
1395
|
+
var d, f;
|
|
1396
|
+
(d = mapInstance.value) == null || d.removeOverlay(l), (f = r.parentNode) == null || f.removeChild(r);
|
|
1293
1397
|
});
|
|
1294
|
-
let
|
|
1295
|
-
const
|
|
1296
|
-
return l.setPosition(
|
|
1398
|
+
let s = JSON.parse(JSON.stringify(t));
|
|
1399
|
+
const u = (m = mapInstance.value) == null ? void 0 : m.getCoordinateFromPixel(s);
|
|
1400
|
+
return l.setPosition(u), l;
|
|
1297
1401
|
}, vehicle = ref(null), focusShipData = ref(), currentTruckOverlay = ref(null), findTruck = async (e) => {
|
|
1298
1402
|
if (!mapInstance.value) return;
|
|
1299
1403
|
focusShipData.value = e;
|
|
@@ -1353,31 +1457,31 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, o, n, a = "ship")
|
|
|
1353
1457
|
// 设置文本背景的内边距
|
|
1354
1458
|
})
|
|
1355
1459
|
}), renderMarker = (e, t = !0, o = !0) => {
|
|
1356
|
-
var
|
|
1460
|
+
var c;
|
|
1357
1461
|
if (!mapInstance.value || !e || e.split(",").length !== 2) return;
|
|
1358
1462
|
const [n, a] = e.split(",").map(Number);
|
|
1359
1463
|
marker.value = new Feature({
|
|
1360
1464
|
geometry: new Point(fromLonLat([n, a]))
|
|
1361
1465
|
});
|
|
1362
1466
|
const r = o ? `${n}, ${a}` : "";
|
|
1363
|
-
(
|
|
1467
|
+
(c = marker.value) == null || c.setStyle(createIconStyle(r));
|
|
1364
1468
|
const l = new VectorSource({
|
|
1365
1469
|
features: [marker.value]
|
|
1366
|
-
}),
|
|
1470
|
+
}), i = new VectorLayer({
|
|
1367
1471
|
source: l
|
|
1368
|
-
}),
|
|
1369
|
-
if (mapInstance.value.addLayer(
|
|
1370
|
-
const
|
|
1371
|
-
layers: [
|
|
1472
|
+
}), s = mapInstance.value.getView();
|
|
1473
|
+
if (mapInstance.value.addLayer(i), t) {
|
|
1474
|
+
const m = new Translate({
|
|
1475
|
+
layers: [i]
|
|
1372
1476
|
});
|
|
1373
|
-
|
|
1374
|
-
var
|
|
1375
|
-
const f =
|
|
1376
|
-
markerPosition.value = `${
|
|
1377
|
-
}), mapInstance.value.addInteraction(
|
|
1477
|
+
m.on("translating", function(d) {
|
|
1478
|
+
var p;
|
|
1479
|
+
const f = d.features.item(0).getGeometry().getCoordinates(), g = toLonLat(f);
|
|
1480
|
+
markerPosition.value = `${g[0].toFixed(6)}, ${g[1].toFixed(6)}`, (p = marker.value) == null || p.setStyle(createIconStyle(markerPosition.value));
|
|
1481
|
+
}), mapInstance.value.addInteraction(m);
|
|
1378
1482
|
}
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1483
|
+
const u = new Point([n, a]);
|
|
1484
|
+
s.setCenter(transform(u.getCoordinates(), projection.data, projection.mercator)), s.setZoom(mapZoom.findShip);
|
|
1381
1485
|
}, setMarkerPosition = (e) => {
|
|
1382
1486
|
var a, r;
|
|
1383
1487
|
if (!mapInstance.value) return;
|
|
@@ -1423,12 +1527,12 @@ function createHelpTooltip() {
|
|
|
1423
1527
|
let squareLimitError = !1, lineLimitError = !1;
|
|
1424
1528
|
const validateSquareLimit = (e) => {
|
|
1425
1529
|
let o = 1 / 0, n = -1 / 0, a = 1 / 0, r = -1 / 0;
|
|
1426
|
-
e == null || e.forEach((
|
|
1427
|
-
const
|
|
1428
|
-
o = Math.min(o,
|
|
1530
|
+
e == null || e.forEach((s) => {
|
|
1531
|
+
const u = transform(s, projection.mercator, projection.data), c = u[0], m = u[1];
|
|
1532
|
+
o = Math.min(o, m), n = Math.max(n, m), a = Math.min(a, c), r = Math.max(r, c);
|
|
1429
1533
|
});
|
|
1430
|
-
const l = (n - o) * 111,
|
|
1431
|
-
squareLimitError = l > 150 ||
|
|
1534
|
+
const l = (n - o) * 111, i = (r - a) * 111;
|
|
1535
|
+
squareLimitError = l > 150 || i > 150;
|
|
1432
1536
|
};
|
|
1433
1537
|
let storeFeature;
|
|
1434
1538
|
function addInteraction(e) {
|
|
@@ -1454,17 +1558,17 @@ function addInteraction(e) {
|
|
|
1454
1558
|
draw.on("drawstart", function(a) {
|
|
1455
1559
|
var r;
|
|
1456
1560
|
layerState = "drawn", sketch = a.feature, t = (r = sketch.getGeometry()) == null ? void 0 : r.on("change", function(l) {
|
|
1457
|
-
const
|
|
1458
|
-
let
|
|
1459
|
-
const
|
|
1460
|
-
let
|
|
1461
|
-
if (lineLimitError = Number(getLength(
|
|
1462
|
-
<span class="text">面积:${
|
|
1463
|
-
`), helpTooltipElement &&
|
|
1561
|
+
const i = l.target;
|
|
1562
|
+
let s = formatArea(i, LENGTH_UNIT.NM);
|
|
1563
|
+
const c = i.getCoordinates()[0], m = new LineString([c[c.length - 2], c[c.length - 1]]);
|
|
1564
|
+
let d = formatLength(m, LENGTH_UNIT.NM);
|
|
1565
|
+
if (lineLimitError = Number(getLength(m) / 1e3) > 150, validateSquareLimit(c), measureTooltipElement && s && (measureTooltipElement.innerHTML = `
|
|
1566
|
+
<span class="text">面积:${s}${lineLimitError || squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</span>
|
|
1567
|
+
`), helpTooltipElement && s) {
|
|
1464
1568
|
let f = "";
|
|
1465
|
-
parseFloat(
|
|
1466
|
-
<div class="text ${squareLimitError ? "error" : ""}">面积:${
|
|
1467
|
-
<span class="text ${lineLimitError ? "error" : ""}">线段${
|
|
1569
|
+
parseFloat(s) > 0 && (f = `
|
|
1570
|
+
<div class="text ${squareLimitError ? "error" : ""}">面积:${s}${squareLimitError ? '<span class="error pl-12">超出可以绘画的距离</span>' : ""}</div>`), helpTooltipElement.innerHTML = `${f}
|
|
1571
|
+
<span class="text ${lineLimitError ? "error" : ""}">线段${c.length - 2}:${d}${lineLimitError ? '<span class="error pl-4">超出可以绘画的距离</span>' : ""}</span>
|
|
1468
1572
|
<div><span class="text">单击继续,双击结束</span></div>
|
|
1469
1573
|
`;
|
|
1470
1574
|
}
|
|
@@ -1489,11 +1593,11 @@ const endFn = (e) => {
|
|
|
1489
1593
|
var t, o, n;
|
|
1490
1594
|
if (e.getGeometry()) {
|
|
1491
1595
|
const a = [], l = e.getGeometry().getCoordinates();
|
|
1492
|
-
(t = l[0]) == null || t.forEach((
|
|
1493
|
-
a.push(transform(
|
|
1596
|
+
(t = l[0]) == null || t.forEach((s) => {
|
|
1597
|
+
a.push(transform(s, projection.mercator, projection.data));
|
|
1494
1598
|
});
|
|
1495
|
-
const
|
|
1496
|
-
if (
|
|
1599
|
+
const i = l[0][l[0].length - 2];
|
|
1600
|
+
if (i && measureTooltip.setPosition(i), measureTooltip.setOffset([10, 0]), measureTooltipElement && (measureTooltipElement.innerHTML += '<span class="delete-icon"><i class="iconfont icon-delete" /></div>'), (o = document.querySelector(".delete-icon")) == null || o.addEventListener("click", () => {
|
|
1497
1601
|
reset();
|
|
1498
1602
|
}), !lineLimitError && !squareLimitError)
|
|
1499
1603
|
return a;
|
|
@@ -1522,14 +1626,15 @@ const endFn = (e) => {
|
|
|
1522
1626
|
}, init = () => {
|
|
1523
1627
|
mapInstance.value && (drawVector = new VectorLayer({
|
|
1524
1628
|
source,
|
|
1525
|
-
style:
|
|
1526
|
-
{
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1629
|
+
style: new Style({
|
|
1630
|
+
stroke: new Stroke({
|
|
1631
|
+
color: "rgba(255, 255, 255, 1)",
|
|
1632
|
+
width: 2
|
|
1633
|
+
}),
|
|
1634
|
+
fill: new Fill({
|
|
1635
|
+
color: "rgba(255, 255, 255, 0.3)"
|
|
1636
|
+
})
|
|
1637
|
+
})
|
|
1533
1638
|
}), mapInstance.value.on("pointermove", pointerMoveHandler), mapInstance.value.getViewport().addEventListener("mouseout", function() {
|
|
1534
1639
|
var e;
|
|
1535
1640
|
(e = helpTooltipElement == null ? void 0 : helpTooltipElement.classList) == null || e.add("hidden");
|
|
@@ -1548,27 +1653,28 @@ const endFn = (e) => {
|
|
|
1548
1653
|
props: {
|
|
1549
1654
|
zoom: {},
|
|
1550
1655
|
center: {},
|
|
1551
|
-
vehicleMode: {}
|
|
1656
|
+
vehicleMode: {},
|
|
1657
|
+
viewMode: {}
|
|
1552
1658
|
},
|
|
1553
1659
|
emits: ["zoomChanged", "extentChanged"],
|
|
1554
1660
|
setup(e, { expose: t, emit: o }) {
|
|
1555
|
-
const n = ref(null), a = ref(null), r = ref(null), l = o,
|
|
1556
|
-
let
|
|
1557
|
-
((
|
|
1558
|
-
|
|
1559
|
-
})(
|
|
1560
|
-
const
|
|
1561
|
-
var
|
|
1562
|
-
const
|
|
1661
|
+
const n = ref(null), a = ref(null), r = ref(null), l = o, i = e, s = ref(i.zoom || mapZoom.default), u = ref(!1), c = ref(!0), m = ref(!0), d = ref(!1);
|
|
1662
|
+
let f;
|
|
1663
|
+
((h) => {
|
|
1664
|
+
h[h.tiandituTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTile }) })] = "tiandituTile", h[h.tiandituTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituTileMark }) })] = "tiandituTileMark", h[h.tiandituImgTile = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTile }), visible: !1 })] = "tiandituImgTile", h[h.tiandituImgTileMark = new TileLayer({ source: new XYZ({ url: baseMap.tiandituImgTileMark }), visible: !1 })] = "tiandituImgTileMark", h[h.greenMark = new TileLayer({ source: new XYZ({ url: baseMap.greenTile }) })] = "greenMark";
|
|
1665
|
+
})(f || (f = {}));
|
|
1666
|
+
const g = () => {
|
|
1667
|
+
var y, v;
|
|
1668
|
+
const h = {
|
|
1563
1669
|
projection: projection.mercator,
|
|
1564
1670
|
// 地图投影坐标系
|
|
1565
|
-
zoom:
|
|
1671
|
+
zoom: i.zoom || (i.vehicleMode === "ship" ? mapZoom.default : mapZoom.truckDefault),
|
|
1566
1672
|
// 地图缩放级别(打开页面时默认级别)
|
|
1567
1673
|
minZoom: mapZoom.min,
|
|
1568
1674
|
// 地图缩放最小级别
|
|
1569
1675
|
maxZoom: mapZoom.max,
|
|
1570
1676
|
// 地图缩放最大级别
|
|
1571
|
-
center: lonLatToMercator(
|
|
1677
|
+
center: lonLatToMercator(i.center || mapDefaultCenter),
|
|
1572
1678
|
// 深圳坐标
|
|
1573
1679
|
constrainResolution: !0,
|
|
1574
1680
|
multiWorld: !0
|
|
@@ -1578,104 +1684,113 @@ const endFn = (e) => {
|
|
|
1578
1684
|
// 对应页面里 id 为 map 的元素
|
|
1579
1685
|
layers: [
|
|
1580
1686
|
// 图层
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1687
|
+
f.tiandituTile,
|
|
1688
|
+
f.tiandituTileMark,
|
|
1689
|
+
f.tiandituImgTile,
|
|
1690
|
+
f.tiandituImgTileMark,
|
|
1691
|
+
f.greenMark
|
|
1586
1692
|
],
|
|
1587
|
-
view: new View(
|
|
1588
|
-
}), (
|
|
1693
|
+
view: new View(h)
|
|
1694
|
+
}), (y = a.value) == null || y.setScaleLine(), (v = mapInstance.value) == null || v.on("moveend", L), p(i.vehicleMode === "ship"), T(i.vehicleMode === "ship" ? BaseMapType.satellite : BaseMapType.vector);
|
|
1589
1695
|
};
|
|
1590
1696
|
onMounted(() => {
|
|
1591
|
-
|
|
1697
|
+
g();
|
|
1592
1698
|
});
|
|
1593
|
-
const
|
|
1594
|
-
var
|
|
1595
|
-
(
|
|
1596
|
-
|
|
1699
|
+
const p = (h) => {
|
|
1700
|
+
var y;
|
|
1701
|
+
(y = mapInstance.value) == null || y.getLayers().forEach((v) => {
|
|
1702
|
+
v.ol_uid === f.greenMark.ol_uid && (v.setVisible(h), c.value = h);
|
|
1597
1703
|
});
|
|
1598
|
-
},
|
|
1599
|
-
var
|
|
1600
|
-
console.log("mode",
|
|
1601
|
-
(
|
|
1704
|
+
}, T = (h) => {
|
|
1705
|
+
var y;
|
|
1706
|
+
console.log("mode", h), (y = mapInstance.value) == null || y.getLayers().forEach((v) => {
|
|
1707
|
+
(v.ol_uid === f.tiandituTile.ol_uid || v.ol_uid === f.tiandituTileMark.ol_uid || v.ol_uid === f.tiandituImgTile.ol_uid || v.ol_uid === f.tiandituImgTileMark.ol_uid) && v.setVisible(!1), (h === BaseMapType.vector && v.ol_uid === f.tiandituTile.ol_uid || v.ol_uid === f.tiandituTileMark.ol_uid || h === BaseMapType.satellite && v.ol_uid === f.tiandituImgTile.ol_uid || v.ol_uid === f.tiandituImgTileMark.ol_uid) && (console.log(h, v.ol_uid), v.setVisible(!0));
|
|
1602
1708
|
});
|
|
1603
|
-
},
|
|
1604
|
-
const
|
|
1605
|
-
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
-
},
|
|
1609
|
-
var
|
|
1610
|
-
|
|
1611
|
-
const
|
|
1612
|
-
!
|
|
1613
|
-
},
|
|
1614
|
-
const
|
|
1615
|
-
l("extentChanged", { extent: [
|
|
1709
|
+
}, L = () => {
|
|
1710
|
+
const h = mapInstance.value.getView(), y = h.getZoom();
|
|
1711
|
+
y && E(y);
|
|
1712
|
+
const v = h.calculateExtent(mapInstance.value.getSize());
|
|
1713
|
+
v && y && b(v, y);
|
|
1714
|
+
}, E = (h) => {
|
|
1715
|
+
var C, V, w, S;
|
|
1716
|
+
s.value = h;
|
|
1717
|
+
const y = (C = mapInstance.value) == null ? void 0 : C.getLayers(), v = i.vehicleMode === "ship" ? y == null ? void 0 : y.getArray().find((M) => M.ol_uid === f.greenMark.ol_uid) : void 0;
|
|
1718
|
+
!u.value && c.value && h < mapZoom.shipGreenDotMax ? (m.value = !0, v == null || v.setVisible(!0), (V = shipsLayer.value) == null || V.setVisible(!1), (w = largeAmountShipsLayer.value) == null || w.setVisible(!1)) : (m.value = !1, v == null || v.setVisible(!1), (S = largeAmountShipsLayer.value) == null || S.setVisible(!0)), l("zoomChanged", h);
|
|
1719
|
+
}, b = (h, y) => {
|
|
1720
|
+
const v = transform([h[0], h[1]], projection.mercator, projection.data), C = transform([h[2], h[3]], projection.mercator, projection.data);
|
|
1721
|
+
l("extentChanged", { extent: [v, C], zoom: y });
|
|
1616
1722
|
};
|
|
1617
1723
|
return t({
|
|
1618
1724
|
mapInstance,
|
|
1619
|
-
initMap:
|
|
1725
|
+
initMap: g,
|
|
1620
1726
|
renderTrucksMarker,
|
|
1621
1727
|
renderShip: renderShips,
|
|
1622
|
-
renderTrack,
|
|
1728
|
+
renderTrack: (h, y, v) => {
|
|
1729
|
+
d.value = !0, u.value = !0, renderTrack(h, y, v, LENGTH_UNIT.NM);
|
|
1730
|
+
},
|
|
1623
1731
|
findTruck,
|
|
1624
1732
|
removeTruckIcon,
|
|
1625
1733
|
clearAllTruck,
|
|
1626
1734
|
closeTrack: () => {
|
|
1627
|
-
var
|
|
1628
|
-
(
|
|
1735
|
+
var h;
|
|
1736
|
+
d.value = !1, (h = shipTrackVectorLayer.value) == null || h.setVisible(!1);
|
|
1629
1737
|
},
|
|
1630
1738
|
closeTruckTrack: () => {
|
|
1631
|
-
var
|
|
1632
|
-
(
|
|
1739
|
+
var h;
|
|
1740
|
+
d.value = !1, (h = shipTrackVectorLayer.value) == null || h.setVisible(!1);
|
|
1633
1741
|
},
|
|
1742
|
+
resetTrackView,
|
|
1743
|
+
playTrack,
|
|
1634
1744
|
clearSelectFeature,
|
|
1635
1745
|
findShip,
|
|
1636
|
-
focusShip: (
|
|
1637
|
-
var
|
|
1638
|
-
(
|
|
1746
|
+
focusShip: (h, y) => {
|
|
1747
|
+
var v, C;
|
|
1748
|
+
(v = shipsLayer.value) == null || v.setVisible(!1), (C = largeAmountShipsLayer.value) == null || C.setVisible(!1), findShip(h, y);
|
|
1639
1749
|
},
|
|
1640
1750
|
showTracks,
|
|
1641
1751
|
removeAllTrackLayer,
|
|
1642
1752
|
switchFilterItem,
|
|
1643
1753
|
rerenderShip,
|
|
1644
|
-
switchGreenDot: () =>
|
|
1754
|
+
switchGreenDot: () => p(!1),
|
|
1645
1755
|
zoomTruckIcon,
|
|
1646
|
-
renderTruckTrack: (
|
|
1647
|
-
renderTrack(
|
|
1756
|
+
renderTruckTrack: (h, y, v) => {
|
|
1757
|
+
d.value = !0, renderTrack(h, y, v, LENGTH_UNIT.KM, "truck");
|
|
1648
1758
|
},
|
|
1649
1759
|
renderMarker,
|
|
1650
1760
|
setMarkerPosition,
|
|
1651
1761
|
drawPolygonTool
|
|
1652
|
-
}), (
|
|
1762
|
+
}), (h, y) => (openBlock(), createElementBlock("div", {
|
|
1653
1763
|
class: "map-page map-container",
|
|
1654
1764
|
ref_key: "pageRef",
|
|
1655
1765
|
ref: n
|
|
1656
1766
|
}, [
|
|
1657
|
-
|
|
1767
|
+
y[0] || (y[0] = createElementVNode("div", {
|
|
1658
1768
|
id: "map",
|
|
1659
1769
|
class: "map"
|
|
1660
1770
|
}, null, -1)),
|
|
1661
1771
|
createVNode(ToolPanel, {
|
|
1662
|
-
"vehicle-mode":
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1772
|
+
"vehicle-mode": h.vehicleMode,
|
|
1773
|
+
"view-mode": h.viewMode,
|
|
1774
|
+
"disable-green-dot": u.value,
|
|
1775
|
+
"show-track-layer": d.value,
|
|
1776
|
+
onSwitchGreenDot: p,
|
|
1777
|
+
onSwitchMapTile: T
|
|
1778
|
+
}, null, 8, ["vehicle-mode", "view-mode", "disable-green-dot", "show-track-layer"]),
|
|
1779
|
+
h.viewMode !== "WxMiniprogram" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1780
|
+
createVNode(ScaleLine, {
|
|
1781
|
+
ref_key: "scaleLineControl",
|
|
1782
|
+
ref: a
|
|
1783
|
+
}, null, 512),
|
|
1784
|
+
createVNode(ZoomControl, {
|
|
1785
|
+
ref_key: "zoomControl",
|
|
1786
|
+
ref: r
|
|
1787
|
+
}, null, 512),
|
|
1788
|
+
createVNode(Fullscreen, { page: n.value }, null, 8, ["page"])
|
|
1789
|
+
], 64)) : createCommentVNode("", !0),
|
|
1790
|
+
createVNode(Copyright)
|
|
1676
1791
|
], 512));
|
|
1677
1792
|
}
|
|
1678
|
-
}), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1793
|
+
}), Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-51c9ddf4"]]), ZhMap = withInstall(Map);
|
|
1679
1794
|
export {
|
|
1680
1795
|
ZhMap as Z
|
|
1681
1796
|
};
|