gisviewer-vue3-arcgis 1.0.246 → 1.0.248

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.
@@ -1,21 +1,144 @@
1
- import { subclass as a } from "@arcgis/core/core/accessorSupport/decorators";
2
- import c from "@arcgis/core/layers/BaseTileLayer.js";
3
- var i = Object.defineProperty, m = Object.getOwnPropertyDescriptor, f = (e, l, t, s) => {
4
- for (var r = s > 1 ? void 0 : s ? m(l, t) : l, p = e.length - 1, o; p >= 0; p--)
5
- (o = e[p]) && (r = (s ? o(l, t, r) : o(r)) || r);
6
- return s && r && i(l, t, r), r;
1
+ import { subclass as u } from "@arcgis/core/core/accessorSupport/decorators";
2
+ import a from "@arcgis/core/layers/BaseTileLayer.js";
3
+ var c = Object.defineProperty, v = Object.getOwnPropertyDescriptor, p = (e, s, o, r) => {
4
+ for (var l = r > 1 ? void 0 : r ? v(s, o) : s, t = e.length - 1, i; t >= 0; t--)
5
+ (i = e[t]) && (l = (r ? i(s, o, l) : i(l)) || l);
6
+ return r && l && c(s, o, l), l;
7
7
  };
8
- let u = class extends c {
8
+ let n = class extends a {
9
9
  constructor(e) {
10
- super(e), this.urlTemplate = "", this.urlTemplate = e.urlTemplate;
10
+ e.tileInfo || (e.tileInfo = {
11
+ dpi: 96,
12
+ size: [256, 256],
13
+ format: "png",
14
+ origin: {
15
+ x: -400,
16
+ y: 400
17
+ },
18
+ spatialReference: {
19
+ wkid: 4326
20
+ },
21
+ lods: [
22
+ {
23
+ level: "0",
24
+ scale: 591657527591555e-6,
25
+ resolution: 1.4078260157100582
26
+ },
27
+ {
28
+ level: "1",
29
+ scale: 295828763795777e-6,
30
+ resolution: 0.703913007855028
31
+ },
32
+ {
33
+ level: "2",
34
+ scale: 147914381897889e-6,
35
+ resolution: 0.35195650392751515
36
+ },
37
+ {
38
+ level: "3",
39
+ scale: 7395719094894399e-8,
40
+ resolution: 0.17597825196375638
41
+ },
42
+ {
43
+ level: "4",
44
+ scale: 36978595474471994e-9,
45
+ resolution: 0.08798912598187819
46
+ },
47
+ {
48
+ level: "5",
49
+ scale: 18489297737235997e-9,
50
+ resolution: 0.043994562990939096
51
+ },
52
+ {
53
+ level: "6",
54
+ scale: 9244648868617998e-9,
55
+ resolution: 0.021997281495469548
56
+ },
57
+ {
58
+ level: "7",
59
+ scale: 4622324434308999e-9,
60
+ resolution: 0.010998640747734774
61
+ },
62
+ {
63
+ level: "8",
64
+ scale: 2311162217155e-6,
65
+ resolution: 0.005499320373868577
66
+ },
67
+ {
68
+ level: "9",
69
+ scale: 1155581108577e-6,
70
+ resolution: 0.0027496601869330985
71
+ },
72
+ {
73
+ level: "10",
74
+ scale: 577790.554289,
75
+ resolution: 0.001374830093467739
76
+ },
77
+ {
78
+ level: "11",
79
+ scale: 288895.277144,
80
+ resolution: 6874150467326798e-19
81
+ },
82
+ {
83
+ level: "12",
84
+ scale: 144447.638572,
85
+ resolution: 3437075233663399e-19
86
+ },
87
+ {
88
+ level: "13",
89
+ scale: 72223.819286,
90
+ resolution: 17185376168316996e-20
91
+ },
92
+ {
93
+ level: "14",
94
+ scale: 36111.909643,
95
+ resolution: 8592688084158498e-20
96
+ },
97
+ {
98
+ level: "15",
99
+ scale: 9027.99546661377,
100
+ resolution: 4296344042198222e-20
101
+ },
102
+ {
103
+ level: "16",
104
+ scale: 9027.977411,
105
+ resolution: 2148172021099111e-20
106
+ },
107
+ {
108
+ level: "17",
109
+ scale: 4513.988705,
110
+ resolution: 10740860104305824e-21
111
+ },
112
+ {
113
+ level: "18",
114
+ scale: 2256.994353,
115
+ resolution: 53704300533426425e-22
116
+ },
117
+ {
118
+ level: "19",
119
+ scale: 1128.497176,
120
+ resolution: 2685215025481591e-21
121
+ },
122
+ {
123
+ level: "20",
124
+ scale: 564.248588,
125
+ resolution: 13426075127407955e-22
126
+ },
127
+ {
128
+ level: "21",
129
+ scale: 282.124294,
130
+ resolution: 6713037563703978e-22
131
+ }
132
+ ]
133
+ }), super(e), this.urlTemplate = "", this.urlTemplate = e.urlTemplate;
11
134
  }
12
- getTileUrl(e, l, t) {
13
- return this.urlTemplate.replace("{level}", String(e)).replace("{col}", String(t)).replace("{row}", String(l));
135
+ getTileUrl(e, s, o) {
136
+ return this.urlTemplate.replace("{level}", String(e)).replace("{col}", String(o)).replace("{row}", String(s));
14
137
  }
15
138
  };
16
- u = f([
17
- a("CustomWMTS")
18
- ], u);
139
+ n = p([
140
+ u("CustomWMTS")
141
+ ], n);
19
142
  export {
20
- u as default
143
+ n as default
21
144
  };
@@ -0,0 +1,14 @@
1
+ import { IResult, IShowEdpassDeviceParams } from '../../types';
2
+ export default class EdpassDeviceController {
3
+ private view;
4
+ private cameraNormalLayer;
5
+ private cameraAbnormalLayer;
6
+ private kkNormalLayer;
7
+ private kkAbnormalLayer;
8
+ private mapInitializer;
9
+ private watchHandle;
10
+ constructor(view: __esri.MapView | __esri.SceneView);
11
+ setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
12
+ private getLayerConfig;
13
+ private showClusterInExtent;
14
+ }
@@ -0,0 +1,268 @@
1
+ import * as d from "@arcgis/core/core/reactiveUtils.js";
2
+ import v from "@arcgis/core/Graphic";
3
+ import l from "@arcgis/core/layers/GraphicsLayer";
4
+ import { toRaw as b } from "vue";
5
+ import p from "../stores/index.mjs";
6
+ class S {
7
+ constructor(e) {
8
+ this.watchHandle = null, this.view = e;
9
+ const t = p.useAppDataStore;
10
+ this.mapInitializer = b(t.mapInitializer), this.cameraNormalLayer = new l({
11
+ id: "cameraNormalLayer",
12
+ visible: !1
13
+ }), this.cameraAbnormalLayer = new l({
14
+ id: "cameraAbnormalLayer",
15
+ visible: !1
16
+ }), this.kkNormalLayer = new l({
17
+ id: "kkNormalLayer",
18
+ visible: !1
19
+ }), this.kkAbnormalLayer = new l({
20
+ id: "kkAbnormalLayer",
21
+ visible: !1
22
+ }), this.view.map.addMany([
23
+ this.cameraNormalLayer,
24
+ this.cameraAbnormalLayer,
25
+ this.kkNormalLayer,
26
+ this.kkAbnormalLayer
27
+ ]);
28
+ }
29
+ async setEdpassLayerVisibility(e) {
30
+ var t;
31
+ if (e.deviceType !== "camera" && e.deviceType !== "kk")
32
+ return { status: -1, message: "不支持的设备类型" };
33
+ switch (e.mode) {
34
+ case "scatter":
35
+ return this.mapInitializer.setLayerVisibility({
36
+ id: `${e.deviceType}-${e.deviceState}`,
37
+ visible: e.visible
38
+ });
39
+ case "cluster": {
40
+ const { deviceLayer: i } = this.getLayerConfig(e);
41
+ i.visible = e.visible, console.log(i.id, i.visible), e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = d.when(
42
+ () => this.view.stationary,
43
+ async () => {
44
+ this.cameraNormalLayer.visible && (console.log("刷新 camera normal"), await this.showClusterInExtent(
45
+ {
46
+ deviceType: "camera",
47
+ deviceState: "normal",
48
+ mode: "cluster",
49
+ visible: !0
50
+ },
51
+ this.view.extent
52
+ )), this.cameraAbnormalLayer.visible && (console.log("刷新 camera abnormal"), await this.showClusterInExtent(
53
+ {
54
+ deviceType: "camera",
55
+ deviceState: "abnormal",
56
+ mode: "cluster",
57
+ visible: !0
58
+ },
59
+ this.view.extent
60
+ )), this.kkNormalLayer.visible && (console.log("刷新 kk normal"), await this.showClusterInExtent(
61
+ {
62
+ deviceType: "kk",
63
+ deviceState: "normal",
64
+ mode: "cluster",
65
+ visible: !0
66
+ },
67
+ this.view.extent
68
+ )), this.kkAbnormalLayer.visible && (console.log("刷新 kk abnormal"), await this.showClusterInExtent(
69
+ {
70
+ deviceType: "kk",
71
+ deviceState: "abnormal",
72
+ mode: "cluster",
73
+ visible: !0
74
+ },
75
+ this.view.extent
76
+ ));
77
+ }
78
+ ))) : (i.removeAll(), !this.cameraNormalLayer.visible && !this.cameraAbnormalLayer.visible && !this.kkNormalLayer.visible && !this.kkAbnormalLayer.visible && ((t = this.watchHandle) == null || t.remove(), this.watchHandle = null));
79
+ break;
80
+ }
81
+ }
82
+ return {
83
+ status: 0,
84
+ message: "Success"
85
+ };
86
+ }
87
+ getLayerConfig(e) {
88
+ let t, i, r;
89
+ return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196], r = this.cameraNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_sxj_yc.png", i = [189, 49, 50], r = this.cameraAbnormalLayer) : e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_kk_map.png", i = [45, 108, 196], r = this.kkNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_kk_yc.png", i = [189, 49, 50], r = this.kkAbnormalLayer), {
90
+ icon: t,
91
+ color: i,
92
+ deviceLayer: r
93
+ };
94
+ }
95
+ async showClusterInExtent(e, t) {
96
+ const i = await fetch("/es/queryGeoAggregation", {
97
+ method: "POST",
98
+ headers: {
99
+ "Content-Type": "application/json"
100
+ },
101
+ body: JSON.stringify({
102
+ deviceType: e.deviceType,
103
+ topLeftLat: t.ymax,
104
+ topLeftLon: t.xmin,
105
+ bottomRightLat: t.ymin,
106
+ bottomRightLon: t.xmax,
107
+ devStateSet: [e.deviceState === "normal" ? "1" : "2"],
108
+ // meter: Math.round(this.view.scale / 6)
109
+ mapLevel: this.view.zoom + 9
110
+ })
111
+ });
112
+ if (i.status !== 200) {
113
+ console.error(i.statusText);
114
+ return;
115
+ }
116
+ const r = await i.json();
117
+ if (r.code !== 200)
118
+ return;
119
+ const { icon: n, color: c, deviceLayer: m } = this.getLayerConfig(e);
120
+ m.removeAll();
121
+ const h = r.data.map((a) => {
122
+ var y;
123
+ const o = (a.count.toString().length * 6 + 6) / 2, s = new v({
124
+ geometry: {
125
+ type: "point",
126
+ x: a.lon,
127
+ y: a.lat
128
+ },
129
+ attributes: {
130
+ id: ((y = a.devInfo) == null ? void 0 : y.deviceId) || a.key,
131
+ type: e.deviceType,
132
+ count: a.count,
133
+ typeName: e.deviceType === "camera" ? "视频" : "卡口",
134
+ stateName: e.deviceState === "normal" ? "正常" : "异常",
135
+ ...a.devInfo
136
+ }
137
+ });
138
+ return a.count > 1 ? s.symbol = {
139
+ type: "cim",
140
+ data: {
141
+ type: "CIMSymbolReference",
142
+ symbol: {
143
+ type: "CIMPointSymbol",
144
+ symbolLayers: [
145
+ // 聚合数量
146
+ {
147
+ type: "CIMVectorMarker",
148
+ size: 32,
149
+ colorLocked: !0,
150
+ anchorPointUnits: "Relative",
151
+ frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
152
+ markerGraphics: [
153
+ // 数量文本框
154
+ {
155
+ type: "CIMMarkerGraphic",
156
+ geometry: {
157
+ rings: [
158
+ [
159
+ [-o, 30],
160
+ [o, 30],
161
+ [o, 15],
162
+ [-o, 15],
163
+ [-o, 30]
164
+ ]
165
+ ]
166
+ },
167
+ symbol: {
168
+ type: "CIMPolygonSymbol",
169
+ symbolLayers: [
170
+ {
171
+ type: "CIMSolidFill",
172
+ enable: !0,
173
+ color: c.concat([255])
174
+ },
175
+ {
176
+ type: "CIMSolidStroke",
177
+ enable: !0,
178
+ width: 3,
179
+ color: c.concat([128])
180
+ }
181
+ ]
182
+ }
183
+ },
184
+ // 数量文字
185
+ {
186
+ type: "CIMMarkerGraphic",
187
+ primitiveName: "textGraphic",
188
+ geometry: { x: 0, y: 0 },
189
+ symbol: {
190
+ type: "CIMTextSymbol",
191
+ fontFamilyName: "msyh",
192
+ height: 12,
193
+ horizontalAlignment: "Center",
194
+ offsetX: 0,
195
+ offsetY: 22,
196
+ symbol: {
197
+ type: "CIMPolygonSymbol",
198
+ symbolLayers: [
199
+ {
200
+ type: "CIMSolidFill",
201
+ enable: !0,
202
+ color: [255, 255, 255, 255]
203
+ }
204
+ ]
205
+ },
206
+ verticalAlignment: "Center"
207
+ },
208
+ textString: a.count.toString()
209
+ }
210
+ ],
211
+ scaleSymbolsProportionally: !0,
212
+ respectFrame: !0
213
+ },
214
+ // 聚合图标
215
+ {
216
+ type: "CIMPictureMarker",
217
+ enable: !0,
218
+ anchorPoint: {
219
+ x: 0,
220
+ y: 0
221
+ },
222
+ anchorPointUnits: "Relative",
223
+ size: 24,
224
+ rotateClockwise: !0,
225
+ textureFilter: "Picture",
226
+ url: n
227
+ }
228
+ ]
229
+ }
230
+ }
231
+ } : (s.symbol = {
232
+ type: "picture-marker",
233
+ url: n,
234
+ width: 18,
235
+ height: 18
236
+ }, s.popupTemplate = {
237
+ title: "视频信息",
238
+ content: [
239
+ {
240
+ type: "fields",
241
+ fieldInfos: [
242
+ {
243
+ fieldName: "deviceId",
244
+ label: "设备编号"
245
+ },
246
+ {
247
+ fieldName: "deviceName",
248
+ label: "设备名称"
249
+ },
250
+ {
251
+ fieldName: "typeName",
252
+ label: "设备类型"
253
+ },
254
+ {
255
+ fieldName: "stateName",
256
+ label: "设备状态"
257
+ }
258
+ ]
259
+ }
260
+ ]
261
+ }), s;
262
+ });
263
+ m.addMany(h);
264
+ }
265
+ }
266
+ export {
267
+ S as default
268
+ };
@@ -4,6 +4,7 @@ import { ILayerVisibleParams, ILookAtParams, IResult, ISetMapCameraParams, ISetM
4
4
  export default class MapInitializer {
5
5
  private view;
6
6
  private mapConfig;
7
+ private processUrl;
7
8
  /**
8
9
  * 初始化地图
9
10
  * @param params 容器