gisviewer-vue3-arcgis 1.0.93 → 1.0.94

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.
@@ -1,12 +1,12 @@
1
- import * as d from "@arcgis/core/core/reactiveUtils";
2
- import { Point as c } from "@arcgis/core/geometry";
1
+ import * as c from "@arcgis/core/core/reactiveUtils";
2
+ import { Point as d } from "@arcgis/core/geometry";
3
3
  import p from "@arcgis/core/layers/FeatureLayer";
4
4
  import u from "../../stores/index.mjs";
5
5
  class f {
6
- constructor(e) {
7
- this.currentPhaseMap = /* @__PURE__ */ new Map(), this.countdownCanvasMap = /* @__PURE__ */ new Map(), this.lastDataTime = 0, this.isDeletingCanvas = !1, this.canvasWidth = 120, this.canvasHeight = 50, this.view = (e.type === "2d", e);
8
- const t = u.useAppDataStore;
9
- this.mapConfig = JSON.parse(JSON.stringify(t.mapConfig));
6
+ constructor(a) {
7
+ this.currentPhaseMap = /* @__PURE__ */ new Map(), this.countdownCanvasMap = /* @__PURE__ */ new Map(), this.lastDataTime = 0, this.isDeletingCanvas = !1, this.canvasWidth = 120, this.canvasHeight = 50, this.view = (a.type === "2d", a);
8
+ const e = u.useAppDataStore;
9
+ this.mapConfig = JSON.parse(JSON.stringify(e.mapConfig));
10
10
  }
11
11
  /**
12
12
  * 初始化相位线图层
@@ -16,14 +16,14 @@ class f {
16
16
  if (this.phaseLineLayer)
17
17
  this.phaseLineLayer.visible || (this.phaseLineLayer.visible = !0);
18
18
  else {
19
- const e = `${this.mapConfig.assetsRoot}/${this.mapConfig.phaseLineLayer}`, o = (await (await fetch(e)).json()).features.map((s, n) => ({
19
+ const a = `${this.mapConfig.assetsRoot}/${this.mapConfig.phaseLineLayer}`, o = (await (await fetch(a)).json()).features.map((t, s) => ({
20
20
  geometry: {
21
21
  type: "polyline",
22
- paths: [s.geometry.coordinates]
22
+ paths: [t.geometry.coordinates]
23
23
  },
24
24
  attributes: {
25
- ObjectID: n + 1,
26
- id: s.properties.id,
25
+ ObjectID: s + 1,
26
+ id: t.properties.id,
27
27
  color: "hide"
28
28
  }
29
29
  }));
@@ -105,58 +105,54 @@ class f {
105
105
  }), this.view.map.add(this.phaseLineLayer);
106
106
  }
107
107
  }
108
- async handleSignalData(e) {
109
- const t = new Date().getTime();
110
- if (t - this.lastDataTime < 100)
111
- return;
112
- this.lastDataTime = t;
113
- const { crossId: o, lat: s, lon: n, rtStage: a, channelsConfig: l } = e;
114
- await this.updateCountdown(o, s, n, a), !(!this.phaseLineLayer || !l) && ((!this.currentPhaseMap.has(o) || this.currentPhaseMap.get(o) !== a.stagePhase) && await this.updatePhaseLine(
115
- o,
116
- a.channelsConfig,
117
- l
118
- ), this.currentPhaseMap.set(o, a.stagePhase));
108
+ async handleSignalData(a) {
109
+ const { crossId: e, lat: i, lon: o, rtStage: t, channelsConfig: s } = a;
110
+ await this.updateCountdown(e, i, o, t), !(!this.phaseLineLayer || !s) && ((!this.currentPhaseMap.has(e) || this.currentPhaseMap.get(e) !== t.stagePhase) && await this.updatePhaseLine(
111
+ e,
112
+ t.channelsConfig,
113
+ s
114
+ ), this.currentPhaseMap.set(e, t.stagePhase));
119
115
  }
120
116
  /**
121
117
  * 清除实时信号相关图层
122
118
  * */
123
119
  clearSignal() {
124
- this.phaseLineLayer.visible = !1, this.countdownWatchHandel && (this.countdownWatchHandel.remove(), this.countdownWatchHandel = void 0), this.countdownCanvasMap.forEach((e) => {
125
- this.view.container.removeChild(e.backgroundCanvas), this.view.container.removeChild(e.countdownCanvas);
120
+ this.phaseLineLayer && (this.phaseLineLayer.visible = !1), this.countdownWatchHandel && (this.countdownWatchHandel.remove(), this.countdownWatchHandel = void 0), this.countdownCanvasMap.forEach((a) => {
121
+ this.view.container.removeChild(a.backgroundCanvas), this.view.container.removeChild(a.countdownCanvas);
126
122
  }), this.countdownCanvasMap.clear();
127
123
  }
128
124
  /**
129
125
  * 获取显示倒计时的canvas
130
126
  * */
131
- async updateCountdown(e, t, i, o) {
127
+ async updateCountdown(a, e, i, o) {
132
128
  if (this.isDeletingCanvas)
133
129
  return;
134
- const s = this.countdownCanvasMap.get(e);
135
- if (s)
136
- this.drawCountdownText(s.countdownCanvas, o);
130
+ const t = this.countdownCanvasMap.get(a);
131
+ if (t)
132
+ this.drawCountdownText(t.countdownCanvas, o);
137
133
  else {
138
- const n = new c({
134
+ const s = new d({
139
135
  longitude: i,
140
- latitude: t,
136
+ latitude: e,
141
137
  z: 10
142
- }), a = this.view.toScreen(n);
143
- if (a.x > this.view.width || a.y > this.view.height || a.x <= 0 || a.y <= 0)
138
+ }), n = this.view.toScreen(s);
139
+ if (n.x > this.view.width || n.y > this.view.height || n.x <= 0 || n.y <= 0)
144
140
  return;
145
141
  this.createCountdownCanvas((l) => {
146
142
  const h = l[0], r = l[1];
147
- h.style.left = a.x + "px", h.style.top = a.y + "px", r.style.left = a.x + "px", r.style.top = a.y + "px", this.countdownCanvasMap.set(e, {
143
+ 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, {
148
144
  backgroundCanvas: h,
149
145
  countdownCanvas: r,
150
- mapPoint: n
146
+ mapPoint: s
151
147
  }), this.drawCountdownText(r, o);
152
148
  });
153
149
  }
154
- this.countdownWatchHandel || (this.countdownWatchHandel = d.watch(
150
+ this.countdownWatchHandel || (this.countdownWatchHandel = c.watch(
155
151
  () => this.view.extent,
156
152
  () => {
157
- this.countdownCanvasMap.forEach((n) => {
158
- const a = this.view.toScreen(n.mapPoint);
159
- a.x > this.view.width || a.y > this.view.height || a.x <= 0 || a.y <= 0 ? (this.isDeletingCanvas = !0, this.view.container.removeChild(n.backgroundCanvas), this.view.container.removeChild(n.countdownCanvas), this.countdownCanvasMap.delete(e), this.isDeletingCanvas = !1) : (n.backgroundCanvas.style.left = a.x + "px", n.backgroundCanvas.style.top = a.y + "px", n.countdownCanvas.style.left = a.x + "px", n.countdownCanvas.style.top = a.y + "px");
153
+ this.countdownCanvasMap.forEach((s) => {
154
+ const n = this.view.toScreen(s.mapPoint);
155
+ s.backgroundCanvas.style.left = n.x + "px", s.backgroundCanvas.style.top = n.y + "px", s.countdownCanvas.style.left = n.x + "px", s.countdownCanvas.style.top = n.y + "px";
160
156
  });
161
157
  }
162
158
  ));
@@ -170,21 +166,21 @@ class f {
170
166
  * @param rtStage.stageAllRedTime 全红时间
171
167
  * @param rtStage.stageYellowTime 黄灯时间
172
168
  */
173
- drawCountdownText(e, t) {
174
- const i = e.getContext("2d");
175
- i.clearRect(0, 0, e.width, e.height), i.font = "32px LESLIE", i.textBaseline = "middle", i.textAlign = "center", i.fillStyle = t.stageRemainingTime <= t.stageAllRedTime ? "red" : t.stageRemainingTime <= t.stageAllRedTime + t.stageYellowTime ? "yellow" : "lime", i.fillText(
176
- `${t.stageID} ${t.stageRemainingTime.toFixed(0)}`,
177
- e.width / 2,
178
- e.height / 2
169
+ drawCountdownText(a, e) {
170
+ const i = a.getContext("2d");
171
+ i.clearRect(0, 0, a.width, a.height), i.font = "32px Digital", i.textBaseline = "middle", i.textAlign = "center", i.fillStyle = e.stageRemainingTime <= e.stageAllRedTime ? "red" : e.stageRemainingTime <= e.stageAllRedTime + e.stageYellowTime ? "yellow" : "lime", i.fillText(
172
+ `${e.stageID} ${e.stageRemainingTime.toFixed(0)}`,
173
+ a.width / 2,
174
+ a.height / 2
179
175
  );
180
176
  }
181
- async updatePhaseLine(e, t, i) {
177
+ async updatePhaseLine(a, e, i) {
182
178
  const o = this.phaseLineLayer.source.filter(
183
- (s) => s.getAttribute("id").includes(e)
179
+ (t) => t.getAttribute("id").includes(a)
184
180
  );
185
- o.forEach((s) => {
186
- const n = s.getAttribute("id");
187
- this.isLaneInChannels(n, t) ? s.setAttribute("color", "green") : this.isLaneInChannels(n, i) ? s.setAttribute("color", "red") : s.setAttribute("color", "green");
181
+ o.forEach((t) => {
182
+ const s = t.getAttribute("id");
183
+ this.isLaneInChannels(s, e) ? t.setAttribute("color", "green") : this.isLaneInChannels(s, i) ? t.setAttribute("color", "red") : t.setAttribute("color", "green");
188
184
  }), await this.phaseLineLayer.applyEdits({ updateFeatures: o });
189
185
  }
190
186
  /**
@@ -193,24 +189,24 @@ class f {
193
189
  * @param channels 通道列表
194
190
  * @returns
195
191
  */
196
- isLaneInChannels(e, t) {
197
- const i = e.split("+"), o = i[1], s = i[2];
198
- for (let n = 0; n < t.length; n++)
199
- for (let a = 0; a < t[n].laneSnList.length; a++) {
200
- const l = t[n].laneSnList[a].toFixed(0);
201
- if (o === l[0] && s === l[1])
192
+ isLaneInChannels(a, e) {
193
+ const i = a.split("+"), o = i[1], t = i[2];
194
+ for (let s = 0; s < e.length; s++)
195
+ for (let n = 0; n < e[s].laneSnList.length; n++) {
196
+ const l = e[s].laneSnList[n].toFixed(0);
197
+ if (o === l[0] && t === l[1])
202
198
  return !0;
203
199
  }
204
200
  return !1;
205
201
  }
206
- createCountdownCanvas(e) {
207
- const t = new Image();
208
- t.src = `${this.mapConfig.assetsRoot}/Images/timeboard/CountdownBG.png`, t.onload = () => {
202
+ createCountdownCanvas(a) {
203
+ const e = new Image();
204
+ e.src = `${this.mapConfig.assetsRoot}/Images/timeboard/CountdownBG.png`, e.onload = () => {
209
205
  const i = document.createElement("canvas");
210
- i.width = this.canvasWidth, i.height = this.canvasHeight, i.style.position = "absolute", i.style.transform = "translate(-50%, -50%)", i.getContext("2d").drawImage(t, 0, 0, this.canvasWidth, this.canvasHeight), this.view.container.appendChild(i);
211
- const s = document.createElement("canvas");
212
- s.width = this.canvasWidth - 10, s.height = this.canvasHeight - 10, s.style.position = "absolute", s.style.transform = "translate(-50%, -50%)", this.view.container.appendChild(s), e([i, s]);
213
- }, t.onerror = () => {
206
+ i.width = this.canvasWidth, i.height = this.canvasHeight, i.style.position = "absolute", i.style.transform = "translate(-50%, -50%)", i.getContext("2d").drawImage(e, 0, 0, this.canvasWidth, this.canvasHeight), this.view.container.appendChild(i);
207
+ const t = document.createElement("canvas");
208
+ t.width = this.canvasWidth - 10, t.height = this.canvasHeight - 10, t.style.position = "absolute", t.style.transform = "translate(-50%, -50%)", this.view.container.appendChild(t), a([i, t]);
209
+ }, e.onerror = () => {
214
210
  console.error("倒计时背景图加载失败");
215
211
  };
216
212
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/core/reactiveUtils"),u=require("@arcgis/core/geometry"),p=require("@arcgis/core/layers/FeatureLayer"),y=require("../../stores/index.js");function g(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const w=g(d);class m{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,s)=>({geometry:{type:"polyline",paths:[n.geometry.coordinates]},attributes:{ObjectID:s+1,id:n.properties.id,color:"hide"}}));this.phaseLineLayer=new p({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 e=new Date().getTime();if(e-this.lastDataTime<100)return;this.lastDataTime=e;const{crossId:o,lat:n,lon:s,rtStage:i,channelsConfig:l}=t;await this.updateCountdown(o,n,s,i),!(!this.phaseLineLayer||!l)&&((!this.currentPhaseMap.has(o)||this.currentPhaseMap.get(o)!==i.stagePhase)&&await this.updatePhaseLine(o,i.channelsConfig,l),this.currentPhaseMap.set(o,i.stagePhase))}clearSignal(){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 s=new u.Point({longitude:a,latitude:e,z:10}),i=this.view.toScreen(s);if(i.x>this.view.width||i.y>this.view.height||i.x<=0||i.y<=0)return;this.createCountdownCanvas(l=>{const c=l[0],h=l[1];c.style.left=i.x+"px",c.style.top=i.y+"px",h.style.left=i.x+"px",h.style.top=i.y+"px",this.countdownCanvasMap.set(t,{backgroundCanvas:c,countdownCanvas:h,mapPoint:s}),this.drawCountdownText(h,o)})}this.countdownWatchHandel||(this.countdownWatchHandel=w.watch(()=>this.view.extent,()=>{this.countdownCanvasMap.forEach(s=>{const i=this.view.toScreen(s.mapPoint);i.x>this.view.width||i.y>this.view.height||i.x<=0||i.y<=0?(this.isDeletingCanvas=!0,this.view.container.removeChild(s.backgroundCanvas),this.view.container.removeChild(s.countdownCanvas),this.countdownCanvasMap.delete(t),this.isDeletingCanvas=!1):(s.backgroundCanvas.style.left=i.x+"px",s.backgroundCanvas.style.top=i.y+"px",s.countdownCanvas.style.left=i.x+"px",s.countdownCanvas.style.top=i.y+"px")})}))}drawCountdownText(t,e){const a=t.getContext("2d");a.clearRect(0,0,t.width,t.height),a.font="32px LESLIE",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 s=n.getAttribute("id");this.isLaneInChannels(s,e)?n.setAttribute("color","green"):this.isLaneInChannels(s,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 s=0;s<e.length;s++)for(let i=0;i<e[s].laneSnList.length;i++){const l=e[s].laneSnList[i].toFixed(0);if(o===l[0]&&n===l[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=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/core/reactiveUtils"),u=require("@arcgis/core/geometry"),p=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 w=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((i,n)=>({geometry:{type:"polyline",paths:[i.geometry.coordinates]},attributes:{ObjectID:n+1,id:i.properties.id,color:"hide"}}));this.phaseLineLayer=new p({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:i,channelsConfig:n}=t;await this.updateCountdown(e,a,o,i),!(!this.phaseLineLayer||!n)&&((!this.currentPhaseMap.has(e)||this.currentPhaseMap.get(e)!==i.stagePhase)&&await this.updatePhaseLine(e,i.channelsConfig,n),this.currentPhaseMap.set(e,i.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 i=this.countdownCanvasMap.get(t);if(i)this.drawCountdownText(i.countdownCanvas,o);else{const n=new u.Point({longitude:a,latitude:e,z:10}),s=this.view.toScreen(n);if(s.x>this.view.width||s.y>this.view.height||s.x<=0||s.y<=0)return;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:n}),this.drawCountdownText(h,o)})}this.countdownWatchHandel||(this.countdownWatchHandel=w.watch(()=>this.view.extent,()=>{this.countdownCanvasMap.forEach(n=>{const s=this.view.toScreen(n.mapPoint);n.backgroundCanvas.style.left=s.x+"px",n.backgroundCanvas.style.top=s.y+"px",n.countdownCanvas.style.left=s.x+"px",n.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(i=>i.getAttribute("id").includes(t));o.forEach(i=>{const n=i.getAttribute("id");this.isLaneInChannels(n,e)?i.setAttribute("color","green"):this.isLaneInChannels(n,a)?i.setAttribute("color","red"):i.setAttribute("color","green")}),await this.phaseLineLayer.applyEdits({updateFeatures:o})}isLaneInChannels(t,e){const a=t.split("+"),o=a[1],i=a[2];for(let n=0;n<e.length;n++)for(let s=0;s<e[n].laneSnList.length;s++){const r=e[n].laneSnList[s].toFixed(0);if(o===r[0]&&i===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 i=document.createElement("canvas");i.width=this.canvasWidth-10,i.height=this.canvasHeight-10,i.style.position="absolute",i.style.transform="translate(-50%, -50%)",this.view.container.appendChild(i),t([a,i])},e.onerror=()=>{console.error("倒计时背景图加载失败")}}}exports.default=f;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.93",
3
+ "version": "1.0.94",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [