gisviewer-vue3-arcgis 1.0.256 → 1.0.258

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.
@@ -242,7 +242,7 @@ class me {
242
242
  async setLayerVisibility(e) {
243
243
  const { id: i, visible: s } = e;
244
244
  if (i === "shanghai_district")
245
- return this.detachmentLayerLoaded ? this.detachmentLayer.visible = s : await this.loadDetachmentLayer(), { status: 0, message: "ok" };
245
+ return !this.detachmentLayerLoaded && e.visible ? await this.loadDetachmentLayer() : this.detachmentLayer.visible = s, { status: 0, message: "ok" };
246
246
  {
247
247
  const a = this.view.map.findLayerById(i);
248
248
  return a ? (a.visible = s, { status: 0, message: "ok" }) : { status: -1, message: "未找到图层" };
@@ -2,8 +2,16 @@ import DistrictController from './district-controller';
2
2
  export default class CrossRenderer {
3
3
  private view;
4
4
  private crossLayer;
5
- private crossGraphics;
6
5
  private crossGraphicSymbol;
6
+ private locations;
7
7
  constructor(view: __esri.MapView | __esri.SceneView);
8
8
  showCrosses(controllers: DistrictController[]): Promise<void>;
9
+ /**
10
+ * 显示聚合点
11
+ */
12
+ showCluster(): void;
13
+ /**
14
+ * 显示散点
15
+ */
16
+ showScatter(): void;
9
17
  }
@@ -1,8 +1,7 @@
1
- import s from "@arcgis/core/Graphic";
2
- import a from "@arcgis/core/layers/GraphicsLayer";
3
- class p {
1
+ import o from "@arcgis/core/layers/GraphicsLayer";
2
+ class l {
4
3
  constructor(r) {
5
- this.crossGraphics = [], this.crossGraphicSymbol = {
4
+ this.crossGraphicSymbol = {
6
5
  type: "cim",
7
6
  data: {
8
7
  type: "CIMSymbolReference",
@@ -84,62 +83,44 @@ class p {
84
83
  ]
85
84
  }
86
85
  }
87
- }, this.view = r, this.crossLayer = new a(), this.view.map.add(this.crossLayer);
86
+ }, this.locations = [], this.view = r, this.crossLayer = new o(), this.view.map.add(this.crossLayer);
88
87
  }
89
88
  async showCrosses(r) {
90
- this.crossLayer.removeAll(), r.forEach((i) => {
89
+ r.forEach((i) => {
91
90
  i.signals.forEach((e) => {
92
- const t = new s({
93
- geometry: {
94
- type: "point",
95
- longitude: e.longitude,
96
- latitude: e.latitude
97
- },
98
- symbol: this.crossGraphicSymbol,
99
- attributes: {
100
- id: e.id,
101
- name: e.name,
102
- signalId: e.signalId,
103
- nodeId: e.nodeId || e.id,
104
- districtId: i.id,
105
- districtName: i.name,
106
- subDistrictId: "",
107
- subDistrictName: "",
108
- isKey: e.isKey,
109
- type: "signal",
110
- selected: !0
111
- }
91
+ e.longitude && e.latitude && !isNaN(e.longitude) && !isNaN(e.latitude) && this.locations.push({
92
+ id: e.id,
93
+ x: e.longitude,
94
+ y: e.latitude,
95
+ visited: !1,
96
+ clusterId: void 0,
97
+ properties: e
112
98
  });
113
- this.crossGraphics.push(t);
114
99
  }), i.subDistricts.forEach((e) => {
115
100
  e.signals.forEach((t) => {
116
- const o = new s({
117
- geometry: {
118
- type: "point",
119
- longitude: t.longitude,
120
- latitude: t.latitude
121
- },
122
- symbol: this.crossGraphicSymbol,
123
- attributes: {
124
- id: t.id,
125
- name: t.name,
126
- signalId: t.signalId,
127
- nodeId: t.nodeId || t.id,
128
- districtId: i.id,
129
- districtName: i.name,
130
- subDistrictId: e.id,
131
- subDistrictName: e.name,
132
- isKey: t.isKey,
133
- type: "signal",
134
- selected: !0
135
- }
101
+ t.longitude && t.latitude && !isNaN(t.longitude) && !isNaN(t.latitude) && this.locations.push({
102
+ id: t.id,
103
+ x: t.longitude,
104
+ y: t.latitude,
105
+ visited: !1,
106
+ clusterId: void 0,
107
+ properties: t
136
108
  });
137
- this.crossGraphics.push(o);
138
109
  });
139
110
  });
140
- }), this.crossLayer.addMany(this.crossGraphics);
111
+ });
112
+ }
113
+ /**
114
+ * 显示聚合点
115
+ */
116
+ showCluster() {
117
+ }
118
+ /**
119
+ * 显示散点
120
+ */
121
+ showScatter() {
141
122
  }
142
123
  }
143
124
  export {
144
- p as default
125
+ l as default
145
126
  };
@@ -1,12 +1,12 @@
1
1
  import d from "pako";
2
- import h from "../common-utils.mjs";
2
+ import l from "../common-utils.mjs";
3
3
  class c {
4
- constructor(i, s) {
5
- if (this.parentName = "", this.signals = [], this.subDistricts = [], this.areaColor = this.getDarkNonGrayColor(), this.signalCount = 0, this.subDistrictCount = 0, this.roadConnections = [], this.id = i.name, this.name = i.areaDesc, this.parentId = i.parentId, s === "alarm" && (this.areaColor = [255, 0, 0]), i.mapConnectList)
4
+ constructor(o, s) {
5
+ if (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]), o.mapConnectList)
6
6
  try {
7
- const t = i.mapConnectList, o = new Uint8Array(
7
+ const t = o.mapConnectList, i = new Uint8Array(
8
8
  window.atob(t).split("").map((r) => r.charCodeAt(0))
9
- ), a = d.inflate(o, { to: "string" }), n = JSON.parse(a);
9
+ ), a = d.inflate(i, { to: "string" }), n = JSON.parse(a);
10
10
  this.roadConnections.push(
11
11
  ...n.map((r) => ({
12
12
  id: r.roadsectId,
@@ -18,28 +18,27 @@ class c {
18
18
  } catch (t) {
19
19
  console.error("解压子区路段连接信息失败:", t);
20
20
  }
21
- console.log(i);
22
- for (const t of i.children)
21
+ for (const t of o.children)
23
22
  if (t.children) {
24
- const o = new c(t, s);
25
- if (o.id = t.id, o.name = `SS ${t.name}`, o.parentId = this.id, o.parentName = this.name, o.areaColor = this.getDarkNonGrayColor(t.id), this.subDistricts.push(o), this.subDistrictCount++, this.signalCount += o.signalCount, t.mapConnectList)
23
+ const i = new c(t, s);
24
+ 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)
26
25
  try {
27
26
  const a = t.mapConnectList, n = new Uint8Array(
28
27
  window.atob(a).split("").map((e) => e.charCodeAt(0))
29
- ), r = d.inflate(n, { to: "string" }), l = JSON.parse(r);
30
- o.roadConnections.push(
31
- ...l.map((e) => ({
28
+ ), r = d.inflate(n, { to: "string" }), h = JSON.parse(r);
29
+ i.roadConnections.push(
30
+ ...h.map((e) => ({
32
31
  id: e.roadsectId,
33
32
  coordinates: JSON.parse(e.geomData).coordinates,
34
- districtId: o.parentId,
35
- subDistrictId: o.id
33
+ districtId: i.parentId,
34
+ subDistrictId: i.id
36
35
  }))
37
36
  );
38
37
  } catch (a) {
39
38
  console.error("解压子区路段连接信息失败:", a);
40
39
  }
41
- } else if (h.isCoordinateValid(t)) {
42
- const o = {
40
+ } else if (l.isCoordinateValid(t)) {
41
+ const i = {
43
42
  id: t.id,
44
43
  name: t.name,
45
44
  parentId: t.parentId,
@@ -49,7 +48,7 @@ class c {
49
48
  nodeId: t.nodeId,
50
49
  isKey: t.isKey === 1
51
50
  };
52
- this.signals.push(o), this.signalCount++;
51
+ this.signals.push(i), this.signalCount++;
53
52
  }
54
53
  }
55
54
  /**
@@ -57,27 +56,27 @@ class c {
57
56
  * @returns
58
57
  */
59
58
  getAllSignalCoordinates() {
60
- const i = [];
59
+ const o = [];
61
60
  for (const s of this.signals)
62
- i.push([s.longitude, s.latitude]);
61
+ o.push([s.longitude, s.latitude]);
63
62
  for (const s of this.subDistricts)
64
- i.push(...s.getAllSignalCoordinates());
65
- return i;
63
+ o.push(...s.getAllSignalCoordinates());
64
+ return o;
66
65
  }
67
- getDarkNonGrayColor(i) {
68
- let s, t, o;
69
- if (i) {
70
- const a = this.cyrb53(i);
71
- s = ((a & 16711680) >> 16) % 200, t = ((a & 65280) >> 8) % 200, o = (a & 255) % 200;
66
+ getDarkNonGrayColor(o) {
67
+ let s, t, i;
68
+ if (o) {
69
+ const a = this.cyrb53(o);
70
+ s = ((a & 16711680) >> 16) % 200, t = ((a & 65280) >> 8) % 200, i = (a & 255) % 200;
72
71
  } else
73
- s = Math.floor(Math.random() * 256), t = Math.floor(Math.random() * 256), o = Math.floor(Math.random() * 256);
74
- return [s, t, o];
72
+ s = Math.floor(Math.random() * 256), t = Math.floor(Math.random() * 256), i = Math.floor(Math.random() * 256);
73
+ return [s, t, i];
75
74
  }
76
- cyrb53(i, s = 0) {
77
- let t = 3735928559 ^ s, o = 1103547991 ^ s;
78
- for (let a = 0, n; a < i.length; a++)
79
- n = i.charCodeAt(a), t = Math.imul(t ^ n, 2654435761), o = Math.imul(o ^ n, 1597334677);
80
- return t = Math.imul(t ^ t >>> 16, 2246822507), t ^= Math.imul(o ^ o >>> 13, 3266489909), o = Math.imul(o ^ o >>> 16, 2246822507), o ^= Math.imul(t ^ t >>> 13, 3266489909), 4294967296 * (2097151 & o) + (t >>> 0);
75
+ cyrb53(o, s = 0) {
76
+ let t = 3735928559 ^ s, i = 1103547991 ^ s;
77
+ for (let a = 0, n; a < o.length; a++)
78
+ n = o.charCodeAt(a), t = Math.imul(t ^ n, 2654435761), i = Math.imul(i ^ n, 1597334677);
79
+ 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);
81
80
  }
82
81
  }
83
82
  export {
@@ -14,7 +14,15 @@ export default class SignalControlAreaController1 {
14
14
  * @returns
15
15
  */
16
16
  showSignalControlArea(params: IShowSignalControlAreaParams): Promise<IResult>;
17
+ /**
18
+ * 显示单个区控
19
+ * @param params
20
+ */
17
21
  showDistrict(params: IShowSignalControlAreaParams): Promise<void>;
22
+ /**
23
+ * 显示单个子区
24
+ * @param params
25
+ */
18
26
  showSubDistrict(params: IShowSignalControlAreaParams): Promise<void>;
19
27
  /**
20
28
  * 清空区控、子区、信号机
@@ -1,7 +1,7 @@
1
1
  import a from "../../stores/index.mjs";
2
- import l from "./cross-renderer.mjs";
2
+ import c from "./cross-renderer.mjs";
3
3
  import r from "./district-controller.mjs";
4
- import c from "./district-renderer.mjs";
4
+ import l from "./district-renderer.mjs";
5
5
  import o from "./signal-renderer.mjs";
6
6
  import d from "./sub-district-renderer.mjs";
7
7
  class f {
@@ -9,7 +9,7 @@ class f {
9
9
  constructor(t) {
10
10
  this.view = t;
11
11
  const i = a.useAppDataStore;
12
- this.mapConfig = JSON.parse(JSON.stringify(i.mapConfig)), this.districtRenderer = new c(t), this.subDistrictRenderer = new d(t), this.signalRenderer = new o(t), this.crossRenderer = new l(t);
12
+ this.mapConfig = JSON.parse(JSON.stringify(i.mapConfig)), this.districtRenderer = new l(t), this.subDistrictRenderer = new d(t), this.signalRenderer = new o(t), this.crossRenderer = new c(t);
13
13
  }
14
14
  /**
15
15
  * 显示所有区控、子区、信号机
@@ -26,8 +26,12 @@ class f {
26
26
  );
27
27
  i.push(n), s.push(...n.subDistricts);
28
28
  }
29
- return this.districtRenderer.style = t.style || "", await this.districtRenderer.showDistricts(i), await this.subDistrictRenderer.showSubDistricts(s), await this.signalRenderer.showSignals(i), { status: 0, message: "ok" };
29
+ return this.districtRenderer.style = t.style || "", await this.districtRenderer.showDistricts(i), await this.subDistrictRenderer.showSubDistricts(s), this.crossRenderer.showCrosses(i), { status: 0, message: "ok" };
30
30
  }
31
+ /**
32
+ * 显示单个区控
33
+ * @param params
34
+ */
31
35
  async showDistrict(t) {
32
36
  this.setLayerVisibility({ id: "district", visible: !0 }), this.setLayerVisibility({ id: "subDistrict", visible: !0 });
33
37
  const i = new r(
@@ -41,6 +45,10 @@ class f {
41
45
  type: "district"
42
46
  });
43
47
  }
48
+ /**
49
+ * 显示单个子区
50
+ * @param params
51
+ */
44
52
  async showSubDistrict(t) {
45
53
  this.setLayerVisibility({ id: "subDistrict", visible: !0 });
46
54
  const i = new r(
@@ -72,12 +80,6 @@ class f {
72
80
  case "subDistrict":
73
81
  this.subDistrictRenderer.setVisible(t.visible);
74
82
  break;
75
- case "signal":
76
- this.signalRenderer.setPointVisible(t.visible);
77
- break;
78
- case "signalCluster":
79
- this.signalRenderer.setClusterVisible(t.visible);
80
- break;
81
83
  }
82
84
  return { status: 0, message: "ok" };
83
85
  }
@@ -106,27 +106,27 @@ class C {
106
106
  */
107
107
  async showRoads(i) {
108
108
  const { type: s, id: e } = i, r = this.subDistrictPointLayer.createQuery(), a = s === "district" ? "districtId" : "subDistrictId";
109
- r.where = `${a} = '${e}'`;
109
+ e !== "" ? r.where = `${a} = '${e}'` : r.where = "1=1";
110
110
  const t = await this.subDistrictPointLayer.queryFeatures(
111
111
  r
112
112
  ), n = /* @__PURE__ */ new Map();
113
113
  t.features.forEach((u) => {
114
- var y;
114
+ var b;
115
115
  const {
116
116
  subDistrictId: o,
117
117
  color: c,
118
118
  id: p,
119
119
  districtName: h,
120
120
  subDistrictName: L,
121
- signalCount: b
121
+ signalCount: y
122
122
  } = u.attributes;
123
123
  n.has(o) || n.set(o, {
124
124
  color: c,
125
125
  signalIds: [],
126
126
  districtName: h,
127
127
  subDistrictName: L,
128
- signalCount: b
129
- }), (y = n.get(o)) == null || y.signalIds.push(p);
128
+ signalCount: y
129
+ }), (b = n.get(o)) == null || b.signalIds.push(p);
130
130
  });
131
131
  const d = [], f = [];
132
132
  for (const u of n) {
@@ -141,7 +141,7 @@ class C {
141
141
  style: "solid"
142
142
  }
143
143
  });
144
- const { districtName: p, subDistrictName: h, signalIds: L, signalCount: b } = u[1];
144
+ const { districtName: p, subDistrictName: h, signalIds: L, signalCount: y } = u[1];
145
145
  this.roadConnections.filter(
146
146
  (l) => l.subDistrictId === c
147
147
  ).forEach((l) => {
@@ -157,7 +157,7 @@ class C {
157
157
  subDistrictId: c,
158
158
  subDistrictName: h,
159
159
  districtName: p,
160
- signalCount: b,
160
+ signalCount: y,
161
161
  color: u[1].color
162
162
  }
163
163
  });
@@ -216,10 +216,10 @@ class C {
216
216
  const s = await this.subDistrictLineLayer.queryFeatures();
217
217
  s.features.length > 0 && await this.subDistrictLineLayer.applyEdits({
218
218
  deleteFeatures: s.features
219
- }), this.subDistrictLineLayer.definitionExpression = "1=1", (e = this.clickHandler) == null || e.remove();
219
+ }), this.subDistrictLineLayer.definitionExpression = "1=1", this.roadConnections = [], (e = this.clickHandler) == null || e.remove();
220
220
  }
221
221
  setVisible(i) {
222
- this.subDistrictPointLayer.visible = i, this.subDistrictLineLayer.visible = i;
222
+ this.showRoads({ type: "district", id: "" }), this.subDistrictPointLayer.visible = i, this.subDistrictLineLayer.visible = i;
223
223
  }
224
224
  /**
225
225
  * 定位子区
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@arcgis/core/Basemap"),M=require("@arcgis/core/config"),W=require("@arcgis/core/core/reactiveUtils"),b=require("@arcgis/core/geometry"),C=require("@arcgis/core/geometry/support/webMercatorUtils"),T=require("@arcgis/core/Graphic"),I=require("@arcgis/core/layers/FeatureLayer"),G=require("@arcgis/core/layers/GeoJSONLayer"),O=require("@arcgis/core/layers/GroupLayer"),S=require("@arcgis/core/layers/IntegratedMesh3DTilesLayer"),x=require("@arcgis/core/layers/MapImageLayer"),_=require("@arcgis/core/layers/TileLayer"),j=require("@arcgis/core/layers/WebTileLayer"),H=require("@arcgis/core/layers/WMSLayer"),B=require("@arcgis/core/Map"),N=require("@arcgis/core/views/MapView"),R=require("@arcgis/core/views/SceneView"),E=require("@turf/destination"),U=require("@turf/helpers"),A=require("@arcgis/core/layers/GraphicsLayer"),D=require("./custom-layer/custom-wmts-layer.js");function k(y){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const i in y)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(y,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>y[i]})}}return e.default=y,Object.freeze(e)}const q=k(W),L=k(C),V=k(U);class J{constructor(){this.mapConfig={},this.watchHandleMap=new Map,this.handleIndex=0,this.zoomWatchHandle=null,this.detachmentLayerLoaded=!1}processUrl(e){return e&&(e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("{{")?e.replace("{{geoServer}}",this.mapConfig.geoServer):this.mapConfig.assetsRoot+e)}async initialize(e){var p,w,g,m;this.mapConfig=e.mapConfig;const{container:i,markerClickCallback:s,mapClickCallback:o}=e;M.assetsPath=`${this.mapConfig.assetsRoot}/ArcgisAssets`,M.fontsUrl=`${this.mapConfig.assetsRoot}/fonts`,M.apiKey="AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";const a=new B;((p=this.mapConfig)==null?void 0:p.mapOptions.mode.toLowerCase())==="2d"?(this.view=new N({map:a,container:i,...this.mapConfig.mapOptions}),this.view.on("drag",t=>{t.button===2&&t.stopPropagation()})):this.view=new R({map:a,container:i,environment:{atmosphereEnabled:!0,lighting:{type:"virtual"}},...(w=this.mapConfig)==null?void 0:w.mapOptions}),this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!1,featureNavigation:!0},this.view.popup.dockOptions={buttonEnabled:!1,breakpoint:!1},this.view.on("click",async t=>{var l,v;if(o){let n=t.mapPoint;n.spatialReference.isWebMercator&&(n=L.webMercatorToGeographic(n)),o([n.x,n.y],[t.screenPoint.x,t.screenPoint.y],t)}if(this.view.type==="3d"){const n=this.view.camera;if(this.view.spatialReference.isWebMercator){const d=L.webMercatorToGeographic(n.position),f={heading:n.heading,tilt:n.tilt,position:d.toJSON()};console.log(f),(l=navigator.clipboard)==null||l.writeText(JSON.stringify(f))}else console.log(n.toJSON());console.log(this.view.zoom,this.view.scale)}else{let n=this.view.center;this.view.spatialReference.isWebMercator&&(n=L.webMercatorToGeographic(n)),console.log({center:n.toJSON(),zoom:this.view.zoom,scale:this.view.scale})}const c=(v=(await this.view.hitTest(t)).results)==null?void 0:v.filter(n=>n.type==="graphic");c.length>0&&c.forEach(n=>{var f;const d=n.graphic;(f=d.attributes)!=null&&f.type&&s&&s(d.attributes.type,d.attributes.id,d.attributes,t)})});{let t=0,r=!1;this.view.on("pointer-move",async c=>{var v;const l=performance.now();if(!(r||l-t<100)){t=l,r=!0;try{const d=(v=(await this.view.hitTest(c)).results)==null?void 0:v.some(z=>z.type==="graphic"),f=this.view.container;f&&(f.style.cursor=d?"pointer":"default")}finally{r=!1}}})}if(this.view.on("pointer-leave",()=>{const t=this.view.container;t&&(t.style.cursor="default")}),(g=this.mapConfig)!=null&&g.baseLayers?this.mapConfig.baseLayers.forEach(t=>{const r=this.processUrl(t.url);let c=null;switch(t.type.toLowerCase()){case"webTile".toLowerCase():{c=new j({urlTemplate:r,...t.options});break}case"tile":{c=new _({url:r,...t.options});break}case"customwmts".toLowerCase():{c=new D.default({urlTemplate:r,...t.options});break}case"mapimage".toLowerCase():{c=new x({url:r,...t.options});break}case"arcgis":{const l=new P(t.options);a.basemap=l;break}case"feature":{c=new I({url:r,...t.options});break}case"3dtiles":{c=new S({url:r,...t.options});break}case"wms":{c=new H({url:r,...t.options});break}}if(c)if(t.group){let l=a.findLayerById(t.group);l&&l.type==="group"?l.add(c):(l=new O({id:t.group,title:t.groupTitle,visibilityMode:"inherited",layers:[c],visible:t.groupVisible!==!1}),a.add(l))}else a.add(c)}):a.basemap=new P({style:{id:"arcgis/light-gray",language:"zh-CN"}}),(m=this.mapConfig)!=null&&m.hdLayers){const t=this.mapConfig.hdLayers.map(r=>new G({url:this.processUrl(r.url),...r.options,title:r.options.id}));a.addMany(t)}this.view.ui.remove("attribution"),await this.view.when();const h=this.mapConfig.camera;let u;if(this.view.type==="2d"){let t=this.view.center;this.view.spatialReference.isWebMercator&&(t=L.webMercatorToGeographic(t)),u={center:[t.x,t.y],zoom:this.view.zoom}}else{let t=this.view.camera.position;this.view.spatialReference.isWebMercator&&(t=L.webMercatorToGeographic(t)),u={position:t,heading:this.view.camera.heading,tilt:this.view.camera.tilt}}return h?h.home=u:this.mapConfig.camera={home:u},this.view}async setLayerVisibility(e){const{id:i,visible:s}=e;if(i==="shanghai_district")return this.detachmentLayerLoaded?this.detachmentLayer.visible=s:await this.loadDetachmentLayer(),{status:0,message:"ok"};{const o=this.view.map.findLayerById(i);return o?(o.visible=s,{status:0,message:"ok"}):{status:-1,message:"未找到图层"}}}async setMapCenter(e){var i;if(!this.view)return{status:-1,message:"未初始化"};if(e.center||e.target){switch((i=e.target)==null?void 0:i.type.toLowerCase()){case"point":e.target=new b.Point(e.target);break;case"polyline":e.target=new b.Polyline(e.target);break;case"polygon":e.target=new b.Polygon(e.target);break;case"multipoint":e.target=new b.Multipoint(e.target);break}await this.view.goTo(e,{duration:(e.duration||0)*1e3})}return{status:0,message:"成功"}}setMapZoom(e){return this.view?(this.view.zoom=e.zoom,{status:0,message:"成功"}):{status:-1,message:"未初始化"}}async lookAt(e){if(this.view.type==="2d")return;const i=e.tilt||0,s=e.heading||0;if(i===0)await this.view.goTo({position:{x:e.center[0],y:e.center[1],z:e.height},heading:s,tilt:0},{duration:(e.duration||2)*1e3});else{const o=Math.tan(i*Math.PI/180)*e.height,a=E(V.point(e.center),o,s+180,{units:"meters"});await this.view.goTo({position:{x:a.geometry.coordinates[0],y:a.geometry.coordinates[1],z:e.height},heading:s,tilt:i},{duration:(e.duration||2)*1e3})}}async setMapCamera(e){if(!this.view)return{status:-1,message:"未初始化"};const{name:i,duration:s=0}=e,{camera:o}=this.mapConfig;if(!o)return{status:-1,message:"未配置camera"};const a=o[i];return a?(await this.view.goTo(a,{duration:s*1e3}),{status:0,message:"成功"}):{status:-1,message:"未配置camera"}}requestCoordinateTransform(e,i){let s=0;const a=1e3/30,h=q.watch(()=>this.view.center,()=>{const u=this.transformPoints(e),p=Date.now();p-s>a&&(i(u),s=p)});return this.handleIndex++,this.watchHandleMap.set(this.handleIndex,h),{handle:this.handleIndex,points:this.transformPoints(e)}}transformPoints(e){return e.map(i=>{const s=new b.Point({x:i[0],y:i[1]}),o=this.view.toScreen(s);return[o.x,o.y]})}cancelCoordinateTransform(e){const i=this.watchHandleMap.get(e);i&&(i.remove(),this.watchHandleMap.delete(e))}setMapZoomRange(e){const{min:i,max:s}=e;!i&&!s||(this.zoomWatchHandle&&this.zoomWatchHandle.remove(),this.zoomWatchHandle=q.watch(()=>this.view.zoom,o=>{i&&o<=i&&(this.view.zoom=i),s&&o>=s&&(this.view.zoom=s)}))}async loadDetachmentLayer(){this.detachmentLayer=new A({id:"detachmentLayer",title:"支队图层",effect:void 0}),this.view.map.add(this.detachmentLayer);const e=this.mapConfig.baseLayers;if(!e)return;const i=e.find(s=>s.options.id==="shanghai_district");if(i)try{const o=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),a=[],{renderer:h,labelingInfo:u}=i.options;o.features.forEach(p=>{const w=p.attributes.ZD_NAME;if(w!=="高架支队"){let g=new b.Polygon({rings:p.geometry.rings});g=C.webMercatorToGeographic(g);const m=new T({geometry:g,attributes:p.attributes});if(h){if(h.type==="simple")m.symbol=h.symbol;else if(h.type==="unique-value"){const t=m.getAttribute("OBJECTID"),r=h.uniqueValueInfos.find(c=>c.value==t);m.symbol=r?r.symbol:h.defaultSymbol}}else m.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(a.push(m),u&&w!=="边防港航支队"&&w!=="机场支队"){const t=new T({geometry:g.centroid,symbol:{...u.symbol,text:w}});a.push(t)}}}),this.detachmentLayer.addMany(a),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=J;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@arcgis/core/Basemap"),M=require("@arcgis/core/config"),W=require("@arcgis/core/core/reactiveUtils"),b=require("@arcgis/core/geometry"),C=require("@arcgis/core/geometry/support/webMercatorUtils"),T=require("@arcgis/core/Graphic"),I=require("@arcgis/core/layers/FeatureLayer"),G=require("@arcgis/core/layers/GeoJSONLayer"),O=require("@arcgis/core/layers/GroupLayer"),S=require("@arcgis/core/layers/IntegratedMesh3DTilesLayer"),x=require("@arcgis/core/layers/MapImageLayer"),_=require("@arcgis/core/layers/TileLayer"),j=require("@arcgis/core/layers/WebTileLayer"),H=require("@arcgis/core/layers/WMSLayer"),B=require("@arcgis/core/Map"),N=require("@arcgis/core/views/MapView"),R=require("@arcgis/core/views/SceneView"),E=require("@turf/destination"),U=require("@turf/helpers"),A=require("@arcgis/core/layers/GraphicsLayer"),D=require("./custom-layer/custom-wmts-layer.js");function k(y){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const i in y)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(y,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>y[i]})}}return e.default=y,Object.freeze(e)}const q=k(W),L=k(C),V=k(U);class J{constructor(){this.mapConfig={},this.watchHandleMap=new Map,this.handleIndex=0,this.zoomWatchHandle=null,this.detachmentLayerLoaded=!1}processUrl(e){return e&&(e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("{{")?e.replace("{{geoServer}}",this.mapConfig.geoServer):this.mapConfig.assetsRoot+e)}async initialize(e){var p,w,g,m;this.mapConfig=e.mapConfig;const{container:i,markerClickCallback:s,mapClickCallback:a}=e;M.assetsPath=`${this.mapConfig.assetsRoot}/ArcgisAssets`,M.fontsUrl=`${this.mapConfig.assetsRoot}/fonts`,M.apiKey="AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";const o=new B;((p=this.mapConfig)==null?void 0:p.mapOptions.mode.toLowerCase())==="2d"?(this.view=new N({map:o,container:i,...this.mapConfig.mapOptions}),this.view.on("drag",t=>{t.button===2&&t.stopPropagation()})):this.view=new R({map:o,container:i,environment:{atmosphereEnabled:!0,lighting:{type:"virtual"}},...(w=this.mapConfig)==null?void 0:w.mapOptions}),this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!1,featureNavigation:!0},this.view.popup.dockOptions={buttonEnabled:!1,breakpoint:!1},this.view.on("click",async t=>{var l,v;if(a){let n=t.mapPoint;n.spatialReference.isWebMercator&&(n=L.webMercatorToGeographic(n)),a([n.x,n.y],[t.screenPoint.x,t.screenPoint.y],t)}if(this.view.type==="3d"){const n=this.view.camera;if(this.view.spatialReference.isWebMercator){const d=L.webMercatorToGeographic(n.position),f={heading:n.heading,tilt:n.tilt,position:d.toJSON()};console.log(f),(l=navigator.clipboard)==null||l.writeText(JSON.stringify(f))}else console.log(n.toJSON());console.log(this.view.zoom,this.view.scale)}else{let n=this.view.center;this.view.spatialReference.isWebMercator&&(n=L.webMercatorToGeographic(n)),console.log({center:n.toJSON(),zoom:this.view.zoom,scale:this.view.scale})}const c=(v=(await this.view.hitTest(t)).results)==null?void 0:v.filter(n=>n.type==="graphic");c.length>0&&c.forEach(n=>{var f;const d=n.graphic;(f=d.attributes)!=null&&f.type&&s&&s(d.attributes.type,d.attributes.id,d.attributes,t)})});{let t=0,r=!1;this.view.on("pointer-move",async c=>{var v;const l=performance.now();if(!(r||l-t<100)){t=l,r=!0;try{const d=(v=(await this.view.hitTest(c)).results)==null?void 0:v.some(z=>z.type==="graphic"),f=this.view.container;f&&(f.style.cursor=d?"pointer":"default")}finally{r=!1}}})}if(this.view.on("pointer-leave",()=>{const t=this.view.container;t&&(t.style.cursor="default")}),(g=this.mapConfig)!=null&&g.baseLayers?this.mapConfig.baseLayers.forEach(t=>{const r=this.processUrl(t.url);let c=null;switch(t.type.toLowerCase()){case"webTile".toLowerCase():{c=new j({urlTemplate:r,...t.options});break}case"tile":{c=new _({url:r,...t.options});break}case"customwmts".toLowerCase():{c=new D.default({urlTemplate:r,...t.options});break}case"mapimage".toLowerCase():{c=new x({url:r,...t.options});break}case"arcgis":{const l=new P(t.options);o.basemap=l;break}case"feature":{c=new I({url:r,...t.options});break}case"3dtiles":{c=new S({url:r,...t.options});break}case"wms":{c=new H({url:r,...t.options});break}}if(c)if(t.group){let l=o.findLayerById(t.group);l&&l.type==="group"?l.add(c):(l=new O({id:t.group,title:t.groupTitle,visibilityMode:"inherited",layers:[c],visible:t.groupVisible!==!1}),o.add(l))}else o.add(c)}):o.basemap=new P({style:{id:"arcgis/light-gray",language:"zh-CN"}}),(m=this.mapConfig)!=null&&m.hdLayers){const t=this.mapConfig.hdLayers.map(r=>new G({url:this.processUrl(r.url),...r.options,title:r.options.id}));o.addMany(t)}this.view.ui.remove("attribution"),await this.view.when();const h=this.mapConfig.camera;let u;if(this.view.type==="2d"){let t=this.view.center;this.view.spatialReference.isWebMercator&&(t=L.webMercatorToGeographic(t)),u={center:[t.x,t.y],zoom:this.view.zoom}}else{let t=this.view.camera.position;this.view.spatialReference.isWebMercator&&(t=L.webMercatorToGeographic(t)),u={position:t,heading:this.view.camera.heading,tilt:this.view.camera.tilt}}return h?h.home=u:this.mapConfig.camera={home:u},this.view}async setLayerVisibility(e){const{id:i,visible:s}=e;if(i==="shanghai_district")return!this.detachmentLayerLoaded&&e.visible?await this.loadDetachmentLayer():this.detachmentLayer.visible=s,{status:0,message:"ok"};{const a=this.view.map.findLayerById(i);return a?(a.visible=s,{status:0,message:"ok"}):{status:-1,message:"未找到图层"}}}async setMapCenter(e){var i;if(!this.view)return{status:-1,message:"未初始化"};if(e.center||e.target){switch((i=e.target)==null?void 0:i.type.toLowerCase()){case"point":e.target=new b.Point(e.target);break;case"polyline":e.target=new b.Polyline(e.target);break;case"polygon":e.target=new b.Polygon(e.target);break;case"multipoint":e.target=new b.Multipoint(e.target);break}await this.view.goTo(e,{duration:(e.duration||0)*1e3})}return{status:0,message:"成功"}}setMapZoom(e){return this.view?(this.view.zoom=e.zoom,{status:0,message:"成功"}):{status:-1,message:"未初始化"}}async lookAt(e){if(this.view.type==="2d")return;const i=e.tilt||0,s=e.heading||0;if(i===0)await this.view.goTo({position:{x:e.center[0],y:e.center[1],z:e.height},heading:s,tilt:0},{duration:(e.duration||2)*1e3});else{const a=Math.tan(i*Math.PI/180)*e.height,o=E(V.point(e.center),a,s+180,{units:"meters"});await this.view.goTo({position:{x:o.geometry.coordinates[0],y:o.geometry.coordinates[1],z:e.height},heading:s,tilt:i},{duration:(e.duration||2)*1e3})}}async setMapCamera(e){if(!this.view)return{status:-1,message:"未初始化"};const{name:i,duration:s=0}=e,{camera:a}=this.mapConfig;if(!a)return{status:-1,message:"未配置camera"};const o=a[i];return o?(await this.view.goTo(o,{duration:s*1e3}),{status:0,message:"成功"}):{status:-1,message:"未配置camera"}}requestCoordinateTransform(e,i){let s=0;const o=1e3/30,h=q.watch(()=>this.view.center,()=>{const u=this.transformPoints(e),p=Date.now();p-s>o&&(i(u),s=p)});return this.handleIndex++,this.watchHandleMap.set(this.handleIndex,h),{handle:this.handleIndex,points:this.transformPoints(e)}}transformPoints(e){return e.map(i=>{const s=new b.Point({x:i[0],y:i[1]}),a=this.view.toScreen(s);return[a.x,a.y]})}cancelCoordinateTransform(e){const i=this.watchHandleMap.get(e);i&&(i.remove(),this.watchHandleMap.delete(e))}setMapZoomRange(e){const{min:i,max:s}=e;!i&&!s||(this.zoomWatchHandle&&this.zoomWatchHandle.remove(),this.zoomWatchHandle=q.watch(()=>this.view.zoom,a=>{i&&a<=i&&(this.view.zoom=i),s&&a>=s&&(this.view.zoom=s)}))}async loadDetachmentLayer(){this.detachmentLayer=new A({id:"detachmentLayer",title:"支队图层",effect:void 0}),this.view.map.add(this.detachmentLayer);const e=this.mapConfig.baseLayers;if(!e)return;const i=e.find(s=>s.options.id==="shanghai_district");if(i)try{const a=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),o=[],{renderer:h,labelingInfo:u}=i.options;a.features.forEach(p=>{const w=p.attributes.ZD_NAME;if(w!=="高架支队"){let g=new b.Polygon({rings:p.geometry.rings});g=C.webMercatorToGeographic(g);const m=new T({geometry:g,attributes:p.attributes});if(h){if(h.type==="simple")m.symbol=h.symbol;else if(h.type==="unique-value"){const t=m.getAttribute("OBJECTID"),r=h.uniqueValueInfos.find(c=>c.value==t);m.symbol=r?r.symbol:h.defaultSymbol}}else m.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(o.push(m),u&&w!=="边防港航支队"&&w!=="机场支队"){const t=new T({geometry:g.centroid,symbol:{...u.symbol,text:w}});o.push(t)}}}),this.detachmentLayer.addMany(o),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=J;
@@ -2,8 +2,16 @@ import DistrictController from './district-controller';
2
2
  export default class CrossRenderer {
3
3
  private view;
4
4
  private crossLayer;
5
- private crossGraphics;
6
5
  private crossGraphicSymbol;
6
+ private locations;
7
7
  constructor(view: __esri.MapView | __esri.SceneView);
8
8
  showCrosses(controllers: DistrictController[]): Promise<void>;
9
+ /**
10
+ * 显示聚合点
11
+ */
12
+ showCluster(): void;
13
+ /**
14
+ * 显示散点
15
+ */
16
+ showScatter(): void;
9
17
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@arcgis/core/Graphic"),a=require("@arcgis/core/layers/GraphicsLayer");class c{constructor(s){this.crossGraphics=[],this.crossGraphicSymbol={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:18,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"}]}}},this.view=s,this.crossLayer=new a,this.view.map.add(this.crossLayer)}async showCrosses(s){this.crossLayer.removeAll(),s.forEach(i=>{i.signals.forEach(e=>{const t=new r({geometry:{type:"point",longitude:e.longitude,latitude:e.latitude},symbol:this.crossGraphicSymbol,attributes:{id:e.id,name:e.name,signalId:e.signalId,nodeId:e.nodeId||e.id,districtId:i.id,districtName:i.name,subDistrictId:"",subDistrictName:"",isKey:e.isKey,type:"signal",selected:!0}});this.crossGraphics.push(t)}),i.subDistricts.forEach(e=>{e.signals.forEach(t=>{const o=new r({geometry:{type:"point",longitude:t.longitude,latitude:t.latitude},symbol:this.crossGraphicSymbol,attributes:{id:t.id,name:t.name,signalId:t.signalId,nodeId:t.nodeId||t.id,districtId:i.id,districtName:i.name,subDistrictId:e.id,subDistrictName:e.name,isKey:t.isKey,type:"signal",selected:!0}});this.crossGraphics.push(o)})})}),this.crossLayer.addMany(this.crossGraphics)}}exports.default=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@arcgis/core/layers/GraphicsLayer");class s{constructor(r){this.crossGraphicSymbol={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:18,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"}]}}},this.locations=[],this.view=r,this.crossLayer=new o,this.view.map.add(this.crossLayer)}async showCrosses(r){r.forEach(i=>{i.signals.forEach(e=>{e.longitude&&e.latitude&&!isNaN(e.longitude)&&!isNaN(e.latitude)&&this.locations.push({id:e.id,x:e.longitude,y:e.latitude,visited:!1,clusterId:void 0,properties:e})}),i.subDistricts.forEach(e=>{e.signals.forEach(t=>{t.longitude&&t.latitude&&!isNaN(t.longitude)&&!isNaN(t.latitude)&&this.locations.push({id:t.id,x:t.longitude,y:t.latitude,visited:!1,clusterId:void 0,properties:t})})})})}showCluster(){}showScatter(){}}exports.default=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("pako"),h=require("../common-utils.js");class d{constructor(o,s){if(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]),o.mapConnectList)try{const t=o.mapConnectList,i=new Uint8Array(window.atob(t).split("").map(e=>e.charCodeAt(0))),n=c.inflate(i,{to:"string"}),a=JSON.parse(n);this.roadConnections.push(...a.map(e=>({id:e.roadsectId,coordinates:JSON.parse(e.geomData).coordinates,districtId:this.parentId,subDistrictId:this.id})))}catch(t){console.error("解压子区路段连接信息失败:",t)}console.log(o);for(const t of o.children)if(t.children){const i=new d(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 n=t.mapConnectList,a=new Uint8Array(window.atob(n).split("").map(r=>r.charCodeAt(0))),e=c.inflate(a,{to:"string"}),l=JSON.parse(e);i.roadConnections.push(...l.map(r=>({id:r.roadsectId,coordinates:JSON.parse(r.geomData).coordinates,districtId:i.parentId,subDistrictId:i.id})))}catch(n){console.error("解压子区路段连接信息失败:",n)}}else if(h.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 n=this.cyrb53(o);s=((n&16711680)>>16)%200,t=((n&65280)>>8)%200,i=(n&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 n=0,a;n<o.length;n++)a=o.charCodeAt(n),t=Math.imul(t^a,2654435761),i=Math.imul(i^a,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=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("pako"),h=require("../common-utils.js");class d{constructor(o,s){if(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]),o.mapConnectList)try{const t=o.mapConnectList,i=new Uint8Array(window.atob(t).split("").map(r=>r.charCodeAt(0))),a=c.inflate(i,{to:"string"}),n=JSON.parse(a);this.roadConnections.push(...n.map(r=>({id:r.roadsectId,coordinates:JSON.parse(r.geomData).coordinates,districtId:this.parentId,subDistrictId:this.id})))}catch(t){console.error("解压子区路段连接信息失败:",t)}for(const t of o.children)if(t.children){const i=new d(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))),r=c.inflate(n,{to:"string"}),l=JSON.parse(r);i.roadConnections.push(...l.map(e=>({id:e.roadsectId,coordinates:JSON.parse(e.geomData).coordinates,districtId:i.parentId,subDistrictId:i.id})))}catch(a){console.error("解压子区路段连接信息失败:",a)}}else if(h.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=d;
@@ -14,7 +14,15 @@ export default class SignalControlAreaController1 {
14
14
  * @returns
15
15
  */
16
16
  showSignalControlArea(params: IShowSignalControlAreaParams): Promise<IResult>;
17
+ /**
18
+ * 显示单个区控
19
+ * @param params
20
+ */
17
21
  showDistrict(params: IShowSignalControlAreaParams): Promise<void>;
22
+ /**
23
+ * 显示单个子区
24
+ * @param params
25
+ */
18
26
  showSubDistrict(params: IShowSignalControlAreaParams): Promise<void>;
19
27
  /**
20
28
  * 清空区控、子区、信号机
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../stores/index.js"),l=require("./cross-renderer.js"),r=require("./district-controller.js"),c=require("./district-renderer.js"),d=require("./signal-renderer.js"),u=require("./sub-district-renderer.js");class o{constructor(t){this.view=t;const e=a.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(e.mapConfig)),this.districtRenderer=new c.default(t),this.subDistrictRenderer=new u.default(t),this.signalRenderer=new d.default(t),this.crossRenderer=new l.default(t)}async showSignalControlArea(t){await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const e=[],i=[];for(const s of t.areaList){const n=new r.default(s,t.style||"");e.push(n),i.push(...n.subDistricts)}return this.districtRenderer.style=t.style||"",await this.districtRenderer.showDistricts(e),await this.subDistrictRenderer.showSubDistricts(i),await this.signalRenderer.showSignals(e),{status:0,message:"ok"}}async showDistrict(t){this.setLayerVisibility({id:"district",visible:!0}),this.setLayerVisibility({id:"subDistrict",visible:!0});const e=new r.default(t.areaList,t.style||"");await this.districtRenderer.showDistricts([e]),await this.subDistrictRenderer.showSubDistricts(e.subDistricts),await this.subDistrictRenderer.showRoads({id:e.id,type:"district"})}async showSubDistrict(t){this.setLayerVisibility({id:"subDistrict",visible:!0});const e=new r.default(t.areaList,t.style||"");await this.subDistrictRenderer.showSubDistricts([e]),await this.subDistrictRenderer.showRoads({id:e.id,type:"subDistrict"})}async clearSignalControlArea(){return await this.districtRenderer.clearDistricts(),await this.subDistrictRenderer.clearSubDistricts(),await this.signalRenderer.clearSignals(),{status:0,message:"ok"}}setLayerVisibility(t){switch(t.visible===!1&&this.view.closePopup(),t.id){case"district":this.districtRenderer.setVisible(t.visible);break;case"subDistrict":this.subDistrictRenderer.setVisible(t.visible);break;case"signal":this.signalRenderer.setPointVisible(t.visible);break;case"signalCluster":this.signalRenderer.setClusterVisible(t.visible);break}return{status:0,message:"ok"}}async locateSignalControlArea(t){switch(t.type){case"district":return await this.districtRenderer.locateDistrict(t.id);case"subDistrict":return await this.subDistrictRenderer.locateSubDistrict(t.id);case"signal":return await this.signalRenderer.locateSignal(t.id);default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(t){switch(this.view.closePopup(),t.type){case"district":return await this.districtRenderer.highlightDistrict(t)?(this.subDistrictRenderer.filter(t),this.signalRenderer.filter(t),await this.subDistrictRenderer.showRoads(t),{status:0,message:"ok"}):{status:1,message:"未找到区控"};case"subDistrict":{const{count:e,parentId:i}=await this.subDistrictRenderer.highlightSubDistrict(t);return e>0?(this.districtRenderer.filter(i),this.signalRenderer.filter(t),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:e,subDistrictId:i,count:s}=await this.signalRenderer.highlightSignal(t.id);return s>0?(this.districtRenderer.filter(e),this.subDistrictRenderer.filter(t),{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"}}}exports.default=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../stores/index.js"),c=require("./cross-renderer.js"),r=require("./district-controller.js"),l=require("./district-renderer.js"),d=require("./signal-renderer.js"),u=require("./sub-district-renderer.js");class o{constructor(t){this.view=t;const e=a.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(e.mapConfig)),this.districtRenderer=new l.default(t),this.subDistrictRenderer=new u.default(t),this.signalRenderer=new d.default(t),this.crossRenderer=new c.default(t)}async showSignalControlArea(t){await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const e=[],s=[];for(const i of t.areaList){const n=new r.default(i,t.style||"");e.push(n),s.push(...n.subDistricts)}return this.districtRenderer.style=t.style||"",await this.districtRenderer.showDistricts(e),await this.subDistrictRenderer.showSubDistricts(s),this.crossRenderer.showCrosses(e),{status:0,message:"ok"}}async showDistrict(t){this.setLayerVisibility({id:"district",visible:!0}),this.setLayerVisibility({id:"subDistrict",visible:!0});const e=new r.default(t.areaList,t.style||"");await this.districtRenderer.showDistricts([e]),await this.subDistrictRenderer.showSubDistricts(e.subDistricts),await this.subDistrictRenderer.showRoads({id:e.id,type:"district"})}async showSubDistrict(t){this.setLayerVisibility({id:"subDistrict",visible:!0});const e=new r.default(t.areaList,t.style||"");await this.subDistrictRenderer.showSubDistricts([e]),await this.subDistrictRenderer.showRoads({id:e.id,type:"subDistrict"})}async clearSignalControlArea(){return await this.districtRenderer.clearDistricts(),await this.subDistrictRenderer.clearSubDistricts(),await this.signalRenderer.clearSignals(),{status:0,message:"ok"}}setLayerVisibility(t){switch(t.visible===!1&&this.view.closePopup(),t.id){case"district":this.districtRenderer.setVisible(t.visible);break;case"subDistrict":this.subDistrictRenderer.setVisible(t.visible);break}return{status:0,message:"ok"}}async locateSignalControlArea(t){switch(t.type){case"district":return await this.districtRenderer.locateDistrict(t.id);case"subDistrict":return await this.subDistrictRenderer.locateSubDistrict(t.id);case"signal":return await this.signalRenderer.locateSignal(t.id);default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(t){switch(this.view.closePopup(),t.type){case"district":return await this.districtRenderer.highlightDistrict(t)?(this.subDistrictRenderer.filter(t),this.signalRenderer.filter(t),await this.subDistrictRenderer.showRoads(t),{status:0,message:"ok"}):{status:1,message:"未找到区控"};case"subDistrict":{const{count:e,parentId:s}=await this.subDistrictRenderer.highlightSubDistrict(t);return e>0?(this.districtRenderer.filter(s),this.signalRenderer.filter(t),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:e,subDistrictId:s,count:i}=await this.signalRenderer.highlightSignal(t.id);return i>0?(this.districtRenderer.filter(e),this.subDistrictRenderer.filter(t),{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"}}}exports.default=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@arcgis/core/Graphic"),m=require("@arcgis/core/layers/FeatureLayer"),D=require("../common-utils.js"),w=require("./layer-symbol.js");class g{constructor(e){this.roadConnections=[],this.view=e,this.subDistrictPointLayer=new m(w.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=e.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new m(w.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=e.spatialReference,this.subDistrictLineLayer.popupEnabled=!0,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(e){var a;await this.clearSubDistricts(),(a=this.clickHandler)==null||a.remove(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const i=[],r=[];e.forEach(t=>{t.roadConnections.length>0&&this.roadConnections.push(...t.roadConnections),r.push({value:t.id,label:t.name,symbol:{type:"simple-marker",style:"circle",color:[...t.areaColor,.8],size:"8px",outline:{color:[...t.areaColor],width:4}}}),t.signals.forEach(u=>{const d=new v({geometry:{type:"point",longitude:u.longitude,latitude:u.latitude},attributes:{ObjectID:s++,id:u.nodeId,name:u.name,subDistrictId:t.id,subDistrictName:t.name,districtId:t.parentId,districtName:t.parentName,signalCount:t.signalCount,color:t.areaColor.join(","),type:"subDistrict"}});i.push(d)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:[180,180,180,.5],size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:i}),await D.default.viewGoto(this.view,i)}async showRoads(e){const{type:s,id:i}=e,r=this.subDistrictPointLayer.createQuery(),a=s==="district"?"districtId":"subDistrictId";r.where=`${a} = '${i}'`;const t=await this.subDistrictPointLayer.queryFeatures(r),u=new Map;t.features.forEach(n=>{var p;const{subDistrictId:o,color:c,id:b,districtName:y,subDistrictName:L,signalCount:h}=n.attributes;u.has(o)||u.set(o,{color:c,signalIds:[],districtName:y,subDistrictName:L,signalCount:h}),(p=u.get(o))==null||p.signalIds.push(b)});const d=[],f=[];for(const n of u){let o=0;const c=n[0];d.push({value:c,symbol:{type:"simple-line",color:n[1].color.split(",").map(Number),width:2,style:"solid"}});const{districtName:b,subDistrictName:y,signalIds:L,signalCount:h}=n[1];this.roadConnections.filter(l=>l.subDistrictId===c).forEach(l=>{const I=new v({geometry:{type:"polyline",paths:l.coordinates},attributes:{ObjectID:o++,id:l.id,districtId:l.districtId,subDistrictId:c,subDistrictName:y,districtName:b,signalCount:h,color:n[1].color}});f.push(I)})}this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",color:[180,180,180,.5],width:2,style:"solid"},defaultLabel:"其他子区",uniqueValueInfos:d,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentLineRenderer=this.subDistrictLineLayer.renderer.clone(),await this.subDistrictLineLayer.applyEdits({addFeatures:f})}async clearSubDistricts(){var i;const e=await this.subDistrictPointLayer.queryFeatures();e.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:e.features}),this.subDistrictPointLayer.definitionExpression="1=1";const s=await this.subDistrictLineLayer.queryFeatures();s.features.length>0&&await this.subDistrictLineLayer.applyEdits({deleteFeatures:s.features}),this.subDistrictLineLayer.definitionExpression="1=1",(i=this.clickHandler)==null||i.remove()}setVisible(e){this.subDistrictPointLayer.visible=e,this.subDistrictLineLayer.visible=e}async locateSubDistrict(e){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${e}'`,s.returnGeometry=!0;const i=await this.subDistrictPointLayer.queryFeatures(s);return i.features.length>0?(await D.default.viewGoto(this.view,i.features,!1),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(e){let s="";const i=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${e.id}'`;const r=await this.subDistrictPointLayer.queryFeatures(),a=r.features.length;return a>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${e.id}'`,s=r.features[0].attributes.districtId,await D.default.viewGoto(this.view,r.features,e.needZoom!==!1)):this.subDistrictPointLayer.definitionExpression=i,{count:a,parentId:s}}filter(e){const{type:s,id:i}=e,r=`${s==="district"?"districtId":"subDistrictId"} = '${i}'`;this.subDistrictPointLayer.definitionExpression=r,this.subDistrictLineLayer.definitionExpression=r}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(e){var r;const i=(r=(await this.view.hitTest(e,{include:[this.subDistrictPointLayer,this.subDistrictLineLayer]})).results)==null?void 0:r.filter(a=>a.type==="graphic");if(i.length===0)console.time("resetRenderer"),this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const a=i[0].graphic,t=a.attributes.color.split(",").map(Number);this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:a.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[...t,.8],size:"8px",outline:{color:t,width:4}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",style:"solid",color:[180,180,180,.5],width:"8px"},defaultLabel:"其他子区",uniqueValueInfos:[{value:a.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:a.attributes.color.split(",").map(Number),width:"8px"}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}}}}exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@arcgis/core/Graphic"),m=require("@arcgis/core/layers/FeatureLayer"),D=require("../common-utils.js"),w=require("./layer-symbol.js");class g{constructor(e){this.roadConnections=[],this.view=e,this.subDistrictPointLayer=new m(w.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=e.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new m(w.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=e.spatialReference,this.subDistrictLineLayer.popupEnabled=!0,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(e){var a;await this.clearSubDistricts(),(a=this.clickHandler)==null||a.remove(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const i=[],r=[];e.forEach(t=>{t.roadConnections.length>0&&this.roadConnections.push(...t.roadConnections),r.push({value:t.id,label:t.name,symbol:{type:"simple-marker",style:"circle",color:[...t.areaColor,.8],size:"8px",outline:{color:[...t.areaColor],width:4}}}),t.signals.forEach(n=>{const d=new v({geometry:{type:"point",longitude:n.longitude,latitude:n.latitude},attributes:{ObjectID:s++,id:n.nodeId,name:n.name,subDistrictId:t.id,subDistrictName:t.name,districtId:t.parentId,districtName:t.parentName,signalCount:t.signalCount,color:t.areaColor.join(","),type:"subDistrict"}});i.push(d)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:[180,180,180,.5],size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:i}),await D.default.viewGoto(this.view,i)}async showRoads(e){const{type:s,id:i}=e,r=this.subDistrictPointLayer.createQuery(),a=s==="district"?"districtId":"subDistrictId";i!==""?r.where=`${a} = '${i}'`:r.where="1=1";const t=await this.subDistrictPointLayer.queryFeatures(r),n=new Map;t.features.forEach(u=>{var p;const{subDistrictId:o,color:c,id:h,districtName:y,subDistrictName:L,signalCount:b}=u.attributes;n.has(o)||n.set(o,{color:c,signalIds:[],districtName:y,subDistrictName:L,signalCount:b}),(p=n.get(o))==null||p.signalIds.push(h)});const d=[],f=[];for(const u of n){let o=0;const c=u[0];d.push({value:c,symbol:{type:"simple-line",color:u[1].color.split(",").map(Number),width:2,style:"solid"}});const{districtName:h,subDistrictName:y,signalIds:L,signalCount:b}=u[1];this.roadConnections.filter(l=>l.subDistrictId===c).forEach(l=>{const I=new v({geometry:{type:"polyline",paths:l.coordinates},attributes:{ObjectID:o++,id:l.id,districtId:l.districtId,subDistrictId:c,subDistrictName:y,districtName:h,signalCount:b,color:u[1].color}});f.push(I)})}this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",color:[180,180,180,.5],width:2,style:"solid"},defaultLabel:"其他子区",uniqueValueInfos:d,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentLineRenderer=this.subDistrictLineLayer.renderer.clone(),await this.subDistrictLineLayer.applyEdits({addFeatures:f})}async clearSubDistricts(){var i;const e=await this.subDistrictPointLayer.queryFeatures();e.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:e.features}),this.subDistrictPointLayer.definitionExpression="1=1";const s=await this.subDistrictLineLayer.queryFeatures();s.features.length>0&&await this.subDistrictLineLayer.applyEdits({deleteFeatures:s.features}),this.subDistrictLineLayer.definitionExpression="1=1",this.roadConnections=[],(i=this.clickHandler)==null||i.remove()}setVisible(e){this.showRoads({type:"district",id:""}),this.subDistrictPointLayer.visible=e,this.subDistrictLineLayer.visible=e}async locateSubDistrict(e){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${e}'`,s.returnGeometry=!0;const i=await this.subDistrictPointLayer.queryFeatures(s);return i.features.length>0?(await D.default.viewGoto(this.view,i.features,!1),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(e){let s="";const i=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${e.id}'`;const r=await this.subDistrictPointLayer.queryFeatures(),a=r.features.length;return a>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${e.id}'`,s=r.features[0].attributes.districtId,await D.default.viewGoto(this.view,r.features,e.needZoom!==!1)):this.subDistrictPointLayer.definitionExpression=i,{count:a,parentId:s}}filter(e){const{type:s,id:i}=e,r=`${s==="district"?"districtId":"subDistrictId"} = '${i}'`;this.subDistrictPointLayer.definitionExpression=r,this.subDistrictLineLayer.definitionExpression=r}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(e){var r;const i=(r=(await this.view.hitTest(e,{include:[this.subDistrictPointLayer,this.subDistrictLineLayer]})).results)==null?void 0:r.filter(a=>a.type==="graphic");if(i.length===0)console.time("resetRenderer"),this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const a=i[0].graphic,t=a.attributes.color.split(",").map(Number);this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",style:"circle",color:[0,0,0,0],size:"8px",outline:{color:[180,180,180,.5],width:4}},defaultLabel:"其他子区",uniqueValueInfos:[{value:a.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[...t,.8],size:"8px",outline:{color:t,width:4}}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.subDistrictLineLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-line",style:"solid",color:[180,180,180,.5],width:"8px"},defaultLabel:"其他子区",uniqueValueInfos:[{value:a.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:a.attributes.color.split(",").map(Number),width:"8px"}}],visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:6,value:2500},{size:5,value:5e3},{size:4,value:18055.954822000003},{size:3,value:144447.638572},{size:2,value:1155581108577e-6}]}]}}}}exports.default=g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.256",
3
+ "version": "1.0.258",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [