gisviewer-vue3-arcgis 1.0.235 → 1.0.237
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/common-utils.d.ts +2 -0
- package/es/src/gis-map/utils/common-utils.mjs +37 -23
- package/es/src/gis-map/utils/detect-gpu.mjs +4 -4
- 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/district-renderer.d.ts +1 -2
- package/es/src/gis-map/utils/signal-control-area/district-renderer.mjs +19 -24
- 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 +39 -72
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.d.ts +3 -4
- package/es/src/gis-map/utils/signal-control-area/signal-renderer.mjs +36 -37
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +13 -6
- package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +95 -107
- package/es/src/types/index.d.ts +6 -0
- package/lib/src/gis-map/utils/common-utils.d.ts +2 -0
- package/lib/src/gis-map/utils/common-utils.js +1 -1
- package/lib/src/gis-map/utils/detect-gpu.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/district-renderer.d.ts +1 -2
- package/lib/src/gis-map/utils/signal-control-area/district-renderer.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 +3 -4
- 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 +13 -6
- 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,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
), this.subDistrictPointLayer.spatialReference = e.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new w(
|
|
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
|
+
constructor(e) {
|
|
7
|
+
this.roadConnections = [], this.view = e, this.subDistrictPointLayer = new m(
|
|
9
8
|
I
|
|
9
|
+
), this.subDistrictPointLayer.spatialReference = e.spatialReference, this.subDistrictPointLayer.popupEnabled = !0, this.subDistrictLineLayer = new m(
|
|
10
|
+
z
|
|
10
11
|
), this.subDistrictLineLayer.spatialReference = e.spatialReference, this.subDistrictLineLayer.popupEnabled = !0, this.view.map.addMany([
|
|
11
12
|
this.subDistrictLineLayer,
|
|
12
13
|
this.subDistrictPointLayer
|
|
@@ -14,16 +15,16 @@ class F {
|
|
|
14
15
|
}
|
|
15
16
|
async showSubDistricts(e) {
|
|
16
17
|
await this.clearSubDistricts(), this.clickHandler = this.view.on("click", this.viewHitTest.bind(this));
|
|
17
|
-
let
|
|
18
|
-
const
|
|
18
|
+
let s = 0;
|
|
19
|
+
const t = [], r = [];
|
|
19
20
|
e.forEach((i) => {
|
|
20
|
-
r.push({
|
|
21
|
+
i.roadConnections.length > 0 && this.roadConnections.push(...i.roadConnections), r.push({
|
|
21
22
|
value: i.id,
|
|
22
23
|
label: i.name,
|
|
23
24
|
symbol: {
|
|
24
25
|
type: "simple-marker",
|
|
25
26
|
style: "circle",
|
|
26
|
-
color: [
|
|
27
|
+
color: [...i.areaColor, 0.8],
|
|
27
28
|
size: "8px",
|
|
28
29
|
outline: {
|
|
29
30
|
color: [...i.areaColor],
|
|
@@ -31,14 +32,14 @@ class F {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
}), i.signals.forEach((a) => {
|
|
34
|
-
const
|
|
35
|
+
const n = new f({
|
|
35
36
|
geometry: {
|
|
36
37
|
type: "point",
|
|
37
38
|
longitude: a.longitude,
|
|
38
39
|
latitude: a.latitude
|
|
39
40
|
},
|
|
40
41
|
attributes: {
|
|
41
|
-
ObjectID:
|
|
42
|
+
ObjectID: s++,
|
|
42
43
|
id: a.nodeId,
|
|
43
44
|
name: a.name,
|
|
44
45
|
subDistrictId: i.id,
|
|
@@ -50,7 +51,7 @@ class F {
|
|
|
50
51
|
type: "subDistrict"
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
|
-
|
|
54
|
+
t.push(n);
|
|
54
55
|
});
|
|
55
56
|
}), this.subDistrictPointLayer.renderer = {
|
|
56
57
|
type: "unique-value",
|
|
@@ -95,41 +96,43 @@ class F {
|
|
|
95
96
|
}
|
|
96
97
|
]
|
|
97
98
|
}, this.currentPointRenderer = this.subDistrictPointLayer.renderer.clone(), await this.subDistrictPointLayer.applyEdits({
|
|
98
|
-
addFeatures:
|
|
99
|
-
}), await this.view.goTo(s, {
|
|
100
|
-
duration: this.hasGpu ? 1e3 : 0
|
|
99
|
+
addFeatures: t
|
|
101
100
|
});
|
|
102
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* 显示区控下的所有子区,用道路线表示
|
|
104
|
+
* @param id 区控ID
|
|
105
|
+
*/
|
|
103
106
|
async showRoads(e) {
|
|
104
|
-
const t = this.subDistrictPointLayer.createQuery();
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
),
|
|
109
|
-
|
|
110
|
-
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;
|
|
111
114
|
const {
|
|
112
|
-
subDistrictId:
|
|
113
|
-
color:
|
|
114
|
-
id:
|
|
115
|
-
districtName:
|
|
116
|
-
subDistrictName:
|
|
117
|
-
signalCount:
|
|
115
|
+
subDistrictId: o,
|
|
116
|
+
color: c,
|
|
117
|
+
id: d,
|
|
118
|
+
districtName: p,
|
|
119
|
+
subDistrictName: L,
|
|
120
|
+
signalCount: b
|
|
118
121
|
} = u.attributes;
|
|
119
|
-
|
|
120
|
-
color:
|
|
122
|
+
n.has(o) || n.set(o, {
|
|
123
|
+
color: c,
|
|
121
124
|
signalIds: [],
|
|
122
|
-
districtName:
|
|
123
|
-
subDistrictName:
|
|
124
|
-
signalCount:
|
|
125
|
-
}), (
|
|
125
|
+
districtName: p,
|
|
126
|
+
subDistrictName: L,
|
|
127
|
+
signalCount: b
|
|
128
|
+
}), (y = n.get(o)) == null || y.signalIds.push(d);
|
|
126
129
|
});
|
|
127
|
-
const
|
|
128
|
-
for (const u of
|
|
129
|
-
let
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
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,
|
|
133
136
|
symbol: {
|
|
134
137
|
type: "simple-line",
|
|
135
138
|
color: u[1].color.split(",").map(Number),
|
|
@@ -137,43 +140,28 @@ class F {
|
|
|
137
140
|
style: "solid"
|
|
138
141
|
}
|
|
139
142
|
});
|
|
140
|
-
const { districtName:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
geometry: {
|
|
159
|
-
type: "polyline",
|
|
160
|
-
paths: [D.coordinates]
|
|
161
|
-
},
|
|
162
|
-
attributes: {
|
|
163
|
-
ObjectID: c++,
|
|
164
|
-
id: D.id,
|
|
165
|
-
districtId: e,
|
|
166
|
-
subDistrictId: l,
|
|
167
|
-
subDistrictName: b,
|
|
168
|
-
districtName: p,
|
|
169
|
-
signalCount: y,
|
|
170
|
-
fromNode: L,
|
|
171
|
-
toNode: f,
|
|
172
|
-
color: u[1].color
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
a.push(g);
|
|
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
|
|
176
161
|
}
|
|
162
|
+
});
|
|
163
|
+
D.push(w);
|
|
164
|
+
});
|
|
177
165
|
}
|
|
178
166
|
this.subDistrictLineLayer.renderer = {
|
|
179
167
|
type: "unique-value",
|
|
@@ -185,7 +173,7 @@ class F {
|
|
|
185
173
|
style: "solid"
|
|
186
174
|
},
|
|
187
175
|
defaultLabel: "其他子区",
|
|
188
|
-
uniqueValueInfos:
|
|
176
|
+
uniqueValueInfos: h,
|
|
189
177
|
visualVariables: [
|
|
190
178
|
{
|
|
191
179
|
type: "size",
|
|
@@ -215,19 +203,19 @@ class F {
|
|
|
215
203
|
}
|
|
216
204
|
]
|
|
217
205
|
}, this.currentLineRenderer = this.subDistrictLineLayer.renderer.clone(), await this.subDistrictLineLayer.applyEdits({
|
|
218
|
-
addFeatures:
|
|
206
|
+
addFeatures: D
|
|
219
207
|
});
|
|
220
208
|
}
|
|
221
209
|
async clearSubDistricts() {
|
|
222
|
-
var
|
|
210
|
+
var t;
|
|
223
211
|
const e = await this.subDistrictPointLayer.queryFeatures();
|
|
224
212
|
e.features.length > 0 && await this.subDistrictPointLayer.applyEdits({
|
|
225
213
|
deleteFeatures: e.features
|
|
226
214
|
}), this.subDistrictPointLayer.definitionExpression = "1=1";
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
deleteFeatures:
|
|
230
|
-
}), this.subDistrictLineLayer.definitionExpression = "1=1", (
|
|
215
|
+
const s = await this.subDistrictLineLayer.queryFeatures();
|
|
216
|
+
s.features.length > 0 && await this.subDistrictLineLayer.applyEdits({
|
|
217
|
+
deleteFeatures: s.features
|
|
218
|
+
}), this.subDistrictLineLayer.definitionExpression = "1=1", (t = this.clickHandler) == null || t.remove();
|
|
231
219
|
}
|
|
232
220
|
setVisible(e) {
|
|
233
221
|
this.subDistrictPointLayer.visible = e, this.subDistrictLineLayer.visible = e;
|
|
@@ -237,12 +225,10 @@ class F {
|
|
|
237
225
|
* @param id 子区ID
|
|
238
226
|
*/
|
|
239
227
|
async locateSubDistrict(e) {
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
return
|
|
244
|
-
duration: this.hasGpu ? 1e3 : 0
|
|
245
|
-
}), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
|
|
228
|
+
const s = this.subDistrictPointLayer.createQuery();
|
|
229
|
+
s.where = `subDistrictId = '${e}'`, s.returnGeometry = !0;
|
|
230
|
+
const t = await this.subDistrictPointLayer.queryFeatures(s);
|
|
231
|
+
return t.features.length > 0 ? (await v.viewGoto(this.view, t.features), { status: 0, message: "ok" }) : { status: 1, message: "未找到子区" };
|
|
246
232
|
}
|
|
247
233
|
/**
|
|
248
234
|
* 高亮子区, 其他子区隐藏
|
|
@@ -250,22 +236,20 @@ class F {
|
|
|
250
236
|
* @return 返回高亮子区的数量以及区控id
|
|
251
237
|
*/
|
|
252
238
|
async highlightSubDistrict(e) {
|
|
253
|
-
let
|
|
254
|
-
const
|
|
239
|
+
let s = "";
|
|
240
|
+
const t = this.subDistrictPointLayer.definitionExpression;
|
|
255
241
|
this.subDistrictPointLayer.definitionExpression = `subDistrictId = '${e}'`;
|
|
256
242
|
const r = await this.subDistrictPointLayer.queryFeatures(), i = r.features.length;
|
|
257
|
-
return i > 0 ? (this.subDistrictLineLayer.definitionExpression = `subDistrictId = '${e}'`,
|
|
258
|
-
duration: this.hasGpu ? 1e3 : 0
|
|
259
|
-
})) : this.subDistrictPointLayer.definitionExpression = s, { count: i, parentId: t };
|
|
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 };
|
|
260
244
|
}
|
|
261
245
|
/**
|
|
262
246
|
* 按照区控、子区id显示子区
|
|
263
247
|
* @param type 类型,district 或 subDistrict
|
|
264
248
|
* @param id
|
|
265
249
|
*/
|
|
266
|
-
filter(e
|
|
267
|
-
const s = `${
|
|
268
|
-
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;
|
|
269
253
|
}
|
|
270
254
|
/**
|
|
271
255
|
* 重置过滤器,显示所有子区
|
|
@@ -273,17 +257,21 @@ class F {
|
|
|
273
257
|
resetFilter() {
|
|
274
258
|
this.subDistrictPointLayer.definitionExpression = "1=1", this.subDistrictLineLayer.definitionExpression = "1=1";
|
|
275
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* 监听地图点击事件,进行子区高亮
|
|
262
|
+
* @param event
|
|
263
|
+
*/
|
|
276
264
|
async viewHitTest(e) {
|
|
277
265
|
var r;
|
|
278
|
-
const
|
|
266
|
+
const t = (r = (await this.view.hitTest(e, {
|
|
279
267
|
include: [this.subDistrictPointLayer, this.subDistrictLineLayer]
|
|
280
268
|
})).results) == null ? void 0 : r.filter(
|
|
281
269
|
(i) => i.type === "graphic"
|
|
282
270
|
);
|
|
283
|
-
if (
|
|
284
|
-
this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
|
|
271
|
+
if (t.length === 0)
|
|
272
|
+
console.time("resetRenderer"), this.subDistrictPointLayer.renderer = this.currentPointRenderer, this.subDistrictLineLayer.renderer = this.currentLineRenderer;
|
|
285
273
|
else {
|
|
286
|
-
const i =
|
|
274
|
+
const i = t[0].graphic, a = i.attributes.color.split(",").map(Number);
|
|
287
275
|
this.subDistrictPointLayer.renderer = {
|
|
288
276
|
type: "unique-value",
|
|
289
277
|
field: "subDistrictId",
|
|
@@ -304,10 +292,10 @@ class F {
|
|
|
304
292
|
symbol: {
|
|
305
293
|
type: "simple-marker",
|
|
306
294
|
style: "circle",
|
|
307
|
-
color: [
|
|
295
|
+
color: [...a, 0.8],
|
|
308
296
|
size: "8px",
|
|
309
297
|
outline: {
|
|
310
|
-
color:
|
|
298
|
+
color: a,
|
|
311
299
|
width: 4
|
|
312
300
|
}
|
|
313
301
|
}
|
|
@@ -395,5 +383,5 @@ class F {
|
|
|
395
383
|
}
|
|
396
384
|
}
|
|
397
385
|
export {
|
|
398
|
-
|
|
386
|
+
C as default
|
|
399
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,4 +1,5 @@
|
|
|
1
1
|
import { Point, Polygon, Polyline } from '@arcgis/core/geometry';
|
|
2
|
+
import Graphic from '@arcgis/core/Graphic';
|
|
2
3
|
import * as turf from '@turf/helpers';
|
|
3
4
|
export default class CommonUtils {
|
|
4
5
|
/**
|
|
@@ -89,4 +90,5 @@ export default class CommonUtils {
|
|
|
89
90
|
* @returns
|
|
90
91
|
*/
|
|
91
92
|
static getCenterPointInLine(line: number[][]): number[];
|
|
93
|
+
static viewGoto(view: __esri.MapView | __esri.SceneView, target: Graphic[]): Promise<void>;
|
|
92
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/geometryEngineAsync"),w=require("@arcgis/core/geometry/support/webMercatorUtils"),p=require("@turf/bearing"),l=require("@turf/destination"),b=require("@turf/helpers"),S=require("@turf/length"),A=require("@turf/line-slice-along"),x=require("pako"),h=require("proj4");function y(u){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const t in u)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>u[t]})}}return e.default=u,Object.freeze(e)}const g=y(L),P=y(w),c=y(b);class i{static destinationWithPoint(e,t,n){const r=c.point([e.x,e.y]),s=l(r,n,t,{units:"meters"});return new f.Point({x:s.geometry.coordinates[0],y:s.geometry.coordinates[1]})}static angleOfLine(e){const t=e.paths[0],n=c.point(t[0]),r=c.point(t[t.length-1]);return p(n,r)}static extendLineInTowDir(e,t){const n=e.paths[0],r=c.point(n[0]),s=c.point(n[1]),o=p(s,r),a=l(r,t,o,{units:"meters"}),d=o>0?o-180:o+180,O=l(s,t,d,{units:"meters"});return new f.Polyline({paths:[[a.geometry.coordinates,O.geometry.coordinates]]})}static async getIntersectPointOfTwoLines(e,t){const n=await g.intersectLinesToPoints(e,t);if(n.length)return n[0]}static async getIntersectPointsOfStopLineAndLane(e,t,n){let r=await i.getIntersectPointOfLineAndPolygon(e,t);if(await i.pointDistance(r)<3&&n){for(const s of n)if(r=await i.getIntersectPointOfLineAndPolygon(e,t,s),await i.pointDistance(r)>2.5){const o=new f.Polyline({paths:[r]});return(await i.getOffsetLine(o,-s)).paths[0]}}else return r;return[]}static async pointDistance(e){if(e.length<2)return 0;const t=new f.Polyline({paths:[e]});return await g.geodesicLength(t,"meters")}static async getIntersectPointOfLineAndPolygon(e,t,n=0){n!==0&&(e=await i.getOffsetLine(e,n));const r=await g.intersect(e,t);if(r instanceof f.Polyline){const s=r.paths[0],o=s[0],a=s[s.length-1];return[o,a]}return[]}static async getOffsetLine(e,t){const n=P.geographicToWebMercator(e),r=await g.offset(n,t,"meters");return P.webMercatorToGeographic(r,!1)}static unzip(e){try{const t=[],n=e.split("");for(let s=0;s<n.length;s++){const o=n[s];t.push(o.charCodeAt(0))}const r=new Uint8Array(t);return x.inflate(r,{to:"string"})}catch{console.log(`非压缩内容: ${e}`)}}static getStdVecEntries(e,t=!1){const n=new Array(e.size());for(let r=0;r<e.size();r++)n[r]=e.get(r);return t&&e.delete(),n}static getStdMapEntries(e){const t=[];for(const n of i.getStdMapKeys(e))t.push([n,e.get(n)]);return t}static getStdMapKeys(e,t=!1){const n=[],r=e.keys();for(let s=0;s<r.size();s++)n.push(r.get(s));return r.delete(),t&&e.delete(),n}static setGeoData(e,t,n){i.geoReference=e,i.xOffset=t,i.yOffset=n}static transformLineProjection(e){try{return e.map(t=>h(i.geoReference).inverse([t[0]-i.xOffset,t[1]-i.yOffset]))}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static transformPointProjection(e){try{return h(i.geoReference).inverse([e[0]-i.xOffset,e[1]-i.yOffset])}catch{return console.error("OpenDrive坐标转换为WGS84坐标失败",i.geoReference),e}}static pointsEqual(e,t){return Math.abs(e[0]-t[0])<Number.EPSILON&&Math.abs(e[1]-t[1])<Number.EPSILON}static getExtensionLine(e,t,n){const r=c.point(e),s=c.point(t),o=p(r,s);return l(s,n,o,{units:"meters"}).geometry.coordinates}static isCoordinateValid(e){return typeof e.latitude=="string"&&(e.latitude=Number(e.latitude)),typeof e.longitude=="string"&&(e.longitude=Number(e.longitude)),e.latitude!==null&&e.longitude!==null&&!isNaN(e.latitude)&&!isNaN(e.longitude)&&e.latitude!==0&&e.longitude!==0}static getCenterPointInLine(e){const t=c.lineString(e),n=S(t,{units:"meters"})/2,r=A(t,0,n,{units:"meters"});return r.geometry.coordinates[r.geometry.coordinates.length-1]}static async viewGoto(e,t){var s;if(localStorage.getItem("gpu")!=="Unknown")await e.goTo(t,{duration:1e3});else if(t.length>0){const o=t.map(a=>a.geometry).filter(a=>a);if(o.length>0){const a=(s=await g.union(o))==null?void 0:s.extent;a&&(e.extent=a)}}}}exports.default=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=e=>{const r=[],o=e.split("");for(let t=0;t<o.length;t++)if(o[t]==="(")r.push(t);else if(o[t]===")"){const n=r.pop();n!==void 0&&(o.splice(n,t-n+1),t=n-1)}return o.join("")},i=e=>s(e).replace(/\/PCIe\/SSE2/g,"").replace(/\s+/g," ").trim(),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=e=>{const r=[],o=e.split("");for(let t=0;t<o.length;t++)if(o[t]==="(")r.push(t);else if(o[t]===")"){const n=r.pop();n!==void 0&&(o.splice(n,t-n+1),t=n-1)}return o.join("")},i=e=>s(e).replace(/\/PCIe\/SSE2/g,"").replace(/\s+/g," ").trim(),l=()=>{try{const e=document.createElement("canvas"),r=e.getContext("webgl")||e.getContext("experimental-webgl");if(!r)return"Unknown";const o=r.getExtension("WEBGL_debug_renderer_info");return o&&r.getParameter(o.UNMASKED_RENDERER_WEBGL)||"Unknown"}catch{return"Unknown"}},c=()=>{const e=l();try{if(/, or similar$/.test(e)||/SwiftShader/.test(e))return"Unknown";if(/^ANGLE/.test(e)){const r=e.match(/\((.+)\)$/);if(r){const o=r[1],t=o.split(/,\s*/g);let n=t[1];return/^ANGLE Metal Renderer: /.test(n)&&(n=e.split(": ")[1].split(",")[0]),t.length===1&&(n=t[0].split(" ").slice(1).join(" ")),/Direct3D/.test(n)&&(n=n.split("Direct3D")[0].trim()),n}}}catch{return"Unknown"}return i(e)},u=()=>{let e=c();return console.log("GPU:",e),(!e.toLowerCase().includes("nvidia")&&!e.toLowerCase().includes("amd")&&!e.toLowerCase().includes("intel")||e.toLowerCase().includes("520")||e.toLowerCase().includes("swiftshader"))&&(console.log("GPU is not supported or unknown:",e),e="Unknown"),localStorage.setItem("gpu",e),e};exports.default=u;
|
|
@@ -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;
|
|
@@ -7,8 +7,7 @@ export default class DistrictRenderer {
|
|
|
7
7
|
/** 区控实线图层,区控符号由半透明实线+不透明虚线组成 */
|
|
8
8
|
private districtControllerSolidLayer;
|
|
9
9
|
style: string;
|
|
10
|
-
|
|
11
|
-
constructor(view: __esri.MapView | __esri.SceneView, hasGpu: boolean);
|
|
10
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
12
11
|
/**
|
|
13
12
|
* 显示区控
|
|
14
13
|
* @param controllers 区控控制器数组
|
|
@@ -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 C=require("@arcgis/core/Graphic"),c=require("@arcgis/core/layers/FeatureLayer"),L=require("@turf/helpers"),d=require("@turf/turf"),l=require("../common-utils.js"),u=require("./layer-symbol.js");function g(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const n=g(L);class D{constructor(t){this.style="",this.view=t,this.districtControllerDashLayer=new c(u.districtDashLineLayerOptions),this.districtControllerDashLayer.spatialReference=t.spatialReference,this.districtControllerSolidLayer=new c(u.districtSolidLineLayerOptions),this.districtControllerSolidLayer.spatialReference=t.spatialReference,this.districtControllerSolidLayer.popupEnabled=!0,this.view.map.addMany([this.districtControllerDashLayer,this.districtControllerSolidLayer])}async showDistricts(t){await this.clearDistricts();const e=[];for(let i=0;i<t.length;i++){const r=t[i],s=r.getAllSignalCoordinates();let a=null;if(s.length>=2)if(s.length===2)a=n.lineString(s);else{const f=n.featureCollection(s.map(p=>n.point(p)));a=d.convex(f),a||(a=n.lineString(s))}else if(s.length===1)a=n.point(s[0]);else continue;const h=d.buffer(a.geometry,200,{units:"meters"}),y=new C({geometry:{type:"polyline",paths:h.geometry.coordinates},attributes:{ObjectID:i,id:r.id,name:r.name,subDistrictCount:r.subDistrictCount,signalCount:r.signalCount,parentId:r.parentId,parentName:r.parentName,selected:this.style,type:"district"}});e.push(y)}await this.districtControllerDashLayer.applyEdits({addFeatures:e}),await this.districtControllerSolidLayer.applyEdits({addFeatures:e}),await l.default.viewGoto(this.view,e)}async clearDistricts(){let t=await this.districtControllerDashLayer.queryFeatures();await this.districtControllerDashLayer.applyEdits({deleteFeatures:t.features}),this.districtControllerDashLayer.definitionExpression="1=1",t=await this.districtControllerSolidLayer.queryFeatures(),await this.districtControllerSolidLayer.applyEdits({deleteFeatures:t.features}),this.districtControllerSolidLayer.definitionExpression="1=1"}setVisible(t){this.districtControllerDashLayer.visible=t,this.districtControllerSolidLayer.visible=t}async locateDistrict(t){const e=this.districtControllerDashLayer.createQuery();e.where=`id = '${t}'`,e.returnGeometry=!0,e.outFields=["*"];const i=await this.districtControllerDashLayer.queryFeatures(e);return i.features.length>0?(await l.default.viewGoto(this.view,i.features),{status:0,message:"ok"}):{status:1,message:"未找到区控"}}async highlightDistrict(t){const e=this.districtControllerDashLayer.definitionExpression;this.districtControllerDashLayer.definitionExpression=`id = '${t}'`;const i=await this.districtControllerDashLayer.queryFeatures(),r=i.features.length;return r>0?(this.districtControllerSolidLayer.definitionExpression=`id = '${t}'`,await l.default.viewGoto(this.view,i.features)):this.districtControllerDashLayer.definitionExpression=e,r}filter(t){const e=`id = '${t}'`;this.districtControllerDashLayer.definitionExpression=e,this.districtControllerSolidLayer.definitionExpression=e}resetFilter(){this.districtControllerDashLayer.definitionExpression="1=1",this.districtControllerSolidLayer.definitionExpression="1=1"}}exports.default=D;
|
|
@@ -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,12 +1,11 @@
|
|
|
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;
|
|
5
|
-
private hasGpu;
|
|
6
5
|
private signalMarkerLayer;
|
|
7
6
|
private signalPictureLayer;
|
|
8
7
|
private signalClusterLayer;
|
|
9
|
-
constructor(view: __esri.MapView | __esri.SceneView
|
|
8
|
+
constructor(view: __esri.MapView | __esri.SceneView);
|
|
10
9
|
showSignals(controllers: DistrictController[]): Promise<void>;
|
|
11
10
|
clearSignals(): Promise<void>;
|
|
12
11
|
setPointVisible(visible: boolean): Promise<void>;
|
|
@@ -17,6 +16,6 @@ export default class CrossRenderer {
|
|
|
17
16
|
subDistrictId: string;
|
|
18
17
|
count: number;
|
|
19
18
|
}>;
|
|
20
|
-
filter(
|
|
19
|
+
filter(params: IFindSignalControlAreaParams): void;
|
|
21
20
|
resetFilter(): void;
|
|
22
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/Graphic"),u=require("@arcgis/core/layers/FeatureLayer"),l=require("./layer-symbol.js");class y{constructor(e
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/Graphic"),u=require("@arcgis/core/layers/FeatureLayer"),o=require("../common-utils.js"),l=require("./layer-symbol.js");class y{constructor(e){this.view=e,this.signalMarkerLayer=new u(l.signalMarkerLayerOptions),this.signalMarkerLayer.spatialReference=e.spatialReference,this.signalMarkerLayer.popupEnabled=!0,this.signalPictureLayer=new u(l.signalPictureLayerOptions),this.signalPictureLayer.spatialReference=e.spatialReference,this.signalPictureLayer.popupEnabled=!0,this.signalClusterLayer=new u(l.signalClusterLayerOptions),this.signalClusterLayer.spatialReference=e.spatialReference,this.signalClusterLayer.popupEnabled=!0,this.view.map.addMany([this.signalMarkerLayer,this.signalPictureLayer,this.signalClusterLayer])}async showSignals(e){await this.clearSignals();let r=0;const a=[];e.forEach(s=>{s.signals.forEach(i=>{const t=new d({geometry:{type:"point",longitude:i.longitude,latitude:i.latitude},attributes:{ObjectID:r++,id:i.id,name:i.name,signalId:i.signalId,nodeId:i.nodeId||i.id,districtId:s.id,districtName:s.name,subDistrictId:"",subDistrictName:"",isKey:i.isKey,type:"signal",selected:!0}});a.push(t)}),s.subDistricts.forEach(i=>{i.signals.forEach(t=>{const n=new d({geometry:{type:"point",longitude:t.longitude,latitude:t.latitude},attributes:{ObjectID:r++,id:t.id,name:t.name,signalId:t.signalId,nodeId:t.nodeId||t.id,districtId:s.id,districtName:s.name,subDistrictId:i.id,subDistrictName:i.name,isKey:t.isKey,type:"signal",selected:!0}});a.push(n)})})}),await this.signalMarkerLayer.applyEdits({addFeatures:a}),await this.signalPictureLayer.applyEdits({addFeatures:a}),await this.signalClusterLayer.applyEdits({addFeatures:a})}async clearSignals(){let e=await this.signalMarkerLayer.queryFeatures();await this.signalMarkerLayer.applyEdits({deleteFeatures:e.features}),this.signalMarkerLayer.definitionExpression="1=1",e=await this.signalPictureLayer.queryFeatures(),await this.signalPictureLayer.applyEdits({deleteFeatures:e.features}),this.signalPictureLayer.definitionExpression="1=1",e=await this.signalClusterLayer.queryFeatures(),await this.signalClusterLayer.applyEdits({deleteFeatures:e.features}),this.signalClusterLayer.definitionExpression="1=1"}async setPointVisible(e){this.signalMarkerLayer.visible=e,this.signalPictureLayer.visible=e}setClusterVisible(e){this.signalClusterLayer.visible=e}async locateSignal(e){return{status:0,message:"ok"}}async highlightSignal(e){let r="",a="";const s=this.signalMarkerLayer.definitionExpression;this.signalMarkerLayer.definitionExpression=`signalId = '${e}'`;const i=await this.signalMarkerLayer.queryFeatures(),t=i.features.length;if(t>0){const n=i.features[0].attributes.districtId||"",c=i.features[0].attributes.subDistrictId||"";return await o.default.viewGoto(this.view,i.features),{districtId:n,subDistrictId:c,count:t}}else this.signalMarkerLayer.definitionExpression=s;return{districtId:r,subDistrictId:a,count:t}}filter(e){const{id:r,type:a}=e,s=`${a==="district"?"districtId":"subDistrictId"} = '${r}'`;this.signalClusterLayer.definitionExpression=s,this.signalMarkerLayer.definitionExpression=s,this.signalPictureLayer.definitionExpression=s}resetFilter(){const e="1=1";this.signalClusterLayer.definitionExpression=e,this.signalMarkerLayer.definitionExpression=e,this.signalPictureLayer.definitionExpression=e}}exports.default=y;
|