zhihao-ui 1.2.29 → 1.2.30
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-XETJaruy.js → BaseInfo-CAuR2Id0.js} +1 -1
- package/dist/es/BaseItem-CQzBP1WX.js +129 -0
- package/dist/es/{Button-CzjgaPIL.js → Button-D-R-2Fix.js} +4 -4
- package/dist/es/DatePicker-BDz_yTX2.js +36 -0
- package/dist/es/{DetailHeader-C7L01g9Z.js → DetailHeader-CBN9CqAp.js} +3 -3
- package/dist/es/{DetailSubTitle-ChWfR3qA.js → DetailSubTitle-DsnSxPKH.js} +2 -2
- package/dist/es/{Dialog-Cky8TKRM.js → Dialog-C_hAbDgU.js} +3 -3
- package/dist/es/{DiyDataTable-D1s7-cdV.js → DiyDataTable-CXSUoapn.js} +10 -10
- package/dist/es/{EditInfoPair-C0EG8kUd.js → EditInfoPair-C0Ielr4q.js} +3 -3
- package/dist/es/{FileWrapper-CmvheBNp.js → FileWrapper-DFqY2SD_.js} +4 -4
- package/dist/es/Grid-CLg9sn2Y.js +198 -0
- package/dist/es/{InfoPair-JA1pAAyP.js → InfoPair-6agPuvqq.js} +3 -3
- package/dist/es/{Input-12ajHBoj.js → Input-CzlIXSCf.js} +3 -3
- package/dist/es/{Loading-CHji9tKE.js → Loading-ClE8eADM.js} +2 -2
- package/dist/es/{Map-Bq9kPMot.js → Map-Ch7K-0xC.js} +173 -179
- package/dist/es/{MessageBox-1NCCwju7.js → MessageBox-CBMAgp6C.js} +2 -2
- package/dist/es/{MoneyInput-PI2K9BeH.js → MoneyInput-EODuzFjO.js} +17 -18
- package/dist/es/{PageHeadPanel-CBDItYUC.js → PageHeadPanel-DDnMIqmC.js} +2 -2
- package/dist/es/{Table-BBWU5wYF.js → Table-D7YUOcI0.js} +132 -130
- package/dist/es/{ToolTips-BBCd543g.js → ToolTips-BpZo8gsa.js} +3 -3
- package/dist/es/index.js +66 -60
- package/dist/es/utils-BbWQLYZL.js +52 -0
- package/dist/es/{vendor-BhAIOWbw.js → vendor-Cq716b5Q.js} +2034 -2019
- package/dist/index.css +1 -1
- package/dist/types/components/BaseItem/BaseItem.test.d.ts +1 -0
- package/dist/types/components/BaseItem/BaseItem.vue.d.ts +50 -0
- package/dist/types/components/BaseItem/index.d.ts +209 -0
- package/dist/types/components/BaseItem/types.d.ts +39 -0
- package/dist/types/components/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/types/components/DatePicker/index.d.ts +5 -5
- package/dist/types/components/Dialog/Dialog.vue.d.ts +29 -29
- package/dist/types/components/Dialog/index.d.ts +45 -45
- package/dist/types/components/FileWrapper/FileWrapper.vue.d.ts +2 -2
- package/dist/types/components/FileWrapper/index.d.ts +6 -6
- package/dist/types/components/Grid/Grid.vue.d.ts +7 -9
- package/dist/types/components/Grid/components/GridItem.vue.d.ts +71 -0
- package/dist/types/components/Grid/components/MultiGrid.vue.d.ts +11 -0
- package/dist/types/components/Grid/components/collectGridItems.d.ts +9 -0
- package/dist/types/components/Grid/index.d.ts +187 -0
- package/dist/types/components/Grid/types.d.ts +14 -1
- package/dist/types/components/Map/interface/entity/render.d.ts +2 -0
- package/dist/types/components/Map/render/renderPoint.d.ts +1 -2
- package/dist/types/components/Table/components/ColSetting.vue.d.ts +2 -2
- package/dist/types/components/Table/components/SearchForm.vue.d.ts +2 -2
- package/dist/types/components/ToolTips/ToolTips.vue.d.ts +1 -1
- package/dist/types/components/ToolTips/index.d.ts +3 -3
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/utils/color.d.ts +1 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.umd.cjs +19 -19
- package/package.json +1 -1
- package/dist/es/DatePicker-DNgii92T.js +0 -58
- package/dist/es/Grid-CfJ_U3gi.js +0 -96
- package/dist/es/utils-BIGjF-zg.js +0 -14
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
var A = (e, t, n) => t in e ?
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var A = (e, t, n) => t in e ? D(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var I = (e, t, n) => A(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { o as getArea, p as getLength, V as VectorSource, q as VectorLayer, S as Style, C as CircleStyle, F as Fill, r as Stroke, D as Draw, O as Overlay, u as unByKey, s as ElSelect, t as ElOption, T as Text, v as fromLonLat, w as transformExtent, x as hooks, L as LineString, y as Feature, P as Point, z as Polyline, A as getVectorContext, h as cloneDeep, G as GeoJSON, W as WebGLPointsLayer, B as Circle, H as transform, I as buffer, J as ScaleLine$1, K as Icon, M as Translate, N as toLonLat, Q as MultiPoint, R as getCenter, U as TileLayer, X as XYZ, Y as Map$1, Z as View } from "./vendor-Cq716b5Q.js";
|
|
5
5
|
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";
|
|
6
|
-
import { _ as _export_sfc } from "./Button-
|
|
7
|
-
import { w as withInstall } from "./utils-
|
|
6
|
+
import { _ as _export_sfc } from "./Button-D-R-2Fix.js";
|
|
7
|
+
import { g as getForegroundColor, w as withInstall } from "./utils-BbWQLYZL.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 || {}), SHIP_SAIL_STATUS = /* @__PURE__ */ ((e) => (e[e.发动机使用中 = 0] = "发动机使用中", e[e.锚泊 = 1] = "锚泊", e[e.未操作 = 2] = "未操作", e[e.操纵能力受限 = 3] = "操纵能力受限", e[e.吃水受限 = 4] = "吃水受限", e[e.系泊 = 5] = "系泊", e[e.搁浅 = 6] = "搁浅", e[e.从事捕捞 = 7] = "从事捕捞", e[e.航行中 = 8] = "航行中", e[e.留作将来修正导航状态 = 9] = "留作将来修正导航状态", e[e.高速船留用 = 10] = "高速船留用", e[e.机动船尾推作业 = 11] = "机动船尾推作业", e[e.机动船顶推或侧推作业 = 12] = "机动船顶推或侧推作业", e[e.飞翼船留用 = 13] = "飞翼船留用", e[e.现行的 = 14] = "现行的", e[e.未定义 = 15] = "未定义", e))(SHIP_SAIL_STATUS || {});
|
|
9
9
|
class ShipMapData {
|
|
10
|
-
constructor(t, n, o, r, l, i, s, c, d, m, u, f, p, y, h, g,
|
|
11
|
-
|
|
10
|
+
constructor(t, n, o, r, l, i, s, c, d, m, u, f, p, y, h, g, T, M, b, E, x, v, w, k) {
|
|
11
|
+
I(this, "id");
|
|
12
12
|
// mmsi
|
|
13
|
-
|
|
13
|
+
I(this, "mmsi");
|
|
14
14
|
// 船舶三角形填充色
|
|
15
|
-
|
|
15
|
+
I(this, "fill");
|
|
16
16
|
// 船类型 "7": "货船",
|
|
17
|
-
|
|
17
|
+
I(this, "shipType");
|
|
18
18
|
// 船名
|
|
19
|
-
|
|
19
|
+
I(this, "name");
|
|
20
20
|
// 长度
|
|
21
|
-
|
|
21
|
+
I(this, "length");
|
|
22
22
|
// 宽度
|
|
23
|
-
|
|
23
|
+
I(this, "breadth");
|
|
24
24
|
// 经度
|
|
25
|
-
|
|
25
|
+
I(this, "lon");
|
|
26
26
|
// 纬度
|
|
27
|
-
|
|
27
|
+
I(this, "lat");
|
|
28
28
|
// 时间
|
|
29
|
-
|
|
29
|
+
I(this, "createdAt");
|
|
30
30
|
// 速度
|
|
31
|
-
|
|
31
|
+
I(this, "speed");
|
|
32
32
|
// 来源
|
|
33
|
-
|
|
33
|
+
I(this, "from");
|
|
34
34
|
// 船状态 "stop":"静止","sail":"航行","work":"作业","danger":"危险","other":"其他"
|
|
35
|
-
|
|
35
|
+
I(this, "sailStatus");
|
|
36
36
|
// 船艏向
|
|
37
|
-
|
|
37
|
+
I(this, "hdg");
|
|
38
38
|
// 航迹向
|
|
39
|
-
|
|
39
|
+
I(this, "cog");
|
|
40
40
|
// 设备定位类型
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
I(this, "posType");
|
|
42
|
+
I(this, "type");
|
|
43
43
|
// 航向角度
|
|
44
|
-
|
|
44
|
+
I(this, "angle");
|
|
45
45
|
// 左侧是否显示色块
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this.id = t, this.mmsi = n, this.fill = o, 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 =
|
|
46
|
+
I(this, "leftIconColor");
|
|
47
|
+
I(this, "existDevice");
|
|
48
|
+
I(this, "existMobile");
|
|
49
|
+
I(this, "existWaterGauge");
|
|
50
|
+
I(this, "selected");
|
|
51
|
+
I(this, "blinkColors");
|
|
52
|
+
this.id = t, this.mmsi = n, this.fill = o, 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 = T, this.angle = M, this.leftIconColor = b, this.existDevice = E, this.existMobile = x, this.existWaterGauge = v, this.selected = w, this.blinkColors = k;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
const formatLength = function(e, t) {
|
|
@@ -143,15 +143,15 @@ const formatLength = function(e, t) {
|
|
|
143
143
|
}), g = function(L) {
|
|
144
144
|
if (L.dragging)
|
|
145
145
|
return;
|
|
146
|
-
let
|
|
147
|
-
m && (
|
|
148
|
-
},
|
|
146
|
+
let S = "点击选择起点";
|
|
147
|
+
m && (S = "单击继续,双击结束"), u && (u.innerHTML = S, f.setPosition(L.coordinate), u.classList.remove("hidden"));
|
|
148
|
+
}, T = () => {
|
|
149
149
|
o.value && (o.value.on("pointermove", g), o.value.getViewport().addEventListener("mouseout", function() {
|
|
150
150
|
var L;
|
|
151
151
|
(L = u == null ? void 0 : u.classList) == null || L.add("hidden");
|
|
152
152
|
}), c.value = !0);
|
|
153
153
|
};
|
|
154
|
-
let
|
|
154
|
+
let M;
|
|
155
155
|
const b = new Style({
|
|
156
156
|
fill: new Fill({
|
|
157
157
|
color: "rgba(255, 255, 255, 0.2)"
|
|
@@ -171,39 +171,39 @@ const formatLength = function(e, t) {
|
|
|
171
171
|
})
|
|
172
172
|
})
|
|
173
173
|
});
|
|
174
|
-
function
|
|
175
|
-
var L,
|
|
174
|
+
function E() {
|
|
175
|
+
var L, S;
|
|
176
176
|
if (o.value) {
|
|
177
|
-
if (s.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((
|
|
177
|
+
if (s.value = [], document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach((V) => {
|
|
178
178
|
var F;
|
|
179
|
-
(F =
|
|
180
|
-
}), d.clear(),
|
|
181
|
-
const
|
|
182
|
-
|
|
179
|
+
(F = V == null ? void 0 : V.parentNode) == null || F.removeChild(V);
|
|
180
|
+
}), d.clear(), M) {
|
|
181
|
+
const V = o.value.getInteractions().getArray().find((F) => F.ol_uid === M.ol_uid);
|
|
182
|
+
V && ((L = o.value) == null || L.removeInteraction(V));
|
|
183
183
|
}
|
|
184
|
-
(
|
|
184
|
+
(S = o.value) == null || S.removeLayer(h), u != null && u.parentNode && u.parentNode.removeChild(u), p != null && p.parentNode && p.parentNode.removeChild(p);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
function x() {
|
|
188
|
-
var
|
|
189
|
-
|
|
188
|
+
var S, V;
|
|
189
|
+
E(), (S = o.value) == null || S.addLayer(h), M = new Draw({
|
|
190
190
|
source: d,
|
|
191
191
|
type: "LineString",
|
|
192
192
|
style: function() {
|
|
193
193
|
return b;
|
|
194
194
|
}
|
|
195
|
-
}), (
|
|
195
|
+
}), (V = o.value) == null || V.addInteraction(M), w(), v();
|
|
196
196
|
let L;
|
|
197
|
-
|
|
197
|
+
M.on("drawstart", function(F) {
|
|
198
198
|
var $;
|
|
199
199
|
m = F.feature;
|
|
200
200
|
let N;
|
|
201
|
-
L = ($ = m.getGeometry()) == null ? void 0 : $.on("change", function(
|
|
202
|
-
const P =
|
|
201
|
+
L = ($ = m.getGeometry()) == null ? void 0 : $.on("change", function(R) {
|
|
202
|
+
const P = R.target;
|
|
203
203
|
let B = formatUtils.formatLength(P, Number(i.value));
|
|
204
204
|
N = P.getLastCoordinate(), p && B && (p.innerHTML = B), y.setPosition(N);
|
|
205
205
|
});
|
|
206
|
-
}),
|
|
206
|
+
}), M.on("drawend", function() {
|
|
207
207
|
p && (p.className = "ol-tooltip ol-tooltip-static ol-tooltip-measure"), p != null && p.innerHTML && s.value.push(p == null ? void 0 : p.innerHTML), y.setOffset([0, -7]), m = null, p = null, w(), L && unByKey(L);
|
|
208
208
|
});
|
|
209
209
|
}
|
|
@@ -228,32 +228,32 @@ const formatLength = function(e, t) {
|
|
|
228
228
|
const k = (L) => {
|
|
229
229
|
var F, N;
|
|
230
230
|
s.value[L] && s.value.splice(L, 1);
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
},
|
|
231
|
+
const S = document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");
|
|
232
|
+
S[L] && ((N = (F = S[L]) == null ? void 0 : F.parentNode) == null || N.removeChild(S[L]));
|
|
233
|
+
const V = d.getFeatures();
|
|
234
|
+
V[L] && d.removeFeature(V[L]);
|
|
235
|
+
}, C = () => {
|
|
236
236
|
r("close");
|
|
237
237
|
};
|
|
238
238
|
return watch(() => l, () => {
|
|
239
|
-
l && !c.value && (
|
|
239
|
+
l && !c.value && (T(), x());
|
|
240
240
|
}, { deep: !0, immediate: !0 }), t({
|
|
241
241
|
addInteraction: x,
|
|
242
|
-
removeInteraction:
|
|
243
|
-
}), (L,
|
|
242
|
+
removeInteraction: E
|
|
243
|
+
}), (L, S) => l.value && L.viewMode !== "WxMiniprogram" ? (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
|
-
onClick:
|
|
247
|
+
onClick: C,
|
|
248
248
|
class: "map-iconfont icon-close"
|
|
249
249
|
})
|
|
250
250
|
]),
|
|
251
251
|
createElementVNode("div", _hoisted_2$2, [
|
|
252
|
-
|
|
252
|
+
S[2] || (S[2] = createElementVNode("div", { class: "tips" }, "在地图上点击多个点测量距离,距离单位", -1)),
|
|
253
253
|
createVNode(unref(ElSelect), {
|
|
254
254
|
class: "select-length-unit",
|
|
255
255
|
modelValue: i.value,
|
|
256
|
-
"onUpdate:modelValue":
|
|
256
|
+
"onUpdate:modelValue": S[0] || (S[0] = (V) => i.value = V)
|
|
257
257
|
}, {
|
|
258
258
|
default: withCtx(() => [
|
|
259
259
|
createVNode(unref(ElOption), {
|
|
@@ -273,19 +273,19 @@ const formatLength = function(e, t) {
|
|
|
273
273
|
}, 8, ["modelValue"])
|
|
274
274
|
]),
|
|
275
275
|
createElementVNode("div", _hoisted_3$2, [
|
|
276
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (
|
|
276
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (V, F) => (openBlock(), createElementBlock("div", {
|
|
277
277
|
class: "measure-history-item",
|
|
278
278
|
key: F
|
|
279
279
|
}, [
|
|
280
280
|
createElementVNode("div", _hoisted_4, [
|
|
281
|
-
|
|
281
|
+
S[3] || (S[3] = createElementVNode("i", { class: "map-iconfont icon-line" }, null, -1)),
|
|
282
282
|
createElementVNode("span", _hoisted_5, "线段" + toDisplayString(F + 1), 1),
|
|
283
|
-
createElementVNode("span", _hoisted_6, toDisplayString(
|
|
283
|
+
createElementVNode("span", _hoisted_6, toDisplayString(V), 1)
|
|
284
284
|
]),
|
|
285
285
|
createElementVNode("div", {
|
|
286
286
|
class: "delete-button",
|
|
287
287
|
onClick: (N) => k(F)
|
|
288
|
-
},
|
|
288
|
+
}, S[4] || (S[4] = [
|
|
289
289
|
createElementVNode("i", { class: "map-iconfont icon-delete" }, null, -1)
|
|
290
290
|
]), 8, _hoisted_7)
|
|
291
291
|
]))), 128))
|
|
@@ -377,8 +377,8 @@ const multiplyPixelRatio = (e) => {
|
|
|
377
377
|
return function(v, w) {
|
|
378
378
|
return (i(w, v) + 180) % 360;
|
|
379
379
|
}(u, f);
|
|
380
|
-
const y = l(u), h = l(f), g = r(y[0]),
|
|
381
|
-
return o(Math.atan2(
|
|
380
|
+
const y = l(u), h = l(f), g = r(y[0]), T = r(h[0]), M = r(y[1]), b = r(h[1]), E = Math.sin(T - g) * Math.cos(b), x = Math.cos(M) * Math.sin(b) - Math.sin(M) * Math.cos(b) * Math.cos(T - g);
|
|
381
|
+
return o(Math.atan2(E, x));
|
|
382
382
|
}
|
|
383
383
|
function s(u) {
|
|
384
384
|
return !isNaN(u) && u !== null && !Array.isArray(u);
|
|
@@ -498,35 +498,35 @@ function drawLabelBody(e, t, n) {
|
|
|
498
498
|
(c || d) && (f += l + 4 * r), e.restore();
|
|
499
499
|
let p, y = 20, h = -1, g = l + 3 * r;
|
|
500
500
|
if (m)
|
|
501
|
-
for (let
|
|
502
|
-
p = calculateBounds(i,
|
|
503
|
-
let
|
|
501
|
+
for (let T = 0; T < 8; T++) {
|
|
502
|
+
p = calculateBounds(i, T, f, g, m);
|
|
503
|
+
let M = !1;
|
|
504
504
|
for (let b = 0; b < t.length; ++b) {
|
|
505
|
-
let
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
505
|
+
let E = t[b].bounds, x = [
|
|
506
|
+
E[0] - y,
|
|
507
|
+
E[1] - y,
|
|
508
|
+
E[2] + y,
|
|
509
|
+
E[3] + y
|
|
510
510
|
];
|
|
511
511
|
if (p && isOverlapping(p, x)) {
|
|
512
|
-
|
|
512
|
+
M = !0;
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
if (!
|
|
517
|
-
h =
|
|
516
|
+
if (!M) {
|
|
517
|
+
h = T;
|
|
518
518
|
break;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
else
|
|
522
522
|
h = 0, p = calculateBounds(i, h, f, g, m);
|
|
523
523
|
if (u && h === -1 && (h = 0), p && h > -1) {
|
|
524
|
-
let
|
|
524
|
+
let T = getBottomLeftPoint(p), M = getTopRighttPoint(p);
|
|
525
525
|
return {
|
|
526
526
|
center: i,
|
|
527
527
|
x: calculateAnchorPoint(i, h, f, g, m),
|
|
528
|
-
l:
|
|
529
|
-
r:
|
|
528
|
+
l: M,
|
|
529
|
+
r: T,
|
|
530
530
|
bounds: p,
|
|
531
531
|
position: h,
|
|
532
532
|
name: s
|
|
@@ -534,32 +534,15 @@ function drawLabelBody(e, t, n) {
|
|
|
534
534
|
} else
|
|
535
535
|
return null;
|
|
536
536
|
}
|
|
537
|
-
let intervalId;
|
|
538
537
|
const drawText = (e, t) => {
|
|
539
538
|
if (!e) return;
|
|
540
539
|
const { center: n, text: o, textColor: r, leftIcon: l, rightIcons: i, font: s } = t;
|
|
541
540
|
e.save(), e.setTransform(1, 0, 0, 1, 0, 0);
|
|
542
541
|
let [c, d] = n;
|
|
543
542
|
if (l) {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
t.blinkColors.forEach((p) => {
|
|
548
|
-
f.push(p), f.push("white");
|
|
549
|
-
}), intervalId && clearInterval(intervalId), intervalId = setInterval(() => {
|
|
550
|
-
const p = Date.now();
|
|
551
|
-
if (p - m >= 500) {
|
|
552
|
-
u = (u + 1) % f.length, m = p, e.font = "22px map-iconfont";
|
|
553
|
-
let y = getIconFont(l.icon);
|
|
554
|
-
e.fillStyle = f[u], e.fillText(y, c - 22 + labelOutSize - 4, d + 4);
|
|
555
|
-
}
|
|
556
|
-
}, 10);
|
|
557
|
-
} else {
|
|
558
|
-
e.font = "22px map-iconfont";
|
|
559
|
-
let m = getIconFont(l.icon);
|
|
560
|
-
e.fillStyle = l.color, e.fillText(m, c + labelOutSize - 4, d + 4);
|
|
561
|
-
}
|
|
562
|
-
c += 22;
|
|
543
|
+
e.font = "22px map-iconfont";
|
|
544
|
+
let m = getIconFont(l.icon);
|
|
545
|
+
e.fillStyle = l.color, e.fillText(m, c + labelOutSize - 4, d + 4), c += 22;
|
|
563
546
|
}
|
|
564
547
|
if (i != null && i.length) {
|
|
565
548
|
e.font = "12px map-iconfont", e.fillStyle = "#3370ff";
|
|
@@ -588,10 +571,13 @@ const drawText = (e, t) => {
|
|
|
588
571
|
e.lineTo(n[u][0], n[u][1]);
|
|
589
572
|
l && e.closePath(), o && (e.strokeStyle = o, e.stroke()), r && l && (m && (e.globalAlpha = m), e.fillStyle = r, e.fill()), e.restore();
|
|
590
573
|
}
|
|
591
|
-
}
|
|
592
|
-
|
|
574
|
+
};
|
|
575
|
+
let intervalId = [];
|
|
576
|
+
const drawLabel = (e, t, n) => {
|
|
577
|
+
var u, f;
|
|
578
|
+
let { center: o, text: r, color: l, textColor: i, bgColor: s, leftIcon: c, rightIcons: d, type: m } = t;
|
|
593
579
|
if (o && r) {
|
|
594
|
-
let
|
|
580
|
+
let p = {
|
|
595
581
|
font: labelFont,
|
|
596
582
|
labelOutSize,
|
|
597
583
|
labelHeight,
|
|
@@ -599,12 +585,14 @@ const drawText = (e, t) => {
|
|
|
599
585
|
text: r,
|
|
600
586
|
leftIcon: c,
|
|
601
587
|
selected: t.selected
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
588
|
+
};
|
|
589
|
+
(u = t.blinkColors) != null && u.length && (s = t.fill, i = getForegroundColor(t.fill));
|
|
590
|
+
let y = drawLabelBody(e, n, p);
|
|
591
|
+
if (y) {
|
|
592
|
+
const { x: h, bounds: g, l: T } = y;
|
|
593
|
+
let M = [getTopLeftPoint(g), getBottomLeftPoint(g), getBottomRightPoint(g), getTopRighttPoint(g)];
|
|
594
|
+
n.find((k) => k.name === r) || n.push(y), drawPolygon(e, {
|
|
595
|
+
points: [o, h],
|
|
608
596
|
strokeColor: l,
|
|
609
597
|
fillColor: "#000",
|
|
610
598
|
shouldClosePath: !0,
|
|
@@ -614,22 +602,31 @@ const drawText = (e, t) => {
|
|
|
614
602
|
scale: void 0,
|
|
615
603
|
globalAlpha: labelAlpha
|
|
616
604
|
}), d != null && d.length && d.forEach(() => {
|
|
617
|
-
|
|
618
|
-
})
|
|
619
|
-
|
|
605
|
+
M[1][0] += 20, M[2][0] += 20;
|
|
606
|
+
});
|
|
607
|
+
const E = {
|
|
608
|
+
points: M,
|
|
620
609
|
strokeColor: l,
|
|
621
610
|
fillColor: s,
|
|
622
611
|
shouldClosePath: !0
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
center: [b, C + labelOutSize + labelHeight + 1],
|
|
612
|
+
}, [x, v] = T, w = {
|
|
613
|
+
center: [x, v + labelOutSize + labelHeight + 1],
|
|
626
614
|
text: r,
|
|
627
615
|
textColor: i,
|
|
628
616
|
leftIcon: c,
|
|
629
617
|
rightIcons: d,
|
|
630
618
|
blinkColors: t.blinkColors
|
|
631
619
|
};
|
|
632
|
-
drawText(e,
|
|
620
|
+
if (drawPolygon(e, E), drawText(e, w), ((f = t == null ? void 0 : t.blinkColors) == null ? void 0 : f.length) > 0) {
|
|
621
|
+
let k = Date.now(), C = 0;
|
|
622
|
+
const L = [];
|
|
623
|
+
t.blinkColors.forEach((S) => {
|
|
624
|
+
L.push(S), L.push("white");
|
|
625
|
+
}), intervalId[t.text] && clearInterval(intervalId[t.text]), intervalId[t.text] = setInterval(() => {
|
|
626
|
+
const S = Date.now();
|
|
627
|
+
S - k >= 500 && (C = (C + 1) % L.length, k = S, E.fillColor = L[C], drawPolygon(e, E), w.textColor = getForegroundColor(E.fillColor), drawText(e, w));
|
|
628
|
+
}, 10);
|
|
629
|
+
}
|
|
633
630
|
}
|
|
634
631
|
}
|
|
635
632
|
return null;
|
|
@@ -685,8 +682,8 @@ function mercatorToLonLat(e, t = "lonlat") {
|
|
|
685
682
|
function calculateBoundingBox(e) {
|
|
686
683
|
let t = 1 / 0, n = -1 / 0, o = 1 / 0, r = -1 / 0;
|
|
687
684
|
e.forEach((h) => {
|
|
688
|
-
const [g,
|
|
689
|
-
t = Math.min(t,
|
|
685
|
+
const [g, T] = h;
|
|
686
|
+
t = Math.min(t, T), n = Math.max(n, T), o = Math.min(o, g), r = Math.max(r, g);
|
|
690
687
|
});
|
|
691
688
|
const l = r - o, i = n - t, s = Math.max(l, i), c = (o + r) / 2, d = (t + n) / 2, m = s / 2, u = c - m, f = c + m, p = d - m, y = d + m;
|
|
692
689
|
return [f, p, u, y];
|
|
@@ -1054,6 +1051,7 @@ const moveFeature = (e, t) => {
|
|
|
1054
1051
|
const s = 8;
|
|
1055
1052
|
e.beginPath(), e.moveTo(n + s, l), e.lineTo(n, l), e.lineTo(n, l - s), e.moveTo(n, o + s), e.lineTo(n, o), e.lineTo(n + s, o), e.moveTo(r - s, o), e.lineTo(r, o), e.lineTo(r, o + s), e.moveTo(r, l - s), e.lineTo(r, l), e.lineTo(r - s, l), e.stroke(), e.restore();
|
|
1056
1053
|
}, drawShipLabel = (e, t, n) => {
|
|
1054
|
+
if (!t.selected && shipLabels.value.find((u) => u.name === t.name)) return;
|
|
1057
1055
|
const [o, r] = n, l = o - 0, i = r - 0, s = t.name;
|
|
1058
1056
|
let c;
|
|
1059
1057
|
t.leftIconColor && (c = { color: t.leftIconColor, icon: "" });
|
|
@@ -1061,6 +1059,7 @@ const moveFeature = (e, t) => {
|
|
|
1061
1059
|
const m = {
|
|
1062
1060
|
center: [l, i],
|
|
1063
1061
|
text: s,
|
|
1062
|
+
fill: t.fill,
|
|
1064
1063
|
color: "#fff",
|
|
1065
1064
|
textColor: "#000",
|
|
1066
1065
|
bgColor: "#fff",
|
|
@@ -1282,8 +1281,8 @@ const renderShips = (e) => {
|
|
|
1282
1281
|
}), document.addEventListener("mousemove", function(h) {
|
|
1283
1282
|
var g;
|
|
1284
1283
|
if (f) {
|
|
1285
|
-
let
|
|
1286
|
-
i.setPosition([p[0] +
|
|
1284
|
+
let T = (g = mapInstance$5.value) == null ? void 0 : g.getCoordinateFromPixel([h.clientX - y[0], h.clientY - y[1]]), M = T[0] - p[0], b = T[1] - p[1];
|
|
1285
|
+
i.setPosition([p[0] + M, p[1] + b]);
|
|
1287
1286
|
}
|
|
1288
1287
|
}), document.addEventListener("mouseup", function() {
|
|
1289
1288
|
f = !1;
|
|
@@ -1427,8 +1426,8 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1427
1426
|
nextTick(() => {
|
|
1428
1427
|
var h;
|
|
1429
1428
|
(h = n.value) == null || h.on("moveend", () => {
|
|
1430
|
-
var
|
|
1431
|
-
const g = (
|
|
1429
|
+
var T, M;
|
|
1430
|
+
const g = (M = (T = n.value) == null ? void 0 : T.getView()) == null ? void 0 : M.getZoom();
|
|
1432
1431
|
g && (l.value = g);
|
|
1433
1432
|
});
|
|
1434
1433
|
});
|
|
@@ -1457,7 +1456,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1457
1456
|
h.vehicleMode === "ship" ? (openBlock(), createElementBlock("div", {
|
|
1458
1457
|
key: 2,
|
|
1459
1458
|
class: normalizeClass(`switch-btn ${h.mapTileMode === unref(BaseMapType).satellite && "active"}`),
|
|
1460
|
-
onClick: g[0] || (g[0] = (
|
|
1459
|
+
onClick: g[0] || (g[0] = (T) => m())
|
|
1461
1460
|
}, g[7] || (g[7] = [
|
|
1462
1461
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1463
1462
|
createElementVNode("div", { class: "button-text" }, "图层", -1)
|
|
@@ -1465,7 +1464,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1465
1464
|
h.vehicleMode === "truck" ? (openBlock(), createElementBlock("div", {
|
|
1466
1465
|
key: 3,
|
|
1467
1466
|
class: normalizeClass(`switch-btn ${h.mapTileMode === unref(BaseMapType).satellite && "active"}`),
|
|
1468
|
-
onClick: g[1] || (g[1] = (
|
|
1467
|
+
onClick: g[1] || (g[1] = (T) => m())
|
|
1469
1468
|
}, g[8] || (g[8] = [
|
|
1470
1469
|
createElementVNode("i", { class: "map-iconfont icon-space" }, null, -1),
|
|
1471
1470
|
createElementVNode("div", { class: "button-text" }, "卫星", -1)
|
|
@@ -1473,14 +1472,14 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1473
1472
|
h.showTrackLayer ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1474
1473
|
createElementVNode("div", {
|
|
1475
1474
|
class: "switch-btn multiple",
|
|
1476
|
-
onClick: g[2] || (g[2] = (
|
|
1475
|
+
onClick: g[2] || (g[2] = (T) => unref(playTrack)(unref(currentTrackId), 1))
|
|
1477
1476
|
}, g[9] || (g[9] = [
|
|
1478
1477
|
createElementVNode("i", { class: "map-iconfont icon-play" }, null, -1),
|
|
1479
1478
|
createElementVNode("div", { class: "button-text" }, "播放轨迹", -1)
|
|
1480
1479
|
])),
|
|
1481
1480
|
createElementVNode("div", {
|
|
1482
1481
|
class: "switch-btn multiple",
|
|
1483
|
-
onClick: g[3] || (g[3] = (
|
|
1482
|
+
onClick: g[3] || (g[3] = (T) => unref(resetTrackView)())
|
|
1484
1483
|
}, g[10] || (g[10] = [
|
|
1485
1484
|
createElementVNode("i", { class: "map-iconfont icon-center" }, null, -1),
|
|
1486
1485
|
createElementVNode("div", { class: "button-text" }, "轨迹居中", -1)
|
|
@@ -1521,7 +1520,7 @@ const trackId = ref(""), cursor = ref(0), renderTrack = (e, t, n, o, r = "ship")
|
|
|
1521
1520
|
ref_key: "measureRef",
|
|
1522
1521
|
ref: s,
|
|
1523
1522
|
visible: i.value,
|
|
1524
|
-
"onUpdate:visible": g[4] || (g[4] = (
|
|
1523
|
+
"onUpdate:visible": g[4] || (g[4] = (T) => i.value = T),
|
|
1525
1524
|
onClose: f,
|
|
1526
1525
|
"view-mode": h.viewMode
|
|
1527
1526
|
}, null, 8, ["visible", "view-mode"])) : createCommentVNode("", !0)
|
|
@@ -1615,8 +1614,8 @@ const setTruckStyle = (e, t, n, o) => new Style({
|
|
|
1615
1614
|
const p = 56, y = "#FFFFFF";
|
|
1616
1615
|
let h = 176;
|
|
1617
1616
|
const g = 52;
|
|
1618
|
-
let
|
|
1619
|
-
n === CAR_COLOR.YELLOW ? (h = 176,
|
|
1617
|
+
let T = "#164AFF", M = "#FFFFFF";
|
|
1618
|
+
n === CAR_COLOR.YELLOW ? (h = 176, T = "#FFC81E", M = "rgba(0,0,0,0.88)") : n === CAR_COLOR.Y_GREEN && (f = 200, h = 196, T = "#8FED7C", M = "rgba(0,0,0,0.88)"), o != null && o.length && (f += o.length * 56), fillRectRadius(i, m, u, f, p, y), fillRectRadius(i, m + 2, u + 2, h, g, T), n === CAR_COLOR.Y_GREEN && fillRectRadius(i, m + 2, u + 2, 68, g, "#FFC81E"), i.save(), i.restore(), i.fillStyle = M, i.font = "bold 28px Arial", i.textAlign = "left", i.textBaseline = "middle";
|
|
1620
1619
|
const b = `${t.slice(0, 2) + " · " + t.slice(2)}`;
|
|
1621
1620
|
if (i.fillText(b, m + 12, u + 32), i.save(), i.restore(), o != null && o.length) {
|
|
1622
1621
|
const x = i.measureText(b).width + 12;
|
|
@@ -1625,8 +1624,8 @@ const setTruckStyle = (e, t, n, o) => new Style({
|
|
|
1625
1624
|
w === DEVICE_TYPE.CAMERA && (i.drawImage(cameraImage, c - 54 + x + v * 56, d - 64, 50, 50), ++v), w === DEVICE_TYPE.LOAD && (i.drawImage(loadImage, c - 54 + x + v * 56, d - 64, 50, 50), ++v);
|
|
1626
1625
|
});
|
|
1627
1626
|
}
|
|
1628
|
-
const
|
|
1629
|
-
i.drawImage(
|
|
1627
|
+
const E = dotImage$1;
|
|
1628
|
+
i.drawImage(E, c + f / 2 - 90, d, 50 / s, 50 / s), i.restore();
|
|
1630
1629
|
}
|
|
1631
1630
|
}), mapInstance$3 = ref(), renderDashboardSetInstance = (e) => mapInstance$3.value = e;
|
|
1632
1631
|
ref([]);
|
|
@@ -1959,7 +1958,7 @@ const addInteraction = (e) => {
|
|
|
1959
1958
|
p.greenMark
|
|
1960
1959
|
],
|
|
1961
1960
|
view: new View(v)
|
|
1962
|
-
}), h(), (w = l.value) == null || w.setScaleLine(c.vehicleMode === "ship" && "nautical"), (k = o.value) == null || k.on("moveend", b), g(v.zoom < mapZoom.shipGreenDotMax),
|
|
1961
|
+
}), h(), (w = l.value) == null || w.setScaleLine(c.vehicleMode === "ship" && "nautical"), (k = o.value) == null || k.on("moveend", b), g(v.zoom < mapZoom.shipGreenDotMax), M(c.vehicleMode === "ship" || c.viewMode === "findShip" ? BaseMapType.satellite : BaseMapType.vector), c.viewMode === "findShip" && c.mmsi && c.shipData && nextTick(() => {
|
|
1963
1962
|
findShip(String(c.mmsi), c.shipData);
|
|
1964
1963
|
});
|
|
1965
1964
|
};
|
|
@@ -1973,24 +1972,24 @@ const addInteraction = (e) => {
|
|
|
1973
1972
|
c.vehicleMode !== "ship" && (v = !1), (w = o.value) == null || w.getLayers().forEach((k) => {
|
|
1974
1973
|
k.ol_uid === p.greenMark.ol_uid && (k.setVisible(v), u.value = v);
|
|
1975
1974
|
});
|
|
1976
|
-
},
|
|
1975
|
+
}, T = ref(BaseMapType.satellite), M = (v) => {
|
|
1977
1976
|
var w;
|
|
1978
|
-
|
|
1977
|
+
T.value = v, (w = o.value) == null || w.getLayers().forEach((k) => {
|
|
1979
1978
|
(k.ol_uid === p.tiandituTile.ol_uid || k.ol_uid === p.tiandituTileMark.ol_uid || k.ol_uid === p.tiandituImgTile.ol_uid || k.ol_uid === p.tiandituImgTileMark.ol_uid) && k.setVisible(!1), (v === BaseMapType.vector && (k.ol_uid === p.tiandituTile.ol_uid || k.ol_uid === p.tiandituTileMark.ol_uid) || v === BaseMapType.satellite && (k.ol_uid === p.tiandituImgTile.ol_uid || k.ol_uid === p.tiandituImgTileMark.ol_uid)) && k.setVisible(!0);
|
|
1980
1979
|
});
|
|
1981
1980
|
}, b = () => {
|
|
1982
1981
|
const v = o.value.getView(), w = v.getZoom();
|
|
1983
|
-
w &&
|
|
1982
|
+
w && E(w);
|
|
1984
1983
|
const k = v.calculateExtent(o.value.getSize());
|
|
1985
1984
|
k && w && x(k, w);
|
|
1986
|
-
},
|
|
1987
|
-
var
|
|
1985
|
+
}, E = (v) => {
|
|
1986
|
+
var C, L, S, V, F;
|
|
1988
1987
|
d.value = v, g(v < mapZoom.shipGreenDotMax);
|
|
1989
|
-
const w = (
|
|
1990
|
-
showTrackLayer.value ? (f.value = !1, k == null || k.setVisible(!1), (L = shipsLayer.value) == null || L.setVisible(!1), (
|
|
1988
|
+
const w = (C = o.value) == null ? void 0 : C.getLayers(), k = c.vehicleMode === "ship" ? w == null ? void 0 : w.getArray().find((N) => N.ol_uid === p.greenMark.ol_uid) : void 0;
|
|
1989
|
+
showTrackLayer.value ? (f.value = !1, k == null || k.setVisible(!1), (L = shipsLayer.value) == null || L.setVisible(!1), (S = largeAmountShipsLayer.value) == null || S.setVisible(!1)) : !m.value && u.value && v <= mapZoom.shipGreenDotMax ? (f.value = !0, k == null || k.setVisible(!0), (V = shipsLayer.value) == null || V.setVisible(!1), (F = largeAmountShipsLayer.value) == null || F.setVisible(!1)) : (f.value = !1, k == null || k.setVisible(!1)), s("zoomChanged", v);
|
|
1991
1990
|
}, x = (v, w) => {
|
|
1992
|
-
const k = transform([v[0], v[1]], projection.mercator, projection.data),
|
|
1993
|
-
s("extentChanged", { extent: [k,
|
|
1991
|
+
const k = transform([v[0], v[1]], projection.mercator, projection.data), C = transform([v[2], v[3]], projection.mercator, projection.data);
|
|
1992
|
+
s("extentChanged", { extent: [k, C], zoom: w });
|
|
1994
1993
|
};
|
|
1995
1994
|
return t({
|
|
1996
1995
|
mapInstance: o,
|
|
@@ -1998,8 +1997,8 @@ const addInteraction = (e) => {
|
|
|
1998
1997
|
renderTrucksMarker,
|
|
1999
1998
|
renderShip: renderShips,
|
|
2000
1999
|
renderTrack: (v, w, k) => {
|
|
2001
|
-
var
|
|
2002
|
-
currentTrackId.value = v, showTrackLayer.value = !0, m.value = !0, hiddenAllShips(), (L = (
|
|
2000
|
+
var C, L;
|
|
2001
|
+
currentTrackId.value = v, showTrackLayer.value = !0, m.value = !0, hiddenAllShips(), (L = (C = largeAmountShipsLayer.value) == null ? void 0 : C.getSource()) == null || L.clear(), renderTrack(v, w, k, LENGTH_UNIT.NM);
|
|
2003
2002
|
},
|
|
2004
2003
|
findTruck,
|
|
2005
2004
|
removeTruckIcon,
|
|
@@ -2017,8 +2016,8 @@ const addInteraction = (e) => {
|
|
|
2017
2016
|
clearSelectFeature,
|
|
2018
2017
|
findShip,
|
|
2019
2018
|
focusShip: (v, w, k = !0) => {
|
|
2020
|
-
var
|
|
2021
|
-
hiddenOrther.value = k, (
|
|
2019
|
+
var C, L;
|
|
2020
|
+
hiddenOrther.value = k, (C = shipsLayer.value) == null || C.setVisible(!k), (L = largeAmountShipsLayer.value) == null || L.setVisible(!1), findShip(v, w);
|
|
2022
2021
|
},
|
|
2023
2022
|
showTracks,
|
|
2024
2023
|
removeAllTrackLayer,
|
|
@@ -2036,12 +2035,12 @@ const addInteraction = (e) => {
|
|
|
2036
2035
|
var L;
|
|
2037
2036
|
const v = (L = o.value) == null ? void 0 : L.getView();
|
|
2038
2037
|
if (!v) return null;
|
|
2039
|
-
const w = Math.round(Number(v.getZoom())), { lon: k, lat:
|
|
2040
|
-
return { zoom: w, center: [k,
|
|
2038
|
+
const w = Math.round(Number(v.getZoom())), { lon: k, lat: C } = transformUtils.mercatorToLonLat(v.getCenter());
|
|
2039
|
+
return { zoom: w, center: [k, C] };
|
|
2041
2040
|
},
|
|
2042
2041
|
setCenter: (v) => {
|
|
2043
|
-
var
|
|
2044
|
-
const w = (
|
|
2042
|
+
var C;
|
|
2043
|
+
const w = (C = o.value) == null ? void 0 : C.getView();
|
|
2045
2044
|
if (!w) return null;
|
|
2046
2045
|
const k = new Point(v);
|
|
2047
2046
|
w.setCenter(transform(k.getCoordinates(), projection.data, projection.mercator));
|
|
@@ -2070,9 +2069,9 @@ const addInteraction = (e) => {
|
|
|
2070
2069
|
"view-mode": v.viewMode,
|
|
2071
2070
|
"disable-green-dot": m.value,
|
|
2072
2071
|
"show-track-layer": unref(showTrackLayer),
|
|
2073
|
-
"map-tile-mode":
|
|
2072
|
+
"map-tile-mode": T.value,
|
|
2074
2073
|
onSwitchGreenDot: g,
|
|
2075
|
-
onSwitchMapTile:
|
|
2074
|
+
onSwitchMapTile: M
|
|
2076
2075
|
}, {
|
|
2077
2076
|
toolPanel: withCtx(() => [
|
|
2078
2077
|
renderSlot(v.$slots, "toolPanel", {}, void 0, !0)
|
|
@@ -2106,8 +2105,8 @@ const setPointStyle = (e, t, n) => {
|
|
|
2106
2105
|
d.scale(m, m);
|
|
2107
2106
|
let [u, f] = s;
|
|
2108
2107
|
u = u / m, f = f / m, d.font = "12px Arial";
|
|
2109
|
-
const p = d.measureText(t).width, y = u - p / 2, h = f - 10, g = p + 4,
|
|
2110
|
-
if (fillRectRadius(d, y, h + 30, g,
|
|
2108
|
+
const p = d.measureText(t).width, y = u - p / 2, h = f - 10, g = p + 4, T = 20, M = e && i || o;
|
|
2109
|
+
if (fillRectRadius(d, y, h + 30, g, T, M), d.save(), d.restore(), d.fillStyle = e ? "#FFFFFF" : "#000000", d.textAlign = "center", d.textBaseline = "middle", d.fillText(t, y + (p + 4) / 2, h + 41), d.save(), d.restore(), r || l) {
|
|
2111
2110
|
const b = e ? dotActiveImage : dotImage;
|
|
2112
2111
|
d.drawImage(b, u - b.width / 2, f - b.height / 2, 40 / m, 40 / m);
|
|
2113
2112
|
}
|
|
@@ -2123,16 +2122,16 @@ class PointMarkerClass {
|
|
|
2123
2122
|
* @param options
|
|
2124
2123
|
*/
|
|
2125
2124
|
constructor(t, n) {
|
|
2126
|
-
|
|
2125
|
+
I(this, "mapInstance");
|
|
2127
2126
|
// 渲染的数据
|
|
2128
|
-
|
|
2127
|
+
I(this, "pointMarkerList", []);
|
|
2129
2128
|
// 绘制点渲染层数据
|
|
2130
|
-
|
|
2129
|
+
I(this, "pointsVectorSource");
|
|
2131
2130
|
// 当前高亮的数据
|
|
2132
|
-
|
|
2133
|
-
|
|
2131
|
+
I(this, "highlightPoint");
|
|
2132
|
+
I(this, "pointLayer");
|
|
2134
2133
|
// 颜色等其他设置
|
|
2135
|
-
|
|
2134
|
+
I(this, "options");
|
|
2136
2135
|
this.mapInstance = t, this.options = n;
|
|
2137
2136
|
}
|
|
2138
2137
|
/**
|
|
@@ -2179,22 +2178,23 @@ class PointMarkerClass {
|
|
|
2179
2178
|
source: this.pointsVectorSource
|
|
2180
2179
|
}), this.mapInstance.addLayer(this.pointLayer), console.log(this.pointLayer);
|
|
2181
2180
|
}
|
|
2182
|
-
//
|
|
2183
|
-
deleteAllPointMarkers() {
|
|
2184
|
-
this.pointMarkerList.forEach((
|
|
2185
|
-
var
|
|
2186
|
-
|
|
2187
|
-
})
|
|
2181
|
+
// 删除 未选中的渲染点
|
|
2182
|
+
deleteAllPointMarkers(t) {
|
|
2183
|
+
this.pointMarkerList.forEach((n) => {
|
|
2184
|
+
var o;
|
|
2185
|
+
n.feature && t !== n.id && ((o = this.pointsVectorSource) == null || o.removeFeature(n.feature));
|
|
2186
|
+
});
|
|
2188
2187
|
}
|
|
2189
2188
|
// 取消高亮
|
|
2190
2189
|
cancelHighlightTruckMarker() {
|
|
2191
|
-
var r;
|
|
2192
2190
|
if (!this.highlightPoint)
|
|
2193
2191
|
return;
|
|
2194
|
-
const { id: t, name: n } = this.highlightPoint
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2192
|
+
const { id: t, name: n } = this.highlightPoint;
|
|
2193
|
+
this.highlightPoint = void 0, this.pointMarkerList.find((o) => {
|
|
2194
|
+
o.id === t && o.feature.setStyle(
|
|
2195
|
+
setPointStyle(!1, n, this.options)
|
|
2196
|
+
);
|
|
2197
|
+
});
|
|
2198
2198
|
}
|
|
2199
2199
|
/**
|
|
2200
2200
|
* 设置选中
|
|
@@ -2223,12 +2223,6 @@ class PointMarkerClass {
|
|
|
2223
2223
|
pointType: s
|
|
2224
2224
|
}, this.setPointCenter(c);
|
|
2225
2225
|
}
|
|
2226
|
-
//隐藏其他点
|
|
2227
|
-
hiddenPointMarker(t) {
|
|
2228
|
-
this.pointMarkerList.forEach((n) => {
|
|
2229
|
-
n.id !== t && n.feature && n.feature.setStyle(void 0);
|
|
2230
|
-
});
|
|
2231
|
-
}
|
|
2232
2226
|
// 获取feature
|
|
2233
2227
|
getFeature(t, n) {
|
|
2234
2228
|
var r;
|