11 lines
712 KiB
JavaScript
11 lines
712 KiB
JavaScript
|
|
!function(){var t=1e-6,e="undefined"!=typeof Float32Array?Float32Array:Array;function r(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return t[0]=s*c-a*u,t[1]=i*u-n*c,t[2]=n*a-i*s,t[3]=a*l-o*c,t[4]=r*c-i*l,t[5]=i*o-r*a,t[6]=o*u-s*l,t[7]=n*l-r*u,t[8]=r*s-n*o,t}function n(t,e,r){var n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=r[0],d=r[1],f=r[2],y=r[3],m=r[4],g=r[5],x=r[6],v=r[7],b=r[8];return t[0]=p*n+d*s+f*u,t[1]=p*i+d*a+f*c,t[2]=p*o+d*l+f*h,t[3]=y*n+m*s+g*u,t[4]=y*i+m*a+g*c,t[5]=y*o+m*l+g*h,t[6]=x*n+v*s+b*u,t[7]=x*i+v*a+b*c,t[8]=x*o+v*l+b*h,t}function i(){var t=new e(16);return e!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function o(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],y=e[13],m=e[14],g=e[15],x=r*a-n*s,v=r*l-i*s,b=r*u-o*s,w=n*l-i*a,_=n*u-o*a,A=i*u-o*l,S=c*y-h*f,I=c*m-p*f,P=c*g-d*f,M=h*m-p*y,D=h*g-d*y,E=p*g-d*m,C=x*E-v*D+b*M+w*P-_*I+A*S;return C?(t[0]=(a*E-l*D+u*M)*(C=1/C),t[1]=(i*D-n*E-o*M)*C,t[2]=(y*A-m*_+g*w)*C,t[3]=(p*_-h*A-d*w)*C,t[4]=(l*P-s*E-u*I)*C,t[5]=(r*E-i*P+o*I)*C,t[6]=(m*b-f*A-g*v)*C,t[7]=(c*A-p*b+d*v)*C,t[8]=(s*D-a*P+u*S)*C,t[9]=(n*P-r*D-o*S)*C,t[10]=(f*_-y*b+g*x)*C,t[11]=(h*b-c*_-d*x)*C,t[12]=(a*I-s*M-l*S)*C,t[13]=(r*M-n*I+i*S)*C,t[14]=(y*v-f*w-m*x)*C,t[15]=(c*w-h*v+p*x)*C,t):null}function a(t,e,r){var n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],y=e[12],m=e[13],g=e[14],x=e[15],v=r[0],b=r[1],w=r[2],_=r[3];return t[0]=v*n+b*a+w*h+_*y,t[1]=v*i+b*l+w*p+_*m,t[2]=v*o+b*u+w*d+_*g,t[3]=v*s+b*c+w*f+_*x,t[4]=(v=r[4])*n+(b=r[5])*a+(w=r[6])*h+(_=r[7])*y,t[5]=v*i+b*l+w*p+_*m,t[6]=v*o+b*u+w*d+_*g,t[7]=v*s+b*c+w*f+_*x,t[8]=(v=r[8])*n+(b=r[9])*a+(w=r[10])*h+(_=r[11])*y,t[9]=v*i+b*l+w*p+_*m,t[10]=v*o+b*u+w*d+_*g,t[11]=v*s+b*c+w*f+_*x,t[12]=(v=r[12])*n+(b=r[13])*a+(w=r[14])*h+(_=r[15])*y,t[13]=v*i+b*l+w*p+_*m,t[14]=v*o+b*u+w*d+_*g,t[15]=v*s+b*c+w*f+_*x,t}function l(t,e,r){var n,i,o,s,a,l,u,c,h,p,d,f,y=r[0],m=r[1],g=r[2];return e===t?(t[12]=e[0]*y+e[4]*m+e[8]*g+e[12],t[13]=e[1]*y+e[5]*m+e[9]*g+e[13],t[14]=e[2]*y+e[6]*m+e[10]*g+e[14],t[15]=e[3]*y+e[7]*m+e[11]*g+e[15]):(i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=n=e[0],t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=n*y+a*m+h*g+e[12],t[13]=i*y+l*m+p*g+e[13],t[14]=o*y+u*m+d*g+e[14],t[15]=s*y+c*m+f*g+e[15]),t}function u(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function c(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*n,t[5]=s*i+c*n,t[6]=a*i+h*n,t[7]=l*i+p*n,t[8]=u*i-o*n,t[9]=c*i-s*n,t[10]=h*i-a*n,t[11]=p*i-l*n,t}function h(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],l=e[3],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-u*n,t[1]=s*i-c*n,t[2]=a*i-h*n,t[3]=l*i-p*n,t[8]=o*n+u*i,t[9]=s*n+c*i,t[10]=a*n+h*i,t[11]=l*n+p*i,t}function p(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*n,t[1]=s*i+c*n,t[2]=a*i+h*n,t[3]=l*i+p*n,t[4]=u*i-o*n,t[5]=c*i-s*n,t[6]=h*i-a*n,t[7]=p*i-l*n,t}function d(){var t=new e(3);return e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function f(t){var r=new e(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function y(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function m(t,r,n
|
||
|
|
/**
|
||
|
|
* martinez v0.7.4
|
||
|
|
* Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor
|
||
|
|
*
|
||
|
|
* @author Alex Milevski <info@w8r.name>
|
||
|
|
* @license MIT
|
||
|
|
* @preserve
|
||
|
|
*/function Na(t,e,r,n){const i=[],o=0===n?(t,e,r,n,i,o)=>{t.push(new ot(o,r+(o-e)/(n-e)*(i-r)))}:(t,e,r,n,i,o)=>{t.push(new ot(e+(o-r)/(i-r)*(n-e),o))};for(const s of t){const t=[];for(const i of s){if(i.length<=2)continue;const s=[];for(let t=0;t<i.length-1;t++){const a=i[t].x,l=i[t].y,u=i[t+1].x,c=i[t+1].y,h=0===n?a:l,p=0===n?u:c;h<e?p>e&&o(s,a,l,u,c,e):h>r?p<r&&o(s,a,l,u,c,r):s.push(i[t]),p<e&&h>=e&&o(s,a,l,u,c,e),p>r&&h<=r&&o(s,a,l,u,c,r)}let a=i[i.length-1];const l=0===n?a.x:a.y;l>=e&&l<=r&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),t.push(s))}t.length&&i.push(t)}return i}function ja(t,e){const r=$a(t),n=$a([e]),i=Ua.intersection(r,n);return null==i?[]:qa(i)}function Ga(t,e){const r=65536;let n=$a(t,r);const i=[];for(;e.valid();e.next()){const[t,n]=e.get(),o=t.x*r,s=t.y*r,a=n.x*r,l=n.y*r,u=a-o,c=l-s,h=Math.hypot(u,c);if(0===h)continue;const p=Math.trunc(c/h*3),d=-Math.trunc(u/h*3);i.push([[[o,s],[a,l],[a+p,l+d],[o+p,s+d],[o,s]]])}return i.length>0&&(n=Ua.diff(n,i)),qa(n,1/r)}function $a(t,e=1){return[t.map((t=>t.map((t=>[t.x*e,t.y*e]))))]}function qa(t,e=1){return t.map((t=>t.map(((t,r)=>{const n=t.map((t=>new ot(t[0]*e,t[1]*e).round()));return r>0&&n.reverse(),n}))))}class FillBufferData{constructor(t,e){this.layoutVertexArray=new StructArrayLayout2i4,this.indexArray=new StructArrayLayout3ui6,this.lineIndexArray=new StructArrayLayout2ui4,this.triangleSegments=new SegmentVector,this.lineSegments=new SegmentVector,this.programConfigurations=new ProgramConfigurationSet(t.layers,{zoom:t.zoom,lut:t.lut}),this.uploaded=!1,e&&(this.elevatedLayoutVertexArray=new StructArrayLayout1f4)}update(t,e,r,n,i,o,s,a){this.programConfigurations.updatePaintArrays(t,e,i,r,n,o,s,a)}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,na.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.lineIndexBuffer=t.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=t.createVertexBuffer(this.elevatedLayoutVertexArray,ia.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(t,e,r,n,i,o,s){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,e,r,n,i,o,void 0,s)}}class FillBucket{constructor(t){this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lut=t.lut,this.bufferData=new FillBufferData(t,!1),this.elevationBufferData=new FillBufferData(t,!0),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.projection=t.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference"),this.sourceLayerIndex=t.sourceLayerIndex,this.worldview=t.worldview,this.hasAppearances=null}updateFootprints(t,e){}updateAppearances(t,e,r,n){}populate(t,e,r,n){this.hasPattern=Va("fill",this.layers,this.pixelRatio,e);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:u}of t){const t=this.layers[0]._featureFilter.needGeometry,c=Ko(s,t);if(!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom,{worldview:this.worldview,activeFloors:e.activeFloors}),c,r))continue;const h=i?i.evaluate(c,{},r,e.availableImages):void 0,p={id:a,properties:s.properties,type:s.type,sourceLayerIndex:u,index:l,geometry:t?c.geometry:Jo(s,r,n),patterns:{},sortKey:h};o.push(p)}i&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of o){const{geometry:i,index:o,sourceLayerIndex:s}=n;if
|
||
|
|
//# sourceMappingURL=mapbox-gl-csp-worker.js.map
|