gisviewer-vue3-arcgis 1.0.164 → 1.0.166
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 +111 -0
- package/es/src/gis-map/gis-map.vue.mjs +135 -124
- package/es/src/gis-map/index.d.ts +111 -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 +6 -6
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +85 -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 +120 -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 +13 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +95 -35
- package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +102 -99
- package/es/src/gis-map/utils/map-initializer.mjs +54 -45
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +7 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +314 -286
- package/es/src/gis-map/utils/traffic-flow.mjs +5 -4
- package/es/src/types/index.d.ts +21 -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 +111 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +111 -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 +85 -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 +13 -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.js +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +7 -0
- 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 +21 -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
|
}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import y from "@arcgis/core/Basemap";
|
|
2
2
|
import g from "@arcgis/core/config";
|
|
3
3
|
import * as M from "@arcgis/core/core/reactiveUtils";
|
|
4
|
-
import { Polygon as P, Polyline as
|
|
4
|
+
import { Polygon as P, Polyline as L, Point as k } from "@arcgis/core/geometry";
|
|
5
5
|
import * as f from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
6
|
-
import
|
|
6
|
+
import W from "@arcgis/core/layers/GeoJSONLayer";
|
|
7
|
+
import z from "@arcgis/core/layers/MapImageLayer";
|
|
7
8
|
import x from "@arcgis/core/layers/TileLayer";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
9
|
+
import S from "@arcgis/core/layers/WebTileLayer";
|
|
10
|
+
import I from "@arcgis/core/Map";
|
|
10
11
|
import O from "@arcgis/core/views/MapView";
|
|
11
12
|
import R from "@arcgis/core/views/SceneView";
|
|
12
13
|
import C from "@turf/destination";
|
|
13
14
|
import * as H from "@turf/helpers";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
function T(
|
|
17
|
-
return
|
|
15
|
+
import G from "../stores/index.mjs";
|
|
16
|
+
import N from "./custom-layer/custom-wmts-layer.mjs";
|
|
17
|
+
function T(h, e) {
|
|
18
|
+
return h && (h.startsWith("http://") || h.startsWith("https://") ? h : e + h);
|
|
18
19
|
}
|
|
19
|
-
class
|
|
20
|
+
class Z {
|
|
20
21
|
constructor() {
|
|
21
22
|
this.mapConfig = {}, this.watchHandleMap = /* @__PURE__ */ new Map(), this.handleIndex = 0, this.zoomWatchHandle = null;
|
|
22
23
|
}
|
|
@@ -26,11 +27,11 @@ class F {
|
|
|
26
27
|
* @returns view
|
|
27
28
|
*/
|
|
28
29
|
async initialize(e) {
|
|
29
|
-
const i =
|
|
30
|
+
const i = G.useAppDataStore, t = JSON.parse(JSON.stringify(i.mapConfig));
|
|
30
31
|
this.mapConfig = t;
|
|
31
|
-
const { container: a, markerClickCallback:
|
|
32
|
+
const { container: a, markerClickCallback: c, mapClickCallback: d } = e;
|
|
32
33
|
g.assetsPath = `${t.assetsRoot}/ArcgisAssets`, g.fontsUrl = `${t.assetsRoot}/fonts`, g.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
|
|
33
|
-
const n = new
|
|
34
|
+
const n = new I();
|
|
34
35
|
if ((t == null ? void 0 : t.mapOptions.mode.toLowerCase()) === "2d" ? this.view = new O({
|
|
35
36
|
map: n,
|
|
36
37
|
container: a,
|
|
@@ -54,7 +55,7 @@ class F {
|
|
|
54
55
|
buttonEnabled: !1,
|
|
55
56
|
breakpoint: !1
|
|
56
57
|
}, this.view.on("click", async (s) => {
|
|
57
|
-
var
|
|
58
|
+
var b, v;
|
|
58
59
|
if (d) {
|
|
59
60
|
let o = s.mapPoint;
|
|
60
61
|
o.spatialReference.isWebMercator && (o = f.webMercatorToGeographic(
|
|
@@ -75,7 +76,7 @@ class F {
|
|
|
75
76
|
tilt: o.tilt,
|
|
76
77
|
position: p.toJSON()
|
|
77
78
|
};
|
|
78
|
-
console.log(w), (
|
|
79
|
+
console.log(w), (b = navigator.clipboard) == null || b.writeText(JSON.stringify(w));
|
|
79
80
|
} else
|
|
80
81
|
console.log(o.toJSON());
|
|
81
82
|
console.log(this.view.zoom, this.view.scale);
|
|
@@ -89,65 +90,73 @@ class F {
|
|
|
89
90
|
scale: this.view.scale
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
|
-
const
|
|
93
|
+
const r = (v = (await this.view.hitTest(s)).results) == null ? void 0 : v.filter(
|
|
93
94
|
(o) => o.type === "graphic"
|
|
94
95
|
);
|
|
95
|
-
|
|
96
|
+
r.length > 0 && r.forEach((o) => {
|
|
96
97
|
var w;
|
|
97
98
|
const p = o.graphic;
|
|
98
|
-
(w = p.attributes) != null && w.type &&
|
|
99
|
+
(w = p.attributes) != null && w.type && c && c(
|
|
99
100
|
p.attributes.type,
|
|
100
101
|
p.attributes.id,
|
|
101
102
|
p.attributes,
|
|
102
103
|
s
|
|
103
104
|
);
|
|
104
105
|
});
|
|
105
|
-
}), t != null && t.baseLayers ? t.baseLayers.forEach((s) => {
|
|
106
|
-
const
|
|
106
|
+
}), t != null && t.baseLayers ? (console.log(t.baseLayers), t.baseLayers.forEach((s) => {
|
|
107
|
+
const l = T(s.url, t.assetsRoot);
|
|
107
108
|
switch (s.type.toLowerCase()) {
|
|
108
109
|
case "webTile".toLowerCase(): {
|
|
109
|
-
const
|
|
110
|
-
urlTemplate:
|
|
110
|
+
const r = new S({
|
|
111
|
+
urlTemplate: l,
|
|
111
112
|
...s.options
|
|
112
113
|
});
|
|
113
|
-
n.add(
|
|
114
|
+
n.add(r);
|
|
114
115
|
break;
|
|
115
116
|
}
|
|
116
117
|
case "tile": {
|
|
117
|
-
const
|
|
118
|
-
url:
|
|
118
|
+
const r = new x({
|
|
119
|
+
url: l,
|
|
119
120
|
...s.options
|
|
120
121
|
});
|
|
121
|
-
n.add(
|
|
122
|
+
n.add(r);
|
|
122
123
|
break;
|
|
123
124
|
}
|
|
124
125
|
case "customWMTS".toLowerCase(): {
|
|
125
|
-
const
|
|
126
|
-
urlTemplate:
|
|
126
|
+
const r = new N({
|
|
127
|
+
urlTemplate: l,
|
|
127
128
|
...s.options
|
|
128
129
|
});
|
|
129
|
-
n.add(
|
|
130
|
+
n.add(r);
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
case "mapImage".toLowerCase(): {
|
|
134
|
+
const r = new z({
|
|
135
|
+
url: l,
|
|
136
|
+
...s.options
|
|
137
|
+
});
|
|
138
|
+
n.add(r), console.log(r);
|
|
130
139
|
break;
|
|
131
140
|
}
|
|
132
141
|
case "arcgis": {
|
|
133
|
-
const
|
|
134
|
-
n.basemap =
|
|
142
|
+
const r = new y(s.options);
|
|
143
|
+
n.basemap = r;
|
|
135
144
|
break;
|
|
136
145
|
}
|
|
137
146
|
}
|
|
138
|
-
}) : n.basemap = new y({
|
|
147
|
+
})) : n.basemap = new y({
|
|
139
148
|
style: {
|
|
140
149
|
id: "arcgis/light-gray",
|
|
141
150
|
language: "zh-CN"
|
|
142
151
|
}
|
|
143
152
|
}), t != null && t.hdLayers) {
|
|
144
153
|
const s = t.hdLayers.map(
|
|
145
|
-
(
|
|
154
|
+
(l) => (
|
|
146
155
|
// 图层文件为GeoJson格式, renderer和symbol使用autocast配置
|
|
147
|
-
new
|
|
148
|
-
url: T(
|
|
149
|
-
...
|
|
150
|
-
title:
|
|
156
|
+
new W({
|
|
157
|
+
url: T(l.url, t.assetsRoot),
|
|
158
|
+
...l.options,
|
|
159
|
+
title: l.options.id
|
|
151
160
|
})
|
|
152
161
|
)
|
|
153
162
|
);
|
|
@@ -192,7 +201,7 @@ class F {
|
|
|
192
201
|
e.target = new k(e.target);
|
|
193
202
|
break;
|
|
194
203
|
case "polyline":
|
|
195
|
-
e.target = new
|
|
204
|
+
e.target = new L(e.target);
|
|
196
205
|
break;
|
|
197
206
|
case "polygon":
|
|
198
207
|
e.target = new P(e.target);
|
|
@@ -223,7 +232,7 @@ class F {
|
|
|
223
232
|
{ duration: (e.duration || 2) * 1e3 }
|
|
224
233
|
);
|
|
225
234
|
else {
|
|
226
|
-
const a = Math.tan(i * Math.PI / 180) * e.height,
|
|
235
|
+
const a = Math.tan(i * Math.PI / 180) * e.height, c = C(
|
|
227
236
|
H.point(e.center),
|
|
228
237
|
a,
|
|
229
238
|
t + 180,
|
|
@@ -234,8 +243,8 @@ class F {
|
|
|
234
243
|
await this.view.goTo(
|
|
235
244
|
{
|
|
236
245
|
position: {
|
|
237
|
-
x:
|
|
238
|
-
y:
|
|
246
|
+
x: c.geometry.coordinates[0],
|
|
247
|
+
y: c.geometry.coordinates[1],
|
|
239
248
|
z: e.height
|
|
240
249
|
},
|
|
241
250
|
heading: t,
|
|
@@ -251,19 +260,19 @@ class F {
|
|
|
251
260
|
const { name: i, duration: t = 0 } = e, { camera: a } = this.mapConfig;
|
|
252
261
|
if (!a)
|
|
253
262
|
return { status: -1, message: "未配置camera" };
|
|
254
|
-
const
|
|
255
|
-
return
|
|
263
|
+
const c = a[i];
|
|
264
|
+
return c ? (await this.view.goTo(c, { duration: t * 1e3 }), { status: 0, message: "成功" }) : { status: -1, message: "未配置camera" };
|
|
256
265
|
}
|
|
257
266
|
/**
|
|
258
267
|
* 经纬度转像素坐标,在地图移动时回调
|
|
259
268
|
* */
|
|
260
269
|
requestCoordinateTransform(e, i) {
|
|
261
270
|
let t = 0;
|
|
262
|
-
const
|
|
271
|
+
const c = 1e3 / 30, d = M.watch(
|
|
263
272
|
() => this.view.center,
|
|
264
273
|
() => {
|
|
265
274
|
const n = this.transformPoints(e), m = Date.now();
|
|
266
|
-
m - t >
|
|
275
|
+
m - t > c && (i(n), t = m);
|
|
267
276
|
}
|
|
268
277
|
);
|
|
269
278
|
return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, d), { handle: this.handleIndex, points: this.transformPoints(e) };
|
|
@@ -298,5 +307,5 @@ class F {
|
|
|
298
307
|
}
|
|
299
308
|
}
|
|
300
309
|
export {
|
|
301
|
-
|
|
310
|
+
Z as default
|
|
302
311
|
};
|
|
@@ -18,6 +18,8 @@ export default class OpenDriveRenderer {
|
|
|
18
18
|
private mouseClickHandler;
|
|
19
19
|
private junctionNames;
|
|
20
20
|
private readonly junctionScale;
|
|
21
|
+
private scaleWatch;
|
|
22
|
+
private xodrBorder;
|
|
21
23
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
22
24
|
private projectName;
|
|
23
25
|
private openDriveServer;
|
|
@@ -111,6 +113,11 @@ export default class OpenDriveRenderer {
|
|
|
111
113
|
geometrySearch(coordinate: number[][]): Promise<IResult>;
|
|
112
114
|
splitLane(params: ISplitOpenDriveLaneParams): Promise<IResult>;
|
|
113
115
|
clearSplitLane(): void;
|
|
116
|
+
/**
|
|
117
|
+
* 更新所有路口的symbol
|
|
118
|
+
* @param symbolStyle
|
|
119
|
+
*/
|
|
120
|
+
private updateAllJunctionSymbol;
|
|
114
121
|
/**
|
|
115
122
|
* 生成路口点符号。在不同比例尺下,使用不同的符号
|
|
116
123
|
* @param attributes
|