gisviewer-vue3-arcgis 1.0.85
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/README.md +103 -0
- package/es/index.d.ts +8 -0
- package/es/index.mjs +16 -0
- package/es/src/components.d.ts +9 -0
- package/es/src/gis-map/gis-map.vue.d.ts +91 -0
- package/es/src/gis-map/gis-map.vue.mjs +124 -0
- package/es/src/gis-map/gis-map.vue2.mjs +4 -0
- package/es/src/gis-map/index.d.ts +81 -0
- package/es/src/gis-map/index.mjs +7 -0
- package/es/src/gis-map/stores/appData.d.ts +3 -0
- package/es/src/gis-map/stores/appData.mjs +9 -0
- package/es/src/gis-map/stores/index.d.ts +7 -0
- package/es/src/gis-map/stores/index.mjs +10 -0
- package/es/src/gis-map/style/index.css +13 -0
- package/es/src/gis-map/utils/FlyToPoints.d.ts +37 -0
- package/es/src/gis-map/utils/FlyToPoints.mjs +67 -0
- package/es/src/gis-map/utils/GreenWaveline.mjs +193 -0
- package/es/src/gis-map/utils/Layers.d.ts +31 -0
- package/es/src/gis-map/utils/Layers.mjs +99 -0
- package/es/src/gis-map/utils/common-utils.d.ts +65 -0
- package/es/src/gis-map/utils/common-utils.mjs +159 -0
- package/es/src/gis-map/utils/holo-flow/index.d.ts +15 -0
- package/es/src/gis-map/utils/holo-flow/index.mjs +50 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +40 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +209 -0
- package/es/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +69 -0
- package/es/src/gis-map/utils/holo-flow/trace-external-renderer.mjs +316 -0
- package/es/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +18 -0
- package/es/src/gis-map/utils/holo-flow/trace-holo-flow.mjs +75 -0
- package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +35 -0
- package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.mjs +286 -0
- package/es/src/gis-map/utils/index.d.ts +21 -0
- package/es/src/gis-map/utils/index.mjs +23 -0
- package/es/src/gis-map/utils/map-initializer.d.ts +50 -0
- package/es/src/gis-map/utils/map-initializer.mjs +248 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +9 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +271 -0
- package/es/src/gis-map/utils/overlay.d.ts +83 -0
- package/es/src/gis-map/utils/overlay.mjs +149 -0
- package/es/src/gis-map/utils/queue-length.d.ts +14 -0
- package/es/src/gis-map/utils/queue-length.mjs +83 -0
- package/es/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -0
- package/es/src/gis-map/utils/renderer/greenWaveline.mjs +169 -0
- package/es/src/gis-map/utils/road-config-tool/cross.d.ts +51 -0
- package/es/src/gis-map/utils/road-config-tool/cross.mjs +127 -0
- package/es/src/gis-map/utils/road-config-tool/entrance.d.ts +24 -0
- package/es/src/gis-map/utils/road-config-tool/entrance.mjs +79 -0
- package/es/src/gis-map/utils/road-config-tool/exit.d.ts +18 -0
- package/es/src/gis-map/utils/road-config-tool/exit.mjs +86 -0
- package/es/src/gis-map/utils/road-config-tool/index.d.ts +44 -0
- package/es/src/gis-map/utils/road-config-tool/index.mjs +112 -0
- package/es/src/gis-map/utils/road-config-tool/indicator-area.d.ts +22 -0
- package/es/src/gis-map/utils/road-config-tool/indicator-area.mjs +44 -0
- package/es/src/gis-map/utils/road-config-tool/lane.d.ts +21 -0
- package/es/src/gis-map/utils/road-config-tool/lane.mjs +35 -0
- package/es/src/gis-map/utils/road-config-tool/search-nearby-lanes.d.ts +62 -0
- package/es/src/gis-map/utils/road-config-tool/search-nearby-lanes.mjs +265 -0
- package/es/src/gis-map/utils/sketchView.d.ts +209 -0
- package/es/src/gis-map/utils/sketchView.mjs +516 -0
- package/es/src/gis-map/utils/sketchViewTool.d.ts +259 -0
- package/es/src/gis-map/utils/sketchViewTool.mjs +503 -0
- package/es/src/gis-map/utils/syncMapView.d.ts +43 -0
- package/es/src/gis-map/utils/syncMapView.mjs +64 -0
- package/es/src/gis-map/utils/traffic-flow.d.ts +66 -0
- package/es/src/gis-map/utils/traffic-flow.mjs +308 -0
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +4 -0
- package/es/src/types/index.d.ts +142 -0
- package/es/src/types/index.mjs +5 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +1 -0
- package/lib/src/components.d.ts +9 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +91 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -0
- package/lib/src/gis-map/gis-map.vue2.js +1 -0
- package/lib/src/gis-map/index.d.ts +81 -0
- package/lib/src/gis-map/index.js +1 -0
- package/lib/src/gis-map/stores/appData.d.ts +3 -0
- package/lib/src/gis-map/stores/appData.js +1 -0
- package/lib/src/gis-map/stores/index.d.ts +7 -0
- package/lib/src/gis-map/stores/index.js +1 -0
- package/lib/src/gis-map/style/index.css +13 -0
- package/lib/src/gis-map/utils/FlyToPoints.d.ts +37 -0
- package/lib/src/gis-map/utils/FlyToPoints.js +1 -0
- package/lib/src/gis-map/utils/GreenWaveline.js +1 -0
- package/lib/src/gis-map/utils/Layers.d.ts +31 -0
- package/lib/src/gis-map/utils/Layers.js +1 -0
- package/lib/src/gis-map/utils/common-utils.d.ts +65 -0
- package/lib/src/gis-map/utils/common-utils.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +15 -0
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +40 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +69 -0
- package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +18 -0
- package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +35 -0
- package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.js +1 -0
- package/lib/src/gis-map/utils/index.d.ts +21 -0
- package/lib/src/gis-map/utils/index.js +1 -0
- package/lib/src/gis-map/utils/map-initializer.d.ts +50 -0
- package/lib/src/gis-map/utils/map-initializer.js +1 -0
- package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +9 -0
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -0
- package/lib/src/gis-map/utils/overlay.d.ts +83 -0
- package/lib/src/gis-map/utils/overlay.js +1 -0
- package/lib/src/gis-map/utils/queue-length.d.ts +14 -0
- package/lib/src/gis-map/utils/queue-length.js +1 -0
- package/lib/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -0
- package/lib/src/gis-map/utils/renderer/greenWaveline.js +43 -0
- package/lib/src/gis-map/utils/road-config-tool/cross.d.ts +51 -0
- package/lib/src/gis-map/utils/road-config-tool/cross.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/entrance.d.ts +24 -0
- package/lib/src/gis-map/utils/road-config-tool/entrance.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/exit.d.ts +18 -0
- package/lib/src/gis-map/utils/road-config-tool/exit.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/index.d.ts +44 -0
- package/lib/src/gis-map/utils/road-config-tool/index.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/indicator-area.d.ts +22 -0
- package/lib/src/gis-map/utils/road-config-tool/indicator-area.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/lane.d.ts +21 -0
- package/lib/src/gis-map/utils/road-config-tool/lane.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/search-nearby-lanes.d.ts +62 -0
- package/lib/src/gis-map/utils/road-config-tool/search-nearby-lanes.js +1 -0
- package/lib/src/gis-map/utils/sketchView.d.ts +209 -0
- package/lib/src/gis-map/utils/sketchView.js +1 -0
- package/lib/src/gis-map/utils/sketchViewTool.d.ts +259 -0
- package/lib/src/gis-map/utils/sketchViewTool.js +1 -0
- package/lib/src/gis-map/utils/syncMapView.d.ts +43 -0
- package/lib/src/gis-map/utils/syncMapView.js +1 -0
- package/lib/src/gis-map/utils/traffic-flow.d.ts +66 -0
- package/lib/src/gis-map/utils/traffic-flow.js +1 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -0
- package/lib/src/types/index.d.ts +142 -0
- package/lib/src/types/index.js +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import h from "@arcgis/core/Graphic";
|
|
2
|
+
import m from "@arcgis/core/layers/FeatureLayer";
|
|
3
|
+
import w from "axios";
|
|
4
|
+
import f from "pako";
|
|
5
|
+
class I {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
this.view = e, this.laneLayer = new m({
|
|
8
|
+
id: "OpenDriveLane",
|
|
9
|
+
fields: [
|
|
10
|
+
{
|
|
11
|
+
name: "ObjectID",
|
|
12
|
+
alias: "ObjectID",
|
|
13
|
+
type: "oid"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "id",
|
|
17
|
+
alias: "编号",
|
|
18
|
+
type: "string"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "roadId",
|
|
22
|
+
alias: "道路号",
|
|
23
|
+
type: "string"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "roadName",
|
|
27
|
+
alias: "道路名称",
|
|
28
|
+
type: "string"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "sectionId",
|
|
32
|
+
alias: "路段号",
|
|
33
|
+
type: "string"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "laneId",
|
|
37
|
+
alias: "车道号",
|
|
38
|
+
type: "string"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "type",
|
|
42
|
+
alias: "类型",
|
|
43
|
+
type: "string"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
objectIdField: "ObjectID",
|
|
47
|
+
geometryType: "polygon",
|
|
48
|
+
spatialReference: { wkid: 4326 },
|
|
49
|
+
source: [],
|
|
50
|
+
outFields: ["*"],
|
|
51
|
+
renderer: {
|
|
52
|
+
type: "unique-value",
|
|
53
|
+
field: "type",
|
|
54
|
+
defaultSymbol: {
|
|
55
|
+
type: "simple-fill",
|
|
56
|
+
color: [100, 100, 100],
|
|
57
|
+
style: "solid",
|
|
58
|
+
outline: {
|
|
59
|
+
color: "white",
|
|
60
|
+
width: 1
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
uniqueValueInfos: [
|
|
64
|
+
{
|
|
65
|
+
value: "shoulder",
|
|
66
|
+
label: "路肩",
|
|
67
|
+
symbol: {
|
|
68
|
+
type: "simple-fill",
|
|
69
|
+
color: "#008000",
|
|
70
|
+
style: "solid",
|
|
71
|
+
outline: {
|
|
72
|
+
color: "white",
|
|
73
|
+
width: 1
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: "border",
|
|
79
|
+
label: "路沿",
|
|
80
|
+
symbol: {
|
|
81
|
+
type: "simple-fill",
|
|
82
|
+
color: "#DCDCDC",
|
|
83
|
+
style: "solid",
|
|
84
|
+
outline: {
|
|
85
|
+
color: "white",
|
|
86
|
+
width: 1
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: "driving",
|
|
92
|
+
label: "机动车道",
|
|
93
|
+
symbol: {
|
|
94
|
+
type: "simple-fill",
|
|
95
|
+
color: "#2F4F4F",
|
|
96
|
+
style: "solid",
|
|
97
|
+
outline: {
|
|
98
|
+
color: "white",
|
|
99
|
+
width: 1
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
value: "none",
|
|
105
|
+
label: "无",
|
|
106
|
+
symbol: {
|
|
107
|
+
type: "simple-fill",
|
|
108
|
+
color: [111, 120, 135],
|
|
109
|
+
style: "none",
|
|
110
|
+
outline: {
|
|
111
|
+
color: "white",
|
|
112
|
+
width: 1
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
value: "restricted",
|
|
118
|
+
label: "禁行区",
|
|
119
|
+
symbol: {
|
|
120
|
+
type: "simple-fill",
|
|
121
|
+
color: "yellow",
|
|
122
|
+
style: "solid",
|
|
123
|
+
outline: {
|
|
124
|
+
color: "yellow",
|
|
125
|
+
width: 2
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
value: "parking",
|
|
131
|
+
label: "停车区",
|
|
132
|
+
symbol: {
|
|
133
|
+
type: "simple-fill",
|
|
134
|
+
color: [115, 115, 115],
|
|
135
|
+
style: "solid",
|
|
136
|
+
outline: {
|
|
137
|
+
color: "white",
|
|
138
|
+
width: 1
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
value: "median",
|
|
144
|
+
label: "中央隔离带",
|
|
145
|
+
symbol: {
|
|
146
|
+
type: "simple-fill",
|
|
147
|
+
color: "#008000",
|
|
148
|
+
style: "solid",
|
|
149
|
+
outline: {
|
|
150
|
+
color: "white",
|
|
151
|
+
width: 1
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
value: "biking",
|
|
157
|
+
label: "非机动车道",
|
|
158
|
+
symbol: {
|
|
159
|
+
type: "simple-fill",
|
|
160
|
+
color: "#D3D3D3",
|
|
161
|
+
style: "solid",
|
|
162
|
+
outline: {
|
|
163
|
+
color: "white",
|
|
164
|
+
width: 1
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
value: "sidewalk",
|
|
170
|
+
label: "人行道",
|
|
171
|
+
symbol: {
|
|
172
|
+
type: "simple-fill",
|
|
173
|
+
color: "#C0C0C0",
|
|
174
|
+
style: "solid",
|
|
175
|
+
outline: {
|
|
176
|
+
color: "white",
|
|
177
|
+
width: 1
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
value: "junction",
|
|
183
|
+
label: "路口区域",
|
|
184
|
+
symbol: {
|
|
185
|
+
type: "simple-fill",
|
|
186
|
+
color: "#2F4F4F",
|
|
187
|
+
style: "solid",
|
|
188
|
+
outline: {
|
|
189
|
+
color: "white",
|
|
190
|
+
width: 1
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
value: "selected",
|
|
196
|
+
label: "选中车道",
|
|
197
|
+
symbol: {
|
|
198
|
+
type: "simple-fill",
|
|
199
|
+
color: [141, 168, 211],
|
|
200
|
+
style: "solid",
|
|
201
|
+
outline: {
|
|
202
|
+
color: "white",
|
|
203
|
+
width: 1
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
}), this.view.map.add(this.laneLayer);
|
|
210
|
+
}
|
|
211
|
+
async showOpenDrive(e, i) {
|
|
212
|
+
const t = `http://${e}/api/openDrive/analyzeXodr`, o = await w.get(t, {
|
|
213
|
+
headers: {
|
|
214
|
+
projectName: i
|
|
215
|
+
},
|
|
216
|
+
params: {
|
|
217
|
+
analyze: !1,
|
|
218
|
+
compressed: !0
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
if (o.status !== 200)
|
|
222
|
+
throw new Error(`OpenDriveRenderer: ${o.statusText}`);
|
|
223
|
+
let l = o.data.result.json;
|
|
224
|
+
l.startsWith("http") || (l = `http://${e}${l}`);
|
|
225
|
+
const r = await (await fetch(l)).arrayBuffer(), n = f.inflate(r, { to: "string" }), a = JSON.parse(n);
|
|
226
|
+
this.showRoad(a);
|
|
227
|
+
}
|
|
228
|
+
async showRoad(e) {
|
|
229
|
+
const i = await this.laneLayer.queryFeatures();
|
|
230
|
+
i.features.length > 0 && this.laneLayer.applyEdits({
|
|
231
|
+
deleteFeatures: i.features
|
|
232
|
+
});
|
|
233
|
+
for (const t of e) {
|
|
234
|
+
const o = t.id, l = [];
|
|
235
|
+
for (const s of t.laneSections) {
|
|
236
|
+
const r = s.id;
|
|
237
|
+
for (const n of s.lanePaths) {
|
|
238
|
+
const { id: a, type: y, innerPath: d, outerPath: c } = n, p = d.concat(c.reverse());
|
|
239
|
+
p.push(d[0]);
|
|
240
|
+
const u = new h({
|
|
241
|
+
geometry: {
|
|
242
|
+
type: "polygon",
|
|
243
|
+
rings: [p]
|
|
244
|
+
},
|
|
245
|
+
attributes: {
|
|
246
|
+
id: a,
|
|
247
|
+
roadId: o,
|
|
248
|
+
roadName: t.name,
|
|
249
|
+
sectionId: r,
|
|
250
|
+
laneId: a,
|
|
251
|
+
type: y
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
l.push(u);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
await this.laneLayer.applyEdits({
|
|
258
|
+
addFeatures: l
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
async hideOpenDrive() {
|
|
263
|
+
const e = await this.laneLayer.queryFeatures();
|
|
264
|
+
e.features.length > 0 && this.laneLayer.applyEdits({
|
|
265
|
+
deleteFeatures: e.features
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
export {
|
|
270
|
+
I as default
|
|
271
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Graphic from '@arcgis/core/Graphic';
|
|
2
|
+
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
3
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
4
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
5
|
+
import { IOverlay, IOverlayParam, IPointSymbol, IResult } from '../../types';
|
|
6
|
+
interface IOverlayOptions {
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export default class Overlay {
|
|
10
|
+
private view;
|
|
11
|
+
overlayLayer: GraphicsLayer;
|
|
12
|
+
constructor(view: MapView | SceneView, options?: IOverlayOptions);
|
|
13
|
+
private defaultPointSymbol;
|
|
14
|
+
/**
|
|
15
|
+
* 添加覆盖物
|
|
16
|
+
* @param params
|
|
17
|
+
*/
|
|
18
|
+
addOverlays(params: IOverlayParam): IResult;
|
|
19
|
+
/**
|
|
20
|
+
* 按type移除覆盖物
|
|
21
|
+
* @param types
|
|
22
|
+
*/
|
|
23
|
+
removeOverlaysByType(types: string[]): IResult;
|
|
24
|
+
/**
|
|
25
|
+
* 按id移除覆盖物
|
|
26
|
+
* @param ids
|
|
27
|
+
*/
|
|
28
|
+
removeOverlaysById(ids: string[]): IResult;
|
|
29
|
+
/**
|
|
30
|
+
* 按id显示或隐藏覆盖物
|
|
31
|
+
* @param ids
|
|
32
|
+
* @param isShow
|
|
33
|
+
*/
|
|
34
|
+
isShowOverlaysByIds(ids: string[], isShow: boolean): void;
|
|
35
|
+
/**
|
|
36
|
+
* 显示全部覆盖物
|
|
37
|
+
*
|
|
38
|
+
* @memberof Overlay
|
|
39
|
+
*/
|
|
40
|
+
showAllOverlays(): void;
|
|
41
|
+
/**
|
|
42
|
+
* 删除全部覆盖物
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
removeAllOverlays(): IResult;
|
|
46
|
+
/**
|
|
47
|
+
* 销毁
|
|
48
|
+
*
|
|
49
|
+
* @memberof Overlay
|
|
50
|
+
*/
|
|
51
|
+
destroy(): void;
|
|
52
|
+
removeGraphics(graphics: Graphic | Graphic[]): void;
|
|
53
|
+
/**
|
|
54
|
+
* 查找当前点击是否有覆盖物在当前图层
|
|
55
|
+
*
|
|
56
|
+
* @param {((MouseEvent | __esri.MapViewScreenPoint) &
|
|
57
|
+
* (__esri.SceneViewScreenPoint | MouseEvent))} event
|
|
58
|
+
* @returns
|
|
59
|
+
* @memberof Overlay
|
|
60
|
+
*/
|
|
61
|
+
findGraphic(event: (MouseEvent | __esri.MapViewScreenPoint) & (__esri.SceneViewScreenPoint | MouseEvent)): Promise<__esri.ViewHit[]>;
|
|
62
|
+
/**
|
|
63
|
+
* 隐藏图层
|
|
64
|
+
*
|
|
65
|
+
* @memberof Overlay
|
|
66
|
+
*/
|
|
67
|
+
hideLayer(): void;
|
|
68
|
+
/**
|
|
69
|
+
* 显示图层
|
|
70
|
+
*
|
|
71
|
+
* @memberof Overlay
|
|
72
|
+
*/
|
|
73
|
+
showLayer(): void;
|
|
74
|
+
/**
|
|
75
|
+
* 添加点覆盖物
|
|
76
|
+
* @param overlay
|
|
77
|
+
* @param symbol
|
|
78
|
+
* @param properties
|
|
79
|
+
*/
|
|
80
|
+
addPoint(overlay: IOverlay, symbol: IPointSymbol, properties: any, visible?: boolean): IResult;
|
|
81
|
+
private addOverlay;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import o from "@arcgis/core/Graphic";
|
|
2
|
+
import l from "@arcgis/core/layers/GraphicsLayer";
|
|
3
|
+
class v {
|
|
4
|
+
constructor(r, s) {
|
|
5
|
+
this.defaultPointSymbol = {
|
|
6
|
+
type: "simple-marker",
|
|
7
|
+
style: "circle",
|
|
8
|
+
color: "yellow",
|
|
9
|
+
size: 10
|
|
10
|
+
}, this.view = r, this.overlayLayer = new l({
|
|
11
|
+
...s
|
|
12
|
+
}), this.view.map.layers.add(this.overlayLayer);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 添加覆盖物
|
|
16
|
+
* @param params
|
|
17
|
+
*/
|
|
18
|
+
addOverlays(r) {
|
|
19
|
+
let s = 0, i = 0;
|
|
20
|
+
for (const e of r.overlays) {
|
|
21
|
+
e.properties ? (e.properties.type || (e.properties.type = r.type), e.properties.id || (e.properties.id = e.id)) : e.properties = { type: r.type, id: e.id };
|
|
22
|
+
const t = e.symbol || r.defaultSymbol || this.defaultPointSymbol;
|
|
23
|
+
this.addOverlay(
|
|
24
|
+
e,
|
|
25
|
+
t,
|
|
26
|
+
e.properties,
|
|
27
|
+
e.visible
|
|
28
|
+
).message === "add" ? s++ : i++;
|
|
29
|
+
}
|
|
30
|
+
return { status: 0, message: `新增${s}, 更新${i}` };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 按type移除覆盖物
|
|
34
|
+
* @param types
|
|
35
|
+
*/
|
|
36
|
+
removeOverlaysByType(r) {
|
|
37
|
+
const s = this.overlayLayer.graphics.filter((i) => {
|
|
38
|
+
const e = i.getAttribute("type");
|
|
39
|
+
return r.includes(e);
|
|
40
|
+
});
|
|
41
|
+
return this.overlayLayer.graphics.removeMany(s), { status: 0, message: `删除${s.length}` };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 按id移除覆盖物
|
|
45
|
+
* @param ids
|
|
46
|
+
*/
|
|
47
|
+
removeOverlaysById(r) {
|
|
48
|
+
const s = this.overlayLayer.graphics.filter((i) => {
|
|
49
|
+
const e = i.getAttribute("id");
|
|
50
|
+
return r.includes(e);
|
|
51
|
+
});
|
|
52
|
+
return this.overlayLayer.graphics.removeMany(s), { status: 0, message: `删除${s.length}` };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 按id显示或隐藏覆盖物
|
|
56
|
+
* @param ids
|
|
57
|
+
* @param isShow
|
|
58
|
+
*/
|
|
59
|
+
isShowOverlaysByIds(r, s) {
|
|
60
|
+
this.overlayLayer.graphics.map((i) => {
|
|
61
|
+
const e = i.getAttribute("id");
|
|
62
|
+
r.includes(e) ? i.visible = s : i.visible = !s;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 显示全部覆盖物
|
|
67
|
+
*
|
|
68
|
+
* @memberof Overlay
|
|
69
|
+
*/
|
|
70
|
+
showAllOverlays() {
|
|
71
|
+
this.overlayLayer.graphics.forEach((r) => {
|
|
72
|
+
r.visible = !0;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 删除全部覆盖物
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
removeAllOverlays() {
|
|
80
|
+
const r = this.overlayLayer.graphics.length;
|
|
81
|
+
return this.overlayLayer.removeAll(), { status: 0, message: `删除${r}` };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 销毁
|
|
85
|
+
*
|
|
86
|
+
* @memberof Overlay
|
|
87
|
+
*/
|
|
88
|
+
destroy() {
|
|
89
|
+
this.view.map.remove(this.overlayLayer), this.overlayLayer.destroy();
|
|
90
|
+
}
|
|
91
|
+
removeGraphics(r) {
|
|
92
|
+
Array.isArray(r) || (r = [r]), this.overlayLayer.graphics.removeMany(r);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 查找当前点击是否有覆盖物在当前图层
|
|
96
|
+
*
|
|
97
|
+
* @param {((MouseEvent | __esri.MapViewScreenPoint) &
|
|
98
|
+
* (__esri.SceneViewScreenPoint | MouseEvent))} event
|
|
99
|
+
* @returns
|
|
100
|
+
* @memberof Overlay
|
|
101
|
+
*/
|
|
102
|
+
async findGraphic(r) {
|
|
103
|
+
var e;
|
|
104
|
+
return (e = (await this.view.hitTest(r)).results) == null ? void 0 : e.filter(
|
|
105
|
+
(t) => t.type === "graphic" && t.graphic.layer === this.overlayLayer
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 隐藏图层
|
|
110
|
+
*
|
|
111
|
+
* @memberof Overlay
|
|
112
|
+
*/
|
|
113
|
+
hideLayer() {
|
|
114
|
+
this.overlayLayer.visible = !1;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 显示图层
|
|
118
|
+
*
|
|
119
|
+
* @memberof Overlay
|
|
120
|
+
*/
|
|
121
|
+
showLayer() {
|
|
122
|
+
this.overlayLayer.visible = !0;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* 添加点覆盖物
|
|
126
|
+
* @param overlay
|
|
127
|
+
* @param symbol
|
|
128
|
+
* @param properties
|
|
129
|
+
*/
|
|
130
|
+
addPoint(r, s, i, e) {
|
|
131
|
+
let t, a = !0;
|
|
132
|
+
return r.id && (t = this.overlayLayer.graphics.find(
|
|
133
|
+
(y) => y.getAttribute("id") === r.id
|
|
134
|
+
)), t ? t.visible = e ?? t.visible : (e = e ?? !0, t = new o({
|
|
135
|
+
visible: e
|
|
136
|
+
}), this.overlayLayer.add(t), a = !1), t.geometry = r.geometry, t.symbol = s, t.attributes = i, { status: 0, message: a ? "add" : "update" };
|
|
137
|
+
}
|
|
138
|
+
addOverlay(r, s, i, e) {
|
|
139
|
+
let t, a = !0;
|
|
140
|
+
return r.id && (t = this.overlayLayer.graphics.find(
|
|
141
|
+
(y) => y.getAttribute("id") === r.id
|
|
142
|
+
)), t ? t.visible = e ?? t.visible : (e = e ?? !0, t = new o({
|
|
143
|
+
visible: e
|
|
144
|
+
}), this.overlayLayer.add(t), a = !1), t.geometry = r.geometry, t.symbol = s, t.attributes = i, { status: 0, message: a ? "add" : "update" };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export {
|
|
148
|
+
v as default
|
|
149
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import View from '@arcgis/core/views/View';
|
|
2
|
+
import { IQueueLengthParams } from '../../types';
|
|
3
|
+
export default class QueueLength {
|
|
4
|
+
private view;
|
|
5
|
+
private mapConfig;
|
|
6
|
+
private readonly queueLengthLayer;
|
|
7
|
+
private initialized;
|
|
8
|
+
private lanePolygonMap;
|
|
9
|
+
constructor(view: View);
|
|
10
|
+
private initializeLaneGraphic;
|
|
11
|
+
updateQueueLength(params: IQueueLengthParams[]): Promise<void>;
|
|
12
|
+
removeQueueLength(): void;
|
|
13
|
+
private generateQueuePolygon;
|
|
14
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import L from "../stores/index.mjs";
|
|
2
|
+
import d from "@arcgis/core/layers/GraphicsLayer";
|
|
3
|
+
import * as u from "@turf/helpers";
|
|
4
|
+
import C from "@turf/destination";
|
|
5
|
+
import q from "@arcgis/core/Graphic";
|
|
6
|
+
import P from "@turf/intersect";
|
|
7
|
+
import w from "@turf/buffer";
|
|
8
|
+
import h from "@turf/area";
|
|
9
|
+
class $ {
|
|
10
|
+
constructor(e) {
|
|
11
|
+
this.initialized = !1, this.lanePolygonMap = /* @__PURE__ */ new Map(), this.view = e;
|
|
12
|
+
const t = L.useAppDataStore;
|
|
13
|
+
this.mapConfig = JSON.parse(JSON.stringify(t.mapConfig)), this.queueLengthLayer = new d(), this.view.map.add(this.queueLengthLayer);
|
|
14
|
+
}
|
|
15
|
+
async initializeLaneGraphic() {
|
|
16
|
+
if (!this.mapConfig.lanePolygonLayer)
|
|
17
|
+
return;
|
|
18
|
+
const e = `${this.mapConfig.assetsRoot}/${this.mapConfig.lanePolygonLayer}`, n = await (await fetch(e)).json(), { features: i } = n;
|
|
19
|
+
i.forEach((r) => {
|
|
20
|
+
const { properties: o, geometry: s } = r, p = u.polygon(s.coordinates, {
|
|
21
|
+
code: o.code,
|
|
22
|
+
laneDirection: o.laneDirection,
|
|
23
|
+
stopLineCenter: o.stopLineCenter
|
|
24
|
+
});
|
|
25
|
+
this.lanePolygonMap.set(o.code, p);
|
|
26
|
+
}), this.initialized = !0;
|
|
27
|
+
}
|
|
28
|
+
async updateQueueLength(e) {
|
|
29
|
+
if (this.initialized || await this.initializeLaneGraphic(), this.lanePolygonMap.size !== 0)
|
|
30
|
+
for (const t of e) {
|
|
31
|
+
const n = String(t.laneId), i = `${t.crossNo}+${n[0]}+${n[1]}`, r = this.lanePolygonMap.get(i);
|
|
32
|
+
if (!r)
|
|
33
|
+
continue;
|
|
34
|
+
const o = this.queueLengthLayer.graphics.find(
|
|
35
|
+
(s) => s.getAttribute("code") === i
|
|
36
|
+
);
|
|
37
|
+
o && this.queueLengthLayer.remove(o), t.queueLength !== 0 && this.generateQueuePolygon(r, t.queueLength);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
removeQueueLength() {
|
|
41
|
+
this.queueLengthLayer.removeAll();
|
|
42
|
+
}
|
|
43
|
+
generateQueuePolygon(e, t) {
|
|
44
|
+
const n = e.properties.laneDirection, i = JSON.parse(
|
|
45
|
+
e.properties.stopLineCenter
|
|
46
|
+
), r = u.point(i), o = n > 0 ? n - 180 : n + 180, s = C(r, t, o, {
|
|
47
|
+
units: "meters"
|
|
48
|
+
}), p = u.lineString([
|
|
49
|
+
i,
|
|
50
|
+
s.geometry.coordinates
|
|
51
|
+
]), g = w(p, 10, { units: "meters" }), a = P(e, g);
|
|
52
|
+
if (!a)
|
|
53
|
+
return;
|
|
54
|
+
const f = h(a.geometry), m = h(e), l = f / m, c = l > 0.8 ? [139, 0, 0, 0.6] : l > 0.6 ? [255, 165, 0, 0.5] : [46, 139, 87, 0.5], y = new q({
|
|
55
|
+
geometry: {
|
|
56
|
+
type: "polygon",
|
|
57
|
+
rings: a == null ? void 0 : a.geometry.coordinates
|
|
58
|
+
},
|
|
59
|
+
symbol: {
|
|
60
|
+
type: "polygon-3d",
|
|
61
|
+
symbolLayers: [
|
|
62
|
+
{
|
|
63
|
+
type: "fill",
|
|
64
|
+
material: {
|
|
65
|
+
color: c
|
|
66
|
+
},
|
|
67
|
+
outline: {
|
|
68
|
+
color: [c[0], c[1], c[2]],
|
|
69
|
+
size: 3
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
attributes: {
|
|
75
|
+
code: e.properties.code
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
this.queueLengthLayer.add(y);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
$ as default
|
|
83
|
+
};
|