`,new e0(p,-g,e.depth+.85)),u.setLabelStyle(h,.018,"x"),h.setParent(m),h.userData=Z2(B2({},s),{labelType:"town-label",baseScale:.018,townName:s.name}),h.element.addEventListener("pointerdown",C=>{e.handleTownRankingSelect(s.name,{preserveCamera:!0,statusText:`已选中${s.name}`})&&(C.preventDefault(),C.stopPropagation())}),h}}createRotateBorder(){let e=13.2,n=this.assets.instance.getResource("rotationBorder1"),a=this.assets.instance.getResource("rotationBorder2"),i=new _f(this,{width:e*1.178,needRotate:!0,rotateSpeed:.001,material:new V0({map:n,color:4763647,transparent:!0,opacity:.26,side:ze,depthWrite:!1,blending:qe}),position:new e0(0,.31,0)});i.instance.rotation.x=-Math.PI/2,i.instance.renderOrder=6,i.instance.scale.set(0,0,0),i.setParent(this.scene);let r=new _f(this,{width:e*1.116,needRotate:!0,rotateSpeed:-.004,material:new V0({map:a,color:4763647,transparent:!0,opacity:.5,side:ze,depthWrite:!1,blending:qe}),position:new e0(0,.33,0)});r.instance.rotation.x=-Math.PI/2,r.instance.renderOrder=6,r.instance.scale.set(0,0,0),r.setParent(this.scene),this.rotateBorder1=i.instance,this.rotateBorder2=r.instance}createFlyLine(){this.flyLineGroup=new ae,this.flyLineGroup.visible=!1,this.scene.add(this.flyLineGroup)}createFocus(){this.flyLineFocusGroup.clear()}createParticles(){this.particles=new Yi(this,{num:10,range:30,dir:"up",speed:.05,material:new hr({map:Yi.createTexture(),size:1,color:61166,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1,vertexColors:!0,blending:qe,sizeAttenuation:!0})}),this.particleGroup=new ae,this.scene.add(this.particleGroup),this.particleGroup.rotation.x=-Math.PI/2,this.particles.setParent(this.particleGroup),this.particles.enable=!0,this.particleGroup.visible=!0}createScatter(){this.scatterGroup=new ae,this.scatterGroup.visible=!1,this.scatterGroup.rotation.x=-Math.PI/2,this.scene.add(this.scatterGroup);const e=this.assets.instance.getResource("arrow"),n=new D9({map:e,color:16776948,fog:!1,transparent:!0,depthTest:!1});let a=Kf(rM),i=a[0].value;a.map(r=>{const o=new B9(n);o.renderOrder=23;let s=.1+r.value/i*.2;o.scale.set(s,s,s);let[u,m]=this.geoProjection([r.lng,r.lat]);o.position.set(u,-m,this.depth+.45),o.userData.position=[u,-m,this.depth+.45],this.scatterGroup.add(o)})}createInfoPoint(){let e=this;this.InfoPointGroup=new ae,this.scene.add(this.InfoPointGroup),this.InfoPointGroup.visible=!1,this.InfoPointGroup.rotation.x=-Math.PI/2,this.infoPointIndex=0,this.infoPointLabelTime=null,this.infoLabelElement=[],this.infoPointSprites=[];let n=this.label3d;const a=this.assets.instance.getResource("point");let i=[16776948,7863285],r=Kf(oM),o=r[0].value;r.map((u,m)=>{const h=new D9({map:a,color:i[m%i.length],fog:!1,transparent:!0,depthTest:!1}),p=new B9(h);p.renderOrder=23;let g=.7+u.value/o*.4;p.scale.set(g,g,g);let[C,I]=this.geoProjection([u.lng,u.lat]),U=[C,-I,this.depth+.7];p.position.set(...U),p.userData.position=[...U],p.userData={position:[C,-I,this.depth+.7],name:u.name,value:u.value,level:u.level,index:m},this.InfoPointGroup.add(p);let j=s(u,n,this.InfoPointGroup,m);this.infoLabelElement.push(j),this.infoPointSprites.push(p),this.interactionManager.add(p),p.addEventListener("mousedown",u2=>{var v2,S2;if(this.clicked||!this.InfoPointGroup.visible)return!1;this.clicked=!0,this.infoPointIndex=u2.target.userData.index,this.infoLabelElement.map(T2=>{T2.visible=!1}),j.visible=!0,this.handleTownRankingSelect(((v2=u2.target.userData)==null?void 0:v2.name)||((S2=u2.target.userData)==null?void 0:S2.townName)),this.createInfoPointLabelLoop()}),p.addEventListener("mouseup",u2=>{this.clicked=!1}),p.addEventListener("mouseover",u2=>{document.body.style.cursor="pointer"}),p.addEventListener("mouseout",u2=>{document.body.style.cursor="default"})});function s(u,m,h,p){let g=m.create("","info-point",!0);const[C,I]=e.geoProjection([u.lng,u.lat]);return g.init(e.getInfoPointHtml(Z2(B2({},u),{value:0,rank:p+1,unit:""}),e.getTownRankingMeta()),new e0(C,-I,e.depth+1.9)),m.setLabelStyle(g,.015,"x"),g.setParent(h),g.visible=!1,g}}createInfoPointLabelLoop(){var e;this.scenePaused||!((e=this.infoLabelElement)!=null&&e.length)||(clearInterval(this.infoPointLabelTime),this.infoPointLabelTime=setInterval(()=>{this.infoPointIndex++,this.infoPointIndex>=this.infoLabelElement.length&&(this.infoPointIndex=0),this.infoLabelElement.map((n,a)=>{this.infoPointIndex===a?n.visible=!0:n.visible=!1})},3e3))}createStorke(){const e=this.staticMapData.mapStroke,n=this.assets.instance.getResource("pathLine3");n.wrapS=n.wrapT=Ot,n.repeat.set(2,1);let a=new G9(this,{geoProjectionCenter:this.geoProjectionCenter,geoProjectionScale:this.geoProjectionScale,position:new e0(0,0,this.depth+.24),data:e,material:new V0({color:2868444,map:n,alphaMap:n,fog:!1,transparent:!0,opacity:1,blending:qe}),type:"Line3",renderOrder:22,tubeRadius:.03});this.focusMapGroup.add(a.lineGroup),this.time.on("tick",()=>{n.offset.x+=.005})}handleMapClick(e){return P3(this,null,function*(){var r,o,s,u,m,h,p,g,C,I,U,j,u2,v2,S2,T2,C2,j2,K2,H2,s3,m3,p3,G3,b3,Y3,o3,n1,b1,W3,R1,D1,$1,h3,x3,R3,h1,C1,_1,o1,l3;if(!this.currentTopicLayer)return;const n=this.getScreenPointFromEvent(e),a=this.getLngLatFromEvent(e);if(!a){this.clearSelectedFeature(),(o=(r=this.callbacks).onFeatureInfo)==null||o.call(r,{feature:null});return}if(this.boundaryDrawingEnabled){const $2=((s=e==null?void 0:e.data)==null?void 0:s.originalEvent)||(e==null?void 0:e.originalEvent)||e;if($2!=null&&$2.__analysisBoundaryHandled)return;this.addBoundaryDrawPoint(a);return}if(this.shouldClipLayerToHongyuanBoundary(this.currentTopicLayer)&&!this.isLngLatInHongyuanBoundary(a)){this.clearSelectedFeature(),(m=(u=this.callbacks).onFeatureInfo)==null||m.call(u,{feature:null}),(p=(h=this.callbacks).onLayerStatus)==null||p.call(h,{type:"success",text:"当前点击位置不在红原县边界内"});return}if(this.shouldClipLayerToLayerBounds(this.currentTopicLayer)&&!this.isLngLatInLayerClipBounds(a,this.currentTopicLayer)){this.clearSelectedFeature(),(C=(g=this.callbacks).onFeatureInfo)==null||C.call(g,{feature:null}),(U=(I=this.callbacks).onLayerStatus)==null||U.call(I,{type:"success",text:"当前点击位置不在图层显示范围内"});return}if(VM(this.currentTopicLayer)){this.clearSelectedFeature(),(u2=(j=this.callbacks).onFeatureInfo)==null||u2.call(j,{feature:null});return}if(ai(this.currentTopicLayer)){const $2=this.pickVectorFeatureAtPoint(a,n),O3=($2==null?void 0:$2.feature)||$2;let c1=($2==null?void 0:$2.screen)||n;if(O3)this.shouldClipLayerToHongyuanBoundary(this.currentTopicLayer)?(this.clearSelectedGeometryGroup(),this.setSelectedVectorFeatures([O3])):this.showSelectedFeature(O3),((v2=this.currentTopicLayer)==null?void 0:v2.key)==="yak-industry-points"&&(this.setSelectedVectorFeatures([O3]),c1=this.getPointFeatureScreenPoint(O3)||c1),(K2=(j2=this.callbacks).onFeatureInfo)==null||K2.call(j2,{feature:{id:((S2=O3.properties)==null?void 0:S2.id)||((T2=O3.properties)==null?void 0:T2.feature_id)||((C2=O3.properties)==null?void 0:C2.project_name),properties:O3.properties||{},feature:O3,layer:this.currentTopicLayer,lngLat:a},screen:c1}),(s3=(H2=this.callbacks).onLayerStatus)==null||s3.call(H2,{type:"success",text:"真实矢量要素已选中"});else{const M1=this.getTownNameFromMapEvent(e);if(this.handleTownRankingSelect(M1))return;this.clearSelectedFeature(),(p3=(m3=this.callbacks).onFeatureInfo)==null||p3.call(m3,{feature:null}),(b3=(G3=this.callbacks).onLayerStatus)==null||b3.call(G3,{type:"success",text:"当前点击位置无生态保护要素"})}return}const i=this.lngLatToWmsPixel(a);(o3=(Y3=this.callbacks).onFeatureInfo)==null||o3.call(Y3,{feature:null}),(b1=(n1=this.callbacks).onFeatureLoading)==null||b1.call(n1,!0);try{const $2=yield zf(this.currentTopicLayer,i,{size:l6,buffer:10}),O3=Yf($2),c1=O3?null:yield this.queryFallbackFeatureInfo(a),M1=O3||(c1==null?void 0:c1.feature);if(M1){const W1=yield this.enrichFeatureInfo(M1,i,a);this.showSelectedFeature(W1.feature||W1),(R1=(W3=this.callbacks).onFeatureInfo)==null||R1.call(W3,{feature:Z2(B2({},W1),{layer:(c1==null?void 0:c1.layer)||this.currentTopicLayer,lngLat:a}),screen:n})}else this.clearSelectedFeature(),($1=(D1=this.callbacks).onFeatureInfo)==null||$1.call(D1,{feature:null});M1||(x3=(h3=this.callbacks).onLayerStatus)==null||x3.call(h3,{type:"success",text:"当前点击位置无图斑"})}catch($2){this.clearSelectedFeature(),(h1=(R3=this.callbacks).onFeatureInfo)==null||h1.call(R3,{feature:null}),(_1=(C1=this.callbacks).onLayerStatus)==null||_1.call(C1,{type:"error",text:"图斑信息查询失败"})}finally{(l3=(o1=this.callbacks).onFeatureLoading)==null||l3.call(o1,!1)}})}handleCanvasBoundaryPointerDown(e){var a,i;if(!this.boundaryDrawingEnabled)return;const n=this.getLngLatFromCanvasEvent(e);n&&this.addBoundaryDrawPoint(n)&&(e.__analysisBoundaryHandled=!0),(a=e.preventDefault)==null||a.call(e),(i=e.stopPropagation)==null||i.call(e)}handleCanvasBoundaryDoubleClick(e){var a,i;if(!this.boundaryDrawingEnabled)return;const n=this.getLngLatFromCanvasEvent(e);(this.boundaryDrawPoints||[]).length<3&&n&&this.addBoundaryDrawPoint(n),(this.boundaryDrawPoints||[]).length>=3&&(this.finishBoundaryDrawing(),e.__analysisBoundaryHandled=!0),(a=e.preventDefault)==null||a.call(e),(i=e.stopPropagation)==null||i.call(e)}getLngLatFromCanvasEvent(e){var g,C,I;if(!((g=this.camera)!=null&&g.instance)||!this.focusMapGroup||!this.canvas)return null;const n=this.canvas.getBoundingClientRect();if(!n.width||!n.height)return null;const a=(C=this.interactionManager)==null?void 0:C.raycaster;if(!(a!=null&&a.setFromCamera))return null;const i={x:(e.clientX-n.left)/n.width*2-1,y:-((e.clientY-n.top)/n.height)*2+1};a.setFromCamera(i,this.camera.instance);const o=((I=a.intersectObjects(this.eventElement||[],!0)[0])==null?void 0:I.point)||this.getRayMapPlaneIntersection(a.ray);if(!o)return null;const s=this.focusMapGroup.worldToLocal(o.clone()),m=d6().center(this.geoProjectionCenter).scale(this.geoProjectionScale).translate([0,0]).invert([s.x,-s.y]);if(!m)return null;const h=Number(m[0]),p=Number(m[1]);return!Number.isFinite(h)||!Number.isFinite(p)?null:h