gisviewer-vue3-arcgis 1.0.213 → 1.0.215
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/utils/holo-flow/signal-holo-flow-lsr.mjs +15 -8
- package/es/src/gis-map/utils/map-initializer.mjs +77 -71
- package/es/src/gis-map/utils/signal-control-area-controller/layer-symbol.d.ts +7 -0
- package/es/src/gis-map/utils/signal-control-area-controller/layer-symbol.mjs +895 -0
- package/es/src/gis-map/utils/signal-control-area-controller/show-area.d.ts +11 -3
- package/es/src/gis-map/utils/signal-control-area-controller/show-area.mjs +233 -899
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/layer-symbol.d.ts +7 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/layer-symbol.js +1 -0
- package/lib/src/gis-map/utils/signal-control-area-controller/show-area.d.ts +11 -3
- package/lib/src/gis-map/utils/signal-control-area-controller/show-area.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as u from "@arcgis/core/core/reactiveUtils";
|
|
2
2
|
import { Point as f } from "@arcgis/core/geometry";
|
|
3
3
|
import * as d from "@arcgis/core/geometry/support/webMercatorUtils.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
class
|
|
4
|
+
import y from "@arcgis/core/layers/GraphicsLayer";
|
|
5
|
+
import L from "./signal-holo-flow.mjs";
|
|
6
|
+
class x extends L {
|
|
7
7
|
constructor(n, s) {
|
|
8
|
-
super(n), this.stopLineLayer = new
|
|
8
|
+
super(n), this.stopLineLayer = new y(), this.watchHandle = null, this.stopLineMap = /* @__PURE__ */ new Map(), this.countdownPanelProps = s, this.view.map.add(this.stopLineLayer);
|
|
9
9
|
}
|
|
10
10
|
async initializeLayer() {
|
|
11
11
|
var p, l;
|
|
@@ -14,7 +14,14 @@ class M extends m {
|
|
|
14
14
|
if (!n)
|
|
15
15
|
return;
|
|
16
16
|
n = this.mapConfig.assetsRoot + "/" + n, (await (await fetch(n)).json()).features.forEach((t) => {
|
|
17
|
-
const { roadId: o, nodeId: e, angle: a
|
|
17
|
+
const { roadId: o, nodeId: e, angle: a } = t.properties;
|
|
18
|
+
let { destinationPoint: i } = t.properties;
|
|
19
|
+
const { coordinates: r } = t.geometry;
|
|
20
|
+
if (!i) {
|
|
21
|
+
const w = r[0], P = r[r.length - 1], m = (w[0] + P[0]) / 2, g = (w[1] + P[1]) / 2;
|
|
22
|
+
i = [m, g];
|
|
23
|
+
}
|
|
24
|
+
const h = this.stopLineMap.get(e);
|
|
18
25
|
h ? h.set(o, {
|
|
19
26
|
coord: r,
|
|
20
27
|
panelPoint: i,
|
|
@@ -36,7 +43,7 @@ class M extends m {
|
|
|
36
43
|
return n < 1e3 ? s = 1 : n < 2e3 ? s = 0.8 : n < 4e3 ? s = 0.4 : s = 0, s;
|
|
37
44
|
}
|
|
38
45
|
async handleSignalData(n) {
|
|
39
|
-
this.watchHandle || (this.watchHandle =
|
|
46
|
+
this.watchHandle || (this.watchHandle = u.watch(
|
|
40
47
|
() => this.view.extent,
|
|
41
48
|
() => {
|
|
42
49
|
const t = this.getPanelScale();
|
|
@@ -148,5 +155,5 @@ class M extends m {
|
|
|
148
155
|
}
|
|
149
156
|
}
|
|
150
157
|
export {
|
|
151
|
-
|
|
158
|
+
x as default
|
|
152
159
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import C from "@arcgis/core/Basemap";
|
|
2
2
|
import d from "@arcgis/core/config";
|
|
3
3
|
import * as k from "@arcgis/core/core/reactiveUtils";
|
|
4
|
-
import { Polygon as
|
|
4
|
+
import { Polygon as L, Polyline as W, Point as P } from "@arcgis/core/geometry";
|
|
5
5
|
import * as w from "@arcgis/core/geometry/support/webMercatorUtils";
|
|
6
|
-
import
|
|
7
|
-
import x from "@arcgis/core/layers/
|
|
8
|
-
import I from "@arcgis/core/layers/
|
|
9
|
-
import R from "@arcgis/core/layers/
|
|
10
|
-
import H from "@arcgis/core/
|
|
11
|
-
import G from "@arcgis/core/
|
|
12
|
-
import O from "@arcgis/core/views/
|
|
13
|
-
import S from "@
|
|
14
|
-
import
|
|
15
|
-
import N from "
|
|
6
|
+
import z from "@arcgis/core/layers/FeatureLayer";
|
|
7
|
+
import x from "@arcgis/core/layers/GeoJSONLayer";
|
|
8
|
+
import I from "@arcgis/core/layers/MapImageLayer";
|
|
9
|
+
import R from "@arcgis/core/layers/TileLayer";
|
|
10
|
+
import H from "@arcgis/core/layers/WebTileLayer";
|
|
11
|
+
import G from "@arcgis/core/Map";
|
|
12
|
+
import O from "@arcgis/core/views/MapView";
|
|
13
|
+
import S from "@arcgis/core/views/SceneView";
|
|
14
|
+
import B from "@turf/destination";
|
|
15
|
+
import * as N from "@turf/helpers";
|
|
16
|
+
import E from "./custom-layer/custom-wmts-layer.mjs";
|
|
16
17
|
function T(h, t) {
|
|
17
18
|
return h && (h.startsWith("http://") || h.startsWith("https://") ? h : t + h);
|
|
18
19
|
}
|
|
19
|
-
class
|
|
20
|
+
class X {
|
|
20
21
|
constructor() {
|
|
21
22
|
this.mapConfig = {}, this.watchHandleMap = /* @__PURE__ */ new Map(), this.handleIndex = 0, this.zoomWatchHandle = null;
|
|
22
23
|
}
|
|
@@ -28,17 +29,17 @@ class Z {
|
|
|
28
29
|
async initialize(t) {
|
|
29
30
|
var p, u, b, v;
|
|
30
31
|
this.mapConfig = t.mapConfig;
|
|
31
|
-
const { container: i, markerClickCallback: o, mapClickCallback:
|
|
32
|
+
const { container: i, markerClickCallback: o, mapClickCallback: r } = t;
|
|
32
33
|
d.assetsPath = `${this.mapConfig.assetsRoot}/ArcgisAssets`, d.fontsUrl = `${this.mapConfig.assetsRoot}/fonts`, d.apiKey = "AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";
|
|
33
|
-
const
|
|
34
|
-
if (((p = this.mapConfig) == null ? void 0 : p.mapOptions.mode.toLowerCase()) === "2d" ? (this.view = new
|
|
35
|
-
map:
|
|
34
|
+
const s = new G();
|
|
35
|
+
if (((p = this.mapConfig) == null ? void 0 : p.mapOptions.mode.toLowerCase()) === "2d" ? (this.view = new O({
|
|
36
|
+
map: s,
|
|
36
37
|
container: i,
|
|
37
38
|
...this.mapConfig.mapOptions
|
|
38
39
|
}), this.view.on("drag", (e) => {
|
|
39
40
|
e.button === 2 && e.stopPropagation();
|
|
40
|
-
})) : this.view = new
|
|
41
|
-
map:
|
|
41
|
+
})) : this.view = new S({
|
|
42
|
+
map: s,
|
|
42
43
|
container: i,
|
|
43
44
|
environment: {
|
|
44
45
|
atmosphereEnabled: !0,
|
|
@@ -50,53 +51,53 @@ class Z {
|
|
|
50
51
|
}), this.view.popup.visibleElements = {
|
|
51
52
|
closeButton: !0,
|
|
52
53
|
collapseButton: !1,
|
|
53
|
-
actionBar: !
|
|
54
|
+
actionBar: !1,
|
|
54
55
|
featureNavigation: !0
|
|
55
56
|
}, this.view.popup.dockOptions = {
|
|
56
57
|
buttonEnabled: !1,
|
|
57
58
|
breakpoint: !1
|
|
58
59
|
}, this.view.on("click", async (e) => {
|
|
59
60
|
var y, M;
|
|
60
|
-
if (
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)),
|
|
65
|
-
[
|
|
61
|
+
if (r) {
|
|
62
|
+
let a = e.mapPoint;
|
|
63
|
+
a.spatialReference.isWebMercator && (a = w.webMercatorToGeographic(
|
|
64
|
+
a
|
|
65
|
+
)), r(
|
|
66
|
+
[a.x, a.y],
|
|
66
67
|
[e.screenPoint.x, e.screenPoint.y],
|
|
67
68
|
e
|
|
68
69
|
);
|
|
69
70
|
}
|
|
70
71
|
if (this.view.type === "3d") {
|
|
71
|
-
const
|
|
72
|
+
const a = this.view.camera;
|
|
72
73
|
if (this.view.spatialReference.isWebMercator) {
|
|
73
74
|
const m = w.webMercatorToGeographic(
|
|
74
|
-
|
|
75
|
+
a.position
|
|
75
76
|
), f = {
|
|
76
|
-
heading:
|
|
77
|
-
tilt:
|
|
77
|
+
heading: a.heading,
|
|
78
|
+
tilt: a.tilt,
|
|
78
79
|
position: m.toJSON()
|
|
79
80
|
};
|
|
80
81
|
console.log(f), (y = navigator.clipboard) == null || y.writeText(JSON.stringify(f));
|
|
81
82
|
} else
|
|
82
|
-
console.log(
|
|
83
|
+
console.log(a.toJSON());
|
|
83
84
|
console.log(this.view.zoom, this.view.scale);
|
|
84
85
|
} else {
|
|
85
|
-
let
|
|
86
|
-
this.view.spatialReference.isWebMercator && (
|
|
87
|
-
|
|
86
|
+
let a = this.view.center;
|
|
87
|
+
this.view.spatialReference.isWebMercator && (a = w.webMercatorToGeographic(
|
|
88
|
+
a
|
|
88
89
|
)), console.log({
|
|
89
|
-
center:
|
|
90
|
+
center: a.toJSON(),
|
|
90
91
|
zoom: this.view.zoom,
|
|
91
92
|
scale: this.view.scale
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
|
-
const
|
|
95
|
-
(
|
|
95
|
+
const n = (M = (await this.view.hitTest(e)).results) == null ? void 0 : M.filter(
|
|
96
|
+
(a) => a.type === "graphic"
|
|
96
97
|
);
|
|
97
|
-
|
|
98
|
+
n.length > 0 && n.forEach((a) => {
|
|
98
99
|
var f;
|
|
99
|
-
const m =
|
|
100
|
+
const m = a.graphic;
|
|
100
101
|
(f = m.attributes) != null && f.type && o && o(
|
|
101
102
|
m.attributes.type,
|
|
102
103
|
m.attributes.id,
|
|
@@ -108,44 +109,49 @@ class Z {
|
|
|
108
109
|
const c = T(e.url, this.mapConfig.assetsRoot);
|
|
109
110
|
switch (e.type.toLowerCase()) {
|
|
110
111
|
case "webTile".toLowerCase(): {
|
|
111
|
-
const
|
|
112
|
+
const n = new H({
|
|
112
113
|
urlTemplate: c,
|
|
113
114
|
...e.options
|
|
114
115
|
});
|
|
115
|
-
|
|
116
|
+
s.add(n);
|
|
116
117
|
break;
|
|
117
118
|
}
|
|
118
119
|
case "tile": {
|
|
119
|
-
const
|
|
120
|
+
const n = new R({
|
|
120
121
|
url: c,
|
|
121
122
|
...e.options
|
|
122
123
|
});
|
|
123
|
-
|
|
124
|
+
s.add(n);
|
|
124
125
|
break;
|
|
125
126
|
}
|
|
126
127
|
case "customWMTS".toLowerCase(): {
|
|
127
|
-
const
|
|
128
|
+
const n = new E({
|
|
128
129
|
urlTemplate: c,
|
|
129
130
|
...e.options
|
|
130
131
|
});
|
|
131
|
-
|
|
132
|
+
s.add(n);
|
|
132
133
|
break;
|
|
133
134
|
}
|
|
134
135
|
case "mapImage".toLowerCase(): {
|
|
135
|
-
const
|
|
136
|
+
const n = new I({
|
|
136
137
|
url: c,
|
|
137
138
|
...e.options
|
|
138
139
|
});
|
|
139
|
-
|
|
140
|
+
s.add(n);
|
|
140
141
|
break;
|
|
141
142
|
}
|
|
142
143
|
case "arcgis": {
|
|
143
|
-
const
|
|
144
|
-
|
|
144
|
+
const n = new C(e.options);
|
|
145
|
+
s.basemap = n;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case "feature": {
|
|
149
|
+
const n = new z({ url: c, ...e.options });
|
|
150
|
+
s.add(n);
|
|
145
151
|
break;
|
|
146
152
|
}
|
|
147
153
|
}
|
|
148
|
-
}) :
|
|
154
|
+
}) : s.basemap = new C({
|
|
149
155
|
style: {
|
|
150
156
|
id: "arcgis/light-gray",
|
|
151
157
|
language: "zh-CN"
|
|
@@ -154,14 +160,14 @@ class Z {
|
|
|
154
160
|
const e = this.mapConfig.hdLayers.map(
|
|
155
161
|
(c) => (
|
|
156
162
|
// 图层文件为GeoJson格式, renderer和symbol使用autocast配置
|
|
157
|
-
new
|
|
163
|
+
new x({
|
|
158
164
|
url: T(c.url, this.mapConfig.assetsRoot),
|
|
159
165
|
...c.options,
|
|
160
166
|
title: c.options.id
|
|
161
167
|
})
|
|
162
168
|
)
|
|
163
169
|
);
|
|
164
|
-
|
|
170
|
+
s.addMany(e);
|
|
165
171
|
}
|
|
166
172
|
this.view.ui.remove("attribution"), await this.view.when();
|
|
167
173
|
const g = this.mapConfig.camera;
|
|
@@ -184,8 +190,8 @@ class Z {
|
|
|
184
190
|
return g ? g.home = l : this.mapConfig.camera = { home: l }, this.view;
|
|
185
191
|
}
|
|
186
192
|
setLayerVisibility(t) {
|
|
187
|
-
const { id: i, visible: o } = t,
|
|
188
|
-
return
|
|
193
|
+
const { id: i, visible: o } = t, r = this.view.map.findLayerById(i);
|
|
194
|
+
return r ? (r.visible = o, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
|
|
189
195
|
}
|
|
190
196
|
/**
|
|
191
197
|
* 设置地图中心点
|
|
@@ -202,10 +208,10 @@ class Z {
|
|
|
202
208
|
t.target = new P(t.target);
|
|
203
209
|
break;
|
|
204
210
|
case "polyline":
|
|
205
|
-
t.target = new
|
|
211
|
+
t.target = new W(t.target);
|
|
206
212
|
break;
|
|
207
213
|
case "polygon":
|
|
208
|
-
t.target = new
|
|
214
|
+
t.target = new L(t.target);
|
|
209
215
|
break;
|
|
210
216
|
}
|
|
211
217
|
await this.view.goTo(t, { duration: (t.duration || 0) * 1e3 });
|
|
@@ -233,9 +239,9 @@ class Z {
|
|
|
233
239
|
{ duration: (t.duration || 2) * 1e3 }
|
|
234
240
|
);
|
|
235
241
|
else {
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
const r = Math.tan(i * Math.PI / 180) * t.height, s = B(
|
|
243
|
+
N.point(t.center),
|
|
244
|
+
r,
|
|
239
245
|
o + 180,
|
|
240
246
|
{
|
|
241
247
|
units: "meters"
|
|
@@ -244,8 +250,8 @@ class Z {
|
|
|
244
250
|
await this.view.goTo(
|
|
245
251
|
{
|
|
246
252
|
position: {
|
|
247
|
-
x:
|
|
248
|
-
y:
|
|
253
|
+
x: s.geometry.coordinates[0],
|
|
254
|
+
y: s.geometry.coordinates[1],
|
|
249
255
|
z: t.height
|
|
250
256
|
},
|
|
251
257
|
heading: o,
|
|
@@ -258,22 +264,22 @@ class Z {
|
|
|
258
264
|
async setMapCamera(t) {
|
|
259
265
|
if (!this.view)
|
|
260
266
|
return { status: -1, message: "未初始化" };
|
|
261
|
-
const { name: i, duration: o = 0 } = t, { camera:
|
|
262
|
-
if (!
|
|
267
|
+
const { name: i, duration: o = 0 } = t, { camera: r } = this.mapConfig;
|
|
268
|
+
if (!r)
|
|
263
269
|
return { status: -1, message: "未配置camera" };
|
|
264
|
-
const
|
|
265
|
-
return
|
|
270
|
+
const s = r[i];
|
|
271
|
+
return s ? (await this.view.goTo(s, { duration: o * 1e3 }), { status: 0, message: "成功" }) : { status: -1, message: "未配置camera" };
|
|
266
272
|
}
|
|
267
273
|
/**
|
|
268
274
|
* 经纬度转像素坐标,在地图移动时回调
|
|
269
275
|
* */
|
|
270
276
|
requestCoordinateTransform(t, i) {
|
|
271
277
|
let o = 0;
|
|
272
|
-
const
|
|
278
|
+
const s = 1e3 / 30, g = k.watch(
|
|
273
279
|
() => this.view.center,
|
|
274
280
|
() => {
|
|
275
281
|
const l = this.transformPoints(t), p = Date.now();
|
|
276
|
-
p - o >
|
|
282
|
+
p - o > s && (i(l), o = p);
|
|
277
283
|
}
|
|
278
284
|
);
|
|
279
285
|
return this.handleIndex++, this.watchHandleMap.set(this.handleIndex, g), { handle: this.handleIndex, points: this.transformPoints(t) };
|
|
@@ -283,8 +289,8 @@ class Z {
|
|
|
283
289
|
const o = new P({
|
|
284
290
|
x: i[0],
|
|
285
291
|
y: i[1]
|
|
286
|
-
}),
|
|
287
|
-
return [
|
|
292
|
+
}), r = this.view.toScreen(o);
|
|
293
|
+
return [r.x, r.y];
|
|
288
294
|
});
|
|
289
295
|
}
|
|
290
296
|
/**
|
|
@@ -301,12 +307,12 @@ class Z {
|
|
|
301
307
|
const { min: i, max: o } = t;
|
|
302
308
|
!i && !o || (this.zoomWatchHandle && this.zoomWatchHandle.remove(), this.zoomWatchHandle = k.watch(
|
|
303
309
|
() => this.view.zoom,
|
|
304
|
-
(
|
|
305
|
-
i &&
|
|
310
|
+
(r) => {
|
|
311
|
+
i && r <= i && (this.view.zoom = i), o && r >= o && (this.view.zoom = o);
|
|
306
312
|
}
|
|
307
313
|
));
|
|
308
314
|
}
|
|
309
315
|
}
|
|
310
316
|
export {
|
|
311
|
-
|
|
317
|
+
X as default
|
|
312
318
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const districtDashLineLayerOptions: any;
|
|
2
|
+
declare const districtSolidLineLayerOptions: any;
|
|
3
|
+
declare const subDistrictLayerOptions: any;
|
|
4
|
+
declare const signalMarkerLayerOptions: any;
|
|
5
|
+
declare const signalPictureLayerOptions: any;
|
|
6
|
+
declare const signalClusterLayerOptions: any;
|
|
7
|
+
export { districtDashLineLayerOptions, districtSolidLineLayerOptions, signalClusterLayerOptions, signalMarkerLayerOptions, signalPictureLayerOptions, subDistrictLayerOptions };
|