gisviewer-vue3-arcgis 1.0.184 → 1.0.186

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.
@@ -1,6 +1,6 @@
1
1
  import MapView from '@arcgis/core/views/MapView';
2
2
  import SceneView from '@arcgis/core/views/SceneView';
3
- import { IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
3
+ import { IEditSignalControlAreaParams, IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowOpenDriveFromFileParams, IShowSignalControlAreaParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
4
4
  import HoloFlow from './utils/holo-flow';
5
5
  import MapInitializer from './utils/map-initializer';
6
6
  import OpenDriveRenderer from './utils/open-drive-renderer';
@@ -115,10 +115,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
115
115
  status: number;
116
116
  message: string;
117
117
  }>;
118
- showSignalControlArea: (params: {
119
- areaList: any[];
120
- style?: string;
121
- }) => import("../types").IResult;
118
+ showSignalControlArea: (params: IShowSignalControlAreaParams) => import("../types").IResult;
122
119
  clearSignalControlArea: () => void;
123
120
  locateSignalControlArea: (params: {
124
121
  id: string;
@@ -128,12 +125,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
128
125
  }) => Promise<import("../types").IResult>;
129
126
  resetHighlightSignalControlArea: () => import("../types").IResult;
130
127
  showSubSignalControlArea: (params: any) => import("../types").IResult;
131
- editSubSignalControlArea: (addCrossCallback: (params: {
132
- id: string;
133
- name: string;
134
- }) => void, removeCrossCallback: (params: {
135
- id: string;
136
- }) => void) => Promise<import("../types").IResult> | {
128
+ editSubSignalControlArea: (params: IEditSignalControlAreaParams) => Promise<import("../types").IResult> | {
137
129
  status: number;
138
130
  message: string;
139
131
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as Be, ref as k, reactive as Ne, onMounted as ze, getCurrentInstance as Qe, onUnmounted as je, computed as Ee, openBlock as C, createElementBlock as A, createElementVNode as g, withDirectives as Ze, vShow as $e, Fragment as qe, renderList as Ke, createBlock as Ue } from "vue";
1
+ import { defineComponent as Be, ref as k, reactive as Ne, onMounted as ze, getCurrentInstance as Qe, onUnmounted as je, computed as Ee, openBlock as h, createElementBlock as A, createElementVNode as g, withDirectives as Ze, vShow as $e, Fragment as qe, renderList as Ke, createBlock as Ue } from "vue";
2
2
  import b, { registerStore as Ge } from "./stores/index.mjs";
3
3
  import "./style/index.css";
4
4
  import Je from "./utils/holo-flow/index.mjs";
@@ -19,7 +19,7 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
19
19
  emits: ["mapLoaded", "markerClick", "mapClick"],
20
20
  setup(M, { expose: _, emit: x }) {
21
21
  const d = k(null);
22
- let o, u, c, s, n, r, p, t, a;
22
+ let o, l, c, s, n, r, p, t, a;
23
23
  const f = k(!1);
24
24
  Ge();
25
25
  const H = b.useAppDataStore, v = Ne([]);
@@ -29,15 +29,15 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
29
29
  document.addEventListener("keydown", (m) => {
30
30
  m.ctrlKey && m.key === "i" && (f.value = !f.value);
31
31
  });
32
- const e = Qe(), { $gisviewerAssetsRoot: l } = e.appContext.config.globalProperties, i = await (await fetch(O.config)).json();
33
- i.assetsRoot = O.assetsRoot || l, H.mapConfig = i, u = new We(), o = await u.initialize({
32
+ const e = Qe(), { $gisviewerAssetsRoot: u } = e.appContext.config.globalProperties, i = await (await fetch(O.config)).json();
33
+ i.assetsRoot = O.assetsRoot || u, H.mapConfig = i, l = new We(), o = await l.initialize({
34
34
  container: d.value,
35
35
  mapConfig: i,
36
- markerClickCallback: (m, w, h, Ve) => {
37
- y("markerClick", m, w, h, Ve);
36
+ markerClickCallback: (m, w, C, Ve) => {
37
+ y("markerClick", m, w, C, Ve);
38
38
  },
39
- mapClickCallback: (m, w, h) => {
40
- y("mapClick", m, w, h);
39
+ mapClickCallback: (m, w, C) => {
40
+ y("mapClick", m, w, C);
41
41
  }
42
42
  }), n = new Je(o, v), await n.init(), y("mapLoaded");
43
43
  }), je(() => {
@@ -52,15 +52,15 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
52
52
  S("vehicleId");
53
53
  }, z = () => {
54
54
  S("plateNumber");
55
- }, Q = async (e) => await u.setMapCenter(e), j = async (e) => await u.setMapCamera(e), E = async (e) => await u.lookAt(e), Z = (e) => u.setLayerVisibility(e), $ = (e, l) => u.requestCoordinateTransform(e, l), q = (e) => {
56
- u.cancelCoordinateTransform(e);
55
+ }, Q = async (e) => await l.setMapCenter(e), j = async (e) => await l.setMapCamera(e), E = async (e) => await l.lookAt(e), Z = (e) => l.setLayerVisibility(e), $ = (e, u) => l.requestCoordinateTransform(e, u), q = (e) => {
56
+ l.cancelCoordinateTransform(e);
57
57
  }, K = (e) => {
58
- u.setMapZoomRange(e);
58
+ l.setMapZoomRange(e);
59
59
  }, U = (e) => (c || (c = new T(o)), c.showLaneNumber(e)), G = () => {
60
60
  c == null || c.clearLaneNumber();
61
61
  }, J = async (e) => (c || (c = new T(o)), await c.initializeSearch(e)), R = async () => c == null ? void 0 : c.calCrossIndicatorArea(), W = async () => {
62
- }, X = async (e, l) => {
63
- s || (s = new Ye(o)), s.connectTrafficFlow(e, l);
62
+ }, X = async (e, u) => {
63
+ s || (s = new Ye(o)), s.connectTrafficFlow(e, u);
64
64
  }, Y = () => {
65
65
  s == null || s.disconnectTrafficFlow();
66
66
  }, F = async (e) => {
@@ -89,10 +89,10 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
89
89
  p || (p = new Xe(o)), p.updateQueueLength(e);
90
90
  }, fe = () => {
91
91
  p == null || p.removeQueueLength();
92
- }, Se = async (e, l) => (t || (t = new D(o)), await t.showOpenDriveFromServer(e, l)), ye = async (e) => (t || (t = new D(o)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), we = async () => await (t == null ? void 0 : t.clearOpenDrive()), he = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
92
+ }, Se = async (e, u) => (t || (t = new D(o)), await t.showOpenDriveFromServer(e, u)), ye = async (e) => (t || (t = new D(o)), await t.clearOpenDrive(), await t.showOpenDriveFromFile(e)), we = async () => await (t == null ? void 0 : t.clearOpenDrive()), Ce = async (e) => t ? await (t == null ? void 0 : t.findSumo(e)) : {
93
93
  status: -1,
94
94
  message: "未加载OpenDrive地图"
95
- }, Ce = async (e) => t ? t.selectSumo(e) : {
95
+ }, he = async (e) => t ? t.selectSumo(e) : {
96
96
  status: -1,
97
97
  message: "未加载OpenDrive地图"
98
98
  }, ve = async (e) => t ? t.unselectSumo(e) : {
@@ -112,10 +112,7 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
112
112
  message: "未加载OpenDrive地图"
113
113
  }, De = (e) => (a || (a = new I(o)), a.showSignalControlArea(e)), Le = () => {
114
114
  a == null || a.clearSignalControlArea();
115
- }, Te = async (e) => a ? await a.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ie = async (e) => a ? await a.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = () => a ? a.resetHighlight() : { status: -1, message: "未加载信号控制区" }, _e = (e) => (a || (a = new I(o)), a.showSubSignalControlArea(e)), xe = (e, l) => a ? a.editSubSignalArea(
116
- e,
117
- l
118
- ) : { status: -1, message: "未加载信号控制区" }, He = (e) => a ? a.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Pe = (e) => a ? a.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, O = M, y = x;
115
+ }, Te = async (e) => a ? await a.locateSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Ie = async (e) => a ? await a.highlightSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, Me = () => a ? a.resetHighlight() : { status: -1, message: "未加载信号控制区" }, _e = (e) => (a || (a = new I(o)), a.showSubSignalControlArea(e)), xe = (e) => a ? a.editSubSignalControlArea(e) : { status: -1, message: "未加载信号控制区" }, He = (e) => a ? a.selectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, Pe = (e) => a ? a.unselectSubSignalControlAreaCross(e) : { status: -1, message: "未加载信号控制区" }, O = M, y = x;
119
116
  return _({
120
117
  mapViewer: P,
121
118
  setLayerVisibility: Z,
@@ -154,8 +151,8 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
154
151
  showOpenDriveFromFile: ye,
155
152
  clearOpenDrive: we,
156
153
  geometrySearchInOpenDrive: Oe,
157
- findSumoInOpenDrive: he,
158
- selectSumoInOpenDrive: Ce,
154
+ findSumoInOpenDrive: Ce,
155
+ selectSumoInOpenDrive: he,
159
156
  unselectSumoInOpenDrive: ve,
160
157
  getSumoInfo: ke,
161
158
  splitOpenDriveLane: Ae,
@@ -169,7 +166,7 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
169
166
  editSubSignalControlArea: xe,
170
167
  selectSubSignalControlAreaCross: He,
171
168
  unselectSubSignalControlAreaCross: Pe
172
- }), (e, l) => (C(), A("div", Fe, [
169
+ }), (e, u) => (h(), A("div", Fe, [
173
170
  g("div", {
174
171
  class: "gis-viewer-main",
175
172
  ref_key: "mapContainer",
@@ -193,7 +190,7 @@ const Fe = { class: "gis-viewer" }, et = { style: { position: "absolute", bottom
193
190
  [$e, f.value]
194
191
  ])
195
192
  ], 512),
196
- (C(!0), A(qe, null, Ke(v, (i, m) => (C(), Ue(Re, {
193
+ (h(!0), A(qe, null, Ke(v, (i, m) => (h(), Ue(Re, {
197
194
  key: m,
198
195
  "display-mode": i.displayMode,
199
196
  "road-id": i.crossId,
@@ -104,10 +104,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
104
104
  status: number;
105
105
  message: string;
106
106
  }>;
107
- showSignalControlArea: (params: {
108
- areaList: any[];
109
- style?: string | undefined;
110
- }) => import("../types").IResult;
107
+ showSignalControlArea: (params: import("../types").IShowSignalControlAreaParams) => import("../types").IResult;
111
108
  clearSignalControlArea: () => void;
112
109
  locateSignalControlArea: (params: {
113
110
  id: string;
@@ -117,12 +114,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
117
114
  }) => Promise<import("../types").IResult>;
118
115
  resetHighlightSignalControlArea: () => import("../types").IResult;
119
116
  showSubSignalControlArea: (params: any) => import("../types").IResult;
120
- editSubSignalControlArea: (addCrossCallback: (params: {
121
- id: string;
122
- name: string;
123
- }) => void, removeCrossCallback: (params: {
124
- id: string;
125
- }) => void) => Promise<import("../types").IResult> | {
117
+ editSubSignalControlArea: (params: import("../types").IEditSignalControlAreaParams) => Promise<import("../types").IResult> | {
126
118
  status: number;
127
119
  message: string;
128
120
  };
@@ -1,6 +1,6 @@
1
- import * as d from "@arcgis/core/core/reactiveUtils";
1
+ import * as w from "@arcgis/core/core/reactiveUtils";
2
2
  import { Point as f } from "@arcgis/core/geometry";
3
- import * as w from "@arcgis/core/geometry/support/webMercatorUtils.js";
3
+ import * as d from "@arcgis/core/geometry/support/webMercatorUtils.js";
4
4
  import P from "@arcgis/core/layers/GraphicsLayer";
5
5
  import m from "./signal-holo-flow.mjs";
6
6
  class M extends m {
@@ -36,7 +36,7 @@ class M extends m {
36
36
  return n < 1e3 ? s = 1 : n < 2e3 ? s = 0.8 : n < 4e3 ? s = 0.4 : s = 0, s;
37
37
  }
38
38
  async handleSignalData(n) {
39
- this.watchHandle || (this.watchHandle = d.watch(
39
+ this.watchHandle || (this.watchHandle = w.watch(
40
40
  () => this.view.extent,
41
41
  () => {
42
42
  const t = this.getPanelScale();
@@ -47,7 +47,7 @@ class M extends m {
47
47
  x: e[0],
48
48
  y: e[1]
49
49
  });
50
- this.view.spatialReference.isWebMercator && (a = w.geographicToWebMercator(
50
+ this.view.spatialReference.isWebMercator && (a = d.geographicToWebMercator(
51
51
  a
52
52
  ));
53
53
  const i = this.view.toScreen(a);
@@ -94,11 +94,11 @@ class M extends m {
94
94
  x: e.panelPoint[0],
95
95
  y: e.panelPoint[1]
96
96
  });
97
- this.view.spatialReference.isWebMercator && (i = w.geographicToWebMercator(
97
+ this.view.spatialReference.isWebMercator && (i = d.geographicToWebMercator(
98
98
  i
99
99
  ));
100
100
  const r = this.view.toScreen(i), h = this.getPanelRotation(e.coord);
101
- console.log(o, h), this.countdownPanelProps.push({
101
+ this.countdownPanelProps.push({
102
102
  displayMode: "complex",
103
103
  crossId: s,
104
104
  roadId: o,
@@ -132,7 +132,7 @@ class M extends m {
132
132
  x: s[0],
133
133
  y: s[1]
134
134
  });
135
- this.view.spatialReference.isWebMercator && (c = w.geographicToWebMercator(
135
+ this.view.spatialReference.isWebMercator && (c = d.geographicToWebMercator(
136
136
  c
137
137
  ));
138
138
  const p = this.view.toScreen(c), l = n[n.length - 1];
@@ -140,7 +140,7 @@ class M extends m {
140
140
  x: l[0],
141
141
  y: l[1]
142
142
  });
143
- this.view.spatialReference.isWebMercator && (t = w.geographicToWebMercator(
143
+ this.view.spatialReference.isWebMercator && (t = d.geographicToWebMercator(
144
144
  t
145
145
  ));
146
146
  const o = this.view.toScreen(t), e = o.x - p.x, a = o.y - p.y;
@@ -3,10 +3,15 @@ export default class TraceRendererLayer implements ITraceRendererInterface {
3
3
  private view;
4
4
  private readonly vehicleLayer;
5
5
  private mapConfig;
6
+ private hasGpu;
6
7
  private rafSignal;
7
8
  private appDataStore;
8
9
  private logTable;
9
10
  constructor(view: __esri.MapView);
11
+ private getRendererText;
12
+ private em;
13
+ private el;
14
+ private getGpuText;
10
15
  getLog(): (string | number)[][];
11
16
  init(): Promise<void>;
12
17
  private needInterpolate;
@@ -45,6 +50,7 @@ export default class TraceRendererLayer implements ITraceRendererInterface {
45
50
  * @returns
46
51
  */
47
52
  private createCIMSymbol;
53
+ private createMarkerSymbol;
48
54
  /**
49
55
  * 根据车身颜色属性返回对应的车辆图标
50
56
  * @param carColor
@@ -1,10 +1,10 @@
1
- import c from "@arcgis/core/Graphic";
2
- import p from "@arcgis/core/layers/GraphicsLayer";
1
+ import p from "@arcgis/core/Graphic";
2
+ import g from "@arcgis/core/layers/GraphicsLayer";
3
3
  import { toRaw as m } from "vue";
4
- import g from "../../stores/index.mjs";
5
- class P {
4
+ import u from "../../stores/index.mjs";
5
+ class v {
6
6
  constructor(i) {
7
- this.appDataStore = g.useAppDataStore, this.logTable = [
7
+ this.hasGpu = !1, this.appDataStore = u.useAppDataStore, this.logTable = [
8
8
  [
9
9
  "uuid",
10
10
  "ptcId",
@@ -30,9 +30,53 @@ class P {
30
30
  "step",
31
31
  "receiveTimestamp"
32
32
  ]
33
- ], this.needInterpolate = !0, this.isPaused = !1, this.showVehiclePlate = !1, this.showGroundVehicle = !0, this.showElevatedVehicle = !0, this.historyPositionMap = /* @__PURE__ */ new Map(), this.vehicleObjectMap = /* @__PURE__ */ new Map(), this.view = i, this.mapConfig = m(this.appDataStore.mapConfig), this.vehicleLayer = new p({
33
+ ], this.needInterpolate = !0, this.isPaused = !1, this.showVehiclePlate = !1, this.showGroundVehicle = !0, this.showElevatedVehicle = !0, this.historyPositionMap = /* @__PURE__ */ new Map(), this.vehicleObjectMap = /* @__PURE__ */ new Map(), this.view = i, this.mapConfig = m(this.appDataStore.mapConfig), this.vehicleLayer = new g({
34
34
  id: "vehicleLayer"
35
- }), this.view.map.add(this.vehicleLayer), this.rafSignal = requestAnimationFrame(() => this.render());
35
+ }), this.view.map.add(this.vehicleLayer);
36
+ const t = this.getRendererText(), e = this.getGpuText(t);
37
+ this.hasGpu = e !== "Unknown", this.hasGpu && (this.rafSignal = requestAnimationFrame(() => this.render())), console.log("rendererText: ", t), console.log("gpuText: ", e);
38
+ }
39
+ getRendererText() {
40
+ try {
41
+ const i = document.createElement("canvas"), t = i.getContext("webgl") || i.getContext("experimental-webgl");
42
+ if (!t)
43
+ return "Unknown";
44
+ const e = t.getExtension("WEBGL_debug_renderer_info");
45
+ return e && t.getParameter(e.UNMASKED_RENDERER_WEBGL) || "Unknown";
46
+ } catch {
47
+ return "Unknown";
48
+ }
49
+ }
50
+ em(i) {
51
+ const t = [], e = i.split("");
52
+ for (let s = 0; s < e.length; s++)
53
+ if (e[s] === "(")
54
+ t.push(s);
55
+ else if (e[s] === ")") {
56
+ const r = t.pop();
57
+ r !== void 0 && (e.splice(r, s - r + 1), s = r - 1);
58
+ }
59
+ return e.join("");
60
+ }
61
+ el(i) {
62
+ return this.em(i).replace(/\/PCIe\/SSE2/g, "").replace(/\s+/g, " ").trim();
63
+ }
64
+ getGpuText(i) {
65
+ try {
66
+ if (/, or similar$/.test(i) || /SwiftShader/.test(i))
67
+ return "Unknown";
68
+ if (/^ANGLE/.test(i)) {
69
+ const t = i.match(/\((.+)\)$/);
70
+ if (t) {
71
+ const e = t[1], s = e.split(/,\s*/g);
72
+ let r = s[1];
73
+ return /^ANGLE Metal Renderer: /.test(r) && (r = i.split(": ")[1].split(",")[0]), s.length === 1 && (r = s[0].split(" ").slice(1).join(" ")), /Direct3D/.test(r) && (r = r.split("Direct3D")[0].trim()), r;
74
+ }
75
+ }
76
+ } catch {
77
+ return "Unknown";
78
+ }
79
+ return this.el(i);
36
80
  }
37
81
  getLog() {
38
82
  return this.logTable;
@@ -46,28 +90,26 @@ class P {
46
90
  return;
47
91
  }
48
92
  const e = i.map((s) => {
49
- const { vehicleId: o, heading: a, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y);
50
- this.historyPositionMap.set(o, [
51
- { pos: [l, n, 0], heading: a, time: h }
52
- ]);
53
- const r = new c({
93
+ const { vehicleId: r, heading: o, localTimestamp: h } = s, n = Number(s.x), l = Number(s.y), a = new p({
54
94
  geometry: {
55
95
  type: "point",
56
- x: l,
57
- y: n
96
+ x: n,
97
+ y: l
58
98
  },
59
99
  attributes: {
60
100
  ...s,
61
101
  type: "trackVehicle"
62
102
  },
63
- symbol: this.createCIMSymbol(s)
103
+ symbol: this.hasGpu ? this.createCIMSymbol(s) : this.createMarkerSymbol()
64
104
  });
65
- return r.visible = !1, this.vehicleObjectMap.set(o, {
66
- graphic: r,
105
+ return this.hasGpu && (a.visible = !1, this.historyPositionMap.set(r, [
106
+ { pos: [n, l, 0], heading: o, time: h }
107
+ ]), this.vehicleObjectMap.set(r, {
108
+ graphic: a,
67
109
  data: s,
68
110
  waitForDelete: !1,
69
111
  isMoving: !1
70
- }), r;
112
+ })), a;
71
113
  });
72
114
  this.vehicleLayer.addMany(e), t();
73
115
  });
@@ -80,25 +122,42 @@ class P {
80
122
  }
81
123
  const e = [];
82
124
  i.forEach((s) => {
83
- const { vehicleId: o, heading: a, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y), r = this.vehicleObjectMap.get(o);
84
- r ? (r.data = s, r.graphic.attributes = {
85
- ...s,
86
- type: "trackVehicle"
87
- }, this.historyPositionMap.get(
88
- o
89
- ).push({
90
- pos: [l, n, 0],
91
- heading: a,
92
- time: h
93
- })) : e.push(s);
125
+ const { vehicleId: r, heading: o, localTimestamp: h } = s, n = Number(s.x), l = Number(s.y);
126
+ if (this.hasGpu) {
127
+ const a = this.vehicleObjectMap.get(r);
128
+ a ? (a.data = s, a.graphic.attributes = {
129
+ ...s,
130
+ type: "trackVehicle"
131
+ }, this.historyPositionMap.get(
132
+ r
133
+ ).push({
134
+ pos: [n, l, 0],
135
+ heading: o,
136
+ time: h
137
+ })) : e.push(s);
138
+ } else {
139
+ const a = this.vehicleLayer.graphics.find(
140
+ (c) => c.getAttribute("vehicleId") == s.vehicleId
141
+ );
142
+ a ? a.geometry = {
143
+ type: "point",
144
+ x: n,
145
+ y: l
146
+ } : e.push(s);
147
+ }
94
148
  }), this.addVehicles(e), t();
95
149
  });
96
150
  }
97
151
  deleteVehicles(i) {
98
- this.isPaused || i.forEach((t) => {
152
+ this.isPaused || (this.hasGpu ? i.forEach((t) => {
99
153
  const e = this.vehicleObjectMap.get(t);
100
154
  e && (e.waitForDelete = !0);
101
- });
155
+ }) : i.forEach((t) => {
156
+ const e = this.vehicleLayer.graphics.find(
157
+ (s) => s.getAttribute("vehicleId") == t
158
+ );
159
+ e && this.vehicleLayer.remove(e);
160
+ }));
102
161
  }
103
162
  clearVehicles() {
104
163
  this.vehicleLayer.removeAll(), this.vehicleObjectMap.clear(), this.historyPositionMap.clear();
@@ -121,7 +180,7 @@ class P {
121
180
  i.name === "vehiclePlate" && (this.showVehiclePlate = i.visible);
122
181
  }
123
182
  togglePause(i) {
124
- this.isPaused = i, this.isPaused ? cancelAnimationFrame(this.rafSignal) : this.rafSignal = requestAnimationFrame(() => this.render());
183
+ this.isPaused = i, this.isPaused && this.rafSignal ? cancelAnimationFrame(this.rafSignal) : this.rafSignal = requestAnimationFrame(() => this.render());
125
184
  }
126
185
  updatePanelContent(i) {
127
186
  console.log(i);
@@ -139,11 +198,11 @@ class P {
139
198
  if (!t || !e || !e.isMoving && t.length <= 2)
140
199
  return;
141
200
  e.isMoving = !0, (e.graphic.getAttribute("roadLayer") || "1") === "1" ? e.graphic.visible = this.showGroundVehicle : e.graphic.visible = this.showElevatedVehicle, e.segmentStartTime || (e.segmentStartTime = Date.now(), e.segmentTotalTime = t[1].time - t[0].time);
142
- const o = Date.now() - e.segmentStartTime, a = Math.min(
201
+ const r = Date.now() - e.segmentStartTime, o = Math.min(
143
202
  1,
144
- o / e.segmentTotalTime
203
+ r / e.segmentTotalTime
145
204
  );
146
- if (a === 1)
205
+ if (o === 1)
147
206
  if (t.shift(), t.length === 1) {
148
207
  e.waitForDelete ? (this.vehicleLayer.remove(e.graphic), this.vehicleObjectMap.delete(i), this.historyPositionMap.delete(i)) : (e.segmentStartTime = void 0, e.segmentTotalTime = void 0, e.graphic.visible = !1, e.isMoving = !1);
149
208
  return;
@@ -154,12 +213,12 @@ class P {
154
213
  y: t[0].pos[1]
155
214
  };
156
215
  else {
157
- const h = t[0].pos[0] + (t[1].pos[0] - t[0].pos[0]) * a, l = t[0].pos[1] + (t[1].pos[1] - t[0].pos[1]) * a, n = t[0].heading + (t[1].heading - t[0].heading) * a;
216
+ const h = t[0].pos[0] + (t[1].pos[0] - t[0].pos[0]) * o, n = t[0].pos[1] + (t[1].pos[1] - t[0].pos[1]) * o, l = t[0].heading + (t[1].heading - t[0].heading) * o;
158
217
  e.graphic.geometry = {
159
218
  type: "point",
160
219
  x: h,
161
- y: l
162
- }, e.data.heading = n, e.graphic.symbol = this.createCIMSymbol(e.data);
220
+ y: n
221
+ }, e.data.heading = l, e.graphic.symbol = this.hasGpu ? this.createCIMSymbol(e.data) : this.createMarkerSymbol();
163
222
  }
164
223
  }
165
224
  /**
@@ -258,6 +317,17 @@ class P {
258
317
  }
259
318
  };
260
319
  }
320
+ createMarkerSymbol() {
321
+ return {
322
+ type: "simple-marker",
323
+ color: "green",
324
+ size: 5,
325
+ outline: {
326
+ color: "white",
327
+ width: 1
328
+ }
329
+ };
330
+ }
261
331
  /**
262
332
  * 根据车身颜色属性返回对应的车辆图标
263
333
  * @param carColor
@@ -351,5 +421,5 @@ class P {
351
421
  }
352
422
  }
353
423
  export {
354
- P as default
424
+ v as default
355
425
  };
@@ -1,4 +1,4 @@
1
- import { IResult } from '../../../types';
1
+ import { IEditSignalControlAreaParams, IResult, IShowSignalControlAreaParams } from '../../../types';
2
2
  export default class SignalControlAreaController {
3
3
  private view;
4
4
  private districtControllerLayer;
@@ -15,10 +15,7 @@ export default class SignalControlAreaController {
15
15
  * @param params
16
16
  * @returns
17
17
  */
18
- showSignalControlArea(params: {
19
- areaList: any[];
20
- style?: string;
21
- }): IResult;
18
+ showSignalControlArea(params: IShowSignalControlAreaParams): IResult;
22
19
  clearSignalControlArea(): IResult;
23
20
  locateSignalControlArea(params: {
24
21
  id: string;
@@ -34,6 +31,7 @@ export default class SignalControlAreaController {
34
31
  * @returns
35
32
  */
36
33
  private handleViewClick;
34
+ private crossIdsInDistrict;
37
35
  /**
38
36
  * 显示周边的路口
39
37
  * @param crossIds
@@ -46,12 +44,7 @@ export default class SignalControlAreaController {
46
44
  * 编辑子区的路口
47
45
  * @returns
48
46
  */
49
- editSubSignalArea(addCrossCallback: (params: {
50
- id: string;
51
- name: string;
52
- }) => void, removeCrossCallback: (params: {
53
- id: string;
54
- }) => void): Promise<IResult>;
47
+ editSubSignalControlArea(params: IEditSignalControlAreaParams): Promise<IResult>;
55
48
  /**
56
49
  * 从外部接口选中一个路口
57
50
  * @param id