gisviewer-vue3-arcgis 1.0.252 → 1.0.254
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/es/src/gis-map/gis-map.vue.d.ts +1 -0
- package/es/src/gis-map/gis-map.vue.mjs +107 -104
- package/es/src/gis-map/index.d.ts +1 -0
- package/es/src/gis-map/utils/dbscan-cluster/index.d.ts +1 -0
- package/es/src/gis-map/utils/dbscan-cluster/index.mjs +89 -74
- package/es/src/gis-map/utils/signal-control-area/district-controller.mjs +4 -4
- package/es/src/types/index.d.ts +4 -4
- package/lib/src/gis-map/gis-map.vue.d.ts +1 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +1 -0
- package/lib/src/gis-map/utils/dbscan-cluster/index.d.ts +1 -0
- package/lib/src/gis-map/utils/dbscan-cluster/index.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/district-controller.js +1 -1
- package/lib/src/types/index.d.ts +4 -4
- package/package.json +1 -1
|
@@ -116,6 +116,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
116
116
|
toggleVehicleInfo: (contentType: string) => void;
|
|
117
117
|
addOverlays: (params: IOverlayParam) => Promise<import("../types").IResult>;
|
|
118
118
|
addClusterPoints: (params: IClusterPointParams) => Promise<void>;
|
|
119
|
+
removeAllClusterPoints: () => void;
|
|
119
120
|
addMask: (params: IMaskParam) => void;
|
|
120
121
|
removeMask: () => void;
|
|
121
122
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ct, ref as z, reactive as lt, onMounted as ut, getCurrentInstance as mt, onUnmounted as pt, computed as dt, openBlock as T, createElementBlock as _, createElementVNode as y, withDirectives as gt, vShow as ft, Fragment as yt, renderList as Ct, createBlock as vt } from "vue";
|
|
2
2
|
import x, { registerStore as St } from "./stores/index.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import wt from "./utils/dbscan-cluster/index.mjs";
|
|
5
|
+
import ht from "./utils/detect-gpu.mjs";
|
|
6
|
+
import bt from "./utils/edpass-device-controller.mjs";
|
|
7
7
|
import G from "./utils/green-wave-band-controller/index.mjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import Ot from "./utils/holo-flow/index.mjs";
|
|
9
|
+
import At from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
|
|
10
|
+
import kt from "./utils/map-initializer.mjs";
|
|
11
11
|
import H from "./utils/open-drive-renderer/index.mjs";
|
|
12
12
|
import E from "./utils/overlay.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import Dt from "./utils/police-jurisdiction.mjs";
|
|
14
|
+
import Lt from "./utils/queue-length.mjs";
|
|
15
15
|
import N from "./utils/road-config-tool/index.mjs";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
16
|
+
import Tt from "./utils/signal-control-area/edit-area.mjs";
|
|
17
|
+
import It from "./utils/signal-control-area/show-area.mjs";
|
|
18
|
+
import Mt from "./utils/traffic-flow.mjs";
|
|
19
|
+
const Bt = { class: "gis-viewer" }, Pt = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, Rt = /* @__PURE__ */ ct({
|
|
20
20
|
__name: "gis-map",
|
|
21
21
|
props: {
|
|
22
22
|
config: {},
|
|
@@ -24,47 +24,47 @@ const Mt = { class: "gis-viewer" }, Bt = { style: { position: "absolute", bottom
|
|
|
24
24
|
},
|
|
25
25
|
emits: ["mapLoaded", "markerClick", "mapClick", "update:zoom"],
|
|
26
26
|
setup(W, { expose: Z, emit: Q }) {
|
|
27
|
-
const
|
|
28
|
-
let n, p, c, o, a, r, g, t, l, s, d,
|
|
29
|
-
const O =
|
|
27
|
+
const h = z(null);
|
|
28
|
+
let n, p, c, o, a, r, g, t, l, s, d, C, b, f;
|
|
29
|
+
const O = z(!1);
|
|
30
30
|
St();
|
|
31
|
-
const I = x.useAppDataStore, M =
|
|
32
|
-
let
|
|
31
|
+
const I = x.useAppDataStore, M = lt([]), B = (e) => Math.log2(591657527591555e-6 / e);
|
|
32
|
+
let v = null, P = null;
|
|
33
33
|
const A = (e) => {
|
|
34
34
|
if (!Number.isFinite(e))
|
|
35
35
|
return;
|
|
36
36
|
const u = Math.round(e);
|
|
37
|
-
u !==
|
|
37
|
+
u !== P && (P = u, S("update:zoom", u));
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
if (!
|
|
39
|
+
ht(), ut(async () => {
|
|
40
|
+
if (!h.value)
|
|
41
41
|
return;
|
|
42
42
|
document.addEventListener("keydown", (m) => {
|
|
43
43
|
m.ctrlKey && m.key === "i" && (O.value = !O.value);
|
|
44
44
|
});
|
|
45
|
-
const e =
|
|
46
|
-
i.assetsRoot =
|
|
47
|
-
container:
|
|
45
|
+
const e = mt(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(V.config)).json();
|
|
46
|
+
i.assetsRoot = V.assetsRoot || u, I.mapConfig = i, p = new kt(), I.mapInitializer = p, n = await p.initialize({
|
|
47
|
+
container: h.value,
|
|
48
48
|
mapConfig: i,
|
|
49
|
-
markerClickCallback: (m, D, L,
|
|
50
|
-
S("markerClick", m, D, L,
|
|
49
|
+
markerClickCallback: (m, D, L, it) => {
|
|
50
|
+
S("markerClick", m, D, L, it);
|
|
51
51
|
},
|
|
52
52
|
mapClickCallback: (m, D, L) => {
|
|
53
53
|
S("mapClick", m, D, L);
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
const
|
|
57
|
-
typeof
|
|
58
|
-
const
|
|
56
|
+
const w = n.zoom ?? (n.scale ? B(n.scale) : void 0);
|
|
57
|
+
typeof w == "number" && A(w);
|
|
58
|
+
const ot = n.zoom !== void 0 ? n.watch("zoom", (m) => {
|
|
59
59
|
A(m);
|
|
60
60
|
}) : n.watch("scale", (m) => {
|
|
61
61
|
typeof m == "number" && m > 0 && A(B(m));
|
|
62
62
|
});
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
s == null || s.clearSignalControlArea(), t == null || t.clearOpenDrive(), a.clearHoloTrace(), a.clearHoloSignal(), o == null || o.disconnectTrafficFlow(),
|
|
63
|
+
v = () => ot.remove(), a = new Ot(n, M), await a.init(), S("mapLoaded");
|
|
64
|
+
}), pt(() => {
|
|
65
|
+
s == null || s.clearSignalControlArea(), t == null || t.clearOpenDrive(), a.clearHoloTrace(), a.clearHoloSignal(), o == null || o.disconnectTrafficFlow(), v == null || v(), v = null;
|
|
66
66
|
});
|
|
67
|
-
const j =
|
|
67
|
+
const j = dt(() => n), J = () => {
|
|
68
68
|
const e = x.useAppDataStore;
|
|
69
69
|
e.saveTrackLog = !0;
|
|
70
70
|
}, U = () => {
|
|
@@ -81,7 +81,7 @@ const Mt = { class: "gis-viewer" }, Bt = { style: { position: "absolute", bottom
|
|
|
81
81
|
c == null || c.clearLaneNumber();
|
|
82
82
|
}, se = async (e) => (c || (c = new N(n)), await c.initializeSearch(e)), oe = async () => c == null ? void 0 : c.calCrossIndicatorArea(), ie = async () => {
|
|
83
83
|
}, ce = async (e, u) => {
|
|
84
|
-
o || (o = new
|
|
84
|
+
o || (o = new Mt(n)), o.connectTrafficFlow(e, u);
|
|
85
85
|
}, le = () => {
|
|
86
86
|
o == null || o.disconnectTrafficFlow();
|
|
87
87
|
}, ue = async (e) => {
|
|
@@ -100,56 +100,58 @@ const Mt = { class: "gis-viewer" }, Bt = { style: { position: "absolute", bottom
|
|
|
100
100
|
a.clearHoloSignal();
|
|
101
101
|
}, Ce = (e) => {
|
|
102
102
|
o == null || o.toggleTrafficInfo(e), a == null || a.toggleTrafficInfo(e);
|
|
103
|
-
}, Se = (e) => {
|
|
104
|
-
a == null || a.togglePause(e);
|
|
105
103
|
}, ve = (e) => {
|
|
104
|
+
a == null || a.togglePause(e);
|
|
105
|
+
}, Se = (e) => {
|
|
106
106
|
o == null || o.toggleTrafficObject(e), a == null || a.toggleTrafficObject(e);
|
|
107
107
|
}, k = (e) => {
|
|
108
108
|
a == null || a.updatePanelContent(e);
|
|
109
|
-
}, we = async (e) => (r || (r = new E(n)), r.addOverlays(e)), he = async (e) => (
|
|
109
|
+
}, we = async (e) => (r || (r = new E(n)), r.addOverlays(e)), he = async (e) => (f || (f = new wt(n)), f.addClusterPoints(e)), be = () => {
|
|
110
|
+
f == null || f.removeAllClusterPoints();
|
|
111
|
+
}, Oe = (e) => (r || (r = new E(n)), r.addMask(e)), Ae = () => {
|
|
110
112
|
r == null || r.removeMask();
|
|
111
|
-
},
|
|
113
|
+
}, ke = (e) => r == null ? void 0 : r.removeOverlaysByType(e), De = (e) => r == null ? void 0 : r.removeOverlaysById(e), Le = () => r == null ? void 0 : r.removeAllOverlays(), Te = () => {
|
|
112
114
|
r == null || r.showAllOverlays();
|
|
113
|
-
},
|
|
114
|
-
g || (g = new
|
|
115
|
-
},
|
|
115
|
+
}, Ie = (e) => {
|
|
116
|
+
g || (g = new Lt(n)), g.updateQueueLength(e);
|
|
117
|
+
}, Me = () => {
|
|
116
118
|
g == null || g.removeQueueLength();
|
|
117
|
-
},
|
|
119
|
+
}, Be = async (e, u) => (t || (t = new H(n)), await t.showOpenDriveFromServer(e, u)), Pe = async (e) => (t || (t = new H(n)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), Ve = (e) => t ? t.setOpendriveVisibility(e) : {
|
|
118
120
|
status: -1,
|
|
119
121
|
message: "未加载OpenDrive地图"
|
|
120
|
-
}, ze = async () => await (t == null ? void 0 : t.clearOpenDrive()),
|
|
122
|
+
}, ze = async () => await (t == null ? void 0 : t.clearOpenDrive()), _e = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
|
|
121
123
|
status: -1,
|
|
122
124
|
message: "未加载OpenDrive地图"
|
|
123
|
-
},
|
|
125
|
+
}, xe = async (e) => t ? t.selectSumo(e) : {
|
|
124
126
|
status: -1,
|
|
125
127
|
message: "未加载OpenDrive地图"
|
|
126
|
-
},
|
|
128
|
+
}, Ge = async (e) => t ? t.unselectSumo(e) : {
|
|
127
129
|
status: -1,
|
|
128
130
|
message: "未加载OpenDrive地图"
|
|
129
|
-
},
|
|
131
|
+
}, He = async (e) => t ? await t.geometrySearch(e) : {
|
|
130
132
|
status: -1,
|
|
131
133
|
message: "未加载OpenDrive地图"
|
|
132
|
-
},
|
|
134
|
+
}, Ee = async (e) => t ? await t.getSumoInfo(e) : {
|
|
133
135
|
status: -1,
|
|
134
136
|
message: "未加载OpenDrive地图"
|
|
135
|
-
},
|
|
137
|
+
}, Ne = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
|
|
136
138
|
status: -1,
|
|
137
139
|
message: "未加载OpenDrive地图"
|
|
138
|
-
},
|
|
140
|
+
}, We = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
|
|
139
141
|
status: -1,
|
|
140
142
|
message: "未加载OpenDrive地图"
|
|
141
|
-
},
|
|
143
|
+
}, Ze = async (e) => (s || (s = new It(n)), await s.showSignalControlArea(e)), Qe = async () => await (s == null ? void 0 : s.clearSignalControlArea()), je = (e) => s == null ? void 0 : s.setLayerVisibility(e), Je = async (e) => s ? await (s == null ? void 0 : s.locateSignalControlArea(e)) : { status: -1, message: "未加载信号控制区" }, Ue = async (e) => s ? await s.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, $e = () => s ? s.resetHighlight() : { status: -1, message: "未加载信号控制区" }, qe = (e) => (l || (l = new Tt(n)), l.showSubSignalControlArea(e)), Ke = (e) => l ? l.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Fe = () => l ? l.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Re = (e) => l ? l.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Xe = (e) => l ? l.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Ye = (e) => {
|
|
142
144
|
if (!l)
|
|
143
145
|
return { status: -1, message: "未加载信号控制区" };
|
|
144
|
-
},
|
|
146
|
+
}, et = (e) => (d || (d = new G(n)), d.addGreenWaveBand(e)), tt = () => {
|
|
145
147
|
if (!d)
|
|
146
148
|
return { status: -1, message: "未加载绿波带" };
|
|
147
149
|
d.stopAddGreenWaveBand();
|
|
148
|
-
},
|
|
149
|
-
if (!
|
|
150
|
+
}, nt = async (e) => (d || (d = new G(n)), await d.showGreenWaveBand(e)), at = async (e) => (C || (C = new Dt(n)), await C.showJurisdiction(e)), rt = () => {
|
|
151
|
+
if (!C)
|
|
150
152
|
return { status: -1, message: "未加载警务管辖区" };
|
|
151
|
-
|
|
152
|
-
},
|
|
153
|
+
C.clearJurisdiction();
|
|
154
|
+
}, st = async (e) => (b || (b = new bt(n)), await b.setEdpassLayerVisibility(e)), V = W, S = Q;
|
|
153
155
|
return Z({
|
|
154
156
|
mapViewer: j,
|
|
155
157
|
setLayerVisibility: Y,
|
|
@@ -162,12 +164,13 @@ const Mt = { class: "gis-viewer" }, Bt = { style: { position: "absolute", bottom
|
|
|
162
164
|
cancelCoordinateTransform: te,
|
|
163
165
|
addOverlays: we,
|
|
164
166
|
addClusterPoints: he,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
removeAllClusterPoints: be,
|
|
168
|
+
addMask: Oe,
|
|
169
|
+
removeMask: Ae,
|
|
170
|
+
showAllOverlays: Te,
|
|
171
|
+
removeOverlaysByType: ke,
|
|
172
|
+
removeOverlaysById: De,
|
|
173
|
+
removeAllOverlays: Le,
|
|
171
174
|
showLaneNumber: ae,
|
|
172
175
|
clearLaneNumber: re,
|
|
173
176
|
initializeAreaTool: se,
|
|
@@ -183,66 +186,66 @@ const Mt = { class: "gis-viewer" }, Bt = { style: { position: "absolute", bottom
|
|
|
183
186
|
clearHoloSignal: ye,
|
|
184
187
|
setInterpolate: pe,
|
|
185
188
|
toggleTrafficInfo: Ce,
|
|
186
|
-
toggleTrafficObject:
|
|
189
|
+
toggleTrafficObject: Se,
|
|
187
190
|
toggleVehicleInfo: k,
|
|
188
|
-
togglePause:
|
|
189
|
-
updateQueueLength:
|
|
190
|
-
removeQueueLength:
|
|
191
|
-
showOpenDriveFromServer:
|
|
192
|
-
showOpenDriveFromFile:
|
|
191
|
+
togglePause: ve,
|
|
192
|
+
updateQueueLength: Ie,
|
|
193
|
+
removeQueueLength: Me,
|
|
194
|
+
showOpenDriveFromServer: Be,
|
|
195
|
+
showOpenDriveFromFile: Pe,
|
|
193
196
|
clearOpenDrive: ze,
|
|
194
197
|
setOpendriveVisibility: Ve,
|
|
195
|
-
geometrySearchInOpenDrive:
|
|
196
|
-
findSumoInOpenDrive:
|
|
197
|
-
selectSumoInOpenDrive:
|
|
198
|
-
unselectSumoInOpenDrive:
|
|
199
|
-
getSumoInfo:
|
|
200
|
-
splitOpenDriveLane:
|
|
201
|
-
clearSplitOpenDriveLane:
|
|
202
|
-
showSignalControlArea:
|
|
203
|
-
clearSignalControlArea:
|
|
204
|
-
setSignalControlAreaVisibility:
|
|
205
|
-
locateSignalControlArea:
|
|
206
|
-
highlightSignalControlArea:
|
|
207
|
-
resetHighlightSignalControlArea:
|
|
208
|
-
showSubSignalControlArea:
|
|
209
|
-
editSubSignalControlArea:
|
|
210
|
-
stopEditSubSignalControlArea:
|
|
211
|
-
selectSubSignalControlAreaCross:
|
|
212
|
-
unselectSubSignalControlAreaCross:
|
|
213
|
-
changeSubSignalControlAreaBorderVisibility:
|
|
214
|
-
addGreenWaveBand:
|
|
215
|
-
stopAddGreenWaveBand:
|
|
216
|
-
showGreenWaveBand:
|
|
217
|
-
showPoliceArea:
|
|
218
|
-
clearPoliceArea:
|
|
219
|
-
setEdpassLayerVisibility:
|
|
220
|
-
}), (e, u) => (T(), _("div",
|
|
221
|
-
|
|
198
|
+
geometrySearchInOpenDrive: He,
|
|
199
|
+
findSumoInOpenDrive: _e,
|
|
200
|
+
selectSumoInOpenDrive: xe,
|
|
201
|
+
unselectSumoInOpenDrive: Ge,
|
|
202
|
+
getSumoInfo: Ee,
|
|
203
|
+
splitOpenDriveLane: Ne,
|
|
204
|
+
clearSplitOpenDriveLane: We,
|
|
205
|
+
showSignalControlArea: Ze,
|
|
206
|
+
clearSignalControlArea: Qe,
|
|
207
|
+
setSignalControlAreaVisibility: je,
|
|
208
|
+
locateSignalControlArea: Je,
|
|
209
|
+
highlightSignalControlArea: Ue,
|
|
210
|
+
resetHighlightSignalControlArea: $e,
|
|
211
|
+
showSubSignalControlArea: qe,
|
|
212
|
+
editSubSignalControlArea: Ke,
|
|
213
|
+
stopEditSubSignalControlArea: Fe,
|
|
214
|
+
selectSubSignalControlAreaCross: Re,
|
|
215
|
+
unselectSubSignalControlAreaCross: Xe,
|
|
216
|
+
changeSubSignalControlAreaBorderVisibility: Ye,
|
|
217
|
+
addGreenWaveBand: et,
|
|
218
|
+
stopAddGreenWaveBand: tt,
|
|
219
|
+
showGreenWaveBand: nt,
|
|
220
|
+
showPoliceArea: at,
|
|
221
|
+
clearPoliceArea: rt,
|
|
222
|
+
setEdpassLayerVisibility: st
|
|
223
|
+
}), (e, u) => (T(), _("div", Bt, [
|
|
224
|
+
y("div", {
|
|
222
225
|
class: "gis-viewer-main",
|
|
223
226
|
ref_key: "mapContainer",
|
|
224
|
-
ref:
|
|
227
|
+
ref: h
|
|
225
228
|
}, [
|
|
226
|
-
|
|
227
|
-
|
|
229
|
+
gt(y("div", Pt, [
|
|
230
|
+
y("button", {
|
|
228
231
|
style: { "margin-right": "10px" },
|
|
229
232
|
onClick: J
|
|
230
233
|
}, " 开始记录 "),
|
|
231
|
-
|
|
234
|
+
y("button", {
|
|
232
235
|
style: { "margin-right": "10px" },
|
|
233
236
|
onClick: U
|
|
234
237
|
}, " 下载日志 "),
|
|
235
|
-
|
|
238
|
+
y("button", {
|
|
236
239
|
style: { "margin-right": "10px" },
|
|
237
240
|
onClick: $
|
|
238
241
|
}, " 显示车辆id "),
|
|
239
|
-
|
|
242
|
+
y("button", { onClick: q }, "显示车辆号牌")
|
|
240
243
|
], 512), [
|
|
241
|
-
[
|
|
244
|
+
[ft, O.value]
|
|
242
245
|
])
|
|
243
246
|
], 512),
|
|
244
|
-
(T(!0), _(
|
|
245
|
-
key:
|
|
247
|
+
(T(!0), _(yt, null, Ct(M, (i, w) => (T(), vt(At, {
|
|
248
|
+
key: w,
|
|
246
249
|
"display-mode": i.displayMode,
|
|
247
250
|
flash: i.flash,
|
|
248
251
|
"road-id": i.crossId,
|
|
@@ -258,5 +261,5 @@ const Mt = { class: "gis-viewer" }, Bt = { style: { position: "absolute", bottom
|
|
|
258
261
|
}
|
|
259
262
|
});
|
|
260
263
|
export {
|
|
261
|
-
|
|
264
|
+
Rt as default
|
|
262
265
|
};
|
|
@@ -100,6 +100,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
100
100
|
toggleVehicleInfo: (contentType: string) => void;
|
|
101
101
|
addOverlays: (params: import("../types").IOverlayParam) => Promise<import("../types").IResult>;
|
|
102
102
|
addClusterPoints: (params: import("../types").IClusterPointParams) => Promise<void>;
|
|
103
|
+
removeAllClusterPoints: () => void;
|
|
103
104
|
addMask: (params: import("../types").IMaskParam) => void;
|
|
104
105
|
removeMask: () => void;
|
|
105
106
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import * as f from "@arcgis/core/core/reactiveUtils";
|
|
2
|
-
import { Point as
|
|
2
|
+
import { Point as h } from "@arcgis/core/geometry";
|
|
3
3
|
import m from "@arcgis/core/Graphic";
|
|
4
4
|
import b from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.zoomWatchHandle = null, this.locations = [], this.clusterMarkUrl = "", this.currentZoom = 0, this.view =
|
|
5
|
+
class I {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.zoomWatchHandle = null, this.locations = [], this.clusterMarkUrl = "", this.currentZoom = 0, this.view = t, this.currentZoom = t.zoom, this.clusterLayer = new b(), this.view.map.add(this.clusterLayer);
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* 将地理位置转换为屏幕坐标
|
|
11
11
|
*/
|
|
12
12
|
locationToScreen() {
|
|
13
|
-
this.locations.forEach((
|
|
13
|
+
this.locations.forEach((t) => {
|
|
14
14
|
const s = this.view.toScreen(
|
|
15
|
-
new
|
|
15
|
+
new h({ x: t.x, y: t.y })
|
|
16
16
|
);
|
|
17
|
-
|
|
17
|
+
t.properties.screenX = s.x, t.properties.screenY = s.y;
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* 添加聚类点到视图
|
|
22
22
|
* @param params
|
|
23
23
|
*/
|
|
24
|
-
addClusterPoints(
|
|
25
|
-
var
|
|
26
|
-
this.locations =
|
|
27
|
-
|
|
24
|
+
addClusterPoints(t) {
|
|
25
|
+
var i;
|
|
26
|
+
this.locations = t.points, this.clusterMarkUrl = ((i = t.clusterSymbol) == null ? void 0 : i.url) || "/GisViewerAssets/Images/cross/gis_xhj_blue.png", this.locations = this.locations.filter((e) => e.x !== null && e.y !== null && !isNaN(e.x) && !isNaN(e.y)), this.locations.forEach((e) => {
|
|
27
|
+
e.x = Number(e.x), e.y = Number(e.y), e.symbol || (e.symbol = t.pointSymbol || {
|
|
28
28
|
type: "simple-marker",
|
|
29
29
|
style: "circle",
|
|
30
30
|
color: "#3388ff",
|
|
@@ -37,24 +37,33 @@ class M {
|
|
|
37
37
|
}), this.zoomWatchHandle || (this.zoomWatchHandle = f.watch(
|
|
38
38
|
() => this.view.zoom,
|
|
39
39
|
() => {
|
|
40
|
-
Math.abs(this.currentZoom - this.view.zoom) >= 1
|
|
40
|
+
if (Math.abs(this.currentZoom - this.view.zoom) >= 1) {
|
|
41
|
+
this.currentZoom = this.view.zoom, this.locationToScreen(), console.time("cluster");
|
|
42
|
+
const e = this.doPixelCluster(120, 3);
|
|
43
|
+
console.timeEnd("cluster"), this.showClusters(e);
|
|
44
|
+
}
|
|
41
45
|
}
|
|
42
|
-
)), this.locationToScreen()
|
|
43
|
-
const s = this.doPixelCluster(
|
|
44
|
-
|
|
46
|
+
)), this.locationToScreen();
|
|
47
|
+
const s = this.doPixelCluster(120, 3);
|
|
48
|
+
this.showClusters(s);
|
|
49
|
+
}
|
|
50
|
+
removeAllClusterPoints() {
|
|
51
|
+
var t;
|
|
52
|
+
(t = this.zoomWatchHandle) == null || t.remove(), this.zoomWatchHandle = null, this.clusterLayer.removeAll();
|
|
45
53
|
}
|
|
46
|
-
showClusters(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
showClusters(t) {
|
|
55
|
+
this.clusterLayer.removeAll();
|
|
56
|
+
let s = Number.MIN_VALUE, i = Number.MAX_VALUE;
|
|
57
|
+
t.forEach((e) => {
|
|
58
|
+
e.count > 1 && (i = Math.min(i, e.count), s = Math.max(s, e.count));
|
|
59
|
+
}), t.forEach((e) => {
|
|
60
|
+
if (e.id !== -1) {
|
|
61
|
+
let r = i === s ? (this.maxClusterSymbolSize + this.minClusterSymbolSize) / 2 : this.minClusterSymbolSize + (e.count - i) / (s - i) * (this.maxClusterSymbolSize - this.minClusterSymbolSize);
|
|
62
|
+
r *= 0.75;
|
|
63
|
+
const l = (e.count.toString().length * 8 + 6) / 2, c = new m({
|
|
64
|
+
geometry: new h({ x: e.center.x, y: e.center.y }),
|
|
56
65
|
attributes: {
|
|
57
|
-
count:
|
|
66
|
+
count: e.count
|
|
58
67
|
},
|
|
59
68
|
symbol: {
|
|
60
69
|
type: "cim",
|
|
@@ -80,7 +89,7 @@ class M {
|
|
|
80
89
|
// 聚合数量
|
|
81
90
|
{
|
|
82
91
|
type: "CIMVectorMarker",
|
|
83
|
-
size:
|
|
92
|
+
size: r,
|
|
84
93
|
colorLocked: !0,
|
|
85
94
|
anchorPointUnits: "Relative",
|
|
86
95
|
frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
|
|
@@ -91,11 +100,11 @@ class M {
|
|
|
91
100
|
geometry: {
|
|
92
101
|
rings: [
|
|
93
102
|
[
|
|
94
|
-
[-
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[-
|
|
98
|
-
[-
|
|
103
|
+
[-l, 40],
|
|
104
|
+
[l, 40],
|
|
105
|
+
[l, 20],
|
|
106
|
+
[-l, 20],
|
|
107
|
+
[-l, 40]
|
|
99
108
|
]
|
|
100
109
|
]
|
|
101
110
|
},
|
|
@@ -154,7 +163,7 @@ class M {
|
|
|
154
163
|
y: 0
|
|
155
164
|
},
|
|
156
165
|
anchorPointUnits: "Relative",
|
|
157
|
-
size:
|
|
166
|
+
size: r,
|
|
158
167
|
rotateClockwise: !0,
|
|
159
168
|
textureFilter: "Picture",
|
|
160
169
|
url: this.clusterMarkUrl
|
|
@@ -164,15 +173,19 @@ class M {
|
|
|
164
173
|
}
|
|
165
174
|
}
|
|
166
175
|
});
|
|
167
|
-
this.clusterLayer.add(
|
|
176
|
+
this.clusterLayer.add(c);
|
|
168
177
|
} else
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
geometry: new
|
|
172
|
-
attributes:
|
|
173
|
-
|
|
178
|
+
e.items.forEach((r) => {
|
|
179
|
+
const o = new m({
|
|
180
|
+
geometry: new h({ x: r.x, y: r.y }),
|
|
181
|
+
attributes: {
|
|
182
|
+
...r.properties,
|
|
183
|
+
type: "clusterPoint",
|
|
184
|
+
id: r.id
|
|
185
|
+
},
|
|
186
|
+
symbol: r.symbol
|
|
174
187
|
});
|
|
175
|
-
this.clusterLayer.add(
|
|
188
|
+
this.clusterLayer.add(o);
|
|
176
189
|
});
|
|
177
190
|
});
|
|
178
191
|
}
|
|
@@ -183,9 +196,9 @@ class M {
|
|
|
183
196
|
* @param eps
|
|
184
197
|
* @returns
|
|
185
198
|
*/
|
|
186
|
-
getNeighbors(
|
|
187
|
-
const
|
|
188
|
-
return
|
|
199
|
+
getNeighbors(t, s, i) {
|
|
200
|
+
const e = t[s];
|
|
201
|
+
return t.filter((r) => r.id === e.id || r.visited ? !1 : this.getDistance(e, r) <= i);
|
|
189
202
|
}
|
|
190
203
|
/**
|
|
191
204
|
* 两点间的像素距离
|
|
@@ -193,9 +206,9 @@ class M {
|
|
|
193
206
|
* @param point2
|
|
194
207
|
* @returns
|
|
195
208
|
*/
|
|
196
|
-
getDistance(
|
|
209
|
+
getDistance(t, s) {
|
|
197
210
|
return Math.sqrt(
|
|
198
|
-
Math.pow(
|
|
211
|
+
Math.pow(t.properties.screenX - s.properties.screenX, 2) + Math.pow(t.properties.screenY - s.properties.screenY, 2)
|
|
199
212
|
);
|
|
200
213
|
}
|
|
201
214
|
/**
|
|
@@ -203,30 +216,30 @@ class M {
|
|
|
203
216
|
* @param locations
|
|
204
217
|
* @returns
|
|
205
218
|
*/
|
|
206
|
-
createClusters(
|
|
207
|
-
const s = {},
|
|
208
|
-
for (let
|
|
209
|
-
const
|
|
210
|
-
|
|
219
|
+
createClusters(t) {
|
|
220
|
+
const s = {}, i = [];
|
|
221
|
+
for (let r = 0; r < t.length; r++) {
|
|
222
|
+
const o = t[r];
|
|
223
|
+
o.clusterId === void 0 || o.clusterId === -1 ? i.push(o) : (s[o.clusterId] || (s[o.clusterId] = []), s[o.clusterId].push(o));
|
|
211
224
|
}
|
|
212
|
-
const
|
|
213
|
-
const
|
|
225
|
+
const e = Object.keys(s).map((r, o) => {
|
|
226
|
+
const n = s[Number(r)], l = n.length, c = n.reduce((a, u) => a + u.x, 0), y = n.reduce((a, u) => a + u.y, 0), d = c / l, p = y / l;
|
|
214
227
|
return {
|
|
215
|
-
id: Number(
|
|
216
|
-
items:
|
|
217
|
-
count:
|
|
228
|
+
id: Number(r),
|
|
229
|
+
items: n,
|
|
230
|
+
count: l,
|
|
218
231
|
center: {
|
|
219
|
-
x:
|
|
220
|
-
y:
|
|
232
|
+
x: d,
|
|
233
|
+
y: p
|
|
221
234
|
}
|
|
222
235
|
};
|
|
223
236
|
});
|
|
224
|
-
return
|
|
237
|
+
return i.length > 0 && e.push({
|
|
225
238
|
id: -1,
|
|
226
|
-
items:
|
|
227
|
-
count:
|
|
239
|
+
items: i,
|
|
240
|
+
count: i.length,
|
|
228
241
|
center: null
|
|
229
|
-
}),
|
|
242
|
+
}), e;
|
|
230
243
|
}
|
|
231
244
|
/**
|
|
232
245
|
* 按照像素距离聚类
|
|
@@ -235,22 +248,24 @@ class M {
|
|
|
235
248
|
* @param minPoints
|
|
236
249
|
* @returns
|
|
237
250
|
*/
|
|
238
|
-
doPixelCluster(
|
|
239
|
-
let
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
251
|
+
doPixelCluster(t, s) {
|
|
252
|
+
let i = 0;
|
|
253
|
+
this.locations.forEach((e) => {
|
|
254
|
+
e.visited = !1, e.clusterId = void 0;
|
|
255
|
+
});
|
|
256
|
+
for (let e = 0; e < this.locations.length; e++) {
|
|
257
|
+
const r = this.locations[e];
|
|
258
|
+
if (r.visited)
|
|
244
259
|
continue;
|
|
245
|
-
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
n.visited = !0, n.clusterId =
|
|
249
|
-
}),
|
|
260
|
+
r.visited = !0;
|
|
261
|
+
const o = this.getNeighbors(this.locations, e, t);
|
|
262
|
+
o.length < s ? r.clusterId = -1 : (o.forEach((n) => {
|
|
263
|
+
n.visited = !0, n.clusterId = i;
|
|
264
|
+
}), r.clusterId = i, i++);
|
|
250
265
|
}
|
|
251
|
-
return this.createClusters(
|
|
266
|
+
return this.createClusters(this.locations);
|
|
252
267
|
}
|
|
253
268
|
}
|
|
254
269
|
export {
|
|
255
|
-
|
|
270
|
+
I as default
|
|
256
271
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from "pako";
|
|
2
2
|
import c from "../common-utils.mjs";
|
|
3
3
|
class e {
|
|
4
4
|
constructor(o, s) {
|
|
@@ -10,15 +10,15 @@ class e {
|
|
|
10
10
|
try {
|
|
11
11
|
const a = t.mapConnectList, n = new Uint8Array(
|
|
12
12
|
window.atob(a).split("").map((r) => r.charCodeAt(0))
|
|
13
|
-
), l =
|
|
13
|
+
), l = d.inflate(n, { to: "string" }), h = JSON.parse(l);
|
|
14
14
|
i.roadConnections.push(
|
|
15
|
-
...
|
|
15
|
+
...h.map((r) => ({
|
|
16
16
|
id: r.roadsectId,
|
|
17
17
|
coordinates: JSON.parse(r.geomData).coordinates,
|
|
18
18
|
districtId: i.parentId,
|
|
19
19
|
subDistrictId: i.id
|
|
20
20
|
}))
|
|
21
|
-
)
|
|
21
|
+
);
|
|
22
22
|
} catch (a) {
|
|
23
23
|
console.error("解压子区路段连接信息失败:", a);
|
|
24
24
|
}
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -96,8 +96,8 @@ export interface IPointSymbol {
|
|
|
96
96
|
type: string;
|
|
97
97
|
style?: string;
|
|
98
98
|
url?: string;
|
|
99
|
-
width?: number;
|
|
100
|
-
height?: number;
|
|
99
|
+
width?: number | string;
|
|
100
|
+
height?: number | string;
|
|
101
101
|
xoffset?: number;
|
|
102
102
|
yoffset?: number;
|
|
103
103
|
horizontalOrigin?: string;
|
|
@@ -146,8 +146,8 @@ export interface IOverlayParam {
|
|
|
146
146
|
}
|
|
147
147
|
export interface IClusterPointParams {
|
|
148
148
|
type?: string;
|
|
149
|
-
clusterSymbol?:
|
|
150
|
-
pointSymbol?:
|
|
149
|
+
clusterSymbol?: any;
|
|
150
|
+
pointSymbol?: any;
|
|
151
151
|
points: IClusterLocation[];
|
|
152
152
|
}
|
|
153
153
|
export interface IClusterLocation {
|
|
@@ -116,6 +116,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
116
116
|
toggleVehicleInfo: (contentType: string) => void;
|
|
117
117
|
addOverlays: (params: IOverlayParam) => Promise<import("../types").IResult>;
|
|
118
118
|
addClusterPoints: (params: IClusterPointParams) => Promise<void>;
|
|
119
|
+
removeAllClusterPoints: () => void;
|
|
119
120
|
addMask: (params: IMaskParam) => void;
|
|
120
121
|
removeMask: () => void;
|
|
121
122
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),T=require("./stores/index.js");require("./style/index.css");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),T=require("./stores/index.js");require("./style/index.css");const st=require("./utils/dbscan-cluster/index.js"),ot=require("./utils/detect-gpu.js"),it=require("./utils/edpass-device-controller.js"),M=require("./utils/green-wave-band-controller/index.js"),ct=require("./utils/holo-flow/index.js"),lt=require("./utils/holo-flow/signal-countdown-panel.vue.js"),ut=require("./utils/map-initializer.js"),x=require("./utils/open-drive-renderer/index.js"),P=require("./utils/overlay.js"),dt=require("./utils/police-jurisdiction.js"),mt=require("./utils/queue-length.js"),z=require("./utils/road-config-tool/index.js"),pt=require("./utils/signal-control-area/edit-area.js"),gt=require("./utils/signal-control-area/show-area.js"),ft=require("./utils/traffic-flow.js"),yt={class:"gis-viewer"},vt={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},St=r.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick","update:zoom"],setup(E,{expose:N,emit:H}){const h=r.ref(null);let n,p,l,i,a,s,f,t,u,o,g,v,b,y;const O=r.ref(!1);T.registerStore();const q=T.default.useAppDataStore,V=r.reactive([]),_=e=>Math.log2(591657527591555e-6/e);let S=null,B=null;const A=e=>{if(!Number.isFinite(e))return;const d=Math.round(e);d!==B&&(B=d,w("update:zoom",d))};ot.default(),r.onMounted(async()=>{if(!h.value)return;document.addEventListener("keydown",m=>{m.ctrlKey&&m.key==="i"&&(O.value=!O.value)});const e=r.getCurrentInstance(),{$gisviewerAssetsRoot:d}=e.appContext.config.globalProperties,c=await(await fetch(I.config)).json();c.assetsRoot=I.assetsRoot||d,q.mapConfig=c,p=new ut.default,q.mapInitializer=p,n=await p.initialize({container:h.value,mapConfig:c,markerClickCallback:(m,L,D,rt)=>{w("markerClick",m,L,D,rt)},mapClickCallback:(m,L,D)=>{w("mapClick",m,L,D)}});const C=n.zoom??(n.scale?_(n.scale):void 0);typeof C=="number"&&A(C);const at=n.zoom!==void 0?n.watch("zoom",m=>{A(m)}):n.watch("scale",m=>{typeof m=="number"&&m>0&&A(_(m))});S=()=>at.remove(),a=new ct.default(n,V),await a.init(),w("mapLoaded")}),r.onUnmounted(()=>{o==null||o.clearSignalControlArea(),t==null||t.clearOpenDrive(),a.clearHoloTrace(),a.clearHoloSignal(),i==null||i.disconnectTrafficFlow(),S==null||S(),S=null});const G=r.computed(()=>n),Z=()=>{const e=T.default.useAppDataStore;e.saveTrackLog=!0},W=()=>{a.downloadTrackLog()},j=()=>{k("vehicleId")},J=()=>{k("plateNumber")},Q=async e=>await p.setMapCenter(e),U=async e=>await p.setMapCamera(e),K=e=>p.setMapZoom(e),F=async e=>await p.lookAt(e),X=e=>p.setLayerVisibility(e),Y=(e,d)=>p.requestCoordinateTransform(e,d),R=e=>{p.cancelCoordinateTransform(e)},$=e=>{p.setMapZoomRange(e)},ee=e=>(l||(l=new z.default(n)),l.showLaneNumber(e)),te=()=>{l==null||l.clearLaneNumber()},ne=async e=>(l||(l=new z.default(n)),await l.initializeSearch(e)),ae=async()=>l==null?void 0:l.calCrossIndicatorArea(),re=async()=>{},se=async(e,d)=>{i||(i=new ft.default(n)),i.connectTrafficFlow(e,d)},oe=()=>{i==null||i.disconnectTrafficFlow()},ie=async e=>{a.handleVehicleTraceData(e)},ce=()=>{a.clearHoloTrace()},le=e=>{a.setInterpolate(e)},ue=async e=>{await a.handleSignalData(e)},de=async e=>{await a.initializeLampGroup(e)},me=e=>{a.handleUniSignalData(e)},pe=()=>{a.clearHoloSignal()},ge=e=>{i==null||i.toggleTrafficInfo(e),a==null||a.toggleTrafficInfo(e)},fe=e=>{a==null||a.togglePause(e)},ye=e=>{i==null||i.toggleTrafficObject(e),a==null||a.toggleTrafficObject(e)},k=e=>{a==null||a.updatePanelContent(e)},ve=async e=>(s||(s=new P.default(n)),s.addOverlays(e)),Se=async e=>(y||(y=new st.default(n)),y.addClusterPoints(e)),we=()=>{y==null||y.removeAllClusterPoints()},Ce=e=>(s||(s=new P.default(n)),s.addMask(e)),he=()=>{s==null||s.removeMask()},be=e=>s==null?void 0:s.removeOverlaysByType(e),Oe=e=>s==null?void 0:s.removeOverlaysById(e),Ae=()=>s==null?void 0:s.removeAllOverlays(),ke=()=>{s==null||s.showAllOverlays()},Le=e=>{f||(f=new mt.default(n)),f.updateQueueLength(e)},De=()=>{f==null||f.removeQueueLength()},Te=async(e,d)=>(t||(t=new x.default(n)),await t.showOpenDriveFromServer(e,d)),qe=async e=>(t||(t=new x.default(n)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),Ve=e=>t?t.setOpendriveVisibility(e):{status:-1,message:"未加载OpenDrive地图"},_e=async()=>await(t==null?void 0:t.clearOpenDrive()),Be=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},Ie=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Me=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},xe=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},Pe=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},ze=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},Ee=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Ne=async e=>(o||(o=new gt.default(n)),await o.showSignalControlArea(e)),He=async()=>await(o==null?void 0:o.clearSignalControlArea()),Ge=e=>o==null?void 0:o.setLayerVisibility(e),Ze=async e=>o?await(o==null?void 0:o.locateSignalControlArea(e)):{status:-1,message:"未加载信号控制区"},We=async e=>o?await o.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},je=()=>o?o.resetHighlight():{status:-1,message:"未加载信号控制区"},Je=e=>(u||(u=new pt.default(n)),u.showSubSignalControlArea(e)),Qe=e=>u?u.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ue=()=>u?u.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},Ke=e=>u?u.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Fe=e=>u?u.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Xe=e=>{if(!u)return{status:-1,message:"未加载信号控制区"}},Ye=e=>(g||(g=new M.default(n)),g.addGreenWaveBand(e)),Re=()=>{if(!g)return{status:-1,message:"未加载绿波带"};g.stopAddGreenWaveBand()},$e=async e=>(g||(g=new M.default(n)),await g.showGreenWaveBand(e)),et=async e=>(v||(v=new dt.default(n)),await v.showJurisdiction(e)),tt=()=>{if(!v)return{status:-1,message:"未加载警务管辖区"};v.clearJurisdiction()},nt=async e=>(b||(b=new it.default(n)),await b.setEdpassLayerVisibility(e)),I=E,w=H;return N({mapViewer:G,setLayerVisibility:X,setMapCenter:Q,lookAt:F,setMapCamera:U,setMapZoom:K,setMapZoomRange:$,requestCoordinateTransform:Y,cancelCoordinateTransform:R,addOverlays:ve,addClusterPoints:Se,removeAllClusterPoints:we,addMask:Ce,removeMask:he,showAllOverlays:ke,removeOverlaysByType:be,removeOverlaysById:Oe,removeAllOverlays:Ae,showLaneNumber:ee,clearLaneNumber:te,initializeAreaTool:ne,calCrossIndicatorArea:ae,calRoadIndicatorArea:re,connectCarFlow:se,disconnectCarFlow:oe,handleHoloVehicleTraceData:ie,clearHoloTrace:ce,initializeLampGroup:de,handleUniSignalData:me,handleHoloSignalData:ue,clearHoloSignal:pe,setInterpolate:le,toggleTrafficInfo:ge,toggleTrafficObject:ye,toggleVehicleInfo:k,togglePause:fe,updateQueueLength:Le,removeQueueLength:De,showOpenDriveFromServer:Te,showOpenDriveFromFile:qe,clearOpenDrive:_e,setOpendriveVisibility:Ve,geometrySearchInOpenDrive:xe,findSumoInOpenDrive:Be,selectSumoInOpenDrive:Ie,unselectSumoInOpenDrive:Me,getSumoInfo:Pe,splitOpenDriveLane:ze,clearSplitOpenDriveLane:Ee,showSignalControlArea:Ne,clearSignalControlArea:He,setSignalControlAreaVisibility:Ge,locateSignalControlArea:Ze,highlightSignalControlArea:We,resetHighlightSignalControlArea:je,showSubSignalControlArea:Je,editSubSignalControlArea:Qe,stopEditSubSignalControlArea:Ue,selectSubSignalControlAreaCross:Ke,unselectSubSignalControlAreaCross:Fe,changeSubSignalControlAreaBorderVisibility:Xe,addGreenWaveBand:Ye,stopAddGreenWaveBand:Re,showGreenWaveBand:$e,showPoliceArea:et,clearPoliceArea:tt,setEdpassLayerVisibility:nt}),(e,d)=>(r.openBlock(),r.createElementBlock("div",yt,[r.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:h},[r.withDirectives(r.createElementVNode("div",vt,[r.createElementVNode("button",{style:{"margin-right":"10px"},onClick:Z}," 开始记录 "),r.createElementVNode("button",{style:{"margin-right":"10px"},onClick:W}," 下载日志 "),r.createElementVNode("button",{style:{"margin-right":"10px"},onClick:j}," 显示车辆id "),r.createElementVNode("button",{onClick:J},"显示车辆号牌")],512),[[r.vShow,O.value]])],512),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V,(c,C)=>(r.openBlock(),r.createBlock(lt.default,{key:C,"display-mode":c.displayMode,flash:c.flash,"road-id":c.crossId,"cross-id":c.roadId,"map-point":c.mapPoint,"stop-line":c.stopLine,position:c.position,rotation:c.rotation,scale:c.scale,"lamp-status":c.lampStatus},null,8,["display-mode","flash","road-id","cross-id","map-point","stop-line","position","rotation","scale","lamp-status"]))),128))]))}});exports.default=St;
|
|
@@ -100,6 +100,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
100
100
|
toggleVehicleInfo: (contentType: string) => void;
|
|
101
101
|
addOverlays: (params: import("../types").IOverlayParam) => Promise<import("../types").IResult>;
|
|
102
102
|
addClusterPoints: (params: import("../types").IClusterPointParams) => Promise<void>;
|
|
103
|
+
removeAllClusterPoints: () => void;
|
|
103
104
|
addMask: (params: import("../types").IMaskParam) => void;
|
|
104
105
|
removeMask: () => void;
|
|
105
106
|
removeOverlaysByType: (types: string[]) => import("../types").IResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@arcgis/core/core/reactiveUtils"),m=require("@arcgis/core/geometry"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@arcgis/core/core/reactiveUtils"),m=require("@arcgis/core/geometry"),y=require("@arcgis/core/Graphic"),g=require("@arcgis/core/layers/GraphicsLayer");function x(c){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const r in c)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(c,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>c[r]})}}return t.default=c,Object.freeze(t)}const S=x(b);class C{constructor(t){this.maxClusterSymbolSize=50,this.minClusterSymbolSize=25,this.zoomWatchHandle=null,this.locations=[],this.clusterMarkUrl="",this.currentZoom=0,this.view=t,this.currentZoom=t.zoom,this.clusterLayer=new g,this.view.map.add(this.clusterLayer)}locationToScreen(){this.locations.forEach(t=>{const r=this.view.toScreen(new m.Point({x:t.x,y:t.y}));t.properties.screenX=r.x,t.properties.screenY=r.y})}addClusterPoints(t){var i;this.locations=t.points,this.clusterMarkUrl=((i=t.clusterSymbol)==null?void 0:i.url)||"/GisViewerAssets/Images/cross/gis_xhj_blue.png",this.locations=this.locations.filter(e=>e.x!==null&&e.y!==null&&!isNaN(e.x)&&!isNaN(e.y)),this.locations.forEach(e=>{e.x=Number(e.x),e.y=Number(e.y),e.symbol||(e.symbol=t.pointSymbol||{type:"simple-marker",style:"circle",color:"#3388ff",size:8,outline:{color:"#ffffff",width:1}})}),this.zoomWatchHandle||(this.zoomWatchHandle=S.watch(()=>this.view.zoom,()=>{if(Math.abs(this.currentZoom-this.view.zoom)>=1){this.currentZoom=this.view.zoom,this.locationToScreen(),console.time("cluster");const e=this.doPixelCluster(120,3);console.timeEnd("cluster"),this.showClusters(e)}})),this.locationToScreen();const r=this.doPixelCluster(120,3);this.showClusters(r)}removeAllClusterPoints(){var t;(t=this.zoomWatchHandle)==null||t.remove(),this.zoomWatchHandle=null,this.clusterLayer.removeAll()}showClusters(t){this.clusterLayer.removeAll();let r=Number.MIN_VALUE,i=Number.MAX_VALUE;t.forEach(e=>{e.count>1&&(i=Math.min(i,e.count),r=Math.max(r,e.count))}),t.forEach(e=>{if(e.id!==-1){let s=i===r?(this.maxClusterSymbolSize+this.minClusterSymbolSize)/2:this.minClusterSymbolSize+(e.count-i)/(r-i)*(this.maxClusterSymbolSize-this.minClusterSymbolSize);s*=.75;const l=(e.count.toString().length*8+6)/2,a=new y({geometry:new m.Point({x:e.center.x,y:e.center.y}),attributes:{count:e.count},symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.count",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:s,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-l,40],[l,40],[l,20],[-l,20],[-l,40]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[2,72,200,255]},{type:"CIMSolidStroke",enable:!0,width:5,color:[2,72,200,128]}]}},{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:s,rotateClockwise:!0,textureFilter:"Picture",url:this.clusterMarkUrl}]}}}});this.clusterLayer.add(a)}else e.items.forEach(s=>{const o=new y({geometry:new m.Point({x:s.x,y:s.y}),attributes:{...s.properties,type:"clusterPoint",id:s.id},symbol:s.symbol});this.clusterLayer.add(o)})})}getNeighbors(t,r,i){const e=t[r];return t.filter(s=>s.id===e.id||s.visited?!1:this.getDistance(e,s)<=i)}getDistance(t,r){return Math.sqrt(Math.pow(t.properties.screenX-r.properties.screenX,2)+Math.pow(t.properties.screenY-r.properties.screenY,2))}createClusters(t){const r={},i=[];for(let s=0;s<t.length;s++){const o=t[s];o.clusterId===void 0||o.clusterId===-1?i.push(o):(r[o.clusterId]||(r[o.clusterId]=[]),r[o.clusterId].push(o))}const e=Object.keys(r).map((s,o)=>{const n=r[Number(s)],l=n.length,a=n.reduce((u,h)=>u+h.x,0),d=n.reduce((u,h)=>u+h.y,0),f=a/l,p=d/l;return{id:Number(s),items:n,count:l,center:{x:f,y:p}}});return i.length>0&&e.push({id:-1,items:i,count:i.length,center:null}),e}doPixelCluster(t,r){let i=0;this.locations.forEach(e=>{e.visited=!1,e.clusterId=void 0});for(let e=0;e<this.locations.length;e++){const s=this.locations[e];if(s.visited)continue;s.visited=!0;const o=this.getNeighbors(this.locations,e,t);o.length<r?s.clusterId=-1:(o.forEach(n=>{n.visited=!0,n.clusterId=i}),s.clusterId=i,i++)}return this.createClusters(this.locations)}}exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("pako"),c=require("../common-utils.js");class r{constructor(o
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("pako"),c=require("../common-utils.js");class r{constructor(s,o){this.parentName="",this.signals=[],this.subDistricts=[],this.areaColor=this.getDarkNonGrayColor(),this.signalCount=0,this.subDistrictCount=0,this.roadConnections=[],this.id=s.name,this.name=s.areaDesc,this.parentId=s.parentId,o==="alarm"&&(this.areaColor=[255,0,0]);for(const t of s.children)if(t.children){const i=new r(t,o);if(i.id=t.id,i.name=`SS ${t.name}`,i.parentId=this.id,i.parentName=this.name,i.areaColor=this.getDarkNonGrayColor(t.id),this.subDistricts.push(i),this.subDistrictCount++,this.signalCount+=i.signalCount,t.mapConnectList)try{const a=t.mapConnectList,e=new Uint8Array(window.atob(a).split("").map(n=>n.charCodeAt(0))),l=h.inflate(e,{to:"string"}),d=JSON.parse(l);i.roadConnections.push(...d.map(n=>({id:n.roadsectId,coordinates:JSON.parse(n.geomData).coordinates,districtId:i.parentId,subDistrictId:i.id})))}catch(a){console.error("解压子区路段连接信息失败:",a)}}else if(c.default.isCoordinateValid(t)){const i={id:t.id,name:t.name,parentId:t.parentId,latitude:Number(t.latitude),longitude:Number(t.longitude),signalId:t.signalId,nodeId:t.nodeId,isKey:t.isKey===1};this.signals.push(i),this.signalCount++}}getAllSignalCoordinates(){const s=[];for(const o of this.signals)s.push([o.longitude,o.latitude]);for(const o of this.subDistricts)s.push(...o.getAllSignalCoordinates());return s}getDarkNonGrayColor(s){let o,t,i;if(s){const a=this.cyrb53(s);o=((a&16711680)>>16)%200,t=((a&65280)>>8)%200,i=(a&255)%200}else o=Math.floor(Math.random()*256),t=Math.floor(Math.random()*256),i=Math.floor(Math.random()*256);return[o,t,i]}cyrb53(s,o=0){let t=3735928559^o,i=1103547991^o;for(let a=0,e;a<s.length;a++)e=s.charCodeAt(a),t=Math.imul(t^e,2654435761),i=Math.imul(i^e,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}}exports.default=r;
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -96,8 +96,8 @@ export interface IPointSymbol {
|
|
|
96
96
|
type: string;
|
|
97
97
|
style?: string;
|
|
98
98
|
url?: string;
|
|
99
|
-
width?: number;
|
|
100
|
-
height?: number;
|
|
99
|
+
width?: number | string;
|
|
100
|
+
height?: number | string;
|
|
101
101
|
xoffset?: number;
|
|
102
102
|
yoffset?: number;
|
|
103
103
|
horizontalOrigin?: string;
|
|
@@ -146,8 +146,8 @@ export interface IOverlayParam {
|
|
|
146
146
|
}
|
|
147
147
|
export interface IClusterPointParams {
|
|
148
148
|
type?: string;
|
|
149
|
-
clusterSymbol?:
|
|
150
|
-
pointSymbol?:
|
|
149
|
+
clusterSymbol?: any;
|
|
150
|
+
pointSymbol?: any;
|
|
151
151
|
points: IClusterLocation[];
|
|
152
152
|
}
|
|
153
153
|
export interface IClusterLocation {
|