gisviewer-vue3-arcgis 1.0.247 → 1.0.249
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/src/gis-map/gis-map.vue.d.ts +9 -3
- package/es/src/gis-map/gis-map.vue.mjs +178 -162
- package/es/src/gis-map/index.d.ts +8 -2
- package/es/src/gis-map/utils/edpass-device-controller.d.ts +2 -0
- package/es/src/gis-map/utils/edpass-device-controller.mjs +164 -124
- package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +5 -1
- package/es/src/gis-map/utils/map-initializer.d.ts +1 -0
- package/es/src/gis-map/utils/map-initializer.mjs +98 -81
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +1 -1
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +9 -9
- package/es/src/types/index.d.ts +2 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +9 -3
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +8 -2
- package/lib/src/gis-map/utils/edpass-device-controller.d.ts +2 -0
- package/lib/src/gis-map/utils/edpass-device-controller.js +1 -1
- package/lib/src/gis-map/utils/green-wave-band-controller/index.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.d.ts +1 -1
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
- package/lib/src/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,36 +1,28 @@
|
|
|
1
1
|
import M from "@arcgis/core/Basemap";
|
|
2
2
|
import d from "@arcgis/core/config";
|
|
3
3
|
import * as k from "@arcgis/core/core/reactiveUtils";
|
|
4
|
-
import { Multipoint as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
4
|
+
import { Multipoint as P, Polygon as C, Polyline as W, Point as T } from "@arcgis/core/geometry";
|
|
5
|
+
import * as u from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
6
|
+
import z from "@arcgis/core/layers/FeatureLayer";
|
|
7
|
+
import x from "@arcgis/core/layers/GeoJSONLayer";
|
|
8
|
+
import I from "@arcgis/core/layers/GroupLayer";
|
|
9
|
+
import G from "@arcgis/core/layers/IntegratedMesh3DTilesLayer";
|
|
10
10
|
import S from "@arcgis/core/layers/MapImageLayer";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import * as
|
|
19
|
-
import
|
|
20
|
-
class
|
|
11
|
+
import H from "@arcgis/core/layers/TileLayer";
|
|
12
|
+
import R from "@arcgis/core/layers/WebTileLayer";
|
|
13
|
+
import B from "@arcgis/core/layers/WMSLayer";
|
|
14
|
+
import O from "@arcgis/core/Map";
|
|
15
|
+
import N from "@arcgis/core/views/MapView";
|
|
16
|
+
import U from "@arcgis/core/views/SceneView";
|
|
17
|
+
import E from "@turf/destination";
|
|
18
|
+
import * as A from "@turf/helpers";
|
|
19
|
+
import J from "./custom-layer/custom-wmts-layer.mjs";
|
|
20
|
+
class ae {
|
|
21
21
|
constructor() {
|
|
22
22
|
this.mapConfig = {}, this.watchHandleMap = /* @__PURE__ */ new Map(), this.handleIndex = 0, this.zoomWatchHandle = null;
|
|
23
23
|
}
|
|
24
24
|
processUrl(e) {
|
|
25
|
-
|
|
26
|
-
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
27
|
-
return e;
|
|
28
|
-
if (e.startsWith("{{"))
|
|
29
|
-
return e.replace("{{geoServer}}", this.mapConfig.geoServer);
|
|
30
|
-
if (e.startsWith("/"))
|
|
31
|
-
return this.mapConfig.assetsRoot + e;
|
|
32
|
-
} else
|
|
33
|
-
return e;
|
|
25
|
+
return e && (e.startsWith("http://") || e.startsWith("https://") ? e : e.startsWith("{{") ? e.replace("{{geoServer}}", this.mapConfig.geoServer) : this.mapConfig.assetsRoot + e);
|
|
34
26
|
}
|
|
35
27
|
/**
|
|
36
28
|
* 初始化地图
|
|
@@ -38,18 +30,18 @@ class oe {
|
|
|
38
30
|
* @returns view
|
|
39
31
|
*/
|
|
40
32
|
async initialize(e) {
|
|
41
|
-
var
|
|
33
|
+
var w, v, b, y;
|
|
42
34
|
this.mapConfig = e.mapConfig;
|
|
43
35
|
const { container: i, markerClickCallback: s, mapClickCallback: a } = e;
|
|
44
36
|
d.assetsPath = `${this.mapConfig.assetsRoot}/ArcgisAssets`, d.fontsUrl = `${this.mapConfig.assetsRoot}/fonts`, d.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
|
|
45
|
-
const r = new
|
|
46
|
-
|
|
37
|
+
const r = new O();
|
|
38
|
+
((w = this.mapConfig) == null ? void 0 : w.mapOptions.mode.toLowerCase()) === "2d" ? (this.view = new N({
|
|
47
39
|
map: r,
|
|
48
40
|
container: i,
|
|
49
41
|
...this.mapConfig.mapOptions
|
|
50
42
|
}), this.view.on("drag", (t) => {
|
|
51
43
|
t.button === 2 && t.stopPropagation();
|
|
52
|
-
})) : this.view = new
|
|
44
|
+
})) : this.view = new U({
|
|
53
45
|
map: r,
|
|
54
46
|
container: i,
|
|
55
47
|
environment: {
|
|
@@ -58,7 +50,7 @@ class oe {
|
|
|
58
50
|
type: "virtual"
|
|
59
51
|
}
|
|
60
52
|
},
|
|
61
|
-
...(
|
|
53
|
+
...(v = this.mapConfig) == null ? void 0 : v.mapOptions
|
|
62
54
|
}), this.view.popup.visibleElements = {
|
|
63
55
|
closeButton: !0,
|
|
64
56
|
collapseButton: !1,
|
|
@@ -68,10 +60,10 @@ class oe {
|
|
|
68
60
|
buttonEnabled: !1,
|
|
69
61
|
breakpoint: !1
|
|
70
62
|
}, this.view.on("click", async (t) => {
|
|
71
|
-
var h,
|
|
63
|
+
var h, f;
|
|
72
64
|
if (a) {
|
|
73
65
|
let o = t.mapPoint;
|
|
74
|
-
o.spatialReference.isWebMercator && (o =
|
|
66
|
+
o.spatialReference.isWebMercator && (o = u.webMercatorToGeographic(
|
|
75
67
|
o
|
|
76
68
|
)), a(
|
|
77
69
|
[o.x, o.y],
|
|
@@ -82,20 +74,20 @@ class oe {
|
|
|
82
74
|
if (this.view.type === "3d") {
|
|
83
75
|
const o = this.view.camera;
|
|
84
76
|
if (this.view.spatialReference.isWebMercator) {
|
|
85
|
-
const l =
|
|
77
|
+
const l = u.webMercatorToGeographic(
|
|
86
78
|
o.position
|
|
87
|
-
),
|
|
79
|
+
), p = {
|
|
88
80
|
heading: o.heading,
|
|
89
81
|
tilt: o.tilt,
|
|
90
82
|
position: l.toJSON()
|
|
91
83
|
};
|
|
92
|
-
console.log(
|
|
84
|
+
console.log(p), (h = navigator.clipboard) == null || h.writeText(JSON.stringify(p));
|
|
93
85
|
} else
|
|
94
86
|
console.log(o.toJSON());
|
|
95
87
|
console.log(this.view.zoom, this.view.scale);
|
|
96
88
|
} else {
|
|
97
89
|
let o = this.view.center;
|
|
98
|
-
this.view.spatialReference.isWebMercator && (o =
|
|
90
|
+
this.view.spatialReference.isWebMercator && (o = u.webMercatorToGeographic(
|
|
99
91
|
o
|
|
100
92
|
)), console.log({
|
|
101
93
|
center: o.toJSON(),
|
|
@@ -103,47 +95,69 @@ class oe {
|
|
|
103
95
|
scale: this.view.scale
|
|
104
96
|
});
|
|
105
97
|
}
|
|
106
|
-
const
|
|
98
|
+
const c = (f = (await this.view.hitTest(t)).results) == null ? void 0 : f.filter(
|
|
107
99
|
(o) => o.type === "graphic"
|
|
108
100
|
);
|
|
109
|
-
|
|
110
|
-
var
|
|
101
|
+
c.length > 0 && c.forEach((o) => {
|
|
102
|
+
var p;
|
|
111
103
|
const l = o.graphic;
|
|
112
|
-
(
|
|
104
|
+
(p = l.attributes) != null && p.type && s && s(
|
|
113
105
|
l.attributes.type,
|
|
114
106
|
l.attributes.id,
|
|
115
107
|
l.attributes,
|
|
116
108
|
t
|
|
117
109
|
);
|
|
118
110
|
});
|
|
111
|
+
});
|
|
112
|
+
{
|
|
113
|
+
let t = 0, n = !1;
|
|
114
|
+
this.view.on("pointer-move", async (c) => {
|
|
115
|
+
var f;
|
|
116
|
+
const h = performance.now();
|
|
117
|
+
if (!(n || h - t < 100)) {
|
|
118
|
+
t = h, n = !0;
|
|
119
|
+
try {
|
|
120
|
+
const l = (f = (await this.view.hitTest(c)).results) == null ? void 0 : f.some(
|
|
121
|
+
(L) => L.type === "graphic"
|
|
122
|
+
), p = this.view.container;
|
|
123
|
+
p && (p.style.cursor = l ? "pointer" : "default");
|
|
124
|
+
} finally {
|
|
125
|
+
n = !1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (this.view.on("pointer-leave", () => {
|
|
131
|
+
const t = this.view.container;
|
|
132
|
+
t && (t.style.cursor = "default");
|
|
119
133
|
}), (b = this.mapConfig) != null && b.baseLayers ? this.mapConfig.baseLayers.forEach((t) => {
|
|
120
|
-
const
|
|
121
|
-
let
|
|
134
|
+
const n = this.processUrl(t.url);
|
|
135
|
+
let c = null;
|
|
122
136
|
switch (t.type.toLowerCase()) {
|
|
123
137
|
case "webTile".toLowerCase(): {
|
|
124
|
-
|
|
125
|
-
urlTemplate:
|
|
138
|
+
c = new R({
|
|
139
|
+
urlTemplate: n,
|
|
126
140
|
...t.options
|
|
127
141
|
});
|
|
128
142
|
break;
|
|
129
143
|
}
|
|
130
144
|
case "tile": {
|
|
131
|
-
|
|
132
|
-
url:
|
|
145
|
+
c = new H({
|
|
146
|
+
url: n,
|
|
133
147
|
...t.options
|
|
134
148
|
});
|
|
135
149
|
break;
|
|
136
150
|
}
|
|
137
|
-
case "
|
|
138
|
-
|
|
139
|
-
urlTemplate:
|
|
151
|
+
case "customwmts".toLowerCase(): {
|
|
152
|
+
c = new J({
|
|
153
|
+
urlTemplate: n,
|
|
140
154
|
...t.options
|
|
141
155
|
});
|
|
142
156
|
break;
|
|
143
157
|
}
|
|
144
|
-
case "
|
|
145
|
-
|
|
146
|
-
url:
|
|
158
|
+
case "mapimage".toLowerCase(): {
|
|
159
|
+
c = new S({
|
|
160
|
+
url: n,
|
|
147
161
|
...t.options
|
|
148
162
|
});
|
|
149
163
|
break;
|
|
@@ -154,19 +168,19 @@ class oe {
|
|
|
154
168
|
break;
|
|
155
169
|
}
|
|
156
170
|
case "feature": {
|
|
157
|
-
|
|
171
|
+
c = new z({ url: n, ...t.options });
|
|
158
172
|
break;
|
|
159
173
|
}
|
|
160
174
|
case "3dtiles": {
|
|
161
|
-
|
|
162
|
-
url:
|
|
175
|
+
c = new G({
|
|
176
|
+
url: n,
|
|
163
177
|
...t.options
|
|
164
178
|
});
|
|
165
179
|
break;
|
|
166
180
|
}
|
|
167
181
|
case "wms": {
|
|
168
|
-
|
|
169
|
-
url:
|
|
182
|
+
c = new B({
|
|
183
|
+
url: n,
|
|
170
184
|
...t.options
|
|
171
185
|
});
|
|
172
186
|
break;
|
|
@@ -175,31 +189,31 @@ class oe {
|
|
|
175
189
|
console.warn(`不支持的图层类型: ${t.type}`);
|
|
176
190
|
break;
|
|
177
191
|
}
|
|
178
|
-
if (
|
|
192
|
+
if (c)
|
|
179
193
|
if (t.group) {
|
|
180
194
|
let h = r.findLayerById(t.group);
|
|
181
|
-
h && h.type === "group" ? h.add(
|
|
195
|
+
h && h.type === "group" ? h.add(c) : (h = new I({
|
|
182
196
|
id: t.group,
|
|
183
197
|
title: t.groupTitle,
|
|
184
198
|
visibilityMode: "inherited",
|
|
185
|
-
layers: [
|
|
199
|
+
layers: [c],
|
|
186
200
|
visible: t.groupVisible !== !1
|
|
187
201
|
}), r.add(h));
|
|
188
202
|
} else
|
|
189
|
-
r.add(
|
|
203
|
+
r.add(c);
|
|
190
204
|
}) : r.basemap = new M({
|
|
191
205
|
style: {
|
|
192
206
|
id: "arcgis/light-gray",
|
|
193
207
|
language: "zh-CN"
|
|
194
208
|
}
|
|
195
|
-
}), (
|
|
209
|
+
}), (y = this.mapConfig) != null && y.hdLayers) {
|
|
196
210
|
const t = this.mapConfig.hdLayers.map(
|
|
197
|
-
(
|
|
211
|
+
(n) => (
|
|
198
212
|
// 图层文件为GeoJson格式, renderer和symbol使用autocast配置
|
|
199
|
-
new
|
|
200
|
-
url: this.processUrl(
|
|
201
|
-
...
|
|
202
|
-
title:
|
|
213
|
+
new x({
|
|
214
|
+
url: this.processUrl(n.url),
|
|
215
|
+
...n.options,
|
|
216
|
+
title: n.options.id
|
|
203
217
|
})
|
|
204
218
|
)
|
|
205
219
|
);
|
|
@@ -207,23 +221,23 @@ class oe {
|
|
|
207
221
|
}
|
|
208
222
|
this.view.ui.remove("attribution"), await this.view.when();
|
|
209
223
|
const g = this.mapConfig.camera;
|
|
210
|
-
let
|
|
224
|
+
let m;
|
|
211
225
|
if (this.view.type === "2d") {
|
|
212
226
|
let t = this.view.center;
|
|
213
|
-
this.view.spatialReference.isWebMercator && (t =
|
|
227
|
+
this.view.spatialReference.isWebMercator && (t = u.webMercatorToGeographic(
|
|
214
228
|
t
|
|
215
|
-
)),
|
|
229
|
+
)), m = { center: [t.x, t.y], zoom: this.view.zoom };
|
|
216
230
|
} else {
|
|
217
231
|
let t = this.view.camera.position;
|
|
218
|
-
this.view.spatialReference.isWebMercator && (t =
|
|
232
|
+
this.view.spatialReference.isWebMercator && (t = u.webMercatorToGeographic(
|
|
219
233
|
t
|
|
220
|
-
)),
|
|
234
|
+
)), m = {
|
|
221
235
|
position: t,
|
|
222
236
|
heading: this.view.camera.heading,
|
|
223
237
|
tilt: this.view.camera.tilt
|
|
224
238
|
};
|
|
225
239
|
}
|
|
226
|
-
return g ? g.home =
|
|
240
|
+
return g ? g.home = m : this.mapConfig.camera = { home: m }, this.view;
|
|
227
241
|
}
|
|
228
242
|
setLayerVisibility(e) {
|
|
229
243
|
const { id: i, visible: s } = e, a = this.view.map.findLayerById(i);
|
|
@@ -244,19 +258,22 @@ class oe {
|
|
|
244
258
|
e.target = new T(e.target);
|
|
245
259
|
break;
|
|
246
260
|
case "polyline":
|
|
247
|
-
e.target = new
|
|
261
|
+
e.target = new W(e.target);
|
|
248
262
|
break;
|
|
249
263
|
case "polygon":
|
|
250
|
-
e.target = new
|
|
264
|
+
e.target = new C(e.target);
|
|
251
265
|
break;
|
|
252
266
|
case "multipoint":
|
|
253
|
-
e.target = new
|
|
267
|
+
e.target = new P(e.target);
|
|
254
268
|
break;
|
|
255
269
|
}
|
|
256
270
|
await this.view.goTo(e, { duration: (e.duration || 0) * 1e3 });
|
|
257
271
|
}
|
|
258
272
|
return { status: 0, message: "成功" };
|
|
259
273
|
}
|
|
274
|
+
setMapZoom(e) {
|
|
275
|
+
return this.view ? (this.view.zoom = e, { status: 0, message: "成功" }) : { status: -1, message: "未初始化" };
|
|
276
|
+
}
|
|
260
277
|
/**
|
|
261
278
|
* 在一定的高度,以一定的角度去观察某个坐标
|
|
262
279
|
* */
|
|
@@ -278,8 +295,8 @@ class oe {
|
|
|
278
295
|
{ duration: (e.duration || 2) * 1e3 }
|
|
279
296
|
);
|
|
280
297
|
else {
|
|
281
|
-
const a = Math.tan(i * Math.PI / 180) * e.height, r =
|
|
282
|
-
|
|
298
|
+
const a = Math.tan(i * Math.PI / 180) * e.height, r = E(
|
|
299
|
+
A.point(e.center),
|
|
283
300
|
a,
|
|
284
301
|
s + 180,
|
|
285
302
|
{
|
|
@@ -317,8 +334,8 @@ class oe {
|
|
|
317
334
|
const r = 1e3 / 30, g = k.watch(
|
|
318
335
|
() => this.view.center,
|
|
319
336
|
() => {
|
|
320
|
-
const
|
|
321
|
-
|
|
337
|
+
const m = this.transformPoints(e), w = Date.now();
|
|
338
|
+
w - s > r && (i(m), s = w);
|
|
322
339
|
}
|
|
323
340
|
);
|
|
324
341
|
return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, g), { handle: this.handleIndex, points: this.transformPoints(e) };
|
|
@@ -353,5 +370,5 @@ class oe {
|
|
|
353
370
|
}
|
|
354
371
|
}
|
|
355
372
|
export {
|
|
356
|
-
|
|
373
|
+
ae as default
|
|
357
374
|
};
|
|
@@ -110,7 +110,7 @@ export default class OpenDriveRenderer {
|
|
|
110
110
|
* @param params
|
|
111
111
|
* @returns
|
|
112
112
|
*/
|
|
113
|
-
selectSumo(params: IFindSumoParams): IResult
|
|
113
|
+
selectSumo(params: IFindSumoParams): Promise<IResult>;
|
|
114
114
|
geometrySearch(coordinate: number[][]): Promise<IResult>;
|
|
115
115
|
splitLane(params: ISplitOpenDriveLaneParams): Promise<IResult>;
|
|
116
116
|
clearSplitLane(): void;
|
|
@@ -4,7 +4,7 @@ import * as $ from "@arcgis/core/core/reactiveUtils.js";
|
|
|
4
4
|
import { Polygon as S, Point as P } from "@arcgis/core/geometry";
|
|
5
5
|
import * as L from "@arcgis/core/geometry/geometryEngine";
|
|
6
6
|
import D from "@arcgis/core/layers/FeatureLayer";
|
|
7
|
-
import
|
|
7
|
+
import w from "@arcgis/core/layers/GraphicsLayer";
|
|
8
8
|
import * as k from "@turf/helpers";
|
|
9
9
|
import { lineSliceAlong as x } from "@turf/line-slice-along";
|
|
10
10
|
import b from "axios";
|
|
@@ -289,7 +289,7 @@ class O {
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
]
|
|
292
|
-
}), this.junctionLayer = new
|
|
292
|
+
}), this.junctionLayer = new w({ id: "OpenDriveJunction" }), this.sectionLayer = new w({ id: "OpenDriveSection" }), this.highlightLayer = new w({ id: "OpenDriveHighlight" }), this.flashLayer = new w({ id: "OpenDriveFlash" }), this.drawLayer = new w({ id: "Draw" }), this.splitLaneLayer = new w({ id: "SplitLane" }), this.borderLayer = new w({ id: "OpenDriveBorder" }), this.view.map.addMany([
|
|
293
293
|
this.laneLayer,
|
|
294
294
|
this.sectionLayer,
|
|
295
295
|
this.roadNameLayer,
|
|
@@ -439,7 +439,7 @@ class O {
|
|
|
439
439
|
const v = Number(u.id);
|
|
440
440
|
if (v === 0)
|
|
441
441
|
continue;
|
|
442
|
-
const
|
|
442
|
+
const I = u.type, M = [...u.outerPath], A = u.innerPath.concat(
|
|
443
443
|
M.reverse()
|
|
444
444
|
);
|
|
445
445
|
if (A.length <= 3) {
|
|
@@ -463,7 +463,7 @@ class O {
|
|
|
463
463
|
sectionId: String(d),
|
|
464
464
|
sectionIndex: m,
|
|
465
465
|
laneId: v,
|
|
466
|
-
type:
|
|
466
|
+
type: I,
|
|
467
467
|
sumoId: "",
|
|
468
468
|
// 记录左右边线的起始点,用于按长度高亮车道的一部分
|
|
469
469
|
leftLine: u.innerPath,
|
|
@@ -904,7 +904,7 @@ class O {
|
|
|
904
904
|
* @param params
|
|
905
905
|
* @returns
|
|
906
906
|
*/
|
|
907
|
-
selectSumo(e) {
|
|
907
|
+
async selectSumo(e) {
|
|
908
908
|
switch (e.type) {
|
|
909
909
|
case "junction":
|
|
910
910
|
return this.junctionLayer.graphics.forEach((t) => {
|
|
@@ -929,7 +929,7 @@ class O {
|
|
|
929
929
|
this.selectedSectionIds.includes(a) || this.selectedSectionIds.push(a);
|
|
930
930
|
let n = c.get(a);
|
|
931
931
|
n ? n.push(r.geometry) : (n = [r.geometry], c.set(a, n));
|
|
932
|
-
}), c.forEach((r, a) => {
|
|
932
|
+
}), c.forEach(async (r, a) => {
|
|
933
933
|
const n = L.union(r), l = new g({
|
|
934
934
|
geometry: n,
|
|
935
935
|
symbol: {
|
|
@@ -948,7 +948,7 @@ class O {
|
|
|
948
948
|
selected: !0
|
|
949
949
|
}
|
|
950
950
|
});
|
|
951
|
-
this.sectionLayer.add(l);
|
|
951
|
+
this.sectionLayer.add(l), await this.view.goTo(l);
|
|
952
952
|
}), { status: 0, message: "ok" };
|
|
953
953
|
} else
|
|
954
954
|
return { status: -1, message: "未找到路段" };
|
|
@@ -1014,11 +1014,11 @@ class O {
|
|
|
1014
1014
|
const o = Number(s[1]), i = s[0].split("#"), c = i.length === 2 ? Number(i[1]) : 0;
|
|
1015
1015
|
let r = i[0];
|
|
1016
1016
|
r.startsWith("-") && (r = r.slice(1));
|
|
1017
|
-
const a = this.allLaneGraphics.filter((
|
|
1017
|
+
const a = this.allLaneGraphics.filter((I) => I.getAttribute("roadId") === r && I.getAttribute("sectionIndex") === c);
|
|
1018
1018
|
if (a.length === 0)
|
|
1019
1019
|
return { status: -1, message: "未找到路段" };
|
|
1020
1020
|
const n = a.length - o, l = a.find(
|
|
1021
|
-
(
|
|
1021
|
+
(I) => Math.abs(I.getAttribute("laneId")) === n
|
|
1022
1022
|
);
|
|
1023
1023
|
if (!l)
|
|
1024
1024
|
return { status: -1, message: "未找到车道" };
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import MapView from '@arcgis/core/views/MapView';
|
|
2
2
|
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
3
|
import { IEditSignalControlAreaParams, IFindSignalControlAreaParams, IFindSumoParams, ILaneNumberParams, ILayerVisibleParams, ILookAtParams, IMaskParam, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IShowEdpassDeviceParams, IShowGreenWaveBandParams, IShowJurisdictionParams, IShowOpenDriveFromFileParams, IShowSignalControlAreaParams, ISignalCountdownProps, ISplitOpenDriveLaneParams, IStartCrossBufferParam, IToggleTrafficInfoParams, IUnselectSumoParams } from '../types';
|
|
4
|
+
import EdpassDeviceController from './utils/edpass-device-controller';
|
|
4
5
|
import GreenWaveBandController from './utils/green-wave-band-controller';
|
|
5
6
|
import HoloFlow from './utils/holo-flow';
|
|
6
7
|
import MapInitializer from './utils/map-initializer';
|
|
@@ -12,7 +13,6 @@ import RoadConfigTool from './utils/road-config-tool';
|
|
|
12
13
|
import EditSignalArea from './utils/signal-control-area/edit-area';
|
|
13
14
|
import ShowSignalArea from './utils/signal-control-area/show-area';
|
|
14
15
|
import TrafficFlow from './utils/traffic-flow';
|
|
15
|
-
import EdpassDeviceController from './utils/edpass-device-controller';
|
|
16
16
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
17
17
|
config: {
|
|
18
18
|
type: StringConstructor;
|
|
@@ -69,6 +69,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
69
69
|
rColor?: string | undefined;
|
|
70
70
|
};
|
|
71
71
|
}[];
|
|
72
|
+
scaleToZoom: (scale: number) => number;
|
|
73
|
+
removeZoomWatch: (() => void) | null;
|
|
74
|
+
lastEmittedZoomInt: number | null;
|
|
75
|
+
emitZoomIfChanged: (z: number) => void;
|
|
72
76
|
mapViewer: import("vue").ComputedRef<MapView | SceneView>;
|
|
73
77
|
handleStartSaveTrackLog: () => void;
|
|
74
78
|
handleDownloadTrackLog: () => void;
|
|
@@ -76,6 +80,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
76
80
|
handleShowPlateNumber: () => void;
|
|
77
81
|
setMapCenter: (params: ISetMapCenterParams) => Promise<import("../types").IResult>;
|
|
78
82
|
setMapCamera: (params: ISetMapCameraParams) => Promise<import("../types").IResult>;
|
|
83
|
+
setMapZoom: (zoom: number) => import("../types").IResult;
|
|
79
84
|
lookAt: (params: ILookAtParams) => Promise<void>;
|
|
80
85
|
setLayerVisibility: (params: ILayerVisibleParams) => import("../types").IResult;
|
|
81
86
|
requestCoordinateTransform: (points: number[][], callback: (points: number[][]) => void) => {
|
|
@@ -174,7 +179,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
174
179
|
} | undefined;
|
|
175
180
|
setEdpassLayerVisibility: (params: IShowEdpassDeviceParams) => Promise<import("../types").IResult>;
|
|
176
181
|
props: any;
|
|
177
|
-
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
182
|
+
emit: (event: "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", ...args: any[]) => void;
|
|
178
183
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
179
184
|
displayMode: {
|
|
180
185
|
type: StringConstructor;
|
|
@@ -299,7 +304,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
299
304
|
required: true;
|
|
300
305
|
};
|
|
301
306
|
}>>, {}, {}>;
|
|
302
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick")[], "mapLoaded" | "markerClick" | "mapClick", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
307
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick" | "update:zoom")[], "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
303
308
|
config: {
|
|
304
309
|
type: StringConstructor;
|
|
305
310
|
required: true;
|
|
@@ -312,5 +317,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
312
317
|
onMapLoaded?: ((...args: any[]) => any) | undefined;
|
|
313
318
|
onMarkerClick?: ((...args: any[]) => any) | undefined;
|
|
314
319
|
onMapClick?: ((...args: any[]) => any) | undefined;
|
|
320
|
+
"onUpdate:zoom"?: ((...args: any[]) => any) | undefined;
|
|
315
321
|
}, {}, {}>;
|
|
316
322
|
export default _sfc_main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),D=require("./stores/index.js");require("./style/index.css");const at=require("./utils/detect-gpu.js"),nt=require("./utils/edpass-device-controller.js"),I=require("./utils/green-wave-band-controller/index.js"),rt=require("./utils/holo-flow/index.js"),st=require("./utils/holo-flow/signal-countdown-panel.vue.js"),ot=require("./utils/map-initializer.js"),M=require("./utils/open-drive-renderer/index.js"),x=require("./utils/overlay.js"),it=require("./utils/police-jurisdiction.js"),ct=require("./utils/queue-length.js"),z=require("./utils/road-config-tool/index.js"),lt=require("./utils/signal-control-area/edit-area.js"),ut=require("./utils/signal-control-area/show-area.js"),dt=require("./utils/traffic-flow.js"),mt={class:"gis-viewer"},pt={style:{position:"absolute",bottom:"80px",left:"10px","z-index":"9999"}},gt=n.defineComponent({__name:"gis-map",props:{config:{},assetsRoot:{}},emits:["mapLoaded","markerClick","mapClick","update:zoom"],setup(E,{expose:N,emit:P}){const h=n.ref(null);let r,p,l,i,a,s,f,t,u,o,g,y,C;const b=n.ref(!1);D.registerStore();const T=D.default.useAppDataStore,V=n.reactive([]),_=e=>Math.log2(591657527591555e-6/e);let v=null,q=null;const O=e=>{if(!Number.isFinite(e))return;const d=Math.round(e);d!==q&&(q=d,S("update:zoom",d))};at.default(),n.onMounted(async()=>{if(!h.value)return;document.addEventListener("keydown",m=>{m.ctrlKey&&m.key==="i"&&(b.value=!b.value)});const e=n.getCurrentInstance(),{$gisviewerAssetsRoot:d}=e.appContext.config.globalProperties,c=await(await fetch(B.config)).json();c.assetsRoot=B.assetsRoot||d,T.mapConfig=c,p=new ot.default,T.mapInitializer=p,r=await p.initialize({container:h.value,mapConfig:c,markerClickCallback:(m,A,L,tt)=>{S("markerClick",m,A,L,tt)},mapClickCallback:(m,A,L)=>{S("mapClick",m,A,L)}});const w=r.zoom??(r.scale?_(r.scale):void 0);typeof w=="number"&&O(w);const et=r.zoom!==void 0?r.watch("zoom",m=>{O(m)}):r.watch("scale",m=>{typeof m=="number"&&m>0&&O(_(m))});v=()=>et.remove(),a=new rt.default(r,V),await a.init(),S("mapLoaded")}),n.onUnmounted(()=>{o==null||o.clearSignalControlArea(),t==null||t.clearOpenDrive(),a.clearHoloTrace(),a.clearHoloSignal(),i==null||i.disconnectTrafficFlow(),v==null||v(),v=null});const H=n.computed(()=>r),G=()=>{const e=D.default.useAppDataStore;e.saveTrackLog=!0},Z=()=>{a.downloadTrackLog()},W=()=>{k("vehicleId")},j=()=>{k("plateNumber")},J=async e=>await p.setMapCenter(e),Q=async e=>await p.setMapCamera(e),U=e=>p.setMapZoom(e),K=async e=>await p.lookAt(e),F=e=>p.setLayerVisibility(e),X=(e,d)=>p.requestCoordinateTransform(e,d),Y=e=>{p.cancelCoordinateTransform(e)},R=e=>{p.setMapZoomRange(e)},$=e=>(l||(l=new z.default(r)),l.showLaneNumber(e)),ee=()=>{l==null||l.clearLaneNumber()},te=async e=>(l||(l=new z.default(r)),await l.initializeSearch(e)),ae=async()=>l==null?void 0:l.calCrossIndicatorArea(),ne=async()=>{},re=async(e,d)=>{i||(i=new dt.default(r)),i.connectTrafficFlow(e,d)},se=()=>{i==null||i.disconnectTrafficFlow()},oe=async e=>{a.handleVehicleTraceData(e)},ie=()=>{a.clearHoloTrace()},ce=e=>{a.setInterpolate(e)},le=async e=>{await a.handleSignalData(e)},ue=async e=>{await a.initializeLampGroup(e)},de=e=>{a.handleUniSignalData(e)},me=()=>{a.clearHoloSignal()},pe=e=>{i==null||i.toggleTrafficInfo(e),a==null||a.toggleTrafficInfo(e)},ge=e=>{a==null||a.togglePause(e)},fe=e=>{i==null||i.toggleTrafficObject(e),a==null||a.toggleTrafficObject(e)},k=e=>{a==null||a.updatePanelContent(e)},ye=async e=>(s||(s=new x.default(r)),s.addOverlays(e)),ve=e=>(s||(s=new x.default(r)),s.addMask(e)),Se=()=>{s==null||s.removeMask()},we=e=>s==null?void 0:s.removeOverlaysByType(e),he=e=>s==null?void 0:s.removeOverlaysById(e),Ce=()=>s==null?void 0:s.removeAllOverlays(),be=()=>{s==null||s.showAllOverlays()},Oe=e=>{f||(f=new ct.default(r)),f.updateQueueLength(e)},ke=()=>{f==null||f.removeQueueLength()},Ae=async(e,d)=>(t||(t=new M.default(r)),await t.showOpenDriveFromServer(e,d)),Le=async e=>(t||(t=new M.default(r)),await t.clearOpenDrive(),await t.showOpenDriveFromFile(e)),De=e=>t?t.setOpendriveVisibility(e):{status:-1,message:"未加载OpenDrive地图"},Te=async()=>await(t==null?void 0:t.clearOpenDrive()),Ve=async e=>t?await(t==null?void 0:t.findSumo(e)):{status:-1,message:"未加载OpenDrive地图"},_e=async e=>t?t.selectSumo(e):{status:-1,message:"未加载OpenDrive地图"},qe=async e=>t?t.unselectSumo(e):{status:-1,message:"未加载OpenDrive地图"},Be=async e=>t?await t.geometrySearch(e):{status:-1,message:"未加载OpenDrive地图"},Ie=async e=>t?await t.getSumoInfo(e):{status:-1,message:"未加载OpenDrive地图"},Me=async e=>t?await(t==null?void 0:t.splitLane(e)):{status:-1,message:"未加载OpenDrive地图"},xe=async()=>t?t==null?void 0:t.clearSplitLane():{status:-1,message:"未加载OpenDrive地图"},ze=async e=>(o||(o=new ut.default(r)),await o.showSignalControlArea(e)),Ee=async()=>await(o==null?void 0:o.clearSignalControlArea()),Ne=e=>o==null?void 0:o.setLayerVisibility(e),Pe=async e=>o?await(o==null?void 0:o.locateSignalControlArea(e)):{status:-1,message:"未加载信号控制区"},He=async e=>o?await o.highlightSignalControlArea(e):{status:-1,message:"未加载信号控制区"},Ge=()=>o?o.resetHighlight():{status:-1,message:"未加载信号控制区"},Ze=e=>(u||(u=new lt.default(r)),u.showSubSignalControlArea(e)),We=e=>u?u.editSubSignalControlArea(e):{status:-1,message:"未加载信号控制区"},je=()=>u?u.stopEditSubSignalControlArea():{status:-1,message:"未加载信号控制区"},Je=e=>u?u.selectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Qe=e=>u?u.unselectSubSignalControlAreaCross(e):{status:-1,message:"未加载信号控制区"},Ue=e=>{if(!u)return{status:-1,message:"未加载信号控制区"}},Ke=e=>(g||(g=new I.default(r)),g.addGreenWaveBand(e)),Fe=()=>{if(!g)return{status:-1,message:"未加载绿波带"};g.stopAddGreenWaveBand()},Xe=async e=>(g||(g=new I.default(r)),await g.showGreenWaveBand(e)),Ye=async e=>(y||(y=new it.default(r)),await y.showJurisdiction(e)),Re=()=>{if(!y)return{status:-1,message:"未加载警务管辖区"};y.clearJurisdiction()},$e=async e=>(C||(C=new nt.default(r)),await C.setEdpassLayerVisibility(e)),B=E,S=P;return N({mapViewer:H,setLayerVisibility:F,setMapCenter:J,lookAt:K,setMapCamera:Q,setMapZoom:U,setMapZoomRange:R,requestCoordinateTransform:X,cancelCoordinateTransform:Y,addOverlays:ye,addMask:ve,removeMask:Se,showAllOverlays:be,removeOverlaysByType:we,removeOverlaysById:he,removeAllOverlays:Ce,showLaneNumber:$,clearLaneNumber:ee,initializeAreaTool:te,calCrossIndicatorArea:ae,calRoadIndicatorArea:ne,connectCarFlow:re,disconnectCarFlow:se,handleHoloVehicleTraceData:oe,clearHoloTrace:ie,initializeLampGroup:ue,handleUniSignalData:de,handleHoloSignalData:le,clearHoloSignal:me,setInterpolate:ce,toggleTrafficInfo:pe,toggleTrafficObject:fe,toggleVehicleInfo:k,togglePause:ge,updateQueueLength:Oe,removeQueueLength:ke,showOpenDriveFromServer:Ae,showOpenDriveFromFile:Le,clearOpenDrive:Te,setOpendriveVisibility:De,geometrySearchInOpenDrive:Be,findSumoInOpenDrive:Ve,selectSumoInOpenDrive:_e,unselectSumoInOpenDrive:qe,getSumoInfo:Ie,splitOpenDriveLane:Me,clearSplitOpenDriveLane:xe,showSignalControlArea:ze,clearSignalControlArea:Ee,setSignalControlAreaVisibility:Ne,locateSignalControlArea:Pe,highlightSignalControlArea:He,resetHighlightSignalControlArea:Ge,showSubSignalControlArea:Ze,editSubSignalControlArea:We,stopEditSubSignalControlArea:je,selectSubSignalControlAreaCross:Je,unselectSubSignalControlAreaCross:Qe,changeSubSignalControlAreaBorderVisibility:Ue,addGreenWaveBand:Ke,stopAddGreenWaveBand:Fe,showGreenWaveBand:Xe,showPoliceArea:Ye,clearPoliceArea:Re,setEdpassLayerVisibility:$e}),(e,d)=>(n.openBlock(),n.createElementBlock("div",mt,[n.createElementVNode("div",{class:"gis-viewer-main",ref_key:"mapContainer",ref:h},[n.withDirectives(n.createElementVNode("div",pt,[n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:G}," 开始记录 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:Z}," 下载日志 "),n.createElementVNode("button",{style:{"margin-right":"10px"},onClick:W}," 显示车辆id "),n.createElementVNode("button",{onClick:j},"显示车辆号牌")],512),[[n.vShow,b.value]])],512),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(V,(c,w)=>(n.openBlock(),n.createBlock(st.default,{key:w,"display-mode":c.displayMode,flash:c.flash,"road-id":c.crossId,"cross-id":c.roadId,"map-point":c.mapPoint,"stop-line":c.stopLine,position:c.position,rotation:c.rotation,scale:c.scale,"lamp-status":c.lampStatus},null,8,["display-mode","flash","road-id","cross-id","map-point","stop-line","position","rotation","scale","lamp-status"]))),128))]))}});exports.default=gt;
|
|
@@ -54,6 +54,10 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
54
54
|
rColor?: string | undefined;
|
|
55
55
|
};
|
|
56
56
|
}[];
|
|
57
|
+
scaleToZoom: (scale: number) => number;
|
|
58
|
+
removeZoomWatch: (() => void) | null;
|
|
59
|
+
lastEmittedZoomInt: number | null;
|
|
60
|
+
emitZoomIfChanged: (z: number) => void;
|
|
57
61
|
mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
|
|
58
62
|
handleStartSaveTrackLog: () => void;
|
|
59
63
|
handleDownloadTrackLog: () => void;
|
|
@@ -61,6 +65,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
61
65
|
handleShowPlateNumber: () => void;
|
|
62
66
|
setMapCenter: (params: import("../types").ISetMapCenterParams) => Promise<import("../types").IResult>;
|
|
63
67
|
setMapCamera: (params: import("../types").ISetMapCameraParams) => Promise<import("../types").IResult>;
|
|
68
|
+
setMapZoom: (zoom: number) => import("../types").IResult;
|
|
64
69
|
lookAt: (params: import("../types").ILookAtParams) => Promise<void>;
|
|
65
70
|
setLayerVisibility: (params: import("../types").ILayerVisibleParams) => import("../types").IResult;
|
|
66
71
|
requestCoordinateTransform: (points: number[][], callback: (points: number[][]) => void) => {
|
|
@@ -159,7 +164,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
159
164
|
} | undefined;
|
|
160
165
|
setEdpassLayerVisibility: (params: import("../types").IShowEdpassDeviceParams) => Promise<import("../types").IResult>;
|
|
161
166
|
props: any;
|
|
162
|
-
emit: (event: "mapLoaded" | "markerClick" | "mapClick", ...args: any[]) => void;
|
|
167
|
+
emit: (event: "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", ...args: any[]) => void;
|
|
163
168
|
SignalCountdownPanel: import("vue").DefineComponent<{
|
|
164
169
|
displayMode: {
|
|
165
170
|
type: StringConstructor;
|
|
@@ -284,7 +289,7 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
284
289
|
required: true;
|
|
285
290
|
};
|
|
286
291
|
}>>, {}, {}>;
|
|
287
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick")[], "mapLoaded" | "markerClick" | "mapClick", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
292
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick" | "update:zoom")[], "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
288
293
|
config: {
|
|
289
294
|
type: StringConstructor;
|
|
290
295
|
required: true;
|
|
@@ -297,5 +302,6 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
|
|
|
297
302
|
onMapLoaded?: ((...args: any[]) => any) | undefined;
|
|
298
303
|
onMarkerClick?: ((...args: any[]) => any) | undefined;
|
|
299
304
|
onMapClick?: ((...args: any[]) => any) | undefined;
|
|
305
|
+
"onUpdate:zoom"?: ((...args: any[]) => any) | undefined;
|
|
300
306
|
}, {}, {}>>;
|
|
301
307
|
export default GisMap;
|
|
@@ -7,6 +7,8 @@ export default class EdpassDeviceController {
|
|
|
7
7
|
private kkAbnormalLayer;
|
|
8
8
|
private mapInitializer;
|
|
9
9
|
private watchHandle;
|
|
10
|
+
private currentZdCode;
|
|
11
|
+
private currentDdCode;
|
|
10
12
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
11
13
|
setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
|
|
12
14
|
private getLayerConfig;
|