gisviewer-vue3-arcgis 1.0.94 → 1.0.95
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.vue2.mjs +2 -2
- package/es/src/gis-map/gis-map.vue3.mjs +5 -0
- package/es/src/gis-map/index.mjs +4 -3
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +0 -2
- package/es/style.css +1 -0
- package/lib/src/gis-map/gis-map.vue2.js +1 -1
- package/lib/src/gis-map/gis-map.vue3.js +1 -0
- package/lib/src/gis-map/index.js +1 -1
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -1
- package/package.json +1 -1
package/es/src/gis-map/index.mjs
CHANGED
|
@@ -136,8 +136,6 @@ class f {
|
|
|
136
136
|
latitude: e,
|
|
137
137
|
z: 10
|
|
138
138
|
}), n = this.view.toScreen(s);
|
|
139
|
-
if (n.x > this.view.width || n.y > this.view.height || n.x <= 0 || n.y <= 0)
|
|
140
|
-
return;
|
|
141
139
|
this.createCountdownCanvas((l) => {
|
|
142
140
|
const h = l[0], r = l[1];
|
|
143
141
|
h.style.left = n.x + "px", h.style.top = n.y + "px", r.style.left = n.x + "px", r.style.top = n.y + "px", this.countdownCanvasMap.set(a, {
|
package/es/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gis-viewer{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./gis-map.vue.js");require("./gis-map.vue2.js");exports.default=e.default;
|
package/lib/src/gis-map/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@easyest/utils"),u=require("./gis-map.vue.js")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@easyest/utils"),u=require("./gis-map.vue.js");require("./gis-map.vue2.js");const e=t.withInstall(u.default);exports.GisMap=e;exports.default=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/core/reactiveUtils"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/core/reactiveUtils"),p=require("@arcgis/core/geometry"),u=require("@arcgis/core/layers/FeatureLayer"),y=require("../../stores/index.js");function g(l){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const e in l)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(l,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>l[e]})}}return t.default=l,Object.freeze(t)}const m=g(d);class f{constructor(t){this.currentPhaseMap=new Map,this.countdownCanvasMap=new Map,this.lastDataTime=0,this.isDeletingCanvas=!1,this.canvasWidth=120,this.canvasHeight=50,this.view=(t.type==="2d",t);const e=y.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(e.mapConfig))}async initializeLayer(){if(this.mapConfig.phaseLineLayer)if(this.phaseLineLayer)this.phaseLineLayer.visible||(this.phaseLineLayer.visible=!0);else{const t=`${this.mapConfig.assetsRoot}/${this.mapConfig.phaseLineLayer}`,o=(await(await fetch(t)).json()).features.map((n,i)=>({geometry:{type:"polyline",paths:[n.geometry.coordinates]},attributes:{ObjectID:i+1,id:n.properties.id,color:"hide"}}));this.phaseLineLayer=new u({source:o,geometryType:"polyline",objectIdField:"ObjectID",outFields:["*"],fields:[{name:"ObjectID",alias:"ObjectID",type:"oid"},{name:"color",alias:"color",type:"string"}],renderer:{type:"unique-value",field:"color",defaultSymbol:{type:"simple-line",color:"lightblue",width:"2px",style:"none"},uniqueValueInfos:[{value:"green",symbol:{type:"line-3d",symbolLayers:[{type:"path",profile:"quad",material:{color:[19,255,69,.8]},width:1,height:.5}]}},{value:"red",symbol:{type:"line-3d",symbolLayers:[{type:"path",profile:"quad",material:{color:[254,5,9,.8]},width:1,height:.5}]}},{value:"yellow",symbol:{type:"line-3d",symbolLayers:[{type:"path",profile:"quad",material:{color:[255,215,0,.8]},width:1,height:.5}]}}]}}),this.view.map.add(this.phaseLineLayer)}}async handleSignalData(t){const{crossId:e,lat:a,lon:o,rtStage:n,channelsConfig:i}=t;await this.updateCountdown(e,a,o,n),!(!this.phaseLineLayer||!i)&&((!this.currentPhaseMap.has(e)||this.currentPhaseMap.get(e)!==n.stagePhase)&&await this.updatePhaseLine(e,n.channelsConfig,i),this.currentPhaseMap.set(e,n.stagePhase))}clearSignal(){this.phaseLineLayer&&(this.phaseLineLayer.visible=!1),this.countdownWatchHandel&&(this.countdownWatchHandel.remove(),this.countdownWatchHandel=void 0),this.countdownCanvasMap.forEach(t=>{this.view.container.removeChild(t.backgroundCanvas),this.view.container.removeChild(t.countdownCanvas)}),this.countdownCanvasMap.clear()}async updateCountdown(t,e,a,o){if(this.isDeletingCanvas)return;const n=this.countdownCanvasMap.get(t);if(n)this.drawCountdownText(n.countdownCanvas,o);else{const i=new p.Point({longitude:a,latitude:e,z:10}),s=this.view.toScreen(i);this.createCountdownCanvas(r=>{const c=r[0],h=r[1];c.style.left=s.x+"px",c.style.top=s.y+"px",h.style.left=s.x+"px",h.style.top=s.y+"px",this.countdownCanvasMap.set(t,{backgroundCanvas:c,countdownCanvas:h,mapPoint:i}),this.drawCountdownText(h,o)})}this.countdownWatchHandel||(this.countdownWatchHandel=m.watch(()=>this.view.extent,()=>{this.countdownCanvasMap.forEach(i=>{const s=this.view.toScreen(i.mapPoint);i.backgroundCanvas.style.left=s.x+"px",i.backgroundCanvas.style.top=s.y+"px",i.countdownCanvas.style.left=s.x+"px",i.countdownCanvas.style.top=s.y+"px"})}))}drawCountdownText(t,e){const a=t.getContext("2d");a.clearRect(0,0,t.width,t.height),a.font="32px Digital",a.textBaseline="middle",a.textAlign="center",a.fillStyle=e.stageRemainingTime<=e.stageAllRedTime?"red":e.stageRemainingTime<=e.stageAllRedTime+e.stageYellowTime?"yellow":"lime",a.fillText(`${e.stageID} ${e.stageRemainingTime.toFixed(0)}`,t.width/2,t.height/2)}async updatePhaseLine(t,e,a){const o=this.phaseLineLayer.source.filter(n=>n.getAttribute("id").includes(t));o.forEach(n=>{const i=n.getAttribute("id");this.isLaneInChannels(i,e)?n.setAttribute("color","green"):this.isLaneInChannels(i,a)?n.setAttribute("color","red"):n.setAttribute("color","green")}),await this.phaseLineLayer.applyEdits({updateFeatures:o})}isLaneInChannels(t,e){const a=t.split("+"),o=a[1],n=a[2];for(let i=0;i<e.length;i++)for(let s=0;s<e[i].laneSnList.length;s++){const r=e[i].laneSnList[s].toFixed(0);if(o===r[0]&&n===r[1])return!0}return!1}createCountdownCanvas(t){const e=new Image;e.src=`${this.mapConfig.assetsRoot}/Images/timeboard/CountdownBG.png`,e.onload=()=>{const a=document.createElement("canvas");a.width=this.canvasWidth,a.height=this.canvasHeight,a.style.position="absolute",a.style.transform="translate(-50%, -50%)",a.getContext("2d").drawImage(e,0,0,this.canvasWidth,this.canvasHeight),this.view.container.appendChild(a);const n=document.createElement("canvas");n.width=this.canvasWidth-10,n.height=this.canvasHeight-10,n.style.position="absolute",n.style.transform="translate(-50%, -50%)",this.view.container.appendChild(n),t([a,n])},e.onerror=()=>{console.error("倒计时背景图加载失败")}}}exports.default=f;
|