gisviewer-vue3-arcgis 1.0.169 → 1.0.171

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 (28) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +4 -4
  2. package/es/src/gis-map/gis-map.vue.mjs +105 -106
  3. package/es/src/gis-map/index.d.ts +2 -2
  4. package/es/src/gis-map/style/index.css +26 -0
  5. package/es/src/gis-map/utils/GreenWaveline.d.ts +68 -0
  6. package/es/src/gis-map/utils/holo-flow/index.d.ts +3 -2
  7. package/es/src/gis-map/utils/holo-flow/index.mjs +9 -6
  8. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +120 -5
  9. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +2 -120
  10. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +3 -8
  11. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +60 -77
  12. package/es/style.css +1 -1
  13. package/lib/src/gis-map/gis-map.vue.d.ts +4 -4
  14. package/lib/src/gis-map/gis-map.vue.js +1 -1
  15. package/lib/src/gis-map/index.d.ts +2 -2
  16. package/lib/src/gis-map/style/index.css +26 -0
  17. package/lib/src/gis-map/utils/GreenWaveline.d.ts +68 -0
  18. package/lib/src/gis-map/utils/holo-flow/index.d.ts +3 -2
  19. package/lib/src/gis-map/utils/holo-flow/index.js +1 -1
  20. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -1
  21. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -1
  22. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +3 -8
  23. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
  24. package/package.json +1 -1
  25. package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
  26. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.mjs +0 -4
  27. package/lib/_virtual/_plugin-vue_export-helper.js +0 -1
  28. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@arcgis/core/core/reactiveUtils"),d=require("@arcgis/core/geometry"),m=require("@arcgis/core/layers/GraphicsLayer"),w=require("@turf/bearing"),y=require("@turf/destination"),L=require("@turf/helpers"),S=require("../../stores/index.js"),v=require("../common-utils.js"),M=require("./signal-holo-flow.js");function g(f){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const o in f)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(f,o);Object.defineProperty(e,o,r.get?r:{enumerable:!0,get:()=>f[o]})}}return e.default=f,Object.freeze(e)}const b=g(P),h=g(L);class x extends M.default{constructor(e){super(e),this.stopLineLayer=new m,this.store=S.default.useAppDataStore,this.watchHandle=null,this.stopLineMap=new Map,this.view.map.add(this.stopLineLayer)}async initializeLayer(){var p,c;console.time("初始化停止线图层");let e=(c=(p=this.mapConfig.holoFlow)==null?void 0:p.signal)==null?void 0:c.stopLineLayer;if(!e)return;e=this.mapConfig.assetsRoot+"/"+e,(await(await fetch(e)).json()).features.forEach(t=>{const{roadId:s,nodeId:n,angle:i,destinationPoint:a}=t.properties,{coordinates:l}=t.geometry,u=this.stopLineMap.get(n);u?u.set(s,{coord:l,panelPoint:a,angle:i}):this.stopLineMap.set(n,new Map([[s,{coord:l,panelPoint:a,angle:i}]]))}),console.timeEnd("初始化停止线图层")}getPanelScale(){const e=this.view.scale;let o=1;return e<1e3?o=1:e<2e3?o=.8:o=.4,o}async handleSignalData(e){this.watchHandle||(this.watchHandle=b.watch(()=>this.view.extent,()=>{const t=this.getPanelScale();for(const s of this.store.countdownPanels){t!==this.currentPanelScale&&(s.scale=t);const{mapPoint:n}=s,i=this.view.toScreen({type:"point",x:n[0],y:n[1]});s.position.left=i.x,s.position.top=i.y}this.currentPanelScale=t}));const o=e.crossId,r=this.stopLineMap.get(o);if(!r){console.log(`没有找到路口${o}`);return}const p=e.phaseCountDownList,c=new Map;for(const t of p){let s="";for(let l of t.roadIdList)if(l.startsWith("-")&&(l=l.slice(1)),r.has(l)){s=l;break}if(!s){console.log(`没有找到对应的进口道${o}--${s}`);continue}let n=c.get(s);if(n||(n={},c.set(s,n)),!t.direction){console.log(`没有找到对应的方向${o}--${JSON.stringify(t)}`);continue}const i=t.direction.toLowerCase(),a=t.color===1?"red":t.color===2?"yellow":"green";i==="u"?(n.uNumber=t.leftTime,n.uColor=a):i==="l"?(n.lNumber=t.leftTime,n.lColor=a):i==="s"?(n.sNumber=t.leftTime,n.sColor=a):i==="r"&&(n.rNumber=t.leftTime,n.rColor=a)}c.forEach((t,s)=>{const n=r.get(s);if(!n)return;const i=this.store.countdownPanels.find(a=>a.crossId===o&&a.roadId===s);if(i)i.lampStatus=t;else{const a=n.panelPoint,l=this.view.toScreen({type:"point",x:a[0],y:a[1]}),u=this.getPanelRotation(n.coord);this.store.countdownPanels.push({displayMode:"complex",crossId:o,roadId:s,mapPoint:a,stopLine:n.coord,position:{left:l.x,top:l.y},rotation:u,scale:this.getPanelScale(),lampStatus:t})}})}clearSignal(){var e;this.stopLineLayer.removeAll(),this.store.countdownPanels=[],(e=this.watchHandle)==null||e.remove(),this.watchHandle=null}getPanelPoint(e){const o=v.default.getCenterPointInLine(e),r=e[0],p=e[e.length-1];let t=w(h.point(r),h.point(p))-90;return t<-180&&(t+=360),y(h.point(o),1,t,{units:"meters"}).geometry.coordinates}getPanelRotation(e){const o=e[0],r=new d.Point({x:o[0],y:o[1],spatialReference:this.view.spatialReference}),p=this.view.toScreen(r),c=e[e.length-1],t=new d.Point({x:c[0],y:c[1],spatialReference:this.view.spatialReference}),s=this.view.toScreen(t),n=s.x-p.x,i=s.y-p.y;return Math.atan2(i,n)*(180/Math.PI)}}exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/core/reactiveUtils"),d=require("@arcgis/core/geometry"),P=require("@arcgis/core/layers/GraphicsLayer"),w=require("./signal-holo-flow.js");function g(f){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const o in f)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(f,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>f[o]})}}return t.default=f,Object.freeze(t)}const m=g(u);class y extends w.default{constructor(t,o){super(t),this.stopLineLayer=new P,this.watchHandle=null,this.stopLineMap=new Map,this.countdownPanelProps=o,this.view.map.add(this.stopLineLayer)}async initializeLayer(){var p,c;console.time("初始化停止线图层");let t=(c=(p=this.mapConfig.holoFlow)==null?void 0:p.signal)==null?void 0:c.stopLineLayer;if(!t)return;t=this.mapConfig.assetsRoot+"/"+t,(await(await fetch(t)).json()).features.forEach(n=>{const{roadId:s,nodeId:e,angle:i,destinationPoint:a}=n.properties,{coordinates:l}=n.geometry,h=this.stopLineMap.get(e);h?h.set(s,{coord:l,panelPoint:a,angle:i}):this.stopLineMap.set(e,new Map([[s,{coord:l,panelPoint:a,angle:i}]]))}),console.timeEnd("初始化停止线图层")}getPanelScale(){const t=this.view.scale;let o=1;return t<1e3?o=1:t<2e3?o=.8:o=.4,o}async handleSignalData(t){this.watchHandle||(this.watchHandle=m.watch(()=>this.view.extent,()=>{const n=this.getPanelScale();for(const s of this.countdownPanelProps){n!==this.currentPanelScale&&(s.scale=n);const{mapPoint:e}=s,i=this.view.toScreen({type:"point",x:e[0],y:e[1]});s.position.left=i.x,s.position.top=i.y}this.currentPanelScale=n}));const o=t.crossId,r=this.stopLineMap.get(o);if(!r){console.log(`没有找到路口${o}`);return}const p=t.phaseCountDownList,c=new Map;for(const n of p){let s="";for(let l of n.roadIdList)if(l.startsWith("-")&&(l=l.slice(1)),r.has(l)){s=l;break}if(!s){console.log(`没有找到对应的进口道${o}--${s}`);continue}let e=c.get(s);if(e||(e={},c.set(s,e)),!n.direction){console.log(`没有找到对应的方向${o}--${JSON.stringify(n)}`);continue}const i=n.direction.toLowerCase(),a=n.color===1?"red":n.color===2?"yellow":"green";i==="u"?(e.uNumber=n.leftTime,e.uColor=a):i==="l"?(e.lNumber=n.leftTime,e.lColor=a):i==="s"?(e.sNumber=n.leftTime,e.sColor=a):i==="r"&&(e.rNumber=n.leftTime,e.rColor=a)}c.forEach((n,s)=>{const e=r.get(s);if(!e)return;const i=this.countdownPanelProps.find(a=>a.crossId===o&&a.roadId===s);if(i)i.lampStatus=n;else{const a=e.panelPoint,l=this.view.toScreen({type:"point",x:a[0],y:a[1]}),h=this.getPanelRotation(e.coord);this.countdownPanelProps.push({displayMode:"complex",crossId:o,roadId:s,mapPoint:a,stopLine:e.coord,position:{left:l.x,top:l.y},rotation:h,scale:this.getPanelScale(),lampStatus:n})}})}clearSignal(){var t;this.stopLineLayer.removeAll(),this.countdownPanelProps=[],(t=this.watchHandle)==null||t.remove(),this.watchHandle=null}getPanelRotation(t){const o=t[0],r=new d.Point({x:o[0],y:o[1],spatialReference:this.view.spatialReference}),p=this.view.toScreen(r),c=t[t.length-1],n=new d.Point({x:c[0],y:c[1],spatialReference:this.view.spatialReference}),s=this.view.toScreen(n),e=s.x-p.x,i=s.y-p.y;return Math.atan2(i,e)*(180/Math.PI)}}exports.default=y;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.169",
3
+ "version": "1.0.171",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [
@@ -1,9 +0,0 @@
1
- const s = (t, e) => {
2
- const o = t.__vccOpts || t;
3
- for (const [r, c] of e)
4
- o[r] = c;
5
- return o;
6
- };
7
- export {
8
- s as default
9
- };
@@ -1,4 +0,0 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=(e,o)=>{const t=e.__vccOpts||e;for(const[r,s]of o)t[r]=s;return t};exports.default=u;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;