gisviewer-vue3-arcgis 1.0.236 → 1.0.237

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.
Files changed (21) hide show
  1. package/es/src/gis-map/utils/signal-control-area/district-controller.d.ts +2 -0
  2. package/es/src/gis-map/utils/signal-control-area/district-controller.mjs +42 -26
  3. package/es/src/gis-map/utils/signal-control-area/layer-symbol.mjs +30 -34
  4. package/es/src/gis-map/utils/signal-control-area/show-area.d.ts +0 -7
  5. package/es/src/gis-map/utils/signal-control-area/show-area.mjs +41 -74
  6. package/es/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +2 -2
  7. package/es/src/gis-map/utils/signal-control-area/signal-renderer.mjs +26 -26
  8. package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +12 -4
  9. package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +79 -86
  10. package/es/src/types/index.d.ts +6 -0
  11. package/lib/src/gis-map/utils/signal-control-area/district-controller.d.ts +2 -0
  12. package/lib/src/gis-map/utils/signal-control-area/district-controller.js +1 -1
  13. package/lib/src/gis-map/utils/signal-control-area/layer-symbol.js +1 -1
  14. package/lib/src/gis-map/utils/signal-control-area/show-area.d.ts +0 -7
  15. package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
  16. package/lib/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +2 -2
  17. package/lib/src/gis-map/utils/signal-control-area/signal-renderer.js +1 -1
  18. package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +12 -4
  19. package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
  20. package/lib/src/types/index.d.ts +6 -0
  21. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import { IDistrictRoad } from 'packages/components/src/types';
1
2
  interface ICross {
2
3
  id: string;
3
4
  name: string;
@@ -18,6 +19,7 @@ export default class DistrictController {
18
19
  areaColor: [number, number, number];
19
20
  signalCount: number;
20
21
  subDistrictCount: number;
22
+ roadConnections: IDistrictRoad[];
21
23
  constructor(params: any, style: string);
22
24
  /**
23
25
  * 获取区控/子区下的所有信号机
@@ -1,12 +1,28 @@
1
- import e from "../common-utils.mjs";
2
- class r {
3
- constructor(s, o) {
4
- this.parentName = "", this.signals = [], this.subDistricts = [], this.areaColor = this.getDarkNonGrayColor(), this.signalCount = 0, this.subDistrictCount = 0, this.id = s.name, this.name = s.areaDesc, this.parentId = s.parentId, o === "alarm" && (this.areaColor = [255, 0, 0]);
5
- for (const t of s.children)
1
+ import h from "pako";
2
+ import c from "../common-utils.mjs";
3
+ class e {
4
+ constructor(o, s) {
5
+ 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]);
6
+ for (const t of o.children)
6
7
  if (t.children) {
7
- const i = new r(t, o);
8
- 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;
9
- } else if (e.isCoordinateValid(t)) {
8
+ const i = new e(t, s);
9
+ 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)
10
+ try {
11
+ const a = t.mapConnectList, n = new Uint8Array(
12
+ window.atob(a).split("").map((r) => r.charCodeAt(0))
13
+ ), l = h.inflate(n, { to: "string" }), d = JSON.parse(l);
14
+ i.roadConnections.push(
15
+ ...d.map((r) => ({
16
+ id: r.roadsectId,
17
+ coordinates: JSON.parse(r.geomData).coordinates,
18
+ districtId: i.parentId,
19
+ subDistrictId: i.id
20
+ }))
21
+ ), console.log(i.roadConnections);
22
+ } catch (a) {
23
+ console.error("解压子区路段连接信息失败:", a);
24
+ }
25
+ } else if (c.isCoordinateValid(t)) {
10
26
  const i = {
11
27
  id: t.id,
12
28
  name: t.name,
@@ -25,29 +41,29 @@ class r {
25
41
  * @returns
26
42
  */
27
43
  getAllSignalCoordinates() {
28
- const s = [];
29
- for (const o of this.signals)
30
- s.push([o.longitude, o.latitude]);
31
- for (const o of this.subDistricts)
32
- s.push(...o.getAllSignalCoordinates());
33
- return s;
44
+ const o = [];
45
+ for (const s of this.signals)
46
+ o.push([s.longitude, s.latitude]);
47
+ for (const s of this.subDistricts)
48
+ o.push(...s.getAllSignalCoordinates());
49
+ return o;
34
50
  }
35
- getDarkNonGrayColor(s) {
36
- let o, t, i;
37
- if (s) {
38
- const a = this.cyrb53(s);
39
- o = ((a & 16711680) >> 16) % 200, t = ((a & 65280) >> 8) % 200, i = (a & 255) % 200;
51
+ getDarkNonGrayColor(o) {
52
+ let s, t, i;
53
+ if (o) {
54
+ const a = this.cyrb53(o);
55
+ s = ((a & 16711680) >> 16) % 200, t = ((a & 65280) >> 8) % 200, i = (a & 255) % 200;
40
56
  } else
41
- o = Math.floor(Math.random() * 256), t = Math.floor(Math.random() * 256), i = Math.floor(Math.random() * 256);
42
- return [o, t, i];
57
+ s = Math.floor(Math.random() * 256), t = Math.floor(Math.random() * 256), i = Math.floor(Math.random() * 256);
58
+ return [s, t, i];
43
59
  }
44
- cyrb53(s, o = 0) {
45
- let t = 3735928559 ^ o, i = 1103547991 ^ o;
46
- for (let a = 0, n; a < s.length; a++)
47
- n = s.charCodeAt(a), t = Math.imul(t ^ n, 2654435761), i = Math.imul(i ^ n, 1597334677);
60
+ cyrb53(o, s = 0) {
61
+ let t = 3735928559 ^ s, i = 1103547991 ^ s;
62
+ for (let a = 0, n; a < o.length; a++)
63
+ n = o.charCodeAt(a), t = Math.imul(t ^ n, 2654435761), i = Math.imul(i ^ n, 1597334677);
48
64
  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);
49
65
  }
50
66
  }
51
67
  export {
52
- r as default
68
+ e as default
53
69
  };
@@ -375,14 +375,10 @@ const e = {
375
375
  {
376
376
  value: "true,true",
377
377
  symbol: {
378
- type: "simple-marker",
379
- style: "circle",
380
- color: [254, 172, 22, 0.8],
381
- size: 8,
382
- outline: {
383
- color: "white",
384
- width: 0
385
- }
378
+ type: "picture-marker",
379
+ url: "/GisViewerAssets/Images/icon_star.png",
380
+ width: "20px",
381
+ height: "20px"
386
382
  }
387
383
  },
388
384
  {
@@ -424,31 +420,31 @@ const e = {
424
420
  }
425
421
  }
426
422
  }
427
- ],
428
- visualVariables: [
429
- {
430
- type: "size",
431
- valueExpression: "$view.scale",
432
- stops: [
433
- {
434
- size: 8,
435
- value: 9000.954822000003
436
- },
437
- {
438
- size: 6,
439
- value: 18055.954822000003
440
- },
441
- {
442
- size: 3,
443
- value: 144447.638572
444
- },
445
- {
446
- size: 2,
447
- value: 1155581108577e-6
448
- }
449
- ]
450
- }
451
423
  ]
424
+ // visualVariables: [
425
+ // {
426
+ // type: 'size',
427
+ // valueExpression: '$view.scale',
428
+ // stops: [
429
+ // {
430
+ // size: 8,
431
+ // value: 9000.954822000003
432
+ // },
433
+ // {
434
+ // size: 6,
435
+ // value: 18055.954822000003
436
+ // },
437
+ // {
438
+ // size: 3,
439
+ // value: 144447.638572
440
+ // },
441
+ // {
442
+ // size: 2,
443
+ // value: 1155581.108577
444
+ // }
445
+ // ]
446
+ // }
447
+ // ]
452
448
  }
453
449
  }, s = {
454
450
  id: "signalLayer",
@@ -762,7 +758,7 @@ const e = {
762
758
  }
763
759
  ]
764
760
  }
765
- }, a = {
761
+ }, n = {
766
762
  id: "signalLayer",
767
763
  source: [],
768
764
  objectIdField: "ObjectID",
@@ -980,7 +976,7 @@ const e = {
980
976
  export {
981
977
  e as districtDashLineLayerOptions,
982
978
  t as districtSolidLineLayerOptions,
983
- a as signalClusterLayerOptions,
979
+ n as signalClusterLayerOptions,
984
980
  l as signalMarkerLayerOptions,
985
981
  s as signalPictureLayerOptions,
986
982
  r as subDistrictLineLayerOptions,
@@ -1,7 +1,6 @@
1
1
  import { IFindSignalControlAreaParams, ILayerVisibleParams, IResult, IShowSignalControlAreaParams } from '../../../types';
2
2
  export default class SignalControlAreaController1 {
3
3
  private view;
4
- private hasGpu;
5
4
  /** 支队图层 */
6
5
  private detachmentLayer;
7
6
  private detachmentLayerLoaded;
@@ -9,7 +8,6 @@ export default class SignalControlAreaController1 {
9
8
  private subDistrictRenderer;
10
9
  private signalRenderer;
11
10
  private mapConfig;
12
- private roadLines;
13
11
  constructor(view: __esri.MapView | __esri.SceneView);
14
12
  /**
15
13
  * 显示所有区控、子区、信号机
@@ -51,11 +49,6 @@ export default class SignalControlAreaController1 {
51
49
  status: number;
52
50
  message: string;
53
51
  }>;
54
- /**
55
- * 获取道路线
56
- * @returns
57
- */
58
- private loadRoadLine;
59
52
  /**
60
53
  * 加载支队图层
61
54
  * 现场环境用url创建FeatureLayer有各种问题,
@@ -2,17 +2,17 @@ import { Polygon as f } from "@arcgis/core/geometry";
2
2
  import { webMercatorToGeographic as y } from "@arcgis/core/geometry/support/webMercatorUtils";
3
3
  import g from "@arcgis/core/Graphic";
4
4
  import m from "@arcgis/core/layers/GraphicsLayer";
5
- import R from "papaparse";
6
- import D from "../../stores/index.mjs";
7
- import p from "./district-controller.mjs";
8
- import w from "./district-renderer.mjs";
9
- import L from "./signal-renderer.mjs";
5
+ import R from "../../stores/index.mjs";
6
+ import w from "./district-controller.mjs";
7
+ import D from "./district-renderer.mjs";
8
+ import p from "./signal-renderer.mjs";
10
9
  import C from "./sub-district-renderer.mjs";
11
- class P {
10
+ class N {
11
+ // private roadLines!: IRoadLine[];
12
12
  constructor(e) {
13
- this.detachmentLayerLoaded = !1, this.view = e, this.hasGpu = !1;
14
- const t = D.useAppDataStore;
15
- this.mapConfig = JSON.parse(JSON.stringify(t.mapConfig)), this.detachmentLayer = new m(), this.view.map.add(this.detachmentLayer), this.districtRenderer = new w(e), this.subDistrictRenderer = new C(e), this.signalRenderer = new L(e);
13
+ this.detachmentLayerLoaded = !1, this.view = e;
14
+ const t = R.useAppDataStore;
15
+ this.mapConfig = JSON.parse(JSON.stringify(t.mapConfig)), this.detachmentLayer = new m(), this.view.map.add(this.detachmentLayer), this.districtRenderer = new D(e), this.subDistrictRenderer = new C(e), this.signalRenderer = new p(e);
16
16
  }
17
17
  /**
18
18
  * 显示所有区控、子区、信号机
@@ -20,16 +20,16 @@ class P {
20
20
  * @returns
21
21
  */
22
22
  async showSignalControlArea(e) {
23
- this.detachmentLayerLoaded || await this.loadDetachmentLayer(), this.roadLines || (await this.loadRoadLine(), this.subDistrictRenderer.roadLines = this.roadLines), await this.clearSignalControlArea(), this.districtRenderer.setVisible(!1), this.subDistrictRenderer.setVisible(!1), this.signalRenderer.setClusterVisible(!1), this.signalRenderer.setPointVisible(!1);
24
- const t = [], s = [];
25
- for (const a of e.areaList) {
26
- const i = new p(
27
- a,
23
+ this.detachmentLayerLoaded || await this.loadDetachmentLayer(), await this.clearSignalControlArea(), this.districtRenderer.setVisible(!1), this.subDistrictRenderer.setVisible(!1), this.signalRenderer.setClusterVisible(!1), this.signalRenderer.setPointVisible(!1);
24
+ const t = [], i = [];
25
+ for (const n of e.areaList) {
26
+ const s = new w(
27
+ n,
28
28
  e.style || ""
29
29
  );
30
- t.push(i), s.push(...i.subDistricts);
30
+ t.push(s), i.push(...s.subDistricts);
31
31
  }
32
- return this.districtRenderer.style = e.style || "", await this.districtRenderer.showDistricts(t), await this.subDistrictRenderer.showSubDistricts(s), await this.signalRenderer.showSignals(t), { status: 0, message: "ok" };
32
+ return this.districtRenderer.style = e.style || "", await this.districtRenderer.showDistricts(t), await this.subDistrictRenderer.showSubDistricts(i), await this.signalRenderer.showSignals(t), { status: 0, message: "ok" };
33
33
  }
34
34
  /**
35
35
  * 清空区控、子区、信号机
@@ -88,14 +88,14 @@ class P {
88
88
  async highlightSignalControlArea(e) {
89
89
  switch (this.view.closePopup(), e.type) {
90
90
  case "district":
91
- return await this.districtRenderer.highlightDistrict(e.id) ? (this.subDistrictRenderer.filter("district", e.id), this.signalRenderer.filter("district", e.id), this.roadLines && this.roadLines.length > 0 && await this.subDistrictRenderer.showRoads(e.id), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
91
+ return await this.districtRenderer.highlightDistrict(e.id) ? (this.subDistrictRenderer.filter(e), this.signalRenderer.filter(e), await this.subDistrictRenderer.showRoads(e), { status: 0, message: "ok" }) : { status: 1, message: "未找到区控" };
92
92
  case "subDistrict": {
93
- const { count: t, parentId: s } = await this.subDistrictRenderer.highlightSubDistrict(e.id);
94
- return t > 0 ? (this.districtRenderer.filter(s), this.signalRenderer.filter("subDistrict", e.id), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
93
+ const { count: t, parentId: i } = await this.subDistrictRenderer.highlightSubDistrict(e.id);
94
+ return t > 0 ? (this.districtRenderer.filter(i), this.signalRenderer.filter(e), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
95
95
  }
96
96
  case "signal": {
97
- const { districtId: t, subDistrictId: s, count: a } = await this.signalRenderer.highlightSignal(e.id);
98
- return a > 0 ? (this.districtRenderer.filter(t), this.subDistrictRenderer.filter("subDistrict", s), { status: 0, message: "ok" }) : { status: 1, message: "未找到信号机" };
97
+ const { districtId: t, subDistrictId: i, count: n } = await this.signalRenderer.highlightSignal(e.id);
98
+ return n > 0 ? (this.districtRenderer.filter(t), this.subDistrictRenderer.filter(e), { status: 0, message: "ok" }) : { status: 1, message: "未找到信号机" };
99
99
  }
100
100
  default:
101
101
  return { status: 1, message: "未知类型" };
@@ -108,39 +108,6 @@ class P {
108
108
  async resetHighlight() {
109
109
  return this.districtRenderer.resetFilter(), this.subDistrictRenderer.resetFilter(), this.signalRenderer.resetFilter(), { status: 0, message: "ok" };
110
110
  }
111
- /**
112
- * 获取道路线
113
- * @returns
114
- */
115
- async loadRoadLine() {
116
- var t;
117
- const e = (t = this.mapConfig.signalControlArea) == null ? void 0 : t.roadLayerUrl;
118
- if (!e) {
119
- console.warn("未配置道路线图层URL");
120
- return;
121
- }
122
- try {
123
- const a = await (await fetch(`/GisViewerAssets/${e}`)).text();
124
- R.parse(a, {
125
- header: !0,
126
- skipEmptyLines: !0,
127
- complete: (i) => {
128
- const { data: r } = i;
129
- this.roadLines = r.map((n) => ({
130
- id: n.ROADSECT_ID,
131
- fromNode: n.FROM_NODE_ID,
132
- toNode: n.TO_NODE_ID,
133
- coordinates: JSON.parse(n.GEOM).coordinates
134
- }));
135
- },
136
- error: (i) => {
137
- console.error("道路线CSV解析失败:", i);
138
- }
139
- });
140
- } catch (s) {
141
- console.error("读取道路线CSV失败:", s);
142
- }
143
- }
144
111
  /**
145
112
  * 加载支队图层
146
113
  * 现场环境用url创建FeatureLayer有各种问题,
@@ -151,35 +118,35 @@ class P {
151
118
  if (!e)
152
119
  return;
153
120
  const t = e.find(
154
- (s) => s.options.id === "shanghai_district"
121
+ (i) => i.options.id === "shanghai_district"
155
122
  );
156
123
  if (t)
157
124
  try {
158
- const a = await (await fetch(
125
+ const n = await (await fetch(
159
126
  "/GisViewerAssets/ShangHai/Layers/district.json"
160
- )).json(), i = [], { renderer: r, labelingInfo: n } = t.options;
161
- a.features.forEach((d) => {
162
- const c = d.attributes.ZD_NAME;
163
- if (c !== "高架支队") {
127
+ )).json(), s = [], { renderer: r, labelingInfo: d } = t.options;
128
+ n.features.forEach((c) => {
129
+ const o = c.attributes.ZD_NAME;
130
+ if (o !== "高架支队") {
164
131
  let l = new f({
165
- rings: d.geometry.rings
132
+ rings: c.geometry.rings
166
133
  });
167
134
  l = y(l);
168
- const o = new g({
135
+ const a = new g({
169
136
  geometry: l,
170
- attributes: d.attributes
137
+ attributes: c.attributes
171
138
  });
172
139
  if (r) {
173
140
  if (r.type === "simple")
174
- o.symbol = r.symbol;
141
+ a.symbol = r.symbol;
175
142
  else if (r.type === "unique-value") {
176
- const h = o.getAttribute("OBJECTID"), u = r.uniqueValueInfos.find(
143
+ const h = a.getAttribute("OBJECTID"), u = r.uniqueValueInfos.find(
177
144
  (b) => b.value == h
178
145
  );
179
- o.symbol = u ? u.symbol : r.defaultSymbol;
146
+ a.symbol = u ? u.symbol : r.defaultSymbol;
180
147
  }
181
148
  } else
182
- o.symbol = {
149
+ a.symbol = {
183
150
  type: "simple-fill",
184
151
  color: [227, 237, 255, 0.4],
185
152
  outline: {
@@ -187,21 +154,21 @@ class P {
187
154
  width: 2
188
155
  }
189
156
  };
190
- if (i.push(o), n && c !== "边防港航支队" && c !== "机场支队") {
157
+ if (s.push(a), d && o !== "边防港航支队" && o !== "机场支队") {
191
158
  const h = new g({
192
159
  geometry: l.centroid,
193
- symbol: { ...n.symbol, text: c }
160
+ symbol: { ...d.symbol, text: o }
194
161
  });
195
- i.push(h);
162
+ s.push(h);
196
163
  }
197
164
  }
198
- }), this.detachmentLayer.addMany(i), this.detachmentLayerLoaded = !0;
199
- } catch (s) {
200
- console.error("加载支队图层失败:", s);
165
+ }), this.detachmentLayer.addMany(s), this.detachmentLayerLoaded = !0;
166
+ } catch (i) {
167
+ console.error("加载支队图层失败:", i);
201
168
  return;
202
169
  }
203
170
  }
204
171
  }
205
172
  export {
206
- P as default
173
+ N as default
207
174
  };
@@ -1,4 +1,4 @@
1
- import { IResult } from '../../../types';
1
+ import { IFindSignalControlAreaParams, IResult } from '../../../types';
2
2
  import DistrictController from './district-controller';
3
3
  export default class CrossRenderer {
4
4
  private view;
@@ -16,6 +16,6 @@ export default class CrossRenderer {
16
16
  subDistrictId: string;
17
17
  count: number;
18
18
  }>;
19
- filter(type: string, id: string): void;
19
+ filter(params: IFindSignalControlAreaParams): void;
20
20
  resetFilter(): void;
21
21
  }
@@ -1,14 +1,14 @@
1
- import d from "@arcgis/core/Graphic";
2
- import u from "@arcgis/core/layers/FeatureLayer";
1
+ import u from "@arcgis/core/Graphic";
2
+ import d from "@arcgis/core/layers/FeatureLayer";
3
3
  import o from "../common-utils.mjs";
4
4
  import { signalMarkerLayerOptions as y, signalPictureLayerOptions as c, signalClusterLayerOptions as p } from "./layer-symbol.mjs";
5
5
  class E {
6
6
  constructor(e) {
7
- this.view = e, this.signalMarkerLayer = new u(
7
+ this.view = e, this.signalMarkerLayer = new d(
8
8
  y
9
- ), this.signalMarkerLayer.spatialReference = e.spatialReference, this.signalMarkerLayer.popupEnabled = !0, this.signalPictureLayer = new u(
9
+ ), this.signalMarkerLayer.spatialReference = e.spatialReference, this.signalMarkerLayer.popupEnabled = !0, this.signalPictureLayer = new d(
10
10
  c
11
- ), this.signalPictureLayer.spatialReference = e.spatialReference, this.signalPictureLayer.popupEnabled = !0, this.signalClusterLayer = new u(
11
+ ), this.signalPictureLayer.spatialReference = e.spatialReference, this.signalPictureLayer.popupEnabled = !0, this.signalClusterLayer = new d(
12
12
  p
13
13
  ), this.signalClusterLayer.spatialReference = e.spatialReference, this.signalClusterLayer.popupEnabled = !0, this.view.map.addMany([
14
14
  this.signalMarkerLayer,
@@ -19,10 +19,10 @@ class E {
19
19
  async showSignals(e) {
20
20
  await this.clearSignals();
21
21
  let r = 0;
22
- const s = [];
23
- e.forEach((a) => {
24
- a.signals.forEach((i) => {
25
- const t = new d({
22
+ const a = [];
23
+ e.forEach((s) => {
24
+ s.signals.forEach((i) => {
25
+ const t = new u({
26
26
  geometry: {
27
27
  type: "point",
28
28
  longitude: i.longitude,
@@ -34,8 +34,8 @@ class E {
34
34
  name: i.name,
35
35
  signalId: i.signalId,
36
36
  nodeId: i.nodeId || i.id,
37
- districtId: a.id,
38
- districtName: a.name,
37
+ districtId: s.id,
38
+ districtName: s.name,
39
39
  subDistrictId: "",
40
40
  subDistrictName: "",
41
41
  isKey: i.isKey,
@@ -43,10 +43,10 @@ class E {
43
43
  selected: !0
44
44
  }
45
45
  });
46
- s.push(t);
47
- }), a.subDistricts.forEach((i) => {
46
+ a.push(t);
47
+ }), s.subDistricts.forEach((i) => {
48
48
  i.signals.forEach((t) => {
49
- const n = new d({
49
+ const n = new u({
50
50
  geometry: {
51
51
  type: "point",
52
52
  longitude: t.longitude,
@@ -58,8 +58,8 @@ class E {
58
58
  name: t.name,
59
59
  signalId: t.signalId,
60
60
  nodeId: t.nodeId || t.id,
61
- districtId: a.id,
62
- districtName: a.name,
61
+ districtId: s.id,
62
+ districtName: s.name,
63
63
  subDistrictId: i.id,
64
64
  subDistrictName: i.name,
65
65
  isKey: t.isKey,
@@ -67,15 +67,15 @@ class E {
67
67
  selected: !0
68
68
  }
69
69
  });
70
- s.push(n);
70
+ a.push(n);
71
71
  });
72
72
  });
73
73
  }), await this.signalMarkerLayer.applyEdits({
74
- addFeatures: s
74
+ addFeatures: a
75
75
  }), await this.signalPictureLayer.applyEdits({
76
- addFeatures: s
76
+ addFeatures: a
77
77
  }), await this.signalClusterLayer.applyEdits({
78
- addFeatures: s
78
+ addFeatures: a
79
79
  });
80
80
  }
81
81
  async clearSignals() {
@@ -98,19 +98,19 @@ class E {
98
98
  return { status: 0, message: "ok" };
99
99
  }
100
100
  async highlightSignal(e) {
101
- let r = "", s = "";
102
- const a = this.signalMarkerLayer.definitionExpression;
101
+ let r = "", a = "";
102
+ const s = this.signalMarkerLayer.definitionExpression;
103
103
  this.signalMarkerLayer.definitionExpression = `signalId = '${e}'`;
104
104
  const i = await this.signalMarkerLayer.queryFeatures(), t = i.features.length;
105
105
  if (t > 0) {
106
106
  const n = i.features[0].attributes.districtId || "", l = i.features[0].attributes.subDistrictId || "";
107
107
  return await o.viewGoto(this.view, i.features), { districtId: n, subDistrictId: l, count: t };
108
108
  } else
109
- this.signalMarkerLayer.definitionExpression = a;
110
- return { districtId: r, subDistrictId: s, count: t };
109
+ this.signalMarkerLayer.definitionExpression = s;
110
+ return { districtId: r, subDistrictId: a, count: t };
111
111
  }
112
- filter(e, r) {
113
- const s = `${e === "district" ? "districtId" : "subDistrictId"} = '${r}'`;
112
+ filter(e) {
113
+ const { id: r, type: a } = e, s = `${a === "district" ? "districtId" : "subDistrictId"} = '${r}'`;
114
114
  this.signalClusterLayer.definitionExpression = s, this.signalMarkerLayer.definitionExpression = s, this.signalPictureLayer.definitionExpression = s;
115
115
  }
116
116
  resetFilter() {
@@ -1,14 +1,18 @@
1
- import { IResult, IRoadLine } from '../../../types';
1
+ import { IDistrictRoad, IFindSignalControlAreaParams, IResult } from '../../../types';
2
2
  import DistrictController from './district-controller';
3
3
  export default class SubDistrictRenderer {
4
4
  private view;
5
5
  private clickHandler;
6
6
  private subDistrictPointLayer;
7
7
  private subDistrictLineLayer;
8
- roadLines: IRoadLine[];
8
+ roadConnections: IDistrictRoad[];
9
9
  constructor(view: __esri.MapView | __esri.SceneView);
10
10
  showSubDistricts(controllers: DistrictController[]): Promise<void>;
11
- showRoads(districtId: string): Promise<void>;
11
+ /**
12
+ * 显示区控下的所有子区,用道路线表示
13
+ * @param id 区控ID
14
+ */
15
+ showRoads(params: IFindSignalControlAreaParams): Promise<void>;
12
16
  clearSubDistricts(): Promise<void>;
13
17
  setVisible(visible: boolean): void;
14
18
  /**
@@ -30,12 +34,16 @@ export default class SubDistrictRenderer {
30
34
  * @param type 类型,district 或 subDistrict
31
35
  * @param id
32
36
  */
33
- filter(type: string, id: string): void;
37
+ filter(param: IFindSignalControlAreaParams): void;
34
38
  /**
35
39
  * 重置过滤器,显示所有子区
36
40
  */
37
41
  resetFilter(): void;
38
42
  private currentPointRenderer;
39
43
  private currentLineRenderer;
44
+ /**
45
+ * 监听地图点击事件,进行子区高亮
46
+ * @param event
47
+ */
40
48
  private viewHitTest;
41
49
  }
@@ -1,13 +1,13 @@
1
- import v from "@arcgis/core/Graphic";
2
- import w from "@arcgis/core/layers/FeatureLayer";
3
- import g from "../common-utils.mjs";
4
- import { subDistrictPointLayerOptions as I, subDistrictLineLayerOptions as P } from "./layer-symbol.mjs";
5
- class S {
1
+ import f from "@arcgis/core/Graphic";
2
+ import m from "@arcgis/core/layers/FeatureLayer";
3
+ import v from "../common-utils.mjs";
4
+ import { subDistrictPointLayerOptions as I, subDistrictLineLayerOptions as z } from "./layer-symbol.mjs";
5
+ class C {
6
6
  constructor(e) {
7
- this.view = e, this.subDistrictPointLayer = new w(
7
+ this.roadConnections = [], this.view = e, this.subDistrictPointLayer = new m(
8
8
  I
9
- ), this.subDistrictPointLayer.spatialReference = e.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new w(
10
- P
9
+ ), this.subDistrictPointLayer.spatialReference = e.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new m(
10
+ z
11
11
  ), this.subDistrictLineLayer.spatialReference = e.spatialReference, this.subDistrictLineLayer.popupEnabled = !0, this.view.map.addMany([
12
12
  this.subDistrictLineLayer,
13
13
  this.subDistrictPointLayer
@@ -18,13 +18,13 @@ class S {
18
18
  let s = 0;
19
19
  const t = [], r = [];
20
20
  e.forEach((i) => {
21
- r.push({
21
+ i.roadConnections.length > 0 && this.roadConnections.push(...i.roadConnections), r.push({
22
22
  value: i.id,
23
23
  label: i.name,
24
24
  symbol: {
25
25
  type: "simple-marker",
26
26
  style: "circle",
27
- color: [0, 0, 0, 0],
27
+ color: [...i.areaColor, 0.8],
28
28
  size: "8px",
29
29
  outline: {
30
30
  color: [...i.areaColor],
@@ -32,7 +32,7 @@ class S {
32
32
  }
33
33
  }
34
34
  }), i.signals.forEach((a) => {
35
- const n = new v({
35
+ const n = new f({
36
36
  geometry: {
37
37
  type: "point",
38
38
  longitude: a.longitude,
@@ -99,80 +99,69 @@ class S {
99
99
  addFeatures: t
100
100
  });
101
101
  }
102
+ /**
103
+ * 显示区控下的所有子区,用道路线表示
104
+ * @param id 区控ID
105
+ */
102
106
  async showRoads(e) {
103
- const s = this.subDistrictPointLayer.createQuery();
104
- s.where = `districtId = '${e}'`;
105
- const t = await this.subDistrictPointLayer.queryFeatures(
106
- s
107
- ), r = /* @__PURE__ */ new Map();
108
- t.features.forEach((n) => {
109
- var o;
107
+ const { type: s, id: t } = e, r = this.subDistrictPointLayer.createQuery(), i = s === "district" ? "districtId" : "subDistrictId";
108
+ r.where = `${i} = '${t}'`;
109
+ const a = await this.subDistrictPointLayer.queryFeatures(
110
+ r
111
+ ), n = /* @__PURE__ */ new Map();
112
+ a.features.forEach((u) => {
113
+ var y;
110
114
  const {
111
- subDistrictId: c,
112
- color: l,
113
- id: b,
114
- districtName: h,
115
- subDistrictName: u,
116
- signalCount: y
117
- } = n.attributes;
118
- r.has(c) || r.set(c, {
119
- color: l,
115
+ subDistrictId: o,
116
+ color: c,
117
+ id: d,
118
+ districtName: p,
119
+ subDistrictName: L,
120
+ signalCount: b
121
+ } = u.attributes;
122
+ n.has(o) || n.set(o, {
123
+ color: c,
120
124
  signalIds: [],
121
- districtName: h,
122
- subDistrictName: u,
123
- signalCount: y
124
- }), (o = r.get(c)) == null || o.signalIds.push(b);
125
+ districtName: p,
126
+ subDistrictName: L,
127
+ signalCount: b
128
+ }), (y = n.get(o)) == null || y.signalIds.push(d);
125
129
  });
126
- const i = [], a = [];
127
- for (const n of r) {
128
- let c = 0;
129
- const l = n[0];
130
- i.push({
131
- value: l,
130
+ const h = [], D = [];
131
+ for (const u of n) {
132
+ let o = 0;
133
+ const c = u[0];
134
+ h.push({
135
+ value: c,
132
136
  symbol: {
133
137
  type: "simple-line",
134
- color: n[1].color.split(",").map(Number),
138
+ color: u[1].color.split(",").map(Number),
135
139
  width: 2,
136
140
  style: "solid"
137
141
  }
138
142
  });
139
- const { districtName: b, subDistrictName: h, signalIds: u, signalCount: y } = n[1];
140
- if (!(u.length < 2))
141
- for (let o = 0; o < u.length; o++)
142
- for (let d = 0; d < u.length; d++) {
143
- if (o === d)
144
- continue;
145
- const f = u[o], L = u[d];
146
- if (a.some((p) => {
147
- const m = p.attributes;
148
- return m && m.fromNode === L && m.toNode === f;
149
- }))
150
- continue;
151
- const D = this.roadLines.find(
152
- (p) => p.fromNode === f && p.toNode === L
153
- );
154
- if (!D)
155
- continue;
156
- const z = new v({
157
- geometry: {
158
- type: "polyline",
159
- paths: [D.coordinates]
160
- },
161
- attributes: {
162
- ObjectID: c++,
163
- id: D.id,
164
- districtId: e,
165
- subDistrictId: l,
166
- subDistrictName: h,
167
- districtName: b,
168
- signalCount: y,
169
- fromNode: f,
170
- toNode: L,
171
- color: n[1].color
172
- }
173
- });
174
- a.push(z);
143
+ const { districtName: d, subDistrictName: p, signalIds: L, signalCount: b } = u[1];
144
+ this.roadConnections.filter(
145
+ (l) => l.subDistrictId === c
146
+ ).forEach((l) => {
147
+ const w = new f({
148
+ geometry: {
149
+ type: "polyline",
150
+ paths: l.coordinates
151
+ },
152
+ attributes: {
153
+ ObjectID: o++,
154
+ id: l.id,
155
+ districtId: l.districtId,
156
+ subDistrictId: c,
157
+ subDistrictName: p,
158
+ districtName: d,
159
+ signalCount: b,
160
+ color: u[1].color
175
161
  }
162
+ });
163
+ D.push(w);
164
+ });
176
165
  }
177
166
  this.subDistrictLineLayer.renderer = {
178
167
  type: "unique-value",
@@ -184,7 +173,7 @@ class S {
184
173
  style: "solid"
185
174
  },
186
175
  defaultLabel: "其他子区",
187
- uniqueValueInfos: i,
176
+ uniqueValueInfos: h,
188
177
  visualVariables: [
189
178
  {
190
179
  type: "size",
@@ -214,7 +203,7 @@ class S {
214
203
  }
215
204
  ]
216
205
  }, this.currentLineRenderer = this.subDistrictLineLayer.renderer.clone(), await this.subDistrictLineLayer.applyEdits({
217
- addFeatures: a
206
+ addFeatures: D
218
207
  });
219
208
  }
220
209
  async clearSubDistricts() {
@@ -239,7 +228,7 @@ class S {
239
228
  const s = this.subDistrictPointLayer.createQuery();
240
229
  s.where = `subDistrictId = '${e}'`, s.returnGeometry = !0;
241
230
  const t = await this.subDistrictPointLayer.queryFeatures(s);
242
- return t.features.length > 0 ? (await g.viewGoto(this.view, t.features), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
231
+ return t.features.length > 0 ? (await v.viewGoto(this.view, t.features), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
243
232
  }
244
233
  /**
245
234
  * 高亮子区, 其他子区隐藏
@@ -251,16 +240,16 @@ class S {
251
240
  const t = this.subDistrictPointLayer.definitionExpression;
252
241
  this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${e}'`;
253
242
  const r = await this.subDistrictPointLayer.queryFeatures(), i = r.features.length;
254
- return i > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${e}'`, s = r.features[0].attributes.districtId, await g.viewGoto(this.view, r.features)) : this.subDistrictPointLayer.definitionExpression = t, { count: i, parentId: s };
243
+ return i > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${e}'`, s = r.features[0].attributes.districtId, await v.viewGoto(this.view, r.features)) : this.subDistrictPointLayer.definitionExpression = t, { count: i, parentId: s };
255
244
  }
256
245
  /**
257
246
  * 按照区控、子区id显示子区
258
247
  * @param type 类型,district 或 subDistrict
259
248
  * @param id
260
249
  */
261
- filter(e, s) {
262
- const t = `${e === "district" ? "districtId" : "subDistrictId"} = '${s}'`;
263
- this.subDistrictPointLayer.definitionExpression = t, this.subDistrictLineLayer.definitionExpression = t;
250
+ filter(e) {
251
+ const { type: s, id: t } = e, r = `${s === "district" ? "districtId" : "subDistrictId"} = '${t}'`;
252
+ this.subDistrictPointLayer.definitionExpression = r, this.subDistrictLineLayer.definitionExpression = r;
264
253
  }
265
254
  /**
266
255
  * 重置过滤器,显示所有子区
@@ -268,6 +257,10 @@ class S {
268
257
  resetFilter() {
269
258
  this.subDistrictPointLayer.definitionExpression = "1=1", this.subDistrictLineLayer.definitionExpression = "1=1";
270
259
  }
260
+ /**
261
+ * 监听地图点击事件,进行子区高亮
262
+ * @param event
263
+ */
271
264
  async viewHitTest(e) {
272
265
  var r;
273
266
  const t = (r = (await this.view.hitTest(e, {
@@ -276,9 +269,9 @@ class S {
276
269
  (i) => i.type === "graphic"
277
270
  );
278
271
  if (t.length === 0)
279
- this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
272
+ console.time("resetRenderer"), this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
280
273
  else {
281
- const i = t[0].graphic;
274
+ const i = t[0].graphic, a = i.attributes.color.split(",").map(Number);
282
275
  this.subDistrictPointLayer.renderer = {
283
276
  type: "unique-value",
284
277
  field: "subDistrictId",
@@ -299,10 +292,10 @@ class S {
299
292
  symbol: {
300
293
  type: "simple-marker",
301
294
  style: "circle",
302
- color: [0, 0, 0, 0],
295
+ color: [...a, 0.8],
303
296
  size: "8px",
304
297
  outline: {
305
- color: i.attributes.color.split(",").map(Number),
298
+ color: a,
306
299
  width: 4
307
300
  }
308
301
  }
@@ -390,5 +383,5 @@ class S {
390
383
  }
391
384
  }
392
385
  export {
393
- S as default
386
+ C as default
394
387
  };
@@ -275,6 +275,12 @@ export interface IShowSignalControlAreaParams {
275
275
  areaList: any[];
276
276
  style?: string;
277
277
  }
278
+ export interface IDistrictRoad {
279
+ id: string;
280
+ coordinates: number[][];
281
+ districtId: string;
282
+ subDistrictId: string;
283
+ }
278
284
  export interface IFindSignalControlAreaParams {
279
285
  type: string;
280
286
  id: string;
@@ -1,3 +1,4 @@
1
+ import { IDistrictRoad } from 'packages/components/src/types';
1
2
  interface ICross {
2
3
  id: string;
3
4
  name: string;
@@ -18,6 +19,7 @@ export default class DistrictController {
18
19
  areaColor: [number, number, number];
19
20
  signalCount: number;
20
21
  subDistrictCount: number;
22
+ roadConnections: IDistrictRoad[];
21
23
  constructor(params: any, style: string);
22
24
  /**
23
25
  * 获取区控/子区下的所有信号机
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../common-utils.js");class n{constructor(s,e){this.parentName="",this.signals=[],this.subDistricts=[],this.areaColor=this.getDarkNonGrayColor(),this.signalCount=0,this.subDistrictCount=0,this.id=s.name,this.name=s.areaDesc,this.parentId=s.parentId,e==="alarm"&&(this.areaColor=[255,0,0]);for(const t of s.children)if(t.children){const i=new n(t,e);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}else if(r.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 e of this.signals)s.push([e.longitude,e.latitude]);for(const e of this.subDistricts)s.push(...e.getAllSignalCoordinates());return s}getDarkNonGrayColor(s){let e,t,i;if(s){const o=this.cyrb53(s);e=((o&16711680)>>16)%200,t=((o&65280)>>8)%200,i=(o&255)%200}else e=Math.floor(Math.random()*256),t=Math.floor(Math.random()*256),i=Math.floor(Math.random()*256);return[e,t,i]}cyrb53(s,e=0){let t=3735928559^e,i=1103547991^e;for(let o=0,a;o<s.length;o++)a=s.charCodeAt(o),t=Math.imul(t^a,2654435761),i=Math.imul(i^a,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=n;
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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={id:"districtController",source:[],objectIdField:"ObjectID",geometryType:"polyline",outFields:["*"],fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"}],renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"long-dash",color:[180,180,180],width:1}}]}},t={id:"districtController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"solid",color:[180,180,180,.4],width:1}}]}},i={id:"subDistrictPointController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"},{name:"type",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},r={id:"subDistrictLineController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"fromNode",type:"string"},{name:"toNode",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},l={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:0}},uniqueValueInfos:[{value:"true,true",symbol:{type:"simple-marker",style:"circle",color:[254,172,22,.8],size:8,outline:{color:"white",width:0}}},{value:"false,true",symbol:{type:"simple-marker",style:"circle",color:[5,116,255,.8],size:8,outline:{color:"white",width:0}}},{value:"true,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}},{value:"false,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:8,value:9000.954822000003},{size:6,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}},s={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",minScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true,true",symbol:{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:30,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:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false,true",symbol:{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: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:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},{value:"true,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxk_gray.png",width:20,height:20}},{value:"false,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_xhj_gray.png",width:20,height:20}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:28,value:2250},{size:24,value:4500}]}]}},a={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],featureReduction:{type:"cluster",clusterRadius:"120px",clusterMaxSize:"50px",clusterMinSize:"30px",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.cluster_count",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:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""},{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]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:40,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"simple",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}};exports.districtDashLineLayerOptions=e;exports.districtSolidLineLayerOptions=t;exports.signalClusterLayerOptions=a;exports.signalMarkerLayerOptions=l;exports.signalPictureLayerOptions=s;exports.subDistrictLineLayerOptions=r;exports.subDistrictPointLayerOptions=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={id:"districtController",source:[],objectIdField:"ObjectID",geometryType:"polyline",outFields:["*"],fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"}],renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"long-dash",color:[180,180,180],width:1}}]}},t={id:"districtController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"solid",color:[180,180,180,.4],width:1}}]}},i={id:"subDistrictPointController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"},{name:"type",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},r={id:"subDistrictLineController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"fromNode",type:"string"},{name:"toNode",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},s={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:0}},uniqueValueInfos:[{value:"true,true",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/icon_star.png",width:"20px",height:"20px"}},{value:"false,true",symbol:{type:"simple-marker",style:"circle",color:[5,116,255,.8],size:8,outline:{color:"white",width:0}}},{value:"true,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}},{value:"false,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}}]}},l={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",minScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true,true",symbol:{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:30,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:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false,true",symbol:{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: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:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},{value:"true,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxk_gray.png",width:20,height:20}},{value:"false,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_xhj_gray.png",width:20,height:20}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:28,value:2250},{size:24,value:4500}]}]}},n={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],featureReduction:{type:"cluster",clusterRadius:"120px",clusterMaxSize:"50px",clusterMinSize:"30px",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.cluster_count",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:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""},{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]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:40,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"simple",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}};exports.districtDashLineLayerOptions=e;exports.districtSolidLineLayerOptions=t;exports.signalClusterLayerOptions=n;exports.signalMarkerLayerOptions=s;exports.signalPictureLayerOptions=l;exports.subDistrictLineLayerOptions=r;exports.subDistrictPointLayerOptions=i;
@@ -1,7 +1,6 @@
1
1
  import { IFindSignalControlAreaParams, ILayerVisibleParams, IResult, IShowSignalControlAreaParams } from '../../../types';
2
2
  export default class SignalControlAreaController1 {
3
3
  private view;
4
- private hasGpu;
5
4
  /** 支队图层 */
6
5
  private detachmentLayer;
7
6
  private detachmentLayerLoaded;
@@ -9,7 +8,6 @@ export default class SignalControlAreaController1 {
9
8
  private subDistrictRenderer;
10
9
  private signalRenderer;
11
10
  private mapConfig;
12
- private roadLines;
13
11
  constructor(view: __esri.MapView | __esri.SceneView);
14
12
  /**
15
13
  * 显示所有区控、子区、信号机
@@ -51,11 +49,6 @@ export default class SignalControlAreaController1 {
51
49
  status: number;
52
50
  message: string;
53
51
  }>;
54
- /**
55
- * 获取道路线
56
- * @returns
57
- */
58
- private loadRoadLine;
59
52
  /**
60
53
  * 加载支队图层
61
54
  * 现场环境用url创建FeatureLayer有各种问题,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils"),g=require("@arcgis/core/Graphic"),R=require("@arcgis/core/layers/GraphicsLayer"),D=require("papaparse"),w=require("../../stores/index.js"),m=require("./district-controller.js"),p=require("./district-renderer.js"),L=require("./signal-renderer.js"),C=require("./sub-district-renderer.js");class S{constructor(e){this.detachmentLayerLoaded=!1,this.view=e,this.hasGpu=!1;const t=w.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.detachmentLayer=new R,this.view.map.add(this.detachmentLayer),this.districtRenderer=new p.default(e),this.subDistrictRenderer=new C.default(e),this.signalRenderer=new L.default(e)}async showSignalControlArea(e){this.detachmentLayerLoaded||await this.loadDetachmentLayer(),this.roadLines||(await this.loadRoadLine(),this.subDistrictRenderer.roadLines=this.roadLines),await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const t=[],s=[];for(const n of e.areaList){const i=new m.default(n,e.style||"");t.push(i),s.push(...i.subDistricts)}return this.districtRenderer.style=e.style||"",await this.districtRenderer.showDistricts(t),await this.subDistrictRenderer.showSubDistricts(s),await this.signalRenderer.showSignals(t),{status:0,message:"ok"}}async clearSignalControlArea(){return await this.districtRenderer.clearDistricts(),await this.subDistrictRenderer.clearSubDistricts(),await this.signalRenderer.clearSignals(),{status:0,message:"ok"}}setLayerVisibility(e){switch(e.visible===!1&&this.view.closePopup(),e.id){case"district":this.districtRenderer.setVisible(e.visible);break;case"subDistrict":this.subDistrictRenderer.setVisible(e.visible);break;case"signal":this.signalRenderer.setPointVisible(e.visible);break;case"signalCluster":this.signalRenderer.setClusterVisible(e.visible);break;case"shanghai_district":this.detachmentLayer.visible=e.visible;break}return{status:0,message:"ok"}}async locateSignalControlArea(e){switch(e.type){case"district":return await this.districtRenderer.locateDistrict(e.id);case"subDistrict":return await this.subDistrictRenderer.locateSubDistrict(e.id);case"signal":return await this.signalRenderer.locateSignal(e.id);default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(e){switch(this.view.closePopup(),e.type){case"district":return await this.districtRenderer.highlightDistrict(e.id)?(this.subDistrictRenderer.filter("district",e.id),this.signalRenderer.filter("district",e.id),this.roadLines&&this.roadLines.length>0&&await this.subDistrictRenderer.showRoads(e.id),{status:0,message:"ok"}):{status:1,message:"未找到区控"};case"subDistrict":{const{count:t,parentId:s}=await this.subDistrictRenderer.highlightSubDistrict(e.id);return t>0?(this.districtRenderer.filter(s),this.signalRenderer.filter("subDistrict",e.id),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:t,subDistrictId:s,count:n}=await this.signalRenderer.highlightSignal(e.id);return n>0?(this.districtRenderer.filter(t),this.subDistrictRenderer.filter("subDistrict",s),{status:0,message:"ok"}):{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async resetHighlight(){return this.districtRenderer.resetFilter(),this.subDistrictRenderer.resetFilter(),this.signalRenderer.resetFilter(),{status:0,message:"ok"}}async loadRoadLine(){var t;const e=(t=this.mapConfig.signalControlArea)==null?void 0:t.roadLayerUrl;if(!e){console.warn("未配置道路线图层URL");return}try{const n=await(await fetch(`/GisViewerAssets/${e}`)).text();D.parse(n,{header:!0,skipEmptyLines:!0,complete:i=>{const{data:r}=i;this.roadLines=r.map(a=>({id:a.ROADSECT_ID,fromNode:a.FROM_NODE_ID,toNode:a.TO_NODE_ID,coordinates:JSON.parse(a.GEOM).coordinates}))},error:i=>{console.error("道路线CSV解析失败:",i)}})}catch(s){console.error("读取道路线CSV失败:",s)}}async loadDetachmentLayer(){const e=this.mapConfig.baseLayers;if(!e)return;const t=e.find(s=>s.options.id==="shanghai_district");if(t)try{const n=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),i=[],{renderer:r,labelingInfo:a}=t.options;n.features.forEach(d=>{const c=d.attributes.ZD_NAME;if(c!=="高架支队"){let l=new f.Polygon({rings:d.geometry.rings});l=y.webMercatorToGeographic(l);const o=new g({geometry:l,attributes:d.attributes});if(r){if(r.type==="simple")o.symbol=r.symbol;else if(r.type==="unique-value"){const h=o.getAttribute("OBJECTID"),u=r.uniqueValueInfos.find(b=>b.value==h);o.symbol=u?u.symbol:r.defaultSymbol}}else o.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(i.push(o),a&&c!=="边防港航支队"&&c!=="机场支队"){const h=new g({geometry:l.centroid,symbol:{...a.symbol,text:c}});i.push(h)}}}),this.detachmentLayer.addMany(i),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils"),g=require("@arcgis/core/Graphic"),w=require("@arcgis/core/layers/GraphicsLayer"),R=require("../../stores/index.js"),D=require("./district-controller.js"),m=require("./district-renderer.js"),S=require("./signal-renderer.js"),C=require("./sub-district-renderer.js");class p{constructor(e){this.detachmentLayerLoaded=!1,this.view=e;const t=R.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.detachmentLayer=new w,this.view.map.add(this.detachmentLayer),this.districtRenderer=new m.default(e),this.subDistrictRenderer=new C.default(e),this.signalRenderer=new S.default(e)}async showSignalControlArea(e){this.detachmentLayerLoaded||await this.loadDetachmentLayer(),await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const t=[],s=[];for(const n of e.areaList){const i=new D.default(n,e.style||"");t.push(i),s.push(...i.subDistricts)}return this.districtRenderer.style=e.style||"",await this.districtRenderer.showDistricts(t),await this.subDistrictRenderer.showSubDistricts(s),await this.signalRenderer.showSignals(t),{status:0,message:"ok"}}async clearSignalControlArea(){return await this.districtRenderer.clearDistricts(),await this.subDistrictRenderer.clearSubDistricts(),await this.signalRenderer.clearSignals(),{status:0,message:"ok"}}setLayerVisibility(e){switch(e.visible===!1&&this.view.closePopup(),e.id){case"district":this.districtRenderer.setVisible(e.visible);break;case"subDistrict":this.subDistrictRenderer.setVisible(e.visible);break;case"signal":this.signalRenderer.setPointVisible(e.visible);break;case"signalCluster":this.signalRenderer.setClusterVisible(e.visible);break;case"shanghai_district":this.detachmentLayer.visible=e.visible;break}return{status:0,message:"ok"}}async locateSignalControlArea(e){switch(e.type){case"district":return await this.districtRenderer.locateDistrict(e.id);case"subDistrict":return await this.subDistrictRenderer.locateSubDistrict(e.id);case"signal":return await this.signalRenderer.locateSignal(e.id);default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(e){switch(this.view.closePopup(),e.type){case"district":return await this.districtRenderer.highlightDistrict(e.id)?(this.subDistrictRenderer.filter(e),this.signalRenderer.filter(e),await this.subDistrictRenderer.showRoads(e),{status:0,message:"ok"}):{status:1,message:"未找到区控"};case"subDistrict":{const{count:t,parentId:s}=await this.subDistrictRenderer.highlightSubDistrict(e.id);return t>0?(this.districtRenderer.filter(s),this.signalRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:t,subDistrictId:s,count:n}=await this.signalRenderer.highlightSignal(e.id);return n>0?(this.districtRenderer.filter(t),this.subDistrictRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async resetHighlight(){return this.districtRenderer.resetFilter(),this.subDistrictRenderer.resetFilter(),this.signalRenderer.resetFilter(),{status:0,message:"ok"}}async loadDetachmentLayer(){const e=this.mapConfig.baseLayers;if(!e)return;const t=e.find(s=>s.options.id==="shanghai_district");if(t)try{const n=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),i=[],{renderer:r,labelingInfo:u}=t.options;n.features.forEach(o=>{const l=o.attributes.ZD_NAME;if(l!=="高架支队"){let c=new f.Polygon({rings:o.geometry.rings});c=y.webMercatorToGeographic(c);const a=new g({geometry:c,attributes:o.attributes});if(r){if(r.type==="simple")a.symbol=r.symbol;else if(r.type==="unique-value"){const d=a.getAttribute("OBJECTID"),h=r.uniqueValueInfos.find(b=>b.value==d);a.symbol=h?h.symbol:r.defaultSymbol}}else a.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(i.push(a),u&&l!=="边防港航支队"&&l!=="机场支队"){const d=new g({geometry:c.centroid,symbol:{...u.symbol,text:l}});i.push(d)}}}),this.detachmentLayer.addMany(i),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=p;
@@ -1,4 +1,4 @@
1
- import { IResult } from '../../../types';
1
+ import { IFindSignalControlAreaParams, IResult } from '../../../types';
2
2
  import DistrictController from './district-controller';
3
3
  export default class CrossRenderer {
4
4
  private view;
@@ -16,6 +16,6 @@ export default class CrossRenderer {
16
16
  subDistrictId: string;
17
17
  count: number;
18
18
  }>;
19
- filter(type: string, id: string): void;
19
+ filter(params: IFindSignalControlAreaParams): void;
20
20
  resetFilter(): void;
21
21
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/Graphic"),u=require("@arcgis/core/layers/FeatureLayer"),o=require("../common-utils.js"),l=require("./layer-symbol.js");class y{constructor(e){this.view=e,this.signalMarkerLayer=new u(l.signalMarkerLayerOptions),this.signalMarkerLayer.spatialReference=e.spatialReference,this.signalMarkerLayer.popupEnabled=!0,this.signalPictureLayer=new u(l.signalPictureLayerOptions),this.signalPictureLayer.spatialReference=e.spatialReference,this.signalPictureLayer.popupEnabled=!0,this.signalClusterLayer=new u(l.signalClusterLayerOptions),this.signalClusterLayer.spatialReference=e.spatialReference,this.signalClusterLayer.popupEnabled=!0,this.view.map.addMany([this.signalMarkerLayer,this.signalPictureLayer,this.signalClusterLayer])}async showSignals(e){await this.clearSignals();let r=0;const s=[];e.forEach(a=>{a.signals.forEach(i=>{const t=new d({geometry:{type:"point",longitude:i.longitude,latitude:i.latitude},attributes:{ObjectID:r++,id:i.id,name:i.name,signalId:i.signalId,nodeId:i.nodeId||i.id,districtId:a.id,districtName:a.name,subDistrictId:"",subDistrictName:"",isKey:i.isKey,type:"signal",selected:!0}});s.push(t)}),a.subDistricts.forEach(i=>{i.signals.forEach(t=>{const n=new d({geometry:{type:"point",longitude:t.longitude,latitude:t.latitude},attributes:{ObjectID:r++,id:t.id,name:t.name,signalId:t.signalId,nodeId:t.nodeId||t.id,districtId:a.id,districtName:a.name,subDistrictId:i.id,subDistrictName:i.name,isKey:t.isKey,type:"signal",selected:!0}});s.push(n)})})}),await this.signalMarkerLayer.applyEdits({addFeatures:s}),await this.signalPictureLayer.applyEdits({addFeatures:s}),await this.signalClusterLayer.applyEdits({addFeatures:s})}async clearSignals(){let e=await this.signalMarkerLayer.queryFeatures();await this.signalMarkerLayer.applyEdits({deleteFeatures:e.features}),this.signalMarkerLayer.definitionExpression="1=1",e=await this.signalPictureLayer.queryFeatures(),await this.signalPictureLayer.applyEdits({deleteFeatures:e.features}),this.signalPictureLayer.definitionExpression="1=1",e=await this.signalClusterLayer.queryFeatures(),await this.signalClusterLayer.applyEdits({deleteFeatures:e.features}),this.signalClusterLayer.definitionExpression="1=1"}async setPointVisible(e){this.signalMarkerLayer.visible=e,this.signalPictureLayer.visible=e}setClusterVisible(e){this.signalClusterLayer.visible=e}async locateSignal(e){return{status:0,message:"ok"}}async highlightSignal(e){let r="",s="";const a=this.signalMarkerLayer.definitionExpression;this.signalMarkerLayer.definitionExpression=`signalId = '${e}'`;const i=await this.signalMarkerLayer.queryFeatures(),t=i.features.length;if(t>0){const n=i.features[0].attributes.districtId||"",c=i.features[0].attributes.subDistrictId||"";return await o.default.viewGoto(this.view,i.features),{districtId:n,subDistrictId:c,count:t}}else this.signalMarkerLayer.definitionExpression=a;return{districtId:r,subDistrictId:s,count:t}}filter(e,r){const s=`${e==="district"?"districtId":"subDistrictId"} = '${r}'`;this.signalClusterLayer.definitionExpression=s,this.signalMarkerLayer.definitionExpression=s,this.signalPictureLayer.definitionExpression=s}resetFilter(){const e="1=1";this.signalClusterLayer.definitionExpression=e,this.signalMarkerLayer.definitionExpression=e,this.signalPictureLayer.definitionExpression=e}}exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/Graphic"),u=require("@arcgis/core/layers/FeatureLayer"),o=require("../common-utils.js"),l=require("./layer-symbol.js");class y{constructor(e){this.view=e,this.signalMarkerLayer=new u(l.signalMarkerLayerOptions),this.signalMarkerLayer.spatialReference=e.spatialReference,this.signalMarkerLayer.popupEnabled=!0,this.signalPictureLayer=new u(l.signalPictureLayerOptions),this.signalPictureLayer.spatialReference=e.spatialReference,this.signalPictureLayer.popupEnabled=!0,this.signalClusterLayer=new u(l.signalClusterLayerOptions),this.signalClusterLayer.spatialReference=e.spatialReference,this.signalClusterLayer.popupEnabled=!0,this.view.map.addMany([this.signalMarkerLayer,this.signalPictureLayer,this.signalClusterLayer])}async showSignals(e){await this.clearSignals();let r=0;const a=[];e.forEach(s=>{s.signals.forEach(i=>{const t=new d({geometry:{type:"point",longitude:i.longitude,latitude:i.latitude},attributes:{ObjectID:r++,id:i.id,name:i.name,signalId:i.signalId,nodeId:i.nodeId||i.id,districtId:s.id,districtName:s.name,subDistrictId:"",subDistrictName:"",isKey:i.isKey,type:"signal",selected:!0}});a.push(t)}),s.subDistricts.forEach(i=>{i.signals.forEach(t=>{const n=new d({geometry:{type:"point",longitude:t.longitude,latitude:t.latitude},attributes:{ObjectID:r++,id:t.id,name:t.name,signalId:t.signalId,nodeId:t.nodeId||t.id,districtId:s.id,districtName:s.name,subDistrictId:i.id,subDistrictName:i.name,isKey:t.isKey,type:"signal",selected:!0}});a.push(n)})})}),await this.signalMarkerLayer.applyEdits({addFeatures:a}),await this.signalPictureLayer.applyEdits({addFeatures:a}),await this.signalClusterLayer.applyEdits({addFeatures:a})}async clearSignals(){let e=await this.signalMarkerLayer.queryFeatures();await this.signalMarkerLayer.applyEdits({deleteFeatures:e.features}),this.signalMarkerLayer.definitionExpression="1=1",e=await this.signalPictureLayer.queryFeatures(),await this.signalPictureLayer.applyEdits({deleteFeatures:e.features}),this.signalPictureLayer.definitionExpression="1=1",e=await this.signalClusterLayer.queryFeatures(),await this.signalClusterLayer.applyEdits({deleteFeatures:e.features}),this.signalClusterLayer.definitionExpression="1=1"}async setPointVisible(e){this.signalMarkerLayer.visible=e,this.signalPictureLayer.visible=e}setClusterVisible(e){this.signalClusterLayer.visible=e}async locateSignal(e){return{status:0,message:"ok"}}async highlightSignal(e){let r="",a="";const s=this.signalMarkerLayer.definitionExpression;this.signalMarkerLayer.definitionExpression=`signalId = '${e}'`;const i=await this.signalMarkerLayer.queryFeatures(),t=i.features.length;if(t>0){const n=i.features[0].attributes.districtId||"",c=i.features[0].attributes.subDistrictId||"";return await o.default.viewGoto(this.view,i.features),{districtId:n,subDistrictId:c,count:t}}else this.signalMarkerLayer.definitionExpression=s;return{districtId:r,subDistrictId:a,count:t}}filter(e){const{id:r,type:a}=e,s=`${a==="district"?"districtId":"subDistrictId"} = '${r}'`;this.signalClusterLayer.definitionExpression=s,this.signalMarkerLayer.definitionExpression=s,this.signalPictureLayer.definitionExpression=s}resetFilter(){const e="1=1";this.signalClusterLayer.definitionExpression=e,this.signalMarkerLayer.definitionExpression=e,this.signalPictureLayer.definitionExpression=e}}exports.default=y;
@@ -1,14 +1,18 @@
1
- import { IResult, IRoadLine } from '../../../types';
1
+ import { IDistrictRoad, IFindSignalControlAreaParams, IResult } from '../../../types';
2
2
  import DistrictController from './district-controller';
3
3
  export default class SubDistrictRenderer {
4
4
  private view;
5
5
  private clickHandler;
6
6
  private subDistrictPointLayer;
7
7
  private subDistrictLineLayer;
8
- roadLines: IRoadLine[];
8
+ roadConnections: IDistrictRoad[];
9
9
  constructor(view: __esri.MapView | __esri.SceneView);
10
10
  showSubDistricts(controllers: DistrictController[]): Promise<void>;
11
- showRoads(districtId: string): Promise<void>;
11
+ /**
12
+ * 显示区控下的所有子区,用道路线表示
13
+ * @param id 区控ID
14
+ */
15
+ showRoads(params: IFindSignalControlAreaParams): Promise<void>;
12
16
  clearSubDistricts(): Promise<void>;
13
17
  setVisible(visible: boolean): void;
14
18
  /**
@@ -30,12 +34,16 @@ export default class SubDistrictRenderer {
30
34
  * @param type 类型,district 或 subDistrict
31
35
  * @param id
32
36
  */
33
- filter(type: string, id: string): void;
37
+ filter(param: IFindSignalControlAreaParams): void;
34
38
  /**
35
39
  * 重置过滤器,显示所有子区
36
40
  */
37
41
  resetFilter(): void;
38
42
  private currentPointRenderer;
39
43
  private currentLineRenderer;
44
+ /**
45
+ * 监听地图点击事件,进行子区高亮
46
+ * @param event
47
+ */
40
48
  private viewHitTest;
41
49
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/Graphic"),w=require("@arcgis/core/layers/FeatureLayer"),g=require("../common-utils.js"),P=require("./layer-symbol.js");class I{constructor(e){this.view=e,this.subDistrictPointLayer=new w(P.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=e.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new w(P.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=e.spatialReference,this.subDistrictLineLayer.popupEnabled=!0,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(e){await this.clearSubDistricts(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const t=[],r=[];e.forEach(i=>{r.push({value:i.id,label:i.name,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[...i.areaColor],width:4}}}),i.signals.forEach(a=>{const u=new m({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:s++,id:a.nodeId,name:a.name,subDistrictId:i.id,subDistrictName:i.name,districtId:i.parentId,districtName:i.parentName,signalCount:i.signalCount,color:i.areaColor.join(","),type:"subDistrict"}});t.push(u)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:[180,180,180,.5],size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:t})}async showRoads(e){const s=this.subDistrictPointLayer.createQuery();s.where=`districtId = '${e}'`;const t=await this.subDistrictPointLayer.queryFeatures(s),r=new Map;t.features.forEach(u=>{var o;const{subDistrictId:l,color:c,id:y,districtName:p,subDistrictName:n,signalCount:h}=u.attributes;r.has(l)||r.set(l,{color:c,signalIds:[],districtName:p,subDistrictName:n,signalCount:h}),(o=r.get(l))==null||o.signalIds.push(y)});const i=[],a=[];for(const u of r){let l=0;const c=u[0];i.push({value:c,symbol:{type:"simple-line",color:u[1].color.split(",").map(Number),width:2,style:"solid"}});const{districtName:y,subDistrictName:p,signalIds:n,signalCount:h}=u[1];if(!(n.length<2))for(let o=0;o<n.length;o++)for(let d=0;d<n.length;d++){if(o===d)continue;const L=n[o],f=n[d];if(a.some(b=>{const v=b.attributes;return v&&v.fromNode===f&&v.toNode===L}))continue;const D=this.roadLines.find(b=>b.fromNode===L&&b.toNode===f);if(!D)continue;const z=new m({geometry:{type:"polyline",paths:[D.coordinates]},attributes:{ObjectID:l++,id:D.id,districtId:e,subDistrictId:c,subDistrictName:p,districtName:y,signalCount:h,fromNode:L,toNode:f,color:u[1].color}});a.push(z)}}this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",color:[180,180,180,.5],width:2,style:"solid"},defaultLabel:"其他子区",uniqueValueInfos:i,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentLineRenderer=this.subDistrictLineLayer.renderer.clone(),await this.subDistrictLineLayer.applyEdits({addFeatures:a})}async clearSubDistricts(){var t;const e=await this.subDistrictPointLayer.queryFeatures();e.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:e.features}),this.subDistrictPointLayer.definitionExpression="1=1";const s=await this.subDistrictLineLayer.queryFeatures();s.features.length>0&&await this.subDistrictLineLayer.applyEdits({deleteFeatures:s.features}),this.subDistrictLineLayer.definitionExpression="1=1",(t=this.clickHandler)==null||t.remove()}setVisible(e){this.subDistrictPointLayer.visible=e,this.subDistrictLineLayer.visible=e}async locateSubDistrict(e){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${e}'`,s.returnGeometry=!0;const t=await this.subDistrictPointLayer.queryFeatures(s);return t.features.length>0?(await g.default.viewGoto(this.view,t.features),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(e){let s="";const t=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${e}'`;const r=await this.subDistrictPointLayer.queryFeatures(),i=r.features.length;return i>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${e}'`,s=r.features[0].attributes.districtId,await g.default.viewGoto(this.view,r.features)):this.subDistrictPointLayer.definitionExpression=t,{count:i,parentId:s}}filter(e,s){const t=`${e==="district"?"districtId":"subDistrictId"} = '${s}'`;this.subDistrictPointLayer.definitionExpression=t,this.subDistrictLineLayer.definitionExpression=t}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(e){var r;const t=(r=(await this.view.hitTest(e,{include:[this.subDistrictPointLayer,this.subDistrictLineLayer]})).results)==null?void 0:r.filter(i=>i.type==="graphic");if(t.length===0)this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const i=t[0].graphic;this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:i.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:i.attributes.color.split(",").map(Number),width:4}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",style:"solid",color:[180,180,180,.5],width:"8px"},defaultLabel:"其他子区",uniqueValueInfos:[{value:i.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:i.attributes.color.split(",").map(Number),width:"8px"}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}}}}exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/Graphic"),v=require("@arcgis/core/layers/FeatureLayer"),m=require("../common-utils.js"),w=require("./layer-symbol.js");class g{constructor(i){this.roadConnections=[],this.view=i,this.subDistrictPointLayer=new v(w.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=i.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new v(w.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=i.spatialReference,this.subDistrictLineLayer.popupEnabled=!0,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(i){await this.clearSubDistricts(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const t=[],r=[];i.forEach(e=>{e.roadConnections.length>0&&this.roadConnections.push(...e.roadConnections),r.push({value:e.id,label:e.name,symbol:{type:"simple-marker",style:"circle",color:[...e.areaColor,.8],size:"8px",outline:{color:[...e.areaColor],width:4}}}),e.signals.forEach(a=>{const u=new f({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:s++,id:a.nodeId,name:a.name,subDistrictId:e.id,subDistrictName:e.name,districtId:e.parentId,districtName:e.parentName,signalCount:e.signalCount,color:e.areaColor.join(","),type:"subDistrict"}});t.push(u)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:[180,180,180,.5],size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:t})}async showRoads(i){const{type:s,id:t}=i,r=this.subDistrictPointLayer.createQuery(),e=s==="district"?"districtId":"subDistrictId";r.where=`${e} = '${t}'`;const a=await this.subDistrictPointLayer.queryFeatures(r),u=new Map;a.features.forEach(n=>{var y;const{subDistrictId:o,color:c,id:d,districtName:b,subDistrictName:L,signalCount:p}=n.attributes;u.has(o)||u.set(o,{color:c,signalIds:[],districtName:b,subDistrictName:L,signalCount:p}),(y=u.get(o))==null||y.signalIds.push(d)});const h=[],D=[];for(const n of u){let o=0;const c=n[0];h.push({value:c,symbol:{type:"simple-line",color:n[1].color.split(",").map(Number),width:2,style:"solid"}});const{districtName:d,subDistrictName:b,signalIds:L,signalCount:p}=n[1];this.roadConnections.filter(l=>l.subDistrictId===c).forEach(l=>{const I=new f({geometry:{type:"polyline",paths:l.coordinates},attributes:{ObjectID:o++,id:l.id,districtId:l.districtId,subDistrictId:c,subDistrictName:b,districtName:d,signalCount:p,color:n[1].color}});D.push(I)})}this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",color:[180,180,180,.5],width:2,style:"solid"},defaultLabel:"其他子区",uniqueValueInfos:h,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentLineRenderer=this.subDistrictLineLayer.renderer.clone(),await this.subDistrictLineLayer.applyEdits({addFeatures:D})}async clearSubDistricts(){var t;const i=await this.subDistrictPointLayer.queryFeatures();i.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:i.features}),this.subDistrictPointLayer.definitionExpression="1=1";const s=await this.subDistrictLineLayer.queryFeatures();s.features.length>0&&await this.subDistrictLineLayer.applyEdits({deleteFeatures:s.features}),this.subDistrictLineLayer.definitionExpression="1=1",(t=this.clickHandler)==null||t.remove()}setVisible(i){this.subDistrictPointLayer.visible=i,this.subDistrictLineLayer.visible=i}async locateSubDistrict(i){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${i}'`,s.returnGeometry=!0;const t=await this.subDistrictPointLayer.queryFeatures(s);return t.features.length>0?(await m.default.viewGoto(this.view,t.features),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(i){let s="";const t=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${i}'`;const r=await this.subDistrictPointLayer.queryFeatures(),e=r.features.length;return e>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${i}'`,s=r.features[0].attributes.districtId,await m.default.viewGoto(this.view,r.features)):this.subDistrictPointLayer.definitionExpression=t,{count:e,parentId:s}}filter(i){const{type:s,id:t}=i,r=`${s==="district"?"districtId":"subDistrictId"} = '${t}'`;this.subDistrictPointLayer.definitionExpression=r,this.subDistrictLineLayer.definitionExpression=r}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(i){var r;const t=(r=(await this.view.hitTest(i,{include:[this.subDistrictPointLayer,this.subDistrictLineLayer]})).results)==null?void 0:r.filter(e=>e.type==="graphic");if(t.length===0)console.time("resetRenderer"),this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const e=t[0].graphic,a=e.attributes.color.split(",").map(Number);this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:e.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[...a,.8],size:"8px",outline:{color:a,width:4}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",style:"solid",color:[180,180,180,.5],width:"8px"},defaultLabel:"其他子区",uniqueValueInfos:[{value:e.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:e.attributes.color.split(",").map(Number),width:"8px"}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}}}}exports.default=g;
@@ -275,6 +275,12 @@ export interface IShowSignalControlAreaParams {
275
275
  areaList: any[];
276
276
  style?: string;
277
277
  }
278
+ export interface IDistrictRoad {
279
+ id: string;
280
+ coordinates: number[][];
281
+ districtId: string;
282
+ subDistrictId: string;
283
+ }
278
284
  export interface IFindSignalControlAreaParams {
279
285
  type: string;
280
286
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.236",
3
+ "version": "1.0.237",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [