gisviewer-vue3-arcgis 1.0.222 → 1.0.223
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/gis-map/gis-map.vue.d.ts +4 -0
- package/es/src/gis-map/gis-map.vue.mjs +106 -100
- package/es/src/gis-map/index.d.ts +4 -0
- package/es/src/gis-map/style/index.css +1 -1
- package/es/src/gis-map/utils/holo-flow/index.d.ts +3 -1
- package/es/src/gis-map/utils/holo-flow/index.mjs +33 -16
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +2 -0
- package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +43 -25
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +17 -3
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +189 -132
- package/lib/src/gis-map/gis-map.vue.d.ts +4 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -1
- package/lib/src/gis-map/index.d.ts +4 -0
- package/lib/src/gis-map/style/index.css +1 -1
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +3 -1
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +2 -0
- package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +17 -3
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@arcgis/core/core/reactiveUtils"),f=require("@arcgis/core/geometry"),y=require("@arcgis/core/geometry/support/webMercatorUtils.js"),S=require("@arcgis/core/layers/GraphicsLayer"),L=require("./signal-holo-flow.js");function g(h){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>h[t]})}}return e.default=h,Object.freeze(e)}const m=g(P),d=g(y);class b extends L.default{constructor(e,t){var a,i;super(e),this.stopLineLayer=new S,this.watchHandle=null,this.trajectoryDelayTime=2,this.stopLineMap=new Map,this.lampGroupMap=new Map,this.countdownPanelProps=t,this.view.map.add(this.stopLineLayer),this.trajectoryDelayTime=((i=(a=this.mapConfig.holoFlow)==null?void 0:a.signal)==null?void 0:i.delay)||2}async initializeLayer(){var i,o;if(this.stopLineMap.size>0)return;console.time("初始化停止线图层");let e=(o=(i=this.mapConfig.holoFlow)==null?void 0:i.signal)==null?void 0:o.stopLineLayer;if(!e)return;e=this.mapConfig.assetsRoot+"/"+e;const a=await(await fetch(e)).json();for(const s of a.features){const{roadId:n}=s.properties;let{destinationPoint:r}=s.properties;const{coordinates:l}=s.geometry;if(r){if(typeof r=="string")try{r=JSON.parse(r)}catch(c){console.error("解析面板基准点失败",c);continue}}else{const c=l[0],u=l[l.length-1],p=(c[0]+u[0])/2,w=(c[1]+u[1])/2;r=[p,w]}this.stopLineMap.set(n,{coord:l,panelPoint:r})}console.timeEnd("初始化停止线图层")}initializeLampGroup(e){const{sigId:t,lampGroupList:a}=e,i=[];a.forEach(o=>{const{lampGroupNo:s,lampGroupType:n,crossFlowList:r,pedList:l}=o;r.length>0&&r.forEach(c=>{const u=c.upSectionId;let p="s";switch(c.turn){case 1:p="s";break;case 2:p="l";break;case 4:p="r";break;case 8:p="u";break}n===81&&(p="bl"),i.push({lampGroupId:s,roadId:u,dir:p})}),l.length>0}),this.lampGroupMap.set(t,i),console.log(i)}handleUniSignalData(e){this.watchHandle||(this.watchHandle=m.watch(()=>this.view.extent,()=>this.updatePanelPosition()));const{sigId:t}=e.data.basicInfo,a=this.lampGroupMap.get(t);if(!a)return{status:-1,message:"灯组未初始化"};const{curSigColorInfo:i}=e.data,o=new Map;return i.forEach(s=>{const n=String(s.lamgroupId),{color:r,leftTime:l}=s,c=a.find(u=>u.lampGroupId===n);if(c){const{roadId:u,dir:p}=c;o.set(u,{...o.get(u)||{},[`${p}Number`]:l,[`${p}Color`]:r===1?"red":r===2?"yellow":"green"})}}),this.updateLampGroupPanelStatus(t,o),{status:0,message:"ok"}}getPanelScale(){const e=this.view.scale;let t=1;return e<1e3?t=1:e<2e3?t=.8:e<4e3?t=.4:t=0,t}updatePanelPosition(){const e=this.getPanelScale();for(const t of this.countdownPanelProps){e!==this.currentPanelScale&&(t.scale=e);const{mapPoint:a}=t;let i=new f.Point({x:a[0],y:a[1]});this.view.spatialReference.isWebMercator&&(i=d.geographicToWebMercator(i));const o=this.view.toScreen(i);if(t.position.left=o.x,t.position.top=o.y,this.view.type==="3d"){const s=this.getPanelRotation(t.stopLine);t.rotation=s}}this.currentPanelScale=e}doHoloSignalData(e){const t=e.crossId,a=e.phaseCountDownList,i=new Map;for(const o of a){let s="";for(let c of o.roadIdList)if(c.startsWith("-")&&(c=c.slice(1)),this.stopLineMap.has(c)){s=c;break}if(!s){console.log(`没有找到对应的进口道${t}--${s}`);continue}let n=i.get(s);if(n||(n={},i.set(s,n)),!o.direction)continue;const r=o.direction.toLowerCase(),l=o.color===1?"red":o.color===2?"yellow":"green";r==="u"?(n.uNumber=o.leftTime,n.uColor=l):r==="l"?(n.lNumber=o.leftTime,n.lColor=l):r==="s"?(n.sNumber=o.leftTime,n.sColor=l):r==="r"&&(n.rNumber=o.leftTime,n.rColor=l)}this.updateLampGroupPanelStatus(t,i)}updateLampGroupPanelStatus(e,t){t.forEach((a,i)=>{const o=this.stopLineMap.get(i);if(!o)return;const s=this.countdownPanelProps.find(n=>n.roadId===i);if(s)s.lampStatus=a;else{let n=new f.Point({x:o.panelPoint[0],y:o.panelPoint[1]});this.view.spatialReference.isWebMercator&&(n=d.geographicToWebMercator(n));const r=this.view.toScreen(n),l=this.getPanelRotation(o.coord);this.countdownPanelProps.push({displayMode:"complex",crossId:e,roadId:i,mapPoint:o.panelPoint,stopLine:o.coord,position:{left:r.x,top:r.y},rotation:l,scale:this.getPanelScale(),lampStatus:a})}})}async handleHoloSignalData(e){this.watchHandle||(this.watchHandle=m.watch(()=>this.view.extent,()=>this.updatePanelPosition())),this.trajectoryDelayTime===0?this.doHoloSignalData(e):setTimeout(()=>this.doHoloSignalData(e),this.trajectoryDelayTime*1e3)}clearSignal(){var e;this.stopLineLayer.removeAll(),this.countdownPanelProps.length=0,(e=this.watchHandle)==null||e.remove(),this.watchHandle=null}getPanelRotation(e){const t=e[0];let a=new f.Point({x:t[0],y:t[1]});this.view.spatialReference.isWebMercator&&(a=d.geographicToWebMercator(a));const i=this.view.toScreen(a),o=e[e.length-1];let s=new f.Point({x:o[0],y:o[1]});this.view.spatialReference.isWebMercator&&(s=d.geographicToWebMercator(s));const n=this.view.toScreen(s),r=n.x-i.x,l=n.y-i.y;return Math.atan2(l,r)*(180/Math.PI)}}exports.default=b;
|