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,193 @@
|
|
|
1
|
+
import c from "@arcgis/core/Graphic";
|
|
2
|
+
import { Point as y } from "@arcgis/core/geometry";
|
|
3
|
+
import p from "@arcgis/core/geometry/Polyline";
|
|
4
|
+
import * as n from "@arcgis/core/geometry/support/webMercatorUtils.js";
|
|
5
|
+
import m from "@arcgis/core/layers/GraphicsLayer";
|
|
6
|
+
import u from "./renderer/greenWaveline.mjs";
|
|
7
|
+
function h(...l) {
|
|
8
|
+
const i = {}, t = (e) => {
|
|
9
|
+
for (const r in e)
|
|
10
|
+
e.hasOwnProperty(r) && (Object.prototype.toString.call(e[r]) === "[object Object]" ? i[r] = h(i[r], e[r]) : i[r] = e[r]);
|
|
11
|
+
};
|
|
12
|
+
for (let e = 0; e < l.length; e++)
|
|
13
|
+
t(l[e]);
|
|
14
|
+
return i;
|
|
15
|
+
}
|
|
16
|
+
class d {
|
|
17
|
+
constructor(i) {
|
|
18
|
+
this.defaultAnimationOptions = {
|
|
19
|
+
isAnimation: !1,
|
|
20
|
+
positive: !0,
|
|
21
|
+
positiveColor: [0, 255, 0],
|
|
22
|
+
negative: !0,
|
|
23
|
+
negativeColor: [0, 255, 0]
|
|
24
|
+
}, this.viewer = i.viewer, this.overlayLayer = new m({
|
|
25
|
+
...i.graphicsLayerOptions
|
|
26
|
+
}), this.customGreenWaveLineView = new u({
|
|
27
|
+
graphics: []
|
|
28
|
+
}), this.viewer.map.layers.add(this.customGreenWaveLineView), this.viewer.map.layers.add(this.overlayLayer);
|
|
29
|
+
}
|
|
30
|
+
addGreenWaveLine(i, t = {
|
|
31
|
+
isAnimation: !1,
|
|
32
|
+
positive: !0,
|
|
33
|
+
positiveColor: [0, 255, 0],
|
|
34
|
+
negative: !0,
|
|
35
|
+
negativeColor: [0, 255, 0]
|
|
36
|
+
}) {
|
|
37
|
+
const e = [], r = [];
|
|
38
|
+
t = h(this.defaultAnimationOptions, t), i.map((a) => {
|
|
39
|
+
const o = a.visible == null ? !0 : a.visible;
|
|
40
|
+
if (t.isAnimation) {
|
|
41
|
+
const s = [...a.paths];
|
|
42
|
+
r.push(...this.getAnimationPath(s, t));
|
|
43
|
+
}
|
|
44
|
+
e.push(this.createLine(a.paths, a.symbol, a.attributes, o));
|
|
45
|
+
}), this.overlayLayer.addMany(e), t.isAnimation && this.customGreenWaveLineView.addMany(r);
|
|
46
|
+
}
|
|
47
|
+
getAnimationPath(i, t = {
|
|
48
|
+
isAnimation: !1,
|
|
49
|
+
positive: !0,
|
|
50
|
+
positiveColor: [0, 255, 0],
|
|
51
|
+
negative: !0,
|
|
52
|
+
negativeColor: [0, 255, 0]
|
|
53
|
+
}) {
|
|
54
|
+
const e = [];
|
|
55
|
+
return t.positive && e.push({
|
|
56
|
+
attributes: {
|
|
57
|
+
color: t.positiveColor
|
|
58
|
+
},
|
|
59
|
+
geometry: n.geographicToWebMercator({
|
|
60
|
+
//@ts-ignore
|
|
61
|
+
paths: [i],
|
|
62
|
+
type: "polyline"
|
|
63
|
+
})
|
|
64
|
+
}), t.negative && e.push({
|
|
65
|
+
attributes: {
|
|
66
|
+
color: t.negativeColor
|
|
67
|
+
},
|
|
68
|
+
geometry: n.geographicToWebMercator({
|
|
69
|
+
//@ts-ignore
|
|
70
|
+
paths: [i.reverse()],
|
|
71
|
+
type: "polyline"
|
|
72
|
+
})
|
|
73
|
+
}), e;
|
|
74
|
+
}
|
|
75
|
+
createLine(i, t, e = {}, r) {
|
|
76
|
+
const a = {
|
|
77
|
+
type: "simple-line",
|
|
78
|
+
color: [0, 0, 255, 0.5],
|
|
79
|
+
width: 2,
|
|
80
|
+
...t
|
|
81
|
+
}, o = new p({
|
|
82
|
+
paths: i
|
|
83
|
+
}), s = n.geographicToWebMercator(o);
|
|
84
|
+
return new c({
|
|
85
|
+
geometry: s,
|
|
86
|
+
// Add the geometry created in step 3
|
|
87
|
+
symbol: a,
|
|
88
|
+
// Add the symbol created in step 4
|
|
89
|
+
attributes: {
|
|
90
|
+
type: "greenWaveLine",
|
|
91
|
+
...e
|
|
92
|
+
},
|
|
93
|
+
visible: r
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
addPointText(i) {
|
|
97
|
+
const t = [];
|
|
98
|
+
i.map((e) => {
|
|
99
|
+
const r = e.visible == null ? !0 : e.visible;
|
|
100
|
+
t.push(
|
|
101
|
+
this.createPointText(e.point, e.symbol, e.attributes, r)
|
|
102
|
+
);
|
|
103
|
+
}), this.overlayLayer.addMany(t);
|
|
104
|
+
}
|
|
105
|
+
createPointText(i, t, e = {}, r) {
|
|
106
|
+
const a = {
|
|
107
|
+
type: "text",
|
|
108
|
+
// autocasts as new TextSymbol()
|
|
109
|
+
color: "white",
|
|
110
|
+
haloColor: "black",
|
|
111
|
+
haloSize: "1px",
|
|
112
|
+
xoffset: 3,
|
|
113
|
+
yoffset: 3,
|
|
114
|
+
font: {
|
|
115
|
+
size: 12,
|
|
116
|
+
family: "Josefin Slab",
|
|
117
|
+
weight: "bold"
|
|
118
|
+
},
|
|
119
|
+
...t
|
|
120
|
+
}, o = new y({
|
|
121
|
+
x: i[0],
|
|
122
|
+
y: i[1]
|
|
123
|
+
}), s = n.geographicToWebMercator(o);
|
|
124
|
+
return new c({
|
|
125
|
+
geometry: s,
|
|
126
|
+
// Add the geometry created in step 3
|
|
127
|
+
symbol: a,
|
|
128
|
+
// Add the symbol created in step 4
|
|
129
|
+
attributes: {
|
|
130
|
+
type: "greenWaveLine-Text",
|
|
131
|
+
...e
|
|
132
|
+
},
|
|
133
|
+
visible: r
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* 隐藏覆盖物
|
|
138
|
+
*
|
|
139
|
+
* @param {string[]} [ids]
|
|
140
|
+
* @memberof GreenWaveLine
|
|
141
|
+
*/
|
|
142
|
+
hideWaveLine(i) {
|
|
143
|
+
i ? this.overlayLayer.graphics.filter((e) => {
|
|
144
|
+
const r = e.getAttribute("id");
|
|
145
|
+
return i.includes(r);
|
|
146
|
+
}).forEach((e) => {
|
|
147
|
+
e.visible = !1;
|
|
148
|
+
}) : this.overlayLayer.graphics.map((t) => {
|
|
149
|
+
t.visible = !1;
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 显示覆盖物
|
|
154
|
+
*
|
|
155
|
+
* @param {string[]} [ids]
|
|
156
|
+
* @memberof GreenWaveLine
|
|
157
|
+
*/
|
|
158
|
+
showWaveLine(i) {
|
|
159
|
+
i ? this.overlayLayer.graphics.filter((e) => {
|
|
160
|
+
const r = e.getAttribute("id");
|
|
161
|
+
return i.includes(r);
|
|
162
|
+
}).forEach((e) => {
|
|
163
|
+
e.visible = !0;
|
|
164
|
+
}) : this.overlayLayer.graphics.map((t) => {
|
|
165
|
+
t.visible = !0;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* 隐藏图层
|
|
170
|
+
*
|
|
171
|
+
* @memberof GreenWaveLine
|
|
172
|
+
*/
|
|
173
|
+
hideLayer() {
|
|
174
|
+
this.overlayLayer.visible = !1, this.customGreenWaveLineView.visible = !1;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* 显示图层
|
|
178
|
+
*
|
|
179
|
+
* @memberof Overlay
|
|
180
|
+
*/
|
|
181
|
+
showLayer() {
|
|
182
|
+
this.overlayLayer.visible = !0, this.customGreenWaveLineView.visible = !0;
|
|
183
|
+
}
|
|
184
|
+
clearGreenWaveLine() {
|
|
185
|
+
this.overlayLayer.removeAll(), this.customGreenWaveLineView.removeAll();
|
|
186
|
+
}
|
|
187
|
+
destroy() {
|
|
188
|
+
this.overlayLayer.removeAll(), this.customGreenWaveLineView.removeAll(), this.viewer.map.layers.remove(this.customGreenWaveLineView), this.viewer.map.layers.remove(this.overlayLayer);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
export {
|
|
192
|
+
d as default
|
|
193
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Layer from '@arcgis/core/layers/Layer';
|
|
2
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
3
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
4
|
+
interface LayersOptions {
|
|
5
|
+
viewer: MapView | SceneView;
|
|
6
|
+
graphicsLayerOptions: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface layerDataFace {
|
|
11
|
+
url: string;
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
type: string;
|
|
16
|
+
options?: any;
|
|
17
|
+
}
|
|
18
|
+
export default class BaseLayers {
|
|
19
|
+
private viewer;
|
|
20
|
+
private layerList;
|
|
21
|
+
constructor(options: LayersOptions);
|
|
22
|
+
getLayerById(id: string): Layer | undefined;
|
|
23
|
+
getLayers(): Map<string, Layer>;
|
|
24
|
+
getTileInfo(): {};
|
|
25
|
+
addLayer(layerData: layerDataFace | layerDataFace[], index?: number): void;
|
|
26
|
+
createLayer(layerData: layerDataFace): Layer | null;
|
|
27
|
+
removeLayerById(ids: string | string[]): void;
|
|
28
|
+
hideLayerById(ids: string | string[]): void;
|
|
29
|
+
showLayerById(ids: string | string[]): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import y from "@arcgis/core/layers/GeoJSONLayer";
|
|
2
|
+
import l from "@arcgis/core/layers/TileLayer";
|
|
3
|
+
import o from "@arcgis/core/layers/WebTileLayer";
|
|
4
|
+
class f {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
this.layerList = /* @__PURE__ */ new Map(), this.viewer = e.viewer;
|
|
7
|
+
const i = this.viewer.map.findLayerById("dark-gray-base-layer");
|
|
8
|
+
i && this.layerList.set("dark-gray-base-layer", i);
|
|
9
|
+
}
|
|
10
|
+
getLayerById(e) {
|
|
11
|
+
return this.layerList.get(e);
|
|
12
|
+
}
|
|
13
|
+
getLayers() {
|
|
14
|
+
return this.layerList;
|
|
15
|
+
}
|
|
16
|
+
getTileInfo() {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
addLayer(e, i) {
|
|
20
|
+
const r = [];
|
|
21
|
+
if (Array.isArray(e))
|
|
22
|
+
e.map((t) => {
|
|
23
|
+
const s = this.createLayer(t);
|
|
24
|
+
s && (this.layerList.set(t.id, s), r.push(this.createLayer(t)));
|
|
25
|
+
});
|
|
26
|
+
else {
|
|
27
|
+
const t = this.createLayer(e);
|
|
28
|
+
if (!t)
|
|
29
|
+
return;
|
|
30
|
+
this.layerList.set(e.id, t), r.push(this.createLayer(e));
|
|
31
|
+
}
|
|
32
|
+
r.map((t) => {
|
|
33
|
+
this.viewer.map.add(t, i);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
createLayer(e) {
|
|
37
|
+
let i = null;
|
|
38
|
+
switch (e.type) {
|
|
39
|
+
case "webTile":
|
|
40
|
+
i = new o({
|
|
41
|
+
urlTemplate: e.url,
|
|
42
|
+
...e.options,
|
|
43
|
+
title: e.options.id,
|
|
44
|
+
visible: e.visible
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
case "hdLayers":
|
|
48
|
+
i = new y({
|
|
49
|
+
url: e.url,
|
|
50
|
+
...e.options,
|
|
51
|
+
title: e.options.id,
|
|
52
|
+
visible: e.visible
|
|
53
|
+
});
|
|
54
|
+
break;
|
|
55
|
+
case "tile":
|
|
56
|
+
i = new l({
|
|
57
|
+
url: e.url,
|
|
58
|
+
...e.options,
|
|
59
|
+
title: e.options.id,
|
|
60
|
+
visible: e.visible
|
|
61
|
+
});
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
return i;
|
|
65
|
+
}
|
|
66
|
+
removeLayerById(e) {
|
|
67
|
+
if (typeof e == "string") {
|
|
68
|
+
const i = this.layerList.get(e);
|
|
69
|
+
i && (this.viewer.map.remove(i), this.layerList.delete(e));
|
|
70
|
+
}
|
|
71
|
+
Array.isArray(e) && e.forEach((i) => {
|
|
72
|
+
const r = this.layerList.get(i);
|
|
73
|
+
r && (this.viewer.map.remove(r), this.layerList.delete(i));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
hideLayerById(e) {
|
|
77
|
+
if (typeof e == "string") {
|
|
78
|
+
const i = this.layerList.get(e);
|
|
79
|
+
i && (i.visible = !1);
|
|
80
|
+
}
|
|
81
|
+
Array.isArray(e) && e.forEach((i) => {
|
|
82
|
+
const r = this.layerList.get(i);
|
|
83
|
+
r && (r.visible = !1);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
showLayerById(e) {
|
|
87
|
+
if (typeof e == "string") {
|
|
88
|
+
const i = this.layerList.get(e);
|
|
89
|
+
i && (i.visible = !0);
|
|
90
|
+
}
|
|
91
|
+
Array.isArray(e) && e.forEach((i) => {
|
|
92
|
+
const r = this.layerList.get(i);
|
|
93
|
+
r && (r.visible = !0);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
f as default
|
|
99
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Point, Polygon, Polyline } from '@arcgis/core/geometry';
|
|
2
|
+
export default class CommonUtils {
|
|
3
|
+
/**
|
|
4
|
+
* 得到某个点在一定方向、距离之外的另一个点
|
|
5
|
+
* @param point
|
|
6
|
+
* @param angel
|
|
7
|
+
* @param distance
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
static destinationWithPoint(point: Point, angel: number, distance: number): Point;
|
|
11
|
+
/**
|
|
12
|
+
* 线段与正北方向夹角
|
|
13
|
+
* @param line
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
static angleOfLine(line: Polyline): number;
|
|
17
|
+
/**
|
|
18
|
+
* 在头尾两个方向上延长折线
|
|
19
|
+
* @param line
|
|
20
|
+
* @param distance
|
|
21
|
+
*/
|
|
22
|
+
static extendLineInTowDir(line: Polyline, distance: number): Polyline;
|
|
23
|
+
/**
|
|
24
|
+
* 两条线的交点
|
|
25
|
+
* @param line1
|
|
26
|
+
* @param line2
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
static getIntersectPointOfTwoLines(line1: Polyline, line2: Polyline): Promise<Point | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* 获取停止线与车道面的交点
|
|
32
|
+
* @param stopLine
|
|
33
|
+
* @param lanePolygon
|
|
34
|
+
* @param offsetDistances
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
static getIntersectPointsOfStopLineAndLane(stopLine: Polyline, lanePolygon: Polygon, offsetDistances?: number[]): Promise<number[][]>;
|
|
38
|
+
/**
|
|
39
|
+
* 两个点之间的距离
|
|
40
|
+
* @param points
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
private static pointDistance;
|
|
44
|
+
/**
|
|
45
|
+
* 线按一定距离平移之后,与面相交的两个端点
|
|
46
|
+
* @param line
|
|
47
|
+
* @param polygon
|
|
48
|
+
* @param offsetDistance 线平移的距离
|
|
49
|
+
* @returns 线面交线的头尾端点
|
|
50
|
+
*/
|
|
51
|
+
static getIntersectPointOfLineAndPolygon(line: Polyline, polygon: Polygon, offsetDistance?: number): Promise<number[][]>;
|
|
52
|
+
/**
|
|
53
|
+
* 对polyline做平移
|
|
54
|
+
* @param line
|
|
55
|
+
* @param offsetDistance
|
|
56
|
+
* @returns 平移后的polyline
|
|
57
|
+
*/
|
|
58
|
+
static getOffsetLine(line: Polyline, offsetDistance: number): Promise<Polyline>;
|
|
59
|
+
/**
|
|
60
|
+
* 解压
|
|
61
|
+
* @param key
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
static unzip(key: string): string | undefined;
|
|
65
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Point as y, Polyline as f } from "@arcgis/core/geometry";
|
|
2
|
+
import * as g from "@arcgis/core/geometry/geometryEngineAsync";
|
|
3
|
+
import * as u from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
4
|
+
import h from "@turf/bearing";
|
|
5
|
+
import p from "@turf/destination";
|
|
6
|
+
import * as a from "@turf/helpers";
|
|
7
|
+
import w from "pako";
|
|
8
|
+
class s {
|
|
9
|
+
/**
|
|
10
|
+
* 得到某个点在一定方向、距离之外的另一个点
|
|
11
|
+
* @param point
|
|
12
|
+
* @param angel
|
|
13
|
+
* @param distance
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
static destinationWithPoint(t, e, n) {
|
|
17
|
+
const i = a.point([t.x, t.y]), o = p(i, n, e, {
|
|
18
|
+
units: "meters"
|
|
19
|
+
});
|
|
20
|
+
return new y({
|
|
21
|
+
x: o.geometry.coordinates[0],
|
|
22
|
+
y: o.geometry.coordinates[1]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 线段与正北方向夹角
|
|
27
|
+
* @param line
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
static angleOfLine(t) {
|
|
31
|
+
const e = t.paths[0], n = a.point(e[0]), i = a.point(e[e.length - 1]);
|
|
32
|
+
return h(n, i);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 在头尾两个方向上延长折线
|
|
36
|
+
* @param line
|
|
37
|
+
* @param distance
|
|
38
|
+
*/
|
|
39
|
+
static extendLineInTowDir(t, e) {
|
|
40
|
+
const n = t.paths[0], i = a.point(n[0]), o = a.point(n[1]), r = h(o, i), c = p(i, e, r, {
|
|
41
|
+
units: "meters"
|
|
42
|
+
}), l = r > 0 ? r - 180 : r + 180, P = p(o, e, l, {
|
|
43
|
+
units: "meters"
|
|
44
|
+
});
|
|
45
|
+
return new f({
|
|
46
|
+
paths: [
|
|
47
|
+
[c.geometry.coordinates, P.geometry.coordinates]
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 两条线的交点
|
|
53
|
+
* @param line1
|
|
54
|
+
* @param line2
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
static async getIntersectPointOfTwoLines(t, e) {
|
|
58
|
+
const n = await g.intersectLinesToPoints(
|
|
59
|
+
t,
|
|
60
|
+
e
|
|
61
|
+
);
|
|
62
|
+
if (n.length)
|
|
63
|
+
return n[0];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 获取停止线与车道面的交点
|
|
67
|
+
* @param stopLine
|
|
68
|
+
* @param lanePolygon
|
|
69
|
+
* @param offsetDistances
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
static async getIntersectPointsOfStopLineAndLane(t, e, n) {
|
|
73
|
+
let i = await s.getIntersectPointOfLineAndPolygon(
|
|
74
|
+
t,
|
|
75
|
+
e
|
|
76
|
+
);
|
|
77
|
+
if (await s.pointDistance(i) < 3 && n) {
|
|
78
|
+
for (const o of n)
|
|
79
|
+
if (i = await s.getIntersectPointOfLineAndPolygon(
|
|
80
|
+
t,
|
|
81
|
+
e,
|
|
82
|
+
o
|
|
83
|
+
), await s.pointDistance(i) > 2.5) {
|
|
84
|
+
const r = new f({ paths: [i] });
|
|
85
|
+
return (await s.getOffsetLine(
|
|
86
|
+
r,
|
|
87
|
+
-o
|
|
88
|
+
)).paths[0];
|
|
89
|
+
}
|
|
90
|
+
} else
|
|
91
|
+
return i;
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 两个点之间的距离
|
|
96
|
+
* @param points
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
static async pointDistance(t) {
|
|
100
|
+
if (t.length < 2)
|
|
101
|
+
return 0;
|
|
102
|
+
const e = new f({ paths: [t] });
|
|
103
|
+
return await g.geodesicLength(e, "meters");
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 线按一定距离平移之后,与面相交的两个端点
|
|
107
|
+
* @param line
|
|
108
|
+
* @param polygon
|
|
109
|
+
* @param offsetDistance 线平移的距离
|
|
110
|
+
* @returns 线面交线的头尾端点
|
|
111
|
+
*/
|
|
112
|
+
static async getIntersectPointOfLineAndPolygon(t, e, n = 0) {
|
|
113
|
+
n !== 0 && (t = await s.getOffsetLine(t, n));
|
|
114
|
+
const i = await g.intersect(t, e);
|
|
115
|
+
if (i instanceof f) {
|
|
116
|
+
const o = i.paths[0], r = o[0], c = o[o.length - 1];
|
|
117
|
+
return [r, c];
|
|
118
|
+
}
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 对polyline做平移
|
|
123
|
+
* @param line
|
|
124
|
+
* @param offsetDistance
|
|
125
|
+
* @returns 平移后的polyline
|
|
126
|
+
*/
|
|
127
|
+
static async getOffsetLine(t, e) {
|
|
128
|
+
const n = u.geographicToWebMercator(t), i = await g.offset(
|
|
129
|
+
n,
|
|
130
|
+
e,
|
|
131
|
+
"meters"
|
|
132
|
+
);
|
|
133
|
+
return u.webMercatorToGeographic(
|
|
134
|
+
i,
|
|
135
|
+
!1
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 解压
|
|
140
|
+
* @param key
|
|
141
|
+
* @returns
|
|
142
|
+
*/
|
|
143
|
+
static unzip(t) {
|
|
144
|
+
try {
|
|
145
|
+
const e = [], n = t.split("");
|
|
146
|
+
for (let o = 0; o < n.length; o++) {
|
|
147
|
+
const r = n[o];
|
|
148
|
+
e.push(r.charCodeAt(0));
|
|
149
|
+
}
|
|
150
|
+
const i = new Uint8Array(e);
|
|
151
|
+
return w.inflate(i, { to: "string" });
|
|
152
|
+
} catch {
|
|
153
|
+
console.log(`非压缩内容: ${t}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
export {
|
|
158
|
+
s as default
|
|
159
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import View from '@arcgis/core/views/View';
|
|
2
|
+
export default class Index {
|
|
3
|
+
private readonly view;
|
|
4
|
+
private traceHoloFlow;
|
|
5
|
+
private signalHoloFlow;
|
|
6
|
+
constructor(view: View);
|
|
7
|
+
/**
|
|
8
|
+
* 处理全息流轨迹数据
|
|
9
|
+
* */
|
|
10
|
+
handleVehicleTraceData(data: any): void;
|
|
11
|
+
clearHoloTrace(): void;
|
|
12
|
+
updatePanelContent(contentType: string): void;
|
|
13
|
+
handleSignalData(data: any): Promise<void>;
|
|
14
|
+
clearHoloSignal(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EVehiclePlateState as l } from "../../../types/index.mjs";
|
|
2
|
+
import t from "./signal-holo-flow.mjs";
|
|
3
|
+
import i from "./trace-holo-flow.mjs";
|
|
4
|
+
class h {
|
|
5
|
+
constructor(a) {
|
|
6
|
+
this.view = a;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 处理全息流轨迹数据
|
|
10
|
+
* */
|
|
11
|
+
handleVehicleTraceData(a) {
|
|
12
|
+
this.traceHoloFlow || (this.traceHoloFlow = new i(this.view)), this.traceHoloFlow.handleVehicleTraceData(a);
|
|
13
|
+
}
|
|
14
|
+
clearHoloTrace() {
|
|
15
|
+
var a;
|
|
16
|
+
(a = this.traceHoloFlow) == null || a.clearTrace();
|
|
17
|
+
}
|
|
18
|
+
// public toggleVehiclePlate(visible: boolean): void {
|
|
19
|
+
// this.traceHoloFlow?.togglePlateLayer(visible);
|
|
20
|
+
// }
|
|
21
|
+
updatePanelContent(a) {
|
|
22
|
+
var o;
|
|
23
|
+
let e = l.None;
|
|
24
|
+
switch (a) {
|
|
25
|
+
case "none":
|
|
26
|
+
e = l.None;
|
|
27
|
+
break;
|
|
28
|
+
case "plateNumber":
|
|
29
|
+
e = l.PlateNumber;
|
|
30
|
+
break;
|
|
31
|
+
case "vehicleId":
|
|
32
|
+
e = l.Id;
|
|
33
|
+
break;
|
|
34
|
+
case "mix":
|
|
35
|
+
e = l.Mix;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
(o = this.traceHoloFlow) == null || o.updatePanelContent(e);
|
|
39
|
+
}
|
|
40
|
+
async handleSignalData(a) {
|
|
41
|
+
this.signalHoloFlow || (this.signalHoloFlow = new t(this.view)), await this.signalHoloFlow.initializeLayer(), await this.signalHoloFlow.handleSignalData(a);
|
|
42
|
+
}
|
|
43
|
+
clearHoloSignal() {
|
|
44
|
+
var a;
|
|
45
|
+
(a = this.signalHoloFlow) == null || a.clearSignal();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
h as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import View from '@arcgis/core/views/View';
|
|
2
|
+
export default class SignalHoloFlow {
|
|
3
|
+
private view;
|
|
4
|
+
private mapConfig;
|
|
5
|
+
/** 显示停止线的图层 */
|
|
6
|
+
private phaseLineLayer;
|
|
7
|
+
/** 每个路口的当前相位 */
|
|
8
|
+
private currentPhaseMap;
|
|
9
|
+
/** 每个路口倒计时canvas */
|
|
10
|
+
private countdownCanvasMap;
|
|
11
|
+
private countdownWatchHandel;
|
|
12
|
+
private lastDataTime;
|
|
13
|
+
constructor(view: View);
|
|
14
|
+
/**
|
|
15
|
+
* 初始化相位线图层
|
|
16
|
+
* */
|
|
17
|
+
initializeLayer(): Promise<void>;
|
|
18
|
+
handleSignalData(data: any): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* 清除实时信号相关图层
|
|
21
|
+
* */
|
|
22
|
+
clearSignal(): void;
|
|
23
|
+
private isDeletingCanvas;
|
|
24
|
+
/**
|
|
25
|
+
* 获取显示倒计时的canvas
|
|
26
|
+
* */
|
|
27
|
+
private updateCountdown;
|
|
28
|
+
private drawCountdownText;
|
|
29
|
+
private updatePhaseLine;
|
|
30
|
+
/**
|
|
31
|
+
* 车道是否在通道中
|
|
32
|
+
* @param laneCode 车道编码
|
|
33
|
+
* @param channels 通道列表
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
private isLaneInChannels;
|
|
37
|
+
private readonly canvasWidth;
|
|
38
|
+
private readonly canvasHeight;
|
|
39
|
+
private createCountdownCanvas;
|
|
40
|
+
}
|