gisviewer-vue3-arcgis 1.0.236 → 1.0.238
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/map-initializer.mjs +38 -35
- package/es/src/gis-map/utils/signal-control-area/district-controller.d.ts +2 -0
- package/es/src/gis-map/utils/signal-control-area/district-controller.mjs +42 -26
- package/es/src/gis-map/utils/signal-control-area/layer-symbol.mjs +30 -34
- package/es/src/gis-map/utils/signal-control-area/show-area.d.ts +0 -7
- package/es/src/gis-map/utils/signal-control-area/show-area.mjs +41 -74
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +2 -2
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.mjs +26 -26
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +12 -4
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +79 -86
- package/es/src/types/index.d.ts +6 -0
- package/lib/src/gis-map/utils/map-initializer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/district-controller.d.ts +2 -0
- package/lib/src/gis-map/utils/signal-control-area/district-controller.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/layer-symbol.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/show-area.d.ts +0 -7
- package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +2 -2
- package/lib/src/gis-map/utils/signal-control-area/signal-renderer.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +12 -4
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
- package/lib/src/types/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import u from "@arcgis/core/Graphic";
|
|
2
|
+
import d from "@arcgis/core/layers/FeatureLayer";
|
|
3
3
|
import o from "../common-utils.mjs";
|
|
4
4
|
import { signalMarkerLayerOptions as y, signalPictureLayerOptions as c, signalClusterLayerOptions as p } from "./layer-symbol.mjs";
|
|
5
5
|
class E {
|
|
6
6
|
constructor(e) {
|
|
7
|
-
this.view = e, this.signalMarkerLayer = new
|
|
7
|
+
this.view = e, this.signalMarkerLayer = new d(
|
|
8
8
|
y
|
|
9
|
-
), this.signalMarkerLayer.spatialReference = e.spatialReference, this.signalMarkerLayer.popupEnabled = !0, this.signalPictureLayer = new
|
|
9
|
+
), this.signalMarkerLayer.spatialReference = e.spatialReference, this.signalMarkerLayer.popupEnabled = !0, this.signalPictureLayer = new d(
|
|
10
10
|
c
|
|
11
|
-
), this.signalPictureLayer.spatialReference = e.spatialReference, this.signalPictureLayer.popupEnabled = !0, this.signalClusterLayer = new
|
|
11
|
+
), this.signalPictureLayer.spatialReference = e.spatialReference, this.signalPictureLayer.popupEnabled = !0, this.signalClusterLayer = new d(
|
|
12
12
|
p
|
|
13
13
|
), this.signalClusterLayer.spatialReference = e.spatialReference, this.signalClusterLayer.popupEnabled = !0, this.view.map.addMany([
|
|
14
14
|
this.signalMarkerLayer,
|
|
@@ -19,10 +19,10 @@ class E {
|
|
|
19
19
|
async showSignals(e) {
|
|
20
20
|
await this.clearSignals();
|
|
21
21
|
let r = 0;
|
|
22
|
-
const
|
|
23
|
-
e.forEach((
|
|
24
|
-
|
|
25
|
-
const t = new
|
|
22
|
+
const a = [];
|
|
23
|
+
e.forEach((s) => {
|
|
24
|
+
s.signals.forEach((i) => {
|
|
25
|
+
const t = new u({
|
|
26
26
|
geometry: {
|
|
27
27
|
type: "point",
|
|
28
28
|
longitude: i.longitude,
|
|
@@ -34,8 +34,8 @@ class E {
|
|
|
34
34
|
name: i.name,
|
|
35
35
|
signalId: i.signalId,
|
|
36
36
|
nodeId: i.nodeId || i.id,
|
|
37
|
-
districtId:
|
|
38
|
-
districtName:
|
|
37
|
+
districtId: s.id,
|
|
38
|
+
districtName: s.name,
|
|
39
39
|
subDistrictId: "",
|
|
40
40
|
subDistrictName: "",
|
|
41
41
|
isKey: i.isKey,
|
|
@@ -43,10 +43,10 @@ class E {
|
|
|
43
43
|
selected: !0
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
}),
|
|
46
|
+
a.push(t);
|
|
47
|
+
}), s.subDistricts.forEach((i) => {
|
|
48
48
|
i.signals.forEach((t) => {
|
|
49
|
-
const n = new
|
|
49
|
+
const n = new u({
|
|
50
50
|
geometry: {
|
|
51
51
|
type: "point",
|
|
52
52
|
longitude: t.longitude,
|
|
@@ -58,8 +58,8 @@ class E {
|
|
|
58
58
|
name: t.name,
|
|
59
59
|
signalId: t.signalId,
|
|
60
60
|
nodeId: t.nodeId || t.id,
|
|
61
|
-
districtId:
|
|
62
|
-
districtName:
|
|
61
|
+
districtId: s.id,
|
|
62
|
+
districtName: s.name,
|
|
63
63
|
subDistrictId: i.id,
|
|
64
64
|
subDistrictName: i.name,
|
|
65
65
|
isKey: t.isKey,
|
|
@@ -67,15 +67,15 @@ class E {
|
|
|
67
67
|
selected: !0
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
|
|
70
|
+
a.push(n);
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
}), await this.signalMarkerLayer.applyEdits({
|
|
74
|
-
addFeatures:
|
|
74
|
+
addFeatures: a
|
|
75
75
|
}), await this.signalPictureLayer.applyEdits({
|
|
76
|
-
addFeatures:
|
|
76
|
+
addFeatures: a
|
|
77
77
|
}), await this.signalClusterLayer.applyEdits({
|
|
78
|
-
addFeatures:
|
|
78
|
+
addFeatures: a
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
async clearSignals() {
|
|
@@ -98,19 +98,19 @@ class E {
|
|
|
98
98
|
return { status: 0, message: "ok" };
|
|
99
99
|
}
|
|
100
100
|
async highlightSignal(e) {
|
|
101
|
-
let r = "",
|
|
102
|
-
const
|
|
101
|
+
let r = "", a = "";
|
|
102
|
+
const s = this.signalMarkerLayer.definitionExpression;
|
|
103
103
|
this.signalMarkerLayer.definitionExpression = `signalId = '${e}'`;
|
|
104
104
|
const i = await this.signalMarkerLayer.queryFeatures(), t = i.features.length;
|
|
105
105
|
if (t > 0) {
|
|
106
106
|
const n = i.features[0].attributes.districtId || "", l = i.features[0].attributes.subDistrictId || "";
|
|
107
107
|
return await o.viewGoto(this.view, i.features), { districtId: n, subDistrictId: l, count: t };
|
|
108
108
|
} else
|
|
109
|
-
this.signalMarkerLayer.definitionExpression =
|
|
110
|
-
return { districtId: r, subDistrictId:
|
|
109
|
+
this.signalMarkerLayer.definitionExpression = s;
|
|
110
|
+
return { districtId: r, subDistrictId: a, count: t };
|
|
111
111
|
}
|
|
112
|
-
filter(e
|
|
113
|
-
const s = `${
|
|
112
|
+
filter(e) {
|
|
113
|
+
const { id: r, type: a } = e, s = `${a === "district" ? "districtId" : "subDistrictId"} = '${r}'`;
|
|
114
114
|
this.signalClusterLayer.definitionExpression = s, this.signalMarkerLayer.definitionExpression = s, this.signalPictureLayer.definitionExpression = s;
|
|
115
115
|
}
|
|
116
116
|
resetFilter() {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IDistrictRoad, IFindSignalControlAreaParams, IResult } from '../../../types';
|
|
2
2
|
import DistrictController from './district-controller';
|
|
3
3
|
export default class SubDistrictRenderer {
|
|
4
4
|
private view;
|
|
5
5
|
private clickHandler;
|
|
6
6
|
private subDistrictPointLayer;
|
|
7
7
|
private subDistrictLineLayer;
|
|
8
|
-
|
|
8
|
+
roadConnections: IDistrictRoad[];
|
|
9
9
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
10
10
|
showSubDistricts(controllers: DistrictController[]): Promise<void>;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* 显示区控下的所有子区,用道路线表示
|
|
13
|
+
* @param id 区控ID
|
|
14
|
+
*/
|
|
15
|
+
showRoads(params: IFindSignalControlAreaParams): Promise<void>;
|
|
12
16
|
clearSubDistricts(): Promise<void>;
|
|
13
17
|
setVisible(visible: boolean): void;
|
|
14
18
|
/**
|
|
@@ -30,12 +34,16 @@ export default class SubDistrictRenderer {
|
|
|
30
34
|
* @param type 类型,district 或 subDistrict
|
|
31
35
|
* @param id
|
|
32
36
|
*/
|
|
33
|
-
filter(
|
|
37
|
+
filter(param: IFindSignalControlAreaParams): void;
|
|
34
38
|
/**
|
|
35
39
|
* 重置过滤器,显示所有子区
|
|
36
40
|
*/
|
|
37
41
|
resetFilter(): void;
|
|
38
42
|
private currentPointRenderer;
|
|
39
43
|
private currentLineRenderer;
|
|
44
|
+
/**
|
|
45
|
+
* 监听地图点击事件,进行子区高亮
|
|
46
|
+
* @param event
|
|
47
|
+
*/
|
|
40
48
|
private viewHitTest;
|
|
41
49
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { subDistrictPointLayerOptions as I, subDistrictLineLayerOptions as
|
|
5
|
-
class
|
|
1
|
+
import f from "@arcgis/core/Graphic";
|
|
2
|
+
import m from "@arcgis/core/layers/FeatureLayer";
|
|
3
|
+
import v from "../common-utils.mjs";
|
|
4
|
+
import { subDistrictPointLayerOptions as I, subDistrictLineLayerOptions as z } from "./layer-symbol.mjs";
|
|
5
|
+
class C {
|
|
6
6
|
constructor(e) {
|
|
7
|
-
this.view = e, this.subDistrictPointLayer = new
|
|
7
|
+
this.roadConnections = [], this.view = e, this.subDistrictPointLayer = new m(
|
|
8
8
|
I
|
|
9
|
-
), this.subDistrictPointLayer.spatialReference = e.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new
|
|
10
|
-
|
|
9
|
+
), this.subDistrictPointLayer.spatialReference = e.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new m(
|
|
10
|
+
z
|
|
11
11
|
), this.subDistrictLineLayer.spatialReference = e.spatialReference, this.subDistrictLineLayer.popupEnabled = !0, this.view.map.addMany([
|
|
12
12
|
this.subDistrictLineLayer,
|
|
13
13
|
this.subDistrictPointLayer
|
|
@@ -18,13 +18,13 @@ class S {
|
|
|
18
18
|
let s = 0;
|
|
19
19
|
const t = [], r = [];
|
|
20
20
|
e.forEach((i) => {
|
|
21
|
-
r.push({
|
|
21
|
+
i.roadConnections.length > 0 && this.roadConnections.push(...i.roadConnections), r.push({
|
|
22
22
|
value: i.id,
|
|
23
23
|
label: i.name,
|
|
24
24
|
symbol: {
|
|
25
25
|
type: "simple-marker",
|
|
26
26
|
style: "circle",
|
|
27
|
-
color: [
|
|
27
|
+
color: [...i.areaColor, 0.8],
|
|
28
28
|
size: "8px",
|
|
29
29
|
outline: {
|
|
30
30
|
color: [...i.areaColor],
|
|
@@ -32,7 +32,7 @@ class S {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}), i.signals.forEach((a) => {
|
|
35
|
-
const n = new
|
|
35
|
+
const n = new f({
|
|
36
36
|
geometry: {
|
|
37
37
|
type: "point",
|
|
38
38
|
longitude: a.longitude,
|
|
@@ -99,80 +99,69 @@ class S {
|
|
|
99
99
|
addFeatures: t
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* 显示区控下的所有子区,用道路线表示
|
|
104
|
+
* @param id 区控ID
|
|
105
|
+
*/
|
|
102
106
|
async showRoads(e) {
|
|
103
|
-
const s = this.subDistrictPointLayer.createQuery();
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
),
|
|
108
|
-
|
|
109
|
-
var
|
|
107
|
+
const { type: s, id: t } = e, r = this.subDistrictPointLayer.createQuery(), i = s === "district" ? "districtId" : "subDistrictId";
|
|
108
|
+
r.where = `${i} = '${t}'`;
|
|
109
|
+
const a = await this.subDistrictPointLayer.queryFeatures(
|
|
110
|
+
r
|
|
111
|
+
), n = /* @__PURE__ */ new Map();
|
|
112
|
+
a.features.forEach((u) => {
|
|
113
|
+
var y;
|
|
110
114
|
const {
|
|
111
|
-
subDistrictId:
|
|
112
|
-
color:
|
|
113
|
-
id:
|
|
114
|
-
districtName:
|
|
115
|
-
subDistrictName:
|
|
116
|
-
signalCount:
|
|
117
|
-
} =
|
|
118
|
-
|
|
119
|
-
color:
|
|
115
|
+
subDistrictId: o,
|
|
116
|
+
color: c,
|
|
117
|
+
id: d,
|
|
118
|
+
districtName: p,
|
|
119
|
+
subDistrictName: L,
|
|
120
|
+
signalCount: b
|
|
121
|
+
} = u.attributes;
|
|
122
|
+
n.has(o) || n.set(o, {
|
|
123
|
+
color: c,
|
|
120
124
|
signalIds: [],
|
|
121
|
-
districtName:
|
|
122
|
-
subDistrictName:
|
|
123
|
-
signalCount:
|
|
124
|
-
}), (
|
|
125
|
+
districtName: p,
|
|
126
|
+
subDistrictName: L,
|
|
127
|
+
signalCount: b
|
|
128
|
+
}), (y = n.get(o)) == null || y.signalIds.push(d);
|
|
125
129
|
});
|
|
126
|
-
const
|
|
127
|
-
for (const
|
|
128
|
-
let
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
value:
|
|
130
|
+
const h = [], D = [];
|
|
131
|
+
for (const u of n) {
|
|
132
|
+
let o = 0;
|
|
133
|
+
const c = u[0];
|
|
134
|
+
h.push({
|
|
135
|
+
value: c,
|
|
132
136
|
symbol: {
|
|
133
137
|
type: "simple-line",
|
|
134
|
-
color:
|
|
138
|
+
color: u[1].color.split(",").map(Number),
|
|
135
139
|
width: 2,
|
|
136
140
|
style: "solid"
|
|
137
141
|
}
|
|
138
142
|
});
|
|
139
|
-
const { districtName:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
geometry: {
|
|
158
|
-
type: "polyline",
|
|
159
|
-
paths: [D.coordinates]
|
|
160
|
-
},
|
|
161
|
-
attributes: {
|
|
162
|
-
ObjectID: c++,
|
|
163
|
-
id: D.id,
|
|
164
|
-
districtId: e,
|
|
165
|
-
subDistrictId: l,
|
|
166
|
-
subDistrictName: h,
|
|
167
|
-
districtName: b,
|
|
168
|
-
signalCount: y,
|
|
169
|
-
fromNode: f,
|
|
170
|
-
toNode: L,
|
|
171
|
-
color: n[1].color
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
a.push(z);
|
|
143
|
+
const { districtName: d, subDistrictName: p, signalIds: L, signalCount: b } = u[1];
|
|
144
|
+
this.roadConnections.filter(
|
|
145
|
+
(l) => l.subDistrictId === c
|
|
146
|
+
).forEach((l) => {
|
|
147
|
+
const w = new f({
|
|
148
|
+
geometry: {
|
|
149
|
+
type: "polyline",
|
|
150
|
+
paths: l.coordinates
|
|
151
|
+
},
|
|
152
|
+
attributes: {
|
|
153
|
+
ObjectID: o++,
|
|
154
|
+
id: l.id,
|
|
155
|
+
districtId: l.districtId,
|
|
156
|
+
subDistrictId: c,
|
|
157
|
+
subDistrictName: p,
|
|
158
|
+
districtName: d,
|
|
159
|
+
signalCount: b,
|
|
160
|
+
color: u[1].color
|
|
175
161
|
}
|
|
162
|
+
});
|
|
163
|
+
D.push(w);
|
|
164
|
+
});
|
|
176
165
|
}
|
|
177
166
|
this.subDistrictLineLayer.renderer = {
|
|
178
167
|
type: "unique-value",
|
|
@@ -184,7 +173,7 @@ class S {
|
|
|
184
173
|
style: "solid"
|
|
185
174
|
},
|
|
186
175
|
defaultLabel: "其他子区",
|
|
187
|
-
uniqueValueInfos:
|
|
176
|
+
uniqueValueInfos: h,
|
|
188
177
|
visualVariables: [
|
|
189
178
|
{
|
|
190
179
|
type: "size",
|
|
@@ -214,7 +203,7 @@ class S {
|
|
|
214
203
|
}
|
|
215
204
|
]
|
|
216
205
|
}, this.currentLineRenderer = this.subDistrictLineLayer.renderer.clone(), await this.subDistrictLineLayer.applyEdits({
|
|
217
|
-
addFeatures:
|
|
206
|
+
addFeatures: D
|
|
218
207
|
});
|
|
219
208
|
}
|
|
220
209
|
async clearSubDistricts() {
|
|
@@ -239,7 +228,7 @@ class S {
|
|
|
239
228
|
const s = this.subDistrictPointLayer.createQuery();
|
|
240
229
|
s.where = `subDistrictId = '${e}'`, s.returnGeometry = !0;
|
|
241
230
|
const t = await this.subDistrictPointLayer.queryFeatures(s);
|
|
242
|
-
return t.features.length > 0 ? (await
|
|
231
|
+
return t.features.length > 0 ? (await v.viewGoto(this.view, t.features), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
|
|
243
232
|
}
|
|
244
233
|
/**
|
|
245
234
|
* 高亮子区, 其他子区隐藏
|
|
@@ -251,16 +240,16 @@ class S {
|
|
|
251
240
|
const t = this.subDistrictPointLayer.definitionExpression;
|
|
252
241
|
this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${e}'`;
|
|
253
242
|
const r = await this.subDistrictPointLayer.queryFeatures(), i = r.features.length;
|
|
254
|
-
return i > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${e}'`, s = r.features[0].attributes.districtId, await
|
|
243
|
+
return i > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${e}'`, s = r.features[0].attributes.districtId, await v.viewGoto(this.view, r.features)) : this.subDistrictPointLayer.definitionExpression = t, { count: i, parentId: s };
|
|
255
244
|
}
|
|
256
245
|
/**
|
|
257
246
|
* 按照区控、子区id显示子区
|
|
258
247
|
* @param type 类型,district 或 subDistrict
|
|
259
248
|
* @param id
|
|
260
249
|
*/
|
|
261
|
-
filter(e
|
|
262
|
-
const t = `${
|
|
263
|
-
this.subDistrictPointLayer.definitionExpression =
|
|
250
|
+
filter(e) {
|
|
251
|
+
const { type: s, id: t } = e, r = `${s === "district" ? "districtId" : "subDistrictId"} = '${t}'`;
|
|
252
|
+
this.subDistrictPointLayer.definitionExpression = r, this.subDistrictLineLayer.definitionExpression = r;
|
|
264
253
|
}
|
|
265
254
|
/**
|
|
266
255
|
* 重置过滤器,显示所有子区
|
|
@@ -268,6 +257,10 @@ class S {
|
|
|
268
257
|
resetFilter() {
|
|
269
258
|
this.subDistrictPointLayer.definitionExpression = "1=1", this.subDistrictLineLayer.definitionExpression = "1=1";
|
|
270
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* 监听地图点击事件,进行子区高亮
|
|
262
|
+
* @param event
|
|
263
|
+
*/
|
|
271
264
|
async viewHitTest(e) {
|
|
272
265
|
var r;
|
|
273
266
|
const t = (r = (await this.view.hitTest(e, {
|
|
@@ -276,9 +269,9 @@ class S {
|
|
|
276
269
|
(i) => i.type === "graphic"
|
|
277
270
|
);
|
|
278
271
|
if (t.length === 0)
|
|
279
|
-
this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
|
|
272
|
+
console.time("resetRenderer"), this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
|
|
280
273
|
else {
|
|
281
|
-
const i = t[0].graphic;
|
|
274
|
+
const i = t[0].graphic, a = i.attributes.color.split(",").map(Number);
|
|
282
275
|
this.subDistrictPointLayer.renderer = {
|
|
283
276
|
type: "unique-value",
|
|
284
277
|
field: "subDistrictId",
|
|
@@ -299,10 +292,10 @@ class S {
|
|
|
299
292
|
symbol: {
|
|
300
293
|
type: "simple-marker",
|
|
301
294
|
style: "circle",
|
|
302
|
-
color: [
|
|
295
|
+
color: [...a, 0.8],
|
|
303
296
|
size: "8px",
|
|
304
297
|
outline: {
|
|
305
|
-
color:
|
|
298
|
+
color: a,
|
|
306
299
|
width: 4
|
|
307
300
|
}
|
|
308
301
|
}
|
|
@@ -390,5 +383,5 @@ class S {
|
|
|
390
383
|
}
|
|
391
384
|
}
|
|
392
385
|
export {
|
|
393
|
-
|
|
386
|
+
C as default
|
|
394
387
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -275,6 +275,12 @@ export interface IShowSignalControlAreaParams {
|
|
|
275
275
|
areaList: any[];
|
|
276
276
|
style?: string;
|
|
277
277
|
}
|
|
278
|
+
export interface IDistrictRoad {
|
|
279
|
+
id: string;
|
|
280
|
+
coordinates: number[][];
|
|
281
|
+
districtId: string;
|
|
282
|
+
subDistrictId: string;
|
|
283
|
+
}
|
|
278
284
|
export interface IFindSignalControlAreaParams {
|
|
279
285
|
type: string;
|
|
280
286
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@arcgis/core/Basemap"),g=require("@arcgis/core/config"),q=require("@arcgis/core/core/reactiveUtils"),f=require("@arcgis/core/geometry"),z=require("@arcgis/core/geometry/support/webMercatorUtils"),W=require("@arcgis/core/layers/FeatureLayer"),O=require("@arcgis/core/layers/GeoJSONLayer"),x=require("@arcgis/core/layers/IntegratedMesh3DTilesLayer"),I=require("@arcgis/core/layers/MapImageLayer"),S=require("@arcgis/core/layers/TileLayer"),R=require("@arcgis/core/layers/WebTileLayer"),H=require("@arcgis/core/Map"),_=require("@arcgis/core/views/MapView"),G=require("@arcgis/core/views/SceneView"),j=require("@turf/destination"),B=require("@turf/helpers"),N=require("./custom-layer/custom-wmts-layer.js");function b(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>c[t]})}}return e.default=c,Object.freeze(e)}const T=b(q),m=b(z),U=b(B);function L(c,e){return c&&(c.startsWith("http://")||c.startsWith("https://")?c:e+c)}class E{constructor(){this.mapConfig={},this.watchHandleMap=new Map,this.handleIndex=0,this.zoomWatchHandle=null}async initialize(e){var u,y,v,M;this.mapConfig=e.mapConfig;const{container:t,markerClickCallback:s,mapClickCallback:n}=e;g.assetsPath=`${this.mapConfig.assetsRoot}/ArcgisAssets`,g.fontsUrl=`${this.mapConfig.assetsRoot}/fonts`,g.apiKey="AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";const a=new H;if(((u=this.mapConfig)==null?void 0:u.mapOptions.mode.toLowerCase())==="2d"?(this.view=new _({map:a,container:t,...this.mapConfig.mapOptions}),this.view.on("drag",i=>{i.button===2&&i.stopPropagation()})):this.view=new G({map:a,container:t,environment:{atmosphereEnabled:!0,lighting:{type:"virtual"}},...(y=this.mapConfig)==null?void 0:y.mapOptions}),this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!1,featureNavigation:!0},this.view.popup.dockOptions={buttonEnabled:!1,breakpoint:!1},this.view.on("click",async i=>{var k,C;if(n){let o=i.mapPoint;o.spatialReference.isWebMercator&&(o=m.webMercatorToGeographic(o)),n([o.x,o.y],[i.screenPoint.x,i.screenPoint.y],i)}if(this.view.type==="3d"){const o=this.view.camera;if(this.view.spatialReference.isWebMercator){const p=m.webMercatorToGeographic(o.position),w={heading:o.heading,tilt:o.tilt,position:p.toJSON()};console.log(w),(k=navigator.clipboard)==null||k.writeText(JSON.stringify(w))}else console.log(o.toJSON());console.log(this.view.zoom,this.view.scale)}else{let o=this.view.center;this.view.spatialReference.isWebMercator&&(o=m.webMercatorToGeographic(o)),console.log({center:o.toJSON(),zoom:this.view.zoom,scale:this.view.scale})}const r=(C=(await this.view.hitTest(i)).results)==null?void 0:C.filter(o=>o.type==="graphic");r.length>0&&r.forEach(o=>{var w;const p=o.graphic;(w=p.attributes)!=null&&w.type&&s&&s(p.attributes.type,p.attributes.id,p.attributes,i)})}),(v=this.mapConfig)!=null&&v.baseLayers?this.mapConfig.baseLayers.forEach(i=>{const l=L(i.url,this.mapConfig.assetsRoot);switch(i.type.toLowerCase()){case"webTile".toLowerCase():{const r=new R({urlTemplate:l,...i.options});a.add(r);break}case"tile":{const r=new S({url:l,...i.options});a.add(r);break}case"customWMTS".toLowerCase():{const r=new N.default({urlTemplate:l,...i.options});a.add(r);break}case"mapImage".toLowerCase():{const r=new I({url:l,...i.options});a.add(r);break}case"arcgis":{const r=new P(i.options);a.basemap=r;break}case"feature":{const r=new W({url:l,...i.options});a.add(r);break}case"3dtiles":{const r=new x({url:l,...i.options});a.add(r);break}}}):a.basemap=new P({style:{id:"arcgis/light-gray",language:"zh-CN"}}),(M=this.mapConfig)!=null&&M.hdLayers){const i=this.mapConfig.hdLayers.map(l=>new O({url:L(l.url,this.mapConfig.assetsRoot),...l.options,title:l.options.id}));a.addMany(i)}this.view.ui.remove("attribution"),await this.view.when();const d=this.mapConfig.camera;let h;if(this.view.type==="2d"){let i=this.view.center;this.view.spatialReference.isWebMercator&&(i=m.webMercatorToGeographic(i)),h={center:[i.x,i.y],zoom:this.view.zoom}}else{let i=this.view.camera.position;this.view.spatialReference.isWebMercator&&(i=m.webMercatorToGeographic(i)),h={position:i,heading:this.view.camera.heading,tilt:this.view.camera.tilt}}return d?d.home=h:this.mapConfig.camera={home:h},this.view}setLayerVisibility(e){const{id:t,visible:s}=e,n=this.view.map.findLayerById(t);return n?(n.visible=s,{status:0,message:"ok"}):{status:-1,message:"未找到图层"}}async setMapCenter(e){var t;if(!this.view)return{status:-1,message:"未初始化"};if(e.center||e.target){switch((t=e.target)==null?void 0:t.type.toLowerCase()){case"point":e.target=new f.Point(e.target);break;case"polyline":e.target=new f.Polyline(e.target);break;case"polygon":e.target=new f.Polygon(e.target);break;case"multipoint":e.target=new f.Multipoint(e.target);break}await this.view.goTo(e,{duration:(e.duration||0)*1e3})}return{status:0,message:"成功"}}async lookAt(e){if(this.view.type==="2d")return;const t=e.tilt||0,s=e.heading||0;if(t===0)await this.view.goTo({position:{x:e.center[0],y:e.center[1],z:e.height},heading:s,tilt:0},{duration:(e.duration||2)*1e3});else{const n=Math.tan(t*Math.PI/180)*e.height,a=j(U.point(e.center),n,s+180,{units:"meters"});await this.view.goTo({position:{x:a.geometry.coordinates[0],y:a.geometry.coordinates[1],z:e.height},heading:s,tilt:t},{duration:(e.duration||2)*1e3})}}async setMapCamera(e){if(!this.view)return{status:-1,message:"未初始化"};const{name:t,duration:s=0}=e,{camera:n}=this.mapConfig;if(!n)return{status:-1,message:"未配置camera"};const a=n[t];return a?(await this.view.goTo(a,{duration:s*1e3}),{status:0,message:"成功"}):{status:-1,message:"未配置camera"}}requestCoordinateTransform(e,t){let s=0;const a=1e3/30,d=T.watch(()=>this.view.center,()=>{const h=this.transformPoints(e),u=Date.now();u-s>a&&(t(h),s=u)});return this.handleIndex++,this.watchHandleMap.set(this.handleIndex,d),{handle:this.handleIndex,points:this.transformPoints(e)}}transformPoints(e){return e.map(t=>{const s=new f.Point({x:t[0],y:t[1]}),n=this.view.toScreen(s);return[n.x,n.y]})}cancelCoordinateTransform(e){const t=this.watchHandleMap.get(e);t&&(t.remove(),this.watchHandleMap.delete(e))}setMapZoomRange(e){const{min:t,max:s}=e;!t&&!s||(this.zoomWatchHandle&&this.zoomWatchHandle.remove(),this.zoomWatchHandle=T.watch(()=>this.view.zoom,n=>{t&&n<=t&&(this.view.zoom=t),s&&n>=s&&(this.view.zoom=s)}))}}exports.default=E;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IDistrictRoad } from 'packages/components/src/types';
|
|
1
2
|
interface ICross {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -18,6 +19,7 @@ export default class DistrictController {
|
|
|
18
19
|
areaColor: [number, number, number];
|
|
19
20
|
signalCount: number;
|
|
20
21
|
subDistrictCount: number;
|
|
22
|
+
roadConnections: IDistrictRoad[];
|
|
21
23
|
constructor(params: any, style: string);
|
|
22
24
|
/**
|
|
23
25
|
* 获取区控/子区下的所有信号机
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("pako"),c=require("../common-utils.js");class r{constructor(o,s){this.parentName="",this.signals=[],this.subDistricts=[],this.areaColor=this.getDarkNonGrayColor(),this.signalCount=0,this.subDistrictCount=0,this.roadConnections=[],this.id=o.name,this.name=o.areaDesc,this.parentId=o.parentId,s==="alarm"&&(this.areaColor=[255,0,0]);for(const t of o.children)if(t.children){const i=new r(t,s);if(i.id=t.id,i.name=`SS ${t.name}`,i.parentId=this.id,i.parentName=this.name,i.areaColor=this.getDarkNonGrayColor(t.id),this.subDistricts.push(i),this.subDistrictCount++,this.signalCount+=i.signalCount,t.mapConnectList)try{const a=t.mapConnectList,n=new Uint8Array(window.atob(a).split("").map(e=>e.charCodeAt(0))),l=h.inflate(n,{to:"string"}),d=JSON.parse(l);i.roadConnections.push(...d.map(e=>({id:e.roadsectId,coordinates:JSON.parse(e.geomData).coordinates,districtId:i.parentId,subDistrictId:i.id}))),console.log(i.roadConnections)}catch(a){console.error("解压子区路段连接信息失败:",a)}}else if(c.default.isCoordinateValid(t)){const i={id:t.id,name:t.name,parentId:t.parentId,latitude:Number(t.latitude),longitude:Number(t.longitude),signalId:t.signalId,nodeId:t.nodeId,isKey:t.isKey===1};this.signals.push(i),this.signalCount++}}getAllSignalCoordinates(){const o=[];for(const s of this.signals)o.push([s.longitude,s.latitude]);for(const s of this.subDistricts)o.push(...s.getAllSignalCoordinates());return o}getDarkNonGrayColor(o){let s,t,i;if(o){const a=this.cyrb53(o);s=((a&16711680)>>16)%200,t=((a&65280)>>8)%200,i=(a&255)%200}else s=Math.floor(Math.random()*256),t=Math.floor(Math.random()*256),i=Math.floor(Math.random()*256);return[s,t,i]}cyrb53(o,s=0){let t=3735928559^s,i=1103547991^s;for(let a=0,n;a<o.length;a++)n=o.charCodeAt(a),t=Math.imul(t^n,2654435761),i=Math.imul(i^n,1597334677);return t=Math.imul(t^t>>>16,2246822507),t^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}}exports.default=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={id:"districtController",source:[],objectIdField:"ObjectID",geometryType:"polyline",outFields:["*"],fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"}],renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"long-dash",color:[180,180,180],width:1}}]}},t={id:"districtController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"solid",color:[180,180,180,.4],width:1}}]}},i={id:"subDistrictPointController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"},{name:"type",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},r={id:"subDistrictLineController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"fromNode",type:"string"},{name:"toNode",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},l={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:0}},uniqueValueInfos:[{value:"true,true",symbol:{type:"simple-marker",style:"circle",color:[254,172,22,.8],size:8,outline:{color:"white",width:0}}},{value:"false,true",symbol:{type:"simple-marker",style:"circle",color:[5,116,255,.8],size:8,outline:{color:"white",width:0}}},{value:"true,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}},{value:"false,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:8,value:9000.954822000003},{size:6,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}},s={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",minScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true,true",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:30,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false,true",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:15,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},{value:"true,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxk_gray.png",width:20,height:20}},{value:"false,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_xhj_gray.png",width:20,height:20}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:28,value:2250},{size:24,value:4500}]}]}},a={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],featureReduction:{type:"cluster",clusterRadius:"120px",clusterMaxSize:"50px",clusterMinSize:"30px",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.cluster_count",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""},{type:"CIMMarkerGraphic",geometry:{rings:[[[-15,40],[15,40],[15,20],[-15,20],[-15,40]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[2,72,200,255]},{type:"CIMSolidStroke",enable:!0,width:5,color:[2,72,200,128]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:40,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"simple",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}};exports.districtDashLineLayerOptions=e;exports.districtSolidLineLayerOptions=t;exports.signalClusterLayerOptions=a;exports.signalMarkerLayerOptions=l;exports.signalPictureLayerOptions=s;exports.subDistrictLineLayerOptions=r;exports.subDistrictPointLayerOptions=i;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={id:"districtController",source:[],objectIdField:"ObjectID",geometryType:"polyline",outFields:["*"],fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"}],renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"long-dash",color:[111,100,255],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"long-dash",color:[180,180,180],width:1}}]}},t={id:"districtController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"subDistrictCount",type:"integer"},{name:"signalCount",type:"integer"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}",content:[{type:"fields",fieldInfos:[{fieldName:"id",label:"区控编号"},{fieldName:"subDistrictCount",label:"子区数量"},{fieldName:"signalCount",label:"信号机数量"}]}]},renderer:{type:"unique-value",field:"selected",defaultSymbol:{type:"simple-line",style:"solid",color:[111,100,255,.4],width:2},uniqueValueInfos:[{value:"false",symbol:{type:"simple-line",style:"solid",color:[180,180,180,.4],width:1}}]}},i={id:"subDistrictPointController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"selected",type:"string"},{name:"type",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},r={id:"subDistrictLineController",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"polyline",fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"signalCount",type:"integer"},{name:"fromNode",type:"string"},{name:"toNode",type:"string"},{name:"color",type:"string"}],popupTemplate:{title:"{subDistrictName} 子区",content:[{type:"fields",fieldInfos:[{fieldName:"subDistrictId",label:"子区编号"},{fieldName:"districtName",label:"所属区控"},{fieldName:"signalCount",label:"信号机数量"}]}]}},s={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:0}},uniqueValueInfos:[{value:"true,true",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/icon_star.png",width:"20px",height:"20px"}},{value:"false,true",symbol:{type:"simple-marker",style:"circle",color:[5,116,255,.8],size:8,outline:{color:"white",width:0}}},{value:"true,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}},{value:"false,false",symbol:{type:"simple-marker",style:"circle",color:[180,180,180,.8],size:8,outline:{color:"white",width:0}}}]}},l={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",minScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"unique-value",field:"isKey",field2:"selected",defaultSymbol:{type:"simple-marker",style:"circle",color:"gray",size:4,outline:{color:"white",width:1}},uniqueValueInfos:[{value:"true,true",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:30,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_gjxklk_orange.png"}]}}}},{value:"false,true",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:15,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},{value:"true,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_gjxk_gray.png",width:20,height:20}},{value:"false,false",symbol:{type:"picture-marker",url:"/GisViewerAssets/Images/cross/gis_xhj_gray.png",width:20,height:20}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:28,value:2250},{size:24,value:4500}]}]}},n={id:"signalLayer",source:[],objectIdField:"ObjectID",outFields:["*"],geometryType:"point",maxScale:5e3,fields:[{name:"ObjectID",type:"oid"},{name:"id",type:"string"},{name:"name",type:"string"},{name:"signalId",type:"string"},{name:"nodeId",type:"string"},{name:"isKey",type:"string"},{name:"districtId",type:"string"},{name:"districtName",type:"string"},{name:"subDistrictId",type:"string"},{name:"subDistrictName",type:"string"},{name:"type",type:"string"},{name:"type",type:"string"},{name:"selected",type:"string"}],featureReduction:{type:"cluster",clusterRadius:"120px",clusterMaxSize:"50px",clusterMinSize:"30px",symbol:{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.cluster_count",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:16,horizontalAlignment:"Center",offsetX:0,offsetY:30,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:""},{type:"CIMMarkerGraphic",geometry:{rings:[[[-15,40],[15,40],[15,20],[-15,20],[-15,40]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[2,72,200,255]},{type:"CIMSolidStroke",enable:!0,width:5,color:[2,72,200,128]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:40,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/cross/gis_xhj_blue.png"}]}}}},popupTemplate:{title:"{name}信号机",content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"signalId",label:"信号机编号"},{fieldName:"nodeId",label:"路口编号"}]}]},renderer:{type:"simple",symbol:{type:"simple-marker",style:"circle",color:[5,116,255],size:8,outline:{color:"white",width:1}}}};exports.districtDashLineLayerOptions=e;exports.districtSolidLineLayerOptions=t;exports.signalClusterLayerOptions=n;exports.signalMarkerLayerOptions=s;exports.signalPictureLayerOptions=l;exports.subDistrictLineLayerOptions=r;exports.subDistrictPointLayerOptions=i;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IFindSignalControlAreaParams, ILayerVisibleParams, IResult, IShowSignalControlAreaParams } from '../../../types';
|
|
2
2
|
export default class SignalControlAreaController1 {
|
|
3
3
|
private view;
|
|
4
|
-
private hasGpu;
|
|
5
4
|
/** 支队图层 */
|
|
6
5
|
private detachmentLayer;
|
|
7
6
|
private detachmentLayerLoaded;
|
|
@@ -9,7 +8,6 @@ export default class SignalControlAreaController1 {
|
|
|
9
8
|
private subDistrictRenderer;
|
|
10
9
|
private signalRenderer;
|
|
11
10
|
private mapConfig;
|
|
12
|
-
private roadLines;
|
|
13
11
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
14
12
|
/**
|
|
15
13
|
* 显示所有区控、子区、信号机
|
|
@@ -51,11 +49,6 @@ export default class SignalControlAreaController1 {
|
|
|
51
49
|
status: number;
|
|
52
50
|
message: string;
|
|
53
51
|
}>;
|
|
54
|
-
/**
|
|
55
|
-
* 获取道路线
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
private loadRoadLine;
|
|
59
52
|
/**
|
|
60
53
|
* 加载支队图层
|
|
61
54
|
* 现场环境用url创建FeatureLayer有各种问题,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils"),g=require("@arcgis/core/Graphic"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils"),g=require("@arcgis/core/Graphic"),w=require("@arcgis/core/layers/GraphicsLayer"),R=require("../../stores/index.js"),D=require("./district-controller.js"),m=require("./district-renderer.js"),S=require("./signal-renderer.js"),C=require("./sub-district-renderer.js");class p{constructor(e){this.detachmentLayerLoaded=!1,this.view=e;const t=R.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.detachmentLayer=new w,this.view.map.add(this.detachmentLayer),this.districtRenderer=new m.default(e),this.subDistrictRenderer=new C.default(e),this.signalRenderer=new S.default(e)}async showSignalControlArea(e){this.detachmentLayerLoaded||await this.loadDetachmentLayer(),await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const t=[],s=[];for(const n of e.areaList){const i=new D.default(n,e.style||"");t.push(i),s.push(...i.subDistricts)}return this.districtRenderer.style=e.style||"",await this.districtRenderer.showDistricts(t),await this.subDistrictRenderer.showSubDistricts(s),await this.signalRenderer.showSignals(t),{status:0,message:"ok"}}async clearSignalControlArea(){return await this.districtRenderer.clearDistricts(),await this.subDistrictRenderer.clearSubDistricts(),await this.signalRenderer.clearSignals(),{status:0,message:"ok"}}setLayerVisibility(e){switch(e.visible===!1&&this.view.closePopup(),e.id){case"district":this.districtRenderer.setVisible(e.visible);break;case"subDistrict":this.subDistrictRenderer.setVisible(e.visible);break;case"signal":this.signalRenderer.setPointVisible(e.visible);break;case"signalCluster":this.signalRenderer.setClusterVisible(e.visible);break;case"shanghai_district":this.detachmentLayer.visible=e.visible;break}return{status:0,message:"ok"}}async locateSignalControlArea(e){switch(e.type){case"district":return await this.districtRenderer.locateDistrict(e.id);case"subDistrict":return await this.subDistrictRenderer.locateSubDistrict(e.id);case"signal":return await this.signalRenderer.locateSignal(e.id);default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(e){switch(this.view.closePopup(),e.type){case"district":return await this.districtRenderer.highlightDistrict(e.id)?(this.subDistrictRenderer.filter(e),this.signalRenderer.filter(e),await this.subDistrictRenderer.showRoads(e),{status:0,message:"ok"}):{status:1,message:"未找到区控"};case"subDistrict":{const{count:t,parentId:s}=await this.subDistrictRenderer.highlightSubDistrict(e.id);return t>0?(this.districtRenderer.filter(s),this.signalRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:t,subDistrictId:s,count:n}=await this.signalRenderer.highlightSignal(e.id);return n>0?(this.districtRenderer.filter(t),this.subDistrictRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async resetHighlight(){return this.districtRenderer.resetFilter(),this.subDistrictRenderer.resetFilter(),this.signalRenderer.resetFilter(),{status:0,message:"ok"}}async loadDetachmentLayer(){const e=this.mapConfig.baseLayers;if(!e)return;const t=e.find(s=>s.options.id==="shanghai_district");if(t)try{const n=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),i=[],{renderer:r,labelingInfo:u}=t.options;n.features.forEach(o=>{const l=o.attributes.ZD_NAME;if(l!=="高架支队"){let c=new f.Polygon({rings:o.geometry.rings});c=y.webMercatorToGeographic(c);const a=new g({geometry:c,attributes:o.attributes});if(r){if(r.type==="simple")a.symbol=r.symbol;else if(r.type==="unique-value"){const d=a.getAttribute("OBJECTID"),h=r.uniqueValueInfos.find(b=>b.value==d);a.symbol=h?h.symbol:r.defaultSymbol}}else a.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(i.push(a),u&&l!=="边防港航支队"&&l!=="机场支队"){const d=new g({geometry:c.centroid,symbol:{...u.symbol,text:l}});i.push(d)}}}),this.detachmentLayer.addMany(i),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=p;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResult } from '../../../types';
|
|
1
|
+
import { IFindSignalControlAreaParams, IResult } from '../../../types';
|
|
2
2
|
import DistrictController from './district-controller';
|
|
3
3
|
export default class CrossRenderer {
|
|
4
4
|
private view;
|
|
@@ -16,6 +16,6 @@ export default class CrossRenderer {
|
|
|
16
16
|
subDistrictId: string;
|
|
17
17
|
count: number;
|
|
18
18
|
}>;
|
|
19
|
-
filter(
|
|
19
|
+
filter(params: IFindSignalControlAreaParams): void;
|
|
20
20
|
resetFilter(): void;
|
|
21
21
|
}
|