gisviewer-vue3-arcgis 1.0.157 → 1.0.159

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.
@@ -80,7 +80,7 @@ export default class CommonUtils {
80
80
  static pointsEqual(point1: number[], point2: number[]): boolean;
81
81
  static getExtensionLine(pt1: number[], pt2: number[], distance: number): turf.Position;
82
82
  static isCoordinateValid(coordinate: {
83
- latitude: number;
84
- longitude: number;
83
+ latitude: number | string;
84
+ longitude: number | string;
85
85
  }): boolean;
86
86
  }
@@ -1,11 +1,11 @@
1
- import { Point as d, Polyline as f } from "@arcgis/core/geometry";
1
+ import { Point as O, Polyline as f } from "@arcgis/core/geometry";
2
2
  import * as g from "@arcgis/core/geometry/geometryEngineAsync";
3
- import * as y from "@arcgis/core/geometry/support/webMercatorUtils";
3
+ import * as l from "@arcgis/core/geometry/support/webMercatorUtils";
4
4
  import p from "@turf/bearing";
5
5
  import u from "@turf/destination";
6
- import * as a from "@turf/helpers";
7
- import O from "pako";
8
- import h from "proj4";
6
+ import * as o from "@turf/helpers";
7
+ import L from "pako";
8
+ import y from "proj4";
9
9
  class i {
10
10
  /**
11
11
  * 得到某个点在一定方向、距离之外的另一个点
@@ -15,10 +15,10 @@ class i {
15
15
  * @returns
16
16
  */
17
17
  static destinationWithPoint(t, e, n) {
18
- const r = a.point([t.x, t.y]), s = u(r, n, e, {
18
+ const r = o.point([t.x, t.y]), s = u(r, n, e, {
19
19
  units: "meters"
20
20
  });
21
- return new d({
21
+ return new O({
22
22
  x: s.geometry.coordinates[0],
23
23
  y: s.geometry.coordinates[1]
24
24
  });
@@ -29,7 +29,7 @@ class i {
29
29
  * @returns
30
30
  */
31
31
  static angleOfLine(t) {
32
- const e = t.paths[0], n = a.point(e[0]), r = a.point(e[e.length - 1]);
32
+ const e = t.paths[0], n = o.point(e[0]), r = o.point(e[e.length - 1]);
33
33
  return p(n, r);
34
34
  }
35
35
  /**
@@ -38,9 +38,9 @@ class i {
38
38
  * @param distance
39
39
  */
40
40
  static extendLineInTowDir(t, e) {
41
- const n = t.paths[0], r = a.point(n[0]), s = a.point(n[1]), o = p(s, r), c = u(r, e, o, {
41
+ const n = t.paths[0], r = o.point(n[0]), s = o.point(n[1]), a = p(s, r), c = u(r, e, a, {
42
42
  units: "meters"
43
- }), l = o > 0 ? o - 180 : o + 180, P = u(s, e, l, {
43
+ }), h = a > 0 ? a - 180 : a + 180, P = u(s, e, h, {
44
44
  units: "meters"
45
45
  });
46
46
  return new f({
@@ -82,9 +82,9 @@ class i {
82
82
  e,
83
83
  s
84
84
  ), await i.pointDistance(r) > 2.5) {
85
- const o = new f({ paths: [r] });
85
+ const a = new f({ paths: [r] });
86
86
  return (await i.getOffsetLine(
87
- o,
87
+ a,
88
88
  -s
89
89
  )).paths[0];
90
90
  }
@@ -114,8 +114,8 @@ class i {
114
114
  n !== 0 && (t = await i.getOffsetLine(t, n));
115
115
  const r = await g.intersect(t, e);
116
116
  if (r instanceof f) {
117
- const s = r.paths[0], o = s[0], c = s[s.length - 1];
118
- return [o, c];
117
+ const s = r.paths[0], a = s[0], c = s[s.length - 1];
118
+ return [a, c];
119
119
  }
120
120
  return [];
121
121
  }
@@ -126,12 +126,12 @@ class i {
126
126
  * @returns 平移后的polyline
127
127
  */
128
128
  static async getOffsetLine(t, e) {
129
- const n = y.geographicToWebMercator(t), r = await g.offset(
129
+ const n = l.geographicToWebMercator(t), r = await g.offset(
130
130
  n,
131
131
  e,
132
132
  "meters"
133
133
  );
134
- return y.webMercatorToGeographic(
134
+ return l.webMercatorToGeographic(
135
135
  r,
136
136
  !1
137
137
  );
@@ -145,11 +145,11 @@ class i {
145
145
  try {
146
146
  const e = [], n = t.split("");
147
147
  for (let s = 0; s < n.length; s++) {
148
- const o = n[s];
149
- e.push(o.charCodeAt(0));
148
+ const a = n[s];
149
+ e.push(a.charCodeAt(0));
150
150
  }
151
151
  const r = new Uint8Array(e);
152
- return O.inflate(r, { to: "string" });
152
+ return L.inflate(r, { to: "string" });
153
153
  } catch {
154
154
  console.log(`非压缩内容: ${t}`);
155
155
  }
@@ -183,7 +183,7 @@ class i {
183
183
  static transformLineProjection(t) {
184
184
  try {
185
185
  return t.map(
186
- (e) => h(i.geoReference).inverse([
186
+ (e) => y(i.geoReference).inverse([
187
187
  e[0] - i.xOffset,
188
188
  e[1] - i.yOffset
189
189
  ])
@@ -197,7 +197,7 @@ class i {
197
197
  }
198
198
  static transformPointProjection(t) {
199
199
  try {
200
- return h(i.geoReference).inverse([
200
+ return y(i.geoReference).inverse([
201
201
  t[0] - i.xOffset,
202
202
  t[1] - i.yOffset
203
203
  ]);
@@ -212,11 +212,11 @@ class i {
212
212
  return Math.abs(t[0] - e[0]) < Number.EPSILON && Math.abs(t[1] - e[1]) < Number.EPSILON;
213
213
  }
214
214
  static getExtensionLine(t, e, n) {
215
- const r = a.point(t), s = a.point(e), o = p(r, s);
216
- return u(s, n, o, { units: "meters" }).geometry.coordinates;
215
+ const r = o.point(t), s = o.point(e), a = p(r, s);
216
+ return u(s, n, a, { units: "meters" }).geometry.coordinates;
217
217
  }
218
218
  static isCoordinateValid(t) {
219
- return t.latitude !== void 0 && t.longitude !== void 0 && !isNaN(t.latitude) && !isNaN(t.longitude) && t.latitude !== 0 && t.longitude !== 0;
219
+ return typeof t.latitude == "string" && (t.latitude = Number(t.latitude)), typeof t.longitude == "string" && (t.longitude = Number(t.longitude)), t.latitude !== null && t.longitude !== null && !isNaN(t.latitude) && !isNaN(t.longitude) && t.latitude !== 0 && t.longitude !== 0;
220
220
  }
221
221
  }
222
222
  export {
@@ -1,36 +1,36 @@
1
- import * as m from "@arcgis/core/views/3d/externalRenderers";
2
- import f from "./trace-renderer-external.mjs";
3
- import R from "./trace-renderer-layer.mjs";
4
- class V {
1
+ import * as f from "@arcgis/core/views/3d/externalRenderers";
2
+ import R from "./trace-renderer-external.mjs";
3
+ import T from "./trace-renderer-layer.mjs";
4
+ class L {
5
5
  constructor(e) {
6
- e.type === "3d" ? (this.traceRenderer = new f(e), m.add(
6
+ e.type === "3d" ? (this.traceRenderer = new R(e), f.add(
7
7
  e,
8
8
  this.traceRenderer
9
- )) : this.traceRenderer = new R(e);
9
+ )) : this.traceRenderer = new T(e);
10
10
  }
11
11
  async init() {
12
12
  await this.traceRenderer.init();
13
13
  }
14
14
  downloadLog() {
15
- const e = this.traceRenderer.getLog().map((s) => s.join(",")).join(`
16
- `).replace(/null/g, ""), o = new Blob([e], { type: "text/csv;charset=utf-8;" }), i = URL.createObjectURL(o), r = document.createElement("a");
17
- r.setAttribute("href", i), r.setAttribute("download", "trace-log.csv"), r.style.visibility = "hidden", document.body.appendChild(r), r.click(), document.body.removeChild(r);
15
+ const e = this.traceRenderer.getLog().map((i) => i.join(",")).join(`
16
+ `).replace(/null/g, ""), o = new Blob([e], { type: "text/csv;charset=utf-8;" }), s = URL.createObjectURL(o), r = document.createElement("a");
17
+ r.setAttribute("href", s), r.setAttribute("download", "trace-log.csv"), r.style.visibility = "hidden", document.body.appendChild(r), r.click(), document.body.removeChild(r);
18
18
  }
19
19
  /**
20
20
  * 处理全息流轨迹数据
21
21
  * */
22
22
  async handleVehicleTraceData(e) {
23
- const { newVehList: o, updateVehList: i, deleteVehList: r, jgsj: s } = e, n = e.crossId || "", l = [], a = [];
23
+ const { newVehList: o, updateVehList: s, deleteVehList: r, jgsj: i } = e, n = e.crossId || "", l = [], a = [];
24
24
  if (o && o.length > 0) {
25
25
  for (const c of o) {
26
- c.localTimestamp || (c.localTimestamp = s || Date.now());
26
+ c.localTimestamp || (c.localTimestamp = i || Date.now());
27
27
  const t = this.buildVehicleTrackData(c, n);
28
28
  t && l.push(t);
29
29
  }
30
30
  await this.traceRenderer.addVehicles(l);
31
31
  }
32
- if (i && i.length > 0) {
33
- for (const c of i) {
32
+ if (s && s.length > 0) {
33
+ for (const c of s) {
34
34
  const t = this.buildVehicleTrackData(c, n);
35
35
  t && a.push(t);
36
36
  }
@@ -75,13 +75,13 @@ class V {
75
75
  this.traceRenderer.setInterpolate(e);
76
76
  }
77
77
  buildVehicleTrackData(e, o) {
78
- const i = e.longitude, r = e.latitude, s = e.ptcId, n = Number(e.ptcType), l = e.heading, a = Number(e.vehicleType), c = Number(e.vehicleColor), t = e.plateNo || e.plateno, h = Number(e.plateColor), d = e.timestamp, p = e.localTimestamp, u = e.roadLayer ? String(e.roadLayer) : "1", g = e.step;
78
+ const s = e.longitude, r = e.latitude, i = e.ptcId, n = Number(e.ptcType), l = e.heading, a = Number(e.vehicleType), c = Number(e.vehicleColor), t = e.plateNo || e.plateno, h = Number(e.plateColor), d = e.timestamp, p = e.localTimestamp, u = e.roadLayer ? String(e.roadLayer) : "1", g = e.step, m = e.speed;
79
79
  if (!(n < 0 || n > 8))
80
80
  return {
81
- ptcId: s,
81
+ ptcId: i,
82
82
  crossId: o,
83
- vehicleId: o + "-" + s,
84
- x: i,
83
+ vehicleId: o + "-" + i,
84
+ x: s,
85
85
  y: r,
86
86
  ptcType: n,
87
87
  vehicleType: a,
@@ -93,10 +93,11 @@ class V {
93
93
  timestamp: d,
94
94
  localTimestamp: p,
95
95
  roadLayer: u,
96
- step: g
96
+ step: g,
97
+ speed: m
97
98
  };
98
99
  }
99
100
  }
100
101
  export {
101
- V as default
102
+ L as default
102
103
  };
@@ -45,27 +45,28 @@ class f {
45
45
  return;
46
46
  }
47
47
  const t = i.map((s) => {
48
- const { vehicleId: o, heading: a, localTimestamp: h } = s, r = Number(s.x), l = Number(s.y);
49
- this.historyPositionMap.set(o, [
50
- { pos: [r, l, 0], heading: a, time: h }
48
+ const { vehicleId: r, heading: a, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y);
49
+ this.historyPositionMap.set(r, [
50
+ { pos: [l, n, 0], heading: a, time: h }
51
51
  ]);
52
- const n = new c({
52
+ const o = new c({
53
53
  geometry: {
54
54
  type: "point",
55
- x: r,
56
- y: l
55
+ x: l,
56
+ y: n
57
57
  },
58
58
  attributes: {
59
- ...s
59
+ ...s,
60
+ type: "trackVehicle"
60
61
  },
61
62
  symbol: this.createCIMSymbol(s)
62
63
  });
63
- return n.visible = !1, this.vehicleObjectMap.set(o, {
64
- graphic: n,
64
+ return o.visible = !1, this.vehicleObjectMap.set(r, {
65
+ graphic: o,
65
66
  data: s,
66
67
  waitForDelete: !1,
67
68
  isMoving: !1
68
- }), n;
69
+ }), o;
69
70
  });
70
71
  this.vehicleLayer.addMany(t), e();
71
72
  });
@@ -78,11 +79,14 @@ class f {
78
79
  }
79
80
  const t = [];
80
81
  i.forEach((s) => {
81
- const { vehicleId: o, heading: a, localTimestamp: h } = s, r = Number(s.x), l = Number(s.y), n = this.vehicleObjectMap.get(o);
82
- n ? (n.data = s, this.historyPositionMap.get(
83
- o
82
+ const { vehicleId: r, heading: a, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y), o = this.vehicleObjectMap.get(r);
83
+ o ? (o.data = s, o.graphic.attributes = {
84
+ ...s,
85
+ type: "trackVehicle"
86
+ }, this.historyPositionMap.get(
87
+ r
84
88
  ).push({
85
- pos: [r, l, 0],
89
+ pos: [l, n, 0],
86
90
  heading: a,
87
91
  time: h
88
92
  })) : t.push(s);
@@ -134,9 +138,9 @@ class f {
134
138
  if (!e || !t || !t.isMoving && e.length <= 2)
135
139
  return;
136
140
  t.isMoving = !0, (t.graphic.getAttribute("roadLayer") || "1") === "1" ? t.graphic.visible = this.showGroundVehicle : t.graphic.visible = this.showElevatedVehicle, t.segmentStartTime || (t.segmentStartTime = Date.now(), t.segmentTotalTime = e[1].time - e[0].time);
137
- const o = Date.now() - t.segmentStartTime, a = Math.min(
141
+ const r = Date.now() - t.segmentStartTime, a = Math.min(
138
142
  1,
139
- o / t.segmentTotalTime
143
+ r / t.segmentTotalTime
140
144
  );
141
145
  if (a === 1)
142
146
  if (e.shift(), e.length === 1) {
@@ -149,12 +153,12 @@ class f {
149
153
  y: e[0].pos[1]
150
154
  };
151
155
  else {
152
- const h = e[0].pos[0] + (e[1].pos[0] - e[0].pos[0]) * a, r = e[0].pos[1] + (e[1].pos[1] - e[0].pos[1]) * a, l = e[0].heading + (e[1].heading - e[0].heading) * a;
156
+ const h = e[0].pos[0] + (e[1].pos[0] - e[0].pos[0]) * a, l = e[0].pos[1] + (e[1].pos[1] - e[0].pos[1]) * a, n = e[0].heading + (e[1].heading - e[0].heading) * a;
153
157
  t.graphic.geometry = {
154
158
  type: "point",
155
159
  x: h,
156
- y: r
157
- }, t.data.heading = l, t.graphic.symbol = this.createCIMSymbol(t.data);
160
+ y: l
161
+ }, t.data.heading = n, t.graphic.symbol = this.createCIMSymbol(t.data);
158
162
  }
159
163
  }
160
164
  /**
@@ -246,8 +250,9 @@ class f {
246
250
  rotation: i.heading,
247
251
  rotateClockwise: !0,
248
252
  textureFilter: "Picture",
249
- url: `${this.mapConfig.assetsRoot}Images/car/${this.getCarPic(
250
- i.vehicleColor
253
+ url: `${this.mapConfig.assetsRoot}Images/${this.getCarPic(
254
+ i.vehicleColor,
255
+ i.speed
251
256
  )}`
252
257
  }
253
258
  ]
@@ -260,53 +265,53 @@ class f {
260
265
  * @param carColor
261
266
  * @returns
262
267
  */
263
- getCarPic(i) {
264
- if (this.view.zoom <= 15)
265
- return "point.png";
266
- let e = "grey";
268
+ getCarPic(i, e) {
269
+ if (this.view.scale >= 1e3)
270
+ return e ? e <= 4.2 ? "point_red.png" : e <= 8.4 ? "point_yellow.png" : "point_green.png" : "point_green.png";
271
+ let t = "grey";
267
272
  switch (typeof i == "string" && (i = i.toLowerCase()), i) {
268
273
  case "a":
269
274
  case 1:
270
- e = "white";
275
+ t = "white";
271
276
  break;
272
277
  case "b":
273
278
  case 2:
274
- e = "grey";
279
+ t = "grey";
275
280
  break;
276
281
  case "c":
277
282
  case 3:
278
- e = "yellow";
283
+ t = "yellow";
279
284
  break;
280
285
  case "d":
281
286
  case 4:
282
- e = "pink";
287
+ t = "pink";
283
288
  break;
284
289
  case "e":
285
290
  case 5:
286
- e = "red";
291
+ t = "red";
287
292
  break;
288
293
  case "f":
289
294
  case 10:
290
- e = "purple";
295
+ t = "purple";
291
296
  break;
292
297
  case "g":
293
298
  case 6:
294
- e = "green";
299
+ t = "green";
295
300
  break;
296
301
  case "h":
297
302
  case 7:
298
- e = "blue";
303
+ t = "blue";
299
304
  break;
300
305
  case "i":
301
306
  case 8:
302
- e = "brown";
307
+ t = "brown";
303
308
  break;
304
309
  case "j":
305
310
  case 9:
306
- e = "black";
311
+ t = "black";
307
312
  break;
308
313
  }
309
- return e + ".png";
314
+ return "/car/" + t + ".png";
310
315
  }
311
316
  /**
312
317
  * 根据号牌颜色属性获取填充色和背景色
@@ -1,41 +1,41 @@
1
1
  import h from "../common-utils.mjs";
2
2
  class r {
3
- constructor(t) {
3
+ constructor(s) {
4
4
  this.parentName = "", this.crosses = [], this.subDistricts = [], this.areaColor = [
5
5
  Math.floor(Math.random() * 255),
6
6
  Math.floor(Math.random() * 255),
7
7
  Math.floor(Math.random() * 255)
8
- ], this.crossCount = 0, this.subDistrictCount = 0, this.id = t.id, this.name = t.name, this.parentId = t.parentId;
9
- for (const s of t.children)
10
- if (s.children) {
11
- const o = new r(s);
8
+ ], this.crossCount = 0, this.subDistrictCount = 0, this.id = s.id, this.name = s.name, this.parentId = s.parentId;
9
+ for (const t of s.children)
10
+ if (t.children) {
11
+ const o = new r(t);
12
12
  o.parentName = this.name;
13
- const n = this.areaColor[0], e = this.areaColor[1], a = this.areaColor[2], i = Math.random() * 200 - 100;
13
+ const a = this.areaColor[0], n = this.areaColor[1], e = this.areaColor[2], i = Math.random() * 200 - 100;
14
14
  o.areaColor = [
15
- n + i,
16
- e + i,
17
- a + i
15
+ Math.max(a + i, 100),
16
+ Math.max(n + i, 100),
17
+ Math.max(e + i, 100)
18
18
  ], this.subDistricts.push(o), this.subDistrictCount++, this.crossCount += o.crossCount;
19
- } else {
19
+ } else if (h.isCoordinateValid(t)) {
20
20
  const o = {
21
- id: s.id,
22
- name: s.name,
23
- parentId: s.parentId,
24
- latitude: Number(s.latitude),
25
- longitude: Number(s.longitude),
26
- signalId: s.signalId,
27
- isKey: s.isKey === 1
21
+ id: t.id,
22
+ name: t.name,
23
+ parentId: t.parentId,
24
+ latitude: Number(t.latitude),
25
+ longitude: Number(t.longitude),
26
+ signalId: t.signalId,
27
+ isKey: t.isKey === 1
28
28
  };
29
29
  this.crosses.push(o), this.crossCount++;
30
30
  }
31
31
  }
32
32
  getAllCrossCoordinates() {
33
- const t = [];
34
- for (const s of this.crosses)
35
- h.isCoordinateValid(s) && t.push([s.longitude, s.latitude]);
36
- for (const s of this.subDistricts)
37
- t.push(...s.getAllCrossCoordinates());
38
- return t;
33
+ const s = [];
34
+ for (const t of this.crosses)
35
+ s.push([t.longitude, t.latitude]);
36
+ for (const t of this.subDistricts)
37
+ s.push(...t.getAllCrossCoordinates());
38
+ return s;
39
39
  }
40
40
  }
41
41
  export {
@@ -5,12 +5,10 @@ export default class SignalControlAreaController {
5
5
  private subDistrictControllerLayer;
6
6
  private crossLayer;
7
7
  private highlightLayer;
8
- private districtControllers;
9
8
  private watchHandle?;
10
- private openDriveServerUrl;
11
9
  private readonly crossScale;
12
10
  constructor(view: __esri.MapView | __esri.SceneView);
13
- showSignalControlArea(params: any): Promise<IResult>;
11
+ showSignalControlArea(params: any): IResult;
14
12
  clearSignalControlArea(): IResult;
15
13
  locateSignalControlArea(params: {
16
14
  id: string;
@@ -27,14 +25,12 @@ export default class SignalControlAreaController {
27
25
  */
28
26
  private findAreaGraphic;
29
27
  /**
30
- * 显示区控
28
+ * 绘制区控与子区
31
29
  * @param districtController
30
+ * @param isDistrict 是否是区控
32
31
  * @returns
33
32
  */
34
- private showDistrict;
35
- private showSubDistrictCross;
36
- private loadedSubDistricts;
37
- private showSubDistrictRoad;
33
+ private drawArea;
38
34
  /**
39
35
  * 生成路口点符号。在不同比例尺下,使用不同的符号
40
36
  * @param attributes
@@ -1,32 +1,26 @@
1
1
  import * as u from "@arcgis/core/core/reactiveUtils.js";
2
- import { Polyline as g } from "@arcgis/core/geometry";
3
- import * as y from "@arcgis/core/geometry/geometryEngine.js";
4
- import a from "@arcgis/core/Graphic";
5
- import l from "@arcgis/core/layers/GraphicsLayer";
6
- import f from "@turf/buffer";
7
- import b from "@turf/concave";
8
- import * as n from "@turf/helpers";
9
- import C from "axios";
10
- import S from "../../stores/index.mjs";
11
- import m from "../common-utils.mjs";
12
- import v from "./district-controller.mjs";
13
- class k {
2
+ import y from "@arcgis/core/Graphic";
3
+ import h from "@arcgis/core/layers/GraphicsLayer";
4
+ import p from "@turf/buffer";
5
+ import f from "@turf/convex";
6
+ import * as o from "@turf/helpers";
7
+ import d from "concaveman";
8
+ import b from "./district-controller.mjs";
9
+ class x {
14
10
  constructor(e) {
15
- this.districtControllers = [], this.crossScale = 5e3, this.loadedSubDistricts = [], this.view = e;
16
- const i = S.useAppDataStore.mapConfig;
17
- this.openDriveServerUrl = i.openDriveServer.url, this.districtControllerLayer = new l({
11
+ this.crossScale = 5e3, this.view = e, this.districtControllerLayer = new h({
18
12
  id: "districtControllerLayer",
19
13
  maxScale: 144447,
20
14
  minScale: 1155582
21
- }), this.subDistrictControllerLayer = new l({
15
+ }), this.subDistrictControllerLayer = new h({
22
16
  id: "subDistrictControllerLayer",
23
17
  maxScale: 0,
24
18
  minScale: 144447
25
- }), this.crossLayer = new l({
19
+ }), this.crossLayer = new h({
26
20
  id: "crossLayer",
27
21
  maxScale: 0,
28
22
  minScale: 36112
29
- }), this.highlightLayer = new l({
23
+ }), this.highlightLayer = new h({
30
24
  id: "highlightLayer"
31
25
  }), this.view.map.addMany([
32
26
  this.districtControllerLayer,
@@ -35,80 +29,82 @@ class k {
35
29
  this.highlightLayer
36
30
  ]);
37
31
  }
38
- async showSignalControlArea(e) {
39
- console.time("showSignalControlArea"), this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0;
40
- for (const r of e) {
41
- const i = new v(r);
42
- this.showDistrict(i), this.districtControllers.push(i);
32
+ showSignalControlArea(e) {
33
+ this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0;
34
+ for (const t of e) {
35
+ const r = new b(t);
36
+ this.drawArea(r, !0);
43
37
  }
44
- this.watchHandle = u.watch(
38
+ return this.watchHandle = u.watch(
45
39
  () => this.view.scale,
46
- (r, i) => {
47
- r > this.crossScale && i <= this.crossScale ? (this.crossLayer.graphics.forEach((t) => {
48
- t.symbol = this.getCrossGraphicSymbol(
49
- t.attributes,
40
+ (t, r) => {
41
+ console.log(t, r), t > this.crossScale && r <= this.crossScale ? (this.crossLayer.graphics.forEach((s) => {
42
+ s.symbol = this.getCrossGraphicSymbol(
43
+ s.attributes,
50
44
  "marker"
51
45
  );
52
- }), this.highlightLayer.graphics.forEach((t) => {
53
- t.getAttribute("type") === "cross" && (t.symbol = this.getCrossGraphicSymbol(
54
- t.attributes,
46
+ }), this.highlightLayer.graphics.forEach((s) => {
47
+ s.getAttribute("type") === "cross" && (s.symbol = this.getCrossGraphicSymbol(
48
+ s.attributes,
55
49
  "marker"
56
50
  ));
57
- })) : r <= this.crossScale && i > this.crossScale && (this.crossLayer.graphics.forEach((t) => {
58
- t.symbol = this.getCrossGraphicSymbol(
59
- t.attributes,
51
+ })) : t <= this.crossScale && r > this.crossScale && (this.crossLayer.graphics.forEach((s) => {
52
+ s.symbol = this.getCrossGraphicSymbol(
53
+ s.attributes,
60
54
  "picture"
61
55
  );
62
- }), this.highlightLayer.graphics.forEach((t) => {
63
- t.getAttribute("type") === "cross" && (t.symbol = this.getCrossGraphicSymbol(
64
- t.attributes,
56
+ }), this.highlightLayer.graphics.forEach((s) => {
57
+ s.getAttribute("type") === "cross" && (s.symbol = this.getCrossGraphicSymbol(
58
+ s.attributes,
65
59
  "picture"
66
60
  ));
67
61
  }));
68
62
  }
69
- );
70
- for (const r of this.districtControllers)
71
- for (const i of r.subDistricts)
72
- await this.showSubDistrictRoad(i);
73
- return console.timeEnd("showSignalControlArea"), { status: 0, message: "ok" };
63
+ ), { status: 0, message: "ok" };
74
64
  }
75
65
  clearSignalControlArea() {
76
66
  var e;
77
67
  return this.districtControllerLayer.removeAll(), this.subDistrictControllerLayer.removeAll(), this.crossLayer.removeAll(), this.highlightLayer.removeAll(), (e = this.watchHandle) == null || e.remove(), this.view.closePopup(), { status: 0, message: "ok" };
78
68
  }
79
69
  async locateSignalControlArea(e) {
80
- const r = this.findAreaGraphic(e.id);
81
- return r ? (r[0].attributes.type === "cross" ? await this.view.goTo({
82
- target: r,
70
+ const t = this.findAreaGraphic(e.id);
71
+ return t ? (t.attributes.type === "cross" ? await this.view.goTo({
72
+ target: t.geometry,
83
73
  scale: 1500
84
- }) : await this.view.goTo(r), { status: 0, message: "ok" }) : { status: 1, message: "未找到" };
74
+ }) : await this.view.goTo(t.geometry), { status: 0, message: "ok" }) : { status: 1, message: "未找到" };
85
75
  }
86
76
  showPopup(e) {
87
- const r = e.geometry.type === "point" ? e.geometry : e.geometry.centroid;
77
+ const t = e.geometry.type === "point" ? e.geometry : e.geometry.centroid;
88
78
  this.view.openPopup({
89
79
  features: [e],
90
- location: r
80
+ location: t
91
81
  });
92
82
  }
93
83
  async highlightSignalControlArea(e) {
94
84
  if (!e.id || e.id === "")
95
85
  return { status: 1, message: "请输入id" };
96
86
  this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !1, this.subDistrictControllerLayer.visible = !1, this.crossLayer.visible = !1;
97
- for (const s of this.districtControllers)
98
- for (const o of s.subDistricts)
99
- (o.id === e.id || o.parentId === e.id) && await this.showSubDistrictRoad(o);
100
- const r = this.districtControllerLayer.graphics.filter((s) => s.getAttribute("id") === e.id).toArray().map((s) => s.clone()), i = this.subDistrictControllerLayer.graphics.filter(
101
- (s) => s.getAttribute("districtId") === e.id || s.getAttribute("subDistrictId") === e.id
102
- ).toArray().map((s) => s.clone()), t = this.crossLayer.graphics.filter(
103
- (s) => s.getAttribute("id") === e.id || s.getAttribute("districtId") === e.id || s.getAttribute("subDistrictId") === e.id
104
- ).toArray().map((s) => s.clone());
105
- return r.length > 0 && this.highlightLayer.addMany(r), i.length > 0 && this.highlightLayer.addMany(i), t.length > 0 && this.highlightLayer.addMany(t), this.highlightLayer.graphics.length === 0 ? { status: 1, message: "未找到" } : (r.length > 0 ? await this.view.goTo(r) : i.length > 0 ? await this.view.goTo({
106
- target: i,
107
- scale: this.crossScale - 500
108
- }) : t.length > 1 ? await this.view.goTo(t) : await this.view.goTo({
109
- target: t[0].geometry,
110
- scale: 1500
111
- }), { status: 0, message: "ok" });
87
+ const t = this.districtControllerLayer.graphics.filter((i) => i.getAttribute("id") === e.id).toArray().map((i) => i.clone()), r = this.subDistrictControllerLayer.graphics.filter(
88
+ (i) => i.getAttribute("id") === e.id || i.getAttribute("parentId") === e.id
89
+ ).toArray().map((i) => i.clone()), s = this.crossLayer.graphics.filter(
90
+ (i) => i.getAttribute("id") === e.id || i.getAttribute("districtId") === e.id || i.getAttribute("subDistrictId") === e.id
91
+ ).toArray().map((i) => i.clone());
92
+ if (t.length > 0 && this.highlightLayer.addMany(t), r.length > 0 && this.highlightLayer.addMany(r), s.length > 0 && this.highlightLayer.addMany(s), this.highlightLayer.graphics.length === 0)
93
+ return { status: 1, message: "未找到" };
94
+ if (t.length > 0)
95
+ await this.view.goTo(t);
96
+ else if (r.length > 0) {
97
+ const i = r[0].geometry.centroid;
98
+ await this.view.goTo({
99
+ target: i,
100
+ scale: this.crossScale - 500
101
+ });
102
+ } else
103
+ s.length > 1 ? await this.view.goTo(s) : await this.view.goTo({
104
+ target: s[0].geometry,
105
+ scale: 1500
106
+ });
107
+ return { status: 0, message: "ok" };
112
108
  }
113
109
  resetHighlight() {
114
110
  return this.highlightLayer.removeAll(), this.view.closePopup(), this.districtControllerLayer.visible = !0, this.subDistrictControllerLayer.visible = !0, this.crossLayer.visible = !0, { status: 0, message: "ok" };
@@ -119,35 +115,47 @@ class k {
119
115
  * @returns
120
116
  */
121
117
  findAreaGraphic(e) {
122
- let r = this.districtControllerLayer.graphics.filter(
123
- (i) => i.attributes.id === e
118
+ let t = this.districtControllerLayer.graphics.find(
119
+ (r) => r.attributes.id === e
124
120
  );
125
- if (r || (r = this.subDistrictControllerLayer.graphics.filter(
126
- (i) => i.attributes.getAttribute("subDistrictId") === e
127
- )), r || (r = this.crossLayer.graphics.filter((i) => i.attributes.id === e)), r.length !== 0)
128
- return r.toArray();
121
+ return t || (t = this.subDistrictControllerLayer.graphics.find(
122
+ (r) => r.attributes.id === e
123
+ )), t || (t = this.crossLayer.graphics.find((r) => r.attributes.id === e)), t;
129
124
  }
130
125
  /**
131
- * 显示区控
126
+ * 绘制区控与子区
132
127
  * @param districtController
128
+ * @param isDistrict 是否是区控
133
129
  * @returns
134
130
  */
135
- showDistrict(e) {
131
+ drawArea(e, t) {
136
132
  const r = e.getAllCrossCoordinates();
137
133
  if (r.length >= 2) {
138
- let t = null;
134
+ let i = null;
139
135
  if (r.length === 2)
140
- t = n.lineString(r);
141
- else if (r.length > 2) {
142
- const p = n.featureCollection(
143
- r.map((d) => n.point(d))
144
- );
145
- t = b(p);
136
+ i = o.lineString(r);
137
+ else {
138
+ if (t) {
139
+ const n = o.featureCollection(
140
+ r.map((g) => o.point(g))
141
+ );
142
+ i = f(n);
143
+ } else {
144
+ const n = d(r, 0.5);
145
+ n.length >= 4 && (i = o.polygon([n]));
146
+ }
147
+ i || (i = o.lineString(r));
146
148
  }
147
- t || (t = n.lineString(r));
148
- const s = f(t.geometry, 200, {
149
- units: "meters"
150
- }), o = [
149
+ const l = p(
150
+ i.geometry,
151
+ // 区控面积更大,需要更大的缓冲半径
152
+ t ? 200 : 30,
153
+ {
154
+ units: "meters"
155
+ }
156
+ );
157
+ let a;
158
+ t ? a = [
151
159
  {
152
160
  fieldName: "id",
153
161
  label: "区控编号"
@@ -160,7 +168,17 @@ class k {
160
168
  fieldName: "subDistrictCount",
161
169
  label: "子区数量"
162
170
  }
163
- ], c = {
171
+ ] : a = [
172
+ {
173
+ fieldName: "parentName",
174
+ label: "所属区控"
175
+ },
176
+ {
177
+ fieldName: "crossCount",
178
+ label: "路口数量"
179
+ }
180
+ ];
181
+ const m = {
164
182
  type: "signalControlArea",
165
183
  id: e.id,
166
184
  name: e.name,
@@ -168,112 +186,58 @@ class k {
168
186
  parentName: e.parentName,
169
187
  crossCount: e.crossCount,
170
188
  subDistrictCount: e.subDistrictCount
171
- }, h = new a({
189
+ }, c = new y({
172
190
  geometry: {
173
191
  type: "polygon",
174
- rings: s.geometry.coordinates
192
+ rings: l.geometry.coordinates
175
193
  },
176
194
  symbol: {
177
195
  type: "simple-fill",
178
- color: [...e.areaColor, 0.1],
196
+ color: [...e.areaColor, 0.2],
179
197
  outline: {
180
198
  color: e.areaColor,
181
- width: 2
199
+ width: 3,
200
+ style: t ? "solid" : "long-dash"
182
201
  }
183
202
  },
184
- attributes: c,
203
+ attributes: m,
185
204
  popupTemplate: {
186
- title: `区控 ${e.name}`,
205
+ title: `${t ? "区控" : "子区"} ${e.name}`,
187
206
  content: [
188
207
  {
189
208
  type: "fields",
190
- fieldInfos: o
209
+ fieldInfos: a
191
210
  }
192
211
  ]
193
212
  }
194
213
  });
195
- this.districtControllerLayer.add(h);
214
+ t ? this.districtControllerLayer.add(c) : this.subDistrictControllerLayer.add(c);
196
215
  }
197
- for (let t = 0; t < e.subDistricts.length; t++) {
198
- const s = e.subDistricts[t];
199
- this.showSubDistrictCross(s);
200
- }
201
- const i = [];
202
- e.crosses = e.crosses.filter(
203
- (t) => m.isCoordinateValid(t)
204
- ), e.crosses.forEach((t) => {
205
- if (m.isCoordinateValid(t)) {
206
- const s = {
207
- type: "cross",
208
- id: t.id,
209
- name: t.name,
210
- color: e.areaColor,
211
- signalId: t.signalId,
212
- districtId: e.id,
213
- districtName: e.name,
214
- isKey: t.isKey
215
- }, o = new a({
216
- geometry: {
217
- type: "point",
218
- x: t.longitude,
219
- y: t.latitude
220
- },
221
- symbol: this.getCrossGraphicSymbol(s, "marker"),
222
- attributes: s,
223
- popupTemplate: {
224
- title: t.name,
225
- content: [
226
- {
227
- type: "fields",
228
- fieldInfos: [
229
- {
230
- fieldName: "districtName",
231
- label: "区控名称"
232
- },
233
- {
234
- fieldName: "id",
235
- label: "路口编号"
236
- },
237
- {
238
- fieldName: "signalId",
239
- label: "信号机编号"
240
- }
241
- ]
242
- }
243
- ]
244
- }
245
- });
246
- i.push(o);
247
- } else
248
- console.log("路口坐标无效", t);
249
- }), this.crossLayer.addMany(i);
250
- }
251
- showSubDistrictCross(e) {
252
- const r = [];
253
- e.crosses = e.crosses.filter(
254
- (i) => m.isCoordinateValid(i)
255
- ), e.crosses.forEach((i) => {
256
- const t = {
216
+ for (const i of e.subDistricts)
217
+ this.drawArea(i, !1);
218
+ const s = [];
219
+ e.crosses.forEach((i) => {
220
+ const l = {
257
221
  type: "cross",
258
222
  id: i.id,
259
223
  name: i.name,
260
224
  color: e.areaColor,
261
225
  signalId: i.signalId,
262
- districtId: e.parentId,
263
- districtName: e.parentName,
264
- subDistrictId: e.id,
265
- subDistrictName: e.name,
226
+ districtId: t ? e.id : e.parentId,
227
+ districtName: t ? e.name : e.parentName,
228
+ subDistrictId: t ? "" : e.id,
229
+ subDistrictName: t ? "" : e.name,
266
230
  isKey: i.isKey
267
- }, s = new a({
231
+ }, a = new y({
268
232
  geometry: {
269
233
  type: "point",
270
234
  x: i.longitude,
271
235
  y: i.latitude
272
236
  },
273
- symbol: this.getCrossGraphicSymbol(t, "marker"),
274
- attributes: t,
237
+ symbol: this.getCrossGraphicSymbol(l, "marker"),
238
+ attributes: l,
275
239
  popupTemplate: {
276
- title: `${i.name}`,
240
+ title: i.name,
277
241
  content: [
278
242
  {
279
243
  type: "fields",
@@ -299,74 +263,8 @@ class k {
299
263
  ]
300
264
  }
301
265
  });
302
- r.push(s);
303
- }), this.crossLayer.addMany(r);
304
- }
305
- async showSubDistrictRoad(e) {
306
- if (e.crosses.length > 1 && !this.loadedSubDistricts.includes(e.id) && this.openDriveServerUrl && this.openDriveServerUrl !== "") {
307
- this.loadedSubDistricts.push(e.id);
308
- const r = await C.get(
309
- `http://${this.openDriveServerUrl}/api/computable/getRoadsectWithinJunctions`,
310
- {
311
- params: {
312
- junctionIds: e.crosses.map((i) => i.id).join(",")
313
- }
314
- }
315
- );
316
- if (r.status === 200) {
317
- const i = r.data.result;
318
- if (i.length > 0) {
319
- const t = i.map((h) => new g({ paths: [h] })), s = y.geodesicBuffer(
320
- t,
321
- 5,
322
- "meters"
323
- ), o = y.union(
324
- s
325
- ), c = new a({
326
- geometry: o,
327
- symbol: {
328
- type: "simple-fill",
329
- color: [...e.areaColor, 0.8],
330
- outline: {
331
- color: e.areaColor,
332
- width: 1
333
- }
334
- },
335
- attributes: {
336
- type: "subDistrict",
337
- districtId: e.parentId,
338
- districtName: e.parentName,
339
- subDistrictId: e.id,
340
- subDistrictName: e.name,
341
- crossCount: e.crosses.length
342
- },
343
- popupTemplate: {
344
- title: `子区 ${e.name}`,
345
- content: [
346
- {
347
- type: "fields",
348
- fieldInfos: [
349
- {
350
- fieldName: "districtName",
351
- label: "区控名称"
352
- },
353
- {
354
- fieldName: "subDistrictName",
355
- label: "子区名称"
356
- },
357
- {
358
- fieldName: "crossCount",
359
- label: "路口数量"
360
- }
361
- ]
362
- }
363
- ]
364
- }
365
- });
366
- this.subDistrictControllerLayer.add(c);
367
- }
368
- }
369
- }
266
+ s.push(a);
267
+ }), this.crossLayer.addMany(s);
370
268
  }
371
269
  /**
372
270
  * 生成路口点符号。在不同比例尺下,使用不同的符号
@@ -374,10 +272,10 @@ class k {
374
272
  * @param symbolType
375
273
  * @returns
376
274
  */
377
- getCrossGraphicSymbol(e, r) {
378
- const { isKey: i, color: t } = e;
379
- if (r === "marker")
380
- return i ? {
275
+ getCrossGraphicSymbol(e, t) {
276
+ const { isKey: r, color: s } = e;
277
+ if (t === "marker")
278
+ return r ? {
381
279
  type: "picture-marker",
382
280
  url: "/GisViewerAssets/Images/icon_star.png",
383
281
  width: "30px",
@@ -385,14 +283,14 @@ class k {
385
283
  } : {
386
284
  type: "simple-marker",
387
285
  style: "circle",
388
- color: t,
286
+ color: s,
389
287
  size: 8,
390
288
  outline: {
391
289
  color: "white",
392
290
  width: 1
393
291
  }
394
292
  };
395
- if (r === "picture")
293
+ if (t === "picture")
396
294
  return {
397
295
  type: "cim",
398
296
  data: {
@@ -431,7 +329,7 @@ class k {
431
329
  height: 12,
432
330
  horizontalAlignment: "Center",
433
331
  offsetX: 0,
434
- offsetY: i ? 60 : 40,
332
+ offsetY: r ? 50 : 40,
435
333
  haloSize: 1,
436
334
  haloSymbol: {
437
335
  type: "CIMPolygonSymbol",
@@ -470,11 +368,11 @@ class k {
470
368
  y: 0
471
369
  },
472
370
  anchorPointUnits: "Relative",
473
- size: i ? 45 : 30,
371
+ size: r ? 45 : 30,
474
372
  rotateClockwise: !0,
475
373
  textureFilter: "Picture",
476
- url: `/GisViewerAssets/Images/xhj_${i ? 4 : 1}.png`,
477
- offsetY: i ? 22 : 15
374
+ url: `/GisViewerAssets/Images/xhj_${r ? 4 : 1}.png`,
375
+ offsetY: r ? 22 : 15
478
376
  }
479
377
  ]
480
378
  }
@@ -483,5 +381,5 @@ class k {
483
381
  }
484
382
  }
485
383
  export {
486
- k as default
384
+ x as default
487
385
  };
@@ -80,7 +80,7 @@ export default class CommonUtils {
80
80
  static pointsEqual(point1: number[], point2: number[]): boolean;
81
81
  static getExtensionLine(pt1: number[], pt2: number[], distance: number): turf.Position;
82
82
  static isCoordinateValid(coordinate: {
83
- latitude: number;
84
- longitude: number;
83
+ latitude: number | string;
84
+ longitude: number | string;
85
85
  }): boolean;
86
86
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),g=require("@turf/destination"),b=require("@turf/helpers"),S=require("pako"),P=require("proj4");function y(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const l=y(L),d=y(w),c=y(b);class i{static destinationWithPoint(e,t,n){const r=c.point([e.x,e.y]),s=g(r,n,t,{units:"meters"});return new u.Point({x:s.geometry.coordinates[0],y:s.geometry.coordinates[1]})}static angleOfLine(e){const t=e.paths[0],n=c.point(t[0]),r=c.point(t[t.length-1]);return p(n,r)}static extendLineInTowDir(e,t){const n=e.paths[0],r=c.point(n[0]),s=c.point(n[1]),o=p(s,r),f=g(r,t,o,{units:"meters"}),h=o>0?o-180:o+180,O=g(s,t,h,{units:"meters"});return new u.Polyline({paths:[[f.geometry.coordinates,O.geometry.coordinates]]})}static async getIntersectPointOfTwoLines(e,t){const n=await l.intersectLinesToPoints(e,t);if(n.length)return n[0]}static async getIntersectPointsOfStopLineAndLane(e,t,n){let r=await i.getIntersectPointOfLineAndPolygon(e,t);if(await i.pointDistance(r)<3&&n){for(const s of n)if(r=await i.getIntersectPointOfLineAndPolygon(e,t,s),await i.pointDistance(r)>2.5){const o=new u.Polyline({paths:[r]});return(await i.getOffsetLine(o,-s)).paths[0]}}else return r;return[]}static async pointDistance(e){if(e.length<2)return 0;const t=new u.Polyline({paths:[e]});return await l.geodesicLength(t,"meters")}static async getIntersectPointOfLineAndPolygon(e,t,n=0){n!==0&&(e=await i.getOffsetLine(e,n));const r=await l.intersect(e,t);if(r instanceof u.Polyline){const s=r.paths[0],o=s[0],f=s[s.length-1];return[o,f]}return[]}static async getOffsetLine(e,t){const n=d.geographicToWebMercator(e),r=await l.offset(n,t,"meters");return d.webMercatorToGeographic(r,!1)}static unzip(e){try{const t=[],n=e.split("");for(let s=0;s<n.length;s++){const o=n[s];t.push(o.charCodeAt(0))}const r=new Uint8Array(t);return S.inflate(r,{to:"string"})}catch{console.log(`非压缩内容: ${e}`)}}static getStdVecEntries(e,t=!1){const n=new Array(e.size());for(let r=0;r<e.size();r++)n[r]=e.get(r);return t&&e.delete(),n}static getStdMapEntries(e){const t=[];for(const n of i.getStdMapKeys(e))t.push([n,e.get(n)]);return t}static getStdMapKeys(e,t=!1){const n=[],r=e.keys();for(let s=0;s<r.size();s++)n.push(r.get(s));return r.delete(),t&&e.delete(),n}static setGeoData(e,t,n){i.geoReference=e,i.xOffset=t,i.yOffset=n}static transformLineProjection(e){try{return e.map(t=>P(i.geoReference).inverse([t[0]-i.xOffset,t[1]-i.yOffset]))}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static transformPointProjection(e){try{return P(i.geoReference).inverse([e[0]-i.xOffset,e[1]-i.yOffset])}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static pointsEqual(e,t){return Math.abs(e[0]-t[0])<Number.EPSILON&&Math.abs(e[1]-t[1])<Number.EPSILON}static getExtensionLine(e,t,n){const r=c.point(e),s=c.point(t),o=p(r,s);return g(s,n,o,{units:"meters"}).geometry.coordinates}static isCoordinateValid(e){return e.latitude!==void 0&&e.longitude!==void 0&&!isNaN(e.latitude)&&!isNaN(e.longitude)&&e.latitude!==0&&e.longitude!==0}}exports.default=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),g=require("@turf/destination"),b=require("@turf/helpers"),S=require("pako"),P=require("proj4");function y(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>c[t]})}}return e.default=c,Object.freeze(e)}const l=y(L),h=y(w),o=y(b);class i{static destinationWithPoint(e,t,n){const r=o.point([e.x,e.y]),s=g(r,n,t,{units:"meters"});return new u.Point({x:s.geometry.coordinates[0],y:s.geometry.coordinates[1]})}static angleOfLine(e){const t=e.paths[0],n=o.point(t[0]),r=o.point(t[t.length-1]);return p(n,r)}static extendLineInTowDir(e,t){const n=e.paths[0],r=o.point(n[0]),s=o.point(n[1]),a=p(s,r),f=g(r,t,a,{units:"meters"}),d=a>0?a-180:a+180,O=g(s,t,d,{units:"meters"});return new u.Polyline({paths:[[f.geometry.coordinates,O.geometry.coordinates]]})}static async getIntersectPointOfTwoLines(e,t){const n=await l.intersectLinesToPoints(e,t);if(n.length)return n[0]}static async getIntersectPointsOfStopLineAndLane(e,t,n){let r=await i.getIntersectPointOfLineAndPolygon(e,t);if(await i.pointDistance(r)<3&&n){for(const s of n)if(r=await i.getIntersectPointOfLineAndPolygon(e,t,s),await i.pointDistance(r)>2.5){const a=new u.Polyline({paths:[r]});return(await i.getOffsetLine(a,-s)).paths[0]}}else return r;return[]}static async pointDistance(e){if(e.length<2)return 0;const t=new u.Polyline({paths:[e]});return await l.geodesicLength(t,"meters")}static async getIntersectPointOfLineAndPolygon(e,t,n=0){n!==0&&(e=await i.getOffsetLine(e,n));const r=await l.intersect(e,t);if(r instanceof u.Polyline){const s=r.paths[0],a=s[0],f=s[s.length-1];return[a,f]}return[]}static async getOffsetLine(e,t){const n=h.geographicToWebMercator(e),r=await l.offset(n,t,"meters");return h.webMercatorToGeographic(r,!1)}static unzip(e){try{const t=[],n=e.split("");for(let s=0;s<n.length;s++){const a=n[s];t.push(a.charCodeAt(0))}const r=new Uint8Array(t);return S.inflate(r,{to:"string"})}catch{console.log(`非压缩内容: ${e}`)}}static getStdVecEntries(e,t=!1){const n=new Array(e.size());for(let r=0;r<e.size();r++)n[r]=e.get(r);return t&&e.delete(),n}static getStdMapEntries(e){const t=[];for(const n of i.getStdMapKeys(e))t.push([n,e.get(n)]);return t}static getStdMapKeys(e,t=!1){const n=[],r=e.keys();for(let s=0;s<r.size();s++)n.push(r.get(s));return r.delete(),t&&e.delete(),n}static setGeoData(e,t,n){i.geoReference=e,i.xOffset=t,i.yOffset=n}static transformLineProjection(e){try{return e.map(t=>P(i.geoReference).inverse([t[0]-i.xOffset,t[1]-i.yOffset]))}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static transformPointProjection(e){try{return P(i.geoReference).inverse([e[0]-i.xOffset,e[1]-i.yOffset])}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static pointsEqual(e,t){return Math.abs(e[0]-t[0])<Number.EPSILON&&Math.abs(e[1]-t[1])<Number.EPSILON}static getExtensionLine(e,t,n){const r=o.point(e),s=o.point(t),a=p(r,s);return g(s,n,a,{units:"meters"}).geometry.coordinates}static isCoordinateValid(e){return typeof e.latitude=="string"&&(e.latitude=Number(e.latitude)),typeof e.longitude=="string"&&(e.longitude=Number(e.longitude)),e.latitude!==null&&e.longitude!==null&&!isNaN(e.latitude)&&!isNaN(e.longitude)&&e.latitude!==0&&e.longitude!==0}}exports.default=i;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@arcgis/core/views/3d/externalRenderers"),b=require("./trace-renderer-external.js"),y=require("./trace-renderer-layer.js");function R(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const r in i)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>i[r]})}}return e.default=i,Object.freeze(e)}const T=R(m);class v{constructor(e){e.type==="3d"?(this.traceRenderer=new b.default(e),T.add(e,this.traceRenderer)):this.traceRenderer=new y.default(e)}async init(){await this.traceRenderer.init()}downloadLog(){const e=this.traceRenderer.getLog().map(s=>s.join(",")).join(`
2
- `).replace(/null/g,""),r=new Blob([e],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(r),c=document.createElement("a");c.setAttribute("href",n),c.setAttribute("download","trace-log.csv"),c.style.visibility="hidden",document.body.appendChild(c),c.click(),document.body.removeChild(c)}async handleVehicleTraceData(e){const{newVehList:r,updateVehList:n,deleteVehList:c,jgsj:s}=e,l=e.crossId||"",a=[],d=[];if(r&&r.length>0){for(const o of r){o.localTimestamp||(o.localTimestamp=s||Date.now());const t=this.buildVehicleTrackData(o,l);t&&a.push(t)}await this.traceRenderer.addVehicles(a)}if(n&&n.length>0){for(const o of n){const t=this.buildVehicleTrackData(o,l);t&&d.push(t)}await this.traceRenderer.updateVehicles(d)}if(c&&c.length>0){const o=c.map(t=>l+"-"+(t.ptcId||t.vehno||t.vehNo));this.traceRenderer.deleteVehicles(o)}}toggleTrafficInfo(e){this.traceRenderer.toggleTrafficInfo(e)}clearTrace(){this.traceRenderer.clearVehicles()}togglePause(e){this.traceRenderer.togglePause(e)}updatePanelContent(e){this.traceRenderer.updatePanelContent(e)}toggleGroundVehicle(e){this.traceRenderer.toggleGroundVehicle(e)}toggleElevatedVehicle(e){this.traceRenderer.toggleElevatedVehicle(e)}setInterpolate(e){this.traceRenderer.setInterpolate(e)}buildVehicleTrackData(e,r){const n=e.longitude,c=e.latitude,s=e.ptcId,l=Number(e.ptcType),a=e.heading,d=Number(e.vehicleType),o=Number(e.vehicleColor),t=e.plateNo||e.plateno,h=Number(e.plateColor),u=e.timestamp,p=e.localTimestamp,g=e.roadLayer?String(e.roadLayer):"1",f=e.step;if(!(l<0||l>8))return{ptcId:s,crossId:r,vehicleId:r+"-"+s,x:n,y:c,ptcType:l,vehicleType:d,heading:l===2?-a:a,vehicleColor:o,showName:t&&t!==""&&t!=="0"&&t!=="000000"?t:"",plateNo:t,plateColor:h,timestamp:u,localTimestamp:p,roadLayer:g,step:f}}}exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@arcgis/core/views/3d/externalRenderers"),y=require("./trace-renderer-external.js"),R=require("./trace-renderer-layer.js");function T(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const r in l)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(l,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>l[r]})}}return e.default=l,Object.freeze(e)}const v=T(b);class V{constructor(e){e.type==="3d"?(this.traceRenderer=new y.default(e),v.add(e,this.traceRenderer)):this.traceRenderer=new R.default(e)}async init(){await this.traceRenderer.init()}downloadLog(){const e=this.traceRenderer.getLog().map(i=>i.join(",")).join(`
2
+ `).replace(/null/g,""),r=new Blob([e],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(r),c=document.createElement("a");c.setAttribute("href",n),c.setAttribute("download","trace-log.csv"),c.style.visibility="hidden",document.body.appendChild(c),c.click(),document.body.removeChild(c)}async handleVehicleTraceData(e){const{newVehList:r,updateVehList:n,deleteVehList:c,jgsj:i}=e,s=e.crossId||"",a=[],d=[];if(r&&r.length>0){for(const o of r){o.localTimestamp||(o.localTimestamp=i||Date.now());const t=this.buildVehicleTrackData(o,s);t&&a.push(t)}await this.traceRenderer.addVehicles(a)}if(n&&n.length>0){for(const o of n){const t=this.buildVehicleTrackData(o,s);t&&d.push(t)}await this.traceRenderer.updateVehicles(d)}if(c&&c.length>0){const o=c.map(t=>s+"-"+(t.ptcId||t.vehno||t.vehNo));this.traceRenderer.deleteVehicles(o)}}toggleTrafficInfo(e){this.traceRenderer.toggleTrafficInfo(e)}clearTrace(){this.traceRenderer.clearVehicles()}togglePause(e){this.traceRenderer.togglePause(e)}updatePanelContent(e){this.traceRenderer.updatePanelContent(e)}toggleGroundVehicle(e){this.traceRenderer.toggleGroundVehicle(e)}toggleElevatedVehicle(e){this.traceRenderer.toggleElevatedVehicle(e)}setInterpolate(e){this.traceRenderer.setInterpolate(e)}buildVehicleTrackData(e,r){const n=e.longitude,c=e.latitude,i=e.ptcId,s=Number(e.ptcType),a=e.heading,d=Number(e.vehicleType),o=Number(e.vehicleColor),t=e.plateNo||e.plateno,h=Number(e.plateColor),u=e.timestamp,p=e.localTimestamp,g=e.roadLayer?String(e.roadLayer):"1",f=e.step,m=e.speed;if(!(s<0||s>8))return{ptcId:i,crossId:r,vehicleId:r+"-"+i,x:n,y:c,ptcType:s,vehicleType:d,heading:s===2?-a:a,vehicleColor:o,showName:t&&t!==""&&t!=="0"&&t!=="000000"?t:"",plateNo:t,plateColor:h,timestamp:u,localTimestamp:p,roadLayer:g,step:f,speed:m}}}exports.default=V;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@arcgis/core/Graphic"),p=require("@arcgis/core/layers/GraphicsLayer"),m=require("../../stores/index.js");class g{constructor(i){this.appDataStore=m.default.useAppDataStore,this.logTable=[["uuid","ptcId","plateno","timestamp","localTimestamp","timestamp_str","speed","laneNo","objHeight","objLength","latitude","longitude","ptcType","vehicleType","vehicleColor","plateColor","sbdm","heading","fixAngle","roadLayer","status","step","receiveTimestamp"]],this.needInterpolate=!0,this.isPaused=!1,this.showVehiclePlate=!1,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.historyPositionMap=new Map,this.vehicleObjectMap=new Map,this.view=i,this.mapConfig=JSON.parse(JSON.stringify(this.appDataStore.mapConfig)),this.vehicleLayer=new p({id:"vehicleLayer"}),this.view.map.add(this.vehicleLayer),this.rafSignal=requestAnimationFrame(()=>this.render())}getLog(){return this.logTable}async init(){}addVehicles(i){return new Promise(e=>{if(this.isPaused){e();return}const t=i.map(s=>{const{vehicleId:o,heading:a,localTimestamp:h}=s,r=Number(s.x),l=Number(s.y);this.historyPositionMap.set(o,[{pos:[r,l,0],heading:a,time:h}]);const n=new c({geometry:{type:"point",x:r,y:l},attributes:{...s},symbol:this.createCIMSymbol(s)});return n.visible=!1,this.vehicleObjectMap.set(o,{graphic:n,data:s,waitForDelete:!1,isMoving:!1}),n});this.vehicleLayer.addMany(t),e()})}updateVehicles(i){return new Promise(e=>{if(this.isPaused){e();return}const t=[];i.forEach(s=>{const{vehicleId:o,heading:a,localTimestamp:h}=s,r=Number(s.x),l=Number(s.y),n=this.vehicleObjectMap.get(o);n?(n.data=s,this.historyPositionMap.get(o).push({pos:[r,l,0],heading:a,time:h})):t.push(s)}),this.addVehicles(t),e()})}deleteVehicles(i){this.isPaused||i.forEach(e=>{const t=this.vehicleObjectMap.get(e);t&&(t.waitForDelete=!0)})}clearVehicles(){this.vehicleLayer.removeAll(),this.vehicleObjectMap.clear(),this.historyPositionMap.clear()}toggleGroundVehicle(i){this.showGroundVehicle=i}toggleElevatedVehicle(i){this.showElevatedVehicle=i}toggleTrafficInfo(i){i.name==="vehiclePlate"&&(this.showVehiclePlate=i.visible)}togglePause(i){this.isPaused=i,this.isPaused?cancelAnimationFrame(this.rafSignal):this.rafSignal=requestAnimationFrame(()=>this.render())}updatePanelContent(i){console.log(i)}setInterpolate(i){this.needInterpolate=i}render(){this.isPaused||this.vehicleObjectMap.forEach((i,e)=>{this.updatePosition(e)}),this.rafSignal=requestAnimationFrame(()=>this.render())}updatePosition(i){const e=this.historyPositionMap.get(i),t=this.vehicleObjectMap.get(i);if(!e||!t||!t.isMoving&&e.length<=2)return;t.isMoving=!0,(t.graphic.getAttribute("roadLayer")||"1")==="1"?t.graphic.visible=this.showGroundVehicle:t.graphic.visible=this.showElevatedVehicle,t.segmentStartTime||(t.segmentStartTime=Date.now(),t.segmentTotalTime=e[1].time-e[0].time);const o=Date.now()-t.segmentStartTime,a=Math.min(1,o/t.segmentTotalTime);if(a===1)if(e.shift(),e.length===1){t.waitForDelete?(this.vehicleLayer.remove(t.graphic),this.vehicleObjectMap.delete(i),this.historyPositionMap.delete(i)):(t.segmentStartTime=void 0,t.segmentTotalTime=void 0,t.graphic.visible=!1,t.isMoving=!1);return}else t.segmentStartTime=Date.now(),t.segmentTotalTime=e[1].time-e[0].time,(e[1].heading>=270&&e[0].heading<=90||e[1].heading<=90&&e[0].heading>=270)&&(e[1].heading>e[0].heading?e[0].heading+=360:e[1].heading+=360),t.graphic.geometry={type:"point",x:e[0].pos[0],y:e[0].pos[1]};else{const h=e[0].pos[0]+(e[1].pos[0]-e[0].pos[0])*a,r=e[0].pos[1]+(e[1].pos[1]-e[0].pos[1])*a,l=e[0].heading+(e[1].heading-e[0].heading)*a;t.graphic.geometry={type:"point",x:h,y:r},t.data.heading=l,t.graphic.symbol=this.createCIMSymbol(t.data)}}createCIMSymbol(i){const e=this.getPlateFontColor(i.plateColor);return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.showName",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:this.showVehiclePlate,size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-8,ymin:-8,xmax:8,ymax:8},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:4,horizontalAlignment:"Center",offsetX:0,offsetY:8,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e.backgroundColor}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e.fillColor}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:30,rotation:i.heading,rotateClockwise:!0,textureFilter:"Picture",url:`${this.mapConfig.assetsRoot}Images/car/${this.getCarPic(i.vehicleColor)}`}]}}}}getCarPic(i){if(this.view.zoom<=15)return"point.png";let e="grey";switch(typeof i=="string"&&(i=i.toLowerCase()),i){case"a":case 1:e="white";break;case"b":case 2:e="grey";break;case"c":case 3:e="yellow";break;case"d":case 4:e="pink";break;case"e":case 5:e="red";break;case"f":case 10:e="purple";break;case"g":case 6:e="green";break;case"h":case 7:e="blue";break;case"i":case 8:e="brown";break;case"j":case 9:e="black";break}return e+".png"}getPlateFontColor(i){let e=[255,255,255,255],t=[169,169,169,255];switch(i){case 0:e=[0,0,0,255],t=[255,255,255,255];break;case 1:e=[0,0,0,255],t=[244,164,96,255];break;case 2:e=[255,255,255,255],t=[65,105,225,255];break;case 3:e=[255,255,255,255],t=[0,0,0,255];break;case 15:e=[244,164,96,255],t=[0,250,154,255];break;case 16:e=[0,0,0,255],t=[0,250,154,255];break}return{fillColor:e,backgroundColor:t}}}exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@arcgis/core/Graphic"),p=require("@arcgis/core/layers/GraphicsLayer"),g=require("../../stores/index.js");class m{constructor(i){this.appDataStore=g.default.useAppDataStore,this.logTable=[["uuid","ptcId","plateno","timestamp","localTimestamp","timestamp_str","speed","laneNo","objHeight","objLength","latitude","longitude","ptcType","vehicleType","vehicleColor","plateColor","sbdm","heading","fixAngle","roadLayer","status","step","receiveTimestamp"]],this.needInterpolate=!0,this.isPaused=!1,this.showVehiclePlate=!1,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.historyPositionMap=new Map,this.vehicleObjectMap=new Map,this.view=i,this.mapConfig=JSON.parse(JSON.stringify(this.appDataStore.mapConfig)),this.vehicleLayer=new p({id:"vehicleLayer"}),this.view.map.add(this.vehicleLayer),this.rafSignal=requestAnimationFrame(()=>this.render())}getLog(){return this.logTable}async init(){}addVehicles(i){return new Promise(e=>{if(this.isPaused){e();return}const t=i.map(s=>{const{vehicleId:r,heading:a,localTimestamp:h}=s,l=Number(s.x),n=Number(s.y);this.historyPositionMap.set(r,[{pos:[l,n,0],heading:a,time:h}]);const o=new c({geometry:{type:"point",x:l,y:n},attributes:{...s,type:"trackVehicle"},symbol:this.createCIMSymbol(s)});return o.visible=!1,this.vehicleObjectMap.set(r,{graphic:o,data:s,waitForDelete:!1,isMoving:!1}),o});this.vehicleLayer.addMany(t),e()})}updateVehicles(i){return new Promise(e=>{if(this.isPaused){e();return}const t=[];i.forEach(s=>{const{vehicleId:r,heading:a,localTimestamp:h}=s,l=Number(s.x),n=Number(s.y),o=this.vehicleObjectMap.get(r);o?(o.data=s,o.graphic.attributes={...s,type:"trackVehicle"},this.historyPositionMap.get(r).push({pos:[l,n,0],heading:a,time:h})):t.push(s)}),this.addVehicles(t),e()})}deleteVehicles(i){this.isPaused||i.forEach(e=>{const t=this.vehicleObjectMap.get(e);t&&(t.waitForDelete=!0)})}clearVehicles(){this.vehicleLayer.removeAll(),this.vehicleObjectMap.clear(),this.historyPositionMap.clear()}toggleGroundVehicle(i){this.showGroundVehicle=i}toggleElevatedVehicle(i){this.showElevatedVehicle=i}toggleTrafficInfo(i){i.name==="vehiclePlate"&&(this.showVehiclePlate=i.visible)}togglePause(i){this.isPaused=i,this.isPaused?cancelAnimationFrame(this.rafSignal):this.rafSignal=requestAnimationFrame(()=>this.render())}updatePanelContent(i){console.log(i)}setInterpolate(i){this.needInterpolate=i}render(){this.isPaused||this.vehicleObjectMap.forEach((i,e)=>{this.updatePosition(e)}),this.rafSignal=requestAnimationFrame(()=>this.render())}updatePosition(i){const e=this.historyPositionMap.get(i),t=this.vehicleObjectMap.get(i);if(!e||!t||!t.isMoving&&e.length<=2)return;t.isMoving=!0,(t.graphic.getAttribute("roadLayer")||"1")==="1"?t.graphic.visible=this.showGroundVehicle:t.graphic.visible=this.showElevatedVehicle,t.segmentStartTime||(t.segmentStartTime=Date.now(),t.segmentTotalTime=e[1].time-e[0].time);const r=Date.now()-t.segmentStartTime,a=Math.min(1,r/t.segmentTotalTime);if(a===1)if(e.shift(),e.length===1){t.waitForDelete?(this.vehicleLayer.remove(t.graphic),this.vehicleObjectMap.delete(i),this.historyPositionMap.delete(i)):(t.segmentStartTime=void 0,t.segmentTotalTime=void 0,t.graphic.visible=!1,t.isMoving=!1);return}else t.segmentStartTime=Date.now(),t.segmentTotalTime=e[1].time-e[0].time,(e[1].heading>=270&&e[0].heading<=90||e[1].heading<=90&&e[0].heading>=270)&&(e[1].heading>e[0].heading?e[0].heading+=360:e[1].heading+=360),t.graphic.geometry={type:"point",x:e[0].pos[0],y:e[0].pos[1]};else{const h=e[0].pos[0]+(e[1].pos[0]-e[0].pos[0])*a,l=e[0].pos[1]+(e[1].pos[1]-e[0].pos[1])*a,n=e[0].heading+(e[1].heading-e[0].heading)*a;t.graphic.geometry={type:"point",x:h,y:l},t.data.heading=n,t.graphic.symbol=this.createCIMSymbol(t.data)}}createCIMSymbol(i){const e=this.getPlateFontColor(i.plateColor);return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.showName",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:this.showVehiclePlate,size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-8,ymin:-8,xmax:8,ymax:8},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:4,horizontalAlignment:"Center",offsetX:0,offsetY:8,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e.backgroundColor}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e.fillColor}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:30,rotation:i.heading,rotateClockwise:!0,textureFilter:"Picture",url:`${this.mapConfig.assetsRoot}Images/${this.getCarPic(i.vehicleColor,i.speed)}`}]}}}}getCarPic(i,e){if(this.view.scale>=1e3)return e?e<=4.2?"point_red.png":e<=8.4?"point_yellow.png":"point_green.png":"point_green.png";let t="grey";switch(typeof i=="string"&&(i=i.toLowerCase()),i){case"a":case 1:t="white";break;case"b":case 2:t="grey";break;case"c":case 3:t="yellow";break;case"d":case 4:t="pink";break;case"e":case 5:t="red";break;case"f":case 10:t="purple";break;case"g":case 6:t="green";break;case"h":case 7:t="blue";break;case"i":case 8:t="brown";break;case"j":case 9:t="black";break}return"/car/"+t+".png"}getPlateFontColor(i){let e=[255,255,255,255],t=[169,169,169,255];switch(i){case 0:e=[0,0,0,255],t=[255,255,255,255];break;case 1:e=[0,0,0,255],t=[244,164,96,255];break;case 2:e=[255,255,255,255],t=[65,105,225,255];break;case 3:e=[255,255,255,255],t=[0,0,0,255];break;case 15:e=[244,164,96,255],t=[0,250,154,255];break;case 16:e=[0,0,0,255],t=[0,250,154,255];break}return{fillColor:e,backgroundColor:t}}}exports.default=m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("../common-utils.js");class r{constructor(s){this.parentName="",this.crosses=[],this.subDistricts=[],this.areaColor=[Math.floor(Math.random()*255),Math.floor(Math.random()*255),Math.floor(Math.random()*255)],this.crossCount=0,this.subDistrictCount=0,this.id=s.id,this.name=s.name,this.parentId=s.parentId;for(const t of s.children)if(t.children){const o=new r(t);o.parentName=this.name;const e=this.areaColor[0],n=this.areaColor[1],a=this.areaColor[2],i=Math.random()*200-100;o.areaColor=[e+i,n+i,a+i],this.subDistricts.push(o),this.subDistrictCount++,this.crossCount+=o.crossCount}else{const o={id:t.id,name:t.name,parentId:t.parentId,latitude:Number(t.latitude),longitude:Number(t.longitude),signalId:t.signalId,isKey:t.isKey===1};this.crosses.push(o),this.crossCount++}}getAllCrossCoordinates(){const s=[];for(const t of this.crosses)u.default.isCoordinateValid(t)&&s.push([t.longitude,t.latitude]);for(const t of this.subDistricts)s.push(...t.getAllCrossCoordinates());return s}}exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("../common-utils.js");class r{constructor(s){this.parentName="",this.crosses=[],this.subDistricts=[],this.areaColor=[Math.floor(Math.random()*255),Math.floor(Math.random()*255),Math.floor(Math.random()*255)],this.crossCount=0,this.subDistrictCount=0,this.id=s.id,this.name=s.name,this.parentId=s.parentId;for(const t of s.children)if(t.children){const o=new r(t);o.parentName=this.name;const e=this.areaColor[0],a=this.areaColor[1],n=this.areaColor[2],i=Math.random()*200-100;o.areaColor=[Math.max(e+i,100),Math.max(a+i,100),Math.max(n+i,100)],this.subDistricts.push(o),this.subDistrictCount++,this.crossCount+=o.crossCount}else if(h.default.isCoordinateValid(t)){const o={id:t.id,name:t.name,parentId:t.parentId,latitude:Number(t.latitude),longitude:Number(t.longitude),signalId:t.signalId,isKey:t.isKey===1};this.crosses.push(o),this.crossCount++}}getAllCrossCoordinates(){const s=[];for(const t of this.crosses)s.push([t.longitude,t.latitude]);for(const t of this.subDistricts)s.push(...t.getAllCrossCoordinates());return s}}exports.default=r;
@@ -5,12 +5,10 @@ export default class SignalControlAreaController {
5
5
  private subDistrictControllerLayer;
6
6
  private crossLayer;
7
7
  private highlightLayer;
8
- private districtControllers;
9
8
  private watchHandle?;
10
- private openDriveServerUrl;
11
9
  private readonly crossScale;
12
10
  constructor(view: __esri.MapView | __esri.SceneView);
13
- showSignalControlArea(params: any): Promise<IResult>;
11
+ showSignalControlArea(params: any): IResult;
14
12
  clearSignalControlArea(): IResult;
15
13
  locateSignalControlArea(params: {
16
14
  id: string;
@@ -27,14 +25,12 @@ export default class SignalControlAreaController {
27
25
  */
28
26
  private findAreaGraphic;
29
27
  /**
30
- * 显示区控
28
+ * 绘制区控与子区
31
29
  * @param districtController
30
+ * @param isDistrict 是否是区控
32
31
  * @returns
33
32
  */
34
- private showDistrict;
35
- private showSubDistrictCross;
36
- private loadedSubDistricts;
37
- private showSubDistrictRoad;
33
+ private drawArea;
38
34
  /**
39
35
  * 生成路口点符号。在不同比例尺下,使用不同的符号
40
36
  * @param attributes
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/core/reactiveUtils.js"),b=require("@arcgis/core/geometry"),C=require("@arcgis/core/geometry/geometryEngine.js"),l=require("@arcgis/core/Graphic"),n=require("@arcgis/core/layers/GraphicsLayer"),v=require("@turf/buffer"),S=require("@turf/concave"),L=require("@turf/helpers"),w=require("axios"),I=require("../../stores/index.js"),d=require("../common-utils.js"),A=require("./district-controller.js");function y(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const i in a)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>a[i]})}}return e.default=a,Object.freeze(e)}const D=y(f),m=y(C),c=y(L);class N{constructor(e){this.districtControllers=[],this.crossScale=5e3,this.loadedSubDistricts=[],this.view=e;const r=I.default.useAppDataStore.mapConfig;this.openDriveServerUrl=r.openDriveServer.url,this.districtControllerLayer=new n({id:"districtControllerLayer",maxScale:144447,minScale:1155582}),this.subDistrictControllerLayer=new n({id:"subDistrictControllerLayer",maxScale:0,minScale:144447}),this.crossLayer=new n({id:"crossLayer",maxScale:0,minScale:36112}),this.highlightLayer=new n({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}async showSignalControlArea(e){console.time("showSignalControlArea"),this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0;for(const i of e){const r=new A.default(i);this.showDistrict(r),this.districtControllers.push(r)}this.watchHandle=D.watch(()=>this.view.scale,(i,r)=>{i>this.crossScale&&r<=this.crossScale?(this.crossLayer.graphics.forEach(t=>{t.symbol=this.getCrossGraphicSymbol(t.attributes,"marker")}),this.highlightLayer.graphics.forEach(t=>{t.getAttribute("type")==="cross"&&(t.symbol=this.getCrossGraphicSymbol(t.attributes,"marker"))})):i<=this.crossScale&&r>this.crossScale&&(this.crossLayer.graphics.forEach(t=>{t.symbol=this.getCrossGraphicSymbol(t.attributes,"picture")}),this.highlightLayer.graphics.forEach(t=>{t.getAttribute("type")==="cross"&&(t.symbol=this.getCrossGraphicSymbol(t.attributes,"picture"))}))});for(const i of this.districtControllers)for(const r of i.subDistricts)await this.showSubDistrictRoad(r);return console.timeEnd("showSignalControlArea"),{status:0,message:"ok"}}clearSignalControlArea(){var e;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.watchHandle)==null||e.remove(),this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const i=this.findAreaGraphic(e.id);return i?(i[0].attributes.type==="cross"?await this.view.goTo({target:i,scale:1500}):await this.view.goTo(i),{status:0,message:"ok"}):{status:1,message:"未找到"}}showPopup(e){const i=e.geometry.type==="point"?e.geometry:e.geometry.centroid;this.view.openPopup({features:[e],location:i})}async highlightSignalControlArea(e){if(!e.id||e.id==="")return{status:1,message:"请输入id"};this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1,this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1;for(const s of this.districtControllers)for(const o of s.subDistricts)(o.id===e.id||o.parentId===e.id)&&await this.showSubDistrictRoad(o);const i=this.districtControllerLayer.graphics.filter(s=>s.getAttribute("id")===e.id).toArray().map(s=>s.clone()),r=this.subDistrictControllerLayer.graphics.filter(s=>s.getAttribute("districtId")===e.id||s.getAttribute("subDistrictId")===e.id).toArray().map(s=>s.clone()),t=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());return i.length>0&&this.highlightLayer.addMany(i),r.length>0&&this.highlightLayer.addMany(r),t.length>0&&this.highlightLayer.addMany(t),this.highlightLayer.graphics.length===0?{status:1,message:"未找到"}:(i.length>0?await this.view.goTo(i):r.length>0?await this.view.goTo({target:r,scale:this.crossScale-500}):t.length>1?await this.view.goTo(t):await this.view.goTo({target:t[0].geometry,scale:1500}),{status:0,message:"ok"})}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0,this.crossLayer.visible=!0,{status:0,message:"ok"}}findAreaGraphic(e){let i=this.districtControllerLayer.graphics.filter(r=>r.attributes.id===e);if(i||(i=this.subDistrictControllerLayer.graphics.filter(r=>r.attributes.getAttribute("subDistrictId")===e)),i||(i=this.crossLayer.graphics.filter(r=>r.attributes.id===e)),i.length!==0)return i.toArray()}showDistrict(e){const i=e.getAllCrossCoordinates();if(i.length>=2){let t=null;if(i.length===2)t=c.lineString(i);else if(i.length>2){const p=c.featureCollection(i.map(g=>c.point(g)));t=S(p)}t||(t=c.lineString(i));const s=v(t.geometry,200,{units:"meters"}),o=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}],h={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},u=new l({geometry:{type:"polygon",rings:s.geometry.coordinates},symbol:{type:"simple-fill",color:[...e.areaColor,.1],outline:{color:e.areaColor,width:2}},attributes:h,popupTemplate:{title:`区控 ${e.name}`,content:[{type:"fields",fieldInfos:o}]}});this.districtControllerLayer.add(u)}for(let t=0;t<e.subDistricts.length;t++){const s=e.subDistricts[t];this.showSubDistrictCross(s)}const r=[];e.crosses=e.crosses.filter(t=>d.default.isCoordinateValid(t)),e.crosses.forEach(t=>{if(d.default.isCoordinateValid(t)){const s={type:"cross",id:t.id,name:t.name,color:e.areaColor,signalId:t.signalId,districtId:e.id,districtName:e.name,isKey:t.isKey},o=new l({geometry:{type:"point",x:t.longitude,y:t.latitude},symbol:this.getCrossGraphicSymbol(s,"marker"),attributes:s,popupTemplate:{title:t.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}});r.push(o)}else console.log("路口坐标无效",t)}),this.crossLayer.addMany(r)}showSubDistrictCross(e){const i=[];e.crosses=e.crosses.filter(r=>d.default.isCoordinateValid(r)),e.crosses.forEach(r=>{const t={type:"cross",id:r.id,name:r.name,color:e.areaColor,signalId:r.signalId,districtId:e.parentId,districtName:e.parentName,subDistrictId:e.id,subDistrictName:e.name,isKey:r.isKey},s=new l({geometry:{type:"point",x:r.longitude,y:r.latitude},symbol:this.getCrossGraphicSymbol(t,"marker"),attributes:t,popupTemplate:{title:`${r.name}`,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}});i.push(s)}),this.crossLayer.addMany(i)}async showSubDistrictRoad(e){if(e.crosses.length>1&&!this.loadedSubDistricts.includes(e.id)&&this.openDriveServerUrl&&this.openDriveServerUrl!==""){this.loadedSubDistricts.push(e.id);const i=await w.get(`http://${this.openDriveServerUrl}/api/computable/getRoadsectWithinJunctions`,{params:{junctionIds:e.crosses.map(r=>r.id).join(",")}});if(i.status===200){const r=i.data.result;if(r.length>0){const t=r.map(u=>new b.Polyline({paths:[u]})),s=m.geodesicBuffer(t,5,"meters"),o=m.union(s),h=new l({geometry:o,symbol:{type:"simple-fill",color:[...e.areaColor,.8],outline:{color:e.areaColor,width:1}},attributes:{type:"subDistrict",districtId:e.parentId,districtName:e.parentName,subDistrictId:e.id,subDistrictName:e.name,crossCount:e.crosses.length},popupTemplate:{title:`子区 ${e.name}`,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"crossCount",label:"路口数量"}]}]}});this.subDistrictControllerLayer.add(h)}}}}getCrossGraphicSymbol(e,i){const{isKey:r,color:t}=e;if(i==="marker")return r?{type:"picture-marker",url:"/GisViewerAssets/Images/icon_star.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:t,size:8,outline:{color:"white",width:1}};if(i==="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?60:40,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?45:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/xhj_${r?4:1}.png`,offsetY:r?22:15}]}}}}}exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/core/reactiveUtils.js"),u=require("@arcgis/core/Graphic"),h=require("@arcgis/core/layers/GraphicsLayer"),f=require("@turf/buffer"),b=require("@turf/convex"),L=require("@turf/helpers"),C=require("concaveman"),v=require("./district-controller.js");function g(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const w=g(d),l=g(L);class A{constructor(e){this.crossScale=5e3,this.view=e,this.districtControllerLayer=new h({id:"districtControllerLayer",maxScale:144447,minScale:1155582}),this.subDistrictControllerLayer=new h({id:"subDistrictControllerLayer",maxScale:0,minScale:144447}),this.crossLayer=new h({id:"crossLayer",maxScale:0,minScale:36112}),this.highlightLayer=new h({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.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0;for(const t of e){const r=new v.default(t);this.drawArea(r,!0)}return this.watchHandle=w.watch(()=>this.view.scale,(t,r)=>{console.log(t,r),t>this.crossScale&&r<=this.crossScale?(this.crossLayer.graphics.forEach(s=>{s.symbol=this.getCrossGraphicSymbol(s.attributes,"marker")}),this.highlightLayer.graphics.forEach(s=>{s.getAttribute("type")==="cross"&&(s.symbol=this.getCrossGraphicSymbol(s.attributes,"marker"))})):t<=this.crossScale&&r>this.crossScale&&(this.crossLayer.graphics.forEach(s=>{s.symbol=this.getCrossGraphicSymbol(s.attributes,"picture")}),this.highlightLayer.graphics.forEach(s=>{s.getAttribute("type")==="cross"&&(s.symbol=this.getCrossGraphicSymbol(s.attributes,"picture"))}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.watchHandle)==null||e.remove(),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:"未找到"}}showPopup(e){const t=e.geometry.type==="point"?e.geometry:e.geometry.centroid;this.view.openPopup({features:[e],location:t})}async highlightSignalControlArea(e){if(!e.id||e.id==="")return{status:1,message:"请输入id"};this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1,this.subDistrictControllerLayer.visible=!1,this.crossLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(i=>i.getAttribute("id")===e.id).toArray().map(i=>i.clone()),r=this.subDistrictControllerLayer.graphics.filter(i=>i.getAttribute("id")===e.id||i.getAttribute("parentId")===e.id).toArray().map(i=>i.clone()),s=this.crossLayer.graphics.filter(i=>i.getAttribute("id")===e.id||i.getAttribute("districtId")===e.id||i.getAttribute("subDistrictId")===e.id).toArray().map(i=>i.clone());if(t.length>0&&this.highlightLayer.addMany(t),r.length>0&&this.highlightLayer.addMany(r),s.length>0&&this.highlightLayer.addMany(s),this.highlightLayer.graphics.length===0)return{status:1,message:"未找到"};if(t.length>0)await this.view.goTo(t);else if(r.length>0){const i=r[0].geometry.centroid;await this.view.goTo({target:i,scale:this.crossScale-500})}else s.length>1?await this.view.goTo(s):await this.view.goTo({target:s[0].geometry,scale:1500});return{status:0,message:"ok"}}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,this.subDistrictControllerLayer.visible=!0,this.crossLayer.visible=!0,{status:0,message:"ok"}}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 i=null;if(r.length===2)i=l.lineString(r);else{if(t){const c=l.featureCollection(r.map(p=>l.point(p)));i=b(c)}else{const c=C(r,.5);c.length>=4&&(i=l.polygon([c]))}i||(i=l.lineString(r))}const n=f(i.geometry,t?200:30,{units:"meters"});let o;t?o=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:o=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const m={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},y=new u({geometry:{type:"polygon",rings:n.geometry.coordinates},symbol:{type:"simple-fill",color:[...e.areaColor,.2],outline:{color:e.areaColor,width:3,style:t?"solid":"long-dash"}},attributes:m,popupTemplate:{title:`${t?"区控":"子区"} ${e.name}`,content:[{type:"fields",fieldInfos:o}]}});t?this.districtControllerLayer.add(y):this.subDistrictControllerLayer.add(y)}for(const i of e.subDistricts)this.drawArea(i,!1);const s=[];e.crosses.forEach(i=>{const n={type:"cross",id:i.id,name:i.name,color:e.areaColor,signalId:i.signalId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name,isKey:i.isKey},o=new u({geometry:{type:"point",x:i.longitude,y:i.latitude},symbol:this.getCrossGraphicSymbol(n,"marker"),attributes:n,popupTemplate:{title:i.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}});s.push(o)}),this.crossLayer.addMany(s)}getCrossGraphicSymbol(e,t){const{isKey:r,color:s}=e;if(t==="marker")return r?{type:"picture-marker",url:"/GisViewerAssets/Images/icon_star.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:s,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?50:40,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?45:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/xhj_${r?4:1}.png`,offsetY:r?22:15}]}}}}}exports.default=A;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.157",
3
+ "version": "1.0.159",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [
@@ -35,6 +35,7 @@
35
35
  "@types/pako": "^2.0.0",
36
36
  "@vitest/coverage-c8": "^0.29.2",
37
37
  "axios": "^1.4.0",
38
+ "concaveman": "^1.2.1",
38
39
  "fast-xml-parser": "^4.4.0",
39
40
  "md5": "^2.3.0",
40
41
  "pako": "^2.1.0",