gisviewer-vue3-arcgis 1.0.274 → 1.0.275

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.
@@ -7,10 +7,16 @@ export default class EdpassDeviceController {
7
7
  private kkAbnormalLayer;
8
8
  private mapInitializer;
9
9
  private watchHandle;
10
- private currentZdCode;
11
- private currentDdCode;
10
+ private currentShowParams;
11
+ private isCameraVisible;
12
+ private isKkVisible;
12
13
  constructor(view: __esri.MapView | __esri.SceneView);
13
14
  setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
15
+ /**
16
+ * 控制散点图层显示隐藏
17
+ * @param visible
18
+ */
19
+ private showScatter;
14
20
  private getLayerConfig;
15
21
  private showClusterInExtent;
16
22
  }
@@ -1,22 +1,22 @@
1
- import * as h 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 u from "../stores/index.mjs";
6
- class I {
1
+ import * as v from "@arcgis/core/core/reactiveUtils.js";
2
+ import u from "@arcgis/core/Graphic";
3
+ import m from "@arcgis/core/layers/GraphicsLayer";
4
+ import { toRaw as p } from "vue";
5
+ import k from "../stores/index.mjs";
6
+ class S {
7
7
  constructor(e) {
8
- this.watchHandle = null, this.currentZdCode = "", this.currentDdCode = "", this.view = e;
9
- const t = u.useAppDataStore;
10
- this.mapInitializer = b(t.mapInitializer), this.cameraNormalLayer = new l({
8
+ this.watchHandle = null, this.currentShowParams = null, this.isCameraVisible = !1, this.isKkVisible = !1, this.view = e;
9
+ const t = k.useAppDataStore;
10
+ this.mapInitializer = p(t.mapInitializer), this.cameraNormalLayer = new m({
11
11
  id: "cameraNormalLayer",
12
12
  visible: !1
13
- }), this.cameraAbnormalLayer = new l({
13
+ }), this.cameraAbnormalLayer = new m({
14
14
  id: "cameraAbnormalLayer",
15
15
  visible: !1
16
- }), this.kkNormalLayer = new l({
16
+ }), this.kkNormalLayer = new m({
17
17
  id: "kkNormalLayer",
18
18
  visible: !1
19
- }), this.kkAbnormalLayer = new l({
19
+ }), this.kkAbnormalLayer = new m({
20
20
  id: "kkAbnormalLayer",
21
21
  visible: !1
22
22
  }), this.view.map.addMany([
@@ -28,34 +28,26 @@ class I {
28
28
  }
29
29
  async setEdpassLayerVisibility(e) {
30
30
  var t;
31
- if (console.log(e), e.deviceType !== "camera" && e.deviceType !== "kk")
31
+ if (this.currentShowParams = e, e.deviceType !== "camera" && e.deviceType !== "kk")
32
32
  return { status: -1, message: "不支持的设备类型" };
33
- switch (e.style) {
34
- case "scatter":
35
- if (e.deviceState)
36
- return this.mapInitializer.setLayerVisibility({
37
- id: `${e.deviceType}-${e.deviceState}`,
38
- visible: e.visible
39
- });
40
- this.mapInitializer.setLayerVisibility({
41
- id: `${e.deviceType}-normal`,
42
- visible: e.visible
43
- }), this.mapInitializer.setLayerVisibility({
44
- id: `${e.deviceType}-abnormal`,
45
- visible: e.visible
46
- });
33
+ switch (e.deviceType === "camera" && (this.isCameraVisible = e.visible), e.deviceType === "kk" && (this.isKkVisible = e.visible), e.style) {
34
+ case "scatter": {
35
+ this.showScatter();
36
+ break;
37
+ }
47
38
  case "cluster": {
48
39
  const { deviceLayer: i } = this.getLayerConfig(e);
49
- i.visible = e.visible, this.currentDdCode = e.ddCode || "", this.currentZdCode = e.zdCode || "", e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = h.when(
40
+ i.visible = e.visible, e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = v.when(
50
41
  () => this.view.stationary,
51
42
  async () => {
43
+ var r, s, o, l, c, a, y, h;
52
44
  this.cameraNormalLayer.visible && await this.showClusterInExtent(
53
45
  {
54
46
  deviceType: "camera",
55
47
  deviceState: "normal",
56
48
  style: "cluster",
57
- ddCode: this.currentDdCode,
58
- zdCode: this.currentZdCode,
49
+ ddCode: ((r = this.currentShowParams) == null ? void 0 : r.ddCode) || "",
50
+ zdCode: ((s = this.currentShowParams) == null ? void 0 : s.zdCode) || "",
59
51
  visible: !0
60
52
  },
61
53
  this.view.extent
@@ -64,8 +56,8 @@ class I {
64
56
  deviceType: "camera",
65
57
  deviceState: "abnormal",
66
58
  style: "cluster",
67
- ddCode: this.currentDdCode,
68
- zdCode: this.currentZdCode,
59
+ ddCode: ((o = this.currentShowParams) == null ? void 0 : o.ddCode) || "",
60
+ zdCode: ((l = this.currentShowParams) == null ? void 0 : l.zdCode) || "",
69
61
  visible: !0
70
62
  },
71
63
  this.view.extent
@@ -74,8 +66,8 @@ class I {
74
66
  deviceType: "kk",
75
67
  deviceState: "normal",
76
68
  style: "cluster",
77
- ddCode: this.currentDdCode,
78
- zdCode: this.currentZdCode,
69
+ ddCode: ((c = this.currentShowParams) == null ? void 0 : c.ddCode) || "",
70
+ zdCode: ((a = this.currentShowParams) == null ? void 0 : a.zdCode) || "",
79
71
  visible: !0
80
72
  },
81
73
  this.view.extent
@@ -84,8 +76,8 @@ class I {
84
76
  deviceType: "kk",
85
77
  deviceState: "abnormal",
86
78
  style: "cluster",
87
- ddCode: this.currentDdCode,
88
- zdCode: this.currentZdCode,
79
+ ddCode: ((y = this.currentShowParams) == null ? void 0 : y.ddCode) || "",
80
+ zdCode: ((h = this.currentShowParams) == null ? void 0 : h.zdCode) || "",
89
81
  visible: !0
90
82
  },
91
83
  this.view.extent
@@ -100,12 +92,32 @@ class I {
100
92
  message: "Success"
101
93
  };
102
94
  }
95
+ /**
96
+ * 控制散点图层显示隐藏
97
+ * @param visible
98
+ */
99
+ showScatter(e) {
100
+ const t = e ?? this.isCameraVisible, i = e ?? this.isKkVisible;
101
+ this.mapInitializer.setLayerVisibility({
102
+ id: "camera-normal",
103
+ visible: t
104
+ }), this.mapInitializer.setLayerVisibility({
105
+ id: "camera-abnormal",
106
+ visible: t
107
+ }), this.mapInitializer.setLayerVisibility({
108
+ id: "kk-normal",
109
+ visible: i
110
+ }), this.mapInitializer.setLayerVisibility({
111
+ id: "kk-abnormal",
112
+ visible: i
113
+ });
114
+ }
103
115
  getLayerConfig(e) {
104
- let t, i, a;
105
- return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196], a = this.cameraNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_sxj_yc.png", i = [189, 49, 50], a = this.cameraAbnormalLayer) : e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_kk_map.png", i = [45, 108, 196], a = this.kkNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_kk_yc.png", i = [189, 49, 50], a = this.kkAbnormalLayer), {
116
+ let t, i, r;
117
+ 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), {
106
118
  icon: t,
107
119
  color: i,
108
- deviceLayer: a
120
+ deviceLayer: r
109
121
  };
110
122
  }
111
123
  async showClusterInExtent(e, t) {
@@ -130,29 +142,29 @@ class I {
130
142
  console.error(i.statusText);
131
143
  return;
132
144
  }
133
- const a = await i.json();
134
- if (a.code !== 200)
145
+ const r = await i.json();
146
+ if (r.code !== 200)
135
147
  return;
136
- const { icon: n, color: c, deviceLayer: d } = this.getLayerConfig(e);
137
- d.removeAll();
138
- const m = a.data.map((r) => {
139
- var y;
140
- const s = (r.count.toString().length * 6 + 6) / 2, o = new v({
148
+ const { icon: s, color: o, deviceLayer: l } = this.getLayerConfig(e);
149
+ l.removeAll();
150
+ const c = r.data.map((a) => {
151
+ var b;
152
+ const n = (a.count.toString().length * 6 + 6) / 2, d = new u({
141
153
  geometry: {
142
154
  type: "point",
143
- x: r.lon,
144
- y: r.lat
155
+ x: a.lon,
156
+ y: a.lat
145
157
  },
146
158
  attributes: {
147
- id: ((y = r.devInfo) == null ? void 0 : y.deviceId) || r.key,
159
+ id: ((b = a.devInfo) == null ? void 0 : b.deviceId) || a.key,
148
160
  type: e.deviceType,
149
- count: r.count,
161
+ count: a.count,
150
162
  typeName: e.deviceType === "camera" ? "视频" : "卡口",
151
163
  stateName: e.deviceState === "normal" ? "正常" : "异常",
152
- ...r.devInfo
164
+ ...a.devInfo
153
165
  }
154
166
  });
155
- return r.count > 1 ? o.symbol = {
167
+ return a.count > 1 ? d.symbol = {
156
168
  type: "cim",
157
169
  data: {
158
170
  type: "CIMSymbolReference",
@@ -173,11 +185,11 @@ class I {
173
185
  geometry: {
174
186
  rings: [
175
187
  [
176
- [-s, 30],
177
- [s, 30],
178
- [s, 15],
179
- [-s, 15],
180
- [-s, 30]
188
+ [-n, 30],
189
+ [n, 30],
190
+ [n, 15],
191
+ [-n, 15],
192
+ [-n, 30]
181
193
  ]
182
194
  ]
183
195
  },
@@ -187,13 +199,13 @@ class I {
187
199
  {
188
200
  type: "CIMSolidFill",
189
201
  enable: !0,
190
- color: c.concat([255])
202
+ color: o.concat([255])
191
203
  },
192
204
  {
193
205
  type: "CIMSolidStroke",
194
206
  enable: !0,
195
207
  width: 3,
196
- color: c.concat([128])
208
+ color: o.concat([128])
197
209
  }
198
210
  ]
199
211
  }
@@ -222,7 +234,7 @@ class I {
222
234
  },
223
235
  verticalAlignment: "Center"
224
236
  },
225
- textString: r.count.toString()
237
+ textString: a.count.toString()
226
238
  }
227
239
  ],
228
240
  scaleSymbolsProportionally: !0,
@@ -240,17 +252,17 @@ class I {
240
252
  size: 24,
241
253
  rotateClockwise: !0,
242
254
  textureFilter: "Picture",
243
- url: n
255
+ url: s
244
256
  }
245
257
  ]
246
258
  }
247
259
  }
248
- } : (o.symbol = {
260
+ } : (d.symbol = {
249
261
  type: "picture-marker",
250
- url: n,
262
+ url: s,
251
263
  width: 18,
252
264
  height: 18
253
- }, o.popupTemplate = {
265
+ }, d.popupTemplate = {
254
266
  title: "视频信息",
255
267
  content: [
256
268
  {
@@ -275,11 +287,11 @@ class I {
275
287
  ]
276
288
  }
277
289
  ]
278
- }), o;
290
+ }), d;
279
291
  });
280
- d.addMany(m);
292
+ l.addMany(c);
281
293
  }
282
294
  }
283
295
  export {
284
- I as default
296
+ S as default
285
297
  };
@@ -7,10 +7,16 @@ export default class EdpassDeviceController {
7
7
  private kkAbnormalLayer;
8
8
  private mapInitializer;
9
9
  private watchHandle;
10
- private currentZdCode;
11
- private currentDdCode;
10
+ private currentShowParams;
11
+ private isCameraVisible;
12
+ private isKkVisible;
12
13
  constructor(view: __esri.MapView | __esri.SceneView);
13
14
  setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
15
+ /**
16
+ * 控制散点图层显示隐藏
17
+ * @param visible
18
+ */
19
+ private showScatter;
14
20
  private getLayerConfig;
15
21
  private showClusterInExtent;
16
22
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/core/reactiveUtils.js"),v=require("@arcgis/core/Graphic"),n=require("@arcgis/core/layers/GraphicsLayer"),b=require("vue"),f=require("../stores/index.js");function g(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const p=g(u);class C{constructor(e){this.watchHandle=null,this.currentZdCode="",this.currentDdCode="",this.view=e;const t=f.default.useAppDataStore;this.mapInitializer=b.toRaw(t.mapInitializer),this.cameraNormalLayer=new n({id:"cameraNormalLayer",visible:!1}),this.cameraAbnormalLayer=new n({id:"cameraAbnormalLayer",visible:!1}),this.kkNormalLayer=new n({id:"kkNormalLayer",visible:!1}),this.kkAbnormalLayer=new n({id:"kkAbnormalLayer",visible:!1}),this.view.map.addMany([this.cameraNormalLayer,this.cameraAbnormalLayer,this.kkNormalLayer,this.kkAbnormalLayer])}async setEdpassLayerVisibility(e){var t;if(console.log(e),e.deviceType!=="camera"&&e.deviceType!=="kk")return{status:-1,message:"不支持的设备类型"};switch(e.style){case"scatter":if(e.deviceState)return this.mapInitializer.setLayerVisibility({id:`${e.deviceType}-${e.deviceState}`,visible:e.visible});this.mapInitializer.setLayerVisibility({id:`${e.deviceType}-normal`,visible:e.visible}),this.mapInitializer.setLayerVisibility({id:`${e.deviceType}-abnormal`,visible:e.visible});case"cluster":{const{deviceLayer:i}=this.getLayerConfig(e);i.visible=e.visible,this.currentDdCode=e.ddCode||"",this.currentZdCode=e.zdCode||"",e.visible?(await this.showClusterInExtent(e,this.view.extent),this.watchHandle||(this.watchHandle=p.when(()=>this.view.stationary,async()=>{this.cameraNormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"normal",style:"cluster",ddCode:this.currentDdCode,zdCode:this.currentZdCode,visible:!0},this.view.extent),this.cameraAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"abnormal",style:"cluster",ddCode:this.currentDdCode,zdCode:this.currentZdCode,visible:!0},this.view.extent),this.kkNormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"normal",style:"cluster",ddCode:this.currentDdCode,zdCode:this.currentZdCode,visible:!0},this.view.extent),this.kkAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"abnormal",style:"cluster",ddCode:this.currentDdCode,zdCode:this.currentZdCode,visible:!0},this.view.extent)}))):(i.removeAll(),!this.cameraNormalLayer.visible&&!this.cameraAbnormalLayer.visible&&!this.kkNormalLayer.visible&&!this.kkAbnormalLayer.visible&&((t=this.watchHandle)==null||t.remove(),this.watchHandle=null));break}}return{status:0,message:"Success"}}getLayerConfig(e){let t,i,a;return e.deviceType==="camera"?e.deviceState==="normal"?(t="/GisViewerAssets/Images/gis/gis_sxj_map.png",i=[45,108,196],a=this.cameraNormalLayer):(t="/GisViewerAssets/Images/gis/gis_sxj_yc.png",i=[189,49,50],a=this.cameraAbnormalLayer):e.deviceState==="normal"?(t="/GisViewerAssets/Images/gis/gis_kk_map.png",i=[45,108,196],a=this.kkNormalLayer):(t="/GisViewerAssets/Images/gis/gis_kk_yc.png",i=[189,49,50],a=this.kkAbnormalLayer),{icon:t,color:i,deviceLayer:a}}async showClusterInExtent(e,t){const i=await fetch("/es/queryGeoAggregation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceType:e.deviceType,topLeftLat:t.ymax,topLeftLon:t.xmin,bottomRightLat:t.ymin,bottomRightLon:t.xmax,devStateSet:e.deviceState?[e.deviceState==="normal"?"1":"2"]:["1","2"],zdCode:e.zdCode||"",ddCode:e.ddCode||"",mapLevel:this.view.zoom+9})});if(i.status!==200){console.error(i.statusText);return}const a=await i.json();if(a.code!==200)return;const{icon:c,color:d,deviceLayer:y}=this.getLayerConfig(e);y.removeAll();const m=a.data.map(r=>{var h;const o=(r.count.toString().length*6+6)/2,l=new v({geometry:{type:"point",x:r.lon,y:r.lat},attributes:{id:((h=r.devInfo)==null?void 0:h.deviceId)||r.key,type:e.deviceType,count:r.count,typeName:e.deviceType==="camera"?"视频":"卡口",stateName:e.deviceState==="normal"?"正常":"异常",...r.devInfo}});return r.count>1?l.symbol={type:"cim",data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-o,30],[o,30],[o,15],[-o,15],[-o,30]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:d.concat([255])},{type:"CIMSolidStroke",enable:!0,width:3,color:d.concat([128])}]}},{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",fontFamilyName:"msyh",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:22,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:r.count.toString()}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:24,rotateClockwise:!0,textureFilter:"Picture",url:c}]}}}:(l.symbol={type:"picture-marker",url:c,width:18,height:18},l.popupTemplate={title:"视频信息",content:[{type:"fields",fieldInfos:[{fieldName:"deviceId",label:"设备编号"},{fieldName:"deviceName",label:"设备名称"},{fieldName:"typeName",label:"设备类型"},{fieldName:"stateName",label:"设备状态"}]}]}),l});y.addMany(m)}}exports.default=C;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@arcgis/core/core/reactiveUtils.js"),p=require("@arcgis/core/Graphic"),m=require("@arcgis/core/layers/GraphicsLayer"),f=require("vue"),k=require("../stores/index.js");function w(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const g=w(v);class C{constructor(e){this.watchHandle=null,this.currentShowParams=null,this.isCameraVisible=!1,this.isKkVisible=!1,this.view=e;const t=k.default.useAppDataStore;this.mapInitializer=f.toRaw(t.mapInitializer),this.cameraNormalLayer=new m({id:"cameraNormalLayer",visible:!1}),this.cameraAbnormalLayer=new m({id:"cameraAbnormalLayer",visible:!1}),this.kkNormalLayer=new m({id:"kkNormalLayer",visible:!1}),this.kkAbnormalLayer=new m({id:"kkAbnormalLayer",visible:!1}),this.view.map.addMany([this.cameraNormalLayer,this.cameraAbnormalLayer,this.kkNormalLayer,this.kkAbnormalLayer])}async setEdpassLayerVisibility(e){var t;if(this.currentShowParams=e,e.deviceType!=="camera"&&e.deviceType!=="kk")return{status:-1,message:"不支持的设备类型"};switch(e.deviceType==="camera"&&(this.isCameraVisible=e.visible),e.deviceType==="kk"&&(this.isKkVisible=e.visible),e.style){case"scatter":{this.showScatter();break}case"cluster":{const{deviceLayer:i}=this.getLayerConfig(e);i.visible=e.visible,e.visible?(await this.showClusterInExtent(e,this.view.extent),this.watchHandle||(this.watchHandle=g.when(()=>this.view.stationary,async()=>{var r,o,l,n,d,a,h,u;this.cameraNormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"normal",style:"cluster",ddCode:((r=this.currentShowParams)==null?void 0:r.ddCode)||"",zdCode:((o=this.currentShowParams)==null?void 0:o.zdCode)||"",visible:!0},this.view.extent),this.cameraAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"abnormal",style:"cluster",ddCode:((l=this.currentShowParams)==null?void 0:l.ddCode)||"",zdCode:((n=this.currentShowParams)==null?void 0:n.zdCode)||"",visible:!0},this.view.extent),this.kkNormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"normal",style:"cluster",ddCode:((d=this.currentShowParams)==null?void 0:d.ddCode)||"",zdCode:((a=this.currentShowParams)==null?void 0:a.zdCode)||"",visible:!0},this.view.extent),this.kkAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"abnormal",style:"cluster",ddCode:((h=this.currentShowParams)==null?void 0:h.ddCode)||"",zdCode:((u=this.currentShowParams)==null?void 0:u.zdCode)||"",visible:!0},this.view.extent)}))):(i.removeAll(),!this.cameraNormalLayer.visible&&!this.cameraAbnormalLayer.visible&&!this.kkNormalLayer.visible&&!this.kkAbnormalLayer.visible&&((t=this.watchHandle)==null||t.remove(),this.watchHandle=null));break}}return{status:0,message:"Success"}}showScatter(e){const t=e??this.isCameraVisible,i=e??this.isKkVisible;this.mapInitializer.setLayerVisibility({id:"camera-normal",visible:t}),this.mapInitializer.setLayerVisibility({id:"camera-abnormal",visible:t}),this.mapInitializer.setLayerVisibility({id:"kk-normal",visible:i}),this.mapInitializer.setLayerVisibility({id:"kk-abnormal",visible:i})}getLayerConfig(e){let t,i,r;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),{icon:t,color:i,deviceLayer:r}}async showClusterInExtent(e,t){const i=await fetch("/es/queryGeoAggregation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceType:e.deviceType,topLeftLat:t.ymax,topLeftLon:t.xmin,bottomRightLat:t.ymin,bottomRightLon:t.xmax,devStateSet:e.deviceState?[e.deviceState==="normal"?"1":"2"]:["1","2"],zdCode:e.zdCode||"",ddCode:e.ddCode||"",mapLevel:this.view.zoom+9})});if(i.status!==200){console.error(i.statusText);return}const r=await i.json();if(r.code!==200)return;const{icon:o,color:l,deviceLayer:n}=this.getLayerConfig(e);n.removeAll();const d=r.data.map(a=>{var b;const c=(a.count.toString().length*6+6)/2,y=new p({geometry:{type:"point",x:a.lon,y:a.lat},attributes:{id:((b=a.devInfo)==null?void 0:b.deviceId)||a.key,type:e.deviceType,count:a.count,typeName:e.deviceType==="camera"?"视频":"卡口",stateName:e.deviceState==="normal"?"正常":"异常",...a.devInfo}});return a.count>1?y.symbol={type:"cim",data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-c,30],[c,30],[c,15],[-c,15],[-c,30]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:l.concat([255])},{type:"CIMSolidStroke",enable:!0,width:3,color:l.concat([128])}]}},{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",fontFamilyName:"msyh",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:22,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:a.count.toString()}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:24,rotateClockwise:!0,textureFilter:"Picture",url:o}]}}}:(y.symbol={type:"picture-marker",url:o,width:18,height:18},y.popupTemplate={title:"视频信息",content:[{type:"fields",fieldInfos:[{fieldName:"deviceId",label:"设备编号"},{fieldName:"deviceName",label:"设备名称"},{fieldName:"typeName",label:"设备类型"},{fieldName:"stateName",label:"设备状态"}]}]}),y});n.addMany(d)}}exports.default=C;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.274",
3
+ "version": "1.0.275",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [