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.
@@ -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 it, ref as P, reactive as ct, onMounted as lt, getCurrentInstance as ut, onUnmounted as mt, computed as pt, openBlock as T, createElementBlock as _, createElementVNode as f, withDirectives as dt, vShow as gt, Fragment as ft, renderList as yt, createBlock as Ct } from "vue";
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 vt from "./utils/dbscan-cluster/index.mjs";
5
- import wt from "./utils/detect-gpu.mjs";
6
- import ht from "./utils/edpass-device-controller.mjs";
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 bt from "./utils/holo-flow/index.mjs";
9
- import Ot from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
10
- import At from "./utils/map-initializer.mjs";
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 kt from "./utils/police-jurisdiction.mjs";
14
- import Dt from "./utils/queue-length.mjs";
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 Lt from "./utils/signal-control-area/edit-area.mjs";
17
- import Tt from "./utils/signal-control-area/show-area.mjs";
18
- import It from "./utils/traffic-flow.mjs";
19
- const Mt = { class: "gis-viewer" }, Bt = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, Ft = /* @__PURE__ */ it({
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 w = P(null);
28
- let n, p, c, o, a, r, g, t, l, s, d, y, h, b;
29
- const O = P(!1);
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 = ct([]), B = (e) => Math.log2(591657527591555e-6 / e);
32
- let C = null, V = null;
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 !== V && (V = u, S("update:zoom", u));
37
+ u !== P && (P = u, S("update:zoom", u));
38
38
  };
39
- wt(), lt(async () => {
40
- if (!w.value)
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 = ut(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(z.config)).json();
46
- i.assetsRoot = z.assetsRoot || u, I.mapConfig = i, p = new At(), I.mapInitializer = p, n = await p.initialize({
47
- container: w.value,
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, ot) => {
50
- S("markerClick", m, D, L, ot);
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 v = n.zoom ?? (n.scale ? B(n.scale) : void 0);
57
- typeof v == "number" && A(v);
58
- const st = n.zoom !== void 0 ? n.watch("zoom", (m) => {
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
- C = () => st.remove(), a = new bt(n, M), await a.init(), S("mapLoaded");
64
- }), mt(() => {
65
- s == null || s.clearSignalControlArea(), t == null || t.clearOpenDrive(), a.clearHoloTrace(), a.clearHoloSignal(), o == null || o.disconnectTrafficFlow(), C == null || C(), C = null;
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 = pt(() => n), 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 It(n)), o.connectTrafficFlow(e, u);
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) => (b || (b = new vt(n)), b.addClusterPoints(e)), be = (e) => (r || (r = new E(n)), r.addMask(e)), Oe = () => {
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
- }, Ae = (e) => r == null ? void 0 : r.removeOverlaysByType(e), ke = (e) => r == null ? void 0 : r.removeOverlaysById(e), De = () => r == null ? void 0 : r.removeAllOverlays(), Le = () => {
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
- }, Te = (e) => {
114
- g || (g = new Dt(n)), g.updateQueueLength(e);
115
- }, Ie = () => {
115
+ }, Ie = (e) => {
116
+ g || (g = new Lt(n)), g.updateQueueLength(e);
117
+ }, Me = () => {
116
118
  g == null || g.removeQueueLength();
117
- }, Me = async (e, u) => (t || (t = new H(n)), await t.showOpenDriveFromServer(e, u)), Be = async (e) => (t || (t = new H(n)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), Ve = (e) => t ? t.setOpendriveVisibility(e) : {
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()), Pe = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
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
- }, _e = async (e) => t ? t.selectSumo(e) : {
125
+ }, xe = async (e) => t ? t.selectSumo(e) : {
124
126
  status: -1,
125
127
  message: "未加载OpenDrive地图"
126
- }, xe = async (e) => t ? t.unselectSumo(e) : {
128
+ }, Ge = async (e) => t ? t.unselectSumo(e) : {
127
129
  status: -1,
128
130
  message: "未加载OpenDrive地图"
129
- }, Ge = async (e) => t ? await t.geometrySearch(e) : {
131
+ }, He = async (e) => t ? await t.geometrySearch(e) : {
130
132
  status: -1,
131
133
  message: "未加载OpenDrive地图"
132
- }, He = async (e) => t ? await t.getSumoInfo(e) : {
134
+ }, Ee = async (e) => t ? await t.getSumoInfo(e) : {
133
135
  status: -1,
134
136
  message: "未加载OpenDrive地图"
135
- }, Ee = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
137
+ }, Ne = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
136
138
  status: -1,
137
139
  message: "未加载OpenDrive地图"
138
- }, Ne = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
140
+ }, We = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
139
141
  status: -1,
140
142
  message: "未加载OpenDrive地图"
141
- }, We = async (e) => (s || (s = new Tt(n)), await s.showSignalControlArea(e)), Ze = async () => await (s == null ? void 0 : s.clearSignalControlArea()), Qe = (e) => s == null ? void 0 : s.setLayerVisibility(e), je = async (e) => s ? await (s == null ? void 0 : s.locateSignalControlArea(e)) : { status: -1, message: "未加载信号控制区" }, Je = async (e) => s ? await s.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ue = () => s ? s.resetHighlight() : { status: -1, message: "未加载信号控制区" }, $e = (e) => (l || (l = new Lt(n)), l.showSubSignalControlArea(e)), qe = (e) => l ? l.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ke = () => l ? l.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Fe = (e) => l ? l.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Re = (e) => l ? l.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Xe = (e) => {
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
- }, Ye = (e) => (d || (d = new G(n)), d.addGreenWaveBand(e)), et = () => {
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
- }, tt = async (e) => (d || (d = new G(n)), await d.showGreenWaveBand(e)), nt = async (e) => (y || (y = new kt(n)), await y.showJurisdiction(e)), at = () => {
149
- if (!y)
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
- y.clearJurisdiction();
152
- }, rt = async (e) => (h || (h = new ht(n)), await h.setEdpassLayerVisibility(e)), z = W, S = Q;
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
- addMask: be,
166
- removeMask: Oe,
167
- showAllOverlays: Le,
168
- removeOverlaysByType: Ae,
169
- removeOverlaysById: ke,
170
- removeAllOverlays: De,
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: ve,
189
+ toggleTrafficObject: Se,
187
190
  toggleVehicleInfo: k,
188
- togglePause: Se,
189
- updateQueueLength: Te,
190
- removeQueueLength: Ie,
191
- showOpenDriveFromServer: Me,
192
- showOpenDriveFromFile: Be,
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: Ge,
196
- findSumoInOpenDrive: Pe,
197
- selectSumoInOpenDrive: _e,
198
- unselectSumoInOpenDrive: xe,
199
- getSumoInfo: He,
200
- splitOpenDriveLane: Ee,
201
- clearSplitOpenDriveLane: Ne,
202
- showSignalControlArea: We,
203
- clearSignalControlArea: Ze,
204
- setSignalControlAreaVisibility: Qe,
205
- locateSignalControlArea: je,
206
- highlightSignalControlArea: Je,
207
- resetHighlightSignalControlArea: Ue,
208
- showSubSignalControlArea: $e,
209
- editSubSignalControlArea: qe,
210
- stopEditSubSignalControlArea: Ke,
211
- selectSubSignalControlAreaCross: Fe,
212
- unselectSubSignalControlAreaCross: Re,
213
- changeSubSignalControlAreaBorderVisibility: Xe,
214
- addGreenWaveBand: Ye,
215
- stopAddGreenWaveBand: et,
216
- showGreenWaveBand: tt,
217
- showPoliceArea: nt,
218
- clearPoliceArea: at,
219
- setEdpassLayerVisibility: rt
220
- }), (e, u) => (T(), _("div", Mt, [
221
- f("div", {
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: w
227
+ ref: h
225
228
  }, [
226
- dt(f("div", Bt, [
227
- f("button", {
229
+ gt(y("div", Pt, [
230
+ y("button", {
228
231
  style: { "margin-right": "10px" },
229
232
  onClick: J
230
233
  }, " 开始记录 "),
231
- f("button", {
234
+ y("button", {
232
235
  style: { "margin-right": "10px" },
233
236
  onClick: U
234
237
  }, " 下载日志 "),
235
- f("button", {
238
+ y("button", {
236
239
  style: { "margin-right": "10px" },
237
240
  onClick: $
238
241
  }, " 显示车辆id "),
239
- f("button", { onClick: q }, "显示车辆号牌")
242
+ y("button", { onClick: q }, "显示车辆号牌")
240
243
  ], 512), [
241
- [gt, O.value]
244
+ [ft, O.value]
242
245
  ])
243
246
  ], 512),
244
- (T(!0), _(ft, null, yt(M, (i, v) => (T(), Ct(Ot, {
245
- key: v,
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
- Ft as default
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;
@@ -18,6 +18,7 @@ export default class DbscanCluster {
18
18
  * @param params
19
19
  */
20
20
  addClusterPoints(params: IClusterPointParams): void;
21
+ removeAllClusterPoints(): void;
21
22
  private showClusters;
22
23
  /**
23
24
  * 获取邻居点
@@ -1,30 +1,30 @@
1
1
  import * as f from "@arcgis/core/core/reactiveUtils";
2
- import { Point as a } from "@arcgis/core/geometry";
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 M {
6
- constructor(e) {
7
- this.maxClusterSymbolSize = 50, this.minClusterSymbolSize = 25, this.zoomWatchHandle = null, this.locations = [], this.clusterMarkUrl = "", this.currentZoom = 0, this.view = e, this.currentZoom = e.zoom, this.clusterLayer = new b(), this.view.map.add(this.clusterLayer);
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((e) => {
13
+ this.locations.forEach((t) => {
14
14
  const s = this.view.toScreen(
15
- new a({ x: e.x, y: e.y })
15
+ new h({ x: t.x, y: t.y })
16
16
  );
17
- e.properties.screenX = s.x, e.properties.screenY = s.y;
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(e) {
25
- var o;
26
- this.locations = e.points, this.clusterMarkUrl = ((o = e.clusterSymbol) == null ? void 0 : o.url) || "/GisViewerAssets/Images/cross/gis_xhj_blue.png", e.points.forEach((r) => {
27
- r.symbol || (r.symbol = e.pointSymbol || {
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 && (this.currentZoom = this.view.zoom, this.locationToScreen(), this.clusterLayer.removeAll(), this.addClusterPoints(e));
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(), console.time("cluster");
43
- const s = this.doPixelCluster(e.points, 120, 3);
44
- console.timeEnd("cluster"), this.showClusters(s);
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(e) {
47
- let s = Number.MIN_VALUE, o = Number.MAX_VALUE;
48
- e.forEach((r) => {
49
- r.count > 1 && (o = Math.min(o, r.count), s = Math.max(s, r.count));
50
- }), e.forEach((r) => {
51
- if (r.id !== -1) {
52
- let t = o === s ? (this.maxClusterSymbolSize + this.minClusterSymbolSize) / 2 : this.minClusterSymbolSize + (r.count - o) / (s - o) * (this.maxClusterSymbolSize - this.minClusterSymbolSize);
53
- t *= 0.75;
54
- const i = new m({
55
- geometry: new a({ x: r.center.x, y: r.center.y }),
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: r.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: t,
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
- [-15, 40],
95
- [15, 40],
96
- [15, 20],
97
- [-15, 20],
98
- [-15, 40]
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: t,
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(i);
176
+ this.clusterLayer.add(c);
168
177
  } else
169
- r.items.forEach((t) => {
170
- const i = new m({
171
- geometry: new a({ x: t.x, y: t.y }),
172
- attributes: t.properties,
173
- symbol: t.symbol
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(i);
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(e, s, o) {
187
- const r = e[s];
188
- return e.filter((t) => t.id === r.id || t.visited ? !1 : this.getDistance(r, t) <= o);
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(e, s) {
209
+ getDistance(t, s) {
197
210
  return Math.sqrt(
198
- Math.pow(e.properties.screenX - s.properties.screenX, 2) + Math.pow(e.properties.screenY - s.properties.screenY, 2)
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(e) {
207
- const s = {}, o = [];
208
- for (let t = 0; t < e.length; t++) {
209
- const i = e[t];
210
- i.clusterId === void 0 || i.clusterId === -1 ? o.push(i) : (s[i.clusterId] || (s[i.clusterId] = []), s[i.clusterId].push(i));
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 r = Object.keys(s).map((t, i) => {
213
- const l = s[Number(t)], n = l.length, h = l.reduce((c, u) => c + u.x, 0), y = l.reduce((c, u) => c + u.y, 0), p = h / n, d = y / n;
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(t),
216
- items: l,
217
- count: n,
228
+ id: Number(r),
229
+ items: n,
230
+ count: l,
218
231
  center: {
219
- x: p,
220
- y: d
232
+ x: d,
233
+ y: p
221
234
  }
222
235
  };
223
236
  });
224
- return o.length > 0 && r.push({
237
+ return i.length > 0 && e.push({
225
238
  id: -1,
226
- items: o,
227
- count: o.length,
239
+ items: i,
240
+ count: i.length,
228
241
  center: null
229
- }), r;
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(e, s, o) {
239
- let r = 0;
240
- e.forEach((t) => t.visited = !1);
241
- for (let t = 0; t < e.length; t++) {
242
- const i = e[t];
243
- if (i.visited)
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
- i.visited = !0;
246
- const l = this.getNeighbors(e, t, s);
247
- l.length < o ? i.clusterId = -1 : (l.forEach((n) => {
248
- n.visited = !0, n.clusterId = r;
249
- }), i.clusterId = r, r++);
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(e);
266
+ return this.createClusters(this.locations);
252
267
  }
253
268
  }
254
269
  export {
255
- M as default
270
+ I as default
256
271
  };
@@ -1,4 +1,4 @@
1
- import h from "pako";
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 = h.inflate(n, { to: "string" }), d = JSON.parse(l);
13
+ ), l = d.inflate(n, { to: "string" }), h = JSON.parse(l);
14
14
  i.roadConnections.push(
15
- ...d.map((r) => ({
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
- ), console.log(i.roadConnections);
21
+ );
22
22
  } catch (a) {
23
23
  console.error("解压子区路段连接信息失败:", a);
24
24
  }
@@ -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?: IPointSymbol;
150
- pointSymbol?: IPointSymbol;
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 rt=require("./utils/dbscan-cluster/index.js"),st=require("./utils/detect-gpu.js"),ot=require("./utils/edpass-device-controller.js"),M=require("./utils/green-wave-band-controller/index.js"),it=require("./utils/holo-flow/index.js"),ct=require("./utils/holo-flow/signal-countdown-panel.vue.js"),lt=require("./utils/map-initializer.js"),x=require("./utils/open-drive-renderer/index.js"),z=require("./utils/overlay.js"),ut=require("./utils/police-jurisdiction.js"),dt=require("./utils/queue-length.js"),E=require("./utils/road-config-tool/index.js"),mt=require("./utils/signal-control-area/edit-area.js"),pt=require("./utils/signal-control-area/show-area.js"),gt=require("./utils/traffic-flow.js"),ft={class:"gis-viewer"},yt={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},vt=r.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick","update:zoom"],setup(P,{expose:N,emit:H}){const C=r.ref(null);let n,p,l,i,a,s,f,t,u,o,g,y,h,b;const O=r.ref(!1);T.registerStore();const q=T.default.useAppDataStore,V=r.reactive([]),_=e=>Math.log2(591657527591555e-6/e);let v=null,B=null;const k=e=>{if(!Number.isFinite(e))return;const d=Math.round(e);d!==B&&(B=d,S("update:zoom",d))};st.default(),r.onMounted(async()=>{if(!C.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 lt.default,q.mapInitializer=p,n=await p.initialize({container:C.value,mapConfig:c,markerClickCallback:(m,L,D,at)=>{S("markerClick",m,L,D,at)},mapClickCallback:(m,L,D)=>{S("mapClick",m,L,D)}});const w=n.zoom??(n.scale?_(n.scale):void 0);typeof w=="number"&&k(w);const nt=n.zoom!==void 0?n.watch("zoom",m=>{k(m)}):n.watch("scale",m=>{typeof m=="number"&&m>0&&k(_(m))});v=()=>nt.remove(),a=new it.default(n,V),await a.init(),S("mapLoaded")}),r.onUnmounted(()=>{o==null||o.clearSignalControlArea(),t==null||t.clearOpenDrive(),a.clearHoloTrace(),a.clearHoloSignal(),i==null||i.disconnectTrafficFlow(),v==null||v(),v=null});const G=r.computed(()=>n),Z=()=>{const e=T.default.useAppDataStore;e.saveTrackLog=!0},W=()=>{a.downloadTrackLog()},j=()=>{A("vehicleId")},J=()=>{A("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 E.default(n)),l.showLaneNumber(e)),te=()=>{l==null||l.clearLaneNumber()},ne=async e=>(l||(l=new E.default(n)),await l.initializeSearch(e)),ae=async()=>l==null?void 0:l.calCrossIndicatorArea(),re=async()=>{},se=async(e,d)=>{i||(i=new gt.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)},A=e=>{a==null||a.updatePanelContent(e)},ve=async e=>(s||(s=new z.default(n)),s.addOverlays(e)),Se=async e=>(b||(b=new rt.default(n)),b.addClusterPoints(e)),we=e=>(s||(s=new z.default(n)),s.addMask(e)),Ce=()=>{s==null||s.removeMask()},he=e=>s==null?void 0:s.removeOverlaysByType(e),be=e=>s==null?void 0:s.removeOverlaysById(e),Oe=()=>s==null?void 0:s.removeAllOverlays(),ke=()=>{s==null||s.showAllOverlays()},Ae=e=>{f||(f=new dt.default(n)),f.updateQueueLength(e)},Le=()=>{f==null||f.removeQueueLength()},De=async(e,d)=>(t||(t=new x.default(n)),await t.showOpenDriveFromServer(e,d)),Te=async e=>(t||(t=new x.default(n)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),qe=e=>t?t.setOpendriveVisibility(e):{status:-1,message:"未加载OpenDrive地图"},Ve=async()=>await(t==null?void 0:t.clearOpenDrive()),_e=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},Be=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Ie=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Me=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},xe=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地图"},Pe=async e=>(o||(o=new pt.default(n)),await o.showSignalControlArea(e)),Ne=async()=>await(o==null?void 0:o.clearSignalControlArea()),He=e=>o==null?void 0:o.setLayerVisibility(e),Ge=async e=>o?await(o==null?void 0:o.locateSignalControlArea(e)):{status:-1,message:"未加载信号控制区"},Ze=async e=>o?await o.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},We=()=>o?o.resetHighlight():{status:-1,message:"未加载信号控制区"},je=e=>(u||(u=new mt.default(n)),u.showSubSignalControlArea(e)),Je=e=>u?u.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Qe=()=>u?u.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},Ue=e=>u?u.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ke=e=>u?u.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Fe=e=>{if(!u)return{status:-1,message:"未加载信号控制区"}},Xe=e=>(g||(g=new M.default(n)),g.addGreenWaveBand(e)),Ye=()=>{if(!g)return{status:-1,message:"未加载绿波带"};g.stopAddGreenWaveBand()},Re=async e=>(g||(g=new M.default(n)),await g.showGreenWaveBand(e)),$e=async e=>(y||(y=new ut.default(n)),await y.showJurisdiction(e)),et=()=>{if(!y)return{status:-1,message:"未加载警务管辖区"};y.clearJurisdiction()},tt=async e=>(h||(h=new ot.default(n)),await h.setEdpassLayerVisibility(e)),I=P,S=H;return N({mapViewer:G,setLayerVisibility:X,setMapCenter:Q,lookAt:F,setMapCamera:U,setMapZoom:K,setMapZoomRange:$,requestCoordinateTransform:Y,cancelCoordinateTransform:R,addOverlays:ve,addClusterPoints:Se,addMask:we,removeMask:Ce,showAllOverlays:ke,removeOverlaysByType:he,removeOverlaysById:be,removeAllOverlays:Oe,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:A,togglePause:fe,updateQueueLength:Ae,removeQueueLength:Le,showOpenDriveFromServer:De,showOpenDriveFromFile:Te,clearOpenDrive:Ve,setOpendriveVisibility:qe,geometrySearchInOpenDrive:Me,findSumoInOpenDrive:_e,selectSumoInOpenDrive:Be,unselectSumoInOpenDrive:Ie,getSumoInfo:xe,splitOpenDriveLane:ze,clearSplitOpenDriveLane:Ee,showSignalControlArea:Pe,clearSignalControlArea:Ne,setSignalControlAreaVisibility:He,locateSignalControlArea:Ge,highlightSignalControlArea:Ze,resetHighlightSignalControlArea:We,showSubSignalControlArea:je,editSubSignalControlArea:Je,stopEditSubSignalControlArea:Qe,selectSubSignalControlAreaCross:Ue,unselectSubSignalControlAreaCross:Ke,changeSubSignalControlAreaBorderVisibility:Fe,addGreenWaveBand:Xe,stopAddGreenWaveBand:Ye,showGreenWaveBand:Re,showPoliceArea:$e,clearPoliceArea:et,setEdpassLayerVisibility:tt}),(e,d)=>(r.openBlock(),r.createElementBlock("div",ft,[r.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:C},[r.withDirectives(r.createElementVNode("div",yt,[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,w)=>(r.openBlock(),r.createBlock(ct.default,{key:w,"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=vt;
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;
@@ -18,6 +18,7 @@ export default class DbscanCluster {
18
18
  * @param params
19
19
  */
20
20
  addClusterPoints(params: IClusterPointParams): void;
21
+ removeAllClusterPoints(): void;
21
22
  private showClusters;
22
23
  /**
23
24
  * 获取邻居点
@@ -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"),h=require("@arcgis/core/Graphic"),S=require("@arcgis/core/layers/GraphicsLayer");function g(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>l[t]})}}return e.default=l,Object.freeze(e)}const C=g(b);class x{constructor(e){this.maxClusterSymbolSize=50,this.minClusterSymbolSize=25,this.zoomWatchHandle=null,this.locations=[],this.clusterMarkUrl="",this.currentZoom=0,this.view=e,this.currentZoom=e.zoom,this.clusterLayer=new S,this.view.map.add(this.clusterLayer)}locationToScreen(){this.locations.forEach(e=>{const t=this.view.toScreen(new m.Point({x:e.x,y:e.y}));e.properties.screenX=t.x,e.properties.screenY=t.y})}addClusterPoints(e){var i;this.locations=e.points,this.clusterMarkUrl=((i=e.clusterSymbol)==null?void 0:i.url)||"/GisViewerAssets/Images/cross/gis_xhj_blue.png",e.points.forEach(s=>{s.symbol||(s.symbol=e.pointSymbol||{type:"simple-marker",style:"circle",color:"#3388ff",size:8,outline:{color:"#ffffff",width:1}})}),this.zoomWatchHandle||(this.zoomWatchHandle=C.watch(()=>this.view.zoom,()=>{Math.abs(this.currentZoom-this.view.zoom)>=1&&(this.currentZoom=this.view.zoom,this.locationToScreen(),this.clusterLayer.removeAll(),this.addClusterPoints(e))})),this.locationToScreen(),console.time("cluster");const t=this.doPixelCluster(e.points,120,3);console.timeEnd("cluster"),this.showClusters(t)}showClusters(e){let t=Number.MIN_VALUE,i=Number.MAX_VALUE;e.forEach(s=>{s.count>1&&(i=Math.min(i,s.count),t=Math.max(t,s.count))}),e.forEach(s=>{if(s.id!==-1){let r=i===t?(this.maxClusterSymbolSize+this.minClusterSymbolSize)/2:this.minClusterSymbolSize+(s.count-i)/(t-i)*(this.maxClusterSymbolSize-this.minClusterSymbolSize);r*=.75;const o=new h({geometry:new m.Point({x:s.center.x,y:s.center.y}),attributes:{count:s.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:r,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-15,40],[15,40],[15,20],[-15,20],[-15,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:r,rotateClockwise:!0,textureFilter:"Picture",url:this.clusterMarkUrl}]}}}});this.clusterLayer.add(o)}else s.items.forEach(r=>{const o=new h({geometry:new m.Point({x:r.x,y:r.y}),attributes:r.properties,symbol:r.symbol});this.clusterLayer.add(o)})})}getNeighbors(e,t,i){const s=e[t];return e.filter(r=>r.id===s.id||r.visited?!1:this.getDistance(s,r)<=i)}getDistance(e,t){return Math.sqrt(Math.pow(e.properties.screenX-t.properties.screenX,2)+Math.pow(e.properties.screenY-t.properties.screenY,2))}createClusters(e){const t={},i=[];for(let r=0;r<e.length;r++){const o=e[r];o.clusterId===void 0||o.clusterId===-1?i.push(o):(t[o.clusterId]||(t[o.clusterId]=[]),t[o.clusterId].push(o))}const s=Object.keys(t).map((r,o)=>{const n=t[Number(r)],c=n.length,y=n.reduce((u,a)=>u+a.x,0),d=n.reduce((u,a)=>u+a.y,0),p=y/c,f=d/c;return{id:Number(r),items:n,count:c,center:{x:p,y:f}}});return i.length>0&&s.push({id:-1,items:i,count:i.length,center:null}),s}doPixelCluster(e,t,i){let s=0;e.forEach(r=>r.visited=!1);for(let r=0;r<e.length;r++){const o=e[r];if(o.visited)continue;o.visited=!0;const n=this.getNeighbors(e,r,t);n.length<i?o.clusterId=-1:(n.forEach(c=>{c.visited=!0,c.clusterId=s}),o.clusterId=s,s++)}return this.createClusters(e)}}exports.default=x;
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,s){this.parentName="",this.signals=[],this.subDistricts=[],this.areaColor=this.getDarkNonGrayColor(),this.signalCount=0,this.subDistrictCount=0,this.roadConnections=[],this.id=o.name,this.name=o.areaDesc,this.parentId=o.parentId,s==="alarm"&&(this.areaColor=[255,0,0]);for(const t of o.children)if(t.children){const i=new r(t,s);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,n=new Uint8Array(window.atob(a).split("").map(e=>e.charCodeAt(0))),l=h.inflate(n,{to:"string"}),d=JSON.parse(l);i.roadConnections.push(...d.map(e=>({id:e.roadsectId,coordinates:JSON.parse(e.geomData).coordinates,districtId:i.parentId,subDistrictId:i.id}))),console.log(i.roadConnections)}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 o=[];for(const s of this.signals)o.push([s.longitude,s.latitude]);for(const s of this.subDistricts)o.push(...s.getAllSignalCoordinates());return o}getDarkNonGrayColor(o){let s,t,i;if(o){const a=this.cyrb53(o);s=((a&16711680)>>16)%200,t=((a&65280)>>8)%200,i=(a&255)%200}else s=Math.floor(Math.random()*256),t=Math.floor(Math.random()*256),i=Math.floor(Math.random()*256);return[s,t,i]}cyrb53(o,s=0){let t=3735928559^s,i=1103547991^s;for(let a=0,n;a<o.length;a++)n=o.charCodeAt(a),t=Math.imul(t^n,2654435761),i=Math.imul(i^n,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;
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;
@@ -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?: IPointSymbol;
150
- pointSymbol?: IPointSymbol;
149
+ clusterSymbol?: any;
150
+ pointSymbol?: any;
151
151
  points: IClusterLocation[];
152
152
  }
153
153
  export interface IClusterLocation {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.252",
3
+ "version": "1.0.254",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [