gisviewer-vue3-arcgis 1.0.165 → 1.0.167
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.
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/src/gis-map/gis-map.vue.d.ts +120 -0
- package/es/src/gis-map/gis-map.vue.mjs +142 -128
- package/es/src/gis-map/index.d.ts +120 -0
- package/es/src/gis-map/stores/appData.d.ts +2 -0
- package/es/src/gis-map/stores/appData.mjs +4 -2
- package/es/src/gis-map/utils/common-utils.mjs +5 -5
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +93 -0
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +7 -0
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +121 -0
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.mjs +4 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +14 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +123 -33
- package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +102 -99
- package/es/src/gis-map/utils/map-initializer.d.ts +1 -0
- package/es/src/gis-map/utils/map-initializer.mjs +135 -127
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +10 -10
- package/es/src/gis-map/utils/traffic-flow.mjs +5 -4
- package/es/src/types/index.d.ts +22 -0
- package/es/style.css +1 -1
- package/lib/_virtual/_plugin-vue_export-helper.js +1 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +120 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +120 -0
- package/lib/src/gis-map/stores/appData.d.ts +2 -0
- package/lib/src/gis-map/stores/appData.js +1 -1
- package/lib/src/gis-map/utils/common-utils.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +93 -0
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +14 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
- package/lib/src/gis-map/utils/map-initializer.d.ts +1 -0
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
- package/lib/src/gis-map/utils/traffic-flow.js +1 -1
- package/lib/src/types/index.d.ts +22 -0
- package/package.json +1 -1
|
@@ -39,17 +39,17 @@ class f {
|
|
|
39
39
|
async init() {
|
|
40
40
|
}
|
|
41
41
|
addVehicles(i) {
|
|
42
|
-
return new Promise((
|
|
42
|
+
return new Promise((t) => {
|
|
43
43
|
if (this.isPaused) {
|
|
44
|
-
|
|
44
|
+
t();
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
const { vehicleId:
|
|
49
|
-
this.historyPositionMap.set(
|
|
47
|
+
const e = i.map((s) => {
|
|
48
|
+
const { vehicleId: o, heading: a, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y);
|
|
49
|
+
this.historyPositionMap.set(o, [
|
|
50
50
|
{ pos: [l, n, 0], heading: a, time: h }
|
|
51
51
|
]);
|
|
52
|
-
const
|
|
52
|
+
const r = new c({
|
|
53
53
|
geometry: {
|
|
54
54
|
type: "point",
|
|
55
55
|
x: l,
|
|
@@ -61,42 +61,42 @@ class f {
|
|
|
61
61
|
},
|
|
62
62
|
symbol: this.createCIMSymbol(s)
|
|
63
63
|
});
|
|
64
|
-
return
|
|
65
|
-
graphic:
|
|
64
|
+
return r.visible = !1, this.vehicleObjectMap.set(o, {
|
|
65
|
+
graphic: r,
|
|
66
66
|
data: s,
|
|
67
67
|
waitForDelete: !1,
|
|
68
68
|
isMoving: !1
|
|
69
|
-
}),
|
|
69
|
+
}), r;
|
|
70
70
|
});
|
|
71
|
-
this.vehicleLayer.addMany(
|
|
71
|
+
this.vehicleLayer.addMany(e), t();
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
updateVehicles(i) {
|
|
75
|
-
return new Promise((
|
|
75
|
+
return new Promise((t) => {
|
|
76
76
|
if (this.isPaused) {
|
|
77
|
-
|
|
77
|
+
t();
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const e = [];
|
|
81
81
|
i.forEach((s) => {
|
|
82
|
-
const { vehicleId:
|
|
83
|
-
|
|
82
|
+
const { vehicleId: o, heading: a, localTimestamp: h } = s, l = Number(s.x), n = Number(s.y), r = this.vehicleObjectMap.get(o);
|
|
83
|
+
r ? (r.data = s, r.graphic.attributes = {
|
|
84
84
|
...s,
|
|
85
85
|
type: "trackVehicle"
|
|
86
86
|
}, this.historyPositionMap.get(
|
|
87
|
-
|
|
87
|
+
o
|
|
88
88
|
).push({
|
|
89
89
|
pos: [l, n, 0],
|
|
90
90
|
heading: a,
|
|
91
91
|
time: h
|
|
92
|
-
})) :
|
|
93
|
-
}), this.addVehicles(
|
|
92
|
+
})) : e.push(s);
|
|
93
|
+
}), this.addVehicles(e), t();
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
deleteVehicles(i) {
|
|
97
|
-
this.isPaused || i.forEach((
|
|
98
|
-
const
|
|
99
|
-
|
|
97
|
+
this.isPaused || i.forEach((t) => {
|
|
98
|
+
const e = this.vehicleObjectMap.get(t);
|
|
99
|
+
e && (e.waitForDelete = !0);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
clearVehicles() {
|
|
@@ -129,36 +129,36 @@ class f {
|
|
|
129
129
|
this.needInterpolate = i;
|
|
130
130
|
}
|
|
131
131
|
render() {
|
|
132
|
-
this.isPaused || this.vehicleObjectMap.forEach((i,
|
|
133
|
-
this.updatePosition(
|
|
132
|
+
this.isPaused || this.vehicleObjectMap.forEach((i, t) => {
|
|
133
|
+
this.updatePosition(t);
|
|
134
134
|
}), this.rafSignal = requestAnimationFrame(() => this.render());
|
|
135
135
|
}
|
|
136
136
|
updatePosition(i) {
|
|
137
|
-
const
|
|
138
|
-
if (!
|
|
137
|
+
const t = this.historyPositionMap.get(i), e = this.vehicleObjectMap.get(i);
|
|
138
|
+
if (!t || !e || !e.isMoving && t.length <= 2)
|
|
139
139
|
return;
|
|
140
|
-
|
|
141
|
-
const
|
|
140
|
+
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);
|
|
141
|
+
const o = Date.now() - e.segmentStartTime, a = Math.min(
|
|
142
142
|
1,
|
|
143
|
-
|
|
143
|
+
o / e.segmentTotalTime
|
|
144
144
|
);
|
|
145
145
|
if (a === 1)
|
|
146
|
-
if (
|
|
147
|
-
|
|
146
|
+
if (t.shift(), t.length === 1) {
|
|
147
|
+
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);
|
|
148
148
|
return;
|
|
149
149
|
} else
|
|
150
|
-
|
|
150
|
+
e.segmentStartTime = Date.now(), e.segmentTotalTime = t[1].time - t[0].time, (t[1].heading >= 270 && t[0].heading <= 90 || t[1].heading <= 90 && t[0].heading >= 270) && (t[1].heading > t[0].heading ? t[0].heading += 360 : t[1].heading += 360), e.graphic.geometry = {
|
|
151
151
|
type: "point",
|
|
152
|
-
x:
|
|
153
|
-
y:
|
|
152
|
+
x: t[0].pos[0],
|
|
153
|
+
y: t[0].pos[1]
|
|
154
154
|
};
|
|
155
155
|
else {
|
|
156
|
-
const h =
|
|
157
|
-
|
|
156
|
+
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;
|
|
157
|
+
e.graphic.geometry = {
|
|
158
158
|
type: "point",
|
|
159
159
|
x: h,
|
|
160
160
|
y: l
|
|
161
|
-
},
|
|
161
|
+
}, e.data.heading = n, e.graphic.symbol = this.createCIMSymbol(e.data);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
@@ -167,7 +167,7 @@ class f {
|
|
|
167
167
|
* @returns
|
|
168
168
|
*/
|
|
169
169
|
createCIMSymbol(i) {
|
|
170
|
-
const
|
|
170
|
+
const t = this.getPlateFontColor(i.plateColor), e = this.getCarPic(i.vehicleColor, i.speed);
|
|
171
171
|
return {
|
|
172
172
|
type: "cim",
|
|
173
173
|
data: {
|
|
@@ -215,7 +215,7 @@ class f {
|
|
|
215
215
|
{
|
|
216
216
|
type: "CIMSolidFill",
|
|
217
217
|
enable: !0,
|
|
218
|
-
color:
|
|
218
|
+
color: t.backgroundColor
|
|
219
219
|
}
|
|
220
220
|
]
|
|
221
221
|
},
|
|
@@ -225,7 +225,7 @@ class f {
|
|
|
225
225
|
{
|
|
226
226
|
type: "CIMSolidFill",
|
|
227
227
|
enable: !0,
|
|
228
|
-
color:
|
|
228
|
+
color: t.fillColor
|
|
229
229
|
}
|
|
230
230
|
]
|
|
231
231
|
},
|
|
@@ -246,14 +246,11 @@ class f {
|
|
|
246
246
|
y: 0
|
|
247
247
|
},
|
|
248
248
|
anchorPointUnits: "Relative",
|
|
249
|
-
size:
|
|
249
|
+
size: e.size,
|
|
250
250
|
rotation: i.heading,
|
|
251
251
|
rotateClockwise: !0,
|
|
252
252
|
textureFilter: "Picture",
|
|
253
|
-
url: `${this.mapConfig.assetsRoot}Images/${
|
|
254
|
-
i.vehicleColor,
|
|
255
|
-
i.speed
|
|
256
|
-
)}`
|
|
253
|
+
url: `${this.mapConfig.assetsRoot}Images/${e.pic}`
|
|
257
254
|
}
|
|
258
255
|
]
|
|
259
256
|
}
|
|
@@ -265,53 +262,59 @@ class f {
|
|
|
265
262
|
* @param carColor
|
|
266
263
|
* @returns
|
|
267
264
|
*/
|
|
268
|
-
getCarPic(i,
|
|
269
|
-
if (this.view.scale >= 1e3)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
265
|
+
getCarPic(i, t) {
|
|
266
|
+
if (this.view.scale >= 1e3) {
|
|
267
|
+
let e = "point_green.png";
|
|
268
|
+
return t && (t <= 4.2 ? e = "point_red.png" : t <= 8.4 ? e = "point_yellow.png" : e = "point_green.png"), {
|
|
269
|
+
pic: e,
|
|
270
|
+
size: 15
|
|
271
|
+
};
|
|
272
|
+
} else {
|
|
273
|
+
let e = "grey";
|
|
274
|
+
switch (typeof i == "string" && (i = i.toLowerCase()), i) {
|
|
275
|
+
case "a":
|
|
276
|
+
case 1:
|
|
277
|
+
e = "white";
|
|
278
|
+
break;
|
|
279
|
+
case "b":
|
|
280
|
+
case 2:
|
|
281
|
+
e = "grey";
|
|
282
|
+
break;
|
|
283
|
+
case "c":
|
|
284
|
+
case 3:
|
|
285
|
+
e = "yellow";
|
|
286
|
+
break;
|
|
287
|
+
case "d":
|
|
288
|
+
case 4:
|
|
289
|
+
e = "pink";
|
|
290
|
+
break;
|
|
291
|
+
case "e":
|
|
292
|
+
case 5:
|
|
293
|
+
e = "red";
|
|
294
|
+
break;
|
|
295
|
+
case "f":
|
|
296
|
+
case 10:
|
|
297
|
+
e = "purple";
|
|
298
|
+
break;
|
|
299
|
+
case "g":
|
|
300
|
+
case 6:
|
|
301
|
+
e = "green";
|
|
302
|
+
break;
|
|
303
|
+
case "h":
|
|
304
|
+
case 7:
|
|
305
|
+
e = "blue";
|
|
306
|
+
break;
|
|
307
|
+
case "i":
|
|
308
|
+
case 8:
|
|
309
|
+
e = "brown";
|
|
310
|
+
break;
|
|
311
|
+
case "j":
|
|
312
|
+
case 9:
|
|
313
|
+
e = "black";
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
return { pic: "/car/" + e + ".png", size: 30 };
|
|
313
317
|
}
|
|
314
|
-
return "/car/" + t + ".png";
|
|
315
318
|
}
|
|
316
319
|
/**
|
|
317
320
|
* 根据号牌颜色属性获取填充色和背景色
|
|
@@ -319,30 +322,30 @@ class f {
|
|
|
319
322
|
* @returns
|
|
320
323
|
*/
|
|
321
324
|
getPlateFontColor(i) {
|
|
322
|
-
let
|
|
325
|
+
let t = [255, 255, 255, 255], e = [169, 169, 169, 255];
|
|
323
326
|
switch (i) {
|
|
324
327
|
case 0:
|
|
325
|
-
|
|
328
|
+
t = [0, 0, 0, 255], e = [255, 255, 255, 255];
|
|
326
329
|
break;
|
|
327
330
|
case 1:
|
|
328
|
-
|
|
331
|
+
t = [0, 0, 0, 255], e = [244, 164, 96, 255];
|
|
329
332
|
break;
|
|
330
333
|
case 2:
|
|
331
|
-
|
|
334
|
+
t = [255, 255, 255, 255], e = [65, 105, 225, 255];
|
|
332
335
|
break;
|
|
333
336
|
case 3:
|
|
334
|
-
|
|
337
|
+
t = [255, 255, 255, 255], e = [0, 0, 0, 255];
|
|
335
338
|
break;
|
|
336
339
|
case 15:
|
|
337
|
-
|
|
340
|
+
t = [244, 164, 96, 255], e = [0, 250, 154, 255];
|
|
338
341
|
break;
|
|
339
342
|
case 16:
|
|
340
|
-
|
|
343
|
+
t = [0, 0, 0, 255], e = [0, 250, 154, 255];
|
|
341
344
|
break;
|
|
342
345
|
}
|
|
343
346
|
return {
|
|
344
|
-
fillColor:
|
|
345
|
-
backgroundColor:
|
|
347
|
+
fillColor: t,
|
|
348
|
+
backgroundColor: e
|
|
346
349
|
};
|
|
347
350
|
}
|
|
348
351
|
}
|
|
@@ -11,6 +11,7 @@ export default class MapInitializer {
|
|
|
11
11
|
*/
|
|
12
12
|
initialize(params: {
|
|
13
13
|
container: HTMLElement;
|
|
14
|
+
mapConfig: any;
|
|
14
15
|
markerClickCallback?: (type: string, id: string, detail: any, event?: any) => void;
|
|
15
16
|
mapClickCallback?: (mapPoint: number[], screenPoint: number[], event?: any) => void;
|
|
16
17
|
}): Promise<MapView | SceneView>;
|