ow-eengine-power 1.0.5 → 1.0.6

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.
@@ -44256,7 +44256,7 @@ class bv {
44256
44256
  this.viewer.dataSources.add(this.dataSource2);
44257
44257
  }
44258
44258
  //移除渲染电力线路
44259
- ReameLineModel() {
44259
+ RemoveLineModel() {
44260
44260
  this.viewer.dataSources.remove(this.dataSource2);
44261
44261
  }
44262
44262
  }
@@ -6581,4 +6581,4 @@ void main()
6581
6581
  v_pickColor = pickColor;
6582
6582
  v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
6583
6583
  }
6584
- `,rA=ve.SHOW_INDEX,Yl=ve.POSITION_INDEX,c0=ve.COLOR_INDEX,sA=ve.OUTLINE_COLOR_INDEX,aA=ve.OUTLINE_WIDTH_INDEX,cA=ve.PIXEL_SIZE_INDEX,l0=ve.SCALE_BY_DISTANCE_INDEX,h0=ve.TRANSLUCENCY_BY_DISTANCE_INDEX,f0=ve.DISTANCE_DISPLAY_CONDITION_INDEX,lA=ve.DISABLE_DEPTH_DISTANCE_INDEX,hA=ve.SPLIT_DIRECTION_INDEX,Xl=ve.NUMBER_OF_PROPERTIES,$t={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function _n(e){e=_(e,_.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(Xl),this._maxPixelSize=1,this._baseVolume=new K,this._baseVolumeWC=new K,this._baseVolume2D=new K,this._boundingVolume=new K,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.blendOption=_(e.blendOption,ht.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=pe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(_n.prototype,{length:{get:function(){return $l(this),this._pointPrimitives.length}}});function u0(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}_n.prototype.add=function(e){const t=new ve(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},_n.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},_n.prototype.removeAll=function(){u0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function $l(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;const t=[],n=e._pointPrimitives,i=n.length;for(let o=0,s=0;o<i;++o){const a=n[o];a&&(a._index=s++,t.push(a))}e._pointPrimitives=t}}_n.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},_n.prototype.contains=function(e){return h(e)&&e._pointPrimitiveCollection===this},_n.prototype.get=function(e){if(!h(e))throw new C("index is required.");return $l(this),this._pointPrimitives[e]},_n.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Xl;++i){const o=n[i]===0?Ae.STATIC_DRAW:Ae.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function fA(e,t,n){return new bt(e,[{index:$t.positionHighAndSize,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Yl]},{index:$t.positionLowAndShow,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Yl]},{index:$t.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[c0]},{index:$t.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[h0]},{index:$t.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[l0]},{index:$t.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[f0]}],t)}const Zl=new je;function d0(e,t,n,i){const o=i._index,s=i._getActualPosition();e._mode===pe.SCENE3D&&(K.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),je.fromCartesian(s,Zl);const a=i.pixelSize,c=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+c);const l=n[$t.positionHighAndSize],u=Zl.high;l(o,u.x,u.y,u.z,a);const d=n[$t.positionLowAndOutline],p=Zl.low;d(o,p.x,p.y,p.z,c)}const Ea=65536,$r=256;function p0(e,t,n,i){const o=i._index,s=i.color,a=i.getPickId(t).color,c=i.outlineColor;let l=w.floatToByte(s.red),u=w.floatToByte(s.green),d=w.floatToByte(s.blue);const p=l*Ea+u*$r+d;l=w.floatToByte(c.red),u=w.floatToByte(c.green),d=w.floatToByte(c.blue);const g=l*Ea+u*$r+d;l=w.floatToByte(a.red),u=w.floatToByte(a.green),d=w.floatToByte(a.blue);const y=l*Ea+u*$r+d,x=w.floatToByte(s.alpha)*Ea+w.floatToByte(c.alpha)*$r+w.floatToByte(a.alpha),E=n[$t.compressedAttribute0];E(o,p,g,y,x)}function m0(e,t,n,i){const o=i._index;let s=0,a=1,c=1,l=1;const u=i.translucencyByDistance;h(u)&&(s=u.near,a=u.nearValue,c=u.far,l=u.farValue,(a!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let d=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(d=!1),a=S.clamp(a,0,1),a=a===1?255:a*255|0;const p=(d?1:0)*$r+a;l=S.clamp(l,0,1),l=l===1?255:l*255|0;const g=l,y=n[$t.compressedAttribute1];y(o,p,g,s,c)}function _0(e,t,n,i){const o=i._index,s=n[$t.scaleByDistance];let a=0,c=1,l=1,u=1;const d=i.scaleByDistance;h(d)&&(a=d.near,c=d.nearValue,l=d.far,u=d.farValue,(c!==1||u!==1)&&(e._shaderScaleByDistance=!0)),s(o,a,c,l,u)}function g0(e,t,n,i){const o=i._index,s=n[$t.distanceDisplayConditionAndDisableDepthAndSplitDirection];let a=0,c=Number.MAX_VALUE;const l=i.distanceDisplayCondition;h(l)&&(a=l.near,c=l.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let d=0;const p=i.splitDirection;h(p)&&(d=p),s(o,a,c,u,d)}function uA(e,t,n,i){d0(e,t,n,i),p0(e,t,n,i),m0(e,t,n,i),_0(e,t,n,i),g0(e,t,n,i)}function Kl(e,t,n,i,o,s){let a;i.mode===pe.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const c=[];for(let l=0;l<n;++l){const u=t[l],d=u.position,p=ve._computeActualPosition(d,i,o);h(p)&&(u._setActualPosition(p),s?c.push(p):K.expand(a,p,a))}s&&K.fromPoints(c,a)}function dA(e,t){const n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==pe.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===pe.SCENE3D||n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&Kl(e,i,i.length,t,s,!0)):n===pe.MORPHING?Kl(e,i,i.length,t,s,!0):(n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&Kl(e,o,e._pointPrimitivesToUpdateIndex,t,s,!1)}function pA(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const mA=[];_n.prototype.update=function(e){if($l(this),!this.show)return;this._maxTotalPointSize=Ce.maximumAliasedPointSize,dA(this,e);const n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,s=this._propertiesChanged,a=this._createVertexArray;let c;const l=e.context,u=e.passes,d=u.pick;if(a||!d&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let B=0;B<Xl;++B)s[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=fA(l,n,this._buffersUsage),c=this._vaf.writers;for(let B=0;B<n;++B){const M=this._pointPrimitives[B];M._dirty=!1,uA(this,l,c,M)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=mA;B.length=0,(s[Yl]||s[aA]||s[cA])&&B.push(d0),(s[c0]||s[sA])&&B.push(p0),(s[rA]||s[h0])&&B.push(m0),s[l0]&&B.push(_0),(s[f0]||s[lA]||s[hA])&&B.push(g0);const M=B.length;if(c=this._vaf.writers,o/n>.1){for(let G=0;G<o;++G){const P=i[G];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P)}this._vaf.commit()}else{for(let G=0;G<o;++G){const P=i[G];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!h(this._vaf)||!h(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,K.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let p,g=N.IDENTITY;e.mode===pe.SCENE3D?(g=this.modelMatrix,p=K.clone(this._baseVolumeWC,this._boundingVolume)):p=K.clone(this._baseVolume2D,this._boundingVolume),pA(this,e,p);const y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===ht.OPAQUE||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===ht.TRANSLUCENT||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:Ji.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,E;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(x=new ge({sources:[oA]}),this._shaderScaleByDistance&&x.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&x.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&x.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&x.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===ht.OPAQUE_AND_TRANSLUCENT&&(E=new ge({defines:["OPAQUE"],sources:[Ca]}),this._sp=it.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t}),E=new ge({defines:["TRANSLUCENT"],sources:[Ca]}),this._spTranslucent=it.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._blendOption===ht.OPAQUE&&(E=new ge({sources:[Ca]}),this._sp=it.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._blendOption===ht.TRANSLUCENT&&(E=new ge({sources:[Ca]}),this._spTranslucent=it.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let T,D,A,O;const I=e.commandList;if(u.render||d){const B=this._colorCommands,M=this._blendOption===ht.OPAQUE,G=this._blendOption===ht.OPAQUE_AND_TRANSLUCENT;T=this._vaf.va,D=T.length,B.length=D;const P=G?D*2:D;for(O=0;O<P;++O){const V=M||G&&O%2===0;A=B[O],h(A)||(A=B[O]=new Xe),A.primitiveType=qe.POINTS,A.pass=V||!G?zt.OPAQUE:zt.TRANSLUCENT,A.owner=this;const k=G?Math.floor(O/2):O;A.boundingVolume=p,A.modelMatrix=g,A.shaderProgram=V?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=T[k].va,A.renderState=V?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",I.push(A)}}},_n.prototype.isDestroyed=function(){return!1},_n.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),u0(this._pointPrimitives),Ke(this)};const y0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ql=1,Zr=8;class Jl{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=i>>4;if(o!==Ql)throw new Error(`Got v${o} data when expected v${Ql}.`);const s=y0[i&15];if(!s)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new Jl(c,a,s,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const s=y0.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Zr,t),this.coords=new this.ArrayType(this.data,Zr+c+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Zr+a+c+l),this.ids=new this.IndexArrayType(this.data,Zr,t),this.coords=new this.ArrayType(this.data,Zr+c+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Ql<<4)+s]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return eh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:a,nodeSize:c}=this,l=[0,s.length-1,0],u=[];for(;l.length;){const d=l.pop()||0,p=l.pop()||0,g=l.pop()||0;if(p-g<=c){for(let T=g;T<=p;T++){const D=a[2*T],A=a[2*T+1];D>=t&&D<=i&&A>=n&&A<=o&&u.push(s[T])}continue}const y=g+p>>1,x=a[2*y],E=a[2*y+1];x>=t&&x<=i&&E>=n&&E<=o&&u.push(s[y]),(d===0?t<=x:n<=E)&&(l.push(g),l.push(y-1),l.push(1-d)),(d===0?i>=x:o>=E)&&(l.push(y+1),l.push(p),l.push(1-d))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],l=[],u=i*i;for(;c.length;){const d=c.pop()||0,p=c.pop()||0,g=c.pop()||0;if(p-g<=a){for(let T=g;T<=p;T++)C0(s[2*T],s[2*T+1],t,n)<=u&&l.push(o[T]);continue}const y=g+p>>1,x=s[2*y],E=s[2*y+1];C0(x,E,t,n)<=u&&l.push(o[y]),(d===0?t-i<=x:n-i<=E)&&(c.push(g),c.push(y-1),c.push(1-d)),(d===0?t+i>=x:n+i>=E)&&(c.push(y+1),c.push(p),c.push(1-d))}return l}}function eh(e,t,n,i,o,s){if(o-i<=n)return;const a=i+o>>1;x0(e,t,a,i,o,s),eh(e,t,n,i,a-1,1-s),eh(e,t,n,a+1,o,1-s)}function x0(e,t,n,i,o,s){for(;o>i;){if(o-i>600){const u=o-i+1,d=n-i+1,p=Math.log(u),g=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*g*(u-g)/u)*(d-u/2<0?-1:1),x=Math.max(i,Math.floor(n-d*g/u+y)),E=Math.min(o,Math.floor(n+(u-d)*g/u+y));x0(e,t,n,x,E,s)}const a=t[2*n+s];let c=i,l=o;for(Kr(e,t,i,n),t[2*o+s]>a&&Kr(e,t,i,o);c<l;){for(Kr(e,t,c,l),c++,l--;t[2*c+s]<a;)c++;for(;t[2*l+s]>a;)l--}t[2*i+s]===a?Kr(e,t,i,l):(l++,Kr(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Kr(e,t,n,i){th(e,n,i),th(t,2*n,2*i),th(t,2*n+1,2*i+1)}function th(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function C0(e,t,n,i){const o=e-n,s=t-i;return o*o+s*s}function Un(e){e=_(e,_.EMPTY_OBJECT),this._enabled=_(e.enabled,!1),this._pixelRange=_(e.pixelRange,80),this._minimumClusterSize=_(e.minimumClusterSize,2),this._clusterBillboards=_(e.clusterBillboards,!0),this._clusterLabels=_(e.clusterLabels,!0),this._clusterPoints=_(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new ze,this.show=_(e.show,!0)}function E0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const _A=new xe;function T0(e,t,n,i,o){if(h(e._labelCollection)&&i._clusterLabels?o=Fn.getScreenSpaceBoundingBox(e,t,o):h(e._billboardCollection)&&i._clusterBillboards?o=he.getScreenSpaceBoundingBox(e,t,o):h(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=ve.getScreenSpaceBoundingBox(e,t,o)),E0(o,n),i._clusterLabels&&!h(e._labelCollection)&&h(e.id)&&w0(i,e.id.id)&&h(e.id._label)){const s=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(s),c=Fn.getScreenSpaceBoundingBox(a,t,_A);E0(c,n),o=xe.union(o,c,o)}return o}function gA(e,t){if(e.clusterShow=!0,!h(e._labelCollection)&&h(e.id)&&w0(t,e.id.id)&&h(e.id._label)){const n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function b0(e,t,n,i){const o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function w0(e,t){return h(e)&&h(e._collectionIndicesByEntity[t])&&h(e._collectionIndicesByEntity[t].labelIndex)}function nh(e,t,n,i,o){if(!h(e))return;const s=e.length;for(let a=0;a<s;++a){const c=e.get(a);if(c.clusterShow=!1,!c.show||o._scene.mode===pe.SCENE3D&&!i.isPointVisible(c.position))continue;const l=o._clusterLabels&&h(c._labelCollection),u=o._clusterBillboards&&h(c.id._billboard),d=o._clusterPoints&&h(c.id._point);if(l&&(d||u))continue;const p=c.computeScreenSpacePosition(n);h(p)&&t.push({index:a,collection:e,clustered:!1,coord:p})}}const yA=new xe,xA=new xe,CA=new xe;function EA(e){return function(t){if(h(t)&&t<.05||!e.enabled)return;const n=e._scene,i=e._labelCollection,o=e._billboardCollection,s=e._pointCollection;if(!h(i)&&!h(o)&&!h(s)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let a=e._clusterLabelCollection,c=e._clusterBillboardCollection,l=e._clusterPointCollection;h(a)?a.removeAll():a=e._clusterLabelCollection=new Mn({scene:n}),h(c)?c.removeAll():c=e._clusterBillboardCollection=new Qt({scene:n}),h(l)?l.removeAll():l=e._clusterPointCollection=new _n;const u=e._pixelRange,d=e._minimumClusterSize,p=e._previousClusters,g=[],y=e._previousHeight,x=n.camera.positionCartographic.height,E=n.ellipsoid,T=n.camera.positionWC,D=new oi(E,T),A=[];e._clusterLabels&&nh(i,A,n,D,e),e._clusterBillboards&&nh(o,A,n,D,e),e._clusterPoints&&nh(s,A,n,D,e);let O,I,B,M,G,P,V,k,H,j,r,b;if(A.length>0){const v=new Jl(A.length,64,Uint32Array);for(let z=0;z<A.length;++z)v.add(A[z].coord.x,A[z].coord.y);if(v.finish(),x<y)for(B=p.length,O=0;O<B;++O){const z=p[O];if(!D.isPointVisible(z.position))continue;const q=he._computeScreenSpacePosition(N.IDENTITY,z.position,f.ZERO,U.ZERO,n);if(!h(q))continue;const W=1-x/y;let Z=z.width=z.width*W,X=z.height=z.height*W;Z=Math.max(Z,z.minimumWidth),X=Math.max(X,z.minimumHeight);const ie=q.x-Z*.5,se=q.y-X*.5,_e=q.x+Z,Ee=q.y+X;for(G=v.range(ie,se,_e,Ee),P=G.length,j=0,H=[],I=0;I<P;++I)V=G[I],k=A[V],k.clustered||(++j,r=k.collection,b=k.index,H.push(r.get(b).id));if(j>=d)for(b0(z.position,j,H,e),g.push(z),I=0;I<P;++I)A[G[I]].clustered=!0}for(B=A.length,O=0;O<B;++O){const z=A[O];if(z.clustered)continue;z.clustered=!0,r=z.collection,b=z.index;const q=r.get(b);M=T0(q,z.coord,u,e,yA);const W=xe.clone(M,xA);G=v.range(M.x,M.y,M.x+M.width,M.y+M.height),P=G.length;const Z=f.clone(q.position);for(j=1,H=[q.id],I=0;I<P;++I)if(V=G[I],k=A[V],!k.clustered){const X=k.collection.get(k.index),ie=T0(X,k.coord,u,e,CA);f.add(X.position,Z,Z),xe.union(W,ie,W),++j,H.push(X.id)}if(j>=d){const X=f.multiplyByScalar(Z,1/j,Z);for(b0(X,j,H,e),g.push({position:X,width:W.width,height:W.height,minimumWidth:M.width,minimumHeight:M.height}),I=0;I<P;++I)A[G[I]].clustered=!0}else gA(q,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),c.length===0&&(c.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=g,e._previousHeight=x}}Un.prototype._initialize=function(e){this._scene=e;const t=EA(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(Un.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function ih(e,t,n,i){return function(o){let s=this[e];h(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[o.id];if(h(a)||(a=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),h(s)&&h(a[i]))return s.get(a[i]);h(s)||(s=this[e]=new t({scene:this._scene}));let c,l;const u=this[n];u.length>0?(c=u.shift(),l=s.get(c)):(l=s.add(),c=s.length-1),a[i]=c;const d=this;return Promise.resolve().then(function(){d._clusterDirty=!0}),l}}function oh(e,t){const n=e._collectionIndicesByEntity[t];!h(n.billboardIndex)&&!h(n.labelIndex)&&!h(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Un.prototype.getLabel=ih("_labelCollection",Mn,"_unusedLabelIndices","labelIndex"),Un.prototype.removeLabel=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._labelCollection)||!h(t)||!h(t.labelIndex))return;const n=t.labelIndex;t.labelIndex=void 0,oh(this,e.id);const i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0},Un.prototype.getBillboard=ih("_billboardCollection",Qt,"_unusedBillboardIndices","billboardIndex"),Un.prototype.removeBillboard=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._billboardCollection)||!h(t)||!h(t.billboardIndex))return;const n=t.billboardIndex;t.billboardIndex=void 0,oh(this,e.id);const i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0},Un.prototype.getPoint=ih("_pointCollection",_n,"_unusedPointIndices","pointIndex"),Un.prototype.removePoint=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._pointCollection)||!h(t)||!h(t.pointIndex))return;const n=t.pointIndex;t.pointIndex=void 0,oh(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function rh(e){if(!h(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function TA(e){e.enabled||(h(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),h(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),h(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,rh(e._labelCollection),rh(e._billboardCollection),rh(e._pointCollection))}Un.prototype.update=function(e){if(!this.show)return;let t;h(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),h(this._billboardCollection)&&this._billboardCollection.length>0&&!h(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,TA(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),h(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),h(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),h(this._clusterPointCollection)&&this._clusterPointCollection.update(e),h(this._labelCollection)&&this._labelCollection.update(e),h(this._billboardCollection)&&this._billboardCollection.update(e),h(this._pointCollection)&&this._pointCollection.update(e)},Un.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),h(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};function sh(e){this._name=e,this._clock=void 0,this._changed=new ze,this._error=new ze,this._isLoading=!1,this._loading=new ze,this._entityCollection=new Xt(this),this._entityCluster=new Un}Object.defineProperties(sh.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){ya.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!h(e))throw new C("value must be defined.");this._entityCluster=e}}}),sh.prototype.update=function(e){return!0};function ah(e,t,n=10,i="#ba1919"){return{name:t,label:{text:t,font:"18px sans-serif"},polyline:{show:!0,positions:e,clampToGround:!1,width:n,material:w.fromCssColorString(i),arcType:ei.NONE,shadows:oa.DISABLED}}}function bA(e,t,n,i=new pt(0,0,0),o=1){return{name:t,position:e,orientation:me.headingPitchRollQuaternion(e,i),model:{show:!0,uri:n,scale:o,heightReference:di.NONE}}}function ch(e,t,n,i,o){n||(n=new pt);const s=me.headingPitchRollQuaternion(e,n,i,o),a=N.fromRotationTranslation(F.fromQuaternion(s,new F),e,new N);return N.multiplyByPoint(a,t,new f)}function lh(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...wA(e[i],e[i+1],t*-1e3,100));return n}function wA(e,t,n,i){var o=[],s=ee.fromCartesian(e),a=ee.fromCartesian(t),c=s.longitude*180/Math.PI,l=s.latitude*180/Math.PI,u=a.longitude*180/Math.PI,d=a.latitude*180/Math.PI,p=Math.sqrt((c-u)*(c-u)+(l-d)*(l-d)),g=p*n,y=f.clone(e),x=f.clone(t),E=f.distance(y,f.ZERO),T=f.distance(x,f.ZERO);if(f.normalize(y,y),f.normalize(x,x),f.distance(y,x)==0)return o;var D=f.angleBetween(y,x);o.push(e);for(var A=1;A<i-1;A++){var O=A*1/(i-1),I=1-O,B=Math.sin(I*D)/Math.sin(D),M=Math.sin(O*D)/Math.sin(D),G=f.multiplyByScalar(y,B,new f),P=f.multiplyByScalar(x,M,new f),V=f.add(G,P,new f),k=O*Math.PI,H=E*I+T*O+Math.sin(k)*g;V=f.multiplyByScalar(V,H,V),o.push(V)}return o.push(t),o}class SA{constructor(t,n,i){st(this,"towerModelUri");st(this,"viewer");st(this,"LineInfo");st(this,"dataSource2",new sh("myEntity2"));st(this,"entityCollection2",this.dataSource2.entities);st(this,"offsetTowers",[]);st(this,"offsetLines11",[]);st(this,"offsetLines12",[]);st(this,"offsetLines13",[]);st(this,"offsetArcLines1A",[]);st(this,"offsetArcLines1B",[]);st(this,"offsetArcLines1C",[]);this.towerModelUri=n,this.viewer=t,this.LineInfo=i}loadLineTower(){this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(f.fromDegrees(t[0],t[1],t[2]-this.LineInfo.towerHeight))}),this.offsetTowers.forEach((t,n)=>{let i=new pt(S.toRadians(this.LineInfo.towerrolls[n][0]),0,0);this.offsetLines11.push(ch(t,new f(this.LineInfo.TowerAPoint[n][0],this.LineInfo.TowerAPoint[n][1],this.LineInfo.TowerAPoint[n][2]),i)),this.offsetLines12.push(ch(t,new f(this.LineInfo.TowerBPoint[n][0],this.LineInfo.TowerBPoint[n][1],this.LineInfo.TowerBPoint[n][2]),i)),this.offsetLines13.push(ch(t,new f(this.LineInfo.TowerCPoint[n][0],this.LineInfo.TowerCPoint[n][1],this.LineInfo.TowerCPoint[n][2]),i))}),this.offsetArcLines1A=lh(this.offsetLines11),this.offsetArcLines1B=lh(this.offsetLines12),this.offsetArcLines1C=lh(this.offsetLines13),this.entityCollection2.add(ah(this.offsetArcLines1A,"导线A",this.LineInfo.lineWidth,this.LineInfo.lineAColor)),this.entityCollection2.add(ah(this.offsetArcLines1B,"导线B",this.LineInfo.lineWidth,this.LineInfo.lineBColor)),this.entityCollection2.add(ah(this.offsetArcLines1C,"导线C",this.LineInfo.lineWidth,this.LineInfo.lineCColor)),this.offsetTowers.forEach((t,n)=>{const i=S.toRadians(this.LineInfo.towerrolls[n][0]),o=new pt(i,S.toRadians(90),0);this.entityCollection2.add(bA(t,`电线塔${n}`,this.towerModelUri,o,this.LineInfo.towerScale))})}loadLineModel(){this.viewer.dataSources.add(this.dataSource2)}ReameLineModel(){this.viewer.dataSources.remove(this.dataSource2)}}class AA{constructor(){st(this,"towers",[]);st(this,"towerrolls",[]);st(this,"TowerAPoint",[]);st(this,"TowerBPoint",[]);st(this,"TowerCPoint",[]);st(this,"towerScale",1);st(this,"towerHeight",42);st(this,"lineAColor","#FFFFFF");st(this,"lineBColor","#FFFFFF");st(this,"lineCColor","#FFFFFF");st(this,"lineWidth",1)}}ln.OWEEgineManager=SA,ln.TowerLineInfo=AA,Object.defineProperty(ln,Symbol.toStringTag,{value:"Module"})});
6584
+ `,rA=ve.SHOW_INDEX,Yl=ve.POSITION_INDEX,c0=ve.COLOR_INDEX,sA=ve.OUTLINE_COLOR_INDEX,aA=ve.OUTLINE_WIDTH_INDEX,cA=ve.PIXEL_SIZE_INDEX,l0=ve.SCALE_BY_DISTANCE_INDEX,h0=ve.TRANSLUCENCY_BY_DISTANCE_INDEX,f0=ve.DISTANCE_DISPLAY_CONDITION_INDEX,lA=ve.DISABLE_DEPTH_DISTANCE_INDEX,hA=ve.SPLIT_DIRECTION_INDEX,Xl=ve.NUMBER_OF_PROPERTIES,$t={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function _n(e){e=_(e,_.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(Xl),this._maxPixelSize=1,this._baseVolume=new K,this._baseVolumeWC=new K,this._baseVolume2D=new K,this._boundingVolume=new K,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.blendOption=_(e.blendOption,ht.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=pe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(_n.prototype,{length:{get:function(){return $l(this),this._pointPrimitives.length}}});function u0(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}_n.prototype.add=function(e){const t=new ve(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},_n.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},_n.prototype.removeAll=function(){u0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function $l(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;const t=[],n=e._pointPrimitives,i=n.length;for(let o=0,s=0;o<i;++o){const a=n[o];a&&(a._index=s++,t.push(a))}e._pointPrimitives=t}}_n.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},_n.prototype.contains=function(e){return h(e)&&e._pointPrimitiveCollection===this},_n.prototype.get=function(e){if(!h(e))throw new C("index is required.");return $l(this),this._pointPrimitives[e]},_n.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Xl;++i){const o=n[i]===0?Ae.STATIC_DRAW:Ae.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function fA(e,t,n){return new bt(e,[{index:$t.positionHighAndSize,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Yl]},{index:$t.positionLowAndShow,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Yl]},{index:$t.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[c0]},{index:$t.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[h0]},{index:$t.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[l0]},{index:$t.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[f0]}],t)}const Zl=new je;function d0(e,t,n,i){const o=i._index,s=i._getActualPosition();e._mode===pe.SCENE3D&&(K.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),je.fromCartesian(s,Zl);const a=i.pixelSize,c=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+c);const l=n[$t.positionHighAndSize],u=Zl.high;l(o,u.x,u.y,u.z,a);const d=n[$t.positionLowAndOutline],p=Zl.low;d(o,p.x,p.y,p.z,c)}const Ea=65536,$r=256;function p0(e,t,n,i){const o=i._index,s=i.color,a=i.getPickId(t).color,c=i.outlineColor;let l=w.floatToByte(s.red),u=w.floatToByte(s.green),d=w.floatToByte(s.blue);const p=l*Ea+u*$r+d;l=w.floatToByte(c.red),u=w.floatToByte(c.green),d=w.floatToByte(c.blue);const g=l*Ea+u*$r+d;l=w.floatToByte(a.red),u=w.floatToByte(a.green),d=w.floatToByte(a.blue);const y=l*Ea+u*$r+d,x=w.floatToByte(s.alpha)*Ea+w.floatToByte(c.alpha)*$r+w.floatToByte(a.alpha),E=n[$t.compressedAttribute0];E(o,p,g,y,x)}function m0(e,t,n,i){const o=i._index;let s=0,a=1,c=1,l=1;const u=i.translucencyByDistance;h(u)&&(s=u.near,a=u.nearValue,c=u.far,l=u.farValue,(a!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let d=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(d=!1),a=S.clamp(a,0,1),a=a===1?255:a*255|0;const p=(d?1:0)*$r+a;l=S.clamp(l,0,1),l=l===1?255:l*255|0;const g=l,y=n[$t.compressedAttribute1];y(o,p,g,s,c)}function _0(e,t,n,i){const o=i._index,s=n[$t.scaleByDistance];let a=0,c=1,l=1,u=1;const d=i.scaleByDistance;h(d)&&(a=d.near,c=d.nearValue,l=d.far,u=d.farValue,(c!==1||u!==1)&&(e._shaderScaleByDistance=!0)),s(o,a,c,l,u)}function g0(e,t,n,i){const o=i._index,s=n[$t.distanceDisplayConditionAndDisableDepthAndSplitDirection];let a=0,c=Number.MAX_VALUE;const l=i.distanceDisplayCondition;h(l)&&(a=l.near,c=l.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let d=0;const p=i.splitDirection;h(p)&&(d=p),s(o,a,c,u,d)}function uA(e,t,n,i){d0(e,t,n,i),p0(e,t,n,i),m0(e,t,n,i),_0(e,t,n,i),g0(e,t,n,i)}function Kl(e,t,n,i,o,s){let a;i.mode===pe.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const c=[];for(let l=0;l<n;++l){const u=t[l],d=u.position,p=ve._computeActualPosition(d,i,o);h(p)&&(u._setActualPosition(p),s?c.push(p):K.expand(a,p,a))}s&&K.fromPoints(c,a)}function dA(e,t){const n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==pe.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===pe.SCENE3D||n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&Kl(e,i,i.length,t,s,!0)):n===pe.MORPHING?Kl(e,i,i.length,t,s,!0):(n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&Kl(e,o,e._pointPrimitivesToUpdateIndex,t,s,!1)}function pA(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const mA=[];_n.prototype.update=function(e){if($l(this),!this.show)return;this._maxTotalPointSize=Ce.maximumAliasedPointSize,dA(this,e);const n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,s=this._propertiesChanged,a=this._createVertexArray;let c;const l=e.context,u=e.passes,d=u.pick;if(a||!d&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let B=0;B<Xl;++B)s[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=fA(l,n,this._buffersUsage),c=this._vaf.writers;for(let B=0;B<n;++B){const M=this._pointPrimitives[B];M._dirty=!1,uA(this,l,c,M)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=mA;B.length=0,(s[Yl]||s[aA]||s[cA])&&B.push(d0),(s[c0]||s[sA])&&B.push(p0),(s[rA]||s[h0])&&B.push(m0),s[l0]&&B.push(_0),(s[f0]||s[lA]||s[hA])&&B.push(g0);const M=B.length;if(c=this._vaf.writers,o/n>.1){for(let G=0;G<o;++G){const P=i[G];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P)}this._vaf.commit()}else{for(let G=0;G<o;++G){const P=i[G];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!h(this._vaf)||!h(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,K.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let p,g=N.IDENTITY;e.mode===pe.SCENE3D?(g=this.modelMatrix,p=K.clone(this._baseVolumeWC,this._boundingVolume)):p=K.clone(this._baseVolume2D,this._boundingVolume),pA(this,e,p);const y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===ht.OPAQUE||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===ht.TRANSLUCENT||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:Ji.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,E;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(x=new ge({sources:[oA]}),this._shaderScaleByDistance&&x.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&x.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&x.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&x.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===ht.OPAQUE_AND_TRANSLUCENT&&(E=new ge({defines:["OPAQUE"],sources:[Ca]}),this._sp=it.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t}),E=new ge({defines:["TRANSLUCENT"],sources:[Ca]}),this._spTranslucent=it.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._blendOption===ht.OPAQUE&&(E=new ge({sources:[Ca]}),this._sp=it.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._blendOption===ht.TRANSLUCENT&&(E=new ge({sources:[Ca]}),this._spTranslucent=it.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let T,D,A,O;const I=e.commandList;if(u.render||d){const B=this._colorCommands,M=this._blendOption===ht.OPAQUE,G=this._blendOption===ht.OPAQUE_AND_TRANSLUCENT;T=this._vaf.va,D=T.length,B.length=D;const P=G?D*2:D;for(O=0;O<P;++O){const V=M||G&&O%2===0;A=B[O],h(A)||(A=B[O]=new Xe),A.primitiveType=qe.POINTS,A.pass=V||!G?zt.OPAQUE:zt.TRANSLUCENT,A.owner=this;const k=G?Math.floor(O/2):O;A.boundingVolume=p,A.modelMatrix=g,A.shaderProgram=V?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=T[k].va,A.renderState=V?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",I.push(A)}}},_n.prototype.isDestroyed=function(){return!1},_n.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),u0(this._pointPrimitives),Ke(this)};const y0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ql=1,Zr=8;class Jl{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=i>>4;if(o!==Ql)throw new Error(`Got v${o} data when expected v${Ql}.`);const s=y0[i&15];if(!s)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new Jl(c,a,s,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const s=y0.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Zr,t),this.coords=new this.ArrayType(this.data,Zr+c+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Zr+a+c+l),this.ids=new this.IndexArrayType(this.data,Zr,t),this.coords=new this.ArrayType(this.data,Zr+c+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Ql<<4)+s]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return eh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:a,nodeSize:c}=this,l=[0,s.length-1,0],u=[];for(;l.length;){const d=l.pop()||0,p=l.pop()||0,g=l.pop()||0;if(p-g<=c){for(let T=g;T<=p;T++){const D=a[2*T],A=a[2*T+1];D>=t&&D<=i&&A>=n&&A<=o&&u.push(s[T])}continue}const y=g+p>>1,x=a[2*y],E=a[2*y+1];x>=t&&x<=i&&E>=n&&E<=o&&u.push(s[y]),(d===0?t<=x:n<=E)&&(l.push(g),l.push(y-1),l.push(1-d)),(d===0?i>=x:o>=E)&&(l.push(y+1),l.push(p),l.push(1-d))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],l=[],u=i*i;for(;c.length;){const d=c.pop()||0,p=c.pop()||0,g=c.pop()||0;if(p-g<=a){for(let T=g;T<=p;T++)C0(s[2*T],s[2*T+1],t,n)<=u&&l.push(o[T]);continue}const y=g+p>>1,x=s[2*y],E=s[2*y+1];C0(x,E,t,n)<=u&&l.push(o[y]),(d===0?t-i<=x:n-i<=E)&&(c.push(g),c.push(y-1),c.push(1-d)),(d===0?t+i>=x:n+i>=E)&&(c.push(y+1),c.push(p),c.push(1-d))}return l}}function eh(e,t,n,i,o,s){if(o-i<=n)return;const a=i+o>>1;x0(e,t,a,i,o,s),eh(e,t,n,i,a-1,1-s),eh(e,t,n,a+1,o,1-s)}function x0(e,t,n,i,o,s){for(;o>i;){if(o-i>600){const u=o-i+1,d=n-i+1,p=Math.log(u),g=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*g*(u-g)/u)*(d-u/2<0?-1:1),x=Math.max(i,Math.floor(n-d*g/u+y)),E=Math.min(o,Math.floor(n+(u-d)*g/u+y));x0(e,t,n,x,E,s)}const a=t[2*n+s];let c=i,l=o;for(Kr(e,t,i,n),t[2*o+s]>a&&Kr(e,t,i,o);c<l;){for(Kr(e,t,c,l),c++,l--;t[2*c+s]<a;)c++;for(;t[2*l+s]>a;)l--}t[2*i+s]===a?Kr(e,t,i,l):(l++,Kr(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Kr(e,t,n,i){th(e,n,i),th(t,2*n,2*i),th(t,2*n+1,2*i+1)}function th(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function C0(e,t,n,i){const o=e-n,s=t-i;return o*o+s*s}function Un(e){e=_(e,_.EMPTY_OBJECT),this._enabled=_(e.enabled,!1),this._pixelRange=_(e.pixelRange,80),this._minimumClusterSize=_(e.minimumClusterSize,2),this._clusterBillboards=_(e.clusterBillboards,!0),this._clusterLabels=_(e.clusterLabels,!0),this._clusterPoints=_(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new ze,this.show=_(e.show,!0)}function E0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const _A=new xe;function T0(e,t,n,i,o){if(h(e._labelCollection)&&i._clusterLabels?o=Fn.getScreenSpaceBoundingBox(e,t,o):h(e._billboardCollection)&&i._clusterBillboards?o=he.getScreenSpaceBoundingBox(e,t,o):h(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=ve.getScreenSpaceBoundingBox(e,t,o)),E0(o,n),i._clusterLabels&&!h(e._labelCollection)&&h(e.id)&&w0(i,e.id.id)&&h(e.id._label)){const s=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(s),c=Fn.getScreenSpaceBoundingBox(a,t,_A);E0(c,n),o=xe.union(o,c,o)}return o}function gA(e,t){if(e.clusterShow=!0,!h(e._labelCollection)&&h(e.id)&&w0(t,e.id.id)&&h(e.id._label)){const n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function b0(e,t,n,i){const o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function w0(e,t){return h(e)&&h(e._collectionIndicesByEntity[t])&&h(e._collectionIndicesByEntity[t].labelIndex)}function nh(e,t,n,i,o){if(!h(e))return;const s=e.length;for(let a=0;a<s;++a){const c=e.get(a);if(c.clusterShow=!1,!c.show||o._scene.mode===pe.SCENE3D&&!i.isPointVisible(c.position))continue;const l=o._clusterLabels&&h(c._labelCollection),u=o._clusterBillboards&&h(c.id._billboard),d=o._clusterPoints&&h(c.id._point);if(l&&(d||u))continue;const p=c.computeScreenSpacePosition(n);h(p)&&t.push({index:a,collection:e,clustered:!1,coord:p})}}const yA=new xe,xA=new xe,CA=new xe;function EA(e){return function(t){if(h(t)&&t<.05||!e.enabled)return;const n=e._scene,i=e._labelCollection,o=e._billboardCollection,s=e._pointCollection;if(!h(i)&&!h(o)&&!h(s)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let a=e._clusterLabelCollection,c=e._clusterBillboardCollection,l=e._clusterPointCollection;h(a)?a.removeAll():a=e._clusterLabelCollection=new Mn({scene:n}),h(c)?c.removeAll():c=e._clusterBillboardCollection=new Qt({scene:n}),h(l)?l.removeAll():l=e._clusterPointCollection=new _n;const u=e._pixelRange,d=e._minimumClusterSize,p=e._previousClusters,g=[],y=e._previousHeight,x=n.camera.positionCartographic.height,E=n.ellipsoid,T=n.camera.positionWC,D=new oi(E,T),A=[];e._clusterLabels&&nh(i,A,n,D,e),e._clusterBillboards&&nh(o,A,n,D,e),e._clusterPoints&&nh(s,A,n,D,e);let O,I,B,M,G,P,V,k,H,j,r,b;if(A.length>0){const v=new Jl(A.length,64,Uint32Array);for(let z=0;z<A.length;++z)v.add(A[z].coord.x,A[z].coord.y);if(v.finish(),x<y)for(B=p.length,O=0;O<B;++O){const z=p[O];if(!D.isPointVisible(z.position))continue;const q=he._computeScreenSpacePosition(N.IDENTITY,z.position,f.ZERO,U.ZERO,n);if(!h(q))continue;const W=1-x/y;let Z=z.width=z.width*W,X=z.height=z.height*W;Z=Math.max(Z,z.minimumWidth),X=Math.max(X,z.minimumHeight);const ie=q.x-Z*.5,se=q.y-X*.5,_e=q.x+Z,Ee=q.y+X;for(G=v.range(ie,se,_e,Ee),P=G.length,j=0,H=[],I=0;I<P;++I)V=G[I],k=A[V],k.clustered||(++j,r=k.collection,b=k.index,H.push(r.get(b).id));if(j>=d)for(b0(z.position,j,H,e),g.push(z),I=0;I<P;++I)A[G[I]].clustered=!0}for(B=A.length,O=0;O<B;++O){const z=A[O];if(z.clustered)continue;z.clustered=!0,r=z.collection,b=z.index;const q=r.get(b);M=T0(q,z.coord,u,e,yA);const W=xe.clone(M,xA);G=v.range(M.x,M.y,M.x+M.width,M.y+M.height),P=G.length;const Z=f.clone(q.position);for(j=1,H=[q.id],I=0;I<P;++I)if(V=G[I],k=A[V],!k.clustered){const X=k.collection.get(k.index),ie=T0(X,k.coord,u,e,CA);f.add(X.position,Z,Z),xe.union(W,ie,W),++j,H.push(X.id)}if(j>=d){const X=f.multiplyByScalar(Z,1/j,Z);for(b0(X,j,H,e),g.push({position:X,width:W.width,height:W.height,minimumWidth:M.width,minimumHeight:M.height}),I=0;I<P;++I)A[G[I]].clustered=!0}else gA(q,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),c.length===0&&(c.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=g,e._previousHeight=x}}Un.prototype._initialize=function(e){this._scene=e;const t=EA(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(Un.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function ih(e,t,n,i){return function(o){let s=this[e];h(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[o.id];if(h(a)||(a=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),h(s)&&h(a[i]))return s.get(a[i]);h(s)||(s=this[e]=new t({scene:this._scene}));let c,l;const u=this[n];u.length>0?(c=u.shift(),l=s.get(c)):(l=s.add(),c=s.length-1),a[i]=c;const d=this;return Promise.resolve().then(function(){d._clusterDirty=!0}),l}}function oh(e,t){const n=e._collectionIndicesByEntity[t];!h(n.billboardIndex)&&!h(n.labelIndex)&&!h(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Un.prototype.getLabel=ih("_labelCollection",Mn,"_unusedLabelIndices","labelIndex"),Un.prototype.removeLabel=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._labelCollection)||!h(t)||!h(t.labelIndex))return;const n=t.labelIndex;t.labelIndex=void 0,oh(this,e.id);const i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0},Un.prototype.getBillboard=ih("_billboardCollection",Qt,"_unusedBillboardIndices","billboardIndex"),Un.prototype.removeBillboard=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._billboardCollection)||!h(t)||!h(t.billboardIndex))return;const n=t.billboardIndex;t.billboardIndex=void 0,oh(this,e.id);const i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0},Un.prototype.getPoint=ih("_pointCollection",_n,"_unusedPointIndices","pointIndex"),Un.prototype.removePoint=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._pointCollection)||!h(t)||!h(t.pointIndex))return;const n=t.pointIndex;t.pointIndex=void 0,oh(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function rh(e){if(!h(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function TA(e){e.enabled||(h(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),h(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),h(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,rh(e._labelCollection),rh(e._billboardCollection),rh(e._pointCollection))}Un.prototype.update=function(e){if(!this.show)return;let t;h(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),h(this._billboardCollection)&&this._billboardCollection.length>0&&!h(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,TA(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),h(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),h(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),h(this._clusterPointCollection)&&this._clusterPointCollection.update(e),h(this._labelCollection)&&this._labelCollection.update(e),h(this._billboardCollection)&&this._billboardCollection.update(e),h(this._pointCollection)&&this._pointCollection.update(e)},Un.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),h(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};function sh(e){this._name=e,this._clock=void 0,this._changed=new ze,this._error=new ze,this._isLoading=!1,this._loading=new ze,this._entityCollection=new Xt(this),this._entityCluster=new Un}Object.defineProperties(sh.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){ya.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!h(e))throw new C("value must be defined.");this._entityCluster=e}}}),sh.prototype.update=function(e){return!0};function ah(e,t,n=10,i="#ba1919"){return{name:t,label:{text:t,font:"18px sans-serif"},polyline:{show:!0,positions:e,clampToGround:!1,width:n,material:w.fromCssColorString(i),arcType:ei.NONE,shadows:oa.DISABLED}}}function bA(e,t,n,i=new pt(0,0,0),o=1){return{name:t,position:e,orientation:me.headingPitchRollQuaternion(e,i),model:{show:!0,uri:n,scale:o,heightReference:di.NONE}}}function ch(e,t,n,i,o){n||(n=new pt);const s=me.headingPitchRollQuaternion(e,n,i,o),a=N.fromRotationTranslation(F.fromQuaternion(s,new F),e,new N);return N.multiplyByPoint(a,t,new f)}function lh(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...wA(e[i],e[i+1],t*-1e3,100));return n}function wA(e,t,n,i){var o=[],s=ee.fromCartesian(e),a=ee.fromCartesian(t),c=s.longitude*180/Math.PI,l=s.latitude*180/Math.PI,u=a.longitude*180/Math.PI,d=a.latitude*180/Math.PI,p=Math.sqrt((c-u)*(c-u)+(l-d)*(l-d)),g=p*n,y=f.clone(e),x=f.clone(t),E=f.distance(y,f.ZERO),T=f.distance(x,f.ZERO);if(f.normalize(y,y),f.normalize(x,x),f.distance(y,x)==0)return o;var D=f.angleBetween(y,x);o.push(e);for(var A=1;A<i-1;A++){var O=A*1/(i-1),I=1-O,B=Math.sin(I*D)/Math.sin(D),M=Math.sin(O*D)/Math.sin(D),G=f.multiplyByScalar(y,B,new f),P=f.multiplyByScalar(x,M,new f),V=f.add(G,P,new f),k=O*Math.PI,H=E*I+T*O+Math.sin(k)*g;V=f.multiplyByScalar(V,H,V),o.push(V)}return o.push(t),o}class SA{constructor(t,n,i){st(this,"towerModelUri");st(this,"viewer");st(this,"LineInfo");st(this,"dataSource2",new sh("myEntity2"));st(this,"entityCollection2",this.dataSource2.entities);st(this,"offsetTowers",[]);st(this,"offsetLines11",[]);st(this,"offsetLines12",[]);st(this,"offsetLines13",[]);st(this,"offsetArcLines1A",[]);st(this,"offsetArcLines1B",[]);st(this,"offsetArcLines1C",[]);this.towerModelUri=n,this.viewer=t,this.LineInfo=i}loadLineTower(){this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(f.fromDegrees(t[0],t[1],t[2]-this.LineInfo.towerHeight))}),this.offsetTowers.forEach((t,n)=>{let i=new pt(S.toRadians(this.LineInfo.towerrolls[n][0]),0,0);this.offsetLines11.push(ch(t,new f(this.LineInfo.TowerAPoint[n][0],this.LineInfo.TowerAPoint[n][1],this.LineInfo.TowerAPoint[n][2]),i)),this.offsetLines12.push(ch(t,new f(this.LineInfo.TowerBPoint[n][0],this.LineInfo.TowerBPoint[n][1],this.LineInfo.TowerBPoint[n][2]),i)),this.offsetLines13.push(ch(t,new f(this.LineInfo.TowerCPoint[n][0],this.LineInfo.TowerCPoint[n][1],this.LineInfo.TowerCPoint[n][2]),i))}),this.offsetArcLines1A=lh(this.offsetLines11),this.offsetArcLines1B=lh(this.offsetLines12),this.offsetArcLines1C=lh(this.offsetLines13),this.entityCollection2.add(ah(this.offsetArcLines1A,"导线A",this.LineInfo.lineWidth,this.LineInfo.lineAColor)),this.entityCollection2.add(ah(this.offsetArcLines1B,"导线B",this.LineInfo.lineWidth,this.LineInfo.lineBColor)),this.entityCollection2.add(ah(this.offsetArcLines1C,"导线C",this.LineInfo.lineWidth,this.LineInfo.lineCColor)),this.offsetTowers.forEach((t,n)=>{const i=S.toRadians(this.LineInfo.towerrolls[n][0]),o=new pt(i,S.toRadians(90),0);this.entityCollection2.add(bA(t,`电线塔${n}`,this.towerModelUri,o,this.LineInfo.towerScale))})}loadLineModel(){this.viewer.dataSources.add(this.dataSource2)}RemoveLineModel(){this.viewer.dataSources.remove(this.dataSource2)}}class AA{constructor(){st(this,"towers",[]);st(this,"towerrolls",[]);st(this,"TowerAPoint",[]);st(this,"TowerBPoint",[]);st(this,"TowerCPoint",[]);st(this,"towerScale",1);st(this,"towerHeight",42);st(this,"lineAColor","#FFFFFF");st(this,"lineBColor","#FFFFFF");st(this,"lineCColor","#FFFFFF");st(this,"lineWidth",1)}}ln.OWEEgineManager=SA,ln.TowerLineInfo=AA,Object.defineProperty(ln,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ow-eengine-power",
3
3
  "private": false,
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",