@aibee/crc-bmap 0.0.119 → 0.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +2 -2
- package/lib/bmap.esm.js +7 -7
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +2 -2
- package/lib/bmap.esm.min.js.map +2 -2
- package/lib/bmap.min.js +2 -2
- package/lib/bmap.min.js.map +2 -2
- package/package.json +1 -1
package/lib/bmap.min.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let l=0;l<i.count;l++){let u=i.getZ(l);u>r&&(r=u)}let s=new C.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new C.Color(this.options[0].fillColor)},uColor2:{value:new C.Color(pt(this.options[0].fillColor))},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{height:e,deltaHeight:r,geometry:i}=t,s=[],l=e+(r||0),{coords:u}=i;for(let a=0;a<u.length;a++){let c=u[a];for(let p=0;p<c.length;p++){let d=c[p],h=p+1===c.length?c[0]:c[p+1];s.push(new C.Vector3(d[0],d[1],l)),s.push(new C.Vector3(h[0],h[1],l))}}return s}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new C.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,ge.mergeGeometries)(t)}createBorder(){let t=new C.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new C.Mesh(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder()}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var mt=y("three"),yr={uuid:"",iconUrl:"",name:"",secondRotate:0,airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},qt=class extends mt.Object3D{constructor(t,e){super();this.context=t;this.options=ct({...yr,...e},this),this.init()}options;mesh;async init(){let{deltaHeight:t,airHeight:e,geometry:r,iconUrl:i,opacity:s}=this.options,l=K(r.coords[0],r.coords.slice(1)),u=new mt.ExtrudeGeometry(l,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4}),a=await this.context.materialFactory.createGroundTextureMaterial({url:i,opacity:s}),c=new mt.Mesh(u,a);this.mesh=c,this.mesh.position.z=e+t,this.add(c)}dispose(){this.mesh?.geometry.dispose(),this.clear()}};var st=y("three");var _r={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0},jt=class extends st.Object3D{constructor(t,e){super();this.context=t;this.options=Object.assign({},_r,e),this.loadModel()}model=null;options;async loadModel(){let t=await It(this.options.url);t.scene.rotation.set(Math.PI/2,Math.PI/2,0);let e=new st.Box3().setFromObject(t.scene),r=e.getSize(new st.Vector3),i=Math.max(r.x,r.y),s=this.options.width/i;this.scale.set(s,s,s),this.add(t.scene),this.position.copy(e.getCenter(new st.Vector3)),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t}dispose(){B(this),this.model=null}};var O=y("three");var me=y("three/examples/jsm/utils/BufferGeometryUtils"),En=y("three/examples/jsm/lines/line2"),bn=y("three/examples/jsm/lines/lineGeometry"),Yt=class extends O.Object3D{constructor(t,e){super();this.context=t;this.options=e;e.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(e=>{let r=K(e.geometry.coords[0],e.geometry.coords.slice(1));return new O.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4})});this.geometry=(0,me.mergeGeometries)(t),t.forEach(e=>e.dispose())}initMaterial(){let{fillColor:t,fillOpacity:e}=this.options[0],r=this.context.materialFactory.createMeshBasicMaterial({color:t,opacity:e});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:e,geometry:r}=t,i=[],s=e||0,{coords:l}=r;for(let u=0;u<l.length;u++){let a=l[u];for(let c=0;c<a.length;c++){let p=a[c],d=c+1===a.length?a[0]:a[c+1];i.push(new O.Vector3(p[0],p[1],s)),i.push(new O.Vector3(d[0],d[1],s))}}return i}initDoubleLine(){let t=this.options.filter(r=>r.double&&r.geometry.otherCoords?.[1]?.length);if(!t.length)return;let e=t.reduce((r,i)=>{let s=`${i.secondColor}-${i.dashed}`;return r[s]&&r[s].push(i),r[s]||(r[s]=[i]),r},{});Object.values(e).map(r=>{let i=this.context.materialFactory.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed});r.map(s=>{let l=new bn.LineGeometry,u=s.geometry.otherCoords[1].map(c=>[...c,0]).flat(2);l.setPositions(u);let a=new En.Line2(l,i);a.computeLineDistances(),a.position.z+=.001,this.add(a)})})}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new O.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,me.mergeGeometries)(t)}createBorder(){let t=new O.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new O.Mesh(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder(),this.initDoubleLine(),this.position.z+=.001+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var Mn=y("three"),Zt=class extends q{startPoint;endPoint;rect;frustum=new Mn.Frustum;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=ht(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),k(this.rect,0,0,0,0),n?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=n=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t)};onPointerUp=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let n=this.getSvgCoordinate(this.startPoint),t={...n};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let e={x:Math.min(n.x,t.x),y:Math.min(n.y,t.y)},r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);k(this.rect,e.x,e.y,r,i)}else k(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:e,clientHeight:r}}}=this,i=v(this.startPoint,t,e,r),s=v(this.endPoint,t,e,r),l={x:Math.min(i.x,s.x),y:Math.min(i.y,s.y)},u={x:Math.max(i.x,s.x),y:Math.max(i.y,s.y)},a=this.searchMapInFrustum(l,u);this.dispatchEvent({type:"selected",list:a})}}searchMapInFrustum(n,t){let{context:e}=this;return e.currentFloor?.graphicLayer.children.filter(r=>r instanceof I&&this.searchChildInFrustum(r,n,t))||[]}searchChildInFrustum(n,t,e){let{context:{camera:r,container:{clientWidth:i,clientHeight:s}}}=this;if(!n)return!1;if(!n.mesh){let d=n.getPosition();if(d){let h=v(d,r,i,s);return Tt(h,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let l=n.mesh.geometry.boundingBox;if(!l)return!1;let{min:u,max:a}=l,c=v(u,r,i,s),p=v(a,r,i,s);return!(!Tt(c,t,e)||!Tt(p,t,e))}dispose(){this.unRegistryEvent()}};var Kt=class extends Sn.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new Zt(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:e,offsetY:r}=t,{x:i,y:s}=this.downPoint;if(Math.sqrt((i-e)**2+(s-r)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(e,r),u=new Set(l.map(c=>c.options.id));this.context.getPoisByDeviceXy(e,r).forEach(c=>{if(!u.has(c.options.id)){let p=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;p&&p.options.geometry.type==="point"&&(l.push(p),u.add(c.options.id))}}),(Nt?t.metaKey:t.ctrlKey)||this._list.clear(),l.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{he(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{he(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(e=>{this._list.add(e)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};var wn=y("three");var $t=class extends wn.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new W;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:e,e:r})=>{let i=e.map(a=>this.context.currentFloor?.graphicLayer.graphicMap.get(a.options.id)).filter(a=>a&&a.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,l=new Set;if(i.length){let a,c=1e4;i.forEach(p=>{let d=e.find(m=>m.options.id===p.options.id),{x:h,y:f}=d.clientPos,_=Math.sqrt((h-r.offsetX)**2+(f-r.offsetY)**2);_<c&&(c=_,a=p)}),l.add(a)}l.size||t.forEach(a=>l.add(a)),l.forEach(a=>{if(this.graphicTimerMap.get(a)||this.curGraphics.has(a))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(a),this.graphicTimerMap.delete(a),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(a,c)}),this.graphicTimerMap.forEach((a,c)=>{l.has(c)||(this.timer.clearTimeout(a),this.graphicTimerMap.delete(c))});let u=this.curGraphics.size;this.curGraphics.forEach(a=>{l.has(a)||this.curGraphics.delete(a)}),u!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let e=this.context.container.getBoundingClientRect();(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};var Cn=y("three/examples/jsm/lines/LineMaterial"),P=y("three");function Tn(o){return`${o.x}-${o.y}-${o.z}`}var Jt=class{constructor(n){this.context=n}lineMaterialMap=new Map;meshStandardMaterialMap=new Map;meshBasicMaterialMap=new Map;shaderMaterialMap=new Map;groundTextureMaterialMap=new Map;line2MaterialMap=new Map;generateLineMaterialKey({color:n,opacity:t}){return`${n}-${t}`}createLineMaterial({color:n,opacity:t}){let e=this.generateLineMaterialKey({color:n,opacity:t});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let r=new P.LineBasicMaterial({color:new P.Color(n).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(e,r),r}createMeshStandardMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshStandardMaterialMap.has(e))return this.meshStandardMaterialMap.get(e);let r=new P.MeshStandardMaterial({color:new P.Color(n).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(e,r),r}createMeshBasicMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let r=new P.MeshBasicMaterial({color:n,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(e,r),r}createShaderMaterial({gradualColor:n,center:t,maxValue:e,opacity:r,direction:i,max:s,min:l}){let u=`${n.toString()}-${Tn(t)}-${e}-${r}-${Tn(i)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let a=`
|
|
27
|
+
`,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let l=0;l<i.count;l++){let u=i.getZ(l);u>r&&(r=u)}let s=new C.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new C.Color(this.options[0].fillColor)},uColor2:{value:new C.Color(pt(this.options[0].fillColor))},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{height:e,deltaHeight:r,geometry:i}=t,s=[],l=e+(r||0),{coords:u}=i;for(let a=0;a<u.length;a++){let c=u[a];for(let p=0;p<c.length;p++){let d=c[p],h=p+1===c.length?c[0]:c[p+1];s.push(new C.Vector3(d[0],d[1],l)),s.push(new C.Vector3(h[0],h[1],l))}}return s}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new C.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,ge.mergeGeometries)(t)}createBorder(){let t=new C.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new C.Mesh(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder()}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var mt=y("three"),yr={uuid:"",iconUrl:"",name:"",secondRotate:0,airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},qt=class extends mt.Object3D{constructor(t,e){super();this.context=t;this.options=ct({...yr,...e},this),this.init()}options;mesh;async init(){let{deltaHeight:t,airHeight:e,geometry:r,iconUrl:i,opacity:s}=this.options,l=K(r.coords[0],r.coords.slice(1)),u=new mt.ExtrudeGeometry(l,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4}),a=await this.context.materialFactory.createGroundTextureMaterial({url:i,opacity:s}),c=new mt.Mesh(u,a);this.mesh=c,this.mesh.position.z=e+t,this.add(c)}dispose(){this.mesh?.geometry.dispose(),this.clear()}};var st=y("three");var _r={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0},jt=class extends st.Object3D{constructor(t,e){super();this.context=t;this.options=Object.assign({},_r,e),this.loadModel()}model=null;options;async loadModel(){let t=await It(this.options.url);t.scene.rotation.set(Math.PI/2,Math.PI/2,0);let e=new st.Box3().setFromObject(t.scene),r=e.getSize(new st.Vector3),i=Math.max(r.x,r.y),s=this.options.width/i;this.scale.set(s,s,s),this.add(t.scene),this.position.copy(e.getCenter(new st.Vector3)),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t}dispose(){B(this),this.model=null}};var O=y("three");var me=y("three/examples/jsm/utils/BufferGeometryUtils.js"),En=y("three/examples/jsm/lines/line2.js"),bn=y("three/examples/jsm/lines/lineGeometry.js"),Yt=class extends O.Object3D{constructor(t,e){super();this.context=t;this.options=e;e.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(e=>{let r=K(e.geometry.coords[0],e.geometry.coords.slice(1));return new O.ExtrudeGeometry(r,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4})});this.geometry=(0,me.mergeGeometries)(t),t.forEach(e=>e.dispose())}initMaterial(){let{fillColor:t,fillOpacity:e}=this.options[0],r=this.context.materialFactory.createMeshBasicMaterial({color:t,opacity:e});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:e,geometry:r}=t,i=[],s=e||0,{coords:l}=r;for(let u=0;u<l.length;u++){let a=l[u];for(let c=0;c<a.length;c++){let p=a[c],d=c+1===a.length?a[0]:a[c+1];i.push(new O.Vector3(p[0],p[1],s)),i.push(new O.Vector3(d[0],d[1],s))}}return i}initDoubleLine(){let t=this.options.filter(r=>r.double&&r.geometry.otherCoords?.[1]?.length);if(!t.length)return;let e=t.reduce((r,i)=>{let s=`${i.secondColor}-${i.dashed}`;return r[s]&&r[s].push(i),r[s]||(r[s]=[i]),r},{});Object.values(e).map(r=>{let i=this.context.materialFactory.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed});r.map(s=>{let l=new bn.LineGeometry,u=s.geometry.otherCoords[1].map(c=>[...c,0]).flat(2);l.setPositions(u);let a=new En.Line2(l,i);a.computeLineDistances(),a.position.z+=.001,this.add(a)})})}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new O.BufferGeometry().setFromPoints(r)});this.lineGeometry=(0,me.mergeGeometries)(t)}createBorder(){let t=new O.LineSegments(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new O.Mesh(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder(),this.initDoubleLine(),this.position.z+=.001+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.clear()}};var Mn=y("three"),Zt=class extends q{startPoint;endPoint;rect;frustum=new Mn.Frustum;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=ht(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),k(this.rect,0,0,0,0),n?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=n=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t)};onPointerUp=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let n=this.getSvgCoordinate(this.startPoint),t={...n};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let e={x:Math.min(n.x,t.x),y:Math.min(n.y,t.y)},r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);k(this.rect,e.x,e.y,r,i)}else k(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:e,clientHeight:r}}}=this,i=v(this.startPoint,t,e,r),s=v(this.endPoint,t,e,r),l={x:Math.min(i.x,s.x),y:Math.min(i.y,s.y)},u={x:Math.max(i.x,s.x),y:Math.max(i.y,s.y)},a=this.searchMapInFrustum(l,u);this.dispatchEvent({type:"selected",list:a})}}searchMapInFrustum(n,t){let{context:e}=this;return e.currentFloor?.graphicLayer.children.filter(r=>r instanceof I&&this.searchChildInFrustum(r,n,t))||[]}searchChildInFrustum(n,t,e){let{context:{camera:r,container:{clientWidth:i,clientHeight:s}}}=this;if(!n)return!1;if(!n.mesh){let d=n.getPosition();if(d){let h=v(d,r,i,s);return Tt(h,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let l=n.mesh.geometry.boundingBox;if(!l)return!1;let{min:u,max:a}=l,c=v(u,r,i,s),p=v(a,r,i,s);return!(!Tt(c,t,e)||!Tt(p,t,e))}dispose(){this.unRegistryEvent()}};var Kt=class extends Sn.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new Zt(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:e,offsetY:r}=t,{x:i,y:s}=this.downPoint;if(Math.sqrt((i-e)**2+(s-r)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(e,r),u=new Set(l.map(c=>c.options.id));this.context.getPoisByDeviceXy(e,r).forEach(c=>{if(!u.has(c.options.id)){let p=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;p&&p.options.geometry.type==="point"&&(l.push(p),u.add(c.options.id))}}),(Nt?t.metaKey:t.ctrlKey)||this._list.clear(),l.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{he(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{he(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(e=>{this._list.add(e)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};var wn=y("three");var $t=class extends wn.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new W;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:e,e:r})=>{let i=e.map(a=>this.context.currentFloor?.graphicLayer.graphicMap.get(a.options.id)).filter(a=>a&&a.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,l=new Set;if(i.length){let a,c=1e4;i.forEach(p=>{let d=e.find(m=>m.options.id===p.options.id),{x:h,y:f}=d.clientPos,_=Math.sqrt((h-r.offsetX)**2+(f-r.offsetY)**2);_<c&&(c=_,a=p)}),l.add(a)}l.size||t.forEach(a=>l.add(a)),l.forEach(a=>{if(this.graphicTimerMap.get(a)||this.curGraphics.has(a))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(a),this.graphicTimerMap.delete(a),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(a,c)}),this.graphicTimerMap.forEach((a,c)=>{l.has(c)||(this.timer.clearTimeout(a),this.graphicTimerMap.delete(c))});let u=this.curGraphics.size;this.curGraphics.forEach(a=>{l.has(a)||this.curGraphics.delete(a)}),u!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let e=this.context.container.getBoundingClientRect();(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};var Cn=y("three/examples/jsm/lines/LineMaterial"),P=y("three");function Tn(o){return`${o.x}-${o.y}-${o.z}`}var Jt=class{constructor(n){this.context=n}lineMaterialMap=new Map;meshStandardMaterialMap=new Map;meshBasicMaterialMap=new Map;shaderMaterialMap=new Map;groundTextureMaterialMap=new Map;line2MaterialMap=new Map;generateLineMaterialKey({color:n,opacity:t}){return`${n}-${t}`}createLineMaterial({color:n,opacity:t}){let e=this.generateLineMaterialKey({color:n,opacity:t});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let r=new P.LineBasicMaterial({color:new P.Color(n).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(e,r),r}createMeshStandardMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshStandardMaterialMap.has(e))return this.meshStandardMaterialMap.get(e);let r=new P.MeshStandardMaterial({color:new P.Color(n).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(e,r),r}createMeshBasicMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let r=new P.MeshBasicMaterial({color:n,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(e,r),r}createShaderMaterial({gradualColor:n,center:t,maxValue:e,opacity:r,direction:i,max:s,min:l}){let u=`${n.toString()}-${Tn(t)}-${e}-${r}-${Tn(i)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let a=`
|
|
28
28
|
uniform vec3 uColor;
|
|
29
29
|
uniform vec3 uGradualColor;
|
|
30
30
|
uniform vec3 center;
|
|
@@ -3749,5 +3749,5 @@ three/build/three.module.js:
|
|
|
3749
3749
|
*/
|
|
3750
3750
|
`)}var A=y("three");var g=y("three"),F=class extends g.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new g.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(n){this.setGeometry(n,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(n){this.setPoints(n,this.widthCallback)}}})}};F.prototype.setMatrixWorld=function(o){this.matrixWorld=o};F.prototype.setGeometry=function(o,n){this._geometry=o,this.setPoints(o.getAttribute("position").array,n)};F.prototype.setPoints=function(o,n){if(!(o instanceof Float32Array)&&!(o instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=o,this.widthCallback=n,this.positions=[],this.counters=[],o.length&&o[0]instanceof g.Vector3)for(var t=0;t<o.length;t++){var e=o[t],r=t/o.length;this.positions.push(e.x,e.y,e.z),this.positions.push(e.x,e.y,e.z),this.counters.push(r),this.counters.push(r)}else for(var t=0;t<o.length;t+=3){var r=t/o.length;this.positions.push(o[t],o[t+1],o[t+2]),this.positions.push(o[t],o[t+1],o[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Er(o,n){var t=new g.Matrix4,e=new g.Ray,r=new g.Sphere,i=new g.Vector3,s=this.geometry;if(s.boundingSphere||s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(this.matrixWorld),o.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),e.copy(o.ray).applyMatrix4(t);var l=new g.Vector3,u=new g.Vector3,a=new g.Vector3,c=this instanceof g.LineSegments?2:1,p=s.index,d=s.attributes;if(p!==null)for(var h=p.array,f=d.position.array,_=d.width.array,m=0,w=h.length-1;m<w;m+=c){var R=h[m],S=h[m+1];l.fromArray(f,R*3),u.fromArray(f,S*3);var T=_[Math.floor(m/3)]!==void 0?_[Math.floor(m/3)]:1,tt=o.params.Line.threshold+this.material.lineWidth*T/2,Z=tt*tt,Mt=e.distanceSqToSegment(l,u,i,a);if(!(Mt>Z)){i.applyMatrix4(this.matrixWorld);var St=o.ray.origin.distanceTo(i);St<o.near||St>o.far||(n.push({distance:St,point:a.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}),m=w)}}}}F.prototype.raycast=Er;F.prototype.compareV3=function(o,n){var t=o*6,e=n*6;return this.positions[t]===this.positions[e]&&this.positions[t+1]===this.positions[e+1]&&this.positions[t+2]===this.positions[e+2]};F.prototype.copyV3=function(o){var n=o*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]};F.prototype.getDistance=function(o){let n=0;for(let t=0;t<o;t++){let e=6*t,r=new g.Vector3(this.positions[e],this.positions[e+1],this.positions[e+2]),i=new g.Vector3(this.positions[e+6],this.positions[e+7],this.positions[e+8]),s=r.distanceTo(i);n+=s}return n};F.prototype.process=function(){var o=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n;let t=this.getDistance(o-1);var e;this.compareV3(0,o-1)?e=this.copyV3(o-2):e=this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(var r=0;r<o;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(r/(o-1)):n=1,this.width.push(n),this.width.push(n),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===o-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let s=this.getDistance(r)/t;this.uvs.push(s,0),this.uvs.push(s,1)}if(r<o-1){e=this.copyV3(r),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(e=this.copyV3(r),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]))}this.compareV3(o-1,0)?e=this.copyV3(1):e=this.copyV3(o-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new g.BufferAttribute(new Float32Array(this.positions),3),previous:new g.BufferAttribute(new Float32Array(this.previous),3),next:new g.BufferAttribute(new Float32Array(this.next),3),side:new g.BufferAttribute(new Float32Array(this.side),1),width:new g.BufferAttribute(new Float32Array(this.width),1),uv:new g.BufferAttribute(new Float32Array(this.uvs),2),index:new g.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new g.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function ve(o,n,t,e,r){var i;if(o=o.subarray||o.slice?o:o.buffer,t=t.subarray||t.slice?t:t.buffer,o=n?o.subarray?o.subarray(n,r&&n+r):o.slice(n,r&&n+r):o,t.set)t.set(o,e);else for(i=0;i<o.length;i++)t[i+e]=o[i];return t}F.prototype.advance=function(o){var n=this._attributes.position.array,t=this._attributes.previous.array,e=this._attributes.next.array,r=n.length;ve(n,0,t,0,r),ve(n,6,n,0,r-6),n[r-6]=o.x,n[r-5]=o.y,n[r-4]=o.z,n[r-3]=o.x,n[r-2]=o.y,n[r-1]=o.z,ve(n,6,e,0,r-6),e[r-6]=o.x,e[r-5]=o.y,e[r-4]=o.z,e[r-3]=o.x,e[r-2]=o.y,e[r-1]=o.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};g.ShaderChunk.meshline_vert=["",g.ShaderChunk.logdepthbuf_pars_vertex,g.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",g.ShaderChunk.logdepthbuf_vertex,g.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",g.ShaderChunk.fog_vertex,"}"].join(`
|
|
3751
3751
|
`);g.ShaderChunk.meshline_frag=["",g.ShaderChunk.fog_pars_fragment,g.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",g.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",g.ShaderChunk.fog_fragment,"}"].join(`
|
|
3752
|
-
`);var bt=class extends g.ShaderMaterial{constructor(n){super({uniforms:Object.assign({},g.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new g.Color(16777215)},opacity:{value:1},resolution:{value:new g.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new g.Vector2(1,1)}}),vertexShader:g.ShaderChunk.meshline_vert,fragmentShader:g.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(n)}};bt.prototype.copy=function(o){return g.ShaderMaterial.prototype.copy.call(this,o),this.lineWidth=o.lineWidth,this.map=o.map,this.useMap=o.useMap,this.alphaMap=o.alphaMap,this.useAlphaMap=o.useAlphaMap,this.color.copy(o.color),this.opacity=o.opacity,this.resolution.copy(o.resolution),this.sizeAttenuation=o.sizeAttenuation,this.dashArray.copy(o.dashArray),this.dashOffset.copy(o.dashOffset),this.dashRatio.copy(o.dashRatio),this.useDash=o.useDash,this.visibility=o.visibility,this.alphaTest=o.alphaTest,this.repeat.copy(o.repeat),this};var Fn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var Un={texture_url:Fn,lineWidth:8,color:16777215},ie=class extends A.Object3D{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},Un,e),this.registryEvent()}mesh=null;geometry=null;material=null;texture=null;config=Un;points=[];basicRepeat=1;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate)}onControlChange=()=>{this.changeRepeat()};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:r,height:i}}}}}=this,s=t.map(([u,a])=>v(new A.Vector3(u,a,0),e,r,i)).map(({x:u,y:a})=>[u,a]);return Ct(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new A.Vector2(t,1)}loadTexture(t){return new Promise((e,r)=>{new A.TextureLoader().load(t,e,void 0,r)})}transformPoints(t){let e=[];for(let r=0;r<t.length;r++)e.push(...t[r],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}async create(t){let e=this.geometry=new F;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=A.RepeatWrapping}let r=this.material=new bt({useMap:!0,color:new A.Color(this.config.color),transparent:!0,resolution:new A.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:A.NormalBlending,repeat:new A.Vector2(this.getRepeat(),1)}),i=this.mesh=new A.Mesh(e,r);return this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var oe=y("@tweenjs/tween.js"),Mr={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0},Gn=class extends j{path=null;worker=_e();fetchRoadStatus=!1;uniqueKey=new ft;paths=[];options;pathTween=new oe.Group;startPoi=null;animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},Mr,e);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&xt(this.worker,"load_road",{url:`${r||location.origin}${i}?project=${t}`,...s}).then(l=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:l})}).catch(l=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",l)})}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor)}onUpdate=()=>{this.pathTween.update()};async setRoadData(n){this.fetchRoadStatus=!1,this.dispatchEvent({type:"fetch-road-status",status:!1}),await xt(this.worker,"set_road_info",n),this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0})}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.pathTween.getAll().forEach(n=>n.stop()),this.pathTween.removeAll())}onSwitchFloor=({data:{curFloor:n}})=>{if(this.paths.length){let t=this.paths.find(e=>e.floor===n.name);t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};getDirectionPath(n){return xt(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(r=>r.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let r=()=>{this.bmap.removeEventListener("center-change",r),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",r)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(r=>[r[0]-t,r[1]-e])}getPath(n,t,e=""){return new Promise((r,i)=>{let s=()=>{xt(this.worker,"get_path",{start:n,end:t,type:e}).then(l=>{l?typeof l=="string"?i(l):r(l):i("no-path")})};if(this.fetchRoadStatus)s();else{let l=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",l),s())};this.addEventListener("fetch-road-status",l)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(t):(this.path=new ie(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+1,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.startPoi.dispose(),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=this.bmap.context.currentFloor?.addPoi({...this.options.startPoi,position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null)}catmullRomCurve3(n){return je(n,!1,!0,.1,150,2.5)}async animationTo(n,t=this.options.speed){if(n.floor!==this.bmap.context.currentFloor?.name||!this.path)return;let{animationPathOptions:{cPathIndex:e}}=this,r=[this.path.points[0],...this.cPath.slice(e+1)],i=this.translatePoints([n.pos])[0],{distance:s,pos:l,index:u}=r.reduce((f,_,m,w)=>{if(m===w.length-1)return f;let{distance:R,closestPoint:S}=Ye(i,_,w[m+1]);return R<f.distance&&(f.distance=R,f.pos=S,f.index=m),f},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===l[0]&&this.path.points[0][1]===l[1])return;let a=0,c=[];if(u===0)a=D(r[0],l),c=[a];else{c=[D(r[0],r[1])];for(let f=1;f<u;f++)c.push(D(r[f],r[f+1]));c.push(D(r[u],l)),a=c.reduce((f,_)=>f+_,0)}let p=this.kmPerHourToMetersPerSecond(t),d=a/p;this.pathTween.getAll().forEach(f=>f.stop()),this.pathTween.removeAll();let h={distance:0};return new Promise(f=>{let _=new oe.Tween(h,this.pathTween).to({distance:a},d*1e3).onUpdate(()=>{for(let m=0;m<c.length;m++){let w=c.slice(0,m+1).reduce((R,S)=>R+S,0);if(w>=h.distance){let R=w-c[m],S=h.distance-R,T=r[m],tt=r[m+1],Z=Ze(T,tt,S);this.path?.updatePoints([Z,...r.slice(m+1)]),this.animationPathOptions.cPathIndex+=m,this.startPoi&&this.startPoi.position.setX(Z[0]).setY(Z[1]),this.dispatchEvent({type:"path-animation"});return}}}).onComplete(()=>{this.pathTween.remove(_),this.dispatchEvent({type:"path-animation-end"}),f(!0)}).start()})}kmPerHourToMetersPerSecond(n){return n*1e3/3600}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var Bn=class extends j{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=V(n);if(this.cacheData.has(t))return this.cacheData.get(t);console.time("floor/get\u8BF7\u6C42"+n.resource_type_list);let[,e]=await Promise.all([this.loadBuildGround(n),ne(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let r=V({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===V(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,r=e.userData.legacyToGraphicMap,i=e.userData.graphicMap,s=[];for(let l of n){if(l.info.group==="ground")e.createGround(l.info);else{let u=e.addGraphic(l.info);u.userData.data=l,r.set(l.legacy_id,u),s.push(u)}i.set(l.element_uuid,l)}this.bmap.triggerHooks("switch_floor_before",{curFloor:e,graphics:s}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:e,graphics:s})}else{let e=V(t),{curFloor:r,graphics:i}=this.bmap.createFloor(n);r.name=t.floor,r.key=e;let s=new Map;n.forEach(l=>{s.set(l.element_uuid,l)}),r.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:r,graphics:i}),this.bmap.context.switchFloor(r),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:r,graphics:i})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(r=>!e.has(r.element_uuid))}async switchFloorByStoreData(n){let t=await this.load({...n,resource_type_list:"6"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async switchFloorByOtherData(n){let t=await this.load({...n,resource_type_list:"1,2,3,4"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async loadBuildGround({brand:n,project:t}){let e=V({brand:n,project:t});return await this.bmap.loadBuildingGround({brand:n,project:t}),this.bmap.currentBuildGround=this.bmap.buildingGroundMap.get(e)||null,this.bmap.currentBuildGround}async changeFloor(n){return await Promise.all([this.switchFloorByStoreData(n),this.switchFloorByOtherData(n)]),Array.from(this.bmap.context.currentFloor.userData.graphicMap.values())}};var kn=y("three"),zn=class extends j{poiLayer;floors=[];group=new kn.Group;constructor(n){super(n),this.poiLayer=new gt(n.context)}show(n){let t=n[0].userData.height;n.forEach(i=>{i.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),i.poiLayer.pois.length=0,i.poiLayer.dispose(),i.position.z=t,t+=i.userData.height});let{scene:e,currentFloor:r}=this.bmap.context;r&&(e.remove(r),r.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n}hide(){let{scene:n}=this.bmap.context;n.remove(this.group),this.poiLayer.clear(!0),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:n,config:t,type:e}=this.bmap;n.cameraBound.setEnable(!1),n.control.minZoom=0,n.control.maxZoom=1/0,n.camera.zoom=1,n.setAzimuthalAngle(t.control.defaultAzimuthal,0),n.setPolarAngle(t.control.defaultPolar,0),n.fitCameraToObject(this.group,void 0,0);let r=n.camera.zoom;n.control.minZoom=r,n.control.maxZoom=r*25,e==="3d"&&n.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=n.camera.zoom,n.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),n.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(n=>n.dispose()),this.floors=[]}};var H;function Vn(o="aibee_map"){return new Promise((n,t)=>{if(H)return n({db:H,type:"success"});let e=indexedDB.open(o);e.onupgradeneeded=function(r){H=r.target.result,console.log("onupgradeneeded"),n({db:H,type:"onupgradeneeded"})},e.onsuccess=r=>{H=r.target.result,n({db:H,type:"success"})},e.onerror=r=>{t(r)}})}function Hn(o,n,t=H){return new Promise((e,r)=>{t||r("\u6CA1\u6709db");let s=t.transaction([o],"readonly").objectStore(o).get(n);s.onsuccess=()=>{s.result?e(s.result.value):e(null)},s.onerror=l=>{console.log("[getVersionByKey]",l),e(null)}})}function Wn(o,n,t,e=H){return new Promise((r,i)=>(e||i("\u6CA1\u6709db"),new Promise((s,l)=>{let a=e.transaction([o],"readwrite").objectStore(o).add({key:n,value:t});a.onsuccess=function(c){s(c)},a.onerror=function(c){l(c)}})))}function se(o,n=H){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function Xn(){H?.close(),H=null}function Q(o,n,t=0){o.forEach(e=>{e.geometry.coords=JSON.parse(JSON.stringify(e.geometry.cds)),e.geometry.type==="polygon"?(e.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(r=>r.map(i=>yt(i,n))))):e.geometry.coords=yt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let r=o[e];r.deltaHeight=1e-5*(t+e+1)}}function yt(o,n){return[o[0]-n[0],o[1]-n[1]]}var Fl={loadRoadNetwork:!1},ae="version",xe="map_data",le="road_network_data",qn=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await Vn();t==="onupgradeneeded"&&(se(ae),se(xe),se(le))}catch(n){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",n)}}async load(n){if(this.clear(),Array.isArray(n))this.floors=n;else{let t=await fetch(n).then(e=>e.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(n,t,e){return Wn(n,`${t}`,e)}getCacheData(n,t){return Hn(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(r=>r.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(ae,e)===t.version_id){let i=await this.getCacheData(xe,e);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch{return this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(n){let t=this.getFloorCacheKey(n);console.time("zstd_json");let e=await fetch(n.map_url).then(r=>r.json());return console.timeEnd("zstd_json"),this.setCacheData(xe,t,e),this.setCacheData(ae,t,n.version_id),this.getDataByJson(e)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(ae,e)===t.version_id){let s=await this.getCacheData(le,e);if(s)return s}let i=await fetch(t.route_url).then(s=>s.json());return await this.setCacheData(le,e,i),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return await this.setCacheData(le,e,r),r}}))).filter(t=>t.points)}async getOtherDataByFreeTime(){}async getMulFloorsData(n){return Promise.all(n.map(t=>this.getFloorData(t))).then(t=>t.filter(e=>e))}async getDataByUrl(n){let t=await fetch(n).then(e=>e.json());return this.getDataByJson(t)}getDataByJson(n){let t=new J(this.bmap.context),e=[0,0];return n.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];e=[i.center_x,i.center_y];break;case"graph":let s=[],l=new Map;Q(r.elements,e),r.elements.forEach(h=>{if(h.group==="ground")t.createGround(h);else{let f=t.addGraphic(h);s.push(f),l.set(h.id,f)}}),t.userData.graphics=s,t.userData.graphicMap=l;break;case"ground":Q(r.elements,e);let u=r.elements.map(h=>new I(this.bmap.context,h));t.addGrounds(u);break;case"wall":Q(r.elements,e);let a=r.elements.reduce((h,f)=>{let{fillColor:_,fillOpacity:m,strokeColor:w,strokeOpacity:R}=f,S=`${_}-${m}-${w}-${R}`;return h[S]?h[S].push(f):h[S]=[f],h},{});Object.values(a).forEach(h=>{let f=new Xt(this.bmap.context,h);t.wallLayer.add(f)});break;case"lane":Q(r.elements,e);let c=r.elements.reduce((h,f)=>{let{fillColor:_,fillOpacity:m,strokeColor:w,strokeOpacity:R}=f,S=`${_}-${m}-${w}-${R}`;return h[S]?h[S].push(f):h[S]=[f],h},{});Object.values(c).forEach(h=>{let f=new Yt(this.bmap.context,h);t.laneLayer.add(f)});break;case"texture2d":case"texture3d":Q(r.elements,e),r.elements.forEach(h=>{let f=new qt(this.bmap.context,h);t.textureLayer.add(f)});break;case"glb":Q(r.elements,e),r.elements.forEach(h=>{let f=new jt(this.bmap.context,{...h,url:h.secondUrl,rotate:h.secondRotate,width:h.secondWidth});t.glbModelLayer.add(f)});break;case"store":r.elements.map(h=>{let f=yt([h.center_x,h.center_y],e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"facility":r.elements.map(h=>{let f=yt(h.geometry.cds,e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"parkingSpace":Q(r.elements,e);let p=[],d=new Map;r.elements.forEach(h=>{let f=t.addGraphic(h);p.push(f),d.set(h.id,f);let _=yt([h.center_x,h.center_y],e);t.poiLayer.createPoi({texts:[{text:h.poi_info.name}],position:{x:_[0],y:_[1],z:h.airHeight}})}),t.userData.parkingSpaces=p,t.userData.parkingSpacesGraphicMap=d;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t}clear(){}dispose(){this.clear(),Xn()}};})();
|
|
3752
|
+
`);var bt=class extends g.ShaderMaterial{constructor(n){super({uniforms:Object.assign({},g.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new g.Color(16777215)},opacity:{value:1},resolution:{value:new g.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new g.Vector2(1,1)}}),vertexShader:g.ShaderChunk.meshline_vert,fragmentShader:g.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(n)}};bt.prototype.copy=function(o){return g.ShaderMaterial.prototype.copy.call(this,o),this.lineWidth=o.lineWidth,this.map=o.map,this.useMap=o.useMap,this.alphaMap=o.alphaMap,this.useAlphaMap=o.useAlphaMap,this.color.copy(o.color),this.opacity=o.opacity,this.resolution.copy(o.resolution),this.sizeAttenuation=o.sizeAttenuation,this.dashArray.copy(o.dashArray),this.dashOffset.copy(o.dashOffset),this.dashRatio.copy(o.dashRatio),this.useDash=o.useDash,this.visibility=o.visibility,this.alphaTest=o.alphaTest,this.repeat.copy(o.repeat),this};var Fn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var Un={texture_url:Fn,lineWidth:8,color:16777215},ie=class extends A.Object3D{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},Un,e),this.registryEvent()}mesh=null;geometry=null;material=null;texture=null;config=Un;points=[];basicRepeat=1;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate)}onControlChange=()=>{this.changeRepeat()};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:r,height:i}}}}}=this,s=t.map(([u,a])=>v(new A.Vector3(u,a,0),e,r,i)).map(({x:u,y:a})=>[u,a]);return Ct(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new A.Vector2(t,1)}loadTexture(t){return new Promise((e,r)=>{new A.TextureLoader().load(t,e,void 0,r)})}transformPoints(t){let e=[];for(let r=0;r<t.length;r++)e.push(...t[r],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}async create(t){let e=this.geometry=new F;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=A.RepeatWrapping}let r=this.material=new bt({useMap:!0,color:new A.Color(this.config.color),transparent:!0,resolution:new A.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:A.NormalBlending,repeat:new A.Vector2(this.getRepeat(),1)}),i=this.mesh=new A.Mesh(e,r);return this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var oe=y("@tweenjs/tween.js"),Mr={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0},Gn=class extends j{path=null;worker=_e();fetchRoadStatus=!1;uniqueKey=new ft;paths=[];options;pathTween=new oe.Group;startPoi=null;animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},Mr,e);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&xt(this.worker,"load_road",{url:`${r||location.origin}${i}?project=${t}`,...s}).then(l=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:l})}).catch(l=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",l)})}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor)}onUpdate=()=>{this.pathTween.update()};async setRoadData(n){this.fetchRoadStatus=!1,this.dispatchEvent({type:"fetch-road-status",status:!1}),await xt(this.worker,"set_road_info",n),this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0})}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.pathTween.getAll().forEach(n=>n.stop()),this.pathTween.removeAll())}onSwitchFloor=({data:{curFloor:n}})=>{if(this.paths.length){let t=this.paths.find(e=>e.floor===n.name);t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};getDirectionPath(n){return xt(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(r=>r.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let r=()=>{this.bmap.removeEventListener("center-change",r),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",r)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(r=>[r[0]-t,r[1]-e])}getPath(n,t,e=""){return new Promise((r,i)=>{let s=()=>{xt(this.worker,"get_path",{start:n,end:t,type:e}).then(l=>{l?typeof l=="string"?i(l):r(l):i("no-path")})};if(this.fetchRoadStatus)s();else{let l=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",l),s())};this.addEventListener("fetch-road-status",l)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(t):(this.path=new ie(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+1,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.startPoi.dispose(),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=this.bmap.context.currentFloor?.addPoi({...this.options.startPoi,position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null)}catmullRomCurve3(n){return je(n,!1,!0,.1,150,2.5)}async animationTo(n,t=this.options.speed){if(n.floor!==this.bmap.context.currentFloor?.name||!this.path)return;let{animationPathOptions:{cPathIndex:e}}=this,r=[this.path.points[0],...this.cPath.slice(e+1)],i=this.translatePoints([n.pos])[0],{distance:s,pos:l,index:u}=r.reduce((f,_,m,w)=>{if(m===w.length-1)return f;let{distance:R,closestPoint:S}=Ye(i,_,w[m+1]);return R<f.distance&&(f.distance=R,f.pos=S,f.index=m),f},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===l[0]&&this.path.points[0][1]===l[1])return;let a=0,c=[];if(u===0)a=D(r[0],l),c=[a];else{c=[D(r[0],r[1])];for(let f=1;f<u;f++)c.push(D(r[f],r[f+1]));c.push(D(r[u],l)),a=c.reduce((f,_)=>f+_,0)}let p=this.kmPerHourToMetersPerSecond(t),d=a/p;this.pathTween.getAll().forEach(f=>f.stop()),this.pathTween.removeAll();let h={distance:0};return new Promise(f=>{let _=new oe.Tween(h,this.pathTween).to({distance:a},d*1e3).onUpdate(()=>{for(let m=0;m<c.length;m++){let w=c.slice(0,m+1).reduce((R,S)=>R+S,0);if(w>=h.distance){let R=w-c[m],S=h.distance-R,T=r[m],tt=r[m+1],Z=Ze(T,tt,S);this.path?.updatePoints([Z,...r.slice(m+1)]),this.animationPathOptions.cPathIndex+=m,this.startPoi&&this.startPoi.position.setX(Z[0]).setY(Z[1]),this.dispatchEvent({type:"path-animation"});return}}}).onComplete(()=>{this.pathTween.remove(_),this.dispatchEvent({type:"path-animation-end"}),f(!0)}).start()})}kmPerHourToMetersPerSecond(n){return n*1e3/3600}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var Bn=class extends j{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=V(n);if(this.cacheData.has(t))return this.cacheData.get(t);console.time("floor/get\u8BF7\u6C42"+n.resource_type_list);let[,e]=await Promise.all([this.loadBuildGround(n),ne(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let r=V({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===V(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,r=e.userData.legacyToGraphicMap,i=e.userData.graphicMap,s=[];for(let l of n){if(l.info.group==="ground")e.createGround(l.info);else{let u=e.addGraphic(l.info);u.userData.data=l,r.set(l.legacy_id,u),s.push(u)}i.set(l.element_uuid,l)}this.bmap.triggerHooks("switch_floor_before",{curFloor:e,graphics:s}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:e,graphics:s})}else{let e=V(t),{curFloor:r,graphics:i}=this.bmap.createFloor(n);r.name=t.floor,r.key=e;let s=new Map;n.forEach(l=>{s.set(l.element_uuid,l)}),r.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:r,graphics:i}),this.bmap.context.switchFloor(r),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:r,graphics:i})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(r=>!e.has(r.element_uuid))}async switchFloorByStoreData(n){let t=await this.load({...n,resource_type_list:"6"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async switchFloorByOtherData(n){let t=await this.load({...n,resource_type_list:"1,2,3,4"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async loadBuildGround({brand:n,project:t}){let e=V({brand:n,project:t});return await this.bmap.loadBuildingGround({brand:n,project:t}),this.bmap.currentBuildGround=this.bmap.buildingGroundMap.get(e)||null,this.bmap.currentBuildGround}async changeFloor(n){return await Promise.all([this.switchFloorByStoreData(n),this.switchFloorByOtherData(n)]),Array.from(this.bmap.context.currentFloor.userData.graphicMap.values())}};var kn=y("three"),zn=class extends j{poiLayer;floors=[];group=new kn.Group;constructor(n){super(n),this.poiLayer=new gt(n.context)}show(n){let t=n[0].userData.height;n.forEach(i=>{i.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),i.poiLayer.pois.length=0,i.poiLayer.dispose(),i.position.z=t,t+=i.userData.height});let{scene:e,currentFloor:r}=this.bmap.context;r&&(e.remove(r),r.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n}hide(){let{scene:n}=this.bmap.context;n.remove(this.group),this.poiLayer.clear(!0),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:n,config:t,type:e}=this.bmap;n.cameraBound.setEnable(!1),n.control.minZoom=0,n.control.maxZoom=1/0,n.camera.zoom=1,n.setAzimuthalAngle(t.control.defaultAzimuthal,0),n.setPolarAngle(t.control.defaultPolar,0),n.fitCameraToObject(this.group,void 0,0);let r=n.camera.zoom;n.control.minZoom=r,n.control.maxZoom=r*25,e==="3d"&&n.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=n.camera.zoom,n.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),n.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(n=>n.dispose()),this.floors=[]}};var H;function Vn(o="aibee_map"){return new Promise((n,t)=>{if(H)return n({db:H,type:"success"});let e=indexedDB.open(o);e.onupgradeneeded=function(r){H=r.target.result,console.log("onupgradeneeded"),n({db:H,type:"onupgradeneeded"})},e.onsuccess=r=>{H=r.target.result,n({db:H,type:"success"})},e.onerror=r=>{t(r)}})}function Hn(o,n,t=H){return new Promise((e,r)=>{t||r("\u6CA1\u6709db");let s=t.transaction([o],"readonly").objectStore(o).get(n);s.onsuccess=()=>{s.result?e(s.result.value):e(null)},s.onerror=l=>{console.log("[getVersionByKey]",l),e(null)}})}function Wn(o,n,t,e=H){return new Promise((r,i)=>(e||i("\u6CA1\u6709db"),new Promise((s,l)=>{let a=e.transaction([o],"readwrite").objectStore(o).add({key:n,value:t});a.onsuccess=function(c){s(c)},a.onerror=function(c){l(c)}})))}function se(o,n=H){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function Xn(){H?.close(),H=null}function Q(o,n,t=0){o.forEach(e=>{e.geometry.coords=JSON.parse(JSON.stringify(e.geometry.cds)),e.geometry.type==="polygon"?(e.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(r=>r.map(i=>yt(i,n))))):e.geometry.coords=yt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let r=o[e];r.deltaHeight=1e-5*(t+e+1)}}function yt(o,n){return[o[0]-n[0],o[1]-n[1]]}var Ol={loadRoadNetwork:!1},ae="version",xe="map_data",le="road_network_data",qn=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await Vn();t==="onupgradeneeded"&&(se(ae),se(xe),se(le))}catch(n){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",n)}}async load(n){if(this.clear(),Array.isArray(n))this.floors=n;else{let t=await fetch(n).then(e=>e.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(n,t,e){return Wn(n,`${t}`,e)}getCacheData(n,t){return Hn(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(r=>r.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(ae,e)===t.version_id){let i=await this.getCacheData(xe,e);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch{return this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(n){let t=this.getFloorCacheKey(n);console.time("zstd_json");let e=await fetch(n.map_url).then(r=>r.json());return console.timeEnd("zstd_json"),this.setCacheData(xe,t,e),this.setCacheData(ae,t,n.version_id),this.getDataByJson(e)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(ae,e)===t.version_id){let s=await this.getCacheData(le,e);if(s)return s}let i=await fetch(t.route_url).then(s=>s.json());return await this.setCacheData(le,e,i),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return await this.setCacheData(le,e,r),r}}))).filter(t=>t.points)}async getOtherDataByFreeTime(){}async getMulFloorsData(n){return Promise.all(n.map(t=>this.getFloorData(t))).then(t=>t.filter(e=>e))}async getDataByUrl(n){let t=await fetch(n).then(e=>e.json());return this.getDataByJson(t)}getDataByJson(n){let t=new J(this.bmap.context),e=[0,0];return n.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];e=[i.center_x,i.center_y];break;case"graph":let s=[],l=new Map;Q(r.elements,e),r.elements.forEach(h=>{if(h.group==="ground")t.createGround(h);else{let f=t.addGraphic(h);s.push(f),l.set(h.id,f)}}),t.userData.graphics=s,t.userData.graphicMap=l;break;case"ground":Q(r.elements,e);let u=r.elements.map(h=>new I(this.bmap.context,h));t.addGrounds(u);break;case"wall":Q(r.elements,e);let a=r.elements.reduce((h,f)=>{let{fillColor:_,fillOpacity:m,strokeColor:w,strokeOpacity:R}=f,S=`${_}-${m}-${w}-${R}`;return h[S]?h[S].push(f):h[S]=[f],h},{});Object.values(a).forEach(h=>{let f=new Xt(this.bmap.context,h);t.wallLayer.add(f)});break;case"lane":Q(r.elements,e);let c=r.elements.reduce((h,f)=>{let{fillColor:_,fillOpacity:m,strokeColor:w,strokeOpacity:R}=f,S=`${_}-${m}-${w}-${R}`;return h[S]?h[S].push(f):h[S]=[f],h},{});Object.values(c).forEach(h=>{let f=new Yt(this.bmap.context,h);t.laneLayer.add(f)});break;case"texture2d":case"texture3d":Q(r.elements,e),r.elements.forEach(h=>{let f=new qt(this.bmap.context,h);t.textureLayer.add(f)});break;case"glb":Q(r.elements,e),r.elements.forEach(h=>{let f=new jt(this.bmap.context,{...h,url:h.secondUrl,rotate:h.secondRotate,width:h.secondWidth});t.glbModelLayer.add(f)});break;case"store":r.elements.map(h=>{let f=yt([h.center_x,h.center_y],e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"facility":r.elements.map(h=>{let f=yt(h.geometry.cds,e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"parkingSpace":Q(r.elements,e);let p=[],d=new Map;r.elements.forEach(h=>{let f=t.addGraphic(h);p.push(f),d.set(h.id,f);let _=yt([h.center_x,h.center_y],e);t.poiLayer.createPoi({texts:[{text:h.poi_info.name}],position:{x:_[0],y:_[1],z:h.airHeight}})}),t.userData.parkingSpaces=p,t.userData.parkingSpacesGraphicMap=d;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t}clear(){}dispose(){this.clear(),Xn()}};})();
|
|
3753
3753
|
//# sourceMappingURL=bmap.min.js.map
|