diff --git a/demo/mapboxgl/App.vue b/demo/mapboxgl/App.vue index 8bf3ba4e..eb8ae7b1 100644 --- a/demo/mapboxgl/App.vue +++ b/demo/mapboxgl/App.vue @@ -9,27 +9,16 @@ 基础组件 - - - - + - + @@ -67,7 +56,6 @@ :address-match="addressMatch" :rest-map="restMapSearch" :rest-data="restDataSearch" - :iportal-data="iportalData" :online-local-search="onlineLocalSearch" :alwaysCenter="false" :data="searchData" @@ -76,11 +64,38 @@ - --> + + inputLayers = e.target.value.split(',')"> + - + + + + - + - - Manager - + Manager Jack Lucy @@ -159,16 +159,10 @@ yiminghe - - {{ (i + 9).toString(36) + i }} + + {{ + (i + 9).toString(36) + i + }} @@ -236,13 +230,20 @@ Content of Tab 3 + + +
=0;w--)if(m[g]=-1,h[w].containsBounds(h[g])){p[g]=-1*p[w],p[g]<0&&(m[g]=w);break}for(var O=0;O0?a.push(f[O]):(a[m[O]].components=a[m[O]].components.concat(f[O].components),a.push(""))}else{a=new Array;for(var S=0;S0&&a.length>0&&(a[a.length-1].components=a[a.length-1].components.concat(l),l=[]),a.push(f[S])),S==o-1){var _=a.length;if(_)a[_-1].components=a[_-1].components.concat(l);else for(var P=0,x=l.length;P-1||(e[n]=t[n]);return e}}])&&wr(e.prototype,r),n&&wr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(),kr=function(t){return"[object Array]"==Object.prototype.toString.call(t)},jr=function(t){return"string"==typeof t&&t.constructor===String},Er={toSuperMapGeometry:function(t){if(t&&t.type)return(new xr).read(t,"FeatureCollection")[0].geometry},toSuperMapBounds:function(t){return kr(t)?new F(t[0],t[1],t[2],t[3]):t instanceof o().LngLatBounds?new F(t.getWest(),t.getSouth(),t.getEast(),t.getNorth()):t},toSuperMapPoint:function(t){return kr(t)?new q(t[0],t[1]):t.lng&&t.lat?new q(t.lng,t.lat):new q(t.geometry.coordinates[0],t.geometry.coordinates[1])},toSuperMapPolygon:function(t){var e=t.getWest(),r=t.getEast(),n=t.getSouth(),o=t.getNorth();return new Ct([new Pt([new q(e,n),new q(r,n),new q(r,o),new q(e,o)])])},isArray:kr,toGeoJSON:function(t){if(t)return(new xr).toGeoJSON(t)},toProcessingParam:function(t){var e={};if(t.length<1)e="";else{for(var r=[],n=0;n1&&(r=parseFloat(r)*l),n.labelAlign&&"cm"!==n.labelAlign)switch(n.labelAlign){case"lt":u.x+=e/2,u.y+=r/2;break;case"lm":u.x+=e/2;break;case"lb":u.x+=e/2,u.y-=r/2;break;case"ct":u.y+=r/2;break;case"cb":u.y-=r/2;break;case"rt":u.x-=e/2,u.y+=r/2;break;case"rm":u.x-=e/2;break;case"rb":u.x-=e/2,u.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=e,o=u.x-parseFloat(e)/2,i=u.y+parseFloat(r)/2,s=u.x+parseFloat(e)/2,a=u.y-parseFloat(r)/2,new F(o,i,s,a)}},{key:"getLabelPxBoundsByText",value:function(t,e){var r,n,o,i,a=this.getLabelPxSize(e),s=A.cloneObject(t);if(e.labelAlign&&"cm"!==e.labelAlign)switch(e.labelAlign){case"lt":s.x+=a.w/2,s.y+=a.h/2;break;case"lm":s.x+=a.w/2;break;case"lb":s.x+=a.w/2,s.y-=a.h/2;break;case"ct":s.y+=a.h/2;break;case"cb":s.y-=a.h/2;break;case"rt":s.x-=a.w/2,s.y+=a.h/2;break;case"rm":s.x-=a.w/2;break;case"rb":s.x-=a.w/2,s.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,r=s.x-a.w/2,n=s.y+a.h/2,i=e.fontStyle&&"italic"===e.fontStyle?s.x+a.w/2+parseInt(parseFloat(e.fontSize)/2):s.x+a.w/2,o=s.y-a.h/2,new F(r,n,i,o)}},{key:"getLabelPxSize",value:function(t){var e,r,n,o,i=parseFloat(t.strokeWidth);e=t.label||this.text,r=t.fontSize?parseFloat(t.fontSize):parseFloat("12px");var a=e.split("\n"),s=a.length;o=s>1?r*s+s+i+.2*r:r+i+.2*r+1,n=0,this.labelWTmp&&n255?r++:n++;return e.cnC=r,e.enC=n,e.textC=t.length,e}}])&&Cr(e.prototype,r),n&&Cr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Ir(t,e){for(var r=0;r1&&(t=new q(e[0],e[1])),new Jt(t,this.attributes)}}])&&Fr(e.prototype,r),n&&Fr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Gr(t){"@babel/helpers - typeof";return(Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ur(t,e){for(var r=0;ri&&(i=t+s+100,n.width=i,r=!0),e+u>a&&(a=e+u+100,n.height=a,r=!0),t<-s&&(i+=s=100*Math.ceil(-t/100),n.width=i,r=!0),e<-u&&(a+=u=100*Math.ceil(-e/100),n.height=a,r=!0),r&&o.translate(s,u)}},{key:"getPixelOffset",value:function(){return{x:this._offsetX,y:this._offsetY}}},{key:"indexOf",value:function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],o=n.length,i=0;i4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],o=this._handlers[t],i=o.length,a=0;a-this.EPSILON&&tthis.EPSILON||t<-this.EPSILON}},{key:"cubicAt",value:function(t,e,r,n,o){var i=1-o;return i*i*(i*t+3*o*e)+o*o*(o*n+3*i*r)}},{key:"cubicDerivativeAt",value:function(t,e,r,n,o){var i=1-o;return 3*(((e-t)*i+2*(r-e)*o)*i+(n-r)*o*o)}},{key:"cubicRootAt",value:function(t,e,r,n,o,i){var a=n+3*(e-r)-t,s=3*(r-2*e+t),u=3*(e-t),l=t-o,c=s*s-3*a*u,f=s*u-9*a*l,h=u*u-3*s*l,p=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(s))i[0]=0;else{var y=-u/s;y>=0&&y<=1&&(i[p++]=y)}else{var d=f*f-4*c*h;if(this.isAroundZero(d)){var b=f/c,v=-s/a+b,m=-b/2;v>=0&&v<=1&&(i[p++]=v),m>=0&&m<=1&&(i[p++]=m)}else if(d>0){var g=Math.sqrt(d),w=c*s+1.5*a*(-f+g),O=c*s+1.5*a*(-f-g),S=(-s-((w=w<0?-Math.pow(-w,this.ONE_THIRD):Math.pow(w,this.ONE_THIRD))+(O=O<0?-Math.pow(-O,this.ONE_THIRD):Math.pow(O,this.ONE_THIRD))))/(3*a);S>=0&&S<=1&&(i[p++]=S)}else{var _=(2*c*s-3*a*f)/(2*Math.sqrt(c*c*c)),P=Math.acos(_)/3,x=Math.sqrt(c),k=Math.cos(P),j=(-s-2*x*k)/(3*a),E=(-s+x*(k+this.THREE_SQRT*Math.sin(P)))/(3*a),T=(-s+x*(k-this.THREE_SQRT*Math.sin(P)))/(3*a);j>=0&&j<=1&&(i[p++]=j),E>=0&&E<=1&&(i[p++]=E),T>=0&&T<=1&&(i[p++]=T)}}return p}},{key:"cubicExtrema",value:function(t,e,r,n,o){var i=6*r-12*e+6*t,a=9*e+3*n-3*t-9*r,s=3*e-3*t,u=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(i)){var l=-s/i;l>=0&&l<=1&&(o[u++]=l)}}else{var c=i*i-4*a*s;if(this.isAroundZero(c))o[0]=-i/(2*a);else if(c>0){var f=Math.sqrt(c),h=(-i+f)/(2*a),p=(-i-f)/(2*a);h>=0&&h<=1&&(o[u++]=h),p>=0&&p<=1&&(o[u++]=p)}}return u}},{key:"cubicSubdivide",value:function(t,e,r,n,o,i){var a=(e-t)*o+t,s=(r-e)*o+e,u=(n-r)*o+r,l=(s-a)*o+a,c=(u-s)*o+s,f=(c-l)*o+l;i[0]=t,i[1]=a,i[2]=l,i[3]=f,i[4]=f,i[5]=c,i[6]=u,i[7]=n}},{key:"cubicProjectPoint",value:function(t,e,r,n,o,i,a,s,u,l,c){var f,h=this.vector.create(),p=this.vector.create(),y=this.vector.create(),d=.005,b=1/0;h[0]=u,h[1]=l;for(var v=0;v<1;v+=.05){p[0]=this.cubicAt(t,r,o,a,v),p[1]=this.cubicAt(e,n,i,s,v);var m=this.vector.distSquare(h,p);m=0&&S=0&&l<=1&&(o[u++]=l)}}else{var c=a*a-4*i*s;if(this.isAroundZero(c)){var f=-a/(2*i);f>=0&&f<=1&&(o[u++]=f)}else if(c>0){var h=Math.sqrt(c),p=(-a+h)/(2*i),y=(-a-h)/(2*i);p>=0&&p<=1&&(o[u++]=p),y>=0&&y<=1&&(o[u++]=y)}}return u}},{key:"quadraticExtremum",value:function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n}},{key:"quadraticProjectPoint",value:function(t,e,r,n,o,i,a,s,u){var l,c=this.vector.create(),f=this.vector.create(),h=this.vector.create(),p=.005,y=1/0;c[0]=a,c[1]=s;for(var d=0;d<1;d+=.05){f[0]=this.quadraticAt(t,r,o,d),f[1]=this.quadraticAt(e,n,i,d);var b=this.vector.distSquare(c,f);b=0&&w0){for(var m=this.isInsidePolygon(e.pointList,b,v),g=t.holePolygonPointLists,w=!1,O=0,S=g.length;Oe+s&&a>n+s||at+s&&i>r+s||ie+f&&c>n+f&&c>i+f&&c>s+f||ct+f&&l>r+f&&l>o+f&&l>a+f||le+l&&u>n+l&&u>i+l||ut+l&&s>r+l&&s>o+l||sr||f+c=l)return!0;if(i){var h=n;n=this.normalizeRadian(o),o=this.normalizeRadian(h)}else n=this.normalizeRadian(n),o=this.normalizeRadian(o);n>o&&(o+=l);var p=Math.atan2(u,s);return p<0&&(p+=l),p>=n&&p<=o||p+l>=n&&p+l<=o}},{key:"isInsideBrokenLine",value:function(t,e,r,n){for(var o=Math.max(e,10),i=0,a=t.length-1;ir*r}},{key:"isInsideRect",value:function(t,e,r,n,o,i){return o>=t&&o<=t+r&&i>=e&&i<=e+n}},{key:"isInsideCircle",value:function(t,e,r,n,o){return(n-t)*(n-t)+(o-e)*(o-e)e&&i>n||io?ne&&l>n&&l>i&&l>s||l1&&this.swapExtrema(),y=c.cubicAt(e,n,i,s,h[0]),v>1&&(d=c.cubicAt(e,n,i,s,h[1]))),2==v?ge&&s>n&&s>i||s=0&&f<=1){for(var h=0,p=u.quadraticAt(e,n,i,f),y=0;ya||(l[y]a?0:ir||s<-r)return 0;var c=Math.sqrt(r*r-s*s);if(u[0]=-c,u[1]=c,Math.abs(n-o)>=l){n=0,o=l;var f=i?1:-1;return a>=u[0]+t&&a<=u[1]+t?f:0}if(i){var h=n;n=this.normalizeRadian(o),o=this.normalizeRadian(h)}else n=this.normalizeRadian(n),o=this.normalizeRadian(o);n>o&&(o+=l);for(var p=0,y=0;y<2;y++){var d=u[y];if(d+t>a){var b=Math.atan2(s,d),v=i?1:-1;b<0&&(b=l+b),(b>=n&&b<=o||b+l>=n&&b+l<=o)&&(b>Math.PI/2&&b<1.5*Math.PI&&(v=-v),p+=v)}}return p}},{key:"isInsidePath",value:function(t,e,r,n,o){for(var i=0,a=0,s=0,u=0,l=0,c=!0,f=!0,h="stroke"===(r=r||"fill")||"both"===r,p="fill"===r||"both"===r,y=0;y0&&(p&&(i+=this.windingLine(a,s,u,l,n,o)),0!==i))return!0;u=b[b.length-2],l=b[b.length-1],c=!1,f&&"A"!==d.command&&(f=!1,a=u,s=l)}switch(d.command){case"M":a=b[0],s=b[1];break;case"L":if(h&&this.isInsideLine(a,s,b[0],b[1],e,n,o))return!0;p&&(i+=this.windingLine(a,s,b[0],b[1],n,o)),a=b[0],s=b[1];break;case"C":if(h&&this.isInsideCubicStroke(a,s,b[0],b[1],b[2],b[3],b[4],b[5],e,n,o))return!0;p&&(i+=this.windingCubic(a,s,b[0],b[1],b[2],b[3],b[4],b[5],n,o)),a=b[4],s=b[5];break;case"Q":if(h&&this.isInsideQuadraticStroke(a,s,b[0],b[1],b[2],b[3],e,n,o))return!0;p&&(i+=this.windingQuadratic(a,s,b[0],b[1],b[2],b[3],n,o)),a=b[2],s=b[3];break;case"A":var v=b[0],m=b[1],g=b[2],w=b[3],O=b[4],S=b[5],_=Math.cos(O)*g+v,P=Math.sin(O)*w+m;f?(f=!1,u=_,l=P):i+=this.windingLine(a,s,_,P);var x=(n-v)*w/g+v;if(h&&this.isInsideArcStroke(v,m,w,O,O+S,1-b[7],e,x,o))return!0;p&&(i+=this.windingArc(v,m,w,O,O+S,1-b[7],x,o)),a=Math.cos(O+S)*g+v,s=Math.sin(O+S)*w+m;break;case"z":if(h&&this.isInsideLine(a,s,u,l,e,n,o))return!0;c=!0}}return p&&(i+=this.windingLine(a,s,u,l,n,o)),0!==i}},{key:"getTextWidth",value:function(t,e){var r=t+":"+e;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,o=0,i=(t=(t+"").split("\n")).length;othis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}},{key:"getTextHeight",value:function(t,e){var r=t+":"+e;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e),t=(t+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*t.length;return this._ctx.restore(),this._textHeightCache[r]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}}])&&Qr(e.prototype,r),n&&Qr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zr(t,e){for(var r=0;r1)for(var o=0,i=n-1;o1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}}},{key:"toArray",value:function(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],r=0;return t.replace(/[\d.]+/g,function(t){r<3?t|=0:t=+t,e[r++]=t}),e}},{key:"convert",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):e.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,e)}},{key:"toRGBA",value:function(t){return this.convert(t,"rgba")}},{key:"toRGB",value:function(t){return this.convert(t,"rgb")}},{key:"toHex",value:function(t){return this.convert(t,"hex")}},{key:"toHSVA",value:function(t){return this.convert(t,"hsva")}},{key:"toHSV",value:function(t){return this.convert(t,"hsv")}},{key:"toHSBA",value:function(t){return this.convert(t,"hsba")}},{key:"toHSB",value:function(t){return this.convert(t,"hsb")}},{key:"toHSLA",value:function(t){return this.convert(t,"hsla")}},{key:"toHSL",value:function(t){return this.convert(t,"hsl")}},{key:"toName",value:function(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}},{key:"trim",value:function(t){return String(t).replace(/\s+/g,"")}},{key:"normalize",value:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t}},{key:"lift",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=e>0?1:-1;void 0===e&&(e=0),e=Math.abs(e)>1?1:Math.abs(e),t=this.toRGB(t);for(var n=this.getData(t),o=0;o<3;o++)n[o]=1===r?n[o]*(1-e)|0:(255-n[o])*e+n[o]|0;return"rgb("+n.join(",")+")"}},{key:"reverse",value:function(t){if(!this.isCalculableColor(t))return t;var e=this.getData(this.toRGBA(t));return e=this.map(e,function(t){return 255-t}),this.toColor(e,"rgb")}},{key:"mix",value:function(t,e,r){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,o=this.getData(this.toRGBA(t)),i=this.getData(this.toRGBA(e)),a=o[3]-i[3],s=((n*a==-1?n:(n+a)/(1+n*a))+1)/2,u=1-s,l=[],c=0;c<3;c++)l[c]=o[c]*s+i[c]*u;var f=o[3]*r+i[3]*(1-r);return f=Math.max(0,Math.min(1,f)),1===o[3]&&1===i[3]?this.toColor(l,"rgb"):(l[3]=f,this.toColor(l,"rgba"))}},{key:"random",value:function(){return"#"+Math.random().toString(16).slice(2,8)}},{key:"getData",value:function(e){var r,n,o=(e=this.normalize(e)).match(this.colorRegExp);if(null===o)throw new Error("The color format error");var i,a=[];if(o[2])i=[(r=o[2].replace("#","").split(""))[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(i,function(e){return t.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(o[4]){var s=o[4].split(",");n=s[3],i=s.slice(0,3),a=this.map(i,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),t.prototype.adjust.call(this,e,[0,255])}),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}else if(o[5]||o[6]){var u=(o[5]||o[6]).split(","),l=parseInt(u[0],0)/360,c=u[1],f=u[2];n=u[3],(a=this.map([c,f],function(e){return t.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}return a}},{key:"alpha",value:function(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var r=this.getData(this.toRGBA(t));return r[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(r,"rgba")}},{key:"map",value:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t}},{key:"isCalculableColor",value:function(t){return t instanceof Array||"string"==typeof t}},{key:"_HSV_2_RGB",value:function(t){var e,r,n,o=t[0],i=t[1],a=t[2];if(0===i)e=255*a,r=255*a,n=255*a;else{var s=6*o;6===s&&(s=0);var u=0|s,l=a*(1-i),c=a*(1-i*(s-u)),f=a*(1-i*(1-(s-u))),h=0,p=0,y=0;0===u?(h=a,p=f,y=l):1===u?(h=c,p=a,y=l):2===u?(h=l,p=a,y=f):3===u?(h=l,p=c,y=a):4===u?(h=f,p=l,y=a):(h=a,p=l,y=c),e=255*h,r=255*p,n=255*y}return[e,r,n]}},{key:"_HSL_2_RGB",value:function(t){var e,r,n,o=t[0],i=t[1],a=t[2];if(0===i)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+i):a+i-i*a);e=255*this._HUE_2_RGB(u,s,o+1/3),r=255*this._HUE_2_RGB(u,s,o),n=255*this._HUE_2_RGB(u,s,o-1/3)}return[e,r,n]}},{key:"_HUE_2_RGB",value:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}},{key:"_RGB_2_HSB",value:function(t){var e,r,n=t[0]/255,o=t[1]/255,i=t[2]/255,a=Math.min(n,o,i),s=Math.max(n,o,i),u=s-a,l=s;if(0===u)e=0,r=0;else{r=u/s;var c=((s-n)/6+u/2)/u,f=((s-o)/6+u/2)/u,h=((s-i)/6+u/2)/u;n===s?e=h-f:o===s?e=1/3+c-h:i===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}},{key:"_RGB_2_HSL",value:function(t){var e,r,n=t[0]/255,o=t[1]/255,i=t[2]/255,a=Math.min(n,o,i),s=Math.max(n,o,i),u=s-a,l=(s+a)/2;if(0===u)e=0,r=0;else{r=l<.5?u/(s+a):u/(2-s-a);var c=((s-n)/6+u/2)/u,f=((s-o)/6+u/2)/u,h=((s-i)/6+u/2)/u;n===s?e=h-f:o===s?e=1/3+c-h:i===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}}])&&Zr(e.prototype,r),n&&Zr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $r(t,e){for(var r=0;ro&&(o=u[0]),u[1]a&&(a=u[1])}e[0]=n,e[1]=i,r[0]=o,r[1]=a}}},{key:"cubeBezier",value:function(t,e,r,n,o,i){var a=new Yr,s=[];a.cubicExtrema(t[0],e[0],r[0],n[0],s);for(var u=0;uo&&!i?o+=2*Math.PI:nn&&(f[0]=Math.cos(p)*r+t,f[1]=Math.sin(p)*r+e,u.min(a,f,a),u.max(s,f,s))}}])&&$r(e.prototype,r),n&&$r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function en(t,e){for(var r=0;r=200&&o.status<300||304===o.status?e&&e(o.responseText):r&&r(),o.onreadystatechange=new Function,o=null)},o.send(null)}}])&&sn(e.prototype,r),n&&sn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ln(t,e){for(var r=0;r1)for(var e in arguments)console.log(arguments[e])}}var e,r,n;return e=t,(r=[{key:"destory",value:function(){return!0}}])&&fn(e.prototype,r),n&&fn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pn(t,e){for(var r=0;ra-2?a-1:p+1][0]+i[0],e[p>a-2?a-1:p+1][1]+i[1]],m=[e[p>a-3?a-1:p+2][0]+i[0],e[p>a-3?a-1:p+2][1]+i[1]]);var g=y*y,w=y*g;s.push([O(d[0],b[0],v[0],m[0],y,g,w),O(d[1],b[1],v[1],m[1],y,g,w)])}return s;function O(t,e,r,n,o,i,a){var s=.5*(r-t),u=.5*(n-e);return(2*(e-r)+s+u)*a+(-3*(e-r)-2*s-u)*i+s*o+e}}},{key:"SUtil_dashedLineTo",value:function(t,e,r,n,o,i,a){var s=[5,5];if(i="number"!=typeof i?5:i,t.setLineDash)return s[0]=i,s[1]=i,a&&a instanceof Array?t.setLineDash(a):t.setLineDash(s),t.moveTo(e,r),void t.lineTo(n,o);var u=n-e,l=o-r,c=Math.floor(Math.sqrt(u*u+l*l)/i);u/=c,l/=c;for(var f=!0,h=0;h-5e-5&&t<5e-5}mn.Util_vector.sub(e,t,this.position),n(e[0])&&n(e[1])||(mn.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})}var e,r,n;return e=t,(r=[{key:"destroy",value:function(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}},{key:"updateNeedTransform",value:function(){function t(t){return t>5e-5||t<-5e-5}this.needLocalTransform=t(this.rotation[0])||t(this.position[0])||t(this.position[1])||t(this.scale[0]-1)||t(this.scale[1]-1)}},{key:"updateTransform",value:function(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var t=[0,0],e=this.transform||mn.Util_matrix.create();if(mn.Util_matrix.identity(e),this.needLocalTransform){if(o(this.scale[0])||o(this.scale[1])){t[0]=-this.scale[2]||0,t[1]=-this.scale[3]||0;var r=o(t[0])||o(t[1]);r&&mn.Util_matrix.translate(e,e,t),mn.Util_matrix.scale(e,e,this.scale),r&&(t[0]=-t[0],t[1]=-t[1],mn.Util_matrix.translate(e,e,t))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){t[0]=-this.rotation[1]||0,t[1]=-this.rotation[2]||0;var n=o(t[0])||o(t[1]);n&&mn.Util_matrix.translate(e,e,t),mn.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],mn.Util_matrix.translate(e,e,t))}}else 0!=+this.rotation&&mn.Util_matrix.rotate(e,e,this.rotation);(o(this.position[0])||o(this.position[1]))&&mn.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?mn.Util_matrix.mul(this.transform,this.parent.transform,this.transform):mn.Util_matrix.copy(this.transform,this.parent.transform))}function o(t){return t>5e-5||t<-5e-5}}},{key:"setTransform",value:function(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}},{key:"decomposeTransform",value:function(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],r=this.position,n=this.scale,o=this.rotation;a(e-1)&&(e=Math.sqrt(e));var i=t[2]*t[2]+t[3]*t[3];a(i-1)&&(i=Math.sqrt(i)),r[0]=t[4],r[1]=t[5],n[0]=e,n[1]=i,n[2]=n[3]=0,o[0]=Math.atan2(-t[1]/i,t[0]/e),o[1]=o[2]=0}function a(t){return t>5e-5||t<-5e-5}}}])&&gn(e.prototype,r),n&&gn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function On(t){"@babel/helpers - typeof";return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sn(t,e){for(var r=0;r0}},{key:"addRoot",value:function(t){t instanceof En&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}},{key:"delRoot",value:function(t){if(void 0===t){for(var e=0;e=0&&(this.delFromMap(i.id),this._roots.splice(a,1),i instanceof En&&i.delChildrenFromStorage(this))}}},{key:"addToMap",value:function(t){return t instanceof En&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}},{key:"get",value:function(t){return this._elements[t]}},{key:"delFromMap",value:function(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof En&&(e._storage=null)),this}},{key:"dispose",value:function(){this._elements=null,this._roots=null,this._hoverElements=null}}])&&Tn(e.prototype,r),n&&Tn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Rn(t){"@babel/helpers - typeof";return(Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function An(t,e){for(var r=0;r1},isLeftClick:function(t){return t.which&&1===t.which||t.button&&1===t.button},isRightClick:function(t){return t.which&&3===t.which||t.button&&2===t.button},stop:function(t,e){e||(t.preventDefault?t.preventDefault():t.returnValue=!1),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},findElement:function(t,e){for(var r=Gn.element(t);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=e.toUpperCase());)r=r.parentNode;return r},observe:function(t,e,r,n){var o=A.getElement(t);if(n=n||!1,"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||o.attachEvent)&&(e="keydown"),this.observers||(this.observers={}),!o._eventCacheID){var i="eventCacheID_";o.id&&(i=o.id+"_"+i),o._eventCacheID=A.createUniqueID(i)}var a=o._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:o,name:e,observer:r,useCapture:n}),o.addEventListener?"mousewheel"===e?o.addEventListener(e,r,{useCapture:n,passive:!1}):o.addEventListener(e,r,n):o.attachEvent&&o.attachEvent("on"+e,r)},stopObservingElement:function(t){var e=A.getElement(t)._eventCacheID;this._removeElementObservers(Gn.observers[e])},_removeElementObservers:function(t){if(t)for(var e=t.length-1;e>=0;e--){var r=t[e],n=new Array(r.element,r.name,r.observer,r.useCapture);Gn.stopObserving.apply(this,n)}},stopObserving:function(t,e,r,n){n=n||!1;var o=A.getElement(t),i=o._eventCacheID;"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||o.detachEvent)&&(e="keydown");var a=!1,s=Gn.observers[i];if(s)for(var u=0;!a&&u0&&(this.setCtxGlobalAlpha(t,"stroke",r),t.stroke()),this.setCtxGlobalAlpha(t,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",r),r.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",r);break;default:this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)}this.drawText(t,r,this.style),this.afterBrush(t)}},{key:"beforeBrush",value:function(t,e){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),e&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r}},{key:"afterBrush",value:function(t){t.restore()}},{key:"setContext",value:function(t,e){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,o=r.length;n=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&mn.Util_area.isInside(this,this.style,t,e)}},{key:"drawText",value:function(t,e,r){if(void 0!==e.text&&!1!==e.text){var n=e.textColor||e.color||e.strokeColor;t.fillStyle=n;var o,a,s,u,l=10,c=e.textPosition||this.textPosition||"top",f=[];switch(f=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],c){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var h=(r||e).__rect||this.getRect(r||e);switch(c){case"inside":s=h.x+h.width/2,u=h.y+h.height/2,o="center",a="middle","stroke"!=e.brushType&&n==e.color&&(t.fillStyle="#fff");break;case"left":s=h.x-l,u=h.y+h.height/2,o="end",a="middle";break;case"right":s=h.x+h.width+l,u=h.y+h.height/2,o="start",a="middle";break;case"top":s=h.x+h.width/2,u=h.y-l,o="center",a="bottom";break;case"bottom":s=h.x+h.width/2,u=h.y+h.height+l,o="center",a="top"}}break;case"start":case"end":var p=0,y=0,d=0,b=0;if(void 0!==e.pointList){var v=e.pointList;if(v.length<2)return;var m=v.length;switch(c){case"start":p=v[0][0]+f[0],y=v[1][0]+f[0],d=v[0][1]+f[1],b=v[1][1]+f[1];break;case"end":p=v[m-2][0]+f[0],y=v[m-1][0]+f[0],d=v[m-2][1]+f[1],b=v[m-1][1]+f[1]}}else p=e.xStart+f[0]||0,y=e.xEnd+f[0]||0,d=e.yStart+f[1]||0,b=e.yEnd+f[1]||0;switch(c){case"start":o=p0&&t>this._zlevelList[0]){for(o=0;ot);o++);n=this._layers[this._zlevelList[o]]}this._zlevelList.splice(o+1,0,t),e=new Oo(A.createUniqueID("_levelLayer_"+t),this);var i=n?n.dom:this._bgDom;i.nextSibling?i.parentNode.insertBefore(e.dom,i.nextSibling):i.parentNode.appendChild(e.dom),e.initContext(),this._layers[t]=e,this._layerConfig[t]&&(new zr).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}},{key:"getLayers",value:function(){return this._layers}},{key:"_updateLayerStatus",value:function(t){var e=this._layers,r={};for(var n in e)"hover"!==n&&(r[n]=e[n].elCount,e[n].elCount=0);for(var o=0;o0?1.1:1/1.1,r=this.painter.getLayers(),n=!1;for(var o in r)if("hover"!==o){var i=r[o],a=i.position;if(i.zoomable){i.__zoom=i.__zoom||1;var s=i.__zoom;s*=e,e=(s=Math.max(Math.min(i.maxZoom,s),i.minZoom))/i.__zoom,i.__zoom=s,a[0]-=(this._mouseX-a[0])*(e-1),a[1]-=(this._mouseY-a[1])*(e-1),i.scale[0]*=e,i.scale[1]*=e,i.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,cn.EVENT.MOUSEWHEEL,t),this._mousemoveHandler(t)},mousemove:function(t){this._clickThreshold++,t=this._zrenderEventFixed(t),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=mn.Util_event.getX(t),this._mouseY=mn.Util_event.getY(t);var e=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(t),this._hasfound=0,this._event=t,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(t),this._processDragLeave(t)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,e,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var o=this.painter.getLayers(),i=!1;for(var a in o)if("hover"!==a){var s=o[a];s.panable&&(n="move",s.position[0]+=e,s.position[1]+=r,i=!0,s.dirty=!0)}i&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,cn.EVENT.MOUSEMOVE,t),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(t){var e=(t=this._zrenderEventFixed(t)).toElement||t.relatedTarget;if(e!=this.root)for(;e&&9!=e.nodeType;){if(e==this.root)return void this._mousemoveHandler(t);e=e.parentNode}t.zrenderX=this._lastX,t.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(t),this._processDrop(t),this._processDragEnd(t),this.painter.refreshHover(),this.dispatch(cn.EVENT.GLOBALOUT,t)},mousedown:function(t){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=t.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,t=this._zrenderEventFixed(t),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,cn.EVENT.MOUSEDOWN,t),this._lastDownButton=t.button},mouseup:function(t){t=this._zrenderEventFixed(t),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,cn.EVENT.MOUSEUP,t),this._processDrop(t),this._processDragEnd(t)},touchstart:function(t){t=this._zrenderEventFixed(t,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(t),this._mousedownHandler(t)},touchmove:function(t){t=this._zrenderEventFixed(t,!0),this._mousemoveHandler(t),this._isDragging&&mn.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment=0;o--){var i=r[o];if(void 0!==i.zlevel&&(t=this.painter.getLayer(i.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(mn.Util_matrix.invert(e,t.transform),mn.Util_vector.applyTransform(n,n,e))),this._findHover(i,n[0],n[1]))break}}},{key:"_mobildFindFixed",value:function(t){var e=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=t.zrenderX,this._mouseY=t.zrenderY,this._event=t,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r=0&&this._clips.splice(e,1)}},{key:"_update",value:function(){for(var t=(new Date).getTime(),e=t-this._time,r=this._clips,n=r.length,o=[],i=[],a=0;a=0&&!(d[w]<=a);w--);w=Math.min(w,l-2)}else{for(w=k;wa);w++);w=Math.min(w-1,l-2)}k=w,j=a;var s=d[w+1]-d[w];if(0!==s){var c,y;for(O=(a-d[w])/s,i?(_=b[w],S=b[0===w?w:w-1],P=b[w>l-2?l-1:w+1],x=b[w>l-3?l-1:w+2],f?Uo._catmullRomInterpolateArray(S,_,P,x,O,O*O,O*O*O,n(t,u),p):(c=h?Uo.rgba2String(E):Uo._catmullRomInterpolate(S,_,P,x,O,O*O,O*O*O),r(t,u,c))):f?Uo._interpolateArray(b[w],b[w+1],O,n(t,u),p):(h?(Uo._interpolateArray(b[w],b[w+1],O,E,1),y=Uo.rgba2String(E)):y=Uo._interpolateNumber(b[w],b[w+1],O),r(t,u,y)),w=0;w=0;e--)t[e].destroy()}}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,this.display(t),this.redrawThematicFeatures(this.map.getBounds()))}},{key:"display",value:function(t){this.div.style.display=t?"block":"none"}},{key:"setOpacity",value:function(t){if(t!==this.opacity){this.opacity=t;var e=this.div;A.modifyDOMElement(e,null,null,null,null,null,null,t),null!==this.map&&o().Evented.prototype.fire("changelayer",{layer:this,property:"opacity"})}}},{key:"addFeatures",value:function(t){}},{key:"removeFeatures",value:function(t){var e=this;if(t){if(t===e.features)return e.removeAllFeatures();A.isArray(t)||"function"==typeof t||(t=[t]);for(var r=[],n=0;n=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){n=!0;break}}return n}},{key:"clearCache",value:function(){this.cache={},this.charts=[]}},{key:"removeFeatures",value:function(t){this.clearCache(),$o(ri(a.prototype),"removeFeatures",this).call(this,t)}},{key:"removeAllFeatures",value:function(){this.clearCache(),$o(ri(a.prototype),"removeAllFeatures",this).call(this)}},{key:"redraw",value:function(){return this.clearCache(),!!this.renderer&&(this.redrawThematicFeatures(this.map.getBounds()),!0)}},{key:"clear",value:function(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}}])&&Ko(e.prototype,r),n&&Ko(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}();function oi(t,e){for(var r=0;rn&&(n=u[0]),u[1]o&&(o=u[1]))}return t.__rect={x:e,y:r,width:n-e,height:o-r},t.__rect}},{key:"getRectNoRotation",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition,n=mn.Util_area.getTextHeight("ZH",t.textFont),o=mn.Util_area.getTextWidth(t.text,t.textFont),i=mn.Util_area.getTextHeight(t.text,t.textFont),a=t.x+r[0];"end"==t.textAlign||"right"==t.textAlign?a-=o:"center"==t.textAlign&&(a-=o/2),e="top"==t.textBaseline?t.y+r[1]:"bottom"==t.textBaseline?t.y+r[1]-i:t.y+r[1]-i/2;var s,u=!1;if(t.maxWidth){var l=parseInt(t.maxWidth);l-1&&(o+=!0===u?n/3*(o/s):n/3));return{x:a,y:e,width:o,height:i}}},{key:"getTextBackground",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!e&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),o=t.x+r[0],i=t.y+r[1],a=[];if(t.textRotation&&0!==t.textRotation){var s=t.textRotation,u=this.getRotatedLocation(n.x,n.y,o,i,s),l=this.getRotatedLocation(n.x+n.width,n.y,o,i,s),c=this.getRotatedLocation(n.x+n.width,n.y+n.height,o,i,s),f=this.getRotatedLocation(n.x,n.y+n.height,o,i,s);a.push(u),a.push(l),a.push(c),a.push(f)}else{var h=[n.x,n.y],p=[n.x+n.width,n.y],y=[n.x+n.width,n.y+n.height],d=[n.x,n.y+n.height];a.push(h),a.push(p),a.push(y),a.push(d)}return t.__textBackground=a,t.__textBackground}},{key:"getRotatedLocation",value:function(t,e,r,n,o){var i,a,s=new Array;return e=-e,n=-n,o=-o,i=(t-r)*Math.cos(o/180*Math.PI)-(e-n)*Math.sin(o/180*Math.PI)+r,a=(t-r)*Math.sin(o/180*Math.PI)+(e-n)*Math.cos(o/180*Math.PI)+n,s[0]=i,s[1]=-a,s}}])&&ba(e.prototype,r),n&&ba(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Sa(t){"@babel/helpers - typeof";return(Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _a(t,e){for(var r=0;r0&&("stroke"==r.brushType||"both"==r.brushType)&&(n||(t.beginPath(),this.buildPath(t,r)),this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)),this.drawText(t,r,this.style);var o=A.cloneObject(r);if(o.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var i=this.holePolygonPointLists,a=i.length,s=0;s0&&("stroke"==o.brushType||"both"==o.brushType)?(n||(t.beginPath(),this.buildPath(t,o)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",o),t.stroke(),this.setCtxGlobalAlpha(t,"reset",o)):t.globalCompositeOperation="source-over"}t.restore()}},{key:"buildPath",value:function(t,e){e.showShadow&&(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var o,i,a,s=mn.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,r);t.moveTo(n[0][0]+r[0],n[0][1]+r[1]);for(var u=n.length,l=0;li&&(i=u[l][0]+r[0]),u[l][1]+r[1]s&&(s=u[l][1]+r[1]);return n="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(o-n/2),y:Math.round(a-n/2),width:i-o+n,height:s-a+n},t.__rect}}])&&Ca(e.prototype,r),n&&Ca(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Ia(t){"@babel/helpers - typeof";return(Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Da(t,e){for(var r=0;rc&&(r*=c/(a=r+n),n*=c/a),o+i>c&&(o*=c/(a=o+i),i*=c/a),n+o>f&&(n*=f/(a=n+o),o*=f/a),r+i>f&&(r*=f/(a=r+i),i*=f/a),t.moveTo(u+r,l),t.lineTo(u+c-n,l),0!==n&&t.quadraticCurveTo(u+c,l,u+c,l+n),t.lineTo(u+c,l+f-o),0!==o&&t.quadraticCurveTo(u+c,l+f,u+c-o,l+f),t.lineTo(u+i,l+f),0!==i&&t.quadraticCurveTo(u,l+f,u,l+f-i),t.lineTo(u,l+r),0!==r&&t.quadraticCurveTo(u,l,u+r,l)}},{key:"buildPath",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+r[0],e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1])),t.closePath()}},{key:"getRect",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+r[0]-e/2),y:Math.round(t.y+r[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}])&&Va(e.prototype,r),n&&Va(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function Xa(t){"@babel/helpers - typeof";return(Xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Za(t,e){for(var r=0;r1?mn.Util_computeBoundingBox.arc(a,s,u,c,f,!h,r,o):(r[0]=o[0]=a,r[1]=o[1]=s),mn.Util_computeBoundingBox.arc(a,s,l,c,f,!h,n,i),mn.Util_vector.min(r,r,n),mn.Util_vector.max(o,o,i),t.__rect={x:r[0],y:r[1],width:o[0]-r[0],height:o[1]-r[1]},t.__rect}}])&&Za(e.prototype,r),n&&Za(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function ns(t,e){for(var r=0;r=15){var h=parseInt(i.axis3DParameter),p=[o[0]-h,o[1]+h];i.axisUseArrow?(c.push([p[0]+1.5,p[1]-7.5]),c.push([p[0]-1,p[1]+1]),c.push([p[0]+7.5,p[1]-1.5]),f.push([p[0],p[1]])):f.push([p[0],p[1]]),f.push([o[0],o[1]])}f.push([o[2]+5,o[1]])}else{var y=Math.abs(o[1]-o[3])/l,d=o[3];f.push([o[0],d-5]);for(var b=0;b=15){var m=parseInt(i.axis3DParameter),g=[o[0]-m,o[1]+m];i.axisUseArrow?(c.push([g[0]+1.5,g[1]-7.5]),c.push([g[0]-1,g[1]+1]),c.push([g[0]+7.5,g[1]-1.5]),f.push([g[0],g[1]])):f.push([g[0],g[1]]),f.push([o[0],o[1]])}f.push([o[2]+5,o[1]])}if(i.axisUseArrow){var w=[[o[2]+5,o[1]+4],[o[2]+13,o[1]],[o[2]+5,o[1]-4]],O=[[o[0]-4,o[3]-5],[o[0],o[3]-13],[o[0]+4,o[3]-5]],S=new ki(w);S.style={fillColor:"#008acd"},A.copyAttributesWithClip(S.style,i.axisStyle),s.push(t.createShape(S));var _=new ki(O);if(_.style={fillColor:"#008acd"},A.copyAttributesWithClip(_.style,i.axisStyle),s.push(t.createShape(_)),i.axis3DParameter&&!isNaN(i.axis3DParameter)&&i.axis3DParameter>=15){var P=new ki(c);P.style={fillColor:"#008acd"},A.copyAttributesWithClip(P.style,i.axisStyle),s.push(t.createShape(P))}}var x=new gi(f);x.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},i.axisStyle&&A.copyAttributesWithClip(x.style,i.axisStyle),x.clickable=!1,x.hoverable=!1;var k=[t.createShape(x)],j=[];if(i.axisYLabels&&i.axisYLabels.length&&i.axisYLabels.length>0){var E=i.axisYLabels,T=E.length,C=[0,0];if(i.axisYLabelsOffset&&i.axisYLabelsOffset.length&&(C=i.axisYLabelsOffset),1==T){var R=new Wi(o[0]-5+C[0],o[3]+C[1],E[0]);R.style={labelAlign:"right"},i.axisYLabelsStyle&&A.copyAttributesWithClip(R.style,i.axisYLabelsStyle),R.clickable=!1,R.hoverable=!1,j.push(t.createShape(R))}else for(var M=o[3],L=Math.abs(o[1]-o[3])/(T-1),N=0;N0){var F=i.axisXLabels,B=F.length,G=[0,0];if(i.axisXLabelsOffset&&i.axisXLabelsOffset.length&&(G=i.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length==B)for(var U=n.xPositions,z=0;z=0&&r[o]&&A.copyAttributesWithClip(a,r[o]),n&&n.length&&void 0!==i)for(var s=n,u=s.length,l=parseFloat(i),c=0;c0){var l=i[i.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}i.push(n)}if(i.length<2)return null;var c=new Object;(c=A.copyAttributesWithClip(c,this.style,["pointList"])).pointList=i;var f=new za({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&A.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}},{key:"multiPointToTF",value:function(t){for(var e=t.components,r=[],n=[],o=this.location,i=[],a=this.nodesClipPixel,s=0;s0){var l=i[i.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}i.push(n);var c=new Object;c.r=6,(c=A.copyAttributesWithClip(c,this.style)).x=n[0],c.y=n[1];var f=new ya({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=o,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&A.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}},{key:"multiLineStringToTF",value:function(t){for(var e=t.components,r=0;r0){var h=i[i.length-1];if(Math.abs(h[0]-n[0])<=u&&Math.abs(h[1]-n[1])<=u)continue}i.push(n)}}else{a=[];for(var p=0;p0){var y=a[a.length-1];if(Math.abs(y[0]-n[0])<=u&&Math.abs(y[1]-n[1])<=u)continue}a.push(n)}}a.length<2||s.push(a)}if(!(i.length<2)){var d={};(d=A.copyAttributesWithClip(d,this.style,["pointList"])).pointList=i;var b=new Na({style:d,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(b.highlightStyle=this.highlightStyle),b.refOriginalPosition=this.location,b.refDataID=this.data.id,b.isHoverByRefDataID=this.isMultiHover,s.length>0&&(b.holePolygonPointLists=s),this.shapeOptions&&A.copyAttributesWithClip(b,this.shapeOptions),this.shapes.push(b)}}},{key:"rectangleToTF",value:function(t){var e=this.location,r=new I(t.x,t.y),n=this.layer.map.getResolution(),o=this.getLocalXY(r),i=new Object;i.r=6,(i=A.copyAttributesWithClip(i,this.style)).x=o[0]-e[0],i.y=o[1]-e[1]-2*t.width/n,i.width=t.width/n,i.height=t.height/n;var a=new Qa({style:i,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=e,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&A.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}},{key:"geoTextToTF",value:function(t){var e=this.location,r=this.getLocalXY(t),n=new Object;n.r=6,(n=A.copyAttributesWithClip(n,this.style,["x","y","text"])).x=r[0]-e[0],n.y=r[1]-e[1],n.text=t.text;var o=new Oa({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(o.highlightStyle=this.highlightStyle),o.refOriginalPosition=e,o.refDataID=this.data.id,o.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&A.copyAttributesWithClip(o,this.shapeOptions),this.shapes.push(o)}},{key:"updateAndAddShapes",value:function(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,r=0,n=this.shapes.length;rs){var h=i[0];i.splice(0,1),delete o[h]}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var p=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(p)}}},{key:"createThematicFeature",value:function(t){var e=A.copyAttributesWithClip(this.style);t.style&&!0===this.isAllowFeatureStyle&&(e=A.copyAttributesWithClip(t.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=os.transformStyle(this.highlightStyle);for(var n=new ps(t,this,os.transformStyle(e),r),o=0;o0&&0==this.labelFeatures.length)for(var e=this.setLabelsStyle(this.features),r=0,n=e.length;r=0&&y.x<=f.x&&y.y>=0&&y.y<=f.y){if(r.style.minZoomLevel>-1&&l<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&l>r.style.maxZoomLevel)continue;var d=null;r.isStyleChange?(r.isStyleChange=null,d=this.calculateLabelBounds(r,y)):d=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,y):this.calculateLabelBounds(r,y);var b=new F(0,f.y,f.x,0),v=d.length;if(this.isAvoid){var m=this.getAvoidInfo(b,d);if(m){if("left"===m.aspectW){r.style.labelXOffset+=m.offsetX;for(var g=0;g=o[u].start&&a=o[u].start&&as&&(s=r,u="top")}if(e.y>t.bottom){var n=Math.abs(e.y-t.bottom);n>s&&(s=n,u="bottom")}if(e.xa&&(a=o,l="left")}if(e.x>t.right){var i=Math.abs(e.x-t.right);i>a&&(a=i,l="right")}}}}},{key:"isQuadrilateralOverLap",value:function(t,e){var r=t.length,n=e.length;if(5!==r||5!==n)return null;for(var o=!1,i=0;it-n&&r.time1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[-180,180],o=n[1],i=n[0],a=o-i;return t===o&&e?t:t===i&&r?t:0===((t-i)%a+a)%a&&e?o:((t-i)%a+a)%a+i}function zs(t){var e=parseInt(t),r=parseInt(60*(t-e)),n=parseInt(60*(60*(t-e)-r));return r=0===parseInt(r/10)?"0".concat(r):r,n=0===parseInt(n/10)?"0".concat(n):n,"".concat(e,"°").concat(r,"'").concat(n)}function Js(t,e,r){return 1/(t*e*(1/.0254)*Gs(r))}function Vs(t,e){for(var r=0;rthis.mapVOptions.maxZoom)}},{key:"_getResolution",value:function(){var t=this.map.getBounds(),e=(t.getEast()-t.getWest())/this.map.getCanvas().getBoundingClientRect().width;return Gs("DEGREE")*e}},{key:"_getCenterPixel",value:function(){return this.map.project(new(o().LngLat)(0,0))}},{key:"addData",value:function(t,e){this.renderer.addData(t,e)}},{key:"update",value:function(t){this.renderer.update(t)}},{key:"getData",value:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet}},{key:"removeData",value:function(t){this.renderer&&this.renderer.removeData(t)}},{key:"clearData",value:function(){this.renderer.clearData()}},{key:"show",value:function(){return this.renderer&&this.renderer.show(),this}},{key:"hide",value:function(){return this.renderer&&this.renderer.hide(),this}},{key:"getTopLeft",value:function(){var t,e=this.map;e&&(t=e.getBounds().getNorthWest());return t}},{key:"bindEvent",value:function(){var t=this.map;this.mapVOptions.methods&&(this.mapVOptions.methods.click&&t.on("click",this.renderer.clickEvent),this.mapVOptions.methods.mousemove&&t.on("mousemove",this.renderer.mousemoveEvent))}},{key:"unbindEvent",value:function(){var t=this.map;this.mapvOptions.methods&&(this.mapvOptions.methods.click&&t.off("click",this.clickEvent),this.mapvOptions.methods.mousemove&&t.off("mousemove",this.mousemoveEvent))}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,t?this.show():this.hide())}},{key:"setZIndex",value:function(t){this.renderer.setZIndex(t)}}])&&Vs(e.prototype,r),n&&Vs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hs(t,e){for(var r=0;r",a=""+(e._createLegendElement.call(e)||"")+"";this._container.innerHTML=i+a}return e._appendLegendCSSStyle(),this._container},r.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},new r}},{key:"_createLegendElement",value:function(){}},{key:"_addLayer",value:function(){var t=this.getLayerStyleOptions(),e=this.id?this.id:"theme3DLayer",r=this.sourceId=e+"Source";this.map.getSource(r)?(this.map.removeSource(r),this.map.addSource(r,{type:"geojson",data:this.data})):this.map.addSource(r,{type:"geojson",data:this.data}),this.map.addLayer({id:e,type:"fill-extrusion",source:r,paint:t}),this.map.moveLayer(e)}},{key:"_addHighLightLayer",value:function(){if(this.map){var t=this.map;t.addLayer({id:this._highlightLayerId,type:"fill-extrusion",source:this.sourceId,paint:this.getHighlightStyleOptions(),filter:["in","$id",""]}),this._selectFeatureId=null,t.on("mousemove",this.id,this._onMouseMove.bind(this)),t.on("mouseout",this.id,this._onMouseMove.bind(this))}}},{key:"_onMouseMove",value:function(t){var e=this,r=this.map,n=r.queryRenderedFeatures(t.point,{layers:[e.id]});if(e.highlight&&e.highlight.callback&&e.highlight.callback(n,t),!n||n.length<1)return e._clearHighlight.call(e),void(e._selectFeatureId=null);var o=n[0].id;e._selectFeatureId!==o&&(e._selectFeatureId=o,r.setFilter(e._highlightLayerId,["==","$id",e._selectFeatureId]))}},{key:"_clearHighlight",value:function(){this.map&&this.map.setFilter(this._highlightLayerId,["in","$id",""])}},{key:"_appendLegendCSSStyle",value:function(){var t=document.createElement("style");t.type="text/css";t.innerHTML="\n .legend {\n display: inline-block;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n font-size: 12px;\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n }\n .legend-light {\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 0px 6px #bbbbbb;\n -moz-box-shadow: 0px 6px 10px #bbbbbb;\n -webkit-box-shadow: 0px 0px 6px #bbbbbb;\n }\n .legend-dark {\n color: rgba(255, 255, 255, 0.8);\n background-color: rgb(64, 64, 64);\n }\n .legend .legend-title {\n min-height: 14px;\n max-width: 500px;\n padding:6px 10px;\n }\n .legend-light .legend-title {\n color: rgba(0, 0, 0, 0.8);\n }\n .legend-dark .legend-title {\n color: rgba(255, 255, 255, 0.8);\n }\n .legend-content{\n padding:6px 10px;\n }\n "+this._legendCSSStyle(),document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_legendCSSStyle",value:function(){return"\n .legend ul {\n padding: 0;\n margin: 0 16px;\n height: 100%;\n display: block;\n list-style: none;\n }\n\n .legend li {\n vertical-align: middle;\n }\n\n .legend li span:first-child {\n vertical-align: middle;\n }\n\n .legend li span:last-child {\n line-height: 28px;\n max-width: 200px;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n -ms-text-overflow: ellipsis;\n }\n\n .legend-vertical li {\n height: 28px;\n }\n\n .legend-vertical li span:first-child {\n display: inline-block;\n width: 60px;\n height: 100%;\n }\n\n .legend-vertical li span:last-child {\n display: inline-block;\n margin-left: 16px;\n height: 100%;\n }\n\n .legend-horizontal li {\n height: 56px;\n float: left;\n }\n\n .legend-horizontal li span:first-child {\n display: block;\n width: 100%;\n height: 50%;\n }\n\n .legend-horizontal li span:last-child {\n display: block;\n vertical-align: middle;\n width: 60px;\n height: 50%;\n text-align: center;\n }\n "}},{key:"_extend",value:function(t){for(var e=0;e";for(t=0;t "+o;else o=o+"-"+this._getWrapperText(this.colorStops[t+1][0]);r+=""+o+""}return r+=""}},{key:"_getWrapperText",value:function(t){var e=t*(null==this.legendRatio?1:parseFloat(this.legendRatio)),r=parseFloat(e);return r%1e6<=1e6?r.toString():parseInt(r/1e3)+"k"}}])&&Qs(e.prototype,r),n&&Qs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function eu(t){"@babel/helpers - typeof";return(eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ru(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,o=r.attributes,i=this.styleGroups,a=!1,s=null;for(var u in o)if(n===u){a=!0,s=o[u];break}if(a)for(var l=0,c=i.length;l=i[l].start&&s"+n+""}return t+=""}}])&&yu(e.prototype,r),n&&yu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function wu(t){"@babel/helpers - typeof";return(wu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ou(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,o=r.attributes,i=this.styleGroups,a=!1,s=null;for(var u in o)if(n===u){a=!0,s=o[u];break}if(a)for(var l=0,c=i.length;l0&&void 0!==arguments[0]?arguments[0]:null;if(!t||0===t.length||t===this.graphics)return this.graphics.length=0,this.layer.props.data&&(this.layer.props.data.length=0),void this.update();A.isArray(t)||(t=[t]);for(var e=t.length-1;e>=0;e--){var r=t[e],n=A.indexOf(this.graphics,r);-1!==n&&this.graphics.splice(n,1)}this.update()}},{key:"update",value:function(){if("Awaiting state"!==this.layer.lifecycle){this.layer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0});var t=this.getState(),e=parseInt(this.canvas.style.width),r=parseInt(this.canvas.style.height);t.width=e,t.height=r,this.layer.setState(t)}}},{key:"clear",value:function(){this.removeGraphics(),this.deckGL.finalize()}},{key:"remove",value:function(){this.mapOptions.targetElement.removeChild(this.canvas)}},{key:"destroy",value:function(){this.remove(),this.clear()}},{key:"moveTo",value:function(t,e){var r=document.getElementById(this.id);if(e=void 0===e||e){var n=document.getElementById(t);r&&n&&n.parentNode.insertBefore(r,n)}else{var o=document.getElementById(t);if(r){if(o.nextSibling)return void o.parentNode.insertBefore(r,o.nextSibling);o.parentNode.appendChild(r)}}}},{key:"setVisibility",value:function(t){this.canvas&&t!==this.visibility&&(this.visibility=t,this.canvas.style.display=t?"block":"none")}},{key:"draw",value:function(){var t=this.getState(),e={};for(var r in t)e[r]=t[r];var n=parseInt(this.canvas.style.width),o=parseInt(this.canvas.style.height);e.width=n,e.height=o,e.layers=[this.layer],e.canvas=this.canvas,this.deckGL.setProps(e)}},{key:"_initContainer",value:function(){this.canvas=this._createCanvas(this.mapOptions.mapElement),this.mapOptions.targetElement.appendChild(this.canvas)}},{key:"_createCanvas",value:function(t){var e=document.createElement("canvas");return this.id&&(e.id=this.id),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.cursor="",e.width=parseInt(t.style.width),e.height=parseInt(t.style.height),e.style.width=t.style.width,e.style.height=t.style.height,e}},{key:"getState",value:function(){var t=this.functions.getMapState();return function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:null;this.renderer&&this.renderer.removeGraphics(t)}},{key:"clear",value:function(){this.renderer&&this.renderer.clear()}},{key:"remove",value:function(){this.renderer&&this.renderer.remove()}},{key:"moveTo",value:function(t,e){this.renderer.moveTo(t,e)}},{key:"setVisibility",value:function(t){this.renderer.setVisibility(t)}},{key:"getState",value:function(){return this.renderer.getState()}},{key:"getMapState",value:function(){var t={},e=this.map.getCenter(),r={longitude:e.lng,latitude:e.lat,zoom:this.map.getZoom(),maxZoom:this.map.getMaxZoom(),pitch:this.map.getPitch(),bearing:this.map.getBearing()};for(var n in r)t[n]=r[n];return this.map.getCRS&&this.map.getCRS()!==o().CRS.EPSG3857&&(t.coordinateSystem=this.coordinateSystem,t.isGeographicCoordinateSystem=this.isGeographicCoordinateSystem),t}}])&&Ru(e.prototype,r),n&&Ru(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Mu=function(){try{return THREE}catch(t){return{}}}();function Lu(t,e,r){if(t===r||t===e)return t;var n=r-e;return((t-e)%n+n)%n+e}function Nu(t){return t*Math.PI/180}var Iu={matrix:[1,-1,0,0],projection:{R:6378137,minZoom:0,maxZoom:22,nativeMaxZoom:19,RAD:Math.PI/180,METERS_PER_DEGREE:6378137*Math.PI/180,MAX_LATITUDE:85.0511287798,project:function(t){var e=this.RAD,r=this.METERS_PER_DEGREE,n=this.MAX_LATITUDE,o=t instanceof Array?{lng:t[0],lat:t[1]}:{lng:t.lng,lat:t.lat},i=o.lng,a=Math.max(Math.min(n,o.lat),-n);return{x:i*r,y:(0===a?0:Math.log(Math.tan((90+a)*e/2))/e)*r}},unproject:function(t){var e,r=t.x,n=t.y,o=this.RAD,i=this.METERS_PER_DEGREE;return 0===n?e=0:(e=n/i,e=(2*Math.atan(Math.exp(e*o))-Math.PI/2)/o),{lng:Lu(r/i,-180,180),lat:Lu(e,-this.MAX_LATITUDE,this.MAX_LATITUDE)}},locate:function(t,e,r){if(!t)return null;if(e=e||0,r=r||0,!e&&!r)return t;var n=t.lng;if(0!==e){var o=Math.abs(e),i=Nu(t.lng);n=Lu(180*(i+=2*Math.sqrt(Math.pow(Math.sin(o/(2*this.R)),2)/Math.pow(Math.cos(i),2))*(o>0?1:-1))/Math.PI,-180,180)}var a=t.lat;if(0!==r){var s=Math.abs(r),u=Nu(t.lat);a=Lu(180*(u+=2*Math.sin(s/(2*this.R))*(s>0?1:-1))/Math.PI,-90,90)}return{lng:n,lat:a}},getResolution:function(t){if(!this.resolutions){for(var e=[],r=12756274*Math.PI,n=0;n<=this.maxZoom;n++)e[n]=r/(256*Math.pow(2,n));this.resolutions=e}var o=0|t,i=this.resolutions.length;o=o<0?0:o>i-1?i-1:o;var a=this.resolutions[o];return(0|t)!==t&&o!==i-1?a+(this.resolutions[o+1]-a)*(t-o):a}},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},lngLatToPoint:function(t,e){var r=this.project(t);return this.transform(r,this.projection.getResolution(e))},locate:function(t,e,r){return this.projection.locate(t,e,r)},transform:function(t,e){return{x:this.matrix[0]*(t.x-this.matrix[2])/e,y:this.matrix[1]*(t.y-this.matrix[3])/e}}};function Du(t,e){for(var r=0;r=0;e--)t.children[e]instanceof Mu.Mesh&&t.remove(t.children[e]);return this}},{key:"clearAll",value:function(t){var e=this.scene;if(!e)return this;for(var r=e.children.length-1;r>=0;r--)!t&&e.children[r]instanceof Mu.Camera||e.remove(e.children[r]);return this}},{key:"setPosition",value:function(t,e){if(!t||!e)return this;var r=this.lngLatToPosition(e);return t.position.set(r.x,r.y,r.z),this}},{key:"lngLatToPosition",value:function(t){var e=Iu.projection.nativeMaxZoom,r=Iu.lngLatToPoint(t,e);return new Ju(r.x,r.y,-0)}},{key:"distanceToThreeVector3",value:function(t,e,r){var n=this.map,o=r||n.getCenter(),i=Iu.projection.nativeMaxZoom,a=Iu.locate(o,t,e),s=Iu.lngLatToPoint(o,i),u=Iu.lngLatToPoint(a,i),l=Math.abs(u.x-s.x)*Math.sign(t),c=Math.abs(u.y-s.y)*Math.sign(e);return new Ju(l,c,0)}},{key:"removeDuplicatedCoordinates",value:function(t){function e(t,e){return t[0]===e[0]&&t[1]===e[1]}for(var r=[].concat(t),n=r.length-1;n>=1;n--)e(r[n],r[n-1])&&r.splice(n,1);return e(r[0],r[r.length-1])&&r.splice(r.length-1,1),r}},{key:"getCoordinatesCenter",value:function(t){for(var e=0,r=0,n=0,o=0,i=t.length;o0?this.convertFastToPixelPoints(t):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}},{key:"convertFastToPixelPoints",value:function(t){var e,r,n,o,i,a,s,u=[],l=t.getEast()-t.getWest(),c=t.getNorth()-t.getSouth(),f=this.mapElement;o=l/f.width>c/f.height?l/f.width:c/f.height,this.useRadius=this.useGeoUnit?parseInt(this.radius/o):this.radius;for(var h=0;h0&&this.maxWidth>0))return!1;var r=this.canvasContext;r.setTransform(1,0,0,1,0,0),this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var n=0;nt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.options;(t=t||{}).strokeStyle=Object.assign({},Tl,t.strokeStyle||{}),t.lngLabelStyle=Object.assign({},El,t.lngLabelStyle||{}),t.latLabelStyle=Object.assign({},El,t.latLabelStyle||{}),this.options=Object.assign({},Cl,t,{extent:this.getDefaultExtent(t.extent),wrapX:t.wrapX}),this.oldExtent=this.options.extent,this._calcInterval(),this.isRotate=!1,this.visible=!0,this.features=this._getGraticuleFeatures()}},{key:"_createCanvas",value:function(){if(!this.canvas){var t=this.mapElement;this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px";var e=("undefined"==typeof window?{}:window).devicePixelRatio||1;this.canvas.width=parseInt(t.style.width)*e,this.canvas.height=parseInt(t.style.height)*e,this.canvas.style.width=t.style.width,this.canvas.style.height=t.style.height,this.canvas.globalAlpha=this.options.opacity,this.targetElement.appendChild(this.canvas)}}},{key:"_drawCanvas",value:function(){this.canvas||this._createCanvas(),this.setVisibility(),this._reset()}},{key:"_resizeCallback",value:function(){this.targetElement&&this.targetElement.removeChild(this.canvas),this.canvas=null,this._drawCanvas()}},{key:"_reset",value:function(){this._updateRotate(),this._updateExtent(),this._calcInterval(),this._drawLabel()}},{key:"_updateRotate",value:function(){var t=this.getMapStateByKey("getBearing");this.isRotate=t>-180&&t<=-90||t>=90&&t<180}},{key:"_updateExtent",value:function(){if(this.options.wrapX&&!this.oldExtent){var t=this.getMapStateByKey("getBounds"),e=t._ne,r=t._sw;this.options.extent=[r.lng,r.lat,e.lng,e.lat]}}},{key:"_calcInterval",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.interval;"function"==typeof t?(t=t(this.map),this._currLngInterval=t,this._currLatInterval=t):(this._currLngInterval=t,this._currLatInterval=t)}},{key:"_formatLat",value:function(t){return this.options.latFormatTickLabel?this.options.latLabelFormatter(t):t<0?zs(-1*t)+"S":t>0?zs(t)+"N":""+zs(t)}},{key:"_formatLng",value:function(t){return this.options.lngLabelFormatter?this.options.lngLabelFormatter(t):(t=Us(t))>0&&t<=180?zs(t)+"E":t<0&&t>=-180?zs(-1*t)+"W":""+zs(t)}},{key:"_parsePxToInt",value:function(t){t.length>2&&"p"===t.charAt(t.length-2)&&(t=t.substr(0,t.length-2));try{return parseInt(t,10)}catch(t){console.log(t)}return 0}},{key:"_drawLabel",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.visible,r=this.canvas,n=r.getContext("2d");if(e&&this.options.showLabel){if(this.mapElement){this._currLngInterval&&this._currLatInterval||this._calcInterval(),n.clearRect(0,0,r.width,r.height);var o=this.options,i=o.lngLabelStyle,a=o.latLabelStyle,s=this._getGridiculePoints(),u=s.lngPoints,l=s.latPonits;u.forEach(function(e){t._drawLng(n,e[0],e[1],e[2],i)}),l.forEach(function(e){t._drawLat(n,e[0],e[1],e[2],a)})}}else n.clearRect(0,0,r.width,r.height)}},{key:"_drawLat",value:function(t,e,r,n,o){t=this._setLabelStyle(t,o);var i=this.canvas.width,a=12;try{var s=t.font.split(" ")[0];a=this._parsePxToInt(s)}catch(t){console.log(t)}if(!n){var u=e;e=r,r=this.getMapStateByKey("project",[u,e])}var l=this._formatLat(e),c=t.measureText(l).width;t.strokeText(l,(n?i:r.x)-c,(n?r:r.y)+a/2),t.fillText(l,(n?i:r.x)-c,(n?r:r.y)+a/2)}},{key:"_drawLng",value:function(t,e,r,n,o){t=this._setLabelStyle(t,o);var i=this.canvas.height;if(!n){var a=r;r=this.getMapStateByKey("project",[e,a])}var s=this._formatLng(e),u=t.measureText(s).width;t.strokeText(s,(n?r:r.x)-u/2,n?i:r.y),t.fillText(s,(n?r:r.x)-u/2,n?i:r.y)}},{key:"_getLatPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-180,180],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(o){if(this.options.wrapX&&-180===e[0]&&180===e[1])return[];var i=[];return o.forEach(function(o){var a=o.geometry.coordinates[0][1];if(o.geometry.coordinates[1][1]===a){var s="number"==typeof n?n:e[1];t.isRotate&&(s="number"==typeof r?r:e[0]),t.options.wrapX&&(i=i.concat(t._getWrapPoints(s,a,[s,s]))),i.push([s,a])}}),i}}},{key:"_getLngPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-90,90],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(o){var i="number"==typeof r?r:e[0];this.isRotate&&(i="number"==typeof n?n:e[1]);var a=[];return o.forEach(function(e){var r=e.geometry.coordinates[0][0];e.geometry.coordinates[1][0]===r&&(a.push([r,i]),t.options.wrapX&&(a=a.concat(t._getWrapPoints(r,i))))}),a}}},{key:"_getWrapPoints",value:function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.oldExtent,n=[],o=this.getMapStateByKey("getBounds"),i=o._ne,a=o._sw,s=r.length>2?r[2]:r[1];t>=a.lng;){var u=Us(t,180===s,-180===r[0]);(!r||u>=r[0]&&u<=s)&&n.push([t,e]),t-=360}for(;t<=i.lng;){var l=Us(t,180===s,-180===r[0]);(!r||l>=r[0]&&l<=s)&&n.push([t,e]),t+=360}return n}},{key:"_getGridiculePoints",value:function(){var t=this._getEdgeLat(),e=this._getEdgeLng(),r=this._getRange(),n=r.latRange,o=r.lngRange,i=r.firstLat,a=r.firstLng,s=r.lastLat,u=r.lastLng;return{latPonits:this._getUniquePoint(this._getLatPoints(o,a,u),t,1),lngPoints:this._getUniquePoint(this._getLngPoints(n,i,s),e,0)}}},{key:"_getEdgeLat",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLatInterval,r=[],n=[],o=this.canvas.width,i=this.canvas.height,a=this._getRange().extent,s=this.getMapStateByKey("getBounds")._ne;if(this.options.wrapX&&Us(s.lng)>a[2])return[];for(var u=this._countDecimals(e),l=0;l<=i;l++){var c=this.getMapStateByKey("unproject",[o,l]),f=Us(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lat,l]),n.push(c.lat),void 0===t&&c.lat.toFixed(u)%e==0&&(t=Number(c.lat.toFixed(u))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,y=h.last,d=h.coordinates,b=h.points;t=Math.min(Math.max(p,-90),90);var v=Math.max(Math.min(Math.round(y),90),-90);return-90!==t||-90!==v?this._getClosestCoordinate(t,v,d,b,e):[]}},{key:"_getEdgeLng",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLngInterval,r=[],n=[],o=this.canvas.width,i=this.canvas.height,a=this.options.extent,s=this._countDecimals(e),u=this.getMapStateByKey("getBounds")._sw;if(this.options.wrapX&&Us(u.lat)>a[3])return[];for(var l=0;l<=o;l++){var c=this.getMapStateByKey("unproject",[l,i]),f=Us(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lng,l]),n.push(c.lng),void 0===t&&c.lng.toFixed(s)%e==0&&(t=Number(c.lng.toFixed(s))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,y=h.last,d=h.coordinates,b=h.points;return t=p,this._getClosestCoordinate(t,y,d,b,e)}},{key:"_getIntersectRange",value:function(t,e,r,n){var o=e[e.length-1];if(t>o){o=t,e.reverse(),r.reverse();for(var i=this._countDecimals(n),a=0;a<=e.length;a++){var s=e[a];if(s.toFixed(i)%n==0){t=Number(s.toFixed(i));break}}}return{first:t,last:o,coordinates:e,points:r}}},{key:"_getClosestCoordinate",value:function(t,e,r,n,o){for(var i=[],a=t;a<=e;){var s=this._getClosestNumberIndex(a,r),u=n[s];i.push([Math.round(u[0]),u[1],!0]),a+=o,r=r.slice(s),n=n.slice(s)}return i}},{key:"_getClosestNumberIndex",value:function(t,e){for(var r=0,n=Number.MAX_VALUE,o=0;o2&&void 0!==arguments[2]?arguments[2]:0;if(this.options.wrapX)return t.concat(e);if(!e||0===e.length)return t;var n=e,o=this.canvas.width,i=this.canvas.height;for(var a in t){var s=this.getMapStateByKey("project",t[a]),u=n.findIndex(function(e){return e[0]===t[a][r]});u<=-1?n.push(t[a]):s&&s.x>=0&&s.x<=o&&s.y>=0&&s.y<=i&&(n[u]=t[a])}return n}},{key:"_countDecimals",value:function(t){return Math.floor(t)!==t&&t.toString().split(".")[1].length||0}},{key:"_getGraticuleFeatures",value:function(){var t=this._currLngInterval||10,e=this._currLatInterval||10,r=[],n=this._getRange(),o=n.latRange,i=n.lngRange,a=n.firstLat,s=n.firstLng,u=n.lastLat,l=n.lastLng;this.options.wrapX&&!this.oldExtent&&(o=[-90,90],i=[-180,180],a=s=u=l=null),"number"==typeof s&&r.unshift(this._makeLineFeature(this._makeLineCoords(s,o,a,u))),"number"==typeof l&&r.unshift(this._makeLineFeature(this._makeLineCoords(l,o,a,u)));for(var c=i[0];c<=i[1];c+=t)r.unshift(this._makeLineFeature(this._makeLineCoords(c,o,a,u)));"number"==typeof a&&r.unshift(this._makeLineFeature(this._makeLineCoords(a,i,s,l,"lat"))),"number"==typeof u&&r.unshift(this._makeLineFeature(this._makeLineCoords(u,i,s,l,"lat")));for(var f=o[0];f<=o[1];f+=e)r.unshift(this._makeLineFeature(this._makeLineCoords(f,i,s,l,"lat")));return r}},{key:"_getRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.extent&&xl(this.options.extent);t&&0!==t.length||(t=this.getDefaultExtent());var e={};if((t=t.map(function(t){return Number(t.toFixed(6))}))[1]%this._currLatInterval!=0){e.firstLat=t[1];var r=Math.ceil(t[1]/this._currLatInterval);t[1]=r*this._currLatInterval}if(t[3]%this._currLatInterval!=0){e.lastLat=t[3];var n=Math.floor(t[3]/this._currLatInterval);t[3]=n*this._currLatInterval}if(t[0]%this._currLngInterval!=0){e.firstLng=t[0];var o=Math.ceil(t[0]/this._currLngInterval);t[0]=o*this._currLngInterval}if(t[2]%this._currLngInterval!=0){e.lastLng=t[2];var i=Math.floor(t[2]/this._currLngInterval);t[2]=i*this._currLngInterval}return Object.assign({latRange:[t[1],t[3]],lngRange:[t[0],t[2]],extent:t},e)}},{key:"_makeLineCoords",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[-90,90],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"lng";t="lng"===o?this._lngFix(t):t,r="number"==typeof r?r:e[0],n="number"==typeof n?n:e[1];for(var i=Math.abs(r-n),a=[],s=r;s<=n;s+=i)"lng"===o?a.push([t,s]):a.push([s,t]);return a}},{key:"_makeLineFeature",value:function(t){return{type:"Feature",geometry:{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"LineString",coordinates:t}}}},{key:"_lngFix",value:function(t){return t>=180?180:t<=-180?-180:t}},{key:"_transformStrokeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.strokeStyle;if(!t||"string"==typeof t)return{paint:{"line-color":t||"rgba(0,0,0,0.2)"}};var e={visibility:this.visible?"visible":"none","line-join":t.lineJoin||"round","line-cap":t.lineCap||"round"},r={"line-color":t.lineColor||"rgba(0,0,0,0.2)","line-width":t.lineWidth||1,"line-offset":t.lineDashOffset||0,"line-translate-anchor":"viewport"};return t.lineWidth&&("function"==typeof t.lineWidth?r["line-width"]=t.lineWidth(this.map):r["line-width"]=t.lineWidth),t.lindDasharray&&("function"==typeof t.lindDasharray?r["line-dasharray"]=t.lindDasharray(this.map):r["line-dasharray"]=t.lindDasharray),{layout:e,paint:r}}},{key:"_setLabelStyle",value:function(t,e){return e.textColor&&(t.fillStyle=e.textColor),e.textSize&&(t.font=e.textSize+" "+(e.textFont||["Calibri","sans-serif"]).join(",")),e.textHaloColor&&(t.strokeStyle=e.textHaloColor,t.lineWidth=e.textHaloWidth||1),e.textAnchor&&(t.textBaseline=this._getTxetBaseline(e.textAnchor),t.textAligin=this._getTxetAlign(e.textAligin)),t}},{key:"_getTxetBaseline",value:function(t){if(!t)return"bottom";var e=t.split("-");return e.includes("bottom")?"bottom":e.includes("top")?"top":e.includes("center")?"middle":void 0}},{key:"_getTxetAlign",value:function(t){if(!t)return"center";var e=t.split("-");return e.includes("left")?"left":e.includes("right")?"right":e.includes("center")?"center":void 0}}])&&jl(e.prototype,r),n&&jl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Al(t,e){for(var r=0;r=this.options.minZoom&&e<=this.options.maxZoom,this.renderer&&(this.renderer.visible=this.visible),this.map.getLayer(this.sourceId)&&this.map.setLayoutProperty(this.sourceId,"visibility",this.visible?"visible":"none"),this.renderer&&this.renderer._drawLabel()}},{key:"setMinZoom",value:function(t){this.options.minZoom=t,this.setVisibility()}},{key:"setMaxZoom",value:function(t){this.options.maxZoom=t,this.setVisibility()}},{key:"setShowLabel",value:function(t){this.options.showLabel=t,this.renderer._drawLabel()}},{key:"setExtent",value:function(t){this.options.extent=this.getDefaultExtent(t,this.map),this.updateGraticuleLayer(),this.renderer._drawLabel()}},{key:"setStrokeStyle",value:function(t){if(this.map&&this.map.getLayer(this.sourceId)){this.options.strokeStyle=t;var e=this.renderer._transformStrokeStyle(t),r=e.layout,n=e.paint;for(var o in r)this.map.setLayoutProperty(this.sourceId,o,r[o]);for(var i in n)this.map.setPaintProperty(this.sourceId,i,n[i])}}},{key:"setLngLabelStyle",value:function(t){this.options.lngLabelStyle=t,this.renderer._drawLabel()}},{key:"setLatLabelStyle",value:function(t){this.options.latLabelStyle=t,this.renderer._drawLabel()}},{key:"setIntervals",value:function(t){this.renderer&&this.renderer.setIntervals(t)}},{key:"getDefaultExtent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.map,r=(e.getCRS&&e.getCRS()||{}).extent;if(r||(r=[-180,-85.05119,180,85.05119]),!t||0===t.length)return r;var n=o().LngLatBounds.convert(t),i=n._sw,a=n._ne;return t=[i.lng,i.lat,a.lng,a.lat],t=[Math.max(r[0],t[0]),Math.max(r[1],t[1]),Math.min(r[2],t[2]),Math.min(r[3],t[3])]}},{key:"addGraticuleLayer",value:function(){if(!this.map.getSource(this.sourceId)){var t={type:"geojson",data:{type:"FeatureCollection",features:this.renderer.features}};this.map.addSource(this.sourceId,t)}if(!this.map.getLayer(this.sourceId)){var e=Object.assign({id:this.sourceId,type:"line",source:this.sourceId},this.renderer._transformStrokeStyle());this.map.addLayer(e)}}},{key:"_getLatPoints",value:function(t,e,r,n){return this.renderer._getLatPoints(t,e,r,n)}},{key:"_bindEvent",value:function(){this.map.on("styledata",this.styleDataEevent),this.map.on("resize",this.resizeEvent),this.map.on("zoomend",this.zoomendEvent)}},{key:"_unbindEvent",value:function(){this.map.off("styledata",this.styleDataEevent),this.map.off("resize",this.resizeEvent),this.map.off("zoomend",this.zoomendEvent)}},{key:"_setLayerTop",value:function(){var t=this,e=this.map;if(e){var r=e.getStyle&&e.getStyle().layers;r&&r.length&&r.findIndex(function(e){return e.id===t.sourceId})!==r.length-1&&e.getLayer(this.sourceId)&&(e.removeLayer(this.sourceId),this.addGraticuleLayer())}}},{key:"updateGraticuleLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.features;if(this.map.getSource(this.sourceId)){var e={type:"FeatureCollection",features:t};this.map.getSource(this.sourceId).setData(e)}this.addGraticuleLayer()}}])&&Al(e.prototype,r),n&&Al(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Gl=(r(9957),r(5937),r(4238)),Ul=r.n(Gl),zl=window.fetch,Jl={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(t){for(var e in t){this.queryKeys.push(e),"string"!=typeof t[e]&&(t[e]=A.toJSON(t[e]));var r=encodeURIComponent(t[e]);this.queryValues.push(r)}},issue:function(t){for(var e=this,r=e.getUid(),n=t.url,o=[],i=n,a=0,s=e.queryKeys?e.queryKeys.length:0,u=0;u=e.limitLength){if(0==a)return!1;o.push(i),i=n,a=0,u--}else if(i.length+e.queryKeys[u].length+2+e.queryValues[u].length>e.limitLength)for(var l=e.queryValues[u];l.length>0;){var c=e.limitLength-i.length-e.queryKeys[u].length-2;i.indexOf("?")>-1?i+="&":i+="?";var f=l.substring(0,c);"%"===f.substring(c-1,c)?(c-=1,f=l.substring(0,c)):"%"===f.substring(c-2,c-1)&&(c-=2,f=l.substring(0,c)),i+=e.queryKeys[u]+"="+f,l=l.substring(c),f.length>0&&(o.push(i),i=n,a=0)}else a++,i.indexOf("?")>-1?i+="&":i+="?",i+=e.queryKeys[u]+"="+e.queryValues[u];return o.push(i),e.send(o,"SuperMapJSONPCallbacks_"+r,t&&t.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(t,e,r){var n=t.length;if(n>0)return new Promise(function(o){for(var i=(new Date).getTime(),a=0;a-1?s+="&":s+="?",s+="sectionCount="+n,s+="§ionIndex="+a,s+="&jsonpUserID="+i,r&&(s=decodeURIComponent(s),s=r+encodeURIComponent(s)),Ul()(s,{jsonpCallbackFunction:e,timeout:3e4}).then(function(t){o(t.json())})}})},GET:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(t.params),this.issue(t)},POST:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},PUT:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},DELETE:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)}},Vl=function(){return void 0!=Ml?Ml:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},ql=function(){return Ll||45e3},Hl={commit:function(t,e,r,n){switch(t=t?t.toUpperCase():t){case"GET":return this.get(e,r,n);case"POST":return this.post(e,r,n);case"PUT":return this.put(e,r,n);case"DELETE":return this.delete(e,r,n);default:return this.get(e,r,n)}},supportDirectRequest:function(t,e){return!!A.isInTheSameDomain(t)||(void 0!=e.crossOrigin?e.crossOrigin:Vl()||e.proxy)},get:function(t,e,r){r=r||{};if(t=A.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){var n={url:t=t.replace(".json",".jsonp"),data:e};return Jl.GET(n)}return this.urlIsLong(t)?this._postSimulatie("GET",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"GET")},delete:function(t,e,r){r=r||{};if(t=A.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=DELETE",data:e};return Jl.DELETE(n)}return this.urlIsLong(t)?this._postSimulatie("DELETE",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"DELETE")},post:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:A.urlAppend(t,"_method=POST"),data:e};return Jl.POST(n)}return this._fetch(t,e,r,"POST")},put:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=PUT",data:e};return Jl.PUT(n)}return this._fetch(t,e,r,"PUT")},urlIsLong:function(t){for(var e=0,r=null,n=0,o=t.length;n-1?"&":"?")+"_method="+t,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(e,r,n)},_processUrl:function(t,e){if(this._isMVTRequest(t))return t;if(-1===t.indexOf(".json")&&!e.withoutFormatSuffix)if(t.indexOf("?")<0)t+=".json";else{var r=t.split("?");2===r.length&&(t=r[0]+".json?"+r[1])}return e&&e.proxy&&("function"==typeof e.proxy?t=e.proxy(t):(t=decodeURIComponent(t),t=e.proxy+encodeURIComponent(t))),t},_fetch:function(t,e,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(e)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,zl(t,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?e:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:ql()}).then(function(t){return t})):zl(t,{method:n,body:"PUT"===n||"POST"===n?e:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:ql()}).then(function(t){return t})},_getWithCredentials:function(t){return!0===t.withCredentials?"include":!1===t.withCredentials?"omit":"same-origin"},_fetchJsonp:function(t,e){return e=e||{},Ul()(t,{method:"GET",timeout:e.timeout}).then(function(t){return t})},_timeout:function(t,e){return new Promise(function(r,n){setTimeout(function(){n(new Error("timeout"))},t),e.then(r,n)})},_getParameterString:function(t){var e=[];for(var r in t){var n,o=t[r];if(null!=o&&"function"!=typeof o)n=Array.isArray(o)||"[object Object]"===o.toString()?encodeURIComponent(JSON.stringify(o)):encodeURIComponent(o),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},_isMVTRequest:function(t){return t.indexOf(".mvt")>-1||t.indexOf(".pbf")>-1}};!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(Nl||(Nl={}));var Wl,Yl=new Int32Array(2),Ql=new Float32Array(Yl.buffer),Xl=new Float64Array(Yl.buffer),Zl=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];function Kl(t,e){for(var r=0;r>24}},{key:"readUint8",value:function(t){return this.bytes_[t]}},{key:"readInt16",value:function(t){return this.readUint16(t)<<16>>16}},{key:"readUint16",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8}},{key:"readInt32",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}},{key:"readUint32",value:function(t){return this.readInt32(t)>>>0}},{key:"readInt64",value:function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}},{key:"writeUint16",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}},{key:"writeInt32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeUint32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeInt64",value:function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}},{key:"writeUint64",value:function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}},{key:"writeFloat32",value:function(t,e){Ql[0]=e,this.writeInt32(t,Yl[0])}},{key:"writeFloat64",value:function(t,e){Xl[0]=e,this.writeInt32(t,Yl[Zl?0:1]),this.writeInt32(t+4,Yl[Zl?1:0])}},{key:"getBufferIdentifier",value:function(){if(this.bytes_.length>10),56320+(1023&i)))}return n}},{key:"__union_with_string",value:function(t,e){return"string"==typeof t?this.__string(e):this.__union(t,e)}},{key:"__indirect",value:function(t){return t+this.readInt32(t)}},{key:"__vector",value:function(t){return t+this.readInt32(t)+4}},{key:"__vector_len",value:function(t){return this.readInt32(t+this.readInt32(t))}},{key:"__has_identifier",value:function(t){if(4!=t.length)throw new Error("FlatBuffers: file identifier must be length 4");for(var e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0}},{key:"createScalarList",value:function(t,e){for(var r=[],n=0;n=0;r--)t.addInt32(e[r]);return t.endVector()}},{key:"startEndsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addXy",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"createXyVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startXyVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addZ",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createZVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startZVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addM",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"createMVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startMVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addT",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"createTVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startTVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addTm",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"createTmVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}},{key:"startTmVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addType",value:function(t,e){t.addFieldInt8(6,e,Nl.Unknown)}},{key:"addParts",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createPartsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startPartsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endGeometry",value:function(t){return t.endObject()}},{key:"createGeometry",value:function(e,r,n,o,i,a,s,u,l){return t.startGeometry(e),t.addEnds(e,r),t.addXy(e,n),t.addZ(e,o),t.addM(e,i),t.addT(e,a),t.addTm(e,s),t.addType(e,u),t.addParts(e,l),t.endGeometry(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"ends",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}},{key:"endsLength",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"endsArray",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"xy",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"xyLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"xyArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"z",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"zLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"zArray",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"m",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"mLength",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"mArray",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"t",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"tLength",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"tArray",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"tm",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):BigInt(0)}},{key:"tmLength",value:function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"type",value:function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):Nl.Unknown}},{key:"parts",value:function(e,r){var n=this.bb.__offset(this.bb_pos,18);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}},{key:"partsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&tc(e.prototype,r),n&&tc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function nc(t,e){for(var r=[],n=0;n>1]),r.push(o)}return r}function oc(t,e,r){if(!r||0===r.length)return[nc(t,e)];var n,o=0,i=Array.from(r).map(function(e){return t.slice(o,o=e<<1)});return e&&(o=0,n=Array.from(r).map(function(t){return e.slice(o,o=t)})),i.map(function(t,e){return nc(t,n?n[e]:void 0)})}function ic(t,e){var r=e;if(r===Nl.Unknown&&(r=t.type()),r===Nl.GeometryCollection){for(var n=[],o=0;o=0;r--)t.addInt8(e[r]);return t.endVector()}},{key:"startPropertiesVector",value:function(t,e){t.startVector(1,e,1)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endFeature",value:function(t){return t.endObject()}},{key:"finishFeatureBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedFeatureBuffer",value:function(t,e){t.finish(e,void 0,!0)}},{key:"createFeature",value:function(e,r,n,o){return t.startFeature(e),t.addGeometry(e,r),t.addProperties(e,n),t.addColumns(e,o),t.endFeature(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"geometry",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new rc).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"properties",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}},{key:"propertiesLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"propertiesArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new sc).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&uc(e.prototype,r),n&&uc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),cc=(new TextEncoder,new TextDecoder);function fc(t,e){var r={};if(!e||0===e.length)return r;var n=t.propertiesArray();if(!n)return r;for(var o=new DataView(n.buffer,n.byteOffset),i=t.propertiesLength(),a=0;a0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:function(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}(e,r.value)}})},yc.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function o(){return e._source.read().then(function(i){return i.done?(e._array=pc,e._index=0,r>0?n.subarray(0,r):null):r+i.value.length>=t?(e._array=i.value,e._index=t-r,n.set(i.value.subarray(0,t-r),r),n):(n.set(i.value,r),r+=i.value.length,o())})}()},yc.prototype.cancel=function(){return this._source.cancel()};var bc=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bb=null,this.bb_pos=0}var e,r,n;return e=t,n=[{key:"getRootAsCrs",value:function(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"getSizePrefixedRootAsCrs",value:function(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startCrs",value:function(t){t.startObject(6)}},{key:"addOrg",value:function(t,e){t.addFieldOffset(0,e,0)}},{key:"addCode",value:function(t,e){t.addFieldInt32(1,e,0)}},{key:"addName",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"addWkt",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"addCodeString",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"endCrs",value:function(t){return t.endObject()}},{key:"createCrs",value:function(e,r,n,o,i,a,s){return t.startCrs(e),t.addOrg(e,r),t.addCode(e,n),t.addName(e,o),t.addDescription(e,i),t.addWkt(e,a),t.addCodeString(e,s),t.endCrs(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"org",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"code",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"wkt",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"codeString",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&dc(e.prototype,r),n&&dc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vc(t,e){for(var r=0;r=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startEnvelopeVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addGeometryType",value:function(t,e){t.addFieldInt8(2,e,Nl.Unknown)}},{key:"addHasZ",value:function(t,e){t.addFieldInt8(3,+e,0)}},{key:"addHasM",value:function(t,e){t.addFieldInt8(4,+e,0)}},{key:"addHasT",value:function(t,e){t.addFieldInt8(5,+e,0)}},{key:"addHasTm",value:function(t,e){t.addFieldInt8(6,+e,0)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addFeaturesCount",value:function(t,e){t.addFieldInt64(8,e,BigInt("0"))}},{key:"addIndexNodeSize",value:function(t,e){t.addFieldInt16(9,e,16)}},{key:"addCrs",value:function(t,e){t.addFieldOffset(10,e,0)}},{key:"addTitle",value:function(t,e){t.addFieldOffset(11,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(12,e,0)}},{key:"addMetadata",value:function(t,e){t.addFieldOffset(13,e,0)}},{key:"endHeader",value:function(t){return t.endObject()}},{key:"finishHeaderBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedHeaderBuffer",value:function(t,e){t.finish(e,void 0,!0)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"envelope",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"envelopeLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"envelopeArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"geometryType",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Nl.Unknown}},{key:"hasZ",value:function(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasM",value:function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasT",value:function(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasTm",value:function(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new sc).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"featuresCount",value:function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt("0")}},{key:"indexNodeSize",value:function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}},{key:"crs",value:function(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new bc).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"title",value:function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"metadata",value:function(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&vc(e.prototype,r),n&&vc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function gc(t){for(var e=mc.getRootAsHeader(t),r=e.featuresCount(),n=e.indexNodeSize(),o=[],i=0;i0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pc(t){return this instanceof Pc?(this.v=t,this):new Pc(t)}function xc(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(t){o[t]&&(n[t]=function(e){return new Promise(function(r,n){i.push([t,e,r,n])>1||s(t,e)})})}function s(t,e){try{(r=o[t](e)).value instanceof Pc?Promise.resolve(r.value.v).then(u,l):c(i[0][2],r)}catch(t){c(i[0][3],t)}var r}function u(t){s("next",t)}function l(t){s("throw",t)}function c(t,e){t(e),i.shift(),i.length&&s(i[0][0],i[0][1])}}var kc=function(t){function e(e){var r=t.call(this,e)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(t,e){function r(){this.constructor=t}wc(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(Error);(function(){function t(t){if(t<0)throw new RangeError("Capacity may not be less than 0");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(t){if(this.full)throw new Error("Buffer full");this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}})(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){for(;this._q.length>=this._c;)this._q.shift();this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}}(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){this._q.length=Rc;return Promise.resolve(e).then(function(e){return!r&&t.state>=Ac?Nc(t).then(function(t){return{value:t,done:!0}}):{value:e,done:r}})}function Dc(t,e){var r,n;if(!(t.state>=Cc))if(t.state=Cc,t.onnext(),t.onstop(),null==t.err&&(t.err=e),0!==t.pushes.length||void 0!==t.buffer&&!t.buffer.empty)try{for(var o=_c(t.pushes),i=o.next();!i.done;i=o.next()){i.value.resolve()}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}else Fc(t)}function Fc(t){var e,r;if(!(t.state>=Rc)){t.state=Ac||(t.state=Tc)){t.state=Tc;var e=function(t,e){if(jc(e),t.pushes.length>=Mc)throw new kc("No more than "+Mc+" pending calls to push are allowed on a single repeater.");if(t.state>=Cc)return Promise.resolve(void 0);var r,n=void 0===t.pending?Promise.resolve(e):t.pending.then(function(){return e});n=n.catch(function(e){t.state=Mc)throw new kc("No more than "+Mc+" pending calls to next are allowed on a single repeater.");if(e.state<=Ec&&Gc(e),e.onnext(t),void 0!==e.buffer&&!e.buffer.empty){var r=Ic(e,e.buffer.remove());if(e.pushes.length){var n=e.pushes.shift();e.buffer.add(n.value),e.onnext=n.resolve}return r}if(e.pushes.length){var o=e.pushes.shift();return e.onnext=o.resolve,Ic(e,o.value)}return e.state>=Cc?(Fc(e),Ic(e,Nc(e))):new Promise(function(r){return e.nexts.push({resolve:r,value:t})})},t.prototype.return=function(t){jc(t);var e=Uc.get(this);if(void 0===e)throw new Error("WeakMap error");return Fc(e),e.execution=Promise.resolve(e.execution).then(function(){return t}),Ic(e,Nc(e))},t.prototype.throw=function(t){var e=Uc.get(this);if(void 0===e)throw new Error("WeakMap error");return e.state<=Ec||e.state>=Cc||void 0!==e.buffer&&!e.buffer.empty?(Fc(e),null==e.err&&(e.err=t),Ic(e,Nc(e))):this.next(Promise.reject(t))},t.prototype[Symbol.asyncIterator]=function(){return this},t.race=Vc,t.merge=qc,t.zip=Hc,t.latest=Wc,t}();function Jc(t,e){var r,n,o=[],i=function(t){null!=t&&"function"==typeof t[Symbol.asyncIterator]?o.push(t[Symbol.asyncIterator]()):null!=t&&"function"==typeof t[Symbol.iterator]?o.push(t[Symbol.iterator]()):o.push(function(){return xc(this,arguments,function(){return Sc(this,function(r){switch(r.label){case 0:return e.yieldValues?[4,Pc(t)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return e.returnValues?[4,Pc(t)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var a=_c(t),s=a.next();!s.done;s=a.next()){i(s.value)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function Vc(t){var e=this,r=Jc(t,{returnValues:!0});return new zc(function(t,n){return Oc(e,void 0,void 0,function(){var e,o,i,a,s,u;return Sc(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2];o=!1,n.then(function(){e(),o=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),a=void 0,s=0,u=function(){var o,u,l,c,f,h;return Sc(this,function(p){switch(p.label){case 0:o=s;try{for(f=void 0,u=_c(r),l=u.next();!l.done;l=u.next())c=l.value,Promise.resolve(c.next()).then(function(t){t.done?(n(),void 0===i&&(i=t)):s===o&&(s++,e(t))},function(t){return n(t)})}catch(t){f={error:t}}finally{try{l&&!l.done&&(h=u.return)&&h.call(u)}finally{if(f)throw f.error}}return[4,new Promise(function(t){return e=t})];case 1:return void 0===(a=p.sent())?[3,3]:[4,t(a.value)];case 2:p.sent(),p.label=3;case 3:return[2]}})},l.label=2;case 2:return o?[3,4]:[5,u()];case 3:return l.sent(),[3,2];case 4:return[2,i&&i.value];case 5:return n(),[4,Promise.race(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function qc(t){var e=this,r=Jc(t,{yieldValues:!0});return new zc(function(t,n){return Oc(e,void 0,void 0,function(){var e,o,i,a=this;return Sc(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2];e=[],o=!1,n.then(function(){var t,r;o=!0;try{for(var n=_c(e),i=n.next();!i.done;i=n.next()){(0,i.value)()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,s){return Oc(a,void 0,void 0,function(){var a;return Sc(this,function(u){switch(u.label){case 0:u.trys.push([0,,6,9]),u.label=1;case 1:return o?[3,5]:(Promise.resolve(r.next()).then(function(t){return e[s](t)},function(t){return n(t)}),[4,new Promise(function(t){e[s]=t})]);case 2:return void 0===(a=u.sent())?[3,4]:a.done?(i=a,[2]):[4,t(a.value)];case 3:u.sent(),u.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:u.sent(),u.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return s.sent(),[2,i&&i.value];case 3:return n(),[7];case 4:return[2]}})})})}function Hc(t){var e=this,r=Jc(t,{returnValues:!0});return new zc(function(t,n){return Oc(e,void 0,void 0,function(){var e,o,i,a;return Sc(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2,[]];o=!1,n.then(function(){e(),o=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return o?[3,5]:(Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})]);case 3:return void 0===(i=s.sent())?[2]:(a=i.map(function(t){return t.value}),i.some(function(t){return t.done})?[2,a]:[4,t(a)]);case 4:return s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function Wc(t){var e=this,r=Jc(t,{yieldValues:!0,returnValues:!0});return new zc(function(t,n){return Oc(e,void 0,void 0,function(){var e,o,i,a,s,u=this;return Sc(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2,[]];o=[],i=!1,n.then(function(){var t,r;e();try{for(var n=_c(o),a=n.next();!a.done;a=n.next()){(0,a.value)()}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}i=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})];case 2:return void 0===(a=l.sent())?[2]:(s=a.map(function(t){return t.value}),a.every(function(t){return t.done})?[2,s]:[4,t(s.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(e,r){return Oc(u,void 0,void 0,function(){var u;return Sc(this,function(l){switch(l.label){case 0:if(a[r].done)return[2,a[r].value];l.label=1;case 1:return i?[3,4]:(Promise.resolve(e.next()).then(function(t){return o[r](t)},function(t){return n(t)}),[4,new Promise(function(t){return o[r]=t})]);case 2:return void 0===(u=l.sent())?[2,a[r].value]:u.done?[2,u.value]:(s[r]=u.value,[4,t(s.slice())]);case 3:return l.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function Yc(t,e){for(var r=0;rt)){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function ef(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return rf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rf(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rf(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rthis.nodes[1]),this.nodes[1]=t}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&of(e.prototype,r),n&&of(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),a=n.minX,s=n.minY,u=n.maxX,l=n.maxY,Kc.info("tree items: ".concat(e,", nodeSize: ").concat(r)),c=cf(e,r),f=c[0][0],void 0,d=c.length-1,h=new i([0,1],d),p=[h],Kc.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(e,", nodeSize: ").concat(r,", levelBounds: ").concat(c)),y=tf().mark(function t(){var n,h,y,d,b,v,m,g,w,O,S,_;return tf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=p.shift(),Kc.debug("popped node: ".concat(n,", queueLength: ").concat(p.length)),h=n.startNode(),y=h>=f,d=ef(c[n.level()],2),b=d[1],v=Math.min(n.endNode()+r,b),m=v-h,t.next=9,new sf(o(h*uf,m*uf),0);case 9:g=t.sent,w=new Float64Array(g),O=new Uint32Array(g),S=tf().mark(function t(r){var o,c,d,b,v,m,g,S;return tf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(uw[o+2])){t.next=7;break}return t.abrupt("return","continue");case 7:if(!(s>w[o+3])){t.next=9;break}return t.abrupt("return","continue");case 9:if(c=O[8+(o<<1)],d=O[9+(o<<1)],b=pf(d,c),!y){t.next=17;break}return v=function(){if(r ").concat(b)),g.extendEndNodeToNewOffset(b),t.abrupt("return","continue");case 23:void 0,_=n.level()-1,S=new i([b,b+1],_),void 0!==g&&g.level()==S.level()?Kc.info("Same level, but too far away. Pushing new request at offset: ".concat(b," rather than merging with distant ").concat(g)):Kc.info("Pushing new level for ".concat(S," onto queue with nearestNodeRange: ").concat(g," since there's not already a range for this level.")),p.push(S);case 26:case"end":return t.stop()}var _},t)}),_=h;case 14:if(!(_=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}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 i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function mf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(t,e)||gf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gf(t,e){if(t){if("string"==typeof t)return wf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wf(t,e):void 0}}function wf(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function Sf(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function _f(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Sf(i,n,o,a,s,"next",t)}function s(t){Sf(i,n,o,a,s,"throw",t)}a(void 0)})}}function Pf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xf(t,e){for(var r=0;rXc.global.extraRequestThreshold()&&(Kc.info("Pushing new feature batch, since gap ".concat(w," was too large")),a.push(s),s=[]),s.push([d,v]);case 23:u=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),l=!0,c=r.t0;case 32:if(r.prev=32,r.prev=33,!u||null==f.return){r.next=37;break}return r.next=37,Tf(f.return());case 37:if(r.prev=37,!l){r.next=40;break}throw c;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return e.headerClient.logUsage("header+index"),s.length>0&&a.push(s),O=a.flatMap(function(t){return e.readFeatureBatch(t)}),r.delegateYield(Cf(Af(zc.merge(O))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return yf.length+df+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(){return new Nf(this.headerClient.httpClient)}},{key:"readFeatureBatch",value:function(t){var e=this;return jf(Of().mark(function r(){var n,o,i,a,s,u,l,c,f,h,p;return Of().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:n=mf(t[0],1),o=n[0],i=mf(t[t.length-1],2),a=i[0],s=i[1],u=a+s-o,l=e.buildFeatureClient(),c=vf(t),r.prev=7,c.s();case 9:if((f=c.n()).done){r.next=17;break}return h=mf(f.value,1),p=h[0],r.next=13,Tf(e.readFeature(l,p,u));case 13:return r.next=15,r.sent;case 15:r.next=9;break;case 17:r.next=22;break;case 19:r.prev=19,r.t0=r.catch(7),c.e(r.t0);case 22:return r.prev=22,c.f(),r.finish(22);case 25:l.logUsage("feature");case 26:case"end":return r.stop()}},r,null,[[7,19,22,25]])}))()}},{key:"readFeature",value:function(){var t=_f(Of().mark(function t(e,r,n){var o,i,a,s,u,l,c;return Of().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r+this.lengthBeforeFeatures(),t.next=3,e.getRange(o,4,n,"feature length");case 3:return a=t.sent,i=new DataView(a).getUint32(0,!0),t.next=7,e.getRange(o+4,i,n,"feature data");case 7:return s=t.sent,u=new Uint8Array(s),(l=new Uint8Array(i+df)).set(u,df),(c=new $l(l)).setPosition(df),t.abrupt("return",lc.getRootAsFeature(c));case 14:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}],[{key:"open",value:function(){var e=_f(Of().mark(function e(r){var n,o,i,a,s,u,l,c,f,h,p;return Of().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=2024,o=new Nf(r),i=function(){var t,e=0;for(t=0;t<3;t++){e+=Math.pow(16,t)*uf}return e}(),a=n+i,Kc.debug("fetching header. minReqLength: ".concat(a," (assumedHeaderLength: ").concat(n,", assumedIndexLength: ").concat(i,")")),e.t0=Uint8Array,e.next=8,o.getRange(0,8,a,"header");case 8:if(e.t1=e.sent,(s=new e.t0(e.t1)).subarray(0,3).every(function(t,e){return yf[e]===t})){e.next=13;break}throw Kc.error("bytes: ".concat(s," != ").concat(yf)),new Error("Not a FlatGeobuf file");case 13:return Kc.debug("magic bytes look good"),e.next=16,o.getRange(8,4,a,"header");case 16:if(l=e.sent,!((u=new DataView(l).getUint32(0,!0))>10485760||u<8)){e.next=21;break}throw new Error("Invalid header size");case 21:return Kc.debug("headerLength: ".concat(u)),e.next=24,o.getRange(12,u,a,"header");case 24:return c=e.sent,f=new $l(new Uint8Array(c)),h=gc(f),p=lf(h.featuresCount,h.indexNodeSize),Kc.debug("completed: opening http reader"),e.abrupt("return",new t(o,h,u,p));case 30:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()}]),t}(),Nf=function(){function t(e){Pf(this,t),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof e?new If(e):e}return kf(t,[{key:"getRange",value:function(){var t=_f(Of().mark(function t(e,r,n,o){var i,a,s;return Of().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.bytesEverUsed+=r,i=e-this.head,a=i+r,!(i>=0&&a<=this.buffer.byteLength)){t.next=5;break}return t.abrupt("return",this.buffer.slice(i,a));case 5:return s=Math.max(r,n),this.bytesEverFetched+=s,Kc.debug("requesting for new Range: ".concat(e,"-").concat(e+r-1)),t.next=10,this.httpClient.getRange(e,s,o);case 10:return this.buffer=t.sent,this.head=e,t.abrupt("return",this.buffer.slice(0,r));case 13:case"end":return t.stop()}},t,this)}));return function(e,r,n,o){return t.apply(this,arguments)}}()},{key:"logUsage",value:function(t){var e=t.split(" ")[0],r=this.bytesEverUsed,n=this.bytesEverFetched,o=(100*r/n).toFixed(2);Kc.info("".concat(e," bytes used/requested: ").concat(r," / ").concat(n," = ").concat(o,"%"))}}]),t}(),If=function(){function t(e){Pf(this,t),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=e}return kf(t,[{key:"getRange",value:function(){var t=_f(Of().mark(function t(e,r,n){var o,i;return Of().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,o="bytes=".concat(e,"-").concat(e+r-1),Kc.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(n,"), bytes: (this_request: ").concat(r,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(o)),t.next=6,fetch(this.url,{headers:{Range:o}});case 6:return i=t.sent,t.abrupt("return",i.arrayBuffer());case 8:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}]),t}();function Df(t){"@babel/helpers - typeof";return(Df="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ff(){Ff=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new _(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return x()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c={};function f(){}function h(){}function p(){}var y={};s(y,o,function(){return this});var d=Object.getPrototypeOf,b=d&&d(d(P([])));b&&b!==e&&r.call(b,o)&&(y=b);var v=p.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach(function(e){s(t,e,function(t){return this._invoke(e,t)})})}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,s){var u=l(t[o],t,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==Df(f)&&r.call(f,"__await")?e.resolve(f.__await).then(function(t){n("next",t,a,s)},function(t){n("throw",t,a,s)}):e.resolve(f).then(function(t){c.value=t,a(c)},function(t){return n("throw",t,a,s)})}s(u.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function Bf(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Gf(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Bf(i,n,o,a,s,"next",t)}function s(t){Bf(i,n,o,a,s,"throw",t)}a(void 0)})}}function Uf(t){var e,r,n,o=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);o--;){if(r&&null!=(e=t[r]))return e.call(t);if(n&&null!=(e=t[n]))return new zf(e.call(t));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function zf(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return(zf=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var r=this.s.return;return void 0===r?Promise.resolve({value:t,done:!0}):e(r.apply(this.s,arguments))},throw:function(t){var r=this.s.return;return void 0===r?Promise.reject(t):e(r.apply(this.s,arguments))}},new zf(t)}function Jf(t){return new Hf(t,0)}function Vf(t){return function(){return new qf(t.apply(this,arguments))}}function qf(t){var e,r;function n(e,r){try{var i=t[e](r),a=i.value,s=a instanceof Hf;Promise.resolve(s?a.v:a).then(function(r){if(s){var u="return"===e?"return":"next";if(!a.k||r.done)return n(u,r);r=t[u](r).value}o(i.done?"return":"normal",r)},function(t){n("throw",t)})}catch(t){o("throw",t)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,o){return new Promise(function(i,a){var s={key:t,arg:o,resolve:i,reject:a,next:null};r?r=r.next=s:(e=r=s,n(t,o))})},"function"!=typeof t.return&&(this.return=void 0)}function Hf(t,e){this.v=t,this.k=e}function Wf(){return(Wf=Vf(Ff().mark(function t(e,r,n){var o,i,a,s,u,l,c,f,h,p;return Ff().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o="function"==typeof(y=e).slice?y:new yc("function"==typeof y.read?y:y.getReader()),i=function(){var t=Gf(Ff().mark(function t(e){return Ff().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.slice(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),t.t0=Uint8Array,t.next=5,Jf(i(8,"magic bytes"));case 5:if(t.t1=t.sent,(a=new t.t0(t.t1)).subarray(0,3).every(function(t,e){return yf[e]===t})){t.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return t.t2=Uint8Array,t.next=12,Jf(i(4,"header length"));case 12:return t.t3=t.sent,a=new t.t2(t.t3),s=new $l(a),u=s.readUint32(0),t.t4=Uint8Array,t.next=19,Jf(i(u,"header data"));case 19:if(t.t5=t.sent,a=new t.t4(t.t5),s=new $l(a),l=gc(s),n&&n(l),c=l.indexNodeSize,f=l.featuresCount,!(c>0)){t.next=29;break}return h=lf(f,c),t.next=29,Jf(i(h,"entire index, w/o rect"));case 29:return t.next=31,Jf(Qf(i,l,r));case 31:if(!(p=t.sent)){t.next=36;break}return t.next=34,p;case 34:t.next=29;break;case 36:case"end":return t.stop()}var y},t)}))).apply(this,arguments)}function Yf(){return(Yf=Vf(Ff().mark(function t(e,r,n,o){var i,a,s,u,l,c,f;return Ff().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Jf(Lf.open(e));case 2:i=t.sent,Kc.debug("opened reader"),o&&o(i.header),a=!1,s=!1,t.prev=7,l=Uf(i.selectBbox(r));case 9:return t.next=11,Jf(l.next());case 11:if(!(a=!(c=t.sent).done)){t.next=18;break}return f=c.value,t.next=15,n(f,i.header);case 15:a=!1,t.next=9;break;case 18:t.next=24;break;case 20:t.prev=20,t.t0=t.catch(7),s=!0,u=t.t0;case 24:if(t.prev=24,t.prev=25,!a||null==l.return){t.next=29;break}return t.next=29,Jf(l.return());case 29:if(t.prev=29,!s){t.next=32;break}throw u;case 32:return t.finish(29);case 33:return t.finish(24);case 34:case"end":return t.stop()}},t,null,[[7,20,24,34],[25,,29,33]])}))).apply(this,arguments)}function Qf(t,e,r){return Xf.apply(this,arguments)}function Xf(){return(Xf=Gf(Ff().mark(function t(e,r,n){var o,i,a,s,u;return Ff().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,e(4,"feature length");case 3:if(t.t1=t.sent,0!==(o=new t.t0(t.t1)).byteLength){t.next=7;break}return t.abrupt("return");case 7:return i=new $l(o),a=i.readUint32(0),t.t2=Uint8Array,t.next=12,e(a,"feature data");case 12:return t.t3=t.sent,o=new t.t2(t.t3),(s=new Uint8Array(a+4)).set(o,4),(i=new $l(s)).setPosition(df),u=lc.getRootAsFeature(i),t.abrupt("return",n(u,r));case 20:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Zf(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,3).every(function(t,e){return yf[e]===t}))throw new Error("Not a FlatGeobuf file");var n=new $l(t),o=n.readUint32(yf.length);n.setPosition(yf.length+df);var i=gc(n);r&&r(i);var a=yf.length+df+o,s=i.indexNodeSize,u=i.featuresCount;s>0&&(a+=lf(u,s));for(var l=[];a=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function ih(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function ah(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){ih(i,n,o,a,s,"next",t)}function s(t){ih(i,n,o,a,s,"throw",t)}a(void 0)})}}function sh(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:A.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.init()}var e,r,n;return e=t,(r=[{key:"init",value:function(){"bbox"===this.strategy&&(this.loadedExtentsRtree_=new(rh()))}},{key:"iterateFeatures",value:function(){var t=ah(oh().mark(function t(e){var r,n,o,i,a,s,u;return oh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r={type:"FeatureCollection",features:[]},n=!1,o=!1,t.prev=3,a=uh(e);case 5:return t.next=7,a.next();case 7:if(!(n=!(s=t.sent).done)){t.next=15;break}u=s.value,this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(u=this.options.featureLoader(u)),this.layerType||(this.layerType=ch[u.geometry.type]),r.features.push(u);case 12:n=!1,t.next=5;break;case 15:t.next=21;break;case 17:t.prev=17,t.t0=t.catch(3),o=!0,i=t.t0;case 21:if(t.prev=21,t.prev=22,!n||null==a.return){t.next=26;break}return t.next=26,a.return();case 26:if(t.prev=26,!o){t.next=29;break}throw i;case 29:return t.finish(26);case 30:return t.finish(21);case 31:return t.abrupt("return",r);case 32:case"end":return t.stop()}},t,this,[[3,17,21,31],[22,,26,30]])}));return function(e){return t.apply(this,arguments)}}()},{key:"_loadData",value:function(){var t=ah(oh().mark(function t(e){var r,n,o=this;return oh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]},e.length){t.next=7;break}return t.next=4,this._getStream(this.url);case 4:r=t.sent,t.next=9;break;case 7:n.value={extent:e.slice()},this.loadedExtentsRtree_.insert(n);case 9:return t.next=11,th(r&&r.body||this.url,n,function(t){o.layerType=ch[t.geometryType]});case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"_getStream",value:function(){var t=ah(oh().mark(function t(e){return oh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Hl.get(e,{},{withoutFormatSuffix:!0}).then(function(t){return t});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()},{key:"_containsExtent",value:function(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}},{key:"_getInExtent",value:function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.loadedExtentsRtree_.search(e).map(function(t){return t.value})}},{key:"_forEachInExtent",value:function(t,e){return this._forEach(this._getInExtent(t),e)}},{key:"_forEach",value:function(t,e){for(var r,n=0,o=t.length;n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function yh(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function dh(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){yh(i,n,o,a,s,"next",t)}function s(t){yh(i,n,o,a,s,"throw",t)}a(void 0)})}}function bh(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:A.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.overlay=!0,this.type="custom",this.renderingMode="3d",this._updateFeaturesFn=this._updateFeatures.bind(this)}var e,r,n;return e=t,(r=[{key:"onAdd",value:function(t){this.map=t;var e,r,n,o=[];if("bbox"===this.strategy){var i=this.map.getBounds().toArray();o=[i[0][0],i[0][1],i[1][0],i[1][1]],this.map.on("moveend",this._updateFeaturesFn)}if(this.extent){var a=(e=this.extent,n=[],function(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}(e,r=o)&&(e[0]>r[0]?n[0]=e[0]:n[0]=r[0],e[1]>r[1]?n[1]=e[1]:n[1]=r[1],e[2]0?(r.totalTimes--,r.ajaxPolling(t)):r._commit(t)}},{key:"ajaxPolling",value:function(t){var e=this,r=t.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return e.index=parseInt(Math.random()*e.length),e.url=e.urls[e.index],r=r.replace(n,n.exec(e.url)[0]),t.url=r,t.isInTheSameDomain=A.isInTheSameDomain(r),e._commit(t)}},{key:"calculatePollingTimes",value:function(){var t=this;t.times?t.totalTimes>t.POLLING_TIMES?t.times>t.POLLING_TIMES?t.totalTimes=t.POLLING_TIMES:t.totalTimes=t.times:t.timest.POLLING_TIMES&&(t.totalTimes=t.POLLING_TIMES),t.totalTimes--}},{key:"isServiceSupportPolling",value:function(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}},{key:"transformResult",value:function(t,e){return{result:t=A.transformResult(t),options:e}}},{key:"transformErrorResult",value:function(t,e){return{error:(t=A.transformResult(t)).error||t,options:e}}},{key:"serviceProcessCompleted",value:function(t,e){t=this.transformResult(t).result,this.events.triggerEvent("processCompleted",{result:t,options:e})}},{key:"serviceProcessFailed",value:function(t,e){var r=(t=this.transformErrorResult(t).error).error||t;this.events.triggerEvent("processFailed",{error:r,options:e})}},{key:"_returnContent",value:function(t){return t.scope.format!==Ee.FGB&&!!t.scope.returnContent}},{key:"supportDataFormat",value:function(t){return this.dataFormat().includes(t)}},{key:"dataFormat",value:function(){return[Ee.GEOJSON,Ee.ISERVER]}},{key:"_commit",value:function(t){var e=this;if("POST"===t.method||"PUT"===t.method||"PATCH"===t.method)if(t.params&&(t.url=A.urlAppend(t.url,A.getParameterString(t.params||{}))),"object"!==Rh(t.data)||t.data instanceof FormData)t.params=t.data;else try{t.params=A.toJSON(t.data)}catch(t){console.log("不是json对象")}return Hl.commit(t.method,t.url,t.params,{headers:t.headers,withoutFormatSuffix:t.withoutFormatSuffix,withCredentials:t.withCredentials,crossOrigin:t.crossOrigin,timeout:t.async?0:null,proxy:t.proxy}).then(function(t){return t.text?t.text():t.json?t.json():t}).then(function(e){var r=e;return"string"==typeof e&&(r=(new Zt).read(e)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&t.scope.format===Ee.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(t){return{error:t}}).then(function(r){var n={object:e};if(r.error){var o="processFailed";if(e.events&&e.events.listeners[o]&&e.events.listeners[o].length){var i=t.failure&&(t.scope?d.bind(t.failure,t.scope):t.failure);i?i(r,t):e.serviceProcessFailed(r,t)}else(n=Th(Th({},n),e.transformErrorResult(r,t))).type=o,t.failure&&t.failure(n)}else{var a="processCompleted";if(e.events&&e.events.listeners[a]&&e.events.listeners[a].length){var s=t.success&&(t.scope?d.bind(t.success,t.scope):t.success);s?s(r,t):e.serviceProcessCompleted(r,t)}else r.succeed=void 0==r.succeed||r.succeed,(n=Th(Th({},n),e.transformResult(r,t))).type=a,t.success&&t.success(n)}return n})}}])&&Ah(e.prototype,r),n&&Ah(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Lh(t){"@babel/helpers - typeof";return(Lh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nh(){Nh=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new _(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return x()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c={};function f(){}function h(){}function p(){}var y={};s(y,o,function(){return this});var d=Object.getPrototypeOf,b=d&&d(d(P([])));b&&b!==e&&r.call(b,o)&&(y=b);var v=p.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach(function(e){s(t,e,function(t){return this._invoke(e,t)})})}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,s){var u=l(t[o],t,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==Lh(f)&&r.call(f,"__await")?e.resolve(f.__await).then(function(t){n("next",t,a,s)},function(t){n("throw",t,a,s)}):e.resolve(f).then(function(t){c.value=t,a(c)},function(t){return n("throw",t,a,s)})}s(u.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function Ih(t){return function(t){if(Array.isArray(t))return Dh(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Dh(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dh(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dh(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function Wh(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Yh(t,e){for(var r=0;r