gisviewer-vue3-arcgis 1.0.248 → 1.0.250
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 +11 -3
- package/es/src/gis-map/gis-map.vue.mjs +178 -162
- package/es/src/gis-map/index.d.ts +10 -2
- package/es/src/gis-map/utils/edpass-device-controller.d.ts +2 -0
- package/es/src/gis-map/utils/edpass-device-controller.mjs +42 -33
- package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +5 -1
- package/es/src/gis-map/utils/map-initializer.d.ts +3 -0
- package/es/src/gis-map/utils/map-initializer.mjs +97 -80
- 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 +11 -3
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +10 -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 +3 -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,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as h from "@arcgis/core/core/reactiveUtils.js";
|
|
2
|
+
import u from "@arcgis/core/Graphic";
|
|
3
3
|
import l from "@arcgis/core/layers/GraphicsLayer";
|
|
4
|
-
import { toRaw as
|
|
5
|
-
import
|
|
6
|
-
class
|
|
4
|
+
import { toRaw as v } from "vue";
|
|
5
|
+
import b from "../stores/index.mjs";
|
|
6
|
+
class I {
|
|
7
7
|
constructor(e) {
|
|
8
|
-
this.watchHandle = null, this.view = e;
|
|
9
|
-
const t =
|
|
10
|
-
this.mapInitializer =
|
|
8
|
+
this.watchHandle = null, this.currentZdCode = "", this.currentDdCode = "", this.view = e;
|
|
9
|
+
const t = b.useAppDataStore;
|
|
10
|
+
this.mapInitializer = v(t.mapInitializer), this.cameraNormalLayer = new l({
|
|
11
11
|
id: "cameraNormalLayer",
|
|
12
12
|
visible: !1
|
|
13
13
|
}), this.cameraAbnormalLayer = new l({
|
|
@@ -38,42 +38,50 @@ class S {
|
|
|
38
38
|
});
|
|
39
39
|
case "cluster": {
|
|
40
40
|
const { deviceLayer: i } = this.getLayerConfig(e);
|
|
41
|
-
i.visible = e.visible,
|
|
41
|
+
i.visible = e.visible, this.currentDdCode = e.ddCode || "", this.currentZdCode = e.zdCode || "", e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = h.when(
|
|
42
42
|
() => this.view.stationary,
|
|
43
43
|
async () => {
|
|
44
|
-
this.cameraNormalLayer.visible &&
|
|
44
|
+
this.cameraNormalLayer.visible && await this.showClusterInExtent(
|
|
45
45
|
{
|
|
46
46
|
deviceType: "camera",
|
|
47
47
|
deviceState: "normal",
|
|
48
48
|
mode: "cluster",
|
|
49
|
+
ddCode: this.currentDdCode,
|
|
50
|
+
zdCode: this.currentZdCode,
|
|
49
51
|
visible: !0
|
|
50
52
|
},
|
|
51
53
|
this.view.extent
|
|
52
|
-
)
|
|
54
|
+
), this.cameraAbnormalLayer.visible && await this.showClusterInExtent(
|
|
53
55
|
{
|
|
54
56
|
deviceType: "camera",
|
|
55
57
|
deviceState: "abnormal",
|
|
56
58
|
mode: "cluster",
|
|
59
|
+
ddCode: this.currentDdCode,
|
|
60
|
+
zdCode: this.currentZdCode,
|
|
57
61
|
visible: !0
|
|
58
62
|
},
|
|
59
63
|
this.view.extent
|
|
60
|
-
)
|
|
64
|
+
), this.kkNormalLayer.visible && await this.showClusterInExtent(
|
|
61
65
|
{
|
|
62
66
|
deviceType: "kk",
|
|
63
67
|
deviceState: "normal",
|
|
64
68
|
mode: "cluster",
|
|
69
|
+
ddCode: this.currentDdCode,
|
|
70
|
+
zdCode: this.currentZdCode,
|
|
65
71
|
visible: !0
|
|
66
72
|
},
|
|
67
73
|
this.view.extent
|
|
68
|
-
)
|
|
74
|
+
), this.kkAbnormalLayer.visible && await this.showClusterInExtent(
|
|
69
75
|
{
|
|
70
76
|
deviceType: "kk",
|
|
71
77
|
deviceState: "abnormal",
|
|
72
78
|
mode: "cluster",
|
|
79
|
+
ddCode: this.currentDdCode,
|
|
80
|
+
zdCode: this.currentZdCode,
|
|
73
81
|
visible: !0
|
|
74
82
|
},
|
|
75
83
|
this.view.extent
|
|
76
|
-
)
|
|
84
|
+
);
|
|
77
85
|
}
|
|
78
86
|
))) : (i.removeAll(), !this.cameraNormalLayer.visible && !this.cameraAbnormalLayer.visible && !this.kkNormalLayer.visible && !this.kkAbnormalLayer.visible && ((t = this.watchHandle) == null || t.remove(), this.watchHandle = null));
|
|
79
87
|
break;
|
|
@@ -85,11 +93,11 @@ class S {
|
|
|
85
93
|
};
|
|
86
94
|
}
|
|
87
95
|
getLayerConfig(e) {
|
|
88
|
-
let t, i,
|
|
89
|
-
return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196],
|
|
96
|
+
let t, i, a;
|
|
97
|
+
return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196], a = this.cameraNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_sxj_yc.png", i = [189, 49, 50], a = this.cameraAbnormalLayer) : e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_kk_map.png", i = [45, 108, 196], a = this.kkNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_kk_yc.png", i = [189, 49, 50], a = this.kkAbnormalLayer), {
|
|
90
98
|
icon: t,
|
|
91
99
|
color: i,
|
|
92
|
-
deviceLayer:
|
|
100
|
+
deviceLayer: a
|
|
93
101
|
};
|
|
94
102
|
}
|
|
95
103
|
async showClusterInExtent(e, t) {
|
|
@@ -105,7 +113,8 @@ class S {
|
|
|
105
113
|
bottomRightLat: t.ymin,
|
|
106
114
|
bottomRightLon: t.xmax,
|
|
107
115
|
devStateSet: [e.deviceState === "normal" ? "1" : "2"],
|
|
108
|
-
|
|
116
|
+
zdCode: e.zdCode || "",
|
|
117
|
+
ddCode: e.ddCode || "",
|
|
109
118
|
mapLevel: this.view.zoom + 9
|
|
110
119
|
})
|
|
111
120
|
});
|
|
@@ -113,29 +122,29 @@ class S {
|
|
|
113
122
|
console.error(i.statusText);
|
|
114
123
|
return;
|
|
115
124
|
}
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
125
|
+
const a = await i.json();
|
|
126
|
+
if (a.code !== 200)
|
|
118
127
|
return;
|
|
119
|
-
const { icon: n, color: c, deviceLayer:
|
|
120
|
-
|
|
121
|
-
const
|
|
128
|
+
const { icon: n, color: c, deviceLayer: d } = this.getLayerConfig(e);
|
|
129
|
+
d.removeAll();
|
|
130
|
+
const m = a.data.map((r) => {
|
|
122
131
|
var y;
|
|
123
|
-
const o = (
|
|
132
|
+
const o = (r.count.toString().length * 6 + 6) / 2, s = new u({
|
|
124
133
|
geometry: {
|
|
125
134
|
type: "point",
|
|
126
|
-
x:
|
|
127
|
-
y:
|
|
135
|
+
x: r.lon,
|
|
136
|
+
y: r.lat
|
|
128
137
|
},
|
|
129
138
|
attributes: {
|
|
130
|
-
id: ((y =
|
|
139
|
+
id: ((y = r.devInfo) == null ? void 0 : y.deviceId) || r.key,
|
|
131
140
|
type: e.deviceType,
|
|
132
|
-
count:
|
|
141
|
+
count: r.count,
|
|
133
142
|
typeName: e.deviceType === "camera" ? "视频" : "卡口",
|
|
134
143
|
stateName: e.deviceState === "normal" ? "正常" : "异常",
|
|
135
|
-
...
|
|
144
|
+
...r.devInfo
|
|
136
145
|
}
|
|
137
146
|
});
|
|
138
|
-
return
|
|
147
|
+
return r.count > 1 ? s.symbol = {
|
|
139
148
|
type: "cim",
|
|
140
149
|
data: {
|
|
141
150
|
type: "CIMSymbolReference",
|
|
@@ -205,7 +214,7 @@ class S {
|
|
|
205
214
|
},
|
|
206
215
|
verticalAlignment: "Center"
|
|
207
216
|
},
|
|
208
|
-
textString:
|
|
217
|
+
textString: r.count.toString()
|
|
209
218
|
}
|
|
210
219
|
],
|
|
211
220
|
scaleSymbolsProportionally: !0,
|
|
@@ -260,9 +269,9 @@ class S {
|
|
|
260
269
|
]
|
|
261
270
|
}), s;
|
|
262
271
|
});
|
|
263
|
-
|
|
272
|
+
d.addMany(m);
|
|
264
273
|
}
|
|
265
274
|
}
|
|
266
275
|
export {
|
|
267
|
-
|
|
276
|
+
I as default
|
|
268
277
|
};
|
|
@@ -42,7 +42,11 @@ class w {
|
|
|
42
42
|
}), a = new c({
|
|
43
43
|
geometry: o,
|
|
44
44
|
symbol: this.getLineSymbol(!0),
|
|
45
|
-
attributes: {
|
|
45
|
+
attributes: {
|
|
46
|
+
bandId: e.bandId,
|
|
47
|
+
type: "greenWaveBand",
|
|
48
|
+
id: e.bandId
|
|
49
|
+
}
|
|
46
50
|
});
|
|
47
51
|
this.roadsectLayer.add(a), await this.view.goTo(a), e.nodeList.forEach((s) => {
|
|
48
52
|
const i = new c({
|
|
@@ -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
|
|
4
|
+
import { Multipoint as P, Polygon as C, Polyline as z, Point as T } from "@arcgis/core/geometry";
|
|
5
|
+
import * as u from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
6
6
|
import W from "@arcgis/core/layers/FeatureLayer";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
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 W({ 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 z(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.zoom, { 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: "未找到车道" };
|