@mappedin/maplibre-overlay 6.0.1-beta.54 → 6.0.1-beta.55
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/esm/{GLTFExporter-CVG4TSMU.js → GLTFExporter-R6F7IFS2.js} +1 -1
- package/lib/esm/{GLTFLoader-N7FATKQH.js → GLTFLoader-NEDVOJZ7.js} +1 -1
- package/lib/esm/{chunk-MSQIQNNK.js → chunk-BJJSORNB.js} +1 -1
- package/lib/esm/{chunk-MY2QYVOC.js → chunk-FWRW5PDC.js} +1 -1
- package/lib/esm/chunk-JL7KYJFU.js +1 -0
- package/lib/esm/{chunk-DZU6L3QB.js → chunk-V373UAUS.js} +1 -1
- package/lib/esm/{chunk-DMDOMXWY.js → chunk-VXAB6NBV.js} +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/{outdoor-context-v5-H6GAWAMZ.js → outdoor-context-v5-SDXFT2FP.js} +1 -1
- package/lib/esm/{text3d-FS4EQ4SH.js → text3d-242FO3DA.js} +1 -1
- package/package.json +4 -4
- package/lib/esm/chunk-3N4I2ZNL.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as oe,j as ke}from"./chunk-FWRW5PDC.js";import{$ as ue,I as B,Q as h,R as se,T as ae,V as S,W as R,Y as Ne,aa as _e,cb as q,qa as Ge}from"./chunk-BJJSORNB.js";import{a as l,b as m}from"./chunk-V373UAUS.js";import{c as o,i as s,j as T,k as D,l as P}from"./chunk-CU2O7JF6.js";l();var ce=class ce{constructor(){s(this,"_subscribers",{});s(this,"_destroyed",!1)}publish(e,t){!this._subscribers||!this._subscribers[e]||this._destroyed||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){(!this._subscribers||this._destroyed)&&(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null||this._destroyed)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._destroyed=!0,this._subscribers={}}};o(ce,"PubSub");var le=ce;l();l();var me="[MappedinJS]";function et(r="",{prefix:e=me}={}){let t="".concat(e).concat(r?"-".concat(r):""),n=o((i,a)=>{if(typeof window<"u"&&window.rnDebug){let u=a.map(c=>c instanceof Error&&c.stack?"".concat(c.message,"\n").concat(c.stack):c);window.rnDebug("".concat(r," ").concat(i,": ").concat(u.join(" ")))}},"rnDebug");return{logState:m.env.NODE_ENV==="test"?3:0,log(...i){this.logState<=0&&(console.log(t,...i),n("log",i))},warn(...i){this.logState<=1&&(console.warn(t,...i),n("warn",i))},error(...i){this.logState<=2&&(console.error(t,...i),n("error",i))},assert(...i){console.assert(...i)},time(i){console.time(i)},timeEnd(i){console.timeEnd(i)},setLevel(i){0<=i&&i<=3&&(this.logState=i)}}}o(et,"createLogger");var tt=et();var k=tt;l();function rt(r,e){return"".concat(e," ").concat(r)}o(rt,"formatMessage");var fe=class fe extends Error{constructor(e,t=me){super(rt(e,t)),this.name="MappedinError"}};o(fe,"MappedinError");var Y=fe;l();l();var pe=class pe extends Error{};o(pe,"InvalidTokenError");var de=pe;de.prototype.name="InvalidTokenError";l();var N=63710088e-1;l();function nt(r,e,t,n){return(r<e||r>t)&&k.warn(n),Math.min(t,Math.max(e,r))}o(nt,"clampWithWarning");l();function it(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}o(it,"arraysEqual");function J(r){return r*(Math.PI/180)}o(J,"toRadians");function sr(r,e){let t=Math.pow(10,e);return Math.sign(r)*Math.round(Math.abs(r)*t)/t}o(sr,"round");function Fe(r,e){return(r%e+e)%e}o(Fe,"euclideanModulo");function ar([r,e],[t,n]){let i=J(n-e),a=J(t-r),u=J(e),c=J(n),f=Math.sin(i/2)*Math.sin(i/2)+Math.sin(a/2)*Math.sin(a/2)*Math.cos(u)*Math.cos(c),d=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return N*d}o(ar,"haversineDistance");function ur(r,e){let t=Fe(r,Math.PI*2),n=Fe(e,Math.PI*2),i=n-t,a=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:t,end:a}}o(ur,"shortestTweenRotation");function ot(r){return r instanceof q?Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y):Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&Number.isFinite(r.min.z)&&Number.isFinite(r.max.z)}o(ot,"isFiniteBox");l();l();var X=class X extends Error{constructor(t){super(t);s(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,X)}};o(X,"AssertionError");var he=X;function Be(r,e){if(r==null){let t;if(e!=null&&e.customMessage)t=e.customMessage;else{let a=e!=null&&e.valueName?"'".concat(e.valueName,"'"):"value";t="Expected ".concat(a," to be defined, but received ").concat(r)}let n=(e==null?void 0:e.errorClass)||he,i=new n(t);throw(e==null?void 0:e.captureStackTrace)!==!1&&Error.captureStackTrace&&Error.captureStackTrace(i,Be),i}}o(Be,"assertExists");function gr(r,e,t){if(Be(r),(r==null?void 0:r.type)!==e){let n="Expected type ".concat(e," but got ").concat(r==null?void 0:r.type);throw new Error(t!=null?t:n)}}o(gr,"assertType");l();var ye=[0,4,6,8,10],V=o(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&(n&3)===0&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],ye.map((n,i)=>t.slice(n,i===ye.length-1?void 0:ye[i+1]).join("")).join("-")},"randomId");l();l();var st=new Set(Object.keys(R.NAMES));var at=o(r=>st.has(r.toLowerCase()),"isX11Color"),ut=o(r=>{if(!r.startsWith("#"))return!1;let e=r.slice(1);if(e.length!==3&&e.length!==6)return!1;for(let t=0;t<e.length;t++)if(!(e[t]>="0"&&e[t]<="9"||e[t]>="A"&&e[t]<="F"||e[t]>="a"&&e[t]<="f"))return!1;return!0},"isHexColor"),lt=o(r=>{if(!r.startsWith("rgb(")&&!r.startsWith("rgba("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let i=0;i<n.length;i++){let a=n[i].trim();if(i<3)if(a.endsWith("%")){let u=parseFloat(a.slice(0,-1));if(isNaN(u)||u<0||u>100)return!1}else{let u=parseInt(a,10);if(isNaN(u)||u<0||u>255)return!1}else{let u=parseFloat(a);if(isNaN(u)||u<0||u>1)return!1}}return!0},"isRgbColor"),ct=o(r=>{if(!r.startsWith("hsl(")&&!r.startsWith("hsla("))return!1;let e=r.indexOf("("),t=r.lastIndexOf(")");if(e===-1||t===-1||t<=e||t!==r.length-1)return!1;let n=r.slice(e+1,t).split(",");if(n.length!==3&&n.length!==4)return!1;for(let i=0;i<n.length;i++){let a=n[i].trim();if(i===0){let u=parseFloat(a);if(isNaN(u))return!1}else if(i<3){if(!a.endsWith("%"))return!1;let u=parseFloat(a.slice(0,-1));if(isNaN(u)||u<0||u>100)return!1}else{let u=parseFloat(a);if(isNaN(u)||u<0||u>1)return!1}}return!0},"isHslColor"),Z=o(r=>r==null||typeof r!="string"?!1:!!(ut(r)||lt(r)||ct(r)||at(r)),"isColor");l();var kr=["ease-in","ease-out","ease-in-out","linear"];var Re=o(r=>r,"linearEase"),mt=o(r=>r*r,"quadEaseIn"),ft=o(r=>1-Math.cos(r*Math.PI/2),"easeIn"),dt=o(r=>1-(1-r)*(1-r),"quadEaseOut"),Ve={linear:Re,"ease-in":mt,"ease-out":dt,"ease-in-out":ft};function Nr(r,e,t,n,i,a=Re){if(e===t)return i;r=Math.max(e,Math.min(r,t));let u=(r-Math.min(e,t))/Math.abs(t-e),c=typeof a=="function"?a(u):Ve[a](u);return n+c*(i-n)}o(Nr,"interpolate");function pt(r,e){let t=0;if(e.length<2)return t;let i=e[0]<e[1]?(a,u)=>a>u:(a,u)=>a<u;for(;t<e.length-1&&i(r,e[t+1]);)t++;return t>e.length-2?Math.max(0,e.length-2):t}o(pt,"getInterpolationBreakpoint");function _r(r,e,t,n="ease-in"){if(e.length!==t.length)throw new Y("Input and output ranges must have the same number of values.");r=Math.max(e[0],Math.min(r,e[e.length-1]));let i=pt(r,e),a=(r-e[i])/(e[i+1]-e[i]),u=typeof n=="function"?n(a):Ve[n](a);return t[i]+u*(t[i+1]-t[i])}o(_r,"interpolateMulti");l();l();function ht(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}o(ht,"normalizeAngle");l();l();l();l();l();l();l();l();var y=63710088e-1,sn={centimeters:y*100,centimetres:y*100,degrees:y/111325,feet:y*3.28084,inches:y*39.37,kilometers:y/1e3,kilometres:y/1e3,meters:y,metres:y,miles:y/1609.344,millimeters:y*1e3,millimetres:y*1e3,nauticalmiles:y/1852,radians:1,yards:y*1.0936},an={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/y,yards:1.0936133};function w(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}o(w,"feature");function yt(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!je(r[0])||!je(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return w(n,e,t)}o(yt,"point");function un(r,e,t){t===void 0&&(t={});for(var n=0,i=r;n<i.length;n++){var a=i[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var u=0;u<a[a.length-1].length;u++)if(a[a.length-1][u]!==a[0][u])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return w(c,e,t)}o(un,"polygon");function gt(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return w(n,e,t)}o(gt,"lineString");function ln(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}o(ln,"featureCollection");function cn(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return w(n,e,t)}o(cn,"multiLineString");function mn(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return w(n,e,t)}o(mn,"multiPolygon");function je(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}o(je,"isNumber");function ge(r,e,t){if(r!==null)for(var n,i,a,u,c,f,d,g=0,p=0,v,M=r.type,L=M==="FeatureCollection",ne=M==="Feature",Qe=L?r.features.length:1,O=0;O<Qe;O++){d=L?r.features[O].geometry:ne?r.geometry:r,v=d?d.type==="GeometryCollection":!1,c=v?d.geometries.length:1;for(var ie=0;ie<c;ie++){var x=0,A=0;if(u=v?d.geometries[ie]:d,u!==null){f=u.coordinates;var E=u.type;switch(g=t&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(e(f,p,O,x,A)===!1)return!1;p++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<f.length;n++){if(e(f[n],p,O,x,A)===!1)return!1;p++,E==="MultiPoint"&&x++}E==="LineString"&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<f.length;n++){for(i=0;i<f[n].length-g;i++){if(e(f[n][i],p,O,x,A)===!1)return!1;p++}E==="MultiLineString"&&x++,E==="Polygon"&&A++}E==="Polygon"&&x++;break;case"MultiPolygon":for(n=0;n<f.length;n++){for(A=0,i=0;i<f[n].length;i++){for(a=0;a<f[n][i].length-g;a++){if(e(f[n][i][a],p,O,x,A)===!1)return!1;p++}A++}x++}break;case"GeometryCollection":for(n=0;n<u.geometries.length;n++)if(ge(u.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}o(ge,"coordEach");function gn(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}o(gn,"featureEach");function bt(r,e){var t,n,i,a,u,c,f,d,g,p,v=0,M=r.type==="FeatureCollection",L=r.type==="Feature",ne=M?r.features.length:1;for(t=0;t<ne;t++){for(c=M?r.features[t].geometry:L?r.geometry:r,d=M?r.features[t].properties:L?r.properties:{},g=M?r.features[t].bbox:L?r.bbox:void 0,p=M?r.features[t].id:L?r.id:void 0,f=c?c.type==="GeometryCollection":!1,u=f?c.geometries.length:1,i=0;i<u;i++){if(a=f?c.geometries[i]:c,a===null){if(e(null,v,d,g,p)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(a,v,d,g,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<a.geometries.length;n++)if(e(a.geometries[n],v,d,g,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}o(bt,"geomEach");function bn(r,e){bt(r,function(t,n,i,a,u){var c=t===null?null:t.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return e(w(t,i,{bbox:a,id:u}),n,0)===!1?!1:void 0}var f;switch(c){case"MultiPoint":f="Point";break;case"MultiLineString":f="LineString";break;case"MultiPolygon":f="Polygon";break}for(var d=0;d<t.coordinates.length;d++){var g=t.coordinates[d],p={type:f,coordinates:g};if(e(w(p,i),n,d)===!1)return!1}})}o(bn,"flattenEach");function be(r){var e=[1/0,1/0,-1/0,-1/0];return ge(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}o(be,"bbox");be.default=be;var Ue=be;function Ke(r){return Ue(r)}o(Ke,"getBoundingBoxFromFeature");l();var xe="#ffffff",xt=.1,Q=.1,j,U,K,ve=class ve{constructor(e={}){s(this,"initialColor",xe);D(this,j,xe);s(this,"initialTopColor");D(this,U);s(this,"topTexture");s(this,"texture");D(this,K);s(this,"dirty",!0);s(this,"visible",!0);s(this,"opacity",1);s(this,"width",xt);s(this,"height",Q);s(this,"initialHeight",Q);s(this,"altitude",0);s(this,"join","round");s(this,"cap","round");s(this,"showImage",!0);s(this,"flipImageToFaceCamera",!0);s(this,"url");s(this,"side","double");s(this,"renderOrder",0);s(this,"shading");s(this,"bevel");this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder,this.shading=e==null?void 0:e.shading,this.bevel=e==null?void 0:e.bevel}set color(e){Z(e)?P(this,j,e):k.warn('Failed to update color. Invalid color "'.concat(e,'".'))}get color(){return T(this,j)}set topColor(e){e===void 0||Z(e)?P(this,U,e):k.warn('Failed to update top color. Invalid color "'.concat(e,'".'))}get topColor(){return T(this,U)}set hoverColor(e){Z(e)?P(this,K,e):k.warn('Failed to update hover color. Invalid color "'.concat(e,'".'))}get hoverColor(){return T(this,K)}};j=new WeakMap,U=new WeakMap,K=new WeakMap,o(ve,"StyleComponent");var Te=ve;var Me=class Me extends Ge{constructor(){super(...arguments);s(this,"type","entityBatchedMesh");s(this,"userData",{entities:{}})}};o(Me,"EntityBatchedMesh");var ee=Me,W,_,Ee=class Ee{constructor(e){s(this,"mesh");s(this,"imageMesh");s(this,"textMesh");s(this,"textEntityId");s(this,"type","geometry");s(this,"dirty",!0);s(this,"detached",!1);s(this,"instanceIndex",-1);s(this,"geometry");s(this,"batchedProps");s(this,"material");s(this,"feature");s(this,"currentHeight",Q);s(this,"color",new R);s(this,"topColor",new R);s(this,"position",new h);s(this,"altitude",0);D(this,W,1);D(this,_);s(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get opacity(){return T(this,W)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}P(this,W,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}set blendTexture(e){this.material&&(this.material.blendTexture=e)}get featureBbox(){return T(this,_)?T(this,_):(P(this,_,Ke(this.feature)),T(this,_))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};W=new WeakMap,_=new WeakMap,o(Ee,"MeshComponent");var We=Ee;var De=class De extends S{constructor(t){super();s(this,"visible",!0);s(this,"type","geometry-group");s(this,"components",[]);s(this,"userData",{entityId:"",entities3D:new Set,dirty:!0,shadingDirty:!0});this.userData.entityId=t}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let i of this.children)if(!i.userData.detached){t=i;break}return t instanceof ee?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}))}get altitude(){return this.position.z}};o(De,"GeometryGroupObject3D");var b=De;l();var Pe=class Pe extends S{};o(Pe,"Geometry2DObject3D");var I=Pe,Se=class Se{constructor(e,t,n=0){s(this,"id");s(this,"verticalOffset");s(this,"occluderId");s(this,"object3d",new I);s(this,"components");s(this,"disposed",!1);s(this,"worldPosition",new h);this.id=e.id||V(),this.components=[e],this.verticalOffset=n,this.object3d=new I,this.object3d.position.set(t.x,t.y,t.z+n),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type,this.positionDirty=!0}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}get position(){return this.positionDirty&&(this.object3d.matrixAutoUpdate=!0,this.object3d.getWorldPosition(this.worldPosition),this.positionDirty=!1,this.object3d.matrixAutoUpdate=!1),this.worldPosition}get positionDirty(){return this.object3d.userData.worldPositionDirty}set positionDirty(e){this.object3d.userData.worldPositionDirty=e}updatePosition(e){this.object3d.position.copy(e),this.positionDirty=!0}setAltitude(e){this.object3d.position.z=e,this.positionDirty=!0}};o(Se,"Geometry2D");var H=Se;l();var we=class we extends S{constructor(){super(...arguments);s(this,"type","geometry");s(this,"userData",{entityId:"",type:"geometry"})}raycast(t,n){this.userData.type==="model"&&this.children[0]&&t.intersectObject(this.children[0],!0).forEach(i=>{n.push(i)})}};o(we,"Geometry3DObject3D");var te=we,Ie=class Ie{constructor(e,t){s(this,"id",V());s(this,"components");s(this,"parentId");s(this,"entities2D",new Map);this.components=[e,t]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}attach(e){this.parentObject3D instanceof b?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof b&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};o(Ie,"Geometry3D");var $=Ie;var G=class G extends S{constructor(t){super();s(this,"childrenIds",new Set);s(this,"children",[]);s(this,"type","group-container");s(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});s(this,"components",[]);this.userData.entityId=t}addOccluderFeature(t,n){this.userData.occluderFeature=t,this.userData.occluderId=n,this.userData.occluderDirty=!0}addEntity(t){t instanceof G?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof H?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id),t.positionDirty=!0):t instanceof b?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof $&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof G?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof H?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof b?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof $&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible!==t&&(this.visible=t,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(t){this.position.z!==t&&(this.position.z=t,this.dispatchEvent({type:"childremoved",child:this}),this.set2DGeometryChildrenPositionDirty())}set2DGeometryChildrenPositionDirty(){this.children.forEach(t=>{t instanceof I?t.userData.worldPositionDirty=!0:t instanceof G&&t.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(t){this.userData.opacity=t}get opacity(){return this.userData.opacity}};o(G,"GroupContainerObject3D");var F=G;l();var li={top:0,bottom:0,left:0,right:0,type:"pixel"},z={enabled:!1,thickness:0,size:0,offset:0,segments:3};function ci(r,e){var t,n,i,a,u;return{bevelEnabled:(t=r==null?void 0:r.enabled)!=null?t:z.enabled,bevelThickness:(n=r==null?void 0:r.thickness)!=null?n:z.thickness,bevelSize:(i=r==null?void 0:r.size)!=null?i:(r==null?void 0:r.thickness)||z.size,bevelOffset:(a=r==null?void 0:r.offset)!=null?a:z.offset,bevelSegments:(u=r==null?void 0:r.segments)!=null?u:z.segments,depth:e}}o(ci,"createExtrudeSettings");var He="mappedin";var mi={ALWAYS_ON_TOP:10},fi=250;l();function Tt(r){let e=r.min,t=r.max,n=new h(e.x,e.y,e.z),i=new h(t.x,e.y,e.z),a=new h(e.x,t.y,e.z),u=new h(t.x,t.y,e.z);return[n,i,a,u]}o(Tt,"getCornersOfBoundingBox");l();function $e(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}o($e,"getGeometryByGeometryId");function vi(r,e,t=[],n=new se,i){(r.getSystems().renderSystem.threeDdirty||r.getSystems().renderSystem.twoDdirty)&&r.renderSync();let a=$e(r.getInternalState(),e);return ze(a,t,n,i),t}o(vi,"getVerticesOfEntity");var re=new h;function ze(r,e=[],t=new se,n){if(r.visible){if(r.isMesh||r.isLine||r.isPoints){let i=r.geometry;if(i.isBufferGeometry){let a=i.attributes.position;for(let u=0;u<a.count;u++)re.fromBufferAttribute(a,u),n!==void 0&&(re.z=n),e.push(re.clone()),t.expandByPoint(re)}}for(let i of r.children)ze(i,e,t,n)}}o(ze,"traverse");l();function vt(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}o(vt,"getPixelRatio");l();function Mt(r,e,t=!1){let n=null,i=0;return function(...a){i++,i===1&&t===!0&&r(...a);let u=o(()=>{(!t||i>1)&&r(...a),n=null,i=0},"later");clearTimeout(n),n=setTimeout(u,e)}}o(Mt,"debounce");l();var Et=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),a=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,u=/android/i.test(e);return r={isIpad:a,isMobile:u||i||a,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),qe=Et.getDeviceType,Ye=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let a=r.getContext("webgl")||r.getContext("experimental-webgl");if(!a)return e;try{let u=qe().isFirefox?null:a.getExtension("WEBGL_debug_renderer_info");return e=u?a.getParameter(u.UNMASKED_RENDERER_WEBGL):a.getParameter(a.RENDERER),e}catch(u){let c=new Error("Failed getting device info");throw c.name="FailedGettingDeviceInfo",c}}o(n,"getInfo");function i(){var u,c;if(!qe().isWindows)return!1;if(t!==void 0)return t;let a=(c=(u=Dt())==null?void 0:u.toLowerCase())!=null?c:"";return t=a.includes("intel")&&(a.includes("uhd")||a.includes("iris")),t}return o(i,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(a){r=a,e=void 0,t=void 0}}})(),Dt=Ye.getInfo,Pt=Ye.shouldDisableOffscreenCanvas;l();function St(r,e){let t={};for(let n=0;n<e.length;n++){let i=e[n];i in r&&(t[i]=r[i])}return t}o(St,"pick");function wt(r){return Object.keys(r).length===0}o(wt,"isEmpty");l();function Ji(r,e,t,n){let i=r*(Math.PI/180),a=n/N,u=r+a*180/Math.PI,c=t/N/Math.cos(i),f=e+c*180/Math.PI;return{lat:u,lon:f}}o(Ji,"cartesianToGeographic");function Xi(r,e,t,n){let i=t*(Math.PI/180),a=n*(Math.PI/180),u=r*(Math.PI/180),c=e*(Math.PI/180),f=i-u,d=a-c,g=N*d*Math.cos(u),p=N*f;return{x:g,y:p}}o(Xi,"geographicToCartesian");var It=o((r,e,t,n=!1)=>{var u;let i=r instanceof F&&r.userData.preloadGeometry,a=n||i&&!r.visible;if(r.children&&(r.visible||i))for(let c of r.children){if(c.visible&&c.type&&!a)if("entities3D"in c.userData&&((u=c.userData)!=null&&u.entities3D)&&c instanceof b){e.add(c.userData.entityId);for(let f of c.userData.entities3D.values())e.add(f)}else(c.type==="group-container"||c.type==="custom-geometry"||c instanceof te)&&e.add(c.userData.entityId);c instanceof b&&c.userData.dirty&&t.add(c.userData.entityId),It(c,e,t,a)}return e},"populateGeometry3DIdsInScene"),Ct=o((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let n of r.children)n.visible&&n instanceof I&&e.add(n.userData.entityId),Ct(n,e);return e},"populateGeometry2DIdsInScene");function Lt(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Lt(r[t],e[t]):r[t]=e[t]}return r}o(Lt,"mergeObjects");function Zi(r,e,t){let n={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},i=new ae,a=new h(n.scale,-n.scale,n.scale),u=new ae().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(a);return{id:He,type:"custom",renderingMode:"3d",render:o((c,f)=>{i.fromArray(f.defaultProjectionData.mainMatrix),e.projectionMatrix=i.multiply(u),t()},"render")}}o(Zi,"createCustomLayer");function Qi(r,e=0){let t=3735928559^e,n=1103547991^e;for(let i=0,a;i<r.length;i++)a=r.charCodeAt(i),t=Math.imul(t^a,2654435761),n=Math.imul(n^a,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}o(Qi,"cyrb53");function eo(r,e,t){let n=r*(Math.PI/180)/2,i=e/2;return t*Math.tan(n)/i}o(eo,"getProjectionScaleFactor");function to(r){return new ke(new oe(r[0][0],r[0][1]),new oe(r[1][0],r[1][1])).getCenter().toArray()}o(to,"getBoundingBoxCenter");function ro(r,e){return r<e||e<=12}o(ro,"shouldExpandZoomLevel");function no(r){let e=1;return r.type==="geometry-group"&&r.parent!=null&&r.parent instanceof F?e=r.parent.userData.computedOpacity:(r.type==="geometry"||r.type==="custom-geometry"||r.type==="model")&&r.parentObject3D!=null&&r.parentObject3D instanceof b&&r.parentObject3D.parent!=null&&r.parentObject3D.parent instanceof F&&(e=r.parentObject3D.parent.userData.computedOpacity),e}o(no,"getGroupContainerOpacity");function io(r,e,t=1e-10){if(r.length!==e.length)return!1;let n=Math.abs(r[0]-e[0])<t,i=Math.abs(r[1]-e[1])<t;if(r.length===3&&e.length===3){let a=Math.abs(r[2]-e[2])<t;return n&&i&&a}return n&&i}o(io,"coordinatesEqual");var Ot="maplibre-frustum-culling-hack";function oo(){let r=new _e(.01,.01,.01),e=new Ne({opacity:0,depthWrite:!1,transparent:!0}),t=new ue(r,e);return t.position.copy(new h(0,50,0)),t.frustumCulled=!1,t.name=Ot,t}o(oo,"maplibreFrustrumCullHack");var C=new h,Je=new B;function so(r,e,t=new q){return r.traverse(n=>{if(n instanceof ue){let a=n.geometry.attributes.position;if(e.position.distanceTo(n.position)<e.near)return;for(let c=0;c<a.count;c++)C.fromBufferAttribute(a,c),C.applyMatrix4(n.matrixWorld),C.applyMatrix4(e.matrixWorldInverse),C.applyMatrix4(e.projectionMatrix),C.z<1&&C.z>0&&(Je.set(C.x,C.y),t.expandByPoint(Je))}}),t}o(so,"projectToBox2D");function Xe(r,e){let t=e.clientWidth,n=e.clientHeight;return new B((r.x+1)*t/2,(1-r.y)*n/2)}o(Xe,"ndcToScreen");function ao(r,e,t){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(e),n.style.pointerEvents="none";let i=Xe(new B(r.min.x,r.min.y),t),a=Xe(new B(r.max.x,r.max.y),t);n.style.left="".concat(i.x,"px"),n.style.top="".concat(a.y,"px");let u=Math.abs(a.x-i.x),c=Math.abs(a.y-i.y);return n.style.width="".concat(u,"px"),n.style.height="".concat(c,"px"),t.appendChild(n),n}o(ao,"drawProjectedBox");l();var Le=class Le{constructor(e){s(this,"visible");s(this,"altitude");s(this,"color");s(this,"dirty",!0);s(this,"maxWidth");s(this,"maxHeight");s(this,"hoverByPolygon");s(this,"flipToFaceCamera",Ze.flipToFaceCamera);s(this,"font");s(this,"fillOpacity");s(this,"fontSize");s(this,"margin");s(this,"outlineWidth");s(this,"outlineBlur");s(this,"outlineOffsetX");s(this,"strokeColor");s(this,"strokeOpacity");s(this,"strokeWidth");s(this,"hoverColor");s(this,"outlineOffsetY");s(this,"outlineColor");s(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}};o(Le,"Text3DStyleComponent");var Ce=Le,Ze=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});l();l();var Ae=class Ae{constructor(e){s(this,"dirty",!0);s(this,"visible",!0);s(this,"opacity",1);s(this,"verticalOffset",0);s(this,"interactive",!1);s(this,"color");s(this,"material");s(this,"rotation");s(this,"scale");e&&Object.assign(this,e)}};o(Ae,"ModelStyleComponnet");var Oe=Ae;l();var At=[1,1,1],kt=[0,0,0];export{w as a,yt as b,un as c,gt as d,ln as e,cn as f,mn as g,gn as h,bn as i,et as j,k,N as l,nt as m,it as n,J as o,sr as p,ar as q,ur as r,ot as s,gr as t,V as u,le as v,Z as w,kr as x,Re as y,ft as z,Nr as A,pt as B,_r as C,xe as D,Te as E,ee as F,We as G,b as H,I,H as J,te as K,$ as L,F as M,li as N,ci as O,mi as P,fi as Q,Tt as R,$e as S,vi as T,vt as U,Mt as V,Pt as W,St as X,wt as Y,ht as Z,Ji as _,Xi as $,It as aa,Ct as ba,Lt as ca,Zi as da,Qi as ea,eo as fa,to as ga,ro as ha,no as ia,io as ja,oo as ka,so as la,ao as ma,Ce as na,Ze as oa,Oe as pa,At as qa,kt as ra};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e}from"./chunk-CU2O7JF6.js";var p,a=e(()=>{p={env:{NODE_ENV:"production",npm_package_version:"6.0.1-beta.
|
|
1
|
+
import{e}from"./chunk-CU2O7JF6.js";var p,a=e(()=>{p={env:{NODE_ENV:"production",npm_package_version:"6.0.1-beta.55"}}});export{a,p as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as y,_ as B,u as w,v as x,w as b}from"./chunk-
|
|
1
|
+
import{Z as y,_ as B,u as w,v as x,w as b}from"./chunk-BJJSORNB.js";import{a as A}from"./chunk-V373UAUS.js";import{c as g}from"./chunk-CU2O7JF6.js";A();function R(o,l=!1){let r=o[0].index!==null,f=new Set(Object.keys(o[0].attributes)),i=new Set(Object.keys(o[0].morphAttributes)),c={},e={},h=o[0].morphTargetsRelative,u=new B,d=0;for(let t=0;t<o.length;++t){let s=o[t],a=0;if(r!==(s.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let n in s.attributes){if(!f.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+'. All geometries must have compatible attributes; make sure "'+n+'" attribute exists among all geometries, or in none of them.'),null;c[n]===void 0&&(c[n]=[]),c[n].push(s.attributes[n]),a++}if(a!==f.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". Make sure all geometries have the same number of attributes."),null;if(h!==s.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let n in s.morphAttributes){if(!i.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphAttributes must be consistent throughout all geometries."),null;e[n]===void 0&&(e[n]=[]),e[n].push(s.morphAttributes[n])}if(l){let n;if(r)n=s.index.count;else if(s.attributes.position!==void 0)n=s.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". The geometry must have either an index or a position attribute"),null;u.addGroup(d,n,t),d+=n}}if(r){let t=0,s=[];for(let a=0;a<o.length;++a){let n=o[a].index;for(let m=0;m<n.count;++m)s.push(n.getX(m)+t);t+=o[a].attributes.position.count}u.setIndex(s)}for(let t in c){let s=T(c[t]);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;u.setAttribute(t,s)}for(let t in e){let s=e[t][0].length;if(s===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[t]=[];for(let a=0;a<s;++a){let n=[];for(let p=0;p<e[t].length;++p)n.push(e[t][p][a]);let m=T(n);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;u.morphAttributes[t].push(m)}}return u}g(R,"mergeGeometries");function T(o){let l,r,f,i=-1,c=0;for(let d=0;d<o.length;++d){let t=o[d];if(l===void 0&&(l=t.array.constructor),l!==t.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(r===void 0&&(r=t.itemSize),r!==t.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(f===void 0&&(f=t.normalized),f!==t.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=t.gpuType),i!==t.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;c+=t.count*r}let e=new l(c),h=new y(e,r,f),u=0;for(let d=0;d<o.length;++d){let t=o[d];if(t.isInterleavedBufferAttribute){let s=u/r;for(let a=0,n=t.count;a<n;a++)for(let m=0;m<r;m++){let p=t.getComponent(a,m);h.setComponent(a+s,m,p)}}else e.set(t.array,u);u+=t.count*r}return i!==void 0&&(h.gpuType=i),h}g(T,"mergeAttributes");function X(o,l){if(l===w)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(l===b||l===x){let r=o.getIndex();if(r===null){let e=[],h=o.getAttribute("position");if(h!==void 0){for(let u=0;u<h.count;u++)e.push(u);o.setIndex(e),r=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}let f=r.count-2,i=[];if(l===b)for(let e=1;e<=f;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<f;e++)e%2===0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==f&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let c=o.clone();return c.setIndex(i),c.clearGroups(),c}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",l),o}g(X,"toTrianglesDrawMode");export{R as a,X as b};
|