gisviewer-vue3-arcgis 1.0.250 → 1.0.252

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.
Files changed (33) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +4 -1
  2. package/es/src/gis-map/gis-map.vue.mjs +155 -153
  3. package/es/src/gis-map/index.d.ts +2 -0
  4. package/es/src/gis-map/utils/dbscan-cluster/index.d.ts +51 -0
  5. package/es/src/gis-map/utils/dbscan-cluster/index.mjs +256 -0
  6. package/es/src/gis-map/utils/green-wave-band-controller/index.d.ts +1 -0
  7. package/es/src/gis-map/utils/green-wave-band-controller/index.mjs +143 -127
  8. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +87 -86
  9. package/es/src/gis-map/utils/overlay.d.ts +3 -8
  10. package/es/src/gis-map/utils/overlay.mjs +48 -52
  11. package/es/src/gis-map/utils/signal-control-area/district-renderer.d.ts +2 -2
  12. package/es/src/gis-map/utils/signal-control-area/district-renderer.mjs +6 -2
  13. package/es/src/gis-map/utils/signal-control-area/show-area.mjs +15 -15
  14. package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +1 -1
  15. package/es/src/gis-map/utils/signal-control-area/sub-district-renderer.mjs +6 -2
  16. package/es/src/types/index.d.ts +33 -3
  17. package/lib/src/gis-map/gis-map.vue.d.ts +4 -1
  18. package/lib/src/gis-map/gis-map.vue.js +1 -1
  19. package/lib/src/gis-map/index.d.ts +2 -0
  20. package/lib/src/gis-map/utils/dbscan-cluster/index.d.ts +51 -0
  21. package/lib/src/gis-map/utils/dbscan-cluster/index.js +1 -0
  22. package/lib/src/gis-map/utils/green-wave-band-controller/index.d.ts +1 -0
  23. package/lib/src/gis-map/utils/green-wave-band-controller/index.js +1 -1
  24. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  25. package/lib/src/gis-map/utils/overlay.d.ts +3 -8
  26. package/lib/src/gis-map/utils/overlay.js +1 -1
  27. package/lib/src/gis-map/utils/signal-control-area/district-renderer.d.ts +2 -2
  28. package/lib/src/gis-map/utils/signal-control-area/district-renderer.js +1 -1
  29. package/lib/src/gis-map/utils/signal-control-area/show-area.js +1 -1
  30. package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.d.ts +1 -1
  31. package/lib/src/gis-map/utils/signal-control-area/sub-district-renderer.js +1 -1
  32. package/lib/src/types/index.d.ts +33 -3
  33. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("@arcgis/core/Graphic"),c=require("@arcgis/core/layers/FeatureLayer"),L=require("@turf/helpers"),d=require("@turf/turf"),l=require("../common-utils.js"),u=require("./layer-symbol.js");function g(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const n=g(L);class D{constructor(t){this.style="",this.view=t,this.districtControllerDashLayer=new c(u.districtDashLineLayerOptions),this.districtControllerDashLayer.spatialReference=t.spatialReference,this.districtControllerSolidLayer=new c(u.districtSolidLineLayerOptions),this.districtControllerSolidLayer.spatialReference=t.spatialReference,this.districtControllerSolidLayer.popupEnabled=!0,this.view.map.addMany([this.districtControllerDashLayer,this.districtControllerSolidLayer])}async showDistricts(t){await this.clearDistricts();const e=[];for(let i=0;i<t.length;i++){const r=t[i],s=r.getAllSignalCoordinates();let a=null;if(s.length>=2)if(s.length===2)a=n.lineString(s);else{const f=n.featureCollection(s.map(p=>n.point(p)));a=d.convex(f),a||(a=n.lineString(s))}else if(s.length===1)a=n.point(s[0]);else continue;const h=d.buffer(a.geometry,200,{units:"meters"}),y=new C({geometry:{type:"polyline",paths:h.geometry.coordinates},attributes:{ObjectID:i,id:r.id,name:r.name,subDistrictCount:r.subDistrictCount,signalCount:r.signalCount,parentId:r.parentId,parentName:r.parentName,selected:this.style,type:"district"}});e.push(y)}await this.districtControllerDashLayer.applyEdits({addFeatures:e}),await this.districtControllerSolidLayer.applyEdits({addFeatures:e}),await l.default.viewGoto(this.view,e)}async clearDistricts(){let t=await this.districtControllerDashLayer.queryFeatures();await this.districtControllerDashLayer.applyEdits({deleteFeatures:t.features}),this.districtControllerDashLayer.definitionExpression="1=1",t=await this.districtControllerSolidLayer.queryFeatures(),await this.districtControllerSolidLayer.applyEdits({deleteFeatures:t.features}),this.districtControllerSolidLayer.definitionExpression="1=1"}setVisible(t){this.districtControllerDashLayer.visible=t,this.districtControllerSolidLayer.visible=t}async locateDistrict(t){const e=this.districtControllerDashLayer.createQuery();e.where=`id = '${t}'`,e.returnGeometry=!0,e.outFields=["*"];const i=await this.districtControllerDashLayer.queryFeatures(e);return i.features.length>0?(await l.default.viewGoto(this.view,i.features),{status:0,message:"ok"}):{status:1,message:"未找到区控"}}async highlightDistrict(t){const e=this.districtControllerDashLayer.definitionExpression;this.districtControllerDashLayer.definitionExpression=`id = '${t}'`;const i=await this.districtControllerDashLayer.queryFeatures(),r=i.features.length;return r>0?(this.districtControllerSolidLayer.definitionExpression=`id = '${t}'`,await l.default.viewGoto(this.view,i.features)):this.districtControllerDashLayer.definitionExpression=e,r}filter(t){const e=`id = '${t}'`;this.districtControllerDashLayer.definitionExpression=e,this.districtControllerSolidLayer.definitionExpression=e}resetFilter(){this.districtControllerDashLayer.definitionExpression="1=1",this.districtControllerSolidLayer.definitionExpression="1=1"}}exports.default=D;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("@arcgis/core/Graphic"),c=require("@arcgis/core/layers/FeatureLayer"),L=require("@turf/helpers"),d=require("@turf/turf"),l=require("../common-utils.js"),u=require("./layer-symbol.js");function g(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const n=g(L);class D{constructor(t){this.style="",this.view=t,this.districtControllerDashLayer=new c(u.districtDashLineLayerOptions),this.districtControllerDashLayer.spatialReference=t.spatialReference,this.districtControllerSolidLayer=new c(u.districtSolidLineLayerOptions),this.districtControllerSolidLayer.spatialReference=t.spatialReference,this.districtControllerSolidLayer.popupEnabled=!0,this.view.map.addMany([this.districtControllerDashLayer,this.districtControllerSolidLayer])}async showDistricts(t){await this.clearDistricts();const e=[];for(let i=0;i<t.length;i++){const r=t[i],s=r.getAllSignalCoordinates();let a=null;if(s.length>=2)if(s.length===2)a=n.lineString(s);else{const f=n.featureCollection(s.map(p=>n.point(p)));a=d.convex(f),a||(a=n.lineString(s))}else if(s.length===1)a=n.point(s[0]);else continue;const h=d.buffer(a.geometry,200,{units:"meters"}),y=new C({geometry:{type:"polyline",paths:h.geometry.coordinates},attributes:{ObjectID:i,id:r.id,name:r.name,subDistrictCount:r.subDistrictCount,signalCount:r.signalCount,parentId:r.parentId,parentName:r.parentName,selected:this.style,type:"district"}});e.push(y)}await this.districtControllerDashLayer.applyEdits({addFeatures:e}),await this.districtControllerSolidLayer.applyEdits({addFeatures:e}),await l.default.viewGoto(this.view,e)}async clearDistricts(){let t=await this.districtControllerDashLayer.queryFeatures();await this.districtControllerDashLayer.applyEdits({deleteFeatures:t.features}),this.districtControllerDashLayer.definitionExpression="1=1",t=await this.districtControllerSolidLayer.queryFeatures(),await this.districtControllerSolidLayer.applyEdits({deleteFeatures:t.features}),this.districtControllerSolidLayer.definitionExpression="1=1"}setVisible(t){this.districtControllerDashLayer.visible=t,this.districtControllerSolidLayer.visible=t}async locateDistrict(t){const e=this.districtControllerDashLayer.createQuery();e.where=`id = '${t}'`,e.returnGeometry=!0,e.outFields=["*"];const i=await this.districtControllerDashLayer.queryFeatures(e);return i.features.length>0?(await l.default.viewGoto(this.view,i.features),{status:0,message:"ok"}):{status:1,message:"未找到区控"}}async highlightDistrict(t){const e=this.districtControllerDashLayer.definitionExpression;this.districtControllerDashLayer.definitionExpression=`id = '${t.id}'`;const i=await this.districtControllerDashLayer.queryFeatures(),r=i.features.length;return r>0?(this.districtControllerSolidLayer.definitionExpression=`id = '${t.id}'`,await l.default.viewGoto(this.view,i.features,t.needZoom!==!1)):this.districtControllerDashLayer.definitionExpression=e,r}filter(t){const e=`id = '${t}'`;this.districtControllerDashLayer.definitionExpression=e,this.districtControllerSolidLayer.definitionExpression=e}resetFilter(){this.districtControllerDashLayer.definitionExpression="1=1",this.districtControllerSolidLayer.definitionExpression="1=1"}}exports.default=D;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils"),g=require("@arcgis/core/Graphic"),w=require("@arcgis/core/layers/GraphicsLayer"),R=require("../../stores/index.js"),D=require("./district-controller.js"),m=require("./district-renderer.js"),S=require("./signal-renderer.js"),C=require("./sub-district-renderer.js");class p{constructor(e){this.detachmentLayerLoaded=!1,this.view=e;const t=R.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.detachmentLayer=new w,this.view.map.add(this.detachmentLayer),this.districtRenderer=new m.default(e),this.subDistrictRenderer=new C.default(e),this.signalRenderer=new S.default(e)}async showSignalControlArea(e){this.detachmentLayerLoaded||await this.loadDetachmentLayer(),await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const t=[],s=[];for(const n of e.areaList){const i=new D.default(n,e.style||"");t.push(i),s.push(...i.subDistricts)}return this.districtRenderer.style=e.style||"",await this.districtRenderer.showDistricts(t),await this.subDistrictRenderer.showSubDistricts(s),await this.signalRenderer.showSignals(t),{status:0,message:"ok"}}async clearSignalControlArea(){return await this.districtRenderer.clearDistricts(),await this.subDistrictRenderer.clearSubDistricts(),await this.signalRenderer.clearSignals(),{status:0,message:"ok"}}setLayerVisibility(e){switch(e.visible===!1&&this.view.closePopup(),e.id){case"district":this.districtRenderer.setVisible(e.visible);break;case"subDistrict":this.subDistrictRenderer.setVisible(e.visible);break;case"signal":this.signalRenderer.setPointVisible(e.visible);break;case"signalCluster":this.signalRenderer.setClusterVisible(e.visible);break;case"shanghai_district":this.detachmentLayer.visible=e.visible;break}return{status:0,message:"ok"}}async locateSignalControlArea(e){switch(e.type){case"district":return await this.districtRenderer.locateDistrict(e.id);case"subDistrict":return await this.subDistrictRenderer.locateSubDistrict(e.id);case"signal":return await this.signalRenderer.locateSignal(e.id);default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(e){switch(this.view.closePopup(),e.type){case"district":return await this.districtRenderer.highlightDistrict(e.id)?(this.subDistrictRenderer.filter(e),this.signalRenderer.filter(e),await this.subDistrictRenderer.showRoads(e),{status:0,message:"ok"}):{status:1,message:"未找到区控"};case"subDistrict":{const{count:t,parentId:s}=await this.subDistrictRenderer.highlightSubDistrict(e.id);return t>0?(this.districtRenderer.filter(s),this.signalRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:t,subDistrictId:s,count:n}=await this.signalRenderer.highlightSignal(e.id);return n>0?(this.districtRenderer.filter(t),this.subDistrictRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async resetHighlight(){return this.districtRenderer.resetFilter(),this.subDistrictRenderer.resetFilter(),this.signalRenderer.resetFilter(),{status:0,message:"ok"}}async loadDetachmentLayer(){const e=this.mapConfig.baseLayers;if(!e)return;const t=e.find(s=>s.options.id==="shanghai_district");if(t)try{const n=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),i=[],{renderer:r,labelingInfo:u}=t.options;n.features.forEach(o=>{const l=o.attributes.ZD_NAME;if(l!=="高架支队"){let c=new f.Polygon({rings:o.geometry.rings});c=y.webMercatorToGeographic(c);const a=new g({geometry:c,attributes:o.attributes});if(r){if(r.type==="simple")a.symbol=r.symbol;else if(r.type==="unique-value"){const d=a.getAttribute("OBJECTID"),h=r.uniqueValueInfos.find(b=>b.value==d);a.symbol=h?h.symbol:r.defaultSymbol}}else a.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(i.push(a),u&&l!=="边防港航支队"&&l!=="机场支队"){const d=new g({geometry:c.centroid,symbol:{...u.symbol,text:l}});i.push(d)}}}),this.detachmentLayer.addMany(i),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils"),g=require("@arcgis/core/Graphic"),w=require("@arcgis/core/layers/GraphicsLayer"),R=require("../../stores/index.js"),D=require("./district-controller.js"),m=require("./district-renderer.js"),S=require("./signal-renderer.js"),C=require("./sub-district-renderer.js");class p{constructor(e){this.detachmentLayerLoaded=!1,this.view=e;const t=R.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.detachmentLayer=new w,this.view.map.add(this.detachmentLayer),this.districtRenderer=new m.default(e),this.subDistrictRenderer=new C.default(e),this.signalRenderer=new S.default(e)}async showSignalControlArea(e){this.detachmentLayerLoaded||await this.loadDetachmentLayer(),await this.clearSignalControlArea(),this.districtRenderer.setVisible(!1),this.subDistrictRenderer.setVisible(!1),this.signalRenderer.setClusterVisible(!1),this.signalRenderer.setPointVisible(!1);const t=[],s=[];for(const n of e.areaList){const i=new D.default(n,e.style||"");t.push(i),s.push(...i.subDistricts)}return this.districtRenderer.style=e.style||"",await this.districtRenderer.showDistricts(t),await this.subDistrictRenderer.showSubDistricts(s),await this.signalRenderer.showSignals(t),{status:0,message:"ok"}}async clearSignalControlArea(){return await this.districtRenderer.clearDistricts(),await this.subDistrictRenderer.clearSubDistricts(),await this.signalRenderer.clearSignals(),{status:0,message:"ok"}}setLayerVisibility(e){switch(e.visible===!1&&this.view.closePopup(),e.id){case"district":this.districtRenderer.setVisible(e.visible);break;case"subDistrict":this.subDistrictRenderer.setVisible(e.visible);break;case"signal":this.signalRenderer.setPointVisible(e.visible);break;case"signalCluster":this.signalRenderer.setClusterVisible(e.visible);break;case"shanghai_district":this.detachmentLayer.visible=e.visible;break}return{status:0,message:"ok"}}async locateSignalControlArea(e){switch(e.type){case"district":return await this.districtRenderer.locateDistrict(e.id);case"subDistrict":return await this.subDistrictRenderer.locateSubDistrict(e.id);case"signal":return await this.signalRenderer.locateSignal(e.id);default:return{status:1,message:"未知类型"}}}async highlightSignalControlArea(e){switch(this.view.closePopup(),e.type){case"district":return await this.districtRenderer.highlightDistrict(e)?(this.subDistrictRenderer.filter(e),this.signalRenderer.filter(e),await this.subDistrictRenderer.showRoads(e),{status:0,message:"ok"}):{status:1,message:"未找到区控"};case"subDistrict":{const{count:t,parentId:s}=await this.subDistrictRenderer.highlightSubDistrict(e);return t>0?(this.districtRenderer.filter(s),this.signalRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}case"signal":{const{districtId:t,subDistrictId:s,count:n}=await this.signalRenderer.highlightSignal(e.id);return n>0?(this.districtRenderer.filter(t),this.subDistrictRenderer.filter(e),{status:0,message:"ok"}):{status:1,message:"未找到信号机"}}default:return{status:1,message:"未知类型"}}}async resetHighlight(){return this.districtRenderer.resetFilter(),this.subDistrictRenderer.resetFilter(),this.signalRenderer.resetFilter(),{status:0,message:"ok"}}async loadDetachmentLayer(){const e=this.mapConfig.baseLayers;if(!e)return;const t=e.find(s=>s.options.id==="shanghai_district");if(t)try{const n=await(await fetch("/GisViewerAssets/ShangHai/Layers/district.json")).json(),i=[],{renderer:r,labelingInfo:u}=t.options;n.features.forEach(o=>{const l=o.attributes.ZD_NAME;if(l!=="高架支队"){let c=new f.Polygon({rings:o.geometry.rings});c=y.webMercatorToGeographic(c);const a=new g({geometry:c,attributes:o.attributes});if(r){if(r.type==="simple")a.symbol=r.symbol;else if(r.type==="unique-value"){const d=a.getAttribute("OBJECTID"),h=r.uniqueValueInfos.find(b=>b.value==d);a.symbol=h?h.symbol:r.defaultSymbol}}else a.symbol={type:"simple-fill",color:[227,237,255,.4],outline:{color:[255,195,153],width:2}};if(i.push(a),u&&l!=="边防港航支队"&&l!=="机场支队"){const d=new g({geometry:c.centroid,symbol:{...u.symbol,text:l}});i.push(d)}}}),this.detachmentLayer.addMany(i),this.detachmentLayerLoaded=!0}catch(s){console.error("加载支队图层失败:",s);return}}}exports.default=p;
@@ -25,7 +25,7 @@ export default class SubDistrictRenderer {
25
25
  * @param id 子区ID
26
26
  * @return 返回高亮子区的数量以及区控id
27
27
  */
28
- highlightSubDistrict(id: string): Promise<{
28
+ highlightSubDistrict(params: IFindSignalControlAreaParams): Promise<{
29
29
  count: number;
30
30
  parentId: string;
31
31
  }>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/Graphic"),v=require("@arcgis/core/layers/FeatureLayer"),m=require("../common-utils.js"),w=require("./layer-symbol.js");class g{constructor(i){this.roadConnections=[],this.view=i,this.subDistrictPointLayer=new v(w.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=i.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new v(w.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=i.spatialReference,this.subDistrictLineLayer.popupEnabled=!0,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(i){await this.clearSubDistricts(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const t=[],r=[];i.forEach(e=>{e.roadConnections.length>0&&this.roadConnections.push(...e.roadConnections),r.push({value:e.id,label:e.name,symbol:{type:"simple-marker",style:"circle",color:[...e.areaColor,.8],size:"8px",outline:{color:[...e.areaColor],width:4}}}),e.signals.forEach(a=>{const u=new f({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:s++,id:a.nodeId,name:a.name,subDistrictId:e.id,subDistrictName:e.name,districtId:e.parentId,districtName:e.parentName,signalCount:e.signalCount,color:e.areaColor.join(","),type:"subDistrict"}});t.push(u)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:[180,180,180,.5],size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:t})}async showRoads(i){const{type:s,id:t}=i,r=this.subDistrictPointLayer.createQuery(),e=s==="district"?"districtId":"subDistrictId";r.where=`${e} = '${t}'`;const a=await this.subDistrictPointLayer.queryFeatures(r),u=new Map;a.features.forEach(n=>{var y;const{subDistrictId:o,color:c,id:d,districtName:b,subDistrictName:L,signalCount:p}=n.attributes;u.has(o)||u.set(o,{color:c,signalIds:[],districtName:b,subDistrictName:L,signalCount:p}),(y=u.get(o))==null||y.signalIds.push(d)});const h=[],D=[];for(const n of u){let o=0;const c=n[0];h.push({value:c,symbol:{type:"simple-line",color:n[1].color.split(",").map(Number),width:2,style:"solid"}});const{districtName:d,subDistrictName:b,signalIds:L,signalCount:p}=n[1];this.roadConnections.filter(l=>l.subDistrictId===c).forEach(l=>{const I=new f({geometry:{type:"polyline",paths:l.coordinates},attributes:{ObjectID:o++,id:l.id,districtId:l.districtId,subDistrictId:c,subDistrictName:b,districtName:d,signalCount:p,color:n[1].color}});D.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:h,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:D})}async clearSubDistricts(){var t;const i=await this.subDistrictPointLayer.queryFeatures();i.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:i.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",(t=this.clickHandler)==null||t.remove()}setVisible(i){this.subDistrictPointLayer.visible=i,this.subDistrictLineLayer.visible=i}async locateSubDistrict(i){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${i}'`,s.returnGeometry=!0;const t=await this.subDistrictPointLayer.queryFeatures(s);return t.features.length>0?(await m.default.viewGoto(this.view,t.features,!1),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(i){let s="";const t=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${i}'`;const r=await this.subDistrictPointLayer.queryFeatures(),e=r.features.length;return e>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${i}'`,s=r.features[0].attributes.districtId,await m.default.viewGoto(this.view,r.features,!1)):this.subDistrictPointLayer.definitionExpression=t,{count:e,parentId:s}}filter(i){const{type:s,id:t}=i,r=`${s==="district"?"districtId":"subDistrictId"} = '${t}'`;this.subDistrictPointLayer.definitionExpression=r,this.subDistrictLineLayer.definitionExpression=r}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(i){var r;const t=(r=(await this.view.hitTest(i,{include:[this.subDistrictPointLayer,this.subDistrictLineLayer]})).results)==null?void 0:r.filter(e=>e.type==="graphic");if(t.length===0)console.time("resetRenderer"),this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const e=t[0].graphic,a=e.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:e.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[...a,.8],size:"8px",outline:{color:a,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:e.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:e.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 f=require("@arcgis/core/Graphic"),v=require("@arcgis/core/layers/FeatureLayer"),m=require("../common-utils.js"),w=require("./layer-symbol.js");class g{constructor(i){this.roadConnections=[],this.view=i,this.subDistrictPointLayer=new v(w.subDistrictPointLayerOptions),this.subDistrictPointLayer.spatialReference=i.spatialReference,this.subDistrictPointLayer.popupEnabled=!0,this.subDistrictLineLayer=new v(w.subDistrictLineLayerOptions),this.subDistrictLineLayer.spatialReference=i.spatialReference,this.subDistrictLineLayer.popupEnabled=!0,this.view.map.addMany([this.subDistrictLineLayer,this.subDistrictPointLayer])}async showSubDistricts(i){await this.clearSubDistricts(),this.clickHandler=this.view.on("click",this.viewHitTest.bind(this));let s=0;const t=[],r=[];i.forEach(e=>{e.roadConnections.length>0&&this.roadConnections.push(...e.roadConnections),r.push({value:e.id,label:e.name,symbol:{type:"simple-marker",style:"circle",color:[...e.areaColor,.8],size:"8px",outline:{color:[...e.areaColor],width:4}}}),e.signals.forEach(a=>{const u=new f({geometry:{type:"point",longitude:a.longitude,latitude:a.latitude},attributes:{ObjectID:s++,id:a.nodeId,name:a.name,subDistrictId:e.id,subDistrictName:e.name,districtId:e.parentId,districtName:e.parentName,signalCount:e.signalCount,color:e.areaColor.join(","),type:"subDistrict"}});t.push(u)})}),this.subDistrictPointLayer.renderer={type:"unique-value",field:"subDistrictId",defaultSymbol:{type:"simple-marker",color:[180,180,180,.5],size:"8px",outline:{color:"white",width:1}},defaultLabel:"其他子区",uniqueValueInfos:r,visualVariables:[{type:"size",valueExpression:"$view.scale",stops:[{size:24,value:2500},{size:20,value:5e3},{size:8,value:18055.954822000003},{size:4,value:144447.638572},{size:2,value:1155581108577e-6}]}]},this.currentPointRenderer=this.subDistrictPointLayer.renderer.clone(),await this.subDistrictPointLayer.applyEdits({addFeatures:t})}async showRoads(i){const{type:s,id:t}=i,r=this.subDistrictPointLayer.createQuery(),e=s==="district"?"districtId":"subDistrictId";r.where=`${e} = '${t}'`;const a=await this.subDistrictPointLayer.queryFeatures(r),u=new Map;a.features.forEach(n=>{var p;const{subDistrictId:o,color:c,id:d,districtName:b,subDistrictName:L,signalCount:y}=n.attributes;u.has(o)||u.set(o,{color:c,signalIds:[],districtName:b,subDistrictName:L,signalCount:y}),(p=u.get(o))==null||p.signalIds.push(d)});const h=[],D=[];for(const n of u){let o=0;const c=n[0];h.push({value:c,symbol:{type:"simple-line",color:n[1].color.split(",").map(Number),width:2,style:"solid"}});const{districtName:d,subDistrictName:b,signalIds:L,signalCount:y}=n[1];this.roadConnections.filter(l=>l.subDistrictId===c).forEach(l=>{const I=new f({geometry:{type:"polyline",paths:l.coordinates},attributes:{ObjectID:o++,id:l.id,districtId:l.districtId,subDistrictId:c,subDistrictName:b,districtName:d,signalCount:y,color:n[1].color}});D.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:h,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:D})}async clearSubDistricts(){var t;const i=await this.subDistrictPointLayer.queryFeatures();i.features.length>0&&await this.subDistrictPointLayer.applyEdits({deleteFeatures:i.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",(t=this.clickHandler)==null||t.remove()}setVisible(i){this.subDistrictPointLayer.visible=i,this.subDistrictLineLayer.visible=i}async locateSubDistrict(i){const s=this.subDistrictPointLayer.createQuery();s.where=`subDistrictId = '${i}'`,s.returnGeometry=!0;const t=await this.subDistrictPointLayer.queryFeatures(s);return t.features.length>0?(await m.default.viewGoto(this.view,t.features,!1),{status:0,message:"ok"}):{status:1,message:"未找到子区"}}async highlightSubDistrict(i){let s="";const t=this.subDistrictPointLayer.definitionExpression;this.subDistrictPointLayer.definitionExpression=`subDistrictId = '${i.id}'`;const r=await this.subDistrictPointLayer.queryFeatures(),e=r.features.length;return e>0?(this.subDistrictLineLayer.definitionExpression=`subDistrictId = '${i.id}'`,s=r.features[0].attributes.districtId,await m.default.viewGoto(this.view,r.features,i.needZoom!==!1)):this.subDistrictPointLayer.definitionExpression=t,{count:e,parentId:s}}filter(i){const{type:s,id:t}=i,r=`${s==="district"?"districtId":"subDistrictId"} = '${t}'`;this.subDistrictPointLayer.definitionExpression=r,this.subDistrictLineLayer.definitionExpression=r}resetFilter(){this.subDistrictPointLayer.definitionExpression="1=1",this.subDistrictLineLayer.definitionExpression="1=1"}async viewHitTest(i){var r;const t=(r=(await this.view.hitTest(i,{include:[this.subDistrictPointLayer,this.subDistrictLineLayer]})).results)==null?void 0:r.filter(e=>e.type==="graphic");if(t.length===0)console.time("resetRenderer"),this.subDistrictPointLayer.renderer=this.currentPointRenderer,this.subDistrictLineLayer.renderer=this.currentLineRenderer;else{const e=t[0].graphic,a=e.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:e.attributes.subDistrictId,symbol:{type:"simple-marker",style:"circle",color:[...a,.8],size:"8px",outline:{color:a,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:e.attributes.subDistrictId,symbol:{type:"simple-line",style:"solid",color:e.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;
@@ -104,6 +104,10 @@ export interface IPointSymbol {
104
104
  verticalOrigin?: string;
105
105
  color?: string;
106
106
  size?: number;
107
+ outline?: {
108
+ color?: string | number[];
109
+ width?: number;
110
+ };
107
111
  }
108
112
  export interface ILineSymbol {
109
113
  type: string;
@@ -139,7 +143,30 @@ export interface IOverlayParam {
139
143
  defaultSymbol?: IPointSymbol | ILineSymbol | IPolygonSymbol;
140
144
  defaultVisible?: boolean;
141
145
  overlays: Array<IOverlay>;
142
- visible?: boolean;
146
+ }
147
+ export interface IClusterPointParams {
148
+ type?: string;
149
+ clusterSymbol?: IPointSymbol;
150
+ pointSymbol?: IPointSymbol;
151
+ points: IClusterLocation[];
152
+ }
153
+ export interface IClusterLocation {
154
+ id: string;
155
+ x: number;
156
+ y: number;
157
+ properties?: any;
158
+ visited?: boolean;
159
+ clusterId?: number;
160
+ symbol?: IPointSymbol;
161
+ }
162
+ export interface ICluster {
163
+ id: number;
164
+ items: IClusterLocation[];
165
+ count: number;
166
+ center: {
167
+ x: number;
168
+ y: number;
169
+ } | null;
143
170
  }
144
171
  export interface ISetMapCameraParams {
145
172
  name: string;
@@ -285,7 +312,7 @@ export interface IDistrictRoad {
285
312
  export interface IFindSignalControlAreaParams {
286
313
  type: string;
287
314
  id: string;
288
- scale?: number;
315
+ needZoom?: boolean;
289
316
  }
290
317
  export interface INode {
291
318
  id: string;
@@ -307,7 +334,10 @@ export interface IEditSignalControlAreaParams {
307
334
  export interface IShowGreenWaveBandParams {
308
335
  bandId: string;
309
336
  coordinates: number[][];
310
- nodeList: INode[];
337
+ nodeList?: INode[];
338
+ lineColor?: string | number[];
339
+ lineWidth?: number;
340
+ arrowColor?: string | number[];
311
341
  }
312
342
  export interface IRoadLine {
313
343
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.250",
3
+ "version": "1.0.252",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [