gisviewer-vue3-arcgis 1.0.231 → 1.0.232
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/signal-control-area/district-controller.d.ts +1 -0
- package/es/src/gis-map/utils/signal-control-area/district-controller.mjs +28 -16
- package/es/src/gis-map/utils/signal-control-area/layer-symbol.mjs +5 -21
- package/es/src/gis-map/utils/signal-control-area/show-area.d.ts +3 -18
- package/es/src/gis-map/utils/signal-control-area/show-area.mjs +98 -288
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +5 -2
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +219 -65
- package/es/src/types/index.d.ts +6 -0
- package/lib/src/gis-map/utils/signal-control-area/district-controller.d.ts +1 -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 +3 -18
- package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
- package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +5 -2
- 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 +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResult } from '../../../types';
|
|
1
|
+
import { IResult, IRoadLine } from '../../../types';
|
|
2
2
|
import DistrictController from './district-controller';
|
|
3
3
|
export default class SubDistrictRenderer {
|
|
4
4
|
private view;
|
|
@@ -6,8 +6,10 @@ export default class SubDistrictRenderer {
|
|
|
6
6
|
private clickHandler;
|
|
7
7
|
private subDistrictPointLayer;
|
|
8
8
|
private subDistrictLineLayer;
|
|
9
|
+
roadLines: IRoadLine[];
|
|
9
10
|
constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
|
|
10
11
|
showSubDistricts(controllers: DistrictController[]): Promise<void>;
|
|
12
|
+
showRoads(districtId: string): Promise<void>;
|
|
11
13
|
clearSubDistricts(): Promise<void>;
|
|
12
14
|
setVisible(visible: boolean): void;
|
|
13
15
|
/**
|
|
@@ -34,6 +36,7 @@ export default class SubDistrictRenderer {
|
|
|
34
36
|
* 重置过滤器,显示所有子区
|
|
35
37
|
*/
|
|
36
38
|
resetFilter(): void;
|
|
37
|
-
private
|
|
39
|
+
private currentPointRenderer;
|
|
40
|
+
private currentLineRenderer;
|
|
38
41
|
private viewHitTest;
|
|
39
42
|
}
|
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { subDistrictPointLayerOptions as
|
|
4
|
-
class
|
|
5
|
-
constructor(
|
|
6
|
-
this.view =
|
|
7
|
-
|
|
8
|
-
), this.subDistrictPointLayer.spatialReference =
|
|
9
|
-
|
|
10
|
-
), this.subDistrictLineLayer.spatialReference =
|
|
1
|
+
import L from "@arcgis/core/Graphic";
|
|
2
|
+
import D from "@arcgis/core/layers/FeatureLayer";
|
|
3
|
+
import { subDistrictPointLayerOptions as m, subDistrictLineLayerOptions as w } from "./layer-symbol.mjs";
|
|
4
|
+
class x {
|
|
5
|
+
constructor(e, t) {
|
|
6
|
+
this.view = e, this.hasGpu = t, this.subDistrictPointLayer = new D(
|
|
7
|
+
m
|
|
8
|
+
), this.subDistrictPointLayer.spatialReference = e.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new D(
|
|
9
|
+
w
|
|
10
|
+
), this.subDistrictLineLayer.spatialReference = e.spatialReference, this.subDistrictLineLayer.popupEnabled = !1, this.view.map.addMany([
|
|
11
|
+
this.subDistrictLineLayer,
|
|
12
|
+
this.subDistrictPointLayer
|
|
13
|
+
]);
|
|
11
14
|
}
|
|
12
|
-
async showSubDistricts(
|
|
15
|
+
async showSubDistricts(e) {
|
|
13
16
|
await this.clearSubDistricts(), this.clickHandler = this.view.on("click", this.viewHitTest.bind(this));
|
|
14
|
-
let
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
+
let t = 0;
|
|
18
|
+
const s = [], r = [];
|
|
19
|
+
e.forEach((i) => {
|
|
17
20
|
r.push({
|
|
18
|
-
value:
|
|
19
|
-
label:
|
|
21
|
+
value: i.id,
|
|
22
|
+
label: i.name,
|
|
20
23
|
symbol: {
|
|
21
24
|
type: "simple-marker",
|
|
22
25
|
style: "circle",
|
|
23
26
|
color: [0, 0, 0, 0],
|
|
24
27
|
size: "8px",
|
|
25
28
|
outline: {
|
|
26
|
-
color: [...
|
|
29
|
+
color: [...i.areaColor],
|
|
27
30
|
width: 4
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
|
-
}),
|
|
31
|
-
const
|
|
33
|
+
}), i.signals.forEach((a) => {
|
|
34
|
+
const u = new L({
|
|
32
35
|
geometry: {
|
|
33
36
|
type: "point",
|
|
34
37
|
longitude: a.longitude,
|
|
35
38
|
latitude: a.latitude
|
|
36
39
|
},
|
|
37
40
|
attributes: {
|
|
38
|
-
ObjectID:
|
|
41
|
+
ObjectID: t++,
|
|
39
42
|
id: a.id,
|
|
40
43
|
name: a.name,
|
|
41
|
-
subDistrictId:
|
|
42
|
-
subDistrictName:
|
|
43
|
-
districtId:
|
|
44
|
-
districtName:
|
|
45
|
-
signalCount:
|
|
46
|
-
color:
|
|
44
|
+
subDistrictId: i.id,
|
|
45
|
+
subDistrictName: i.name,
|
|
46
|
+
districtId: i.parentId,
|
|
47
|
+
districtName: i.parentName,
|
|
48
|
+
signalCount: i.signalCount,
|
|
49
|
+
color: i.areaColor.join(","),
|
|
47
50
|
type: "subDistrict"
|
|
48
51
|
}
|
|
49
52
|
});
|
|
50
|
-
|
|
53
|
+
s.push(u);
|
|
51
54
|
});
|
|
52
55
|
}), this.subDistrictPointLayer.renderer = {
|
|
53
56
|
type: "unique-value",
|
|
54
57
|
field: "subDistrictId",
|
|
55
58
|
defaultSymbol: {
|
|
56
59
|
type: "simple-marker",
|
|
57
|
-
color:
|
|
60
|
+
color: [180, 180, 180, 0.5],
|
|
58
61
|
size: "8px",
|
|
59
62
|
outline: {
|
|
60
63
|
color: "white",
|
|
@@ -91,35 +94,137 @@ class y {
|
|
|
91
94
|
]
|
|
92
95
|
}
|
|
93
96
|
]
|
|
94
|
-
}, this.
|
|
95
|
-
addFeatures:
|
|
96
|
-
}), await this.view.goTo(
|
|
97
|
+
}, this.currentPointRenderer = this.subDistrictPointLayer.renderer.clone(), await this.subDistrictPointLayer.applyEdits({
|
|
98
|
+
addFeatures: s
|
|
99
|
+
}), await this.view.goTo(s, {
|
|
97
100
|
duration: this.hasGpu ? 1e3 : 0
|
|
98
101
|
});
|
|
99
102
|
}
|
|
103
|
+
async showRoads(e) {
|
|
104
|
+
const t = this.subDistrictPointLayer.createQuery();
|
|
105
|
+
t.where = `districtId = '${e}'`;
|
|
106
|
+
const s = await this.subDistrictPointLayer.queryFeatures(
|
|
107
|
+
t
|
|
108
|
+
), r = /* @__PURE__ */ new Map();
|
|
109
|
+
s.features.forEach((u) => {
|
|
110
|
+
var o;
|
|
111
|
+
const { subDistrictId: l, color: c, id: n } = u.attributes;
|
|
112
|
+
r.has(l) || r.set(l, { color: c, signalIds: [] }), (o = r.get(l)) == null || o.signalIds.push(n);
|
|
113
|
+
});
|
|
114
|
+
const i = [], a = [];
|
|
115
|
+
for (const u of r) {
|
|
116
|
+
let l = 0;
|
|
117
|
+
const c = u[0];
|
|
118
|
+
i.push({
|
|
119
|
+
value: c,
|
|
120
|
+
symbol: {
|
|
121
|
+
type: "simple-line",
|
|
122
|
+
color: u[1].color.split(",").map(Number),
|
|
123
|
+
width: 2,
|
|
124
|
+
style: "solid"
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const n = u[1].signalIds;
|
|
128
|
+
if (!(n.length < 2))
|
|
129
|
+
for (let o = 0; o < n.length; o++)
|
|
130
|
+
for (let d = 0; d < n.length; d++) {
|
|
131
|
+
if (o === d)
|
|
132
|
+
continue;
|
|
133
|
+
const p = n[o], y = n[d];
|
|
134
|
+
if (a.some((h) => {
|
|
135
|
+
const f = h.attributes;
|
|
136
|
+
return f && f.fromNode === y && f.toNode === p;
|
|
137
|
+
}))
|
|
138
|
+
continue;
|
|
139
|
+
const b = this.roadLines.find(
|
|
140
|
+
(h) => h.fromNode === p && h.toNode === y
|
|
141
|
+
);
|
|
142
|
+
if (!b)
|
|
143
|
+
continue;
|
|
144
|
+
const v = new L({
|
|
145
|
+
geometry: {
|
|
146
|
+
type: "polyline",
|
|
147
|
+
paths: [b.coordinates]
|
|
148
|
+
},
|
|
149
|
+
attributes: {
|
|
150
|
+
ObjectID: l++,
|
|
151
|
+
id: b.id,
|
|
152
|
+
districtId: e,
|
|
153
|
+
subDistrictId: c,
|
|
154
|
+
fromNode: p,
|
|
155
|
+
toNode: y,
|
|
156
|
+
color: u[1].color
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
a.push(v);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
this.subDistrictLineLayer.renderer = {
|
|
163
|
+
type: "unique-value",
|
|
164
|
+
field: "subDistrictId",
|
|
165
|
+
defaultSymbol: {
|
|
166
|
+
type: "simple-line",
|
|
167
|
+
color: [180, 180, 180, 0.5],
|
|
168
|
+
width: 2,
|
|
169
|
+
style: "solid"
|
|
170
|
+
},
|
|
171
|
+
defaultLabel: "其他子区",
|
|
172
|
+
uniqueValueInfos: i,
|
|
173
|
+
visualVariables: [
|
|
174
|
+
{
|
|
175
|
+
type: "size",
|
|
176
|
+
valueExpression: "$view.scale",
|
|
177
|
+
stops: [
|
|
178
|
+
{
|
|
179
|
+
size: 6,
|
|
180
|
+
value: 2500
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
size: 5,
|
|
184
|
+
value: 5e3
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
size: 4,
|
|
188
|
+
value: 18055.954822000003
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
size: 3,
|
|
192
|
+
value: 144447.638572
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
size: 2,
|
|
196
|
+
value: 1155581108577e-6
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}, this.currentLineRenderer = this.subDistrictLineLayer.renderer.clone(), await this.subDistrictLineLayer.applyEdits({
|
|
202
|
+
addFeatures: a
|
|
203
|
+
});
|
|
204
|
+
}
|
|
100
205
|
async clearSubDistricts() {
|
|
101
|
-
var
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
deleteFeatures:
|
|
206
|
+
var s;
|
|
207
|
+
const e = await this.subDistrictPointLayer.queryFeatures();
|
|
208
|
+
e.features.length > 0 && await this.subDistrictPointLayer.applyEdits({
|
|
209
|
+
deleteFeatures: e.features
|
|
105
210
|
}), this.subDistrictPointLayer.definitionExpression = "1=1";
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
deleteFeatures:
|
|
109
|
-
}), this.subDistrictLineLayer.definitionExpression = "1=1", (
|
|
211
|
+
const t = await this.subDistrictLineLayer.queryFeatures();
|
|
212
|
+
t.features.length > 0 && await this.subDistrictLineLayer.applyEdits({
|
|
213
|
+
deleteFeatures: t.features
|
|
214
|
+
}), this.subDistrictLineLayer.definitionExpression = "1=1", (s = this.clickHandler) == null || s.remove();
|
|
110
215
|
}
|
|
111
|
-
setVisible(
|
|
112
|
-
this.subDistrictPointLayer.visible =
|
|
216
|
+
setVisible(e) {
|
|
217
|
+
this.subDistrictPointLayer.visible = e, this.subDistrictLineLayer.visible = e;
|
|
113
218
|
}
|
|
114
219
|
/**
|
|
115
220
|
* 定位子区
|
|
116
221
|
* @param id 子区ID
|
|
117
222
|
*/
|
|
118
|
-
async locateSubDistrict(
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
return
|
|
223
|
+
async locateSubDistrict(e) {
|
|
224
|
+
const t = this.subDistrictPointLayer.createQuery();
|
|
225
|
+
t.where = `subDistrictId = '${e}'`, t.returnGeometry = !0;
|
|
226
|
+
const s = await this.subDistrictPointLayer.queryFeatures(t);
|
|
227
|
+
return s.features.length > 0 ? (await this.view.goTo(s.features, {
|
|
123
228
|
duration: this.hasGpu ? 1e3 : 0
|
|
124
229
|
}), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
|
|
125
230
|
}
|
|
@@ -128,23 +233,23 @@ class y {
|
|
|
128
233
|
* @param id 子区ID
|
|
129
234
|
* @return 返回高亮子区的数量以及区控id
|
|
130
235
|
*/
|
|
131
|
-
async highlightSubDistrict(
|
|
132
|
-
let
|
|
133
|
-
const
|
|
134
|
-
this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${
|
|
135
|
-
const r = await this.subDistrictPointLayer.queryFeatures(),
|
|
136
|
-
return
|
|
236
|
+
async highlightSubDistrict(e) {
|
|
237
|
+
let t = "";
|
|
238
|
+
const s = this.subDistrictPointLayer.definitionExpression;
|
|
239
|
+
this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${e}'`;
|
|
240
|
+
const r = await this.subDistrictPointLayer.queryFeatures(), i = r.features.length;
|
|
241
|
+
return i > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${e}'`, t = r.features[0].attributes.districtId, await this.view.goTo(r.features, {
|
|
137
242
|
duration: this.hasGpu ? 1e3 : 0
|
|
138
|
-
})) : this.subDistrictPointLayer.definitionExpression =
|
|
243
|
+
})) : this.subDistrictPointLayer.definitionExpression = s, { count: i, parentId: t };
|
|
139
244
|
}
|
|
140
245
|
/**
|
|
141
246
|
* 按照区控、子区id显示子区
|
|
142
247
|
* @param type 类型,district 或 subDistrict
|
|
143
248
|
* @param id
|
|
144
249
|
*/
|
|
145
|
-
filter(
|
|
146
|
-
const
|
|
147
|
-
this.subDistrictPointLayer.definitionExpression =
|
|
250
|
+
filter(e, t) {
|
|
251
|
+
const s = `${e === "district" ? "districtId" : "subDistrictId"} = '${t}'`;
|
|
252
|
+
this.subDistrictPointLayer.definitionExpression = s, this.subDistrictLineLayer.definitionExpression = s;
|
|
148
253
|
}
|
|
149
254
|
/**
|
|
150
255
|
* 重置过滤器,显示所有子区
|
|
@@ -152,17 +257,17 @@ class y {
|
|
|
152
257
|
resetFilter() {
|
|
153
258
|
this.subDistrictPointLayer.definitionExpression = "1=1", this.subDistrictLineLayer.definitionExpression = "1=1";
|
|
154
259
|
}
|
|
155
|
-
async viewHitTest(
|
|
260
|
+
async viewHitTest(e) {
|
|
156
261
|
var r;
|
|
157
|
-
const
|
|
262
|
+
const s = (r = (await this.view.hitTest(e, {
|
|
158
263
|
include: [this.subDistrictPointLayer]
|
|
159
264
|
})).results) == null ? void 0 : r.filter(
|
|
160
|
-
(
|
|
265
|
+
(i) => i.type === "graphic"
|
|
161
266
|
);
|
|
162
|
-
if (
|
|
163
|
-
this.
|
|
267
|
+
if (s.length === 0)
|
|
268
|
+
this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
|
|
164
269
|
else {
|
|
165
|
-
const
|
|
270
|
+
const i = s[0].graphic;
|
|
166
271
|
this.subDistrictPointLayer.renderer = {
|
|
167
272
|
type: "unique-value",
|
|
168
273
|
field: "subDistrictId",
|
|
@@ -179,14 +284,14 @@ class y {
|
|
|
179
284
|
defaultLabel: "其他子区",
|
|
180
285
|
uniqueValueInfos: [
|
|
181
286
|
{
|
|
182
|
-
value:
|
|
287
|
+
value: i.attributes.subDistrictId,
|
|
183
288
|
symbol: {
|
|
184
289
|
type: "simple-marker",
|
|
185
290
|
style: "circle",
|
|
186
291
|
color: [0, 0, 0, 0],
|
|
187
292
|
size: "8px",
|
|
188
293
|
outline: {
|
|
189
|
-
color:
|
|
294
|
+
color: i.attributes.color.split(",").map(Number),
|
|
190
295
|
width: 4
|
|
191
296
|
}
|
|
192
297
|
}
|
|
@@ -220,10 +325,59 @@ class y {
|
|
|
220
325
|
]
|
|
221
326
|
}
|
|
222
327
|
]
|
|
328
|
+
}, this.subDistrictLineLayer.renderer = {
|
|
329
|
+
type: "unique-value",
|
|
330
|
+
field: "subDistrictId",
|
|
331
|
+
defaultSymbol: {
|
|
332
|
+
type: "simple-line",
|
|
333
|
+
style: "solid",
|
|
334
|
+
color: [180, 180, 180, 0.5],
|
|
335
|
+
width: "8px"
|
|
336
|
+
},
|
|
337
|
+
defaultLabel: "其他子区",
|
|
338
|
+
uniqueValueInfos: [
|
|
339
|
+
{
|
|
340
|
+
value: i.attributes.subDistrictId,
|
|
341
|
+
symbol: {
|
|
342
|
+
type: "simple-line",
|
|
343
|
+
style: "solid",
|
|
344
|
+
color: i.attributes.color.split(",").map(Number),
|
|
345
|
+
width: "8px"
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
visualVariables: [
|
|
350
|
+
{
|
|
351
|
+
type: "size",
|
|
352
|
+
valueExpression: "$view.scale",
|
|
353
|
+
stops: [
|
|
354
|
+
{
|
|
355
|
+
size: 6,
|
|
356
|
+
value: 2500
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
size: 5,
|
|
360
|
+
value: 5e3
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
size: 4,
|
|
364
|
+
value: 18055.954822000003
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
size: 3,
|
|
368
|
+
value: 144447.638572
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
size: 2,
|
|
372
|
+
value: 1155581108577e-6
|
|
373
|
+
}
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
]
|
|
223
377
|
};
|
|
224
378
|
}
|
|
225
379
|
}
|
|
226
380
|
}
|
|
227
381
|
export {
|
|
228
|
-
|
|
382
|
+
x as default
|
|
229
383
|
};
|
package/es/src/types/index.d.ts
CHANGED
|
@@ -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 u=require("../common-utils.js");class r{constructor(s,a){this.parentName="",this.signals=[],this.subDistricts=[],this.areaColor=this.getDarkNonGrayColor(),this.signalCount=0,this.subDistrictCount=0,this.id=s.name,this.name=s.areaDesc,this.parentId=s.parentId,a==="alarm"&&(this.areaColor=[255,0,0]);for(const t of s.children)if(t.children){const i=new r(t,a);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}else if(u.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 s=[];for(const a of this.signals)s.push([a.longitude,a.latitude]);for(const a of this.subDistricts)s.push(...a.getAllSignalCoordinates());return s}getDarkNonGrayColor(s){let a,t,i;if(s){const e=this.cyrb53(s);a=Math.abs(e)%360,t=80+Math.abs(e>>3)%21,i=10+Math.abs(e>>7)%41}else a=Math.floor(Math.random()*360),t=80+Math.random()*20,i=15+Math.random()*35;const o=t/100*Math.min(i/100,1-i/100),n=e=>{const l=(e+a/30)%12,h=i/100-o*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*h)};return[n(0),n(8),n(4)]}cyrb53(s,a=0){let t=3735928559^a,i=1103547991^a;for(let o=0,n;o<s.length;o++)n=s.charCodeAt(o),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:"subDistrictController",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:"subDistrictController",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"}]},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:"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}]}]}},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
|
+
"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:"subDistrictId",type:"string"},{name:"fromNode",type:"string"},{name:"toNode",type:"string"},{name:"color",type:"string"}]},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:"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}]}]}},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;
|
|
@@ -8,19 +8,9 @@ export default class SignalControlAreaController1 {
|
|
|
8
8
|
private districtRenderer;
|
|
9
9
|
private subDistrictRenderer;
|
|
10
10
|
private signalRenderer;
|
|
11
|
-
private clickHandler;
|
|
12
|
-
private districtControllerOid;
|
|
13
|
-
private subDistrictControllerOid;
|
|
14
|
-
private signalOid;
|
|
15
|
-
private popupEnabled;
|
|
16
11
|
private mapConfig;
|
|
12
|
+
private roadLines;
|
|
17
13
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
18
|
-
/** 暂存等待绘制的区控graphic */
|
|
19
|
-
private districtGraphics;
|
|
20
|
-
/** 暂存等待绘制的子区graphic */
|
|
21
|
-
private subDistrictGraphics;
|
|
22
|
-
/** 暂存等待绘制的信号机graphic */
|
|
23
|
-
private signalGraphics;
|
|
24
14
|
/**
|
|
25
15
|
* 显示所有区控、子区、信号机
|
|
26
16
|
* @param params
|
|
@@ -62,15 +52,10 @@ export default class SignalControlAreaController1 {
|
|
|
62
52
|
message: string;
|
|
63
53
|
}>;
|
|
64
54
|
/**
|
|
65
|
-
*
|
|
66
|
-
* @param districtController
|
|
67
|
-
* @param isDistrict 是否是区控
|
|
55
|
+
* 获取道路线
|
|
68
56
|
* @returns
|
|
69
57
|
*/
|
|
70
|
-
private
|
|
71
|
-
/**
|
|
72
|
-
* 重置所有graphic的置灰状态
|
|
73
|
-
*/
|
|
58
|
+
private loadRoadLine;
|
|
74
59
|
/**
|
|
75
60
|
* 加载支队图层
|
|
76
61
|
* 现场环境用url创建FeatureLayer有各种问题,
|
|
@@ -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 f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils"),g=require("@arcgis/core/Graphic"),R=require("@arcgis/core/layers/GraphicsLayer"),w=require("papaparse"),D=require("../../stores/index.js"),p=require("./district-controller.js"),m=require("./district-renderer.js"),L=require("./signal-renderer.js"),S=require("./sub-district-renderer.js");class C{constructor(e){this.detachmentLayerLoaded=!1,this.view=e,this.hasGpu=localStorage.getItem("gpu")!=="Unknown";const t=D.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.detachmentLayer=new R,this.view.map.add(this.detachmentLayer),this.districtRenderer=new m.default(e,this.hasGpu),this.subDistrictRenderer=new S.default(e,this.hasGpu),this.signalRenderer=new L.default(e,this.hasGpu)}async showSignalControlArea(e){this.detachmentLayerLoaded||await this.loadDetachmentLayer(),this.roadLines||(await this.loadRoadLine(),this.subDistrictRenderer.roadLines=this.roadLines),await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const t=[],s=[];for(const a of e.areaList){const i=new p.default(a,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("district",e.id),this.signalRenderer.filter("district",e.id),this.roadLines&&this.roadLines.length>0&&await this.subDistrictRenderer.showRoads(e.id),{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("subDistrict",e.id),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:t,subDistrictId:s,count:a}=await this.signalRenderer.highlightSignal(e.id);return a>0?(this.districtRenderer.filter(t),this.subDistrictRenderer.filter("subDistrict",s),{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 loadRoadLine(){var t;const e=(t=this.mapConfig.signalControlArea)==null?void 0:t.roadLayerUrl;if(!e){console.warn("未配置道路线图层URL");return}try{const a=await(await fetch(`/GisViewerAssets/${e}`)).text();w.parse(a,{header:!0,skipEmptyLines:!0,complete:i=>{const{data:r}=i;this.roadLines=r.map(n=>({id:n.ROADSECT_ID,fromNode:n.FROM_NODE_ID,toNode:n.TO_NODE_ID,coordinates:JSON.parse(n.GEOM).coordinates}))},error:i=>{console.error("道路线CSV解析失败:",i)}})}catch(s){console.error("读取道路线CSV失败:",s)}}async loadDetachmentLayer(){const e=this.mapConfig.baseLayers;if(!e)return;const t=e.find(s=>s.options.id==="shanghai_district");if(t)try{const a=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),i=[],{renderer:r,labelingInfo:n}=t.options;a.features.forEach(d=>{const c=d.attributes.ZD_NAME;if(c!=="高架支队"){let l=new f.Polygon({rings:d.geometry.rings});l=y.webMercatorToGeographic(l);const o=new g({geometry:l,attributes:d.attributes});if(r){if(r.type==="simple")o.symbol=r.symbol;else if(r.type==="unique-value"){const h=o.getAttribute("OBJECTID"),u=r.uniqueValueInfos.find(b=>b.value==h);o.symbol=u?u.symbol:r.defaultSymbol}}else o.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(i.push(o),n&&c!=="边防港航支队"&&c!=="机场支队"){const h=new g({geometry:l.centroid,symbol:{...n.symbol,text:c}});i.push(h)}}}),this.detachmentLayer.addMany(i),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=C;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResult } from '../../../types';
|
|
1
|
+
import { IResult, IRoadLine } from '../../../types';
|
|
2
2
|
import DistrictController from './district-controller';
|
|
3
3
|
export default class SubDistrictRenderer {
|
|
4
4
|
private view;
|
|
@@ -6,8 +6,10 @@ export default class SubDistrictRenderer {
|
|
|
6
6
|
private clickHandler;
|
|
7
7
|
private subDistrictPointLayer;
|
|
8
8
|
private subDistrictLineLayer;
|
|
9
|
+
roadLines: IRoadLine[];
|
|
9
10
|
constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
|
|
10
11
|
showSubDistricts(controllers: DistrictController[]): Promise<void>;
|
|
12
|
+
showRoads(districtId: string): Promise<void>;
|
|
11
13
|
clearSubDistricts(): Promise<void>;
|
|
12
14
|
setVisible(visible: boolean): void;
|
|
13
15
|
/**
|
|
@@ -34,6 +36,7 @@ export default class SubDistrictRenderer {
|
|
|
34
36
|
* 重置过滤器,显示所有子区
|
|
35
37
|
*/
|
|
36
38
|
resetFilter(): void;
|
|
37
|
-
private
|
|
39
|
+
private currentPointRenderer;
|
|
40
|
+
private currentLineRenderer;
|
|
38
41
|
private viewHitTest;
|
|
39
42
|
}
|
|
@@ -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 L=require("@arcgis/core/Graphic"),D=require("@arcgis/core/layers/FeatureLayer"),v=require("./layer-symbol.js");class w{constructor(e,t){this.view=e,this.hasGpu=t,this.subDistrictPointLayer=new D(v.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=e.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new D(v.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=e.spatialReference,this.subDistrictLineLayer.popupEnabled=!1,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(e){await this.clearSubDistricts(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let t=0;const s=[],r=[];e.forEach(i=>{r.push({value:i.id,label:i.name,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[...i.areaColor],width:4}}}),i.signals.forEach(a=>{const u=new L({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:t++,id:a.id,name:a.name,subDistrictId:i.id,subDistrictName:i.name,districtId:i.parentId,districtName:i.parentName,signalCount:i.signalCount,color:i.areaColor.join(","),type:"subDistrict"}});s.push(u)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:[180,180,180,.5],size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:s}),await this.view.goTo(s,{duration:this.hasGpu?1e3:0})}async showRoads(e){const t=this.subDistrictPointLayer.createQuery();t.where=`districtId = '${e}'`;const s=await this.subDistrictPointLayer.queryFeatures(t),r=new Map;s.features.forEach(u=>{var o;const{subDistrictId:l,color:c,id:n}=u.attributes;r.has(l)||r.set(l,{color:c,signalIds:[]}),(o=r.get(l))==null||o.signalIds.push(n)});const i=[],a=[];for(const u of r){let l=0;const c=u[0];i.push({value:c,symbol:{type:"simple-line",color:u[1].color.split(",").map(Number),width:2,style:"solid"}});const n=u[1].signalIds;if(!(n.length<2))for(let o=0;o<n.length;o++)for(let d=0;d<n.length;d++){if(o===d)continue;const p=n[o],y=n[d];if(a.some(h=>{const f=h.attributes;return f&&f.fromNode===y&&f.toNode===p}))continue;const b=this.roadLines.find(h=>h.fromNode===p&&h.toNode===y);if(!b)continue;const m=new L({geometry:{type:"polyline",paths:[b.coordinates]},attributes:{ObjectID:l++,id:b.id,districtId:e,subDistrictId:c,fromNode:p,toNode:y,color:u[1].color}});a.push(m)}}this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",color:[180,180,180,.5],width:2,style:"solid"},defaultLabel:"其他子区",uniqueValueInfos:i,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentLineRenderer=this.subDistrictLineLayer.renderer.clone(),await this.subDistrictLineLayer.applyEdits({addFeatures:a})}async clearSubDistricts(){var s;const e=await this.subDistrictPointLayer.queryFeatures();e.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:e.features}),this.subDistrictPointLayer.definitionExpression="1=1";const t=await this.subDistrictLineLayer.queryFeatures();t.features.length>0&&await this.subDistrictLineLayer.applyEdits({deleteFeatures:t.features}),this.subDistrictLineLayer.definitionExpression="1=1",(s=this.clickHandler)==null||s.remove()}setVisible(e){this.subDistrictPointLayer.visible=e,this.subDistrictLineLayer.visible=e}async locateSubDistrict(e){const t=this.subDistrictPointLayer.createQuery();t.where=`subDistrictId = '${e}'`,t.returnGeometry=!0;const s=await this.subDistrictPointLayer.queryFeatures(t);return s.features.length>0?(await this.view.goTo(s.features,{duration:this.hasGpu?1e3:0}),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(e){let t="";const s=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${e}'`;const r=await this.subDistrictPointLayer.queryFeatures(),i=r.features.length;return i>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${e}'`,t=r.features[0].attributes.districtId,await this.view.goTo(r.features,{duration:this.hasGpu?1e3:0})):this.subDistrictPointLayer.definitionExpression=s,{count:i,parentId:t}}filter(e,t){const s=`${e==="district"?"districtId":"subDistrictId"} = '${t}'`;this.subDistrictPointLayer.definitionExpression=s,this.subDistrictLineLayer.definitionExpression=s}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(e){var r;const s=(r=(await this.view.hitTest(e,{include:[this.subDistrictPointLayer]})).results)==null?void 0:r.filter(i=>i.type==="graphic");if(s.length===0)this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const i=s[0].graphic;this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:i.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:i.attributes.color.split(",").map(Number),width:4}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",style:"solid",color:[180,180,180,.5],width:"8px"},defaultLabel:"其他子区",uniqueValueInfos:[{value:i.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:i.attributes.color.split(",").map(Number),width:"8px"}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}}}}exports.default=w;
|