@loaders.gl/terrain
Advanced tools
Comparing version 3.0.0-alpha.18 to 3.0.0-alpha.19
@@ -1,1 +0,1 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){(function(t){const r=n(3),i="undefined"==typeof window?t:window;i.loaders=i.loaders||{},e.exports=Object.assign(i.loaders,r)}).call(this,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"TerrainLoader",(function(){return c})),n.d(t,"TerrainWorkerLoader",(function(){return s})),n.d(t,"QuantizedMeshLoader",(function(){return m})),n.d(t,"QuantizedMeshWorkerLoader",(function(){return S}));class r{constructor(e=257){this.gridSize=e;const t=e-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let e=0;e<this.numTriangles;e++){let n=e+2,r=0,i=0,o=0,a=0,s=0,c=0;for(1&n?o=a=s=t:r=i=c=t;(n>>=1)>1;){const e=r+o>>1,t=i+a>>1;1&n?(o=r,a=i,r=s,i=c):(r=o,i=a,o=s,a=c),s=e,c=t}const u=4*e;this.coords[u+0]=r,this.coords[u+1]=i,this.coords[u+2]=o,this.coords[u+3]=a}}createTile(e){return new i(e,this)}}class i{constructor(e,t){const n=t.gridSize;if(e.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${e.length}.`);this.terrain=e,this.martini=t,this.errors=new Float32Array(e.length),this.update()}update(){const{numTriangles:e,numParentTriangles:t,coords:n,gridSize:r}=this.martini,{terrain:i,errors:o}=this;for(let a=e-1;a>=0;a--){const e=4*a,s=n[e+0],c=n[e+1],u=n[e+2],l=n[e+3],d=s+u>>1,E=c+l>>1,f=d+E-c,h=E+s-d,g=(i[c*r+s]+i[l*r+u])/2,T=E*r+d,y=Math.abs(g-i[T]);if(o[T]=Math.max(o[T],y),a<t){const e=(c+h>>1)*r+(s+f>>1),t=(l+h>>1)*r+(u+f>>1);o[T]=Math.max(o[T],o[e],o[t])}}}getMesh(e=0){const{gridSize:t,indices:n}=this.martini,{errors:r}=this;let i=0,o=0;const a=t-1;function s(a,c,u,l,d,E){const f=a+u>>1,h=c+l>>1;Math.abs(a-d)+Math.abs(c-E)>1&&r[h*t+f]>e?(s(d,E,a,c,f,h),s(u,l,d,E,f,h)):(n[c*t+a]=n[c*t+a]||++i,n[l*t+u]=n[l*t+u]||++i,n[E*t+d]=n[E*t+d]||++i,o++)}n.fill(0),s(0,0,a,a,a,0),s(a,a,0,0,0,a);const c=new Uint16Array(2*i),u=new Uint32Array(3*o);let l=0;function d(i,o,a,s,E,f){const h=i+a>>1,g=o+s>>1;if(Math.abs(i-E)+Math.abs(o-f)>1&&r[g*t+h]>e)d(E,f,i,o,h,g),d(a,s,E,f,h,g);else{const e=n[o*t+i]-1,r=n[s*t+a]-1,d=n[f*t+E]-1;c[2*e]=i,c[2*e+1]=o,c[2*r]=a,c[2*r+1]=s,c[2*d]=E,c[2*d+1]=f,u[l++]=e,u[l++]=r,u[l++]=d}}return d(0,0,a,a,a,0),d(a,a,0,0,0,a),{vertices:c,triangles:u}}}function o(e){if(!e||!e.POSITION)return null;let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;const s=e.POSITION.value,c=s&&s.length;if(!c)return null;for(let e=0;e<c;e+=3){const c=s[e],u=s[e+1],l=s[e+2];t=c<t?c:t,n=u<n?u:n,r=l<r?l:r,i=c>i?c:i,o=u>o?u:o,a=l>a?l:a}return[[t,n,r],[i,o,a]]}function a(e,t){if(null===e)return null;const{meshMaxError:n,bounds:i,elevationDecoder:a}=t,s=e.data,c=e.width,u=c+1,l=function(e,t,n){const{rScaler:r,bScaler:i,gScaler:o,offset:a}=n,s=t+1,c=new Float32Array(s*s);for(let n=0,s=0;s<t;s++)for(let u=0;u<t;u++,n++){const t=4*n,u=e[t+0],l=e[t+1],d=e[t+2];c[n+s]=u*r+l*o+d*i+a}for(let e=s*(s-1),t=0;t<s-1;t++,e++)c[e]=c[e-s];for(let e=s-1,t=0;t<s;t++,e+=s)c[e]=c[e-1];return c}(s,c,a),d=new r(u).createTile(l),{vertices:E,triangles:f}=d.getMesh(n),h=function(e,t,n,r){const i=n+1,o=e.length/2,a=new Float32Array(3*o),s=new Float32Array(2*o),[c,u,l,d]=r||[0,0,n,n],E=(l-c)/n,f=(d-u)/n;for(let r=0;r<o;r++){const o=e[2*r],u=e[2*r+1],l=u*i+o;a[3*r+0]=o*E+c,a[3*r+1]=-u*f+d,a[3*r+2]=t[l],s[2*r+0]=o/n,s[2*r+1]=u/n}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:s,size:2}}}(E,l,c,i);return{loaderData:{header:{}},header:{vertexCount:f.length,boundingBox:o(h)},mode:4,indices:{value:f,size:1},attributes:h}}const s={name:"Terrain",id:"terrain",module:"terrain",version:"3.0.0-alpha.18",worker:!0,extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}},c={...s,parse:async function(e,t,n){return t.image=t.image||{},t.image.type="data",a(await n.parse(e,t,t.baseUri),t.terrain)}},u=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function l(e){return e>>1^-(1&e)}function d(e,t,n,r,i=!0){let o;if(o=2===r?new Uint16Array(e,t,n):new Uint32Array(e,t,n),!i)return o;let a=0;for(let e=0;e<o.length;++e){const t=o[e];o[e]=a-t,0===t&&++a}return o}function E(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}const f=1,h=2,g=3,T=4,y={maxDecodingStep:T};function p(e,t){const n=Object.assign({},y,t),r=new DataView(e),{header:i,headerEndPosition:o}=function(e){let t=0;const n={};for(const[r,i]of u){const o=8===i?e.getFloat64:e.getFloat32;n[r]=o.call(e,t,!0),t+=i}return{header:n,headerEndPosition:t}}(r);if(n.maxDecodingStep<f)return{header:i};const{vertexData:a,vertexDataEndPosition:s}=function(e,t){let n=t;const r=e.getUint32(n,!0),i=new Uint16Array(3*r);n+=Uint32Array.BYTES_PER_ELEMENT;const o=Uint16Array.BYTES_PER_ELEMENT,a=r*o,s=n,c=s+a,u=c+a;let d=0,E=0,f=0;for(let t=0;t<r;t++)d+=l(e.getUint16(s+o*t,!0)),E+=l(e.getUint16(c+o*t,!0)),f+=l(e.getUint16(u+o*t,!0)),i[t]=d,i[t+r]=E,i[t+2*r]=f;return n+=3*a,{vertexData:i,vertexDataEndPosition:n}}(r,o);if(n.maxDecodingStep<h)return{header:i,vertexData:a};const{triangleIndices:c,triangleIndicesEndPosition:p}=function(e,t,n){let r=n;const i=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;r%i!=0&&(r+=i-r%i);const o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=3*o,s=d(e.buffer,r,a,i);return r+=a*i,{triangleIndicesEndPosition:r,triangleIndices:s}}(r,a,s);if(n.maxDecodingStep<g)return{header:i,vertexData:a,triangleIndices:c};const{westIndices:_,southIndices:b,eastIndices:S,northIndices:m,edgeIndicesEndPosition:P}=function(e,t,n){let r=n;const i=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=d(e.buffer,r,o,i,!1);r+=o*i;const s=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const c=d(e.buffer,r,s,i,!1);r+=s*i;const u=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const l=d(e.buffer,r,u,i,!1);r+=u*i;const E=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const f=d(e.buffer,r,E,i,!1);return r+=E*i,{edgeIndicesEndPosition:r,westIndices:a,southIndices:c,eastIndices:l,northIndices:f}}(r,a,p);if(n.maxDecodingStep<T)return{header:i,vertexData:a,triangleIndices:c,westIndices:_,northIndices:m,eastIndices:S,southIndices:b};const{extensions:w}=function(e,t){const n={};if(e.byteLength<=t)return{extensions:n,extensionsEndPosition:t};let r=t;for(;r<e.byteLength;){const t=e.getUint8(r,!0);r+=Uint8Array.BYTES_PER_ELEMENT;const o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=new DataView(e.buffer,r,o);switch(t){case 1:n.vertexNormals=(i=a,new Uint8Array(i.buffer,i.byteOffset,i.byteLength));break;case 2:n.waterMask=E(a)}r+=o}var i;return{extensions:n,extensionsEndPosition:r}}(r,P);return{header:i,vertexData:a,triangleIndices:c,westIndices:_,northIndices:m,eastIndices:S,southIndices:b,extensions:w}}function _(e,t){if(!e)return null;const{bounds:n}=t,{header:r,vertexData:i,triangleIndices:a}=p(e,h),s=function(e,t,n){const{minHeight:r,maxHeight:i}=t,[o,a,s,c]=n||[0,0,1,1],u=s-o,l=c-a,d=i-r,E=e.length/3,f=new Float32Array(3*E),h=new Float32Array(2*E);for(let t=0;t<E;t++){const n=e[t]/32767,i=e[t+E]/32767,s=e[t+2*E]/32767;f[3*t+0]=n*u+o,f[3*t+1]=i*l+a,f[3*t+2]=s*d+r,h[2*t+0]=n,h[2*t+1]=i}return{POSITION:{value:f,size:3},TEXCOORD_0:{value:h,size:2}}}(i,r,n);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:o(s)},mode:4,indices:{value:a,size:1},attributes:s}}function b(e,t){return _(e,t["quantized-mesh"])}const S={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:"3.0.0-alpha.18",worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1]}}},m={...S,parseSync:b,parse:async(e,t)=>b(e,t)}}])})); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){(function(t){const i=n(3),s="undefined"==typeof window?t:window;s.loaders=s.loaders||{},e.exports=Object.assign(s.loaders,i)}).call(this,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"TerrainLoader",(function(){return _})),n.d(t,"TerrainWorkerLoader",(function(){return c})),n.d(t,"QuantizedMeshLoader",(function(){return q})),n.d(t,"QuantizedMeshWorkerLoader",(function(){return x}));function i(e){if(!e||!e.POSITION)return null;let t=1/0,n=1/0,i=1/0,s=-1/0,r=-1/0,o=-1/0;const a=e.POSITION.value,h=a&&a.length;if(!h)return null;for(let e=0;e<h;e+=3){const h=a[e],u=a[e+1],l=a[e+2];t=h<t?h:t,n=u<n?u:n,i=l<i?l:i,s=h>s?h:s,r=u>r?u:r,o=l>o?l:o}return[[t,n,i],[s,r,o]]}class s{constructor(e=257){this.gridSize=e;const t=e-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let e=0;e<this.numTriangles;e++){let n=e+2,i=0,s=0,r=0,o=0,a=0,h=0;for(1&n?r=o=a=t:i=s=h=t;(n>>=1)>1;){const e=i+r>>1,t=s+o>>1;1&n?(r=i,o=s,i=a,s=h):(i=r,s=o,r=a,o=h),a=e,h=t}const u=4*e;this.coords[u+0]=i,this.coords[u+1]=s,this.coords[u+2]=r,this.coords[u+3]=o}}createTile(e){return new r(e,this)}}class r{constructor(e,t){const n=t.gridSize;if(e.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${e.length}.`);this.terrain=e,this.martini=t,this.errors=new Float32Array(e.length),this.update()}update(){const{numTriangles:e,numParentTriangles:t,coords:n,gridSize:i}=this.martini,{terrain:s,errors:r}=this;for(let o=e-1;o>=0;o--){const e=4*o,a=n[e+0],h=n[e+1],u=n[e+2],l=n[e+3],d=a+u>>1,c=h+l>>1,_=d+c-h,g=c+a-d,f=(s[h*i+a]+s[l*i+u])/2,E=c*i+d,p=Math.abs(f-s[E]);if(r[E]=Math.max(r[E],p),o<t){const e=(h+g>>1)*i+(a+_>>1),t=(l+g>>1)*i+(u+_>>1);r[E]=Math.max(r[E],r[e],r[t])}}}getMesh(e=0){const{gridSize:t,indices:n}=this.martini,{errors:i}=this;let s=0,r=0;const o=t-1;function a(o,h,u,l,d,c){const _=o+u>>1,g=h+l>>1;Math.abs(o-d)+Math.abs(h-c)>1&&i[g*t+_]>e?(a(d,c,o,h,_,g),a(u,l,d,c,_,g)):(n[h*t+o]=n[h*t+o]||++s,n[l*t+u]=n[l*t+u]||++s,n[c*t+d]=n[c*t+d]||++s,r++)}n.fill(0),a(0,0,o,o,o,0),a(o,o,0,0,0,o);const h=new Uint16Array(2*s),u=new Uint32Array(3*r);let l=0;function d(s,r,o,a,c,_){const g=s+o>>1,f=r+a>>1;if(Math.abs(s-c)+Math.abs(r-_)>1&&i[f*t+g]>e)d(c,_,s,r,g,f),d(o,a,c,_,g,f);else{const e=n[r*t+s]-1,i=n[a*t+o]-1,d=n[_*t+c]-1;h[2*e]=s,h[2*e+1]=r,h[2*i]=o,h[2*i+1]=a,h[2*d]=c,h[2*d+1]=_,u[l++]=e,u[l++]=i,u[l++]=d}}return d(0,0,o,o,o,0),d(o,o,0,0,0,o),{vertices:h,triangles:u}}}class o{constructor(e,t,n=t){this.data=e,this.width=t,this.height=n,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;const i=t-1,s=n-1,r=this._addPoint(0,0),o=this._addPoint(i,0),a=this._addPoint(0,s),h=this._addPoint(i,s),u=this._addTriangle(h,r,a,-1,-1,-1);this._addTriangle(r,h,o,u,-1,-1),this._flush()}run(e=1){for(;this.getMaxError()>e;)this.refine()}refine(){this._step(),this._flush()}getMaxError(){return this._errors[0]}getRMSD(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}heightAt(e,t){return this.data[this.width*t+e]}_flush(){const e=this.coords;for(let t=0;t<this._pendingLen;t++){const n=this._pending[t],i=2*this.triangles[3*n+0],s=2*this.triangles[3*n+1],r=2*this.triangles[3*n+2];this._findCandidate(e[i],e[i+1],e[s],e[s+1],e[r],e[r+1],n)}this._pendingLen=0}_findCandidate(e,t,n,i,s,r,o){const h=Math.min(e,n,s),u=Math.min(t,i,r),l=Math.max(e,n,s),d=Math.max(t,i,r);let c=a(n,i,s,r,h,u),_=a(s,r,e,t,h,u),g=a(e,t,n,i,h,u);const f=i-t,E=e-n,p=r-i,T=n-s,m=t-r,y=s-e,S=a(e,t,n,i,s,r),w=this.heightAt(e,t)/S,b=this.heightAt(n,i)/S,P=this.heightAt(s,r)/S;let M=0,x=0,q=0,v=0;for(let e=u;e<=d;e++){let t=0;c<0&&0!==p&&(t=Math.max(t,Math.floor(-c/p))),_<0&&0!==m&&(t=Math.max(t,Math.floor(-_/m))),g<0&&0!==f&&(t=Math.max(t,Math.floor(-g/f)));let n=c+p*t,i=_+m*t,s=g+f*t,r=!1;for(let o=h+t;o<=l;o++){if(n>=0&&i>=0&&s>=0){r=!0;const t=w*n+b*i+P*s,a=Math.abs(t-this.heightAt(o,e));v+=a*a,a>M&&(M=a,x=o,q=e)}else if(r)break;n+=p,i+=m,s+=f}c+=T,_+=y,g+=E}(x===e&&q===t||x===n&&q===i||x===s&&q===r)&&(M=0),this._candidates[2*o]=x,this._candidates[2*o+1]=q,this._rms[o]=v,this._queuePush(o,M,v)}_step(){const e=this._queuePop(),t=3*e+0,n=3*e+1,i=3*e+2,s=this.triangles[t],r=this.triangles[n],o=this.triangles[i],h=this.coords[2*s],u=this.coords[2*s+1],l=this.coords[2*r],d=this.coords[2*r+1],c=this.coords[2*o],_=this.coords[2*o+1],g=this._candidates[2*e],f=this._candidates[2*e+1],E=this._addPoint(g,f);if(0===a(h,u,l,d,g,f))this._handleCollinear(E,t);else if(0===a(l,d,c,_,g,f))this._handleCollinear(E,n);else if(0===a(c,_,h,u,g,f))this._handleCollinear(E,i);else{const e=this._halfedges[t],a=this._halfedges[n],h=this._halfedges[i],u=this._addTriangle(s,r,E,e,-1,-1,t),l=this._addTriangle(r,o,E,a,-1,u+1),d=this._addTriangle(o,s,E,h,u+2,l+1);this._legalize(u),this._legalize(l),this._legalize(d)}}_addPoint(e,t){const n=this.coords.length>>1;return this.coords.push(e,t),n}_addTriangle(e,t,n,i,s,r,o=this.triangles.length){const a=o/3;return this.triangles[o+0]=e,this.triangles[o+1]=t,this.triangles[o+2]=n,this._halfedges[o+0]=i,this._halfedges[o+1]=s,this._halfedges[o+2]=r,i>=0&&(this._halfedges[i]=o+0),s>=0&&(this._halfedges[s]=o+1),r>=0&&(this._halfedges[r]=o+2),this._candidates[2*a+0]=0,this._candidates[2*a+1]=0,this._queueIndices[a]=-1,this._rms[a]=0,this._pending[this._pendingLen++]=a,o}_legalize(e){const t=this._halfedges[e];if(t<0)return;const n=e-e%3,i=t-t%3,s=n+(e+1)%3,r=n+(e+2)%3,o=i+(t+2)%3,a=i+(t+1)%3,h=this.triangles[r],u=this.triangles[e],l=this.triangles[s],d=this.triangles[o],c=this.coords;if(!function(e,t,n,i,s,r,o,a){const h=e-o,u=t-a,l=n-o,d=i-a,c=s-o,_=r-a,g=l*l+d*d,f=c*c+_*_;return h*(d*f-g*_)-u*(l*f-g*c)+(h*h+u*u)*(l*_-d*c)<0}(c[2*h],c[2*h+1],c[2*u],c[2*u+1],c[2*l],c[2*l+1],c[2*d],c[2*d+1]))return;const _=this._halfedges[s],g=this._halfedges[r],f=this._halfedges[o],E=this._halfedges[a];this._queueRemove(n/3),this._queueRemove(i/3);const p=this._addTriangle(h,d,l,-1,f,_,n),T=this._addTriangle(d,h,u,p,g,E,i);this._legalize(p+1),this._legalize(T+2)}_handleCollinear(e,t){const n=t-t%3,i=n+(t+1)%3,s=n+(t+2)%3,r=this.triangles[s],o=this.triangles[t],a=this.triangles[i],h=this._halfedges[i],u=this._halfedges[s],l=this._halfedges[t];if(l<0){const t=this._addTriangle(e,r,o,-1,u,-1,n),i=this._addTriangle(r,e,a,t,-1,h);return this._legalize(t+1),void this._legalize(i+2)}const d=l-l%3,c=d+(l+2)%3,_=d+(l+1)%3,g=this.triangles[c],f=this._halfedges[c],E=this._halfedges[_];this._queueRemove(d/3);const p=this._addTriangle(r,o,e,u,-1,-1,n),T=this._addTriangle(o,g,e,E,-1,p+1,d),m=this._addTriangle(g,a,e,f,-1,T+1),y=this._addTriangle(a,r,e,h,p+2,m+1);this._legalize(p),this._legalize(T),this._legalize(m),this._legalize(y)}_queuePush(e,t,n){const i=this._queue.length;this._queueIndices[e]=i,this._queue.push(e),this._errors.push(t),this._rmsSum+=n,this._queueUp(i)}_queuePop(){const e=this._queue.length-1;return this._queueSwap(0,e),this._queueDown(0,e),this._queuePopBack()}_queuePopBack(){const e=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[e],this._queueIndices[e]=-1,e}_queueRemove(e){const t=this._queueIndices[e];if(t<0){const t=this._pending.indexOf(e);if(-1===t)throw new Error("Broken triangulation (something went wrong).");return void(this._pending[t]=this._pending[--this._pendingLen])}const n=this._queue.length-1;n!==t&&(this._queueSwap(t,n),this._queueDown(t,n)||this._queueUp(t)),this._queuePopBack()}_queueLess(e,t){return this._errors[e]>this._errors[t]}_queueSwap(e,t){const n=this._queue[e],i=this._queue[t];this._queue[e]=i,this._queue[t]=n,this._queueIndices[n]=t,this._queueIndices[i]=e;const s=this._errors[e];this._errors[e]=this._errors[t],this._errors[t]=s}_queueUp(e){let t=e;for(;;){const e=t-1>>1;if(e===t||!this._queueLess(t,e))break;this._queueSwap(e,t),t=e}}_queueDown(e,t){let n=e;for(;;){const e=2*n+1;if(e>=t||e<0)break;const i=e+1;let s=e;if(i<t&&this._queueLess(i,e)&&(s=i),!this._queueLess(s,n))break;this._queueSwap(n,s),n=s}return n>e}}function a(e,t,n,i,s,r){return(n-s)*(t-r)-(i-r)*(e-s)}function h(e,t,n,i,s){const{rScaler:r,bScaler:o,gScaler:a,offset:h}=i,u=new Float32Array((t+1)*(n+1));for(let i=0,s=0;s<n;s++)for(let n=0;n<t;n++,i++){const t=4*i,n=e[t+0],l=e[t+1],d=e[t+2];u[i+s]=n*r+l*a+d*o+h}if("martini"===s){for(let e=(t+1)*t,n=0;n<t;n++,e++)u[e]=u[e-t-1];for(let e=n,t=0;t<n+1;t++,e+=n+1)u[e]=u[e-1]}return u}function u(e,t){if(null===e)return null;const{meshMaxError:n,bounds:s,elevationDecoder:r}=t,{data:o,width:a,height:u}=e;let c,_;switch(t.tesselator){case"martini":c=h(o,a,u,r,t.tesselator),_=l(n,a,c);break;case"delatin":c=h(o,a,u,r,t.tesselator),_=d(n,a,u,c);break;default:a!==u||u&a-1?(c=h(o,a,u,r,"delatin"),_=d(n,a,u,c)):(c=h(o,a,u,r,"martini"),_=l(n,a,c))}const{vertices:g,triangles:f}=_,E=function(e,t,n,i,s){const r=n+1,o=e.length/2,a=new Float32Array(3*o),h=new Float32Array(2*o),[u,l,d,c]=s||[0,0,n,i],_=(d-u)/n,g=(c-l)/i;for(let s=0;s<o;s++){const o=e[2*s],l=e[2*s+1],d=l*r+o;a[3*s+0]=o*_+u,a[3*s+1]=-l*g+c,a[3*s+2]=t[d],h[2*s+0]=o/n,h[2*s+1]=l/i}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:h,size:2}}}(g,c,a,u,s);return{loaderData:{header:{}},header:{vertexCount:f.length,boundingBox:i(E)},mode:4,indices:{value:Uint32Array.from(f),size:1},attributes:E}}function l(e,t,n){const i=new s(t+1).createTile(n),{vertices:r,triangles:o}=i.getMesh(e);return{vertices:r,triangles:o}}function d(e,t,n,i){const s=new o(i,t+1,n+1);s.run(e);const{coords:r,triangles:a}=s;return{vertices:r,triangles:a}}const c={name:"Terrain",id:"terrain",module:"terrain",version:"3.0.0-alpha.19",worker:!0,extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}},_={...c,parse:async function(e,t,n){return t.image=t.image||{},t.image.type="data",u(await n.parse(e,t,t.baseUri),t.terrain)}},g=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function f(e){return e>>1^-(1&e)}function E(e,t,n,i,s=!0){let r;if(r=2===i?new Uint16Array(e,t,n):new Uint32Array(e,t,n),!s)return r;let o=0;for(let e=0;e<r.length;++e){const t=r[e];r[e]=o-t,0===t&&++o}return r}function p(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}const T=1,m=2,y=3,S=4,w={maxDecodingStep:S};function b(e,t){const n=Object.assign({},w,t),i=new DataView(e),{header:s,headerEndPosition:r}=function(e){let t=0;const n={};for(const[i,s]of g){const r=8===s?e.getFloat64:e.getFloat32;n[i]=r.call(e,t,!0),t+=s}return{header:n,headerEndPosition:t}}(i);if(n.maxDecodingStep<T)return{header:s};const{vertexData:o,vertexDataEndPosition:a}=function(e,t){let n=t;const i=e.getUint32(n,!0),s=new Uint16Array(3*i);n+=Uint32Array.BYTES_PER_ELEMENT;const r=Uint16Array.BYTES_PER_ELEMENT,o=i*r,a=n,h=a+o,u=h+o;let l=0,d=0,c=0;for(let t=0;t<i;t++)l+=f(e.getUint16(a+r*t,!0)),d+=f(e.getUint16(h+r*t,!0)),c+=f(e.getUint16(u+r*t,!0)),s[t]=l,s[t+i]=d,s[t+2*i]=c;return n+=3*o,{vertexData:s,vertexDataEndPosition:n}}(i,r);if(n.maxDecodingStep<m)return{header:s,vertexData:o};const{triangleIndices:h,triangleIndicesEndPosition:u}=function(e,t,n){let i=n;const s=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;i%s!=0&&(i+=s-i%s);const r=e.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;const o=3*r,a=E(e.buffer,i,o,s);return i+=o*s,{triangleIndicesEndPosition:i,triangleIndices:a}}(i,o,a);if(n.maxDecodingStep<y)return{header:s,vertexData:o,triangleIndices:h};const{westIndices:l,southIndices:d,eastIndices:c,northIndices:_,edgeIndicesEndPosition:b}=function(e,t,n){let i=n;const s=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,r=e.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;const o=E(e.buffer,i,r,s,!1);i+=r*s;const a=e.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;const h=E(e.buffer,i,a,s,!1);i+=a*s;const u=e.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;const l=E(e.buffer,i,u,s,!1);i+=u*s;const d=e.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;const c=E(e.buffer,i,d,s,!1);return i+=d*s,{edgeIndicesEndPosition:i,westIndices:o,southIndices:h,eastIndices:l,northIndices:c}}(i,o,u);if(n.maxDecodingStep<S)return{header:s,vertexData:o,triangleIndices:h,westIndices:l,northIndices:_,eastIndices:c,southIndices:d};const{extensions:P}=function(e,t){const n={};if(e.byteLength<=t)return{extensions:n,extensionsEndPosition:t};let i=t;for(;i<e.byteLength;){const t=e.getUint8(i,!0);i+=Uint8Array.BYTES_PER_ELEMENT;const r=e.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;const o=new DataView(e.buffer,i,r);switch(t){case 1:n.vertexNormals=(s=o,new Uint8Array(s.buffer,s.byteOffset,s.byteLength));break;case 2:n.waterMask=p(o)}i+=r}var s;return{extensions:n,extensionsEndPosition:i}}(i,b);return{header:s,vertexData:o,triangleIndices:h,westIndices:l,northIndices:_,eastIndices:c,southIndices:d,extensions:P}}function P(e,t){if(!e)return null;const{bounds:n}=t,{header:s,vertexData:r,triangleIndices:o}=b(e,m),a=function(e,t,n){const{minHeight:i,maxHeight:s}=t,[r,o,a,h]=n||[0,0,1,1],u=a-r,l=h-o,d=s-i,c=e.length/3,_=new Float32Array(3*c),g=new Float32Array(2*c);for(let t=0;t<c;t++){const n=e[t]/32767,s=e[t+c]/32767,a=e[t+2*c]/32767;_[3*t+0]=n*u+r,_[3*t+1]=s*l+o,_[3*t+2]=a*d+i,g[2*t+0]=n,g[2*t+1]=s}return{POSITION:{value:_,size:3},TEXCOORD_0:{value:g,size:2}}}(r,s,n);return{loaderData:{header:{}},header:{vertexCount:o.length,boundingBox:i(a)},mode:4,indices:{value:o,size:1},attributes:a}}function M(e,t){return P(e,t["quantized-mesh"])}const x={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:"3.0.0-alpha.19",worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1]}}},q={...x,parseSync:M,parse:async(e,t)=>M(e,t)}}])})); |
@@ -13,3 +13,3 @@ "use strict"; | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
@@ -16,0 +16,0 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -18,2 +18,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function getMeshAttributes(vertexData, header, bounds) { | ||
@@ -20,0 +24,0 @@ var minHeight = header.minHeight, |
@@ -16,7 +16,9 @@ "use strict"; | ||
var _loaderUtils = require("@loaders.gl/loader-utils"); | ||
var _martini = _interopRequireDefault(require("@mapbox/martini")); | ||
var _loaderUtils = require("@loaders.gl/loader-utils"); | ||
var _delatin = _interopRequireDefault(require("./delatin")); | ||
function getTerrain(imageData, tileSize, elevationDecoder) { | ||
function getTerrain(imageData, width, height, elevationDecoder, tesselator) { | ||
var rScaler = elevationDecoder.rScaler, | ||
@@ -26,7 +28,6 @@ bScaler = elevationDecoder.bScaler, | ||
offset = elevationDecoder.offset; | ||
var gridSize = tileSize + 1; | ||
var terrain = new Float32Array(gridSize * gridSize); | ||
var terrain = new Float32Array((width + 1) * (height + 1)); | ||
for (var i = 0, y = 0; y < tileSize; y++) { | ||
for (var x = 0; x < tileSize; x++, i++) { | ||
for (var i = 0, y = 0; y < height; y++) { | ||
for (var x = 0; x < width; x++, i++) { | ||
var k = i * 4; | ||
@@ -40,8 +41,10 @@ var r = imageData[k + 0]; | ||
for (var _i = gridSize * (gridSize - 1), _x = 0; _x < gridSize - 1; _x++, _i++) { | ||
terrain[_i] = terrain[_i - gridSize]; | ||
} | ||
if (tesselator === 'martini') { | ||
for (var _i = (width + 1) * width, _x = 0; _x < width; _x++, _i++) { | ||
terrain[_i] = terrain[_i - width - 1]; | ||
} | ||
for (var _i2 = gridSize - 1, _y = 0; _y < gridSize; _y++, _i2 += gridSize) { | ||
terrain[_i2] = terrain[_i2 - 1]; | ||
for (var _i2 = height, _y = 0; _y < height + 1; _y++, _i2 += height + 1) { | ||
terrain[_i2] = terrain[_i2 - 1]; | ||
} | ||
} | ||
@@ -52,4 +55,4 @@ | ||
function getMeshAttributes(vertices, terrain, tileSize, bounds) { | ||
var gridSize = tileSize + 1; | ||
function getMeshAttributes(vertices, terrain, width, height, bounds) { | ||
var gridSize = width + 1; | ||
var numOfVerticies = vertices.length / 2; | ||
@@ -59,3 +62,3 @@ var positions = new Float32Array(numOfVerticies * 3); | ||
var _ref = bounds || [0, 0, tileSize, tileSize], | ||
var _ref = bounds || [0, 0, width, height], | ||
_ref2 = (0, _slicedToArray2.default)(_ref, 4), | ||
@@ -67,4 +70,4 @@ minX = _ref2[0], | ||
var xScale = (maxX - minX) / tileSize; | ||
var yScale = (maxY - minY) / tileSize; | ||
var xScale = (maxX - minX) / width; | ||
var yScale = (maxY - minY) / height; | ||
@@ -78,4 +81,4 @@ for (var i = 0; i < numOfVerticies; i++) { | ||
positions[3 * i + 2] = terrain[pixelIdx]; | ||
texCoords[2 * i + 0] = x / tileSize; | ||
texCoords[2 * i + 1] = y / tileSize; | ||
texCoords[2 * i + 0] = x / width; | ||
texCoords[2 * i + 1] = y / height; | ||
} | ||
@@ -95,3 +98,3 @@ | ||
function getMartiniTileMesh(terrainImage, terrainOptions) { | ||
function getMesh(terrainImage, terrainOptions) { | ||
if (terrainImage === null) { | ||
@@ -104,14 +107,35 @@ return null; | ||
elevationDecoder = terrainOptions.elevationDecoder; | ||
var data = terrainImage.data; | ||
var tileSize = terrainImage.width; | ||
var gridSize = tileSize + 1; | ||
var terrain = getTerrain(data, tileSize, elevationDecoder); | ||
var martini = new _martini.default(gridSize); | ||
var tile = martini.createTile(terrain); | ||
var data = terrainImage.data, | ||
width = terrainImage.width, | ||
height = terrainImage.height; | ||
var terrain; | ||
var mesh; | ||
var _tile$getMesh = tile.getMesh(meshMaxError), | ||
vertices = _tile$getMesh.vertices, | ||
triangles = _tile$getMesh.triangles; | ||
switch (terrainOptions.tesselator) { | ||
case 'martini': | ||
terrain = getTerrain(data, width, height, elevationDecoder, terrainOptions.tesselator); | ||
mesh = getMartiniTileMesh(meshMaxError, width, terrain); | ||
break; | ||
var attributes = getMeshAttributes(vertices, terrain, tileSize, bounds); | ||
case 'delatin': | ||
terrain = getTerrain(data, width, height, elevationDecoder, terrainOptions.tesselator); | ||
mesh = getDelatinTileMesh(meshMaxError, width, height, terrain); | ||
break; | ||
default: | ||
if (width === height && !(height & width - 1)) { | ||
terrain = getTerrain(data, width, height, elevationDecoder, 'martini'); | ||
mesh = getMartiniTileMesh(meshMaxError, width, terrain); | ||
} else { | ||
terrain = getTerrain(data, width, height, elevationDecoder, 'delatin'); | ||
mesh = getDelatinTileMesh(meshMaxError, width, height, terrain); | ||
} | ||
break; | ||
} | ||
var _mesh = mesh, | ||
vertices = _mesh.vertices, | ||
triangles = _mesh.triangles; | ||
var attributes = getMeshAttributes(vertices, terrain, width, height, bounds); | ||
return { | ||
@@ -127,3 +151,3 @@ loaderData: { | ||
indices: { | ||
value: triangles, | ||
value: Uint32Array.from(triangles), | ||
size: 1 | ||
@@ -135,2 +159,29 @@ }, | ||
function getMartiniTileMesh(meshMaxError, width, terrain) { | ||
var gridSize = width + 1; | ||
var martini = new _martini.default(gridSize); | ||
var tile = martini.createTile(terrain); | ||
var _tile$getMesh = tile.getMesh(meshMaxError), | ||
vertices = _tile$getMesh.vertices, | ||
triangles = _tile$getMesh.triangles; | ||
return { | ||
vertices: vertices, | ||
triangles: triangles | ||
}; | ||
} | ||
function getDelatinTileMesh(meshMaxError, width, height, terrain) { | ||
var tin = new _delatin.default(terrain, width + 1, height + 1); | ||
tin.run(meshMaxError); | ||
var coords = tin.coords, | ||
triangles = tin.triangles; | ||
var vertices = coords; | ||
return { | ||
vertices: vertices, | ||
triangles: triangles | ||
}; | ||
} | ||
function loadTerrain(_x2, _x3, _x4) { | ||
@@ -154,3 +205,3 @@ return _loadTerrain.apply(this, arguments); | ||
image = _context.sent; | ||
return _context.abrupt("return", getMartiniTileMesh(image, options.terrain)); | ||
return _context.abrupt("return", getMesh(image, options.terrain)); | ||
@@ -157,0 +208,0 @@ case 6: |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.VERSION = void 0; | ||
var VERSION = typeof "3.0.0-alpha.18" !== 'undefined' ? "3.0.0-alpha.18" : 'latest'; | ||
var VERSION = typeof "3.0.0-alpha.19" !== 'undefined' ? "3.0.0-alpha.19" : 'latest'; | ||
exports.VERSION = VERSION; | ||
//# sourceMappingURL=version.js.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
@@ -23,0 +23,0 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
@@ -16,3 +16,3 @@ "use strict"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
@@ -31,2 +31,3 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
terrain: { | ||
tesselator: 'auto', | ||
bounds: null, | ||
@@ -33,0 +34,0 @@ meshMaxError: 10, |
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
@@ -5,0 +5,0 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } |
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
import { getMeshBoundingBox } from '@loaders.gl/loader-utils'; | ||
import Martini from '@mapbox/martini'; | ||
import { getMeshBoundingBox } from '@loaders.gl/loader-utils'; | ||
import Delatin from './delatin'; | ||
function getTerrain(imageData, tileSize, elevationDecoder) { | ||
function getTerrain(imageData, width, height, elevationDecoder, tesselator) { | ||
var rScaler = elevationDecoder.rScaler, | ||
@@ -12,7 +13,6 @@ bScaler = elevationDecoder.bScaler, | ||
offset = elevationDecoder.offset; | ||
var gridSize = tileSize + 1; | ||
var terrain = new Float32Array(gridSize * gridSize); | ||
var terrain = new Float32Array((width + 1) * (height + 1)); | ||
for (var i = 0, y = 0; y < tileSize; y++) { | ||
for (var x = 0; x < tileSize; x++, i++) { | ||
for (var i = 0, y = 0; y < height; y++) { | ||
for (var x = 0; x < width; x++, i++) { | ||
var k = i * 4; | ||
@@ -26,8 +26,10 @@ var r = imageData[k + 0]; | ||
for (var _i = gridSize * (gridSize - 1), _x = 0; _x < gridSize - 1; _x++, _i++) { | ||
terrain[_i] = terrain[_i - gridSize]; | ||
} | ||
if (tesselator === 'martini') { | ||
for (var _i = (width + 1) * width, _x = 0; _x < width; _x++, _i++) { | ||
terrain[_i] = terrain[_i - width - 1]; | ||
} | ||
for (var _i2 = gridSize - 1, _y = 0; _y < gridSize; _y++, _i2 += gridSize) { | ||
terrain[_i2] = terrain[_i2 - 1]; | ||
for (var _i2 = height, _y = 0; _y < height + 1; _y++, _i2 += height + 1) { | ||
terrain[_i2] = terrain[_i2 - 1]; | ||
} | ||
} | ||
@@ -38,4 +40,4 @@ | ||
function getMeshAttributes(vertices, terrain, tileSize, bounds) { | ||
var gridSize = tileSize + 1; | ||
function getMeshAttributes(vertices, terrain, width, height, bounds) { | ||
var gridSize = width + 1; | ||
var numOfVerticies = vertices.length / 2; | ||
@@ -45,3 +47,3 @@ var positions = new Float32Array(numOfVerticies * 3); | ||
var _ref = bounds || [0, 0, tileSize, tileSize], | ||
var _ref = bounds || [0, 0, width, height], | ||
_ref2 = _slicedToArray(_ref, 4), | ||
@@ -53,4 +55,4 @@ minX = _ref2[0], | ||
var xScale = (maxX - minX) / tileSize; | ||
var yScale = (maxY - minY) / tileSize; | ||
var xScale = (maxX - minX) / width; | ||
var yScale = (maxY - minY) / height; | ||
@@ -64,4 +66,4 @@ for (var i = 0; i < numOfVerticies; i++) { | ||
positions[3 * i + 2] = terrain[pixelIdx]; | ||
texCoords[2 * i + 0] = x / tileSize; | ||
texCoords[2 * i + 1] = y / tileSize; | ||
texCoords[2 * i + 0] = x / width; | ||
texCoords[2 * i + 1] = y / height; | ||
} | ||
@@ -81,3 +83,3 @@ | ||
function getMartiniTileMesh(terrainImage, terrainOptions) { | ||
function getMesh(terrainImage, terrainOptions) { | ||
if (terrainImage === null) { | ||
@@ -90,14 +92,35 @@ return null; | ||
elevationDecoder = terrainOptions.elevationDecoder; | ||
var data = terrainImage.data; | ||
var tileSize = terrainImage.width; | ||
var gridSize = tileSize + 1; | ||
var terrain = getTerrain(data, tileSize, elevationDecoder); | ||
var martini = new Martini(gridSize); | ||
var tile = martini.createTile(terrain); | ||
var data = terrainImage.data, | ||
width = terrainImage.width, | ||
height = terrainImage.height; | ||
var terrain; | ||
var mesh; | ||
var _tile$getMesh = tile.getMesh(meshMaxError), | ||
vertices = _tile$getMesh.vertices, | ||
triangles = _tile$getMesh.triangles; | ||
switch (terrainOptions.tesselator) { | ||
case 'martini': | ||
terrain = getTerrain(data, width, height, elevationDecoder, terrainOptions.tesselator); | ||
mesh = getMartiniTileMesh(meshMaxError, width, terrain); | ||
break; | ||
var attributes = getMeshAttributes(vertices, terrain, tileSize, bounds); | ||
case 'delatin': | ||
terrain = getTerrain(data, width, height, elevationDecoder, terrainOptions.tesselator); | ||
mesh = getDelatinTileMesh(meshMaxError, width, height, terrain); | ||
break; | ||
default: | ||
if (width === height && !(height & width - 1)) { | ||
terrain = getTerrain(data, width, height, elevationDecoder, 'martini'); | ||
mesh = getMartiniTileMesh(meshMaxError, width, terrain); | ||
} else { | ||
terrain = getTerrain(data, width, height, elevationDecoder, 'delatin'); | ||
mesh = getDelatinTileMesh(meshMaxError, width, height, terrain); | ||
} | ||
break; | ||
} | ||
var _mesh = mesh, | ||
vertices = _mesh.vertices, | ||
triangles = _mesh.triangles; | ||
var attributes = getMeshAttributes(vertices, terrain, width, height, bounds); | ||
return { | ||
@@ -113,3 +136,3 @@ loaderData: { | ||
indices: { | ||
value: triangles, | ||
value: Uint32Array.from(triangles), | ||
size: 1 | ||
@@ -121,2 +144,29 @@ }, | ||
function getMartiniTileMesh(meshMaxError, width, terrain) { | ||
var gridSize = width + 1; | ||
var martini = new Martini(gridSize); | ||
var tile = martini.createTile(terrain); | ||
var _tile$getMesh = tile.getMesh(meshMaxError), | ||
vertices = _tile$getMesh.vertices, | ||
triangles = _tile$getMesh.triangles; | ||
return { | ||
vertices: vertices, | ||
triangles: triangles | ||
}; | ||
} | ||
function getDelatinTileMesh(meshMaxError, width, height, terrain) { | ||
var tin = new Delatin(terrain, width + 1, height + 1); | ||
tin.run(meshMaxError); | ||
var coords = tin.coords, | ||
triangles = tin.triangles; | ||
var vertices = coords; | ||
return { | ||
vertices: vertices, | ||
triangles: triangles | ||
}; | ||
} | ||
export default function loadTerrain(_x2, _x3, _x4) { | ||
@@ -140,3 +190,3 @@ return _loadTerrain.apply(this, arguments); | ||
image = _context.sent; | ||
return _context.abrupt("return", getMartiniTileMesh(image, options.terrain)); | ||
return _context.abrupt("return", getMesh(image, options.terrain)); | ||
@@ -143,0 +193,0 @@ case 6: |
@@ -1,2 +0,2 @@ | ||
export var VERSION = typeof "3.0.0-alpha.18" !== 'undefined' ? "3.0.0-alpha.18" : 'latest'; | ||
export var VERSION = typeof "3.0.0-alpha.19" !== 'undefined' ? "3.0.0-alpha.19" : 'latest'; | ||
//# sourceMappingURL=version.js.map |
@@ -5,3 +5,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
@@ -8,0 +8,0 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
@@ -19,2 +19,3 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
terrain: { | ||
tesselator: 'auto', | ||
bounds: null, | ||
@@ -21,0 +22,0 @@ meshMaxError: 10, |
{ | ||
"name": "@loaders.gl/terrain", | ||
"version": "3.0.0-alpha.18", | ||
"version": "3.0.0-alpha.19", | ||
"description": "Framework-independent loader for terrain raster formats", | ||
@@ -37,6 +37,6 @@ "license": "MIT", | ||
"@babel/runtime": "^7.3.1", | ||
"@loaders.gl/loader-utils": "3.0.0-alpha.18", | ||
"@loaders.gl/loader-utils": "3.0.0-alpha.19", | ||
"@mapbox/martini": "^0.2.0" | ||
}, | ||
"gitHead": "8cb1ea7be6c51bae6a4c61b8ee4b71586b02a797" | ||
"gitHead": "4e0a11c8f59a3c3b96eab8e5b81469f72d682e96" | ||
} |
@@ -1,2 +0,1 @@ | ||
/* global window, global */ | ||
const moduleExports = require('./index'); | ||
@@ -3,0 +2,0 @@ |
@@ -0,14 +1,14 @@ | ||
import {getMeshBoundingBox} from '@loaders.gl/loader-utils'; | ||
import Martini from '@mapbox/martini'; | ||
import {getMeshBoundingBox} from '@loaders.gl/loader-utils'; | ||
import Delatin from './delatin'; | ||
function getTerrain(imageData, tileSize, elevationDecoder) { | ||
function getTerrain(imageData, width, height, elevationDecoder, tesselator) { | ||
const {rScaler, bScaler, gScaler, offset} = elevationDecoder; | ||
const gridSize = tileSize + 1; | ||
// From Martini demo | ||
// https://observablehq.com/@mourner/martin-real-time-rtin-terrain-mesh | ||
const terrain = new Float32Array(gridSize * gridSize); | ||
const terrain = new Float32Array((width + 1) * (height + 1)); | ||
// decode terrain values | ||
for (let i = 0, y = 0; y < tileSize; y++) { | ||
for (let x = 0; x < tileSize; x++, i++) { | ||
for (let i = 0, y = 0; y < height; y++) { | ||
for (let x = 0; x < width; x++, i++) { | ||
const k = i * 4; | ||
@@ -21,15 +21,19 @@ const r = imageData[k + 0]; | ||
} | ||
// backfill bottom border | ||
for (let i = gridSize * (gridSize - 1), x = 0; x < gridSize - 1; x++, i++) { | ||
terrain[i] = terrain[i - gridSize]; | ||
if (tesselator === 'martini') { | ||
// backfill bottom border | ||
for (let i = (width + 1) * width, x = 0; x < width; x++, i++) { | ||
terrain[i] = terrain[i - width - 1]; | ||
} | ||
// backfill right border | ||
for (let i = height, y = 0; y < height + 1; y++, i += height + 1) { | ||
terrain[i] = terrain[i - 1]; | ||
} | ||
} | ||
// backfill right border | ||
for (let i = gridSize - 1, y = 0; y < gridSize; y++, i += gridSize) { | ||
terrain[i] = terrain[i - 1]; | ||
} | ||
return terrain; | ||
} | ||
function getMeshAttributes(vertices, terrain, tileSize, bounds) { | ||
const gridSize = tileSize + 1; | ||
function getMeshAttributes(vertices, terrain, width, height, bounds) { | ||
const gridSize = width + 1; | ||
const numOfVerticies = vertices.length / 2; | ||
@@ -41,5 +45,5 @@ // vec3. x, y in pixels, z in meters | ||
const [minX, minY, maxX, maxY] = bounds || [0, 0, tileSize, tileSize]; | ||
const xScale = (maxX - minX) / tileSize; | ||
const yScale = (maxY - minY) / tileSize; | ||
const [minX, minY, maxX, maxY] = bounds || [0, 0, width, height]; | ||
const xScale = (maxX - minX) / width; | ||
const yScale = (maxY - minY) / height; | ||
@@ -55,4 +59,4 @@ for (let i = 0; i < numOfVerticies; i++) { | ||
texCoords[2 * i + 0] = x / tileSize; | ||
texCoords[2 * i + 1] = y / tileSize; | ||
texCoords[2 * i + 0] = x / width; | ||
texCoords[2 * i + 1] = y / height; | ||
} | ||
@@ -67,3 +71,10 @@ | ||
function getMartiniTileMesh(terrainImage, terrainOptions) { | ||
/** | ||
* Returns generated mesh object from image data | ||
* | ||
* @param {object} terrainImage terrain image data | ||
* @param {object} terrainOptions terrain options | ||
* @returns mesh object | ||
*/ | ||
function getMesh(terrainImage, terrainOptions) { | ||
if (terrainImage === null) { | ||
@@ -74,14 +85,30 @@ return null; | ||
const data = terrainImage.data; | ||
const tileSize = terrainImage.width; | ||
const gridSize = tileSize + 1; | ||
const {data, width, height} = terrainImage; | ||
const terrain = getTerrain(data, tileSize, elevationDecoder); | ||
let terrain; | ||
let mesh; | ||
switch (terrainOptions.tesselator) { | ||
case 'martini': | ||
terrain = getTerrain(data, width, height, elevationDecoder, terrainOptions.tesselator); | ||
mesh = getMartiniTileMesh(meshMaxError, width, terrain); | ||
break; | ||
case 'delatin': | ||
terrain = getTerrain(data, width, height, elevationDecoder, terrainOptions.tesselator); | ||
mesh = getDelatinTileMesh(meshMaxError, width, height, terrain); | ||
break; | ||
// auto | ||
default: | ||
if (width === height && !(height & (width - 1))) { | ||
terrain = getTerrain(data, width, height, elevationDecoder, 'martini'); | ||
mesh = getMartiniTileMesh(meshMaxError, width, terrain); | ||
} else { | ||
terrain = getTerrain(data, width, height, elevationDecoder, 'delatin'); | ||
mesh = getDelatinTileMesh(meshMaxError, width, height, terrain); | ||
} | ||
break; | ||
} | ||
const martini = new Martini(gridSize); | ||
const tile = martini.createTile(terrain); | ||
const {vertices, triangles} = tile.getMesh(meshMaxError); | ||
const {vertices, triangles} = mesh; | ||
const attributes = getMeshAttributes(vertices, terrain, width, height, bounds); | ||
const attributes = getMeshAttributes(vertices, terrain, tileSize, bounds); | ||
return { | ||
@@ -97,3 +124,3 @@ // Data return by this loader implementation | ||
mode: 4, // TRIANGLES | ||
indices: {value: triangles, size: 1}, | ||
indices: {value: Uint32Array.from(triangles), size: 1}, | ||
attributes | ||
@@ -103,2 +130,36 @@ }; | ||
/** | ||
* Get Martini generated vertices and triangles | ||
* | ||
* @param {number} meshMaxError threshold for simplifying mesh | ||
* @param {number} width width of the input data | ||
* @param {number[] | Float32Array} terrain elevation data | ||
* @returns {{vertices: Uint16Array, triangles: Uint32Array}} vertices and triangles data | ||
*/ | ||
function getMartiniTileMesh(meshMaxError, width, terrain) { | ||
const gridSize = width + 1; | ||
const martini = new Martini(gridSize); | ||
const tile = martini.createTile(terrain); | ||
const {vertices, triangles} = tile.getMesh(meshMaxError); | ||
return {vertices, triangles}; | ||
} | ||
/** | ||
* Get Delatin generated vertices and triangles | ||
* | ||
* @param {number} meshMaxError threshold for simplifying mesh | ||
* @param {number} width width of the input data array | ||
* @param {number} height height of the input data array | ||
* @param {number[] | Float32Array} terrain elevation data | ||
* @returns {{vertices: number[], triangles: number[]}} vertices and triangles data | ||
*/ | ||
function getDelatinTileMesh(meshMaxError, width, height, terrain) { | ||
const tin = new Delatin(terrain, width + 1, height + 1); | ||
tin.run(meshMaxError); | ||
const {coords, triangles} = tin; | ||
const vertices = coords; | ||
return {vertices, triangles}; | ||
} | ||
export default async function loadTerrain(arrayBuffer, options, context) { | ||
@@ -109,3 +170,3 @@ options.image = options.image || {}; | ||
// Extend function to support additional mesh generation options (square grid or delatin) | ||
return getMartiniTileMesh(image, options.terrain); | ||
return getMesh(image, options.terrain); | ||
} |
@@ -20,2 +20,3 @@ /** @typedef {import('@loaders.gl/loader-utils').WorkerLoaderObject} WorkerLoaderObject */ | ||
terrain: { | ||
tesselator: 'auto', | ||
bounds: null, | ||
@@ -22,0 +23,0 @@ meshMaxError: 10, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
906024
59
14522
+ Added@loaders.gl/loader-utils@3.0.0-alpha.19(transitive)
+ Added@loaders.gl/worker-utils@3.0.0-alpha.19(transitive)
- Removed@loaders.gl/loader-utils@3.0.0-alpha.18(transitive)
- Removed@loaders.gl/worker-utils@3.0.0-alpha.18(transitive)