gisviewer-vue3-arcgis 1.0.192 → 1.0.193

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.
@@ -135,6 +135,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
135
135
  };
136
136
  selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
137
137
  unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
138
+ changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
139
+ status: number;
140
+ message: string;
141
+ };
138
142
  props: any;
139
143
  emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
140
144
  SignalCountdownPanel: import("vue").DefineComponent<{
@@ -1,16 +1,16 @@
1
- import { defineComponent as Ne, ref as k, reactive as ze, onMounted as Ee, getCurrentInstance as Qe, onUnmounted as je, computed as Ze, openBlock as h, createElementBlock as A, createElementVNode as g, withDirectives as $e, vShow as qe, Fragment as Ke, renderList as Ue, createBlock as Ge } from "vue";
2
- import b, { registerStore as Je } from "./stores/index.mjs";
1
+ import { defineComponent as ze, ref as b, reactive as Ee, onMounted as Qe, getCurrentInstance as je, onUnmounted as Ze, computed as $e, openBlock as w, createElementBlock as A, createElementVNode as p, withDirectives as qe, vShow as Ke, Fragment as Ue, renderList as Ge, createBlock as Je } from "vue";
2
+ import k, { registerStore as Re } from "./stores/index.mjs";
3
3
  import "./style/index.css";
4
- import Re from "./utils/holo-flow/index.mjs";
5
- import We from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
6
- import Xe from "./utils/map-initializer.mjs";
4
+ import We from "./utils/holo-flow/index.mjs";
5
+ import Xe from "./utils/holo-flow/signal-countdown-panel.vue.mjs";
6
+ import Ye from "./utils/map-initializer.mjs";
7
7
  import D from "./utils/open-drive-renderer/index.mjs";
8
8
  import L from "./utils/overlay.mjs";
9
- import Ye from "./utils/queue-length.mjs";
9
+ import Fe from "./utils/queue-length.mjs";
10
10
  import T from "./utils/road-config-tool/index.mjs";
11
11
  import I from "./utils/signal-control-area-controller/index.mjs";
12
- import Fe from "./utils/traffic-flow.mjs";
13
- const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, dt = /* @__PURE__ */ Ne({
12
+ import et from "./utils/traffic-flow.mjs";
13
+ const tt = { class: "gis-viewer" }, at = { style: { position: "absolute", bottom: "80px", left: "10px", "z-index": "9999" } }, St = /* @__PURE__ */ ze({
14
14
  __name: "gis-map",
15
15
  props: {
16
16
  config: {},
@@ -18,35 +18,35 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
18
18
  },
19
19
  emits: ["mapLoaded", "markerClick", "mapClick"],
20
20
  setup(M, { expose: _, emit: x }) {
21
- const d = k(null);
22
- let o, l, c, s, n, r, p, t, a;
23
- const S = k(!1);
24
- Je();
25
- const H = b.useAppDataStore, v = ze([]);
26
- Ee(async () => {
21
+ const d = b(null);
22
+ let o, l, c, s, n, r, g, t, a;
23
+ const S = b(!1);
24
+ Re();
25
+ const H = k.useAppDataStore, v = Ee([]);
26
+ Qe(async () => {
27
27
  if (!d.value)
28
28
  return;
29
29
  document.addEventListener("keydown", (m) => {
30
30
  m.ctrlKey && m.key === "i" && (S.value = !S.value);
31
31
  });
32
- const e = Qe(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(O.config)).json();
33
- i.assetsRoot = O.assetsRoot || u, H.mapConfig = i, l = new Xe(), o = await l.initialize({
32
+ const e = je(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(O.config)).json();
33
+ i.assetsRoot = O.assetsRoot || u, H.mapConfig = i, l = new Ye(), o = await l.initialize({
34
34
  container: d.value,
35
35
  mapConfig: i,
36
- markerClickCallback: (m, C, w, Be) => {
37
- y("markerClick", m, C, w, Be);
36
+ markerClickCallback: (m, C, h, Ne) => {
37
+ y("markerClick", m, C, h, Ne);
38
38
  },
39
- mapClickCallback: (m, C, w) => {
40
- y("mapClick", m, C, w);
39
+ mapClickCallback: (m, C, h) => {
40
+ y("mapClick", m, C, h);
41
41
  }
42
- }), n = new Re(o, v), await n.init(), y("mapLoaded");
43
- }), je(() => {
42
+ }), n = new We(o, v), await n.init(), y("mapLoaded");
43
+ }), Ze(() => {
44
44
  a == null || a.clearSignalControlArea(), t == null || t.clearOpenDrive(), n.clearHoloTrace(), n.clearHoloSignal(), s == null || s.disconnectTrafficFlow();
45
45
  });
46
- const P = Ze(() => o), V = () => {
47
- const e = b.useAppDataStore;
46
+ const V = $e(() => o), B = () => {
47
+ const e = k.useAppDataStore;
48
48
  e.saveTrackLog = !0;
49
- }, B = () => {
49
+ }, P = () => {
50
50
  n.downloadTrackLog();
51
51
  }, N = () => {
52
52
  f("vehicleId");
@@ -60,7 +60,7 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
60
60
  c == null || c.clearLaneNumber();
61
61
  }, J = async (e) => (c || (c = new T(o)), await c.initializeSearch(e)), R = async () => c == null ? void 0 : c.calCrossIndicatorArea(), W = async () => {
62
62
  }, X = async (e, u) => {
63
- s || (s = new Fe(o)), s.connectTrafficFlow(e, u);
63
+ s || (s = new et(o)), s.connectTrafficFlow(e, u);
64
64
  }, Y = () => {
65
65
  s == null || s.disconnectTrafficFlow();
66
66
  }, F = async (e) => {
@@ -83,16 +83,16 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
83
83
  n == null || n.updatePanelContent(e);
84
84
  }, ie = async (e) => (r || (r = new L(o)), r.addOverlays(e)), ce = (e) => (r || (r = new L(o)), r.addMask(e)), le = () => {
85
85
  r == null || r.removeMask();
86
- }, ue = (e) => r == null ? void 0 : r.removeOverlaysByType(e), me = (e) => r == null ? void 0 : r.removeOverlaysById(e), pe = () => r == null ? void 0 : r.removeAllOverlays(), ge = () => {
86
+ }, ue = (e) => r == null ? void 0 : r.removeOverlaysByType(e), me = (e) => r == null ? void 0 : r.removeOverlaysById(e), ge = () => r == null ? void 0 : r.removeAllOverlays(), pe = () => {
87
87
  r == null || r.showAllOverlays();
88
88
  }, de = (e) => {
89
- p || (p = new Ye(o)), p.updateQueueLength(e);
89
+ g || (g = new Fe(o)), g.updateQueueLength(e);
90
90
  }, Se = () => {
91
- p == null || p.removeQueueLength();
92
- }, fe = async (e, u) => (t || (t = new D(o)), await t.showOpenDriveFromServer(e, u)), ye = async (e) => (t || (t = new D(o)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), Ce = async () => await (t == null ? void 0 : t.clearOpenDrive()), we = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
91
+ g == null || g.removeQueueLength();
92
+ }, fe = async (e, u) => (t || (t = new D(o)), await t.showOpenDriveFromServer(e, u)), ye = async (e) => (t || (t = new D(o)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), Ce = async () => await (t == null ? void 0 : t.clearOpenDrive()), he = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
93
93
  status: -1,
94
94
  message: "未加载OpenDrive地图"
95
- }, he = async (e) => t ? t.selectSumo(e) : {
95
+ }, we = async (e) => t ? t.selectSumo(e) : {
96
96
  status: -1,
97
97
  message: "未加载OpenDrive地图"
98
98
  }, ve = async (e) => t ? t.unselectSumo(e) : {
@@ -101,20 +101,22 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
101
101
  }, Oe = async (e) => t ? await t.geometrySearch(e) : {
102
102
  status: -1,
103
103
  message: "未加载OpenDrive地图"
104
- }, ke = async (e) => t ? await t.getSumoInfo(e) : {
104
+ }, be = async (e) => t ? await t.getSumoInfo(e) : {
105
105
  status: -1,
106
106
  message: "未加载OpenDrive地图"
107
107
  }, Ae = async (e) => t ? await (t == null ? void 0 : t.splitLane(e)) : {
108
108
  status: -1,
109
109
  message: "未加载OpenDrive地图"
110
- }, be = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
110
+ }, ke = async () => t ? t == null ? void 0 : t.clearSplitLane() : {
111
111
  status: -1,
112
112
  message: "未加载OpenDrive地图"
113
113
  }, De = (e) => (a || (a = new I(o)), a.showSignalControlArea(e)), Le = () => {
114
114
  a == null || a.clearSignalControlArea();
115
- }, Te = async (e) => a ? await a.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ie = async (e) => a ? await a.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = () => a ? a.resetHighlight() : { status: -1, message: "未加载信号控制区" }, _e = (e) => (a || (a = new I(o)), a.showSubSignalControlArea(e)), xe = (e) => a ? a.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, He = () => a ? a.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Pe = (e) => a ? a.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Ve = (e) => a ? a.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, O = M, y = x;
115
+ }, Te = async (e) => a ? await a.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ie = async (e) => a ? await a.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = () => a ? a.resetHighlight() : { status: -1, message: "未加载信号控制区" }, _e = (e) => (a || (a = new I(o)), a.showSubSignalControlArea(e)), xe = (e) => a ? a.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, He = () => a ? a.stopEditSubSignalControlArea() : { status: -1, message: "未加载信号控制区" }, Ve = (e) => a ? a.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Be = (e) => a ? a.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Pe = (e) => a ? a.changeSubSignalControlAreaBorderVisibility(
116
+ e
117
+ ) : { status: -1, message: "未加载信号控制区" }, O = M, y = x;
116
118
  return _({
117
- mapViewer: P,
119
+ mapViewer: V,
118
120
  setLayerVisibility: Z,
119
121
  setMapCenter: E,
120
122
  lookAt: j,
@@ -125,10 +127,10 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
125
127
  addOverlays: ie,
126
128
  addMask: ce,
127
129
  removeMask: le,
128
- showAllOverlays: ge,
130
+ showAllOverlays: pe,
129
131
  removeOverlaysByType: ue,
130
132
  removeOverlaysById: me,
131
- removeAllOverlays: pe,
133
+ removeAllOverlays: ge,
132
134
  showLaneNumber: U,
133
135
  clearLaneNumber: G,
134
136
  initializeAreaTool: J,
@@ -151,12 +153,12 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
151
153
  showOpenDriveFromFile: ye,
152
154
  clearOpenDrive: Ce,
153
155
  geometrySearchInOpenDrive: Oe,
154
- findSumoInOpenDrive: we,
155
- selectSumoInOpenDrive: he,
156
+ findSumoInOpenDrive: he,
157
+ selectSumoInOpenDrive: we,
156
158
  unselectSumoInOpenDrive: ve,
157
- getSumoInfo: ke,
159
+ getSumoInfo: be,
158
160
  splitOpenDriveLane: Ae,
159
- clearSplitOpenDriveLane: be,
161
+ clearSplitOpenDriveLane: ke,
160
162
  showSignalControlArea: De,
161
163
  clearSignalControlArea: Le,
162
164
  locateSignalControlArea: Te,
@@ -165,33 +167,34 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
165
167
  showSubSignalControlArea: _e,
166
168
  editSubSignalControlArea: xe,
167
169
  stopEditSubSignalControlArea: He,
168
- selectSubSignalControlAreaCross: Pe,
169
- unselectSubSignalControlAreaCross: Ve
170
- }), (e, u) => (h(), A("div", et, [
171
- g("div", {
170
+ selectSubSignalControlAreaCross: Ve,
171
+ unselectSubSignalControlAreaCross: Be,
172
+ changeSubSignalControlAreaBorderVisibility: Pe
173
+ }), (e, u) => (w(), A("div", tt, [
174
+ p("div", {
172
175
  class: "gis-viewer-main",
173
176
  ref_key: "mapContainer",
174
177
  ref: d
175
178
  }, [
176
- $e(g("div", tt, [
177
- g("button", {
179
+ qe(p("div", at, [
180
+ p("button", {
178
181
  style: { "margin-right": "10px" },
179
- onClick: V
182
+ onClick: B
180
183
  }, " 开始记录 "),
181
- g("button", {
184
+ p("button", {
182
185
  style: { "margin-right": "10px" },
183
- onClick: B
186
+ onClick: P
184
187
  }, " 下载日志 "),
185
- g("button", {
188
+ p("button", {
186
189
  style: { "margin-right": "10px" },
187
190
  onClick: N
188
191
  }, " 显示车辆id "),
189
- g("button", { onClick: z }, "显示车辆号牌")
192
+ p("button", { onClick: z }, "显示车辆号牌")
190
193
  ], 512), [
191
- [qe, S.value]
194
+ [Ke, S.value]
192
195
  ])
193
196
  ], 512),
194
- (h(!0), A(Ke, null, Ue(v, (i, m) => (h(), Ge(We, {
197
+ (w(!0), A(Ue, null, Ge(v, (i, m) => (w(), Je(Xe, {
195
198
  key: m,
196
199
  "display-mode": i.displayMode,
197
200
  "road-id": i.crossId,
@@ -207,5 +210,5 @@ const et = { class: "gis-viewer" }, tt = { style: { position: "absolute", bottom
207
210
  }
208
211
  });
209
212
  export {
210
- dt as default
213
+ St as default
211
214
  };
@@ -124,6 +124,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
124
124
  };
125
125
  selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
126
126
  unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
127
+ changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
128
+ status: number;
129
+ message: string;
130
+ };
127
131
  props: any;
128
132
  emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
129
133
  SignalCountdownPanel: import("vue").DefineComponent<{
@@ -56,6 +56,7 @@ export default class SignalControlAreaController {
56
56
  * @param id
57
57
  */
58
58
  unselectSubSignalControlAreaCross(id: string): IResult;
59
+ changeSubSignalControlAreaBorderVisibility(visible: boolean): void;
59
60
  /**
60
61
  * 在区控\子区\路口图层中查找对应的graphic
61
62
  * @param id
@@ -1,6 +1,6 @@
1
1
  import * as p from "@arcgis/core/core/reactiveUtils.js";
2
2
  import n from "@arcgis/core/Graphic";
3
- import h from "@arcgis/core/layers/GraphicsLayer";
3
+ import y from "@arcgis/core/layers/GraphicsLayer";
4
4
  import d from "@turf/buffer";
5
5
  import u from "@turf/convex";
6
6
  import * as a from "@turf/helpers";
@@ -13,19 +13,19 @@ class P {
13
13
  var i;
14
14
  this.crossScale = 5e3, this.crossIdsInDistrict = [], this.view = e;
15
15
  const r = C.useAppDataStore.mapConfig;
16
- this.openDriveServer = (i = r.openDriveServer) == null ? void 0 : i.url, this.districtControllerLayer = new h({
16
+ this.openDriveServer = (i = r.openDriveServer) == null ? void 0 : i.url, this.districtControllerLayer = new y({
17
17
  id: "districtControllerLayer"
18
- }), this.subDistrictControllerLayer = new h({
18
+ }), this.subDistrictControllerLayer = new y({
19
19
  id: "subDistrictControllerLayer",
20
20
  visible: !1
21
21
  // maxScale: 0,
22
22
  // minScale: 144447
23
- }), this.crossLayer = new h({
23
+ }), this.crossLayer = new y({
24
24
  id: "crossLayer",
25
25
  visible: !1
26
26
  // maxScale: 0,
27
27
  // minScale: 36112
28
- }), this.highlightLayer = new h({
28
+ }), this.highlightLayer = new y({
29
29
  id: "highlightLayer"
30
30
  }), this.view.map.addMany([
31
31
  this.districtControllerLayer,
@@ -180,10 +180,10 @@ class P {
180
180
  continue;
181
181
  }
182
182
  if (this.crossLayer.graphics.some(
183
- (g) => g.getAttribute("id") === o
183
+ (c) => c.getAttribute("id") === o
184
184
  ))
185
185
  continue;
186
- const y = new n({
186
+ const g = new n({
187
187
  geometry: {
188
188
  type: "point",
189
189
  x: s.lon,
@@ -197,7 +197,7 @@ class P {
197
197
  selected: !1
198
198
  }
199
199
  });
200
- i.push(y);
200
+ i.push(g);
201
201
  }
202
202
  return this.crossLayer.addMany(i), { status: 0, message: "ok" };
203
203
  } else
@@ -271,6 +271,11 @@ class P {
271
271
  ), { status: 0, message: "ok" };
272
272
  }), { status: 0, message: "未找到" };
273
273
  }
274
+ changeSubSignalControlAreaBorderVisibility(e) {
275
+ this.highlightLayer.graphics.forEach((t) => {
276
+ t.getAttribute("type") === "signalControlArea" && (t.visible = e);
277
+ });
278
+ }
274
279
  /**
275
280
  * 在区控\子区\路口图层中查找对应的graphic
276
281
  * @param id
@@ -298,13 +303,13 @@ class P {
298
303
  s = a.lineString(r);
299
304
  else {
300
305
  if (t) {
301
- const c = a.featureCollection(
306
+ const h = a.featureCollection(
302
307
  r.map((m) => a.point(m))
303
308
  );
304
- s = u(c);
309
+ s = u(h);
305
310
  } else {
306
- const c = f(r, 0.5);
307
- c.length >= 4 && (s = a.polygon([c]));
311
+ const h = f(r, 0.5);
312
+ h.length >= 4 && (s = a.polygon([h]));
308
313
  }
309
314
  s || (s = a.lineString(r));
310
315
  }
@@ -340,7 +345,7 @@ class P {
340
345
  label: "路口数量"
341
346
  }
342
347
  ];
343
- const y = {
348
+ const g = {
344
349
  type: "signalControlArea",
345
350
  id: e.id,
346
351
  name: e.name,
@@ -348,7 +353,7 @@ class P {
348
353
  parentName: e.parentName,
349
354
  crossCount: e.crossCount,
350
355
  subDistrictCount: e.subDistrictCount
351
- }, g = new n({
356
+ }, c = new n({
352
357
  geometry: {
353
358
  type: "polygon",
354
359
  rings: o.geometry.coordinates
@@ -363,7 +368,7 @@ class P {
363
368
  style: t ? "long-dash" : "solid"
364
369
  }
365
370
  },
366
- attributes: y,
371
+ attributes: g,
367
372
  popupTemplate: {
368
373
  title: `${t ? "区控" : "子区"} ${e.name}`,
369
374
  content: [
@@ -374,7 +379,7 @@ class P {
374
379
  ]
375
380
  }
376
381
  });
377
- t && this.districtControllerLayer.add(g);
382
+ t ? this.districtControllerLayer.add(c) : this.subDistrictControllerLayer.add(c);
378
383
  }
379
384
  for (const s of e.subDistricts)
380
385
  this.drawArea(s, !1);
@@ -135,6 +135,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
135
135
  };
136
136
  selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
137
137
  unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
138
+ changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
139
+ status: number;
140
+ message: string;
141
+ };
138
142
  props: any;
139
143
  emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
140
144
  SignalCountdownPanel: import("vue").DefineComponent<{
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),C=require("./stores/index.js");require("./style/index.css");const Ve=require("./utils/holo-flow/index.js"),Ne=require("./utils/holo-flow/signal-countdown-panel.vue.js"),Ee=require("./utils/map-initializer.js"),O=require("./utils/open-drive-renderer/index.js"),b=require("./utils/overlay.js"),Be=require("./utils/queue-length.js"),A=require("./utils/road-config-tool/index.js"),L=require("./utils/signal-control-area-controller/index.js"),He=require("./utils/traffic-flow.js"),Pe={class:"gis-viewer"},ze={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},je=n.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(D,{expose:T,emit:_}){const p=n.ref(null);let i,u,l,o,r,s,g,t,a;const f=n.ref(!1);C.registerStore();const I=C.default.useAppDataStore,h=n.reactive([]);n.onMounted(async()=>{if(!p.value)return;document.addEventListener("keydown",m=>{m.ctrlKey&&m.key==="i"&&(f.value=!f.value)});const e=n.getCurrentInstance(),{$gisviewerAssetsRoot:d}=e.appContext.config.globalProperties,c=await(await fetch(k.config)).json();c.assetsRoot=k.assetsRoot||d,I.mapConfig=c,u=new Ee.default,i=await u.initialize({container:p.value,mapConfig:c,markerClickCallback:(m,v,w,Me)=>{y("markerClick",m,v,w,Me)},mapClickCallback:(m,v,w)=>{y("mapClick",m,v,w)}}),r=new Ve.default(i,h),await r.init(),y("mapLoaded")}),n.onUnmounted(()=>{a==null||a.clearSignalControlArea(),t==null||t.clearOpenDrive(),r.clearHoloTrace(),r.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const x=n.computed(()=>i),q=()=>{const e=C.default.useAppDataStore;e.saveTrackLog=!0},M=()=>{r.downloadTrackLog()},V=()=>{S("vehicleId")},N=()=>{S("plateNumber")},E=async e=>await u.setMapCenter(e),B=async e=>await u.setMapCamera(e),H=async e=>await u.lookAt(e),P=e=>u.setLayerVisibility(e),z=(e,d)=>u.requestCoordinateTransform(e,d),j=e=>{u.cancelCoordinateTransform(e)},Q=e=>{u.setMapZoomRange(e)},Z=e=>(l||(l=new A.default(i)),l.showLaneNumber(e)),K=()=>{l==null||l.clearLaneNumber()},U=async e=>(l||(l=new A.default(i)),await l.initializeSearch(e)),G=async()=>l==null?void 0:l.calCrossIndicatorArea(),J=async()=>{},W=async(e,d)=>{o||(o=new He.default(i)),o.connectTrafficFlow(e,d)},X=()=>{o==null||o.disconnectTrafficFlow()},Y=async e=>{r.handleVehicleTraceData(e)},F=()=>{r.clearHoloTrace()},R=e=>{r.setInterpolate(e)},$=async e=>{await r.handleSignalData(e)},ee=()=>{r.clearHoloSignal()},te=e=>{o==null||o.toggleTrafficInfo(e),r==null||r.toggleTrafficInfo(e)},ae=e=>{r==null||r.togglePause(e)},ne=e=>{o==null||o.toggleTrafficObject(e),r==null||r.toggleTrafficObject(e)},S=e=>{r==null||r.updatePanelContent(e)},re=async e=>(s||(s=new b.default(i)),s.addOverlays(e)),se=e=>(s||(s=new b.default(i)),s.addMask(e)),oe=()=>{s==null||s.removeMask()},ie=e=>s==null?void 0:s.removeOverlaysByType(e),ce=e=>s==null?void 0:s.removeOverlaysById(e),le=()=>s==null?void 0:s.removeAllOverlays(),ue=()=>{s==null||s.showAllOverlays()},de=e=>{g||(g=new Be.default(i)),g.updateQueueLength(e)},me=()=>{g==null||g.removeQueueLength()},ge=async(e,d)=>(t||(t=new O.default(i)),await t.showOpenDriveFromServer(e,d)),pe=async e=>(t||(t=new O.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),fe=async()=>await(t==null?void 0:t.clearOpenDrive()),Se=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ve=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},Ce=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},he=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},ke=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},Oe=e=>(a||(a=new L.default(i)),a.showSignalControlArea(e)),be=()=>{a==null||a.clearSignalControlArea()},Ae=async e=>a?await a.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Le=async e=>a?await a.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},De=()=>a?a.resetHighlight():{status:-1,message:"未加载信号控制区"},Te=e=>(a||(a=new L.default(i)),a.showSubSignalControlArea(e)),_e=e=>a?a.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ie=()=>a?a.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},xe=e=>a?a.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},qe=e=>a?a.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},k=D,y=_;return T({mapViewer:x,setLayerVisibility:P,setMapCenter:E,lookAt:H,setMapCamera:B,setMapZoomRange:Q,requestCoordinateTransform:z,cancelCoordinateTransform:j,addOverlays:re,addMask:se,removeMask:oe,showAllOverlays:ue,removeOverlaysByType:ie,removeOverlaysById:ce,removeAllOverlays:le,showLaneNumber:Z,clearLaneNumber:K,initializeAreaTool:U,calCrossIndicatorArea:G,calRoadIndicatorArea:J,connectCarFlow:W,disconnectCarFlow:X,handleHoloVehicleTraceData:Y,clearHoloTrace:F,handleHoloSignalData:$,clearHoloSignal:ee,setInterpolate:R,toggleTrafficInfo:te,toggleTrafficObject:ne,toggleVehicleInfo:S,togglePause:ae,updateQueueLength:de,removeQueueLength:me,showOpenDriveFromServer:ge,showOpenDriveFromFile:pe,clearOpenDrive:fe,geometrySearchInOpenDrive:we,findSumoInOpenDrive:Se,selectSumoInOpenDrive:ye,unselectSumoInOpenDrive:ve,getSumoInfo:Ce,splitOpenDriveLane:he,clearSplitOpenDriveLane:ke,showSignalControlArea:Oe,clearSignalControlArea:be,locateSignalControlArea:Ae,highlightSignalControlArea:Le,resetHighlightSignalControlArea:De,showSubSignalControlArea:Te,editSubSignalControlArea:_e,stopEditSubSignalControlArea:Ie,selectSubSignalControlAreaCross:xe,unselectSubSignalControlAreaCross:qe}),(e,d)=>(n.openBlock(),n.createElementBlock("div",Pe,[n.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[n.withDirectives(n.createElementVNode("div",ze,[n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:q}," 开始记录 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:M}," 下载日志 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:V}," 显示车辆id "),n.createElementVNode("button",{onClick:N},"显示车辆号牌")],512),[[n.vShow,f.value]])],512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h,(c,m)=>(n.openBlock(),n.createBlock(Ne.default,{key:m,"display-mode":c.displayMode,"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","road-id","cross-id","map-point","stop-line","position","rotation","scale","lamp-status"]))),128))]))}});exports.default=je;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),C=require("./stores/index.js");require("./style/index.css");const Be=require("./utils/holo-flow/index.js"),Ne=require("./utils/holo-flow/signal-countdown-panel.vue.js"),Ee=require("./utils/map-initializer.js"),k=require("./utils/open-drive-renderer/index.js"),O=require("./utils/overlay.js"),He=require("./utils/queue-length.js"),A=require("./utils/road-config-tool/index.js"),L=require("./utils/signal-control-area-controller/index.js"),Pe=require("./utils/traffic-flow.js"),ze={class:"gis-viewer"},je={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},Qe=n.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick"],setup(D,{expose:T,emit:_}){const p=n.ref(null);let i,u,l,o,r,s,m,t,a;const S=n.ref(!1);C.registerStore();const I=C.default.useAppDataStore,h=n.reactive([]);n.onMounted(async()=>{if(!p.value)return;document.addEventListener("keydown",d=>{d.ctrlKey&&d.key==="i"&&(S.value=!S.value)});const e=n.getCurrentInstance(),{$gisviewerAssetsRoot:g}=e.appContext.config.globalProperties,c=await(await fetch(b.config)).json();c.assetsRoot=b.assetsRoot||g,I.mapConfig=c,u=new Ee.default,i=await u.initialize({container:p.value,mapConfig:c,markerClickCallback:(d,v,w,Me)=>{y("markerClick",d,v,w,Me)},mapClickCallback:(d,v,w)=>{y("mapClick",d,v,w)}}),r=new Be.default(i,h),await r.init(),y("mapLoaded")}),n.onUnmounted(()=>{a==null||a.clearSignalControlArea(),t==null||t.clearOpenDrive(),r.clearHoloTrace(),r.clearHoloSignal(),o==null||o.disconnectTrafficFlow()});const x=n.computed(()=>i),V=()=>{const e=C.default.useAppDataStore;e.saveTrackLog=!0},q=()=>{r.downloadTrackLog()},M=()=>{f("vehicleId")},B=()=>{f("plateNumber")},N=async e=>await u.setMapCenter(e),E=async e=>await u.setMapCamera(e),H=async e=>await u.lookAt(e),P=e=>u.setLayerVisibility(e),z=(e,g)=>u.requestCoordinateTransform(e,g),j=e=>{u.cancelCoordinateTransform(e)},Q=e=>{u.setMapZoomRange(e)},Z=e=>(l||(l=new A.default(i)),l.showLaneNumber(e)),K=()=>{l==null||l.clearLaneNumber()},U=async e=>(l||(l=new A.default(i)),await l.initializeSearch(e)),G=async()=>l==null?void 0:l.calCrossIndicatorArea(),J=async()=>{},W=async(e,g)=>{o||(o=new Pe.default(i)),o.connectTrafficFlow(e,g)},X=()=>{o==null||o.disconnectTrafficFlow()},Y=async e=>{r.handleVehicleTraceData(e)},F=()=>{r.clearHoloTrace()},R=e=>{r.setInterpolate(e)},$=async e=>{await r.handleSignalData(e)},ee=()=>{r.clearHoloSignal()},te=e=>{o==null||o.toggleTrafficInfo(e),r==null||r.toggleTrafficInfo(e)},ae=e=>{r==null||r.togglePause(e)},ne=e=>{o==null||o.toggleTrafficObject(e),r==null||r.toggleTrafficObject(e)},f=e=>{r==null||r.updatePanelContent(e)},re=async e=>(s||(s=new O.default(i)),s.addOverlays(e)),se=e=>(s||(s=new O.default(i)),s.addMask(e)),oe=()=>{s==null||s.removeMask()},ie=e=>s==null?void 0:s.removeOverlaysByType(e),ce=e=>s==null?void 0:s.removeOverlaysById(e),le=()=>s==null?void 0:s.removeAllOverlays(),ue=()=>{s==null||s.showAllOverlays()},ge=e=>{m||(m=new He.default(i)),m.updateQueueLength(e)},de=()=>{m==null||m.removeQueueLength()},me=async(e,g)=>(t||(t=new k.default(i)),await t.showOpenDriveFromServer(e,g)),pe=async e=>(t||(t=new k.default(i)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),Se=async()=>await(t==null?void 0:t.clearOpenDrive()),fe=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},ye=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},ve=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},we=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},Ce=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},he=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},be=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},ke=e=>(a||(a=new L.default(i)),a.showSignalControlArea(e)),Oe=()=>{a==null||a.clearSignalControlArea()},Ae=async e=>a?await a.locateSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Le=async e=>a?await a.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},De=()=>a?a.resetHighlight():{status:-1,message:"未加载信号控制区"},Te=e=>(a||(a=new L.default(i)),a.showSubSignalControlArea(e)),_e=e=>a?a.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ie=()=>a?a.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},xe=e=>a?a.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ve=e=>a?a.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},qe=e=>a?a.changeSubSignalControlAreaBorderVisibility(e):{status:-1,message:"未加载信号控制区"},b=D,y=_;return T({mapViewer:x,setLayerVisibility:P,setMapCenter:N,lookAt:H,setMapCamera:E,setMapZoomRange:Q,requestCoordinateTransform:z,cancelCoordinateTransform:j,addOverlays:re,addMask:se,removeMask:oe,showAllOverlays:ue,removeOverlaysByType:ie,removeOverlaysById:ce,removeAllOverlays:le,showLaneNumber:Z,clearLaneNumber:K,initializeAreaTool:U,calCrossIndicatorArea:G,calRoadIndicatorArea:J,connectCarFlow:W,disconnectCarFlow:X,handleHoloVehicleTraceData:Y,clearHoloTrace:F,handleHoloSignalData:$,clearHoloSignal:ee,setInterpolate:R,toggleTrafficInfo:te,toggleTrafficObject:ne,toggleVehicleInfo:f,togglePause:ae,updateQueueLength:ge,removeQueueLength:de,showOpenDriveFromServer:me,showOpenDriveFromFile:pe,clearOpenDrive:Se,geometrySearchInOpenDrive:we,findSumoInOpenDrive:fe,selectSumoInOpenDrive:ye,unselectSumoInOpenDrive:ve,getSumoInfo:Ce,splitOpenDriveLane:he,clearSplitOpenDriveLane:be,showSignalControlArea:ke,clearSignalControlArea:Oe,locateSignalControlArea:Ae,highlightSignalControlArea:Le,resetHighlightSignalControlArea:De,showSubSignalControlArea:Te,editSubSignalControlArea:_e,stopEditSubSignalControlArea:Ie,selectSubSignalControlAreaCross:xe,unselectSubSignalControlAreaCross:Ve,changeSubSignalControlAreaBorderVisibility:qe}),(e,g)=>(n.openBlock(),n.createElementBlock("div",ze,[n.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:p},[n.withDirectives(n.createElementVNode("div",je,[n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:V}," 开始记录 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:q}," 下载日志 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:M}," 显示车辆id "),n.createElementVNode("button",{onClick:B},"显示车辆号牌")],512),[[n.vShow,S.value]])],512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h,(c,d)=>(n.openBlock(),n.createBlock(Ne.default,{key:d,"display-mode":c.displayMode,"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","road-id","cross-id","map-point","stop-line","position","rotation","scale","lamp-status"]))),128))]))}});exports.default=Qe;
@@ -124,6 +124,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
124
124
  };
125
125
  selectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
126
126
  unselectSubSignalControlAreaCross: (id: string) => import("../types").IResult;
127
+ changeSubSignalControlAreaBorderVisibility: (params: any) => void | {
128
+ status: number;
129
+ message: string;
130
+ };
127
131
  props: any;
128
132
  emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
129
133
  SignalCountdownPanel: import("vue").DefineComponent<{
@@ -56,6 +56,7 @@ export default class SignalControlAreaController {
56
56
  * @param id
57
57
  */
58
58
  unselectSubSignalControlAreaCross(id: string): IResult;
59
+ changeSubSignalControlAreaBorderVisibility(visible: boolean): void;
59
60
  /**
60
61
  * 在区控\子区\路口图层中查找对应的graphic
61
62
  * @param id
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@arcgis/core/core/reactiveUtils.js"),c=require("@arcgis/core/Graphic"),u=require("@arcgis/core/layers/GraphicsLayer"),f=require("@turf/buffer"),m=require("@turf/convex"),C=require("@turf/helpers"),v=require("axios"),S=require("concaveman"),I=require("../../stores/index.js"),A=require("./district-controller.js");function d(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 L=d(b),a=d(C);class w{constructor(e){var r;this.crossScale=5e3,this.crossIdsInDistrict=[],this.view=e;const i=I.default.useAppDataStore.mapConfig;this.openDriveServer=(r=i.openDriveServer)==null?void 0:r.url,this.districtControllerLayer=new u({id:"districtControllerLayer"}),this.subDistrictControllerLayer=new u({id:"subDistrictControllerLayer",visible:!1}),this.crossLayer=new u({id:"crossLayer",visible:!1}),this.highlightLayer=new u({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1,this.districtControllerLayer.visible=!0;for(const t of e.areaList){const i=new A.default(t,e.style||"");this.drawArea(i,!0)}return this.scaleWatcher=L.watch(()=>this.view.scale,(t,i)=>{t>this.crossScale&&i<=this.crossScale?(this.crossLayer.graphics.forEach(r=>{r.symbol=this.getCrossGraphicSymbol(r.attributes,"marker")}),this.highlightLayer.graphics.forEach(r=>{r.getAttribute("type")==="cross"&&(r.symbol=this.getCrossGraphicSymbol(r.attributes,"marker"))})):t<=this.crossScale&&i>this.crossScale&&(this.crossLayer.graphics.forEach(r=>{r.symbol=this.getCrossGraphicSymbol(r.attributes,"picture")}),this.highlightLayer.graphics.forEach(r=>{r.getAttribute("type")==="cross"&&(r.symbol=this.getCrossGraphicSymbol(r.attributes,"picture"))}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e,t;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.scaleWatcher)==null||e.remove(),this.scaleWatcher=void 0,(t=this.clickWatcher)==null||t.remove(),this.clickWatcher=void 0,this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const t=this.findAreaGraphic(e.id);return t?(t.attributes.type==="cross"?await this.view.goTo({target:t.geometry,scale:1500}):await this.view.goTo(t.geometry),{status:0,message:"ok"}):{status:1,message:"未找到"}}async highlightSignalControlArea(e){if(!e.id||e.id==="")return{status:1,message:"请输入id"};this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id).toArray().map(s=>{const o=s.clone();return o.symbol.style="none",o}),i=this.subDistrictControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("parentId")===e.id).toArray().map(s=>s.clone()),r=this.crossLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("districtId")===e.id||s.getAttribute("subDistrictId")===e.id).toArray().map(s=>s.clone());if(t.length>0&&this.highlightLayer.addMany(t),i.length>0&&this.highlightLayer.addMany(i),r.length>0&&this.highlightLayer.addMany(r),this.highlightLayer.graphics.length===0)return{status:1,message:"未找到"};if(t.length>0)await this.view.goTo(t);else if(i.length>0){const s=i[0].geometry.centroid;await this.view.goTo({target:s,scale:this.crossScale-500})}else r.length>1?await this.view.goTo(r):await this.view.goTo({target:r[0].geometry,scale:1500});return{status:0,message:"ok"}}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,{status:0,message:"ok"}}showSubSignalControlArea(e){this.crossLayer.removeAll(),this.crossLayer.visible=!0;const i=e.children.map(r=>{const s={...r,selected:!0};return new c({geometry:{type:"point",x:r.longitude,y:r.latitude},symbol:this.getCrossSymbolInSubDistrict(s),attributes:s})});return this.crossLayer.addMany(i),this.view.goTo(i),{status:0,message:"ok"}}async handleViewClick(e){var s;const i=(s=(await this.view.hitTest(e,{include:[this.crossLayer]})).results)==null?void 0:s.filter(o=>o.type==="graphic");if(i.length===0)return;const r=i[0].graphic;r.getAttribute("selected")?r.getAttribute("signalId")&&(this.removeCrossCallback&&this.removeCrossCallback({id:r.getAttribute("id")}),r.setAttribute("selected",!1),r.symbol=this.getCrossSymbolInSubDistrict(r.attributes)):(r.getAttribute("signalId")&&(this.addCrossCallback&&this.addCrossCallback({id:r.getAttribute("id"),name:r.getAttribute("name")}),r.setAttribute("selected",!0),r.symbol=this.getCrossSymbolInSubDistrict(r.attributes)),await this.showNearbyCrosses(r.getAttribute("id")))}async showNearbyCrosses(e){const t=await v.get(`http://${this.openDriveServer}/api/computable/getRelatedJunctionsForJunction`,{params:{junctionIds:e}});if(t.status===200)if(t.data.status===0){const i=t.data.result,r=[];for(const s of i){const o=s.junctionId;if(o.startsWith("-"))continue;if(s.signalId&&!this.crossIdsInDistrict.includes(o)){console.log("不是此区控内的路口",o);continue}if(this.crossLayer.graphics.some(g=>g.getAttribute("id")===o))continue;const y=new c({geometry:{type:"point",x:s.lon,y:s.lat},symbol:this.getCrossSymbolInSubDistrict(s),attributes:{id:o,name:s.name,signalId:s.signalId,selected:!1}});r.push(y)}return this.crossLayer.addMany(r),{status:0,message:"ok"}}else return{status:-1,message:t.data.message};else return{status:-1,message:"请求失败"}}async editSubSignalControlArea(e){if(e.odrServer){this.openDriveServer=e.odrServer,this.crossIdsInDistrict=e.crossesInArea.map(s=>s.id);const t=a.featureCollection(e.crossesInArea.map(s=>a.point([s.x,s.y]))),i=m(t);i&&(this.districtControllerLayer.removeAll(),this.districtControllerLayer.add(new c({geometry:{type:"polygon",rings:i.geometry.coordinates},symbol:{type:"simple-fill",style:"none",outline:{color:[61,139,249],width:3,style:"long-dash"}}}))),this.addCrossCallback=e.addCrossCallback,this.removeCrossCallback=e.removeCrossCallback,this.clickWatcher||(this.clickWatcher=this.view.on("click",async s=>{await this.handleViewClick(s)}));const r=this.crossLayer.graphics.toArray().map(s=>s.getAttribute("id")).join(",");return await this.showNearbyCrosses(r)}else return{status:1,message:"未配置OpenDriveServer"}}stopEditSubSignalControlArea(){var t;(t=this.clickWatcher)==null||t.remove(),this.clickWatcher=void 0;const e=this.crossLayer.graphics.filter(i=>i.getAttribute("signalId")===""||!i.getAttribute("signalId")||!i.getAttribute("selected"));this.crossLayer.removeMany(e.toArray())}selectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&!t.getAttribute("selected"))return t.setAttribute("selected",!0),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}unselectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&t.getAttribute("selected"))return t.setAttribute("selected",!1),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(i=>i.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(i=>i.attributes.id===e)),t||(t=this.crossLayer.graphics.find(i=>i.attributes.id===e)),t}drawArea(e,t){const i=e.getAllCrossCoordinates();if(i.length>=2){let s=null;if(i.length===2)s=a.lineString(i);else{if(t){const h=a.featureCollection(i.map(p=>a.point(p)));s=m(h)}else{const h=S(i,.5);h.length>=4&&(s=a.polygon([h]))}s||(s=a.lineString(i))}const o=f(s.geometry,t?200:30,{units:"meters"});let n;t?n=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:n=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const y={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},g=new c({geometry:{type:"polygon",rings:o.geometry.coordinates},symbol:{type:"simple-fill",style:"none",color:[...e.areaColor,.3],outline:{color:e.areaColor,width:3,style:t?"long-dash":"solid"}},attributes:y,popupTemplate:{title:`${t?"区控":"子区"} ${e.name}`,content:[{type:"fields",fieldInfos:n}]}});t&&this.districtControllerLayer.add(g)}for(const s of e.subDistricts)this.drawArea(s,!1);const r=[];e.crosses.forEach(s=>{const o={type:"cross",id:s.id,name:s.name,color:e.areaColor,signalId:s.signalId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name,isKey:s.isKey},n=new c({geometry:{type:"point",x:s.longitude,y:s.latitude},symbol:this.getCrossGraphicSymbol(o,"marker"),attributes:o,popupTemplate:{title:s.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}});r.push(n)}),this.crossLayer.addMany(r)}getCrossSymbolInSubDistrict(e){return e.signalId&&e.signalId!==""?{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:20,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${e.selected?"gis_xhj_blue":"gis_xhj_gray"}.png`}]}}}:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_lkcz.png",width:"20px",height:"20px"}}getCrossGraphicSymbol(e,t){const{isKey:i,color:r}=e;if(t==="marker")return i?{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:r,size:8,outline:{color:"white",width:1}};if(t==="picture")return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:i?30:15,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:i?40:20,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${i?"gis_gjxklk_orange":"gis_xhj_blue"}.png`}]}}}}}exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@arcgis/core/core/reactiveUtils.js"),c=require("@arcgis/core/Graphic"),y=require("@arcgis/core/layers/GraphicsLayer"),f=require("@turf/buffer"),m=require("@turf/convex"),C=require("@turf/helpers"),v=require("axios"),S=require("concaveman"),A=require("../../stores/index.js"),I=require("./district-controller.js");function d(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>l[t]})}}return e.default=l,Object.freeze(e)}const L=d(p),a=d(C);class w{constructor(e){var i;this.crossScale=5e3,this.crossIdsInDistrict=[],this.view=e;const r=A.default.useAppDataStore.mapConfig;this.openDriveServer=(i=r.openDriveServer)==null?void 0:i.url,this.districtControllerLayer=new y({id:"districtControllerLayer"}),this.subDistrictControllerLayer=new y({id:"subDistrictControllerLayer",visible:!1}),this.crossLayer=new y({id:"crossLayer",visible:!1}),this.highlightLayer=new y({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1,this.districtControllerLayer.visible=!0;for(const t of e.areaList){const r=new I.default(t,e.style||"");this.drawArea(r,!0)}return this.scaleWatcher=L.watch(()=>this.view.scale,(t,r)=>{t>this.crossScale&&r<=this.crossScale?(this.crossLayer.graphics.forEach(i=>{i.symbol=this.getCrossGraphicSymbol(i.attributes,"marker")}),this.highlightLayer.graphics.forEach(i=>{i.getAttribute("type")==="cross"&&(i.symbol=this.getCrossGraphicSymbol(i.attributes,"marker"))})):t<=this.crossScale&&r>this.crossScale&&(this.crossLayer.graphics.forEach(i=>{i.symbol=this.getCrossGraphicSymbol(i.attributes,"picture")}),this.highlightLayer.graphics.forEach(i=>{i.getAttribute("type")==="cross"&&(i.symbol=this.getCrossGraphicSymbol(i.attributes,"picture"))}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e,t;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.scaleWatcher)==null||e.remove(),this.scaleWatcher=void 0,(t=this.clickWatcher)==null||t.remove(),this.clickWatcher=void 0,this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const t=this.findAreaGraphic(e.id);return t?(t.attributes.type==="cross"?await this.view.goTo({target:t.geometry,scale:1500}):await this.view.goTo(t.geometry),{status:0,message:"ok"}):{status:1,message:"未找到"}}async highlightSignalControlArea(e){if(!e.id||e.id==="")return{status:1,message:"请输入id"};this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id).toArray().map(s=>{const o=s.clone();return o.symbol.style="none",o}),r=this.subDistrictControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("parentId")===e.id).toArray().map(s=>s.clone()),i=this.crossLayer.graphics.filter(s=>s.getAttribute("id")===e.id||s.getAttribute("districtId")===e.id||s.getAttribute("subDistrictId")===e.id).toArray().map(s=>s.clone());if(t.length>0&&this.highlightLayer.addMany(t),r.length>0&&this.highlightLayer.addMany(r),i.length>0&&this.highlightLayer.addMany(i),this.highlightLayer.graphics.length===0)return{status:1,message:"未找到"};if(t.length>0)await this.view.goTo(t);else if(r.length>0){const s=r[0].geometry.centroid;await this.view.goTo({target:s,scale:this.crossScale-500})}else i.length>1?await this.view.goTo(i):await this.view.goTo({target:i[0].geometry,scale:1500});return{status:0,message:"ok"}}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,{status:0,message:"ok"}}showSubSignalControlArea(e){this.crossLayer.removeAll(),this.crossLayer.visible=!0;const r=e.children.map(i=>{const s={...i,selected:!0};return new c({geometry:{type:"point",x:i.longitude,y:i.latitude},symbol:this.getCrossSymbolInSubDistrict(s),attributes:s})});return this.crossLayer.addMany(r),this.view.goTo(r),{status:0,message:"ok"}}async handleViewClick(e){var s;const r=(s=(await this.view.hitTest(e,{include:[this.crossLayer]})).results)==null?void 0:s.filter(o=>o.type==="graphic");if(r.length===0)return;const i=r[0].graphic;i.getAttribute("selected")?i.getAttribute("signalId")&&(this.removeCrossCallback&&this.removeCrossCallback({id:i.getAttribute("id")}),i.setAttribute("selected",!1),i.symbol=this.getCrossSymbolInSubDistrict(i.attributes)):(i.getAttribute("signalId")&&(this.addCrossCallback&&this.addCrossCallback({id:i.getAttribute("id"),name:i.getAttribute("name")}),i.setAttribute("selected",!0),i.symbol=this.getCrossSymbolInSubDistrict(i.attributes)),await this.showNearbyCrosses(i.getAttribute("id")))}async showNearbyCrosses(e){const t=await v.get(`http://${this.openDriveServer}/api/computable/getRelatedJunctionsForJunction`,{params:{junctionIds:e}});if(t.status===200)if(t.data.status===0){const r=t.data.result,i=[];for(const s of r){const o=s.junctionId;if(o.startsWith("-"))continue;if(s.signalId&&!this.crossIdsInDistrict.includes(o)){console.log("不是此区控内的路口",o);continue}if(this.crossLayer.graphics.some(h=>h.getAttribute("id")===o))continue;const g=new c({geometry:{type:"point",x:s.lon,y:s.lat},symbol:this.getCrossSymbolInSubDistrict(s),attributes:{id:o,name:s.name,signalId:s.signalId,selected:!1}});i.push(g)}return this.crossLayer.addMany(i),{status:0,message:"ok"}}else return{status:-1,message:t.data.message};else return{status:-1,message:"请求失败"}}async editSubSignalControlArea(e){if(e.odrServer){this.openDriveServer=e.odrServer,this.crossIdsInDistrict=e.crossesInArea.map(s=>s.id);const t=a.featureCollection(e.crossesInArea.map(s=>a.point([s.x,s.y]))),r=m(t);r&&(this.districtControllerLayer.removeAll(),this.districtControllerLayer.add(new c({geometry:{type:"polygon",rings:r.geometry.coordinates},symbol:{type:"simple-fill",style:"none",outline:{color:[61,139,249],width:3,style:"long-dash"}}}))),this.addCrossCallback=e.addCrossCallback,this.removeCrossCallback=e.removeCrossCallback,this.clickWatcher||(this.clickWatcher=this.view.on("click",async s=>{await this.handleViewClick(s)}));const i=this.crossLayer.graphics.toArray().map(s=>s.getAttribute("id")).join(",");return await this.showNearbyCrosses(i)}else return{status:1,message:"未配置OpenDriveServer"}}stopEditSubSignalControlArea(){var t;(t=this.clickWatcher)==null||t.remove(),this.clickWatcher=void 0;const e=this.crossLayer.graphics.filter(r=>r.getAttribute("signalId")===""||!r.getAttribute("signalId")||!r.getAttribute("selected"));this.crossLayer.removeMany(e.toArray())}selectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&!t.getAttribute("selected"))return t.setAttribute("selected",!0),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}unselectSubSignalControlAreaCross(e){return this.crossLayer.graphics.forEach(t=>{if(t.getAttribute("id")===e&&t.getAttribute("selected"))return t.setAttribute("selected",!1),t.symbol=this.getCrossSymbolInSubDistrict(t.attributes),{status:0,message:"ok"}}),{status:0,message:"未找到"}}changeSubSignalControlAreaBorderVisibility(e){this.highlightLayer.graphics.forEach(t=>{t.getAttribute("type")==="signalControlArea"&&(t.visible=e)})}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(r=>r.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(r=>r.attributes.id===e)),t||(t=this.crossLayer.graphics.find(r=>r.attributes.id===e)),t}drawArea(e,t){const r=e.getAllCrossCoordinates();if(r.length>=2){let s=null;if(r.length===2)s=a.lineString(r);else{if(t){const u=a.featureCollection(r.map(b=>a.point(b)));s=m(u)}else{const u=S(r,.5);u.length>=4&&(s=a.polygon([u]))}s||(s=a.lineString(r))}const o=f(s.geometry,t?200:30,{units:"meters"});let n;t?n=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:n=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const g={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},h=new c({geometry:{type:"polygon",rings:o.geometry.coordinates},symbol:{type:"simple-fill",style:"none",color:[...e.areaColor,.3],outline:{color:e.areaColor,width:3,style:t?"long-dash":"solid"}},attributes:g,popupTemplate:{title:`${t?"区控":"子区"} ${e.name}`,content:[{type:"fields",fieldInfos:n}]}});t?this.districtControllerLayer.add(h):this.subDistrictControllerLayer.add(h)}for(const s of e.subDistricts)this.drawArea(s,!1);const i=[];e.crosses.forEach(s=>{const o={type:"cross",id:s.id,name:s.name,color:e.areaColor,signalId:s.signalId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name,isKey:s.isKey},n=new c({geometry:{type:"point",x:s.longitude,y:s.latitude},symbol:this.getCrossGraphicSymbol(o,"marker"),attributes:o,popupTemplate:{title:s.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}});i.push(n)}),this.crossLayer.addMany(i)}getCrossSymbolInSubDistrict(e){return e.signalId&&e.signalId!==""?{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:20,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${e.selected?"gis_xhj_blue":"gis_xhj_gray"}.png`}]}}}:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_lkcz.png",width:"20px",height:"20px"}}getCrossGraphicSymbol(e,t){const{isKey:r,color:i}=e;if(t==="marker")return r?{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:i,size:8,outline:{color:"white",width:1}};if(t==="picture")return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:r?30:15,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:r?40:20,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/cross/${r?"gis_gjxklk_orange":"gis_xhj_blue"}.png`}]}}}}}exports.default=w;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.192",
3
+ "version": "1.0.193",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [