node-red-contrib-jwht-map/worldmap/leaflet/VectorTileLayer.umd.min.js

5 lines
22 KiB
JavaScript
Raw Normal View History

2021-10-29 18:30:03 +08:00
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VectorTileLayer=e(t.L)}(this,(function(t){"use strict";var e=i;function i(t,e){this.x=t,this.y=e}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=e*this.x-i*this.y,n=i*this.x+e*this.y;return this.x=r,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),n=e.x+i*(this.x-e.x)-r*(this.y-e.y),s=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=n,this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(t){return t instanceof i?t:Array.isArray(t)?new i(t[0],t[1]):t};var r=e,n=s;function s(t,e,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=n,t.readFields(o,this,e)}function o(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){var i=t.readVarint()+t.pos;for(;t.pos<i;){var r=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[r]=n}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function a(t){for(var e,i,r=0,n=0,s=t.length,o=s-1;n<s;o=n++)e=t[n],r+=((i=t[o]).x-e.x)*(e.y+i.y);return r}s.types=["Unknown","Point","LineString","Polygon"],s.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,s=0,o=0,a=0,u=[];t.pos<i;){if(s<=0){var h=t.readVarint();n=7&h,s=h>>3}if(s--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new r(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},s.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,n=0,s=0,o=1/0,a=-1/0,u=1/0,h=-1/0;t.pos<e;){if(r<=0){var f=t.readVarint();i=7&f,r=f>>3}if(r--,1===i||2===i)(n+=t.readSVarint())<o&&(o=n),n>a&&(a=n),(s+=t.readSVarint())<u&&(u=s),s>h&&(h=s);else if(7!==i)throw new Error("unknown command "+i)}return[o,u,a,h]},s.prototype.toGeoJSON=function(t,e,i){var r,n,o=this.extent*Math.pow(2,i),u=this.extent*t,h=this.extent*e,f=this.loadGeometry(),l=s.types[this.type];function c(t){for(var e=0;e<t.length;e++){var i=t[e],r=180-360*(i.y+h)/o;t[e]=[360*(i.x+u)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(th
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
read:function(t,e,i,r,n){var s,o,a=8*n-r-1,u=(1<<a)-1,h=u>>1,f=-7,l=i?n-1:0,c=i?-1:1,d=t[e+l];for(l+=c,s=d&(1<<-f)-1,d>>=-f,f+=a;f>0;s=256*s+t[e+l],l+=c,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=r;f>0;o=256*o+t[e+l],l+=c,f-=8);if(0===s)s=1-h;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),s-=h}return(d?-1:1)*o*Math.pow(2,s-r)},write:function(t,e,i,r,n,s){var o,a,u,h=8*s-n-1,f=(1<<h)-1,l=f>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,p=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(o++,u/=2),o+l>=f?(a=0,o=f):o+l>=1?(a=(e*u-1)*Math.pow(2,n),o+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,n),o=0));n>=8;t[i+d]=255&a,d+=p,a/=256,n-=8);for(o=o<<n|a,h+=n;h>0;t[i+d]=255&o,d+=p,o/=256,h-=8);t[i+d-p]|=128*y}},F=V,S=m;function V(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}V.Varint=0,V.Fixed64=1,V.Bytes=2,V.Fixed32=5;var _=4294967296,M=1/_,B="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function k(t){return t.type===V.Bytes?t.readVarint()+t.pos:t.pos+1}function P(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function T(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function A(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function D(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function L(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function z(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function E(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function O(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function N(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function C(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function U(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function j(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function G(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Z(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function R(t){return b(t).then((function(e){if(e.ok)return e.arrayBuffer();if(404!==e.status)throw function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return new Error(t.join(": "))}(t,e.status,e.statusText)}))}function q(t){return t.x+"|"+t.y+"|"+t.z}V.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,s=this.pos;this.type=7&r,t(n,e,this),this.pos===s&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=j(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Z(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=j(this.buf,this.pos)+j(this.buf,this.pos+4)*_;return this.pos+=8,t},readSFixed64:function(){var t=j(this.buf,this.pos)+Z(this.buf,this.pos+4)*_;return this.pos+=8,t},readFloat:function(){var t=S.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=S.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,s=i.buf;if(n=s[i.pos++],r=(112&n)>>4,n<128)return P(t,r,e);if(n=s[i.pos++],r|=(127&n)<<3,n<128)return P(t,r,e);if(n=s[i.pos++],r|=(127&n)<<10,n<128)return P(t,r,e);if(n=s[i.pos++],r|=(127&n)<<17,n<128)return P(t,r,e);if(n=s[i.pos++],r|=(127&n)<<24,n<128)return P(t,r,e);if(n=s[i.pos++],r|=(1&n)<<31,n<128)return P(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.
//# sourceMappingURL=VectorTileLayer.umd.min.js.map