@mapgis/webclient-cesium-plugin 16.8.0 → 16.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,10 +9,10 @@ var r=i(9),o=i(10),n=i(11);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:
9
9
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
10
  t.read=function(e,t,i,r,o){var n,a,s=8*o-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?o-1:0,p=i?-1:1,d=e[t+u];for(u+=p,n=d&(1<<-c)-1,d>>=-c,c+=s;c>0;n=256*n+e[t+u],u+=p,c-=8);for(a=n&(1<<-c)-1,n>>=-c,c+=r;c>0;a=256*a+e[t+u],u+=p,c-=8);if(0===n)n=1-h;else{if(n===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),n-=h}return(d?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,o,n){var a,s,l,h=8*n-o-1,c=(1<<h)-1,u=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:n-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?p/l:p*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,o),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;e[i+d]=255&s,d+=f,s/=256,o-=8);for(a=a<<o|s,h+=o;h>0;e[i+d]=255&a,d+=f,a/=256,h-=8);e[i+d-f]|=128*y}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t){var i,r,o=e.exports={};function n(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(i===setTimeout)return setTimeout(e,0);if((i===n||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:n}catch(e){i=n}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,h=[],c=!1,u=-1;function p(){c&&l&&(c=!1,l.length?h=l.concat(h):u=-1,h.length&&d())}function d(){if(!c){var e=s(p);c=!0;for(var t=h.length;t;){for(l=h,h=[];++u<t;)l&&l[u].run();u=-1,t=h.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];h.push(new f(e,t)),1!==h.length||c||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){
11
11
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
12
- t.read=function(e,t,i,r,o){var n,a,s=8*o-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?o-1:0,p=i?-1:1,d=e[t+u];for(u+=p,n=d&(1<<-c)-1,d>>=-c,c+=s;c>0;n=256*n+e[t+u],u+=p,c-=8);for(a=n&(1<<-c)-1,n>>=-c,c+=r;c>0;a=256*a+e[t+u],u+=p,c-=8);if(0===n)n=1-h;else{if(n===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),n-=h}return(d?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,o,n){var a,s,l,h=8*n-o-1,c=(1<<h)-1,u=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:n-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?p/l:p*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,o),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;e[i+d]=255&s,d+=f,s/=256,o-=8);for(a=a<<o|s,h+=o;h>0;e[i+d]=255&a,d+=f,a/=256,h-=8);e[i+d-f]|=128*y}},function(e,t,i){"use strict";i.r(t);var r={};i.r(r),i.d(r,"createBillboard",function(){return eh}),i.d(r,"createLabel",function(){return th}),i.d(r,"createModelPrimitive",function(){return ih}),i.d(r,"createObject3DAppearance",function(){return rh}),i.d(r,"createSpherePrimitive",function(){return oh}),i.d(r,"createCylinderPrimitive",function(){return nh}),i.d(r,"getShadows",function(){return ah});var o=i(0),n=1,a=2,s=3,l=4,h=5,c=484813681109536e-20,u=Math.PI/2,p=.16666666666666666,d=.04722222222222222,f=.022156084656084655,y=1e-10,m=.017453292519943295,g=57.29577951308232,v=Math.PI/4,b=2*Math.PI,_=3.14159265359,w={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},x={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},C=/[\s_\-\/\(\)]/g;function k(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),o=t.toLowerCase().replace(C,""),n=-1;++n<r.length;)if((i=r[n]).toLowerCase().replace(C,"")===o)return e[i]}var M=function(e){var t,i,r,o={},n=e.split("+").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var i=t.split("=");return i.push(!0),e[i[0].toLowerCase()]=i[1],e},{}),a={proj:"projName",datum:"datumCode",rf:function(e){o.rf=parseFloat(e)},lat_0:function(e){o.lat0=e*m},lat_1:function(e){o.lat1=e*m},lat_2:function(e){o.lat2=e*m},lat_ts:function(e){o.lat_ts=e*m},lon_0:function(e){o.long0=e*m},lon_1:function(e){o.long1=e*m},lon_2:function(e){o.long2=e*m},alpha:function(e){o.alpha=parseFloat(e)*m},gamma:function(e){o.rectified_grid_angle=parseFloat(e)},lonc:function(e){o.longc=e*m},x_0:function(e){o.x0=parseFloat(e)},y_0:function(e){o.y0=parseFloat(e)},k_0:function(e){o.k0=parseFloat(e)},k:function(e){o.k0=parseFloat(e)},a:function(e){o.a=parseFloat(e)},b:function(e){o.b=parseFloat(e)},r_a:function(){o.R_A=!0},zone:function(e){o.zone=parseInt(e,10)},south:function(){o.utmSouth=!0},towgs84:function(e){o.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){o.to_meter=parseFloat(e)},units:function(e){o.units=e;var t=k(x,e);t&&(o.to_meter=t.to_meter)},from_greenwich:function(e){o.from_greenwich=e*m},pm:function(e){var t=k(w,e);o.from_greenwich=(t||parseFloat(e))*m},nadgrids:function(e){"@null"===e?o.datumCode="none":o.nadgrids=e},axis:function(e){3===e.length&&-1!=="ewnsud".indexOf(e.substr(0,1))&&-1!=="ewnsud".indexOf(e.substr(1,1))&&-1!=="ewnsud".indexOf(e.substr(2,1))&&(o.axis=e)},approx:function(){o.approx=!0}};for(t in n)i=n[t],t in a?"function"==typeof(r=a[t])?r(i):o[r]=i:o[t]=i;return"string"==typeof o.datumCode&&"WGS84"!==o.datumCode&&(o.datumCode=o.datumCode.toLowerCase()),o},S=function(e){return new A(e).output()},T=1,I=/\s/,E=/[A-Za-z]/,O=/[A-Za-z84_]/,P=/[,\]]/,j=/[\d\.E\-\+]/;function A(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=T}function R(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,o=i.reduce(function(e,t){return z(t,e),e},r);t&&(e[t]=o)}function z(e,t){if(Array.isArray(e)){var i=e.shift();if("PARAMETER"===i&&(i=e.shift()),1===e.length)return Array.isArray(e[0])?(t[i]={},void z(e[0],t[i])):void(t[i]=e[0]);if(e.length)if("TOWGS84"!==i){if("AXIS"===i)return i in t||(t[i]=[]),void t[i].push(e);var r;switch(Array.isArray(i)||(t[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[i]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&z(e[2],t[i]));case"SPHEROID":case"ELLIPSOID":return t[i]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&z(e[3],t[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void R(t,i,e);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return z(e,t[i]);return R(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}A.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;I.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case T:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},A.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(P.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},A.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=T)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=T,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},A.prototype.number=function(e){if(!j.test(e)){if(P.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},A.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},A.prototype.keyword=function(e){if(O.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=T)}if(!P.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},A.prototype.neutral=function(e){if(E.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(j.test(e))return this.word=e,void(this.state=3);if(!P.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},A.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var D=.017453292519943295;function F(e){return e*D}var N=function(e){var t=S(e),i=t.shift(),r=t.shift();t.unshift(["name",r]),t.unshift(["type",i]);var o={};return z(t,o),function(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",i=0,r=e.AXIS.length;i<r;++i){var o=[e.AXIS[i][0].toLowerCase(),e.AXIS[i][1].toLowerCase()];-1!==o[0].indexOf("north")||("y"===o[0]||"lat"===o[0])&&"north"===o[1]?t+="n":-1!==o[0].indexOf("south")||("y"===o[0]||"lat"===o[0])&&"south"===o[1]?t+="s":-1!==o[0].indexOf("east")||("x"===o[0]||"lon"===o[0])&&"east"===o[1]?t+="e":-1===o[0].indexOf("west")&&("x"!==o[0]&&"lon"!==o[0]||"west"!==o[1])||(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var n=e.GEOGCS;function a(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(n=e),n&&(n.DATUM?e.datumCode=n.DATUM.name.toLowerCase():e.datumCode=n.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),n.DATUM&&n.DATUM.SPHEROID&&(e.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=n.DATUM.SPHEROID.a,e.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(e.datum_params=n.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",F],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",F],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",F],["lat0","latitude_of_origin",F],["lat0","standard_parallel_1",F],["lat1","standard_parallel_1",F],["lat2","standard_parallel_2",F],["azimuth","Azimuth"],["alpha","azimuth",F],["srsCode","name"]].forEach(function(t){return function(e,t){var i=t[0],r=t[1];!(i in e)&&r in e&&(e[i]=e[r],3===t.length&&(e[i]=t[2](e[i])))}(e,t)}),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName?!e.lat_ts&&e.lat0&&"Polar_Stereographic"===e.projName&&(e.lat_ts=e.lat0,e.lat0=F(e.lat0>0?90:-90)):(e.lat0=F(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(o),o};function G(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?G[e]=M(arguments[1]):G[e]=N(arguments[1]):G[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?G.apply(t,e):G(e)});if("string"==typeof e){if(e in G)return G[e]}else"EPSG"in e?G["EPSG:"+e.EPSG]=e:"ESRI"in e?G["ESRI:"+e.ESRI]=e:"IAU2000"in e?G["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(G);var V=G;var B=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var q=["3857","900913","3785","102113"];var U=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in V}(e))return V[e];if(function(e){return B.some(function(t){return e.indexOf(t)>-1})}(e)){var t=N(e);if(function(e){var t=k(e,"authority");if(t){var i=k(t,"epsg");return i&&q.indexOf(i)>-1}}(t))return V["EPSG:3857"];var i=function(e){var t=k(e,"extension");if(t)return k(t,"proj4")}(t);return i?M(i):t}return function(e){return"+"===e[0]}(e)?M(e):void 0},W=function(e,t){var i,r;if(e=e||{},!t)return e;for(r in t)void 0!==(i=t[r])&&(e[r]=i);return e},H=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},Y=function(e){return e<0?-1:1},J=function(e){return Math.abs(e)<=_?e:e-Y(e)*b},$=function(e,t,i){var r=e*i,o=.5*e;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(u-t))/r},X=function(e,t){for(var i,r,o=.5*e,n=u-2*Math.atan(t),a=0;a<=15;a++)if(i=e*Math.sin(n),n+=r=u-2*Math.atan(t*Math.pow((1-i)/(1+i),o))-n,Math.abs(r)<=1e-10)return n;return-9999};function Z(e){return e}var K=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,i,r=e.x,o=e.y;if(o*g>90&&o*g<-90&&r*g>180&&r*g<-180)return null;if(Math.abs(Math.abs(o)-u)<=y)return null;if(this.sphere)t=this.x0+this.a*this.k0*J(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*o));else{var n=Math.sin(o),a=$(this.e,o,n);t=this.x0+this.a*this.k0*J(r-this.long0),i=this.y0-this.a*this.k0*Math.log(a)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,o=e.y-this.y0;if(this.sphere)i=u-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var n=Math.exp(-o/(this.a*this.k0));if(-9999===(i=X(this.e,n)))return null}return t=J(this.long0+r/(this.a*this.k0)),e.x=t,e.y=i,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Z,inverse:Z,names:["longlat","identity"]}],Q={},ee=[];function te(e,t){var i=ee.length;return e.names?(ee[i]=e,e.names.forEach(function(e){Q[e.toLowerCase()]=i}),this):(console.log(t),!0)}var ie={start:function(){K.forEach(te)},add:te,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==Q[t]&&ee[Q[t]]?ee[Q[t]]:void 0}},re={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},oe=re.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};re.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ne={};ne.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ne.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ne.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ne.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ne.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ne.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ne.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ne.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ne.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ne.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ne.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ne.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ne.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ne.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ne.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ne.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ne.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var ae=function(e,t,i,r,o,u,p){var d={};return d.datum_type=void 0===e||"none"===e?h:l,t&&(d.datum_params=t.map(parseFloat),0===d.datum_params[0]&&0===d.datum_params[1]&&0===d.datum_params[2]||(d.datum_type=n),d.datum_params.length>3&&(0===d.datum_params[3]&&0===d.datum_params[4]&&0===d.datum_params[5]&&0===d.datum_params[6]||(d.datum_type=a,d.datum_params[3]*=c,d.datum_params[4]*=c,d.datum_params[5]*=c,d.datum_params[6]=d.datum_params[6]/1e6+1))),p&&(d.datum_type=s,d.grids=p),d.a=i,d.b=r,d.es=o,d.ep2=u,d},se={};function le(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:se[e]||null,isNull:!1}}function he(e){return e/3600*Math.PI/180}function ce(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function ue(e){return e.map(function(e){return[he(e.longitudeShift),he(e.latitudeShift)]})}function pe(e,t,i){return{name:ce(e,t+8,t+16).trim(),parent:ce(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function de(e,t,i,r){for(var o=t+176,n=[],a=0;a<i.gridNodeCount;a++){var s={latitudeShift:e.getFloat32(o+16*a,r),longitudeShift:e.getFloat32(o+16*a+4,r),latitudeAccuracy:e.getFloat32(o+16*a+8,r),longitudeAccuracy:e.getFloat32(o+16*a+12,r)};n.push(s)}return n}function fe(e,t){if(!(this instanceof fe))return new fe(e);t=t||function(e){if(e)throw e};var i=U(e);if("object"==typeof i){var r=fe.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var o=k(ne,i.datumCode);o&&(i.datum_params=i.datum_params||(o.towgs84?o.towgs84.split(","):null),i.ellps=o.ellipse,i.datumName=o.datumName?o.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var n=function(e,t,i,r,o){if(!e){var n=k(re,r);n||(n=oe),e=n.a,t=n.b,i=n.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<y)&&(o=!0,t=e),{a:e,b:t,rf:i,sphere:o}}(i.a,i.b,i.rf,i.ellps,i.sphere),a=function(e,t,i,r){var o=e*e,n=t*t,a=(o-n)/o,s=0;return r?(o=(e*=1-a*(p+a*(d+a*f)))*e,a=0):s=Math.sqrt(a),{es:a,e:s,ep2:(o-n)/n}}(n.a,n.b,n.rf,i.R_A),s=function(e){return void 0===e?null:e.split(",").map(le)}(i.nadgrids),l=i.datum||ae(i.datumCode,i.datum_params,n.a,n.b,a.es,a.ep2,s);W(this,i),W(this,r),this.a=n.a,this.b=n.b,this.rf=n.rf,this.sphere=n.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=l,this.init(),t(null,this)}else t(e)}else t(e)}fe.projections=ie,fe.projections.start();var ye=fe;function me(e,t,i){var r,o,n,a,s=e.x,l=e.y,h=e.z?e.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:e.z};if(l>u)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),o=Math.sin(l),a=Math.cos(l),n=o*o,{x:((r=i/Math.sqrt(1-t*n))+h)*a*Math.cos(s),y:(r+h)*a*Math.sin(s),z:(r*(1-t)+h)*o}}function ge(e,t,i,r){var o,n,a,s,l,h,c,p,d,f,y,m,g,v,b,_=e.x,w=e.y,x=e.z?e.z:0;if(o=Math.sqrt(_*_+w*w),n=Math.sqrt(_*_+w*w+x*x),o/i<1e-12){if(v=0,n/i<1e-12)return u,b=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(w,_);a=x/n,p=(s=o/n)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),d=a*l,g=0;do{g++,h=t*(c=i/Math.sqrt(1-t*d*d))/(c+(b=o*p+x*d-c*(1-t*d*d))),m=(y=a*(l=1/Math.sqrt(1-h*(2-h)*s*s)))*p-(f=s*(1-h)*l)*d,p=f,d=y}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(y/Math.abs(f)),z:b}}function ve(e){return e===n||e===a}var be=function(e,t,i){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===n?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==a||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return i;if(e.datum_type===h||t.datum_type===h)return i;var r=e.a,o=e.es;if(e.datum_type===s){if(0!==_e(e,!1,i))return;r=6378137,o=.0066943799901413165}var l=t.a,c=t.b,u=t.es;if(t.datum_type===s&&(l=6378137,c=6356752.314,u=.0066943799901413165),o===u&&r===l&&!ve(e.datum_type)&&!ve(t.datum_type))return i;if((i=me(i,o,r),ve(e.datum_type)&&(i=function(e,t,i){if(t===n)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===a){var r=i[0],o=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6];return{x:u*(e.x-c*e.y+h*e.z)+r,y:u*(c*e.x+e.y-l*e.z)+o,z:u*(-h*e.x+l*e.y+e.z)+s}}}(i,e.datum_type,e.datum_params)),ve(t.datum_type)&&(i=function(e,t,i){if(t===n)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===a){var r=i[0],o=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6],p=(e.x-r)/u,d=(e.y-o)/u,f=(e.z-s)/u;return{x:p+c*d-h*f,y:-c*p+d+l*f,z:h*p-l*d+f}}}(i,t.datum_type,t.datum_params)),i=ge(i,u,l,c),t.datum_type===s)&&0!==_e(t,!0,i))return;return i};function _e(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},o={x:Number.NaN,y:Number.NaN},n=[],a=0;a<e.grids.length;a++){var s=e.grids[a];if(n.push(s.name),s.isNull){o=r;break}if(s.mandatory,null!==s.grid){var l=s.grid.subgrids[0],h=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,c=l.ll[0]-h,u=l.ll[1]-h,p=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,d=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(u>r.y||c>r.x||d<r.y||p<r.x||(o=we(r,t,l),isNaN(o.x))))break}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(o.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*g+" "+r.y*g+" tried: '"+n+"'"),-1):(i.x=-o.x,i.y=o.y,0)}function we(e,t,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var o={x:e.x,y:e.y};o.x-=i.ll[0],o.y-=i.ll[1],o.x=J(o.x-Math.PI)+Math.PI;var n=xe(o,i);if(t){if(isNaN(n.x))return r;n.x=o.x-n.x,n.y=o.y-n.y;var a,s,l=9;do{if(s=xe(n,i),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}a={x:o.x-(s.x+n.x),y:o.y-(s.y+n.y)},n.x+=a.x,n.y+=a.y}while(l--&&Math.abs(a.x)>1e-12&&Math.abs(a.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=J(n.x+i.ll[0]),r.y=n.y+i.ll[1]}else isNaN(n.x)||(r.x=e.x+n.x,r.y=e.y+n.y);return r}function xe(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},o=Math.floor(r.x),n=Math.floor(r.y),a=r.x-1*o,s=r.y-1*n,l={x:Number.NaN,y:Number.NaN};if(o<0||o>=t.lim[0])return l;if(n<0||n>=t.lim[1])return l;i=n*t.lim[0]+o;var h=t.cvs[i][0],c=t.cvs[i][1];i++;var u=t.cvs[i][0],p=t.cvs[i][1];i+=t.lim[0];var d=t.cvs[i][0],f=t.cvs[i][1];i--;var y=t.cvs[i][0],m=t.cvs[i][1],g=a*s,v=a*(1-s),b=(1-a)*(1-s),_=(1-a)*s;return l.x=b*h+v*u+_*y+g*d,l.y=b*c+v*p+_*m+g*f,l}var Ce=function(e,t,i){var r,o,n,a=i.x,s=i.y,l=i.z||0,h={};for(n=0;n<3;n++)if(!t||2!==n||void 0!==i.z)switch(0===n?(r=a,o=-1!=="ew".indexOf(e.axis[n])?"x":"y"):1===n?(r=s,o=-1!=="ns".indexOf(e.axis[n])?"y":"x"):(r=l,o="z"),e.axis[n]){case"e":h[o]=r;break;case"w":h[o]=-r;break;case"n":h[o]=r;break;case"s":h[o]=-r;break;case"u":void 0!==i[o]&&(h.z=r);break;case"d":void 0!==i[o]&&(h.z=-r);break;default:return null}return h},ke=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},Me=function(e){Se(e.x),Se(e.y)};function Se(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function Te(e,t,i,r){var o,l=void 0!==(i=Array.isArray(i)?ke(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(Me(i),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===n||e.datum.datum_type===a||e.datum.datum_type===s)&&"WGS84"!==t.datumCode||(t.datum.datum_type===n||t.datum.datum_type===a||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}(e,t)&&(i=Te(e,o=new ye("WGS84"),i,r),e=o),r&&"enu"!==e.axis&&(i=Ce(e,!1,i)),"longlat"===e.projName)i={x:i.x*m,y:i.y*m,z:i.z||0};else if(e.to_meter&&(i={x:i.x*e.to_meter,y:i.y*e.to_meter,z:i.z||0}),!(i=e.inverse(i)))return;if(e.from_greenwich&&(i.x+=e.from_greenwich),i=be(e.datum,t.datum,i))return t.from_greenwich&&(i={x:i.x-t.from_greenwich,y:i.y,z:i.z||0}),"longlat"===t.projName?i={x:i.x*g,y:i.y*g,z:i.z||0}:(i=t.forward(i),t.to_meter&&(i={x:i.x/t.to_meter,y:i.y/t.to_meter,z:i.z||0})),r&&"enu"!==t.axis?Ce(t,!0,i):(l||delete i.z,i)}var Le=ye("WGS84");function Ie(e,t,i,r){var o,n,a;return Array.isArray(i)?(o=Te(e,t,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof o.z?[o.x,o.y,o.z].concat(i.splice(3)):[o.x,o.y,i[2]].concat(i.splice(3)):[o.x,o.y].concat(i.splice(2)):[o.x,o.y]):(n=Te(e,t,i,r),2===(a=Object.keys(i)).length?n:(a.forEach(function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;n[r]=i[r]}),n))}function Ee(e){return e instanceof ye?e:e.oProj?e.oProj:ye(e)}var Oe=function(e,t,i){e=Ee(e);var r,o=!1;return void 0===t?(t=e,e=Le,o=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=Le,o=!0),t=Ee(t),i?Ie(e,t,i):(r={forward:function(i,r){return Ie(e,t,i,r)},inverse:function(i,r){return Ie(t,e,i,r)}},o&&(r.oProj=t),r)},Pe=6,je="AJSAJS",Ae="AFAFAF",Re=65,ze=73,De=79,Fe=86,Ne=90,Ge={forward:Ve,inverse:function(e){var t=We(Ye(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:Be};function Ve(e,t){return t=t||5,function(e,t){var i="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+function(e,t,i){var r=He(i),o=Math.floor(e/1e5),n=Math.floor(t/1e5)%20;return function(e,t,i){var r=i-1,o=je.charCodeAt(r),n=Ae.charCodeAt(r),a=o+e-1,s=n+t,l=!1;a>Ne&&(a=a-Ne+Re-1,l=!0);(a===ze||o<ze&&a>ze||(a>ze||o<ze)&&l)&&a++;(a===De||o<De&&a>De||(a>De||o<De)&&l)&&++a===ze&&a++;a>Ne&&(a=a-Ne+Re-1);s>Fe?(s=s-Fe+Re-1,l=!0):l=!1;(s===ze||n<ze&&s>ze||(s>ze||n<ze)&&l)&&s++;(s===De||n<De&&s>De||(s>De||n<De)&&l)&&++s===ze&&s++;s>Fe&&(s=s-Fe+Re-1);return String.fromCharCode(a)+String.fromCharCode(s)}(o,n,r)}(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+r.substr(r.length-5,t)}(function(e){var t,i,r,o,n,a,s,l=e.lat,h=e.lon,c=6378137,u=qe(l),p=qe(h);s=Math.floor((h+180)/6)+1,180===h&&(s=60);l>=56&&l<64&&h>=3&&h<12&&(s=32);l>=72&&l<84&&(h>=0&&h<9?s=31:h>=9&&h<21?s=33:h>=21&&h<33?s=35:h>=33&&h<42&&(s=37));a=qe(6*(s-1)-180+3),.006739496752268451,t=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),r=.006739496752268451*Math.cos(u)*Math.cos(u),o=Math.cos(u)*(p-a),n=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var d=.9996*t*(o+(1-i+r)*o*o*o/6+(5-18*i+i*i+72*r-.39089081163157013)*o*o*o*o*o/120)+5e5,f=.9996*(n+t*Math.tan(u)*(o*o/2+(5-i+9*r+4*r*r)*o*o*o*o/24+(61-58*i+i*i+600*r-2.2240339282485886)*o*o*o*o*o*o/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(d),zoneNumber:s,zoneLetter:function(e){var t="Z";84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C");return t}(l)}}({lat:e[1],lon:e[0]}),t)}function Be(e){var t=We(Ye(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function qe(e){return e*(Math.PI/180)}function Ue(e){return e/Math.PI*180}function We(e){var t=e.northing,i=e.easting,r=e.zoneLetter,o=e.zoneNumber;if(o<0||o>60)return null;var n,a,s,l,h,c,u,p,d=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=i-5e5,m=t;r<"N"&&(m-=1e7),c=6*(o-1)-180+3,p=(u=m/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),n=d/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),s=.006739496752268451*Math.cos(p)*Math.cos(p),l=.99330562*d/Math.pow(1-.00669438*Math.sin(p)*Math.sin(p),1.5),h=y/(.9996*n);var g=p-n*Math.tan(p)/l*(h*h/2-(5+3*a+10*s-4*s*s-.06065547077041606)*h*h*h*h/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*h*h*h*h*h*h/720);g=Ue(g);var v,b=(h-(1+2*a+s)*h*h*h/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*h*h*h*h*h/120)/Math.cos(p);if(b=c+Ue(b),e.accuracy){var _=We({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:_.lat,right:_.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function He(e){var t=e%Pe;return 0===t&&(t=Pe),t}function Ye(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,o="",n=0;!/[A-Z]/.test(t=e.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+e;o+=t,n++}var a=parseInt(o,10);if(0===n||n+3>i)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(n++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(n,n+=2);for(var l=He(a),h=function(e,t){var i=je.charCodeAt(t-1),r=1e5,o=!1;for(;i!==e.charCodeAt(0);){if(++i===ze&&i++,i===De&&i++,i>Ne){if(o)throw"Bad character: "+e;i=Re,o=!0}r+=1e5}return r}(r.charAt(0),l),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var i=Ae.charCodeAt(t-1),r=0,o=!1;for(;i!==e.charCodeAt(0);){if(++i===ze&&i++,i===De&&i++,i>Fe){if(o)throw"Bad character: "+e;i=Re,o=!0}r+=1e5}return r}(r.charAt(1),l);c<Je(s);)c+=2e6;var u=i-n;if(u%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var p,d,f,y=u/2,m=0,g=0;return y>0&&(p=1e5/Math.pow(10,y),d=e.substring(n,n+y),m=parseFloat(d)*p,f=e.substring(n+y),g=parseFloat(f)*p),{easting:m+h,northing:g+c,zoneLetter:s,zoneNumber:a,accuracy:p}}function Je(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function $e(e,t,i){if(!(this instanceof $e))return new $e(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}$e.fromMGRS=function(e){return new $e(Be(e))},$e.prototype.toMGRS=function(e){return Ve([this.x,this.y],e)};var Xe=$e,Ze=.01068115234375,Ke=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Ze))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Ze)));var i=e*e;return t[2]=i*(.46875-e*(.013020833333333334+.007120768229166667*e)),i*=e,t[3]=i*(.3645833333333333-.005696614583333333*e),t[4]=i*e*.3076171875,t},Qe=function(e,t,i,r){return i*=t,t*=t,r[0]*e-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},et=function(e,t,i){for(var r=1/(1-t),o=e,n=20;n;--n){var a=Math.sin(o),s=1-t*a*a;if(o-=s=(Qe(o,a,Math.cos(o),i)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<y)return o}return o};var tt={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Ke(this.es),this.ml0=Qe(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,i,r,o=e.x,n=e.y,a=J(o-this.long0),s=Math.sin(n),l=Math.cos(n);if(this.es){var h=l*a,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),p=Math.pow(u,2),d=Math.abs(l)>y?Math.tan(n):0,f=Math.pow(d,2),m=Math.pow(f,2);t=1-this.es*Math.pow(s,2),h/=Math.sqrt(t);var g=Qe(n,s,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+m+14*u-58*f*u+c/42*(61+179*m-m*f-479*f)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*a*h/2*(1+c/12*(5-f+9*u+4*p+c/30*(61+m-58*f+270*u-330*f*u+c/56*(1385+543*m-m*f-3111*f))))))+this.y0}else{var v=l*Math.sin(a);if(Math.abs(Math.abs(v)-1)<y)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(a)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>y)return 93;r=0}else r=Math.acos(r);n<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=i,e.y=r,e},inverse:function(e){var t,i,r,o,n=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,i=et(t,this.es,this.en),Math.abs(i)<u){var s=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>y?Math.tan(i):0,c=this.ep2*Math.pow(l,2),p=Math.pow(c,2),d=Math.pow(h,2),f=Math.pow(d,2);t=1-this.es*Math.pow(s,2);var m=n*Math.sqrt(t)/this.k0,g=Math.pow(m,2);r=i-(t*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*d-9*c*d+c-4*p-g/30*(61+90*d-252*c*d+45*f+46*c-g/56*(1385+3633*d+4095*f+1574*f*d)))),o=J(this.long0+m*(1-g/6*(1+2*d+c-g/20*(5+28*d+24*f+8*c*d+6*c-g/42*(61+662*d+1320*f+720*f*d))))/l)}else r=u*Y(a),o=0;else{var v=Math.exp(n/this.k0),b=.5*(v-1/v),_=this.lat0+a/this.k0,w=Math.cos(_);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(b,2))),r=Math.asin(t),a<0&&(r=-r),o=0===b&&0===w?0:J(Math.atan2(b,w)+this.long0)}return e.x=o,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},it=function(e){var t=Math.exp(e);return t=(t-1/t)/2},rt=function(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),r=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},ot=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,i=t-1;return 0===i?e:e*Math.log(t)/i}(t*(1+t/(rt(1,t)+1))),e<0?-t:t},nt=function(e,t){for(var i,r=2*Math.cos(2*t),o=e.length-1,n=e[o],a=0;--o>=0;)i=r*n-a+e[o],a=n,n=i;return t+i*Math.sin(2*t)},at=function(e,t){for(var i,r=2*Math.cos(t),o=e.length-1,n=e[o],a=0;--o>=0;)i=r*n-a+e[o],a=n,n=i;return Math.sin(t)*i},st=function(e,t,i){for(var r,o,n=Math.sin(t),a=Math.cos(t),s=it(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*a*l,c=-2*n*s,u=e.length-1,p=e[u],d=0,f=0,y=0;--u>=0;)r=f,o=d,p=h*(f=p)-r-c*(d=y)+e[u],y=c*f-o+h*d;return[(h=n*l)*p-(c=a*s)*y,h*y+c*p]};var lt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(tt.init.apply(this),this.forward=tt.forward,this.inverse=tt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),i*=t,this.cgb[1]=i*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i*=t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),i*=t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(t*(-24832/14175)-2.4)),i*=t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i*=t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),i*=t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i*=t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i*=t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i*=t,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=nt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+at(this.gtu,2*r))},forward:function(e){var t=J(e.x-this.long0),i=e.y;i=nt(this.cbg,i);var r=Math.sin(i),o=Math.cos(i),n=Math.sin(t),a=Math.cos(t);i=Math.atan2(r,a*o),t=Math.atan2(n*o,rt(r,o*a)),t=ot(Math.tan(t));var s,l,h=st(this.gtu,2*i,2*t);return i+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e},inverse:function(e){var t,i,r=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(o=(o-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var n=st(this.utg,2*o,2*r);o+=n[0],r+=n[1],r=Math.atan(it(r));var a=Math.sin(o),s=Math.cos(o),l=Math.sin(r),h=Math.cos(r);o=Math.atan2(a*h,rt(l,h*s)),r=Math.atan2(l,h*s),t=J(r+this.long0),i=nt(this.cgb,o)}else t=1/0,i=1/0;return e.x=t,e.y=i,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ht=function(e,t){if(void 0===e){if((e=Math.floor(30*(J(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e};var ct={init:function(){var e=ht(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*m,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,lt.init.apply(this),this.forward=lt.forward,this.inverse=lt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ut=function(e,t){return Math.pow((1-e)/(1+e),t)},pt=20;var dt={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+v)/(Math.pow(Math.tan(.5*this.lat0+v),this.C)*ut(this.e*e,this.ratexp))},forward:function(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+v),this.C)*ut(this.e*Math.sin(i),this.ratexp))-u,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,i=e.y,r=Math.pow(Math.tan(.5*i+v)/this.K,1/this.C),o=pt;o>0&&(i=2*Math.atan(r*ut(this.e*Math.sin(e.y),-.5*this.e))-u,!(Math.abs(i-e.y)<1e-14));--o)e.y=i;return o?(e.x=t,e.y=i,e):null},names:["gauss"]};var ft={init:function(){dt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,i,r,o;return e.x=J(e.x-this.long0),dt.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),o=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=o*i*Math.sin(e.x),e.y=o*(this.cosc0*t-this.sinc0*i*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,i,r,o,n;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,n=Math.sqrt(e.x*e.x+e.y*e.y)){var a=2*Math.atan2(n,this.R2);t=Math.sin(a),i=Math.cos(a),o=Math.asin(i*this.sinc0+e.y*t*this.cosc0/n),r=Math.atan2(e.x*t,n*this.cosc0*i-e.y*this.sinc0*t)}else o=this.phic0,r=0;return e.x=r,e.y=o,dt.inverse.apply(this,[e]),e.x=J(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var yt={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=y&&(this.k0=.5*(1+Y(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=y&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=y&&(this.k0=.5*this.cons*H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/$(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=H(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,i,r,o,n,a,s=e.x,l=e.y,h=Math.sin(l),c=Math.cos(l),p=J(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=y&&Math.abs(l+this.lat0)<=y?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(p)),e.x=this.a*t*c*Math.sin(p)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*c*Math.cos(p))+this.y0,e):(i=2*Math.atan(this.ssfn_(l,h,this.e))-u,o=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=y?(n=$(this.e,l*this.con,this.con*h),a=2*this.a*this.k0*n/this.cons,e.x=this.x0+a*Math.sin(s-this.long0),e.y=this.y0-this.con*a*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<y?(t=2*this.a*this.k0/(1+o*Math.cos(p)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*o*Math.cos(p))),e.y=t*(this.cosX0*r-this.sinX0*o*Math.cos(p))+this.y0),e.x=t*o*Math.sin(p)+this.x0,e))},inverse:function(e){var t,i,r,o,n;e.x-=this.x0,e.y-=this.y0;var a=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,i=this.lat0,a<=y?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/a),t=Math.abs(this.coslat0)<y?this.lat0>0?J(this.long0+Math.atan2(e.x,-1*e.y)):J(this.long0+Math.atan2(e.x,e.y)):J(this.long0+Math.atan2(e.x*Math.sin(s),a*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=y){if(a<=y)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=a*this.cons/(2*this.a*this.k0),i=this.con*X(this.e,r),t=this.con*J(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else o=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=y?n=this.X0:(n=Math.asin(Math.cos(o)*this.sinX0+e.y*Math.sin(o)*this.cosX0/a),t=J(this.long0+Math.atan2(e.x*Math.sin(o),a*this.cosX0*Math.cos(o)-e.y*this.sinX0*Math.sin(o)))),i=-1*X(this.e,Math.tan(.5*(u+n)));return e.x=t,e.y=i,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,i){return t*=i,Math.tan(.5*(u+e))*Math.pow((1-t)/(1+t),.5*i)}};var mt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,o=2*r-Math.pow(r,2),n=this.e=Math.sqrt(o);this.R=this.k0*i*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+n*t)/(1-n*t));this.K=a-this.alpha*s+this.alpha*n/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+i)+this.K,o=2*(Math.atan(Math.exp(r))-Math.PI/4),n=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(n))),s=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(n));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*a+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,o=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(o))),s=this.lambda0+a/this.alpha,l=0,h=n,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=h,e},names:["somerc"]},gt=1e-7;var vt={init:function(){var e,t,i,r,o,n,a,s,l,h,c,p=0,d=0,f=0,g=0,_=0,w=0,x=0;this.no_off=function(e){var t="object"==typeof e.PROJECTION?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(t)}(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var k=!1;if("rectified_grid_angle"in this&&(k=!0),C&&(x=this.alpha),k&&(p=this.rectified_grid_angle*m),C||k)d=this.longc;else if(f=this.long1,_=this.lat1,g=this.long2,w=this.lat2,Math.abs(_-w)<=gt||(e=Math.abs(_))<=gt||Math.abs(e-u)<=gt||Math.abs(Math.abs(this.lat0)-u)<=gt||Math.abs(Math.abs(w)-u)<=gt)throw new Error;var M=1-this.es;t=Math.sqrt(M),Math.abs(this.lat0)>y?(s=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*s*s,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/M),this.A=this.B*this.k0*t/e,(o=(r=this.B*t/(i*Math.sqrt(e)))*r-1)<=0?o=0:(o=Math.sqrt(o),this.lat0<0&&(o=-o)),this.E=o+=r,this.E*=Math.pow($(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=o=1),C||k?(C?(c=Math.asin(Math.sin(x)/r),k||(p=x)):(c=p,x=Math.asin(r*Math.sin(c))),this.lam0=d-Math.asin(.5*(o-1/o)*Math.tan(c))/this.B):(n=Math.pow($(this.e,_,Math.sin(_)),this.B),a=Math.pow($(this.e,w,Math.sin(w)),this.B),o=this.E/n,l=(a-n)/(a+n),h=((h=this.E*this.E)-a*n)/(h+a*n),(e=f-g)<-Math.pi?g-=b:e>Math.pi&&(g+=b),this.lam0=J(.5*(f+g)-Math.atan(h*Math.tan(.5*this.B*(f-g))/l)/this.B),c=Math.atan(2*Math.sin(this.B*J(f-this.lam0))/(o-1/o)),p=x=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),o=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(v-o)),this.v_pole_s=this.ArB*Math.log(Math.tan(v+o))},forward:function(e){var t,i,r,o,n,a,s,l,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-u)>y){if(t=.5*((n=this.E/Math.pow($(this.e,e.y,Math.sin(e.y)),this.B))-(a=1/n)),i=.5*(n+a),o=Math.sin(this.B*e.x),r=(t*this.singam-o*this.cosgam)/i,Math.abs(Math.abs(r)-1)<y)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*e.x),s=Math.abs(a)<gt?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+o*this.singam,a)}else l=e.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*e.y;return this.no_rot?(h.x=s,h.y=l):(s-=this.u_0,h.x=l*this.cosrot+s*this.sinrot,h.y=s*this.cosrot-l*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(e){var t,i,r,o,n,a,s,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),o=.5*((r=Math.exp(-this.BrA*i))-1/r),n=.5*(r+1/r),s=((a=Math.sin(this.BrA*t))*this.cosgam+o*this.singam)/n,Math.abs(Math.abs(s)-1)<y)l.x=0,l.y=s<0?-u:u;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=X(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(o*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var bt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<y)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),i=Math.cos(this.lat1),r=H(this.e,t,i),o=$(this.e,this.lat1,t),n=Math.sin(this.lat2),a=Math.cos(this.lat2),s=H(this.e,n,a),l=$(this.e,this.lat2,n),h=$(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>y?this.ns=Math.log(r/s)/Math.log(o/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=y&&(i=Y(i)*(u-2*y));var r,o,n=Math.abs(Math.abs(i)-u);if(n>y)r=$(this.e,i,Math.sin(i)),o=this.a*this.f0*Math.pow(r,this.ns);else{if((n=i*this.ns)<=0)return null;o=0}var a=this.ns*J(t-this.long0);return e.x=this.k0*(o*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(a))+this.y0,e},inverse:function(e){var t,i,r,o,n,a=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+s*s),i=1):(t=-Math.sqrt(a*a+s*s),i=-1);var l=0;if(0!==t&&(l=Math.atan2(i*a,i*s)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(o=X(this.e,r)))return null}else o=-u;return n=J(l/this.ns+this.long0),e.x=n,e.y=o,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var _t={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,i,r,o,n,a,s,l=e.x,h=e.y,c=J(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),r=-c*this.alfa,o=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),n=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(o)),a=this.n*n,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(o/2+this.s45),this.n),e.y=s*Math.cos(a)/1,e.x=s*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,o,n,a,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),n=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(o)),i=Math.asin(Math.cos(r)*Math.sin(o)/Math.cos(t)),e.x=this.long0-i/this.alfa,a=t,s=0;var h=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(s=1),a=e.y,h+=1}while(0===s&&h<15);return h>=15?null:e},names:["Krovak","krovak"]},wt=function(e,t,i,r,o){return e*o-t*Math.sin(2*o)+i*Math.sin(4*o)-r*Math.sin(6*o)},xt=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},Ct=function(e){return.375*e*(1+.25*e*(1+.46875*e))},kt=function(e){return.05859375*e*e*(1+.75*e)},Mt=function(e){return e*e*e*(35/3072)},St=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},Tt=function(e){return Math.abs(e)<u?e:e-Y(e)*Math.PI},Lt=function(e,t,i,r,o){var n,a;n=e/t;for(var s=0;s<15;s++)if(n+=a=(e-(t*n-i*Math.sin(2*n)+r*Math.sin(4*n)-o*Math.sin(6*n)))/(t-2*i*Math.cos(2*n)+4*r*Math.cos(4*n)-6*o*Math.cos(6*n)),Math.abs(a)<=1e-10)return n;return NaN};var It={init:function(){this.sphere||(this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=kt(this.es),this.e3=Mt(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,i,r=e.x,o=e.y;if(r=J(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(o)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(o),Math.cos(r))-this.lat0);else{var n=Math.sin(o),a=Math.cos(o),s=St(this.a,this.e,n),l=Math.tan(o)*Math.tan(o),h=r*Math.cos(o),c=h*h,u=this.es*a*a/(1-this.es);t=s*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),i=this.a*wt(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*n/a*c*(.5+(5-l+6*u)*c/24)}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r=e.x/this.a,o=e.y/this.a;if(this.sphere){var n=o+this.lat0;t=Math.asin(Math.sin(n)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(n))}else{var a=this.ml0/this.a+o,s=Lt(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-u)<=y)return e.x=this.long0,e.y=u,o<0&&(e.y*=-1),e;var l=St(this.a,this.e,Math.sin(s)),h=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(s),2),p=r*this.a/l,d=p*p;t=s-l*Math.tan(s)/h*p*p*(.5-(1+3*c)*p*p/24),i=p*(1-d*(c/3+(1+3*c)*c*d/15))/Math.cos(s)}return e.x=J(i+this.long0),e.y=Tt(t),e},names:["Cassini","Cassini_Soldner","cass"]},Et=function(e,t){var i;return e>1e-7?(1-e*e)*(t/(1-(i=e*t)*i)-.5/e*Math.log((1-i)/(1+i))):2*t};var Ot=.3333333333333333,Pt=.17222222222222222,jt=.10257936507936508,At=.06388888888888888,Rt=.0664021164021164,zt=.016415012942191543;var Dt={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-u)<y?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<y?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Et(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*Ot,t=e*e,i[0]+=t*Pt,i[1]=t*At,t*=e,i[0]+=t*jt,i[1]+=t*Rt,i[2]=t*zt,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Et(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,i,r,o,n,a,s,l,h,c,p=e.x,d=e.y;if(p=J(p-this.long0),this.sphere){if(n=Math.sin(d),c=Math.cos(d),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*n+this.cosph0*c*r)<=y)return null;t=(i=Math.sqrt(2/i))*c*Math.sin(p),i*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.lat0)<y)return null;i=v-.5*d,t=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(p),i*=r}}else{switch(s=0,l=0,h=0,r=Math.cos(p),o=Math.sin(p),n=Math.sin(d),a=Et(this.e,n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=a/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:h=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:h=1+l*r;break;case this.N_POLE:h=u+d,a=this.qp-a;break;case this.S_POLE:h=d-u,a=this.qp+a}if(Math.abs(h)<y)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),i=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*s-this.sinb1*l*r):(h=Math.sqrt(2/(1+l*r)))*s*this.ymf,t=this.xmf*h*l*o;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(h=Math.sqrt(a))*o,i=r*(this.mode===this.S_POLE?h:-h)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,o,n,a,s,l=e.x/this.a,h=e.y/this.a;if(this.sphere){var c,p=0,d=0;if((i=.5*(c=Math.sqrt(l*l+h*h)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(i),p=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=y?0:Math.asin(h*d/c),l*=d,h=p*c;break;case this.OBLIQ:i=Math.abs(c)<=y?this.lat0:Math.asin(p*this.sinph0+h*d*this.cosph0/c),l*=d*this.cosph0,h=(p-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:h=-h,i=u-i;break;case this.S_POLE:i-=u}t=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,h*=this.dd,(a=Math.sqrt(l*l+h*h))<y)return e.x=this.long0,e.y=this.lat0,e;o=2*Math.asin(.5*a/this.rq),r=Math.cos(o),l*=o=Math.sin(o),this.mode===this.OBLIQ?(s=r*this.sinb1+h*o*this.cosb1/a,n=this.qp*s,h=a*this.cosb1*r-h*this.sinb1*o):(s=h*o/a,n=this.qp*s,h=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(n=l*l+h*h))return e.x=this.long0,e.y=this.lat0,e;s=1-n/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(l,h),i=function(e,t){var i=e+e;return e+t[0]*Math.sin(i)+t[1]*Math.sin(i+i)+t[2]*Math.sin(i+i+i)}(Math.asin(s),this.apa)}return e.x=J(this.long0+t),e.y=i,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Ft=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};var Nt={init:function(){Math.abs(this.lat1+this.lat2)<y||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=H(this.e3,this.sin_po,this.cos_po),this.qs1=Et(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=H(this.e3,this.sin_po,this.cos_po),this.qs2=Et(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Et(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>y?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=Et(this.e3,this.sin_phi),o=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,n=this.ns0*J(t-this.long0),a=o*Math.sin(n)+this.x0,s=this.rh-o*Math.cos(n)+this.y0;return e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o,n,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),o=0,0!==t&&(o=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,i)),n=J(o/this.ns0+this.long0),e.x=n,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,o,n,a,s=Ft(.5*t);if(e<y)return s;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(s),r=Math.cos(s),s+=a=.5*(n=1-(o=e*i)*o)*n/r*(t/(1-l)-i/n+.5/e*Math.log((1-o)/(1+o))),Math.abs(a)<=1e-7)return s;return null}};var Gt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,i,r,o,n,a,s,l=e.x,h=e.y;return r=J(l-this.long0),t=Math.sin(h),i=Math.cos(h),o=Math.cos(r),(n=this.sin_p14*t+this.cos_p14*i*o)>0||Math.abs(n)<=y?(a=this.x0+1*this.a*i*Math.sin(r)/n,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*o)/n):(a=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*o)),e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o,n,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(o=Math.atan2(t,this.rc),i=Math.sin(o),r=Math.cos(o),a=Ft(r*this.sin_p14+e.y*i*this.cos_p14/t),n=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),n=J(this.long0+n)):(a=this.phic0,n=0),e.x=n,e.y=a,e},names:["gnom"]},Vt=function(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*u:u;for(var r,o,n,a,s=Math.asin(.5*t),l=0;l<30;l++)if(o=Math.sin(s),n=Math.cos(s),a=e*o,s+=r=Math.pow(1-a*a,2)/(2*n)*(t/(1-e*e)-o/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return s;return NaN};var Bt={init:function(){this.sphere||(this.k0=H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,o=e.y,n=J(r-this.long0);if(this.sphere)t=this.x0+this.a*n*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(o)/Math.cos(this.lat_ts);else{var a=Et(this.e,Math.sin(o));t=this.x0+this.a*this.k0*n,i=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=i,e},inverse:function(e){var t,i;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=J(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=Vt(this.e,2*e.y*this.k0/this.a),t=J(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]};var qt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,i=e.y,r=J(t-this.long0),o=Tt(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*o,e},inverse:function(e){var t=e.x,i=e.y;return e.x=J(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Tt(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ut=20;var Wt={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=kt(this.es),this.e3=Mt(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,o=e.x,n=e.y,a=J(o-this.long0);if(r=a*Math.sin(n),this.sphere)Math.abs(n)<=y?(t=this.a*a,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(n),i=this.a*(Tt(n-this.lat0)+(1-Math.cos(r))/Math.tan(n)));else if(Math.abs(n)<=y)t=this.a*a,i=-1*this.ml0;else{var s=St(this.a,this.e,Math.sin(n))/Math.tan(n);t=s*Math.sin(r),i=this.a*wt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(r))}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){var t,i,r,o,n,a,s,l,h;if(r=e.x-this.x0,o=e.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=y)t=J(r/this.a+this.long0),i=0;else{var c;for(a=this.lat0+o/this.a,s=r*r/this.a/this.a+a*a,l=a,n=Ut;n;--n)if(l+=h=-1*(a*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-a)/c-1),Math.abs(h)<=y){i=l;break}t=J(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(o+this.ml0)<=y)i=0,t=J(this.long0+r/this.a);else{var u,p,d,f,m;for(a=(this.ml0+o)/this.a,s=r*r/this.a/this.a+a*a,l=a,n=Ut;n;--n)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),p=this.a*wt(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(a*(u*(f=p/this.a)+1)-f-.5*u*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*a*f)/(4*u)+(a-f)*(u*d-2/Math.sin(2*l))-d),Math.abs(h)<=y){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=J(this.long0+Math.asin(r*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]};var Ht={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,i=e.x,r=e.y-this.lat0,o=i-this.long0,n=r/c*1e-5,a=o,s=1,l=0;for(t=1;t<=10;t++)s*=n,l+=this.A[t]*s;var h,u=l,p=a,d=1,f=0,y=0,m=0;for(t=1;t<=6;t++)h=f*u+d*p,d=d*u-f*p,f=h,y=y+this.B_re[t]*d-this.B_im[t]*f,m=m+this.B_im[t]*d+this.B_re[t]*f;return e.x=m*this.a+this.x0,e.y=y*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,o=e.y,n=r-this.x0,a=(o-this.y0)/this.a,s=n/this.a,l=1,h=0,u=0,p=0;for(t=1;t<=6;t++)i=h*a+l*s,l=l*a-h*s,h=i,u=u+this.C_re[t]*l-this.C_im[t]*h,p=p+this.C_im[t]*l+this.C_re[t]*h;for(var d=0;d<this.iterations;d++){var f,y=u,m=p,g=a,v=s;for(t=2;t<=6;t++)f=m*u+y*p,y=y*u-m*p,m=f,g+=(t-1)*(this.B_re[t]*y-this.B_im[t]*m),v+=(t-1)*(this.B_im[t]*y+this.B_re[t]*m);y=1,m=0;var b=this.B_re[1],_=this.B_im[1];for(t=2;t<=6;t++)f=m*u+y*p,y=y*u-m*p,m=f,b+=t*(this.B_re[t]*y-this.B_im[t]*m),_+=t*(this.B_im[t]*y+this.B_re[t]*m);var w=b*b+_*_;u=(g*b+v*_)/w,p=(v*b-g*_)/w}var x=u,C=p,k=1,M=0;for(t=1;t<=9;t++)k*=x,M+=this.D[t]*k;var S=this.lat0+M*c*1e5,T=this.long0+C;return e.x=T,e.y=S,e},names:["New_Zealand_Map_Grid","nzmg"]};var Yt={init:function(){},forward:function(e){var t=e.x,i=e.y,r=J(t-this.long0),o=this.x0+this.a*r,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=o,e.y=n,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=J(this.long0+e.x/this.a),i=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=i,e},names:["Miller_Cylindrical","mill"]},Jt=20;var $t={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ke(this.es)},forward:function(e){var t,i,r=e.x,o=e.y;if(r=J(r-this.long0),this.sphere){if(this.m)for(var n=this.n*Math.sin(o),a=Jt;a;--a){var s=(this.m*o+Math.sin(o)-n)/(this.m+Math.cos(o));if(o-=s,Math.abs(s)<y)break}else o=1!==this.n?Math.asin(this.n*Math.sin(o)):o;t=this.a*this.C_x*r*(this.m+Math.cos(o)),i=this.a*this.C_y*o}else{var l=Math.sin(o),h=Math.cos(o);i=this.a*Qe(o,l,h,this.en),t=this.a*r*h/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r,o;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=Ft((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Ft(Math.sin(t)/this.n)),r=J(r+this.long0),t=Tt(t)):(t=et(e.y/this.a,this.es,this.en),(o=Math.abs(t))<u?(o=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*o*o)/(this.a*Math.cos(t)),r=J(i)):o-y<u&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};var Xt={init:function(){},forward:function(e){for(var t=e.x,i=e.y,r=J(t-this.long0),o=i,n=Math.PI*Math.sin(i);;){var a=-(o+Math.sin(o)-n)/(1+Math.cos(o));if(o+=a,Math.abs(a)<y)break}o/=2,Math.PI/2-Math.abs(i)<y&&(r=0);var s=.900316316158*this.a*r*Math.cos(o)+this.x0,l=1.4142135623731*this.a*Math.sin(o)+this.y0;return e.x=s,e.y=l,e},inverse:function(e){var t,i;e.x-=this.x0,e.y-=this.y0,i=e.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),t=Math.asin(i);var r=J(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var o=Math.asin(i);return e.x=r,e.y=o,e},names:["Mollweide","moll"]};var Zt={init:function(){Math.abs(this.lat1+this.lat2)<y||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=kt(this.es),this.e3=Mt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=H(this.e,this.sinphi,this.cosphi),this.ml1=wt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<y?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=H(this.e,this.sinphi,this.cosphi),this.ml2=wt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=wt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,i=e.x,r=e.y;if(this.sphere)t=this.a*(this.g-r);else{var o=wt(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-o)}var n=this.ns*J(i-this.long0),a=this.x0+t*Math.sin(n),s=this.y0+this.rh-t*Math.cos(n);return e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var n=0;if(0!==i&&(n=Math.atan2(t*e.x,t*e.y)),this.sphere)return o=J(this.long0+n/this.ns),r=Tt(this.g-i/this.a),e.x=o,e.y=r,e;var a=this.g-i/this.a;return r=Lt(a,this.e0,this.e1,this.e2,this.e3),o=J(this.long0+n/this.ns),e.x=o,e.y=r,e},names:["Equidistant_Conic","eqdc"]};var Kt={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,o=e.y,n=J(r-this.long0);Math.abs(o)<=y&&(t=this.x0+this.R*n,i=this.y0);var a=Ft(2*Math.abs(o/Math.PI));(Math.abs(n)<=y||Math.abs(Math.abs(o)-u)<=y)&&(t=this.x0,i=o>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/n-n/Math.PI),l=s*s,h=Math.sin(a),c=Math.cos(a),p=c/(h+c-1),d=p*p,f=p*(2/h-1),m=f*f,g=Math.PI*this.R*(s*(p-m)+Math.sqrt(l*(p-m)*(p-m)-(m+l)*(d-m)))/(m+l);n<0&&(g=-g),t=this.x0+g;var v=l+p;return g=Math.PI*this.R*(f*v-s*Math.sqrt((m+l)*(l+1)-v*v))/(m+l),i=o>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,o,n,a,s,l,h,c,u,p;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,n=(r=e.x/u)*r+(o=e.y/u)*o,u=3*(o*o/(l=-2*(a=-Math.abs(o)*(1+n))+1+2*o*o+n*n)+(2*(s=a-2*o*o+r*r)*s*s/l/l/l-9*a*s/l/l)/27)/(h=(a-s*s/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),p=Math.acos(u)/3,i=e.y>=0?(-c*Math.cos(p+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(p+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<y?this.long0:J(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(r*r-o*o)+n*n))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var Qt={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,i,r,o,n,a,s,l,h,c,p,d,f,m,g,v,b,_,w,x,C,k,M=e.x,S=e.y,T=Math.sin(e.y),L=Math.cos(e.y),I=J(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=y?(e.x=this.x0+this.a*(u-S)*Math.sin(I),e.y=this.y0-this.a*(u-S)*Math.cos(I),e):Math.abs(this.sin_p12+1)<=y?(e.x=this.x0+this.a*(u+S)*Math.sin(I),e.y=this.y0+this.a*(u+S)*Math.cos(I),e):(_=this.sin_p12*T+this.cos_p12*L*Math.cos(I),b=(v=Math.acos(_))?v/Math.sin(v):1,e.x=this.x0+this.a*b*L*Math.sin(I),e.y=this.y0+this.a*b*(this.cos_p12*T-this.sin_p12*L*Math.cos(I)),e):(t=xt(this.es),i=Ct(this.es),r=kt(this.es),o=Mt(this.es),Math.abs(this.sin_p12-1)<=y?(n=this.a*wt(t,i,r,o,u),a=this.a*wt(t,i,r,o,S),e.x=this.x0+(n-a)*Math.sin(I),e.y=this.y0-(n-a)*Math.cos(I),e):Math.abs(this.sin_p12+1)<=y?(n=this.a*wt(t,i,r,o,u),a=this.a*wt(t,i,r,o,S),e.x=this.x0+(n+a)*Math.sin(I),e.y=this.y0+(n+a)*Math.cos(I),e):(s=T/L,l=St(this.a,this.e,this.sin_p12),h=St(this.a,this.e,T),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(h*L)),w=0===(p=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(p)-Math.PI)<=y?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(I)*Math.cos(c)/Math.sin(p)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),v=l*w*(1-(x=w*w)*(g=(f=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es))*f)*(1-g)/6+(C=x*w)/8*(m=d*f)*(1-2*g)+(k=C*w)/120*(g*(4-7*g)-3*d*d*(1-7*g))-k*w/48*m),e.x=this.x0+v*Math.sin(p),e.y=this.y0+v*Math.cos(p),e))},inverse:function(e){var t,i,r,o,n,a,s,l,h,c,p,d,f,m,g,v,b,_,w,x,C,k,M;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*u*this.a)return;return i=t/this.a,r=Math.sin(i),o=Math.cos(i),n=this.long0,Math.abs(t)<=y?a=this.lat0:(a=Ft(o*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-u,n=Math.abs(s)<=y?this.lat0>=0?J(this.long0+Math.atan2(e.x,-e.y)):J(this.long0-Math.atan2(-e.x,e.y)):J(this.long0+Math.atan2(e.x*r,t*this.cos_p12*o-e.y*this.sin_p12*r))),e.x=n,e.y=a,e}return l=xt(this.es),h=Ct(this.es),c=kt(this.es),p=Mt(this.es),Math.abs(this.sin_p12-1)<=y?(d=this.a*wt(l,h,c,p,u),t=Math.sqrt(e.x*e.x+e.y*e.y),a=Lt((d-t)/this.a,l,h,c,p),n=J(this.long0+Math.atan2(e.x,-1*e.y)),e.x=n,e.y=a,e):Math.abs(this.sin_p12+1)<=y?(d=this.a*wt(l,h,c,p,u),t=Math.sqrt(e.x*e.x+e.y*e.y),a=Lt((t-d)/this.a,l,h,c,p),n=J(this.long0+Math.atan2(e.x,e.y)),e.x=n,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),f=St(this.a,this.e,this.sin_p12),v=Math.cos(g),_=-(b=this.e*this.cos_p12*v)*b/(1-this.es),w=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),k=1-_*(C=(x=t/f)-_*(1+_)*Math.pow(x,3)/6-w*(1+3*_)*Math.pow(x,4)/24)*C/2-x*C*C*C/6,m=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*v),n=J(this.long0+Math.asin(Math.sin(g)*Math.sin(C)/Math.cos(m))),M=Math.sin(m),a=Math.atan2((M-this.es*k*this.sin_p12)*Math.tan(m),M*(1-this.es)),e.x=n,e.y=a,e)},names:["Azimuthal_Equidistant","aeqd"]};var ei={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,o,n,a,s,l=e.x,h=e.y;return r=J(l-this.long0),t=Math.sin(h),i=Math.cos(h),o=Math.cos(r),((n=this.sin_p14*t+this.cos_p14*i*o)>0||Math.abs(n)<=y)&&(a=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*o)),e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o,n,a,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Ft(t/this.a),r=Math.sin(i),o=Math.cos(i),a=this.long0,Math.abs(t)<=y?(s=this.lat0,e.x=a,e.y=s,e):(s=Ft(o*this.sin_p14+e.y*r*this.cos_p14/t),n=Math.abs(this.lat0)-u,Math.abs(n)<=y?(a=this.lat0>=0?J(this.long0+Math.atan2(e.x,-e.y)):J(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=s,e):(a=J(this.long0+Math.atan2(e.x*r,t*this.cos_p14*o-e.y*this.sin_p14*r)),e.x=a,e.y=s,e))},names:["ortho"]},ti={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ii={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ri(e,t,i,r){var o;return e<y?(r.value=ii.AREA_0,o=0):(o=Math.atan2(t,i),Math.abs(o)<=v?r.value=ii.AREA_0:o>v&&o<=u+v?(r.value=ii.AREA_1,o-=u):o>u+v||o<=-(u+v)?(r.value=ii.AREA_2,o=o>=0?o-_:o+_):(r.value=ii.AREA_3,o+=u)),o}function oi(e,t){var i=e+t;return i<-_?i+=b:i>+_&&(i-=b),i}var ni={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-v/2?this.face=ti.TOP:this.lat0<=-(u-v/2)?this.face=ti.BOTTOM:Math.abs(this.long0)<=v?this.face=ti.FRONT:Math.abs(this.long0)<=u+v?this.face=this.long0>0?ti.RIGHT:ti.LEFT:this.face=ti.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,i,r,o,n,a,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,i=e.x,this.face===ti.TOP)o=u-t,i>=v&&i<=u+v?(l.value=ii.AREA_0,r=i-u):i>u+v||i<=-(u+v)?(l.value=ii.AREA_1,r=i>0?i-_:i+_):i>-(u+v)&&i<=-v?(l.value=ii.AREA_2,r=i+u):(l.value=ii.AREA_3,r=i);else if(this.face===ti.BOTTOM)o=u+t,i>=v&&i<=u+v?(l.value=ii.AREA_0,r=-i+u):i<v&&i>=-v?(l.value=ii.AREA_1,r=-i):i<-v&&i>=-(u+v)?(l.value=ii.AREA_2,r=-i-u):(l.value=ii.AREA_3,r=i>0?-i+_:-i-_);else{var h,c,p,d,f,y;this.face===ti.RIGHT?i=oi(i,+u):this.face===ti.BACK?i=oi(i,+_):this.face===ti.LEFT&&(i=oi(i,-u)),d=Math.sin(t),f=Math.cos(t),y=Math.sin(i),h=f*Math.cos(i),c=f*y,p=d,this.face===ti.FRONT?r=ri(o=Math.acos(h),p,c,l):this.face===ti.RIGHT?r=ri(o=Math.acos(c),p,-h,l):this.face===ti.BACK?r=ri(o=Math.acos(-h),p,-c,l):this.face===ti.LEFT?r=ri(o=Math.acos(-c),p,h,l):(o=r=0,l.value=ii.AREA_0)}return a=Math.atan(12/_*(r+Math.acos(Math.sin(r)*Math.cos(v))-u)),n=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===ii.AREA_1?a+=u:l.value===ii.AREA_2?a+=_:l.value===ii.AREA_3&&(a+=1.5*_),s.x=n*Math.cos(a),s.y=n*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,i,r,o,n,a,s,l,h,c,p,d,f={lam:0,phi:0},y={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?y.value=ii.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(y.value=ii.AREA_1,t-=u):e.x<0&&-e.x>=Math.abs(e.y)?(y.value=ii.AREA_2,t=t<0?t+_:t-_):(y.value=ii.AREA_3,t+=u),h=_/12*Math.tan(t),n=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(n),(s=1-(r=Math.cos(t))*r*(o=Math.tan(i))*o*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===ti.TOP)l=Math.acos(s),f.phi=u-l,y.value===ii.AREA_0?f.lam=a+u:y.value===ii.AREA_1?f.lam=a<0?a+_:a-_:y.value===ii.AREA_2?f.lam=a-u:f.lam=a;else if(this.face===ti.BOTTOM)l=Math.acos(s),f.phi=l-u,y.value===ii.AREA_0?f.lam=-a+u:y.value===ii.AREA_1?f.lam=-a:y.value===ii.AREA_2?f.lam=-a-u:f.lam=a<0?-a-_:-a+_;else{var m,g,v;h=(m=s)*m,g=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(a))*v)>=1?0:Math.sqrt(1-h),y.value===ii.AREA_1?(h=g,g=-v,v=h):y.value===ii.AREA_2?(g=-g,v=-v):y.value===ii.AREA_3&&(h=g,g=v,v=-h),this.face===ti.RIGHT?(h=m,m=-g,g=h):this.face===ti.BACK?(m=-m,g=-g):this.face===ti.LEFT&&(h=m,m=g,g=-h),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(g,m),this.face===ti.RIGHT?f.lam=oi(f.lam,-u):this.face===ti.BACK?f.lam=oi(f.lam,-_):this.face===ti.LEFT&&(f.lam=oi(f.lam,+u))}return 0!==this.es&&(c=f.phi<0?1:0,p=Math.tan(f.phi),d=this.b/Math.sqrt(p*p+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),c&&(f.phi=-f.phi)),f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},ai=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],si=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],li=.8487,hi=1.3523,ci=g/5,ui=1/ci,pi=18,di=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},fi=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};var yi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=J(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*ci);r<0?r=0:r>=pi&&(r=pi-1),i=g*(i-ui*r);var o={x:di(ai[r],i)*t,y:di(si[r],i)};return e.y<0&&(o.y=-o.y),o.x=o.x*this.a*li+this.x0,o.y=o.y*this.a*hi+this.y0,o},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*li),y:Math.abs(e.y-this.y0)/(this.a*hi)};if(t.y>=1)t.x/=ai[pi][0],t.y=e.y<0?-u:u;else{var i=Math.floor(t.y*pi);for(i<0?i=0:i>=pi&&(i=pi-1);;)if(si[i][0]>t.y)--i;else{if(!(si[i+1][0]<=t.y))break;++i}var r=si[i],o=5*(t.y-r[0])/(si[i+1][0]-r[0]);o=function(e,t,i,r){for(var o=t;r;--r){var n=e(o);if(o-=n,Math.abs(n)<i)break}return o}(function(e){return(di(r,e)-t.y)/fi(r,e)},o,y,100),t.x/=di(ai[i],o),t.y=(5*i+o)*m,e.y<0&&(t.y=-t.y)}return t.x=J(t.x+this.long0),t},names:["Robinson","robin"]};var mi={init:function(){this.name="geocent"},forward:function(e){return me(e,this.es,this.a)},inverse:function(e){return ge(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},gi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},vi={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var bi={init:function(){if(Object.keys(vi).forEach(function(e){if(void 0===this[e])this[e]=vi[e].def;else{if(vi[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);vi[e].num&&(this[e]=parseFloat(this[e]))}vi[e].degrees&&(this[e]=this[e]*m)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)<y?this.mode=this.lat0<0?gi.S_POLE:gi.N_POLE:Math.abs(this.lat0)<y?this.mode=gi.EQUIT:(this.mode=gi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,i,r,o,n=Math.sin(e.y),a=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case gi.OBLIQ:i=this.sinph0*n+this.cosph0*a*s;break;case gi.EQUIT:i=a*s;break;case gi.S_POLE:i=-n;break;case gi.N_POLE:i=n}switch(t=(i=this.pn1/(this.p-i))*a*Math.sin(e.x),this.mode){case gi.OBLIQ:i*=this.cosph0*n-this.sinph0*a*s;break;case gi.EQUIT:i*=n;break;case gi.N_POLE:i*=-a*s;break;case gi.S_POLE:i*=a*s}return o=1/((r=i*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-i*this.sg)*this.cw*o,i=r*o,e.x=t*this.a,e.y=i*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,i,r,o={x:e.x,y:e.y};r=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*r,i=this.pn1*e.y*this.cw*r,e.x=t*this.cg+i*this.sg,e.y=i*this.cg-t*this.sg;var n=rt(e.x,e.y);if(Math.abs(n)<y)o.x=0,o.y=e.y;else{var a,s;switch(s=1-n*n*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/n+n/this.pn1),a=Math.sqrt(1-s*s),this.mode){case gi.OBLIQ:o.y=Math.asin(a*this.sinph0+e.y*s*this.cosph0/n),e.y=(a-this.sinph0*Math.sin(o.y))*n,e.x*=s*this.cosph0;break;case gi.EQUIT:o.y=Math.asin(e.y*s/n),e.y=a*n,e.x*=s;break;case gi.N_POLE:o.y=Math.asin(a),e.y=-e.y;break;case gi.S_POLE:o.y=-Math.asin(a)}o.x=Math.atan2(e.x,e.y)}return e.x=o.x+this.long0,e.y=o.y,e},names:["Tilted_Perspective","tpers"]};var _i={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,i,r,o,n=e.x,a=e.y;if(n-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/rt(this.radius_p*Math.cos(a),Math.sin(a));if(i=s*Math.cos(n)*Math.cos(a),r=s*Math.sin(n)*Math.cos(a),o=s*Math.sin(a),(this.radius_g-i)*i-r*r-o*o*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/rt(o,t)),e.y=this.radius_g_1*Math.atan(o/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(o/rt(r,t)))}else"sphere"===this.shape&&(t=Math.cos(a),i=Math.cos(n)*t,r=Math.sin(n)*t,o=Math.sin(a),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/rt(o,t)),e.y=this.radius_g_1*Math.atan(o/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(o/rt(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,o,n=-1,a=0,s=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*rt(1,s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*rt(1,a));var l=s/this.radius_p;if(t=a*a+l*l+n*n,(r=(i=2*this.radius_g*n)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+o*n,a*=o,s*=o,e.x=Math.atan2(a,n),e.y=Math.atan(s*Math.cos(e.x)/n),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+a*a)),t=a*a+s*s+n*n,(r=(i=2*this.radius_g*n)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+o*n,a*=o,s*=o,e.x=Math.atan2(a,n),e.y=Math.atan(s*Math.cos(e.x)/n)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};Oe.defaultDatum="WGS84",Oe.Proj=ye,Oe.WGS84=new Oe.Proj("WGS84"),Oe.Point=Xe,Oe.toPoint=ke,Oe.defs=V,Oe.nadgrid=function(e,t){var i=new DataView(t),r=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),o=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:ce(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,r);o.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var n={header:o,subgrids:function(e,t,i){for(var r=[],o=0;o<t.nSubgrids;o++){var n=pe(e,176,i),a=de(e,176,n,i),s=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),l=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);r.push({ll:[he(n.lowerLongitude),he(n.lowerLatitude)],del:[he(n.longitudeInterval),he(n.latitudeInterval)],lim:[s,l],count:n.gridNodeCount,cvs:ue(a)})}return r}(i,o,r)};return se[e]=n,n},Oe.transform=Te,Oe.mgrs=Ge,Oe.version="__VERSION__",function(e){e.Proj.projections.add(tt),e.Proj.projections.add(lt),e.Proj.projections.add(ct),e.Proj.projections.add(ft),e.Proj.projections.add(yt),e.Proj.projections.add(mt),e.Proj.projections.add(vt),e.Proj.projections.add(bt),e.Proj.projections.add(_t),e.Proj.projections.add(It),e.Proj.projections.add(Dt),e.Proj.projections.add(Nt),e.Proj.projections.add(Gt),e.Proj.projections.add(Bt),e.Proj.projections.add(qt),e.Proj.projections.add(Wt),e.Proj.projections.add(Ht),e.Proj.projections.add(Yt),e.Proj.projections.add($t),e.Proj.projections.add(Xt),e.Proj.projections.add(Zt),e.Proj.projections.add(Kt),e.Proj.projections.add(Qt),e.Proj.projections.add(ei),e.Proj.projections.add(ni),e.Proj.projections.add(yi),e.Proj.projections.add(mi),e.Proj.projections.add(bi),e.Proj.projections.add(_i)}(Oe);var wi=Oe;function xi(e,t,i){let r=e.wkid,n=e.wkt,a=void 0;if(e.isWebMercator&&(r=3857),!Object(o.defined)(r)&&!Object(o.defined)(n))return new Cesium.WebMercatorTilingScheme;if(Object(o.defined)(r)){const e=o.EPSG.find(e=>e.id===r);if(!Object(o.defined)(e))return o.Log.error("根据该空间参考系的wkid未匹配到wkt值"),new Cesium.WebMercatorTilingScheme;n=e.strProject}switch(r){case 4326:case 4490:case 4610:case 4214:Object(o.defined)(i)&&!Object(o.defined)(i.lods)?a=new Cesium.GeographicTilingScheme:(Object(o.defined)(t)||(t={xmin:-180,ymin:-90,xmax:180,ymax:90}),a=new Cesium.CustomTilingScheme({wkt:n,wkid:r,proj4:wi,tileInfo:i,numberOfLevelZeroTilesX:Object(o.defined)(i)?2:1,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax)}));break;default:Object(o.defined)(i)&&!Object(o.defined)(i.lods)?a=new Cesium.WebMercatorTilingScheme:(Object(o.defined)(t)||(t={xmin:-20037508.342787,ymin:-20037508.342787,xmax:20037508.342787,ymax:20037508.342787}),a=new Cesium.CustomTilingScheme({wkt:n,wkid:r,proj4:wi,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax)}))}return a}function Ci(e,t){let i=t.imageryLayers._layers.length;for(let r=0;r<t.imageryLayers._layers.length;r++)if(t.imageryLayers._layers[r].hasOwnProperty("_realIndex")&&e._realIndex+1<t.imageryLayers._layers[r]._realIndex){i=r;break}return i}function ki(e,t){const i={...e.extent},r=e.spatialReference.wkid,n=e.spatialReference.wkt;let a=void 0;e.spatialReference.isGeographic?a=new Cesium.Rectangle(-180,-90,180,90):e.spatialReference.isWebMercator&&(a=new Cesium.Rectangle(-20037508.342787,-20037508.342787,20037508.342787,20037508.342787)),a&&(i.xmin=Cesium.Math.clamp(i.xmin,a.west,a.east),i.ymin=Cesium.Math.clamp(i.ymin,a.south,a.north),i.xmax=Cesium.Math.clamp(i.xmax,a.west,a.east),i.ymax=Cesium.Math.clamp(i.ymax,a.south,a.north));const s=o.Projection.projectPoints({originWKID:r,originDefs:n,targetWKID:4326,points:[[i.xmin,i.ymax],[i.xmax,i.ymin]]}),[l,h]=s,c={xmin:Cesium.Math.toDegrees(t.west),xmax:Cesium.Math.toDegrees(t.east),ymin:Cesium.Math.toDegrees(t.south),ymax:Cesium.Math.toDegrees(t.north)};return i.xmin=Cesium.Math.clamp(l[0],c.xmin,c.xmax),i.xmax=Cesium.Math.clamp(h[0],c.xmin,c.xmax),i.ymin=Cesium.Math.clamp(h[1],c.ymin,c.ymax),i.ymax=Cesium.Math.clamp(l[1],c.ymin,c.ymax),i}function Mi(e){let t={};return t.url=Object(o.defaultValue)(e.url,void 0),t.id=Object(o.defaultValue)(e.id,void 0),t.show=Object(o.defaultValue)(e.show,!0),t.layerIndex=Object(o.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(o.defaultValue)(e.layerRenderIndex,0),t.igserver=!0,t=Object.assign(t,e.extendOptions)}function Si(e){const t={},i=e.range,r={xMin:i.xmin,yMin:i.ymin,xMax:i.xmax,yMax:i.ymax},n=e.range3D,a={xMin:n.xmin,yMin:n.ymin,xMax:n.xmax,yMax:n.ymax,zMin:n.zmin,zMax:n.zmax};return t.scale=Object(o.defaultValue)(e.elevationScale,void 0),t.range=r,t.range3D=a,t.requestVertexNormals=Object(o.defaultValue)(e.requestVertexNormals,!1),t.sceneIndex=0,t.layerIndex=Object(o.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(o.defaultValue)(e.layerRenderIndex,0),t.show=Object(o.defaultValue)(e.show,!0),t.autoReset=Object(o.defaultValue)(e.autoReset,!0),t}function Ti(e,t){const i=(t=Object(o.defaultValue)(t,{})).sceneIndex,r=t.layerIndex,n=t.layerRenderIndex,a=Object(o.defaultValue)(t.requestVertexNormals,!1);let s;s=t.url.indexOf("/SceneServer")>-1?`${t.url}/layers/${r}/terrains?level={z}&row={x}&col={y}&xDensity=65&yDensity=65&hasNormals=${a}`:`${t.url}/GetTerrain?sceneIndex=${i}&layerIndex=${n}&Level={z}&Row={x}&Col={y}&xdensity=65&ydensity=65&webGL=true&hasNormals=${a}`;const l=new Cesium.MapGISTerrainProvider({url:s,range:t.range,scale:t.scale,requestVertexNormals:a,terrainColorTblInfo:t.terrainColorTblInfo,range3D:t.range3D,waterHeight:t.waterHeight});return e.scene.terrainProvider=l,l.type="terrain",l}function Li(e,t,i,r,n){(e=Object(o.defaultValue)(e,{})).headers&&(e.url=new Cesium.Resource({url:e.url,headers:e.headers})),e._scene=t.scene;const a=t.scene.primitives.add(new Cesium.MapGISM3DSet(e));i._layersMap.put(e.id,a),a.readyPromise.then(function(t){t.id=e.id,t.type="m3d",r&&"function"==typeof r&&r(t)}).otherwise(function(e){n&&"function"==typeof n&&n(e)})}function Ii(e,t,i){t=Object(o.defaultValue)(t,{});const r=Object(o.defaultValue)(t.duration,0),n=Object(o.defaultValue)(t.orientation,new Cesium.HeadingPitchRange(0,-.5,2.5*e.radius));i.scene.camera.flyToBoundingSphere(e,{duration:r,offset:n}),i.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}function Ei(e,t,i,r){(t=Object(o.defaultValue)(t,{})).url=e;let n=void 0;-1!==e.indexOf("igs/rest/mrfs")&&(n="MapGIS2D"),-1!==e.indexOf("igs/rest/g3d")&&(n="MapGIS3D");let a={};switch(n){case"MapGIS2D":a=new Cesium.MapGISLabelLayer(e,r.scene,t,i);break;case"MapGIS3D":t.is3d=!0,a=new Cesium.MapGISLabelLayer(e,r.scene,t,i)}return a.type="label",a}function Oi(e,t,i){let r=e.clippingArea;if(r.type!==o.GeometryType.polygon&r.type!==o.GeometryType.extent&r.type!==o.GeometryType.circle)return;r.spatialReference.isGeographic||(r=o.Projection.project(r,new o.SpatialReference({wkid:4326})));let n={};switch(r.type){case o.GeometryType.polygon:n.outerRing=r.coordinates[0],n.holes=r.coordinates.splice(1,r.coordinates.length-1);break;case o.GeometryType.circle:n.outerRing=r.toPolygon().coordinates[0],n.holes=void 0;break;case o.GeometryType.extent:const{xmin:e,xmax:t,ymin:i,ymax:a}=r;n.outerRing=[[e,i],[t,i],[t,a],[e,a],[e,i]],n.holes=void 0;break;default:n=void 0}if(!n)return;t.swipeEnabled=!0;const a=[],s=n.outerRing;for(let e=0;e<s.length;e++)a.push(Cesium.Cartesian3.fromDegrees(s[e][0],s[e][1],0));let l=void 0;if(n.holes&&n.holes.length>0){l=[];for(let e=0;e<n.holes.length;e++){const t=[];for(let i=0;i<n.holes[e].length;i++)t.push(Cesium.Cartesian3.fromDegrees(n.holes[e][i][0],n.holes[e][i][1],0));l.push(new Cesium.PolygonHierarchy(t))}}const h=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(a,l)}),c=Cesium.PolygonGeometry.createGeometry(h),u=Cesium.GeometryPipeline.createAttributeLocations(c),p=Cesium.VertexArray.fromGeometry({context:i.scene.context,geometry:c,attributeLocations:u}),d=Cesium.ShaderProgram.fromCache({context:i.scene.context,vertexShaderSource:"\n attribute vec3 position;\n void main() {\n gl_Position = czm_viewProjection * vec4(position.xyz, 1.0);\n }\n ",fragmentShaderSource:"\n void main() {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n }\n ",attributeLocations:u}),f=Cesium.RenderState.fromCache({cull:{enabled:!0,face:Cesium.CullFace.BACK}}),y=new Cesium.DrawCommand({primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:p,shaderProgram:d,castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:f}),m=i.scene.context.drawingBufferWidth,g=i.scene.context.drawingBufferHeight,v=new Cesium.Framebuffer({context:i.scene.context,colorTextures:[new Cesium.Texture({context:i.scene.context,width:m,height:g,pixelDatatype:Cesium.PixelDatatype.UNSIGNED_BYTE,pixelFormat:Cesium.PixelFormat.RGB})],destroyAttachments:!1}),b=new Cesium.PassState(i.scene.context);b.framebuffer=v,i.scene._frameState.swipeTexture=b.framebuffer.getColorTexture(0),i.scene._frameState.swiper.type=Cesium.SwipeModeType.POLYGON,i._clipPreRenderFunction=function(){i.scene.context.uniformState.updateCamera(i.camera),new Cesium.ClearCommand({color:new Cesium.Color(0,0,0,1)}).execute(i.scene.context,b),y.execute(i.scene.context,b)},i.scene.preRender.removeEventListener(i._clipPreRenderFunction),i.scene.preRender.addEventListener(i._clipPreRenderFunction)}console.log("Zondy:",o.Zondy),console.log("GeometryType:",o.GeometryType),o.Zondy.Utils.getTilingSchemeBySpatialReference=xi,o.Zondy.Utils.getExtent=ki;class Pi{}Pi.addIGSMapImageLayer=function(e,t,i){const r=xi(e.spatialReference,e.extent),n=ki(e,r.rectangle);e._setLayers();let a=e._url;"1.0"===e._igsVersion&&(a=a.replace("/mrcs/","/mrms/"));const s={url:a,httpMethod:e.httpMethod,tileWidth:e.imageWidth,tileHeight:e.imageHeight,layers:e.layers,tilingScheme:r,guid:Object(o.getGUID)(),projectionSrs:`EPSG:${e.spatialReference.wkid}`,rectangle:Cesium.Rectangle.fromDegrees(n.xmin,n.ymin,n.xmax,n.ymax)},l=Object(o.getIGSDynamicLayer)(e);l.length>0&&(s.dynamicLayers=JSON.stringify(l));const h=Ci(e,t),c=t.imageryLayers.addImageryProvider(new Cesium.MapGISMapServerImageryProvider(s),h);return e.clippingArea&&Oi(e,c,t),c.id=e.id,c._realIndex=e._realIndex+1,c},Pi.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var ji=Pi;class Ai{}Ai.addIGSTileLayer=function(e,t){const i=xi(e.spatialReference,e.extent,e.tileInfo),r=ki(e,i.rectangle);let o=e.url;"1.0"===e._igsVersion&&(o=`${e.url}/{level}/{row}/{col}`);const n={url:o,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:i,rectangle:Cesium.Rectangle.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax)},a=Ci(e,t),s=t.imageryLayers.addImageryProvider(new Cesium.MapGISTileServerImageProvider(n),a);return e.clippingArea&&Oi(e,s,t),s.id=e.id,s._realIndex=e._realIndex+1,s},Ai.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Ri=Ai;class zi{}zi.getMouseEvent=function(e,t,i){let r=null;if(t._innerView.scene.globe.depthTestAgainstTerrain&&!t._innerView.scene.globe.translucency.enabled)r=t._innerView.scene.pickPosition(e.position);else{const i=t._innerView.camera.getPickRay(e.position);r=t._innerView.scene.globe.pick(i,t._innerView.scene)}if(!r)return;const n=Cesium.Cartographic.fromCartesian(r),a=Cesium.Math.toDegrees(n.longitude),s=Cesium.Math.toDegrees(n.latitude),l={mapPoint:new o.Point({coordinates:[a,s,n.height]}),x:e.position.x,y:e.position.y,type:i};return e.originalEvent&&(l.native=e.originalEvent,l.stopPropagation=e.originalEvent.stopPropagation,l.timeStamp=e.originalEvent.timeStamp,l.button=e.originalEvent.button,l.buttons=e.originalEvent.buttons),l},zi.getKeyEvent=function(e,t,i){const r={key:e.key,stopPropagation:e.stopPropagation,timeStamp:e.timeStamp,native:e,type:i};return"key-down"===i&&(r.repeat=e.repeat),r},zi.getViewChangeEvent=function(e,t,i){const r={event:e,target:t,type:i};return r.mapView=t,r.scale=t._scale,r.zoom=t._zoom,r.center=t.center,r.extent=t._extent,r},zi.getDragEvent=function(e,t,i,r,o){return{x:e.originalEvent.layerX,y:e.originalEvent.layerY,button:void 0!==o?o:e.originalEvent.button,buttons:e.originalEvent.buttons,cancelable:e.originalEvent.cancelable,origin:i,stopPropagation:e.originalEvent.stopPropagation,timeStamp:e.originalEvent.timeStamp,native:e.originalEvent,action:r,type:"drag"}},zi.getResizeEvent=function(e,t,i,r){return e};var Di=zi;class Fi{}Fi.addSceneLayer=function(e,t,i,r,o){const n=e.activeScene.sublayers;let a=0;const s=[];for(let r=0;r<n.length;r++)switch(n[r].type){case"3":let l=Si(n[r]);l.url=e.url,l=Object.assign(l,n[r].extendOptions),s.push(Ti(t,l)),a++;break;case"4":let h=`${e.url}/GetLabels`;h=`${h}?sceneIndex=0&layerIndex=${n[r].layerRenderIndex}&level=0&row=0&col=0&format=json&srsName=EPSG:4326`,a++;const c={labelLayer:n[r].labelLayer},u=Ei(h,n[r].extendOptions,c,t);i._layersMap.put(n[r].id,u),s.push(u);break;case"2":case"10":const p=Mi(n[r]);p.url=e.url,p.url.indexOf("/igs/rest/g3d/")>-1?(p.url=`${p.url}/GetDataStreams?sceneIndex=0&layerIndex=${n[r].layerRenderIndex}&Level=0&Row=0&Col=0`,Li(p,t,i,function(e){a++,s.push(e),p.autoReset&&Ii(e.boundingSphere,p,t)},o)):p.url.indexOf("/igs/rest/services/")>-1&&p.url.indexOf("/SceneServer")>-1&&Li(p,t,i,function(e){a++,s.push(e),p.autoReset&&Ii(e.boundingSphere,p,t)},o)}const l=setInterval(function(){a===n.length&&r&&r instanceof Function&&(clearInterval(l),r(s))},50)},Fi.removeLayer=function(e,t,i){for(let r=0;r<e.length;r++)switch(e[r].type){case"m3d":t._layersMap.remove(e[r].id),i.scene.primitives.removeAndDestroy(e[r]);break;case"terrain":i.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider;break;case"label":e[r].destroy(!0),t._layersMap.remove(e[r].id)}e=[]};var Ni=Fi;class Gi{}Gi.addCesium3DTilesLayer=function(e,t,i){const r=Object.assign({show:e.visible},e.extendOptions);r.loaded=function(t){t.id=e.id,i(t)},e.layerIndex=t.scene.layers.appendCesium3DTilesetLayer(e.url,r)},Gi.removeLayer=function(e,t){t.scene.layers.removeCesium3DTilesetLayerByID(e.layerIndex)};var Vi=Gi;class Bi{}Bi.addM3DLayer=function(e,t,i,r,o){const n=Mi(e);n.url=e.url,e.url.indexOf("/igs/rest/services/")>-1?n.igserver=!0:n.igserver=!1,Li(n,t,i,function(e){n.autoReset&&Ii(e.boundingSphere,n,t),r(e)},o)},Bi.removeLayer=function(e,t,i){i._layersMap.remove(e.id),t.scene.primitives.removeAndDestroy(e)};var qi=Bi,Ui=i(4);function Wi(e,t){let i;return e.some(function(e){if(e.id==t)return i=e.source,!0}),i}const Hi=/font-family: ?([^;]*);/,Yi=/("|')/g;let Ji;const $i={},Xi=i.n(Ui).a.getNames();function Zi(e){if(e in $i)return $i[e];const t=e.map(function(e){return mb2css(e,1).split(" 1px ")[1].replace(/"/g,"")})[0];if(!function(e){if(!Ji){Ji={};const e=document.styleSheets;for(let t=0,i=e.length;t<i;++t){const i=e[t];try{const e=i.rules||i.cssRules;if(e)for(let t=0,i=e.length;t<i;++t){const i=e[t];if(5==i.type){const e=i.cssText.match(Hi);Ji[e[1].replace(Yi,"")]=!0}}}catch(e){}}}return e in Ji}(t)&&-1!==Xi.indexOf(t)){const e="https://fonts.googleapis.com/css?family="+t.replace(/ /g,"+");if(!document.querySelector('link[href="'+e+'"]')){const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(t)}}return e}function Ki(){return function(){throw new Error("Unimplemented abstract method.")}()}var Qi=0;function er(e){return e.ol_uid||(e.ol_uid=String(++Qi))}var tr="5.3.3",ir=function(e){function t(t){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===tr?tr:"v"+tr.split("-")[0])+"/doc/errors/#"+t+" for details.";e.call(this,i),this.code=t,this.name="AssertionError",this.message=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error);function rr(e,t){if(!e)throw new ir(t)}var or={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};function nr(e,t,i){return Math.min(Math.max(e,t),i)}var ar="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};function sr(e,t,i,r,o,n){var a=o-i,s=n-r;if(0!==a||0!==s){var l=((e-i)*a+(t-r)*s)/(a*a+s*s);l>1?(i=o,r=n):l>0&&(i+=a*l,r+=s*l)}return lr(e,t,i,r)}function lr(e,t,i,r){var o=i-e,n=r-t;return o*o+n*n}function hr(e,t,i){return e+i*(t-e)}var cr=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ur=/^([a-z]*)$/i;function pr(e){return"string"==typeof e?e:yr(e)}var dr=function(){var e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){var o=0;for(var n in e)0==(3&o++)&&(delete e[n],--t)}r=function(e){var t,i,r,o,n;ur.exec(e)&&(e=function(e){var t=document.createElement("div");if(t.style.color=e,""!==t.style.color){document.body.appendChild(t);var i=getComputedStyle(t).color;return document.body.removeChild(t),i}return""}(e));if(cr.exec(e)){var a,s=e.length-1;a=s<=4?1:2;var l=4===s||8===s;t=parseInt(e.substr(1+0*a,a),16),i=parseInt(e.substr(1+1*a,a),16),r=parseInt(e.substr(1+2*a,a),16),o=l?parseInt(e.substr(1+3*a,a),16):255,1==a&&(t=(t<<4)+t,i=(i<<4)+i,r=(r<<4)+r,l&&(o=(o<<4)+o)),n=[t,i,r,o/255]}else 0==e.indexOf("rgba(")?fr(n=e.slice(5,-1).split(",").map(Number)):0==e.indexOf("rgb(")?((n=e.slice(4,-1).split(",").map(Number)).push(1),fr(n)):rr(!1,14);return n}(i),e[i]=r,++t}return r}}();function fr(e){return e[0]=nr(e[0]+.5|0,0,255),e[1]=nr(e[1]+.5|0,0,255),e[2]=nr(e[2]+.5|0,0,255),e[3]=nr(e[3],0,1),e}function yr(e){var t=e[0];t!=(0|t)&&(t=t+.5|0);var i=e[1];i!=(0|i)&&(i=i+.5|0);var r=e[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+t+","+i+","+r+","+(void 0===e[3]?1:e[3])+")"}function mr(e){return Array.isArray(e)?yr(e):e}function gr(e,t){var i=document.createElement("canvas");return e&&(i.width=e),t&&(i.height=t),i.getContext("2d")}var vr="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",br=(vr.indexOf("firefox"),-1!==vr.indexOf("safari")&&vr.indexOf("chrom"),-1!==vr.indexOf("webkit")&&vr.indexOf("edge"),vr.indexOf("macintosh"),window.devicePixelRatio,function(){var e=!1;try{e=!!document.createElement("canvas").getContext("2d").setLineDash}catch(e){}return e}()),_r=(navigator,window,window,navigator.msPointerEnabled,{IDLE:0,LOADING:1,LOADED:2,ERROR:3}),wr=function(){var e,t={};return function(i){if(e||(e=document.createElement("div").style),!(i in t)){e.font=i;var r=e.fontFamily;if(e.font="",!r)return null;t[i]=r.split(/,\s?/)}return t[i]}}(),xr="function"==typeof Object.assign?Object.assign:function(e,t){var i=arguments;if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),o=1,n=arguments.length;o<n;++o){var a=i[o];if(void 0!==a&&null!==a)for(var s in a)a.hasOwnProperty(s)&&(r[s]=a[s])}return r};function Cr(e){for(var t in e)delete e[t]}function kr(e){var t;for(t in e)return!1;return!t}var Mr=function(){this.disposed_=!1};Mr.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},Mr.prototype.disposeInternal=function(){};var Sr=Mr;function Tr(e,t,i,r){for(var o,n=0,a=e.length;n<a;++n)if((o=e[n]).listener===t&&o.bindTo===i)return r&&(o.deleteIndex=n),o}function Lr(e,t){var i=Ir(e);return i?i[t]:void 0}function Ir(e,t){var i=e.ol_lm;return!i&&t&&(i=e.ol_lm={}),i}function Er(e,t){var i=Lr(e,t);if(i){for(var r=0,o=i.length;r<o;++r)e.removeEventListener(t,i[r].boundListener),Cr(i[r]);i.length=0;var n=Ir(e);n&&(delete n[t],0===Object.keys(n).length&&function(e){delete e.ol_lm}(e))}}function Or(e,t,i,r,o){var n=Ir(e,!0),a=n[t];a||(a=n[t]=[]);var s=Tr(a,i,r,!1);return s?o||(s.callOnce=!1):(s={bindTo:r,callOnce:!!o,listener:i,target:e,type:t},e.addEventListener(t,function(e){var t=function(t){var i=e.listener,r=e.bindTo||e.target;return e.callOnce&&Ar(e),i.call(r,t)};return e.boundListener=t,t}(s)),a.push(s)),s}function Pr(e,t,i,r){return Or(e,t,i,r,!0)}function jr(e,t,i,r){var o=Lr(e,t);if(o){var n=Tr(o,i,r,!0);n&&Ar(n)}}function Ar(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=Lr(e.target,e.type);if(t){var i="deleteIndex"in e?e.deleteIndex:t.indexOf(e);-1!==i&&t.splice(i,1),0===t.length&&Er(e.target,e.type)}Cr(e)}}function Rr(){}var zr=function(e){this.propagationStopped,this.type=e,this.target=null};zr.prototype.preventDefault=function(){this.propagationStopped=!0},zr.prototype.stopPropagation=function(){this.propagationStopped=!0};var Dr=zr,Fr=function(e){function t(){e.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addEventListener=function(e,t){var i=this.listeners_[e];i||(i=this.listeners_[e]=[]),-1===i.indexOf(t)&&i.push(t)},t.prototype.dispatchEvent=function(e){var t="string"==typeof e?new Dr(e):e,i=t.type;t.target=this;var r,o=this.listeners_[i];if(o){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var n=0,a=o.length;n<a;++n)if(!1===o[n].call(this,t)||t.propagationStopped){r=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var s=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];s--;)this.removeEventListener(i,Rr);delete this.dispatching_[i]}return r}},t.prototype.disposeInternal=function(){!function(e){var t=Ir(e);if(t)for(var i in t)Er(e,i)}(this)},t.prototype.getListeners=function(e){return this.listeners_[e]},t.prototype.hasListener=function(e){return e?e in this.listeners_:Object.keys(this.listeners_).length>0},t.prototype.removeEventListener=function(e,t){var i=this.listeners_[e];if(i){var r=i.indexOf(t);e in this.pendingRemovals_?(i[r]=Rr,++this.pendingRemovals_[e]):(i.splice(r,1),0===i.length&&delete this.listeners_[e])}},t}(Sr),Nr="change",Gr="clear",Vr="error",Br="load",qr=function(e){function t(t){e.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Gr)},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e,t){for(var i=this.oldest_;i;)e.call(t,i.value_,i.key_,this),i=i.newer},t.prototype.get=function(e){var t=this.entries_[e];return rr(void 0!==t,15),t===this.newest_?t.value_:(t===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(t.newer.older=t.older,t.older.newer=t.newer),t.newer=null,t.older=this.newest_,this.newest_.newer=t,this.newest_=t,t.value_)},t.prototype.remove=function(e){var t=this.entries_[e];return rr(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t},t.prototype.getValues=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},t.prototype.set=function(e,t){rr(!(e in this.entries_),16);var i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t}(Fr);new Array(6);function Ur(e,t){var i=t[0],r=t[1];return t[0]=e[0]*i+e[2]*r+e[4],t[1]=e[1]*i+e[3]*r+e[5],t}function Wr(e,t,i,r,o,n,a,s){var l=Math.sin(n),h=Math.cos(n);return e[0]=r*h,e[1]=o*l,e[2]=-r*l,e[3]=o*h,e[4]=a*r*h-s*r*l+t,e[5]=a*o*l+s*o*h+i,e}var Hr=[0,0,0,1],Yr=[],Jr=[0,0,0,1],$r=[0,0,0,0],Xr=new qr,Zr={},Kr=null,Qr={},eo=function(){var e,t,i=60,r=Zr,o="32px ",n=["monospace","serif"],a=n.length,s="wmytzilWMYTZIL@#/&?$%10";function l(e){for(var i=to(),r=100;r<=700;r+=300){for(var l=r+" ",h=!0,c=0;c<a;++c){var u=n[c];if(i.font=l+o+u,t=i.measureText(s).width,e!=u){i.font=l+o+e+","+u;var p=i.measureText(s).width;h=h&&p!=t}}if(h)return!0}return!1}function h(){var t=!0;for(var o in r)r[o]<i&&(l(o)?(r[o]=i,Cr(Qr),Kr=null,Xr.clear()):(++r[o],t=!1));t&&(clearInterval(e),e=void 0)}return function(t){var o=wr(t);if(o)for(var n=0,a=o.length;n<a;++n){var s=o[n];s in r||(r[s]=i,l(s)||(r[s]=0,void 0===e&&(e=setInterval(h,32))))}}}();function to(){return Kr||(Kr=gr(1,1)),Kr}var io=function(){var e,t=Qr;return function(i){var r=t[i];return void 0==r&&(e||((e=document.createElement("span")).textContent="M",e.style.margin=e.style.padding="0 !important",e.style.position="absolute !important",e.style.left="-99999px !important"),e.style.font=i,document.body.appendChild(e),r=t[i]=e.offsetHeight,document.body.removeChild(e)),r}}();function ro(e,t){var i=to();return e!=i.font&&(i.font=e),i.measureText(t).width}var oo=[1,0,0,1,0,0];function no(e,t,i,r,o,n,a,s,l,h,c){var u;1!=i&&(u=e.globalAlpha,e.globalAlpha=u*i),t&&e.setTransform.apply(e,t),e.drawImage(r,o,n,a,s,l,h,a*c,s*c),u&&(e.globalAlpha=u),t&&e.setTransform.apply(e,oo)}var ao=function(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale};ao.prototype.clone=function(){return new ao({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},ao.prototype.getOpacity=function(){return this.opacity_},ao.prototype.getRotateWithView=function(){return this.rotateWithView_},ao.prototype.getRotation=function(){return this.rotation_},ao.prototype.getScale=function(){return this.scale_},ao.prototype.getSnapToPixel=function(){return!1},ao.prototype.getAnchor=function(){return Ki()},ao.prototype.getImage=function(e){return Ki()},ao.prototype.getHitDetectionImage=function(e){return Ki()},ao.prototype.getImageState=function(){return Ki()},ao.prototype.getImageSize=function(){return Ki()},ao.prototype.getHitDetectionImageSize=function(){return Ki()},ao.prototype.getOrigin=function(){return Ki()},ao.prototype.getSize=function(){return Ki()},ao.prototype.setOpacity=function(e){this.opacity_=e},ao.prototype.setRotateWithView=function(e){this.rotateWithView_=e},ao.prototype.setRotation=function(e){this.rotation_=e},ao.prototype.setScale=function(e){this.scale_=e},ao.prototype.setSnapToPixel=function(e){},ao.prototype.listenImageChange=function(e,t){return Ki()},ao.prototype.load=function(){Ki()},ao.prototype.unlistenImageChange=function(e,t){Ki()};var so=ao,lo=function(e){function t(t){var i=t||{};e.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,atlasManager:i.atlasManager})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.setRadius=function(e){this.radius_=e,this.render_(this.atlasManager_)},t}(function(e){function t(t){var i=void 0!==t.rotateWithView&&t.rotateWithView;e.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==t.rotation?t.rotation:0,scale:1}),this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.getAnchor=function(){return this.anchor_},t.prototype.getAngle=function(){return this.angle_},t.prototype.getFill=function(){return this.fill_},t.prototype.getHitDetectionImage=function(e){return this.hitDetectionCanvas_},t.prototype.getImage=function(e){return this.canvas_},t.prototype.getImageSize=function(){return this.imageSize_},t.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},t.prototype.getImageState=function(){return _r.LOADED},t.prototype.getOrigin=function(){return this.origin_},t.prototype.getPoints=function(){return this.points_},t.prototype.getRadius=function(){return this.radius_},t.prototype.getRadius2=function(){return this.radius2_},t.prototype.getSize=function(){return this.size_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.listenImageChange=function(e,t){},t.prototype.load=function(){},t.prototype.unlistenImageChange=function(e,t){},t.prototype.render_=function(e){var t,i,r="",o="",n=0,a=null,s=0,l=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=Jr),i=mr(i),void 0===(l=this.stroke_.getWidth())&&(l=1),a=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),br||(a=null,s=0),void 0===(o=this.stroke_.getLineJoin())&&(o="round"),void 0===(r=this.stroke_.getLineCap())&&(r="round"),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var h=2*(this.radius_+l)+1,c={strokeStyle:i,strokeWidth:l,size:h,lineCap:r,lineDash:a,lineDashOffset:s,lineJoin:o,miterLimit:n};if(void 0===e){var u=gr(h,h);this.canvas_=u.canvas,t=h=this.canvas_.width,this.draw_(c,u,0,0),this.createHitDetectionCanvas_(c)}else{h=Math.round(h);var p,d=!this.fill_;d&&(p=this.drawHitDetectionCanvas_.bind(this,c));var f=this.getChecksum(),y=e.add(f,h,h,this.draw_.bind(this,c),p);this.canvas_=y.image,this.origin_=[y.offsetX,y.offsetY],t=y.image.width,d?(this.hitDetectionCanvas_=y.hitImage,this.hitDetectionImageSize_=[y.hitImage.width,y.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[t,t])}this.anchor_=[h/2,h/2],this.size_=[h,h],this.imageSize_=[t,t]},t.prototype.draw_=function(e,t,i,r){var o,n,a;t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var s=this.points_;if(s===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(s*=2),o=0;o<=s;o++)n=2*o*Math.PI/s-Math.PI/2+this.angle_,a=o%2==0?this.radius_:l,t.lineTo(e.size/2+a*Math.cos(n),e.size/2+a*Math.sin(n))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=Hr),t.fillStyle=mr(h),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke()),t.closePath()},t.prototype.createHitDetectionCanvas_=function(e){if(this.hitDetectionImageSize_=[e.size,e.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var t=gr(e.size,e.size);this.hitDetectionCanvas_=t.canvas,this.drawHitDetectionCanvas_(e,t,0,0)}},t.prototype.drawHitDetectionCanvas_=function(e,t,i,r){t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var o=this.points_;if(o===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var n,a,s,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(o*=2),n=0;n<=o;n++)s=2*n*Math.PI/o-Math.PI/2+this.angle_,a=n%2==0?this.radius_:l,t.lineTo(e.size/2+a*Math.cos(s),e.size/2+a*Math.sin(s))}t.fillStyle=pr(Hr),t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.stroke()),t.closePath()},t.prototype.getChecksum=function(){var e=this.stroke_?this.stroke_.getChecksum():"-",t=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||e!=this.checksums_[1]||t!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+e+t+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,e,t,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},t}(so)),ho=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.checksum_=void 0};ho.prototype.clone=function(){var e=this.getColor();return new ho({color:Array.isArray(e)?e.slice():e||void 0})},ho.prototype.getColor=function(){return this.color_},ho.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},ho.prototype.getChecksum=function(){if(void 0===this.checksum_){var e=this.color_;e?Array.isArray(e)||"string"==typeof e?this.checksum_="f"+pr(e):this.checksum_=er(this.color_):this.checksum_="f-"}return this.checksum_};var co=ho,uo=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width,this.checksum_=void 0};uo.prototype.clone=function(){var e=this.getColor();return new uo({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},uo.prototype.getColor=function(){return this.color_},uo.prototype.getLineCap=function(){return this.lineCap_},uo.prototype.getLineDash=function(){return this.lineDash_},uo.prototype.getLineDashOffset=function(){return this.lineDashOffset_},uo.prototype.getLineJoin=function(){return this.lineJoin_},uo.prototype.getMiterLimit=function(){return this.miterLimit_},uo.prototype.getWidth=function(){return this.width_},uo.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},uo.prototype.setLineCap=function(e){this.lineCap_=e,this.checksum_=void 0},uo.prototype.setLineDash=function(e){this.lineDash_=e,this.checksum_=void 0},uo.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e,this.checksum_=void 0},uo.prototype.setLineJoin=function(e){this.lineJoin_=e,this.checksum_=void 0},uo.prototype.setMiterLimit=function(e){this.miterLimit_=e,this.checksum_=void 0},uo.prototype.setWidth=function(e){this.width_=e,this.checksum_=void 0},uo.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=er(this.color_):this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var po=uo,fo=function(e){var t=e||{};this.geometry_=null,this.geometryFunction_=yo,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex};fo.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new fo({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},fo.prototype.getRenderer=function(){return this.renderer_},fo.prototype.setRenderer=function(e){this.renderer_=e},fo.prototype.getGeometry=function(){return this.geometry_},fo.prototype.getGeometryFunction=function(){return this.geometryFunction_},fo.prototype.getFill=function(){return this.fill_},fo.prototype.setFill=function(e){this.fill_=e},fo.prototype.getImage=function(){return this.image_},fo.prototype.setImage=function(e){this.image_=e},fo.prototype.getStroke=function(){return this.stroke_},fo.prototype.setStroke=function(e){this.stroke_=e},fo.prototype.getText=function(){return this.text_},fo.prototype.setText=function(e){this.text_=e},fo.prototype.getZIndex=function(){return this.zIndex_},fo.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=yo,this.geometry_=e},fo.prototype.setZIndex=function(e){this.zIndex_=e};function yo(e){return e.getGeometry()}var mo=fo,go={FRACTION:"fraction",PIXELS:"pixels"},vo=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function bo(e,t,i){return t+":"+e+":"+(i?pr(i):"null")}vo.prototype.clear=function(){this.cache_={},this.cacheSize_=0},vo.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var e=0;for(var t in this.cache_){var i=this.cache_[t];0!=(3&e++)||i.hasListener()||(delete this.cache_[t],--this.cacheSize_)}}},vo.prototype.get=function(e,t,i){var r=bo(e,t,i);return r in this.cache_?this.cache_[r]:null},vo.prototype.set=function(e,t,i,r){var o=bo(e,t,i);this.cache_[o]=r,++this.cacheSize_},vo.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()};var _o=new vo,wo=function(e){function t(t,i,r,o,n,a){e.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==o&&(this.image_.crossOrigin=o),this.canvas_=a?document.createElement("canvas"):null,this.color_=a,this.imageListenerKeys_=null,this.imageState_=n,this.size_=r,this.src_=i,this.tainted_}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===_r.LOADED){this.tainted_=!1;var e=gr(1,1);try{e.drawImage(this.image_,0,0),e.getImageData(0,0,1,1)}catch(e){this.tainted_=!0}}return!0===this.tainted_},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Nr)},t.prototype.handleImageError_=function(){this.imageState_=_r.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=_r.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.replaceColor_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(e){return this.canvas_?this.canvas_:this.image_},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(e){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],i=this.size_[1],r=gr(t,i);r.fillRect(0,0,t,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==_r.IDLE){this.imageState_=_r.LOADING,this.imageListenerKeys_=[Pr(this.image_,Vr,this.handleImageError_,this),Pr(this.image_,Br,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(e){this.handleImageError_()}}},t.prototype.replaceColor_=function(){if(this.color_&&!this.isTainted_()){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var e=this.canvas_.getContext("2d");e.drawImage(this.image_,0,0);for(var t=e.getImageData(0,0,this.image_.width,this.image_.height),i=t.data,r=this.color_[0]/255,o=this.color_[1]/255,n=this.color_[2]/255,a=0,s=i.length;a<s;a+=4)i[a]*=r,i[a+1]*=o,i[a+2]*=n;e.putImageData(t,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ar),this.imageListenerKeys_=null},t}(Fr);var xo={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Co=function(e){function t(t){var i=t||{},r=void 0!==i.opacity?i.opacity:1,o=void 0!==i.rotation?i.rotation:0,n=void 0!==i.scale?i.scale:1,a=void 0!==i.rotateWithView&&i.rotateWithView;e.call(this,{opacity:r,rotation:o,scale:n,rotateWithView:a}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:xo.TOP_LEFT,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:go.FRACTION,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:go.FRACTION,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,l=void 0!==i.imgSize?i.imgSize:null,h=i.src;rr(!(void 0!==h&&s),4),rr(!s||s&&l,5),void 0!==h&&0!==h.length||!s||(h=s.src||er(s)),rr(void 0!==h&&h.length>0,6);var c=void 0!==i.src?_r.IDLE:_r.LOADED;this.color_=void 0!==i.color?function(e){return Array.isArray(e)?e:dr(e)}(i.color):null,this.iconImage_=function(e,t,i,r,o,n){var a=_o.get(t,r,n);return a||(a=new wo(e,t,i,r,o,n),_o.set(t,r,n,a)),a}(s,h,l,this.crossOrigin_,c,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:xo.TOP_LEFT,this.origin_=null,this.size_=void 0!==i.size?i.size:null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var e=this.anchor_,t=this.getSize();if(this.anchorXUnits_==go.FRACTION||this.anchorYUnits_==go.FRACTION){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==go.FRACTION&&(e[0]*=t[0]),this.anchorYUnits_==go.FRACTION&&(e[1]*=t[1])}if(this.anchorOrigin_!=xo.TOP_LEFT){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),this.anchorOrigin_!=xo.TOP_RIGHT&&this.anchorOrigin_!=xo.BOTTOM_RIGHT||(e[0]=-e[0]+t[0]),this.anchorOrigin_!=xo.BOTTOM_LEFT&&this.anchorOrigin_!=xo.BOTTOM_RIGHT||(e[1]=-e[1]+t[1])}return this.normalizedAnchor_=e,this.normalizedAnchor_},t.prototype.setAnchor=function(e){this.anchor_=e,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(e){return this.iconImage_.getImage(e)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(e){return this.iconImage_.getHitDetectionImage(e)},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var e=this.offset_;if(this.offsetOrigin_!=xo.TOP_LEFT){var t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),this.offsetOrigin_!=xo.TOP_RIGHT&&this.offsetOrigin_!=xo.BOTTOM_RIGHT||(e[0]=i[0]-t[0]-e[0]),this.offsetOrigin_!=xo.BOTTOM_LEFT&&this.offsetOrigin_!=xo.BOTTOM_RIGHT||(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(e,t){return Or(this.iconImage_,Nr,e,t)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(e,t){jr(this.iconImage_,Nr,e,t)},t}(so),ko="point",Mo="line",So=function(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new co({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:ko,this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding};So.prototype.clone=function(){return new So({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0})},So.prototype.getOverflow=function(){return this.overflow_},So.prototype.getFont=function(){return this.font_},So.prototype.getMaxAngle=function(){return this.maxAngle_},So.prototype.getPlacement=function(){return this.placement_},So.prototype.getOffsetX=function(){return this.offsetX_},So.prototype.getOffsetY=function(){return this.offsetY_},So.prototype.getFill=function(){return this.fill_},So.prototype.getRotateWithView=function(){return this.rotateWithView_},So.prototype.getRotation=function(){return this.rotation_},So.prototype.getScale=function(){return this.scale_},So.prototype.getStroke=function(){return this.stroke_},So.prototype.getText=function(){return this.text_},So.prototype.getTextAlign=function(){return this.textAlign_},So.prototype.getTextBaseline=function(){return this.textBaseline_},So.prototype.getBackgroundFill=function(){return this.backgroundFill_},So.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},So.prototype.getPadding=function(){return this.padding_},So.prototype.setOverflow=function(e){this.overflow_=e},So.prototype.setFont=function(e){this.font_=e},So.prototype.setMaxAngle=function(e){this.maxAngle_=e},So.prototype.setOffsetX=function(e){this.offsetX_=e},So.prototype.setOffsetY=function(e){this.offsetY_=e},So.prototype.setPlacement=function(e){this.placement_=e},So.prototype.setFill=function(e){this.fill_=e},So.prototype.setRotation=function(e){this.rotation_=e},So.prototype.setScale=function(e){this.scale_=e},So.prototype.setStroke=function(e){this.stroke_=e},So.prototype.setText=function(e){this.text_=e},So.prototype.setTextAlign=function(e){this.textAlign_=e},So.prototype.setTextBaseline=function(e){this.textBaseline_=e},So.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},So.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},So.prototype.setPadding=function(e){this.padding_=e};var To=So,Lo={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Io(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function Eo(e,t,i){var r,o;return(r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*r+(o=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*o}function Oo(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function Po(e,t){var i=e[0],r=e[1],o=e[2],n=e[3],a=t[0],s=t[1],l=Lo.UNKNOWN;return a<i?l|=Lo.LEFT:a>o&&(l|=Lo.RIGHT),s<r?l|=Lo.BELOW:s>n&&(l|=Lo.ABOVE),l===Lo.UNKNOWN&&(l=Lo.INTERSECTING),l}function jo(e,t,i,r,o){return o?(o[0]=e,o[1]=t,o[2]=i,o[3]=r,o):[e,t,i,r]}function Ao(e){return jo(1/0,1/0,-1/0,-1/0,e)}function Ro(e,t){var i=e[0],r=e[1];return jo(i,r,i,r,t)}function zo(e,t,i,r,o){return Fo(Ao(o),e,t,i,r)}function Do(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function Fo(e,t,i,r,o){for(;i<r;i+=o)No(e,t[i],t[i+1]);return e}function No(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function Go(e){return[e[0],e[1]]}function Vo(e){return[e[2],e[1]]}function Bo(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function qo(e){return e[3]-e[1]}function Uo(e){return[e[0],e[3]]}function Wo(e){return[e[2],e[3]]}function Ho(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Yo(e,t,i){var r=[e[0],e[1],e[0],e[3],e[2],e[1],e[2],e[3]];return t(r,r,2),function(e,t,i){return jo(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),i)}([r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]],i)}var Jo="propertychange";var $o=function(e){function t(){e.call(this),this.revision_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.changed=function(){++this.revision_,this.dispatchEvent(Nr)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),o=0;o<i;++o)r[o]=Or(this,e[o],t);return r}return Or(this,e,t)},t.prototype.once=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),o=0;o<i;++o)r[o]=Pr(this,e[o],t);return r}return Pr(this,e,t)},t.prototype.un=function(e,t){if(Array.isArray(e))for(var i=0,r=e.length;i<r;++i)jr(this,e[i],t);else jr(this,e,t)},t}(Fr),Xo=function(e){function t(t,i,r){e.call(this,t),this.key=i,this.oldValue=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Dr),Zo=function(e){function t(t){e.call(this),er(this),this.values_={},void 0!==t&&this.setProperties(t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return xr({},this.values_)},t.prototype.notify=function(e,t){var i;i=function(e){return Ko.hasOwnProperty(e)?Ko[e]:Ko[e]="change:"+e}(e),this.dispatchEvent(new Xo(i,e,t)),i=Jo,this.dispatchEvent(new Xo(i,e,t))},t.prototype.set=function(e,t,i){if(i)this.values_[e]=t;else{var r=this.values_[e];this.values_[e]=t,r!==t&&this.notify(e,r)}},t.prototype.setProperties=function(e,t){for(var i in e)this.set(i,e[i],t)},t.prototype.unset=function(e,t){if(e in this.values_){var i=this.values_[e];delete this.values_[e],t||this.notify(e,i)}},t}($o),Ko={};var Qo=Zo;function en(e,t,i,r,o,n){for(var a=n||[],s=0,l=t;l<i;l+=r){var h=e[l],c=e[l+1];a[s++]=o[0]*h+o[2]*c+o[4],a[s++]=o[1]*h+o[3]*c+o[5]}return n&&a.length!=s&&(a.length=s),a}var tn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},rn={};rn[tn.DEGREES]=2*Math.PI*6370997/360,rn[tn.FEET]=.3048,rn[tn.METERS]=1,rn[tn.USFEET]=1200/3937;var on=tn,nn=function(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit};nn.prototype.canWrapX=function(){return this.canWrapX_},nn.prototype.getCode=function(){return this.code_},nn.prototype.getExtent=function(){return this.extent_},nn.prototype.getUnits=function(){return this.units_},nn.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||rn[this.units_]},nn.prototype.getWorldExtent=function(){return this.worldExtent_},nn.prototype.getAxisOrientation=function(){return this.axisOrientation_},nn.prototype.isGlobal=function(){return this.global_},nn.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},nn.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},nn.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},nn.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},nn.prototype.setWorldExtent=function(e){this.worldExtent_=e},nn.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},nn.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var an=nn,sn=6378137,ln=Math.PI*sn,hn=[-ln,-ln,ln,ln],cn=[-180,-85,180,85],un=function(e){function t(t){e.call(this,{code:t,units:on.METERS,extent:hn,global:!0,worldExtent:cn,getPointResolution:function(e,t){return e/ar(t[1]/sn)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(an),pn=[new un("EPSG:3857"),new un("EPSG:102100"),new un("EPSG:102113"),new un("EPSG:900913"),new un("urn:ogc:def:crs:EPSG:6.18:3:3857"),new un("urn:ogc:def:crs:EPSG::3857"),new un("http://www.opengis.net/gml/srs/epsg.xml#3857")];function dn(e,t,i){var r=e.length,o=i>1?i:2,n=t;void 0===n&&(n=o>2?e.slice():new Array(r));for(var a=ln,s=0;s<r;s+=o){n[s]=a*e[s]/180;var l=sn*Math.log(Math.tan(Math.PI*(e[s+1]+90)/360));l>a?l=a:l<-a&&(l=-a),n[s+1]=l}return n}function fn(e,t,i){var r=e.length,o=i>1?i:2,n=t;void 0===n&&(n=o>2?e.slice():new Array(r));for(var a=0;a<r;a+=o)n[a]=180*e[a]/ln,n[a+1]=360*Math.atan(Math.exp(e[a+1]/sn))/Math.PI-90;return n}var yn=[-180,-90,180,90],mn=6378137*Math.PI/180,gn=function(e){function t(t,i){e.call(this,{code:t,units:on.DEGREES,extent:yn,axisOrientation:i,global:!0,metersPerUnit:mn,worldExtent:yn})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(an),vn=[new gn("CRS:84"),new gn("EPSG:4326","neu"),new gn("urn:ogc:def:crs:EPSG::4326","neu"),new gn("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new gn("urn:ogc:def:crs:OGC:1.3:CRS84"),new gn("urn:ogc:def:crs:OGC:2:84"),new gn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new gn("urn:x-ogc:def:crs:EPSG:4326","neu")],bn={};var _n={};function wn(e,t,i){var r=e.getCode(),o=t.getCode();r in _n||(_n[r]={}),_n[r][o]=i}function xn(e,t,i){var r;if(void 0!==t){for(var o=0,n=e.length;o<n;++o)t[o]=e[o];r=t}else r=e.slice();return r}function Cn(e,t,i){if(void 0!==t&&e!==t){for(var r=0,o=e.length;r<o;++r)t[r]=e[r];e=t}return e}function kn(e){!function(e,t){bn[e]=t}(e.getCode(),e),wn(e,e,xn)}function Mn(e){return"string"==typeof e?function(e){return bn[e]||null}(e):e||null}function Sn(e){!function(e){e.forEach(kn)}(e),e.forEach(function(t){e.forEach(function(e){t!==e&&wn(t,e,xn)})})}function Tn(e,t){var i=function(e,t){var i;return e in _n&&t in _n[e]&&(i=_n[e][t]),i}(e.getCode(),t.getCode());return i||(i=Cn),i}function Ln(e,t){return Tn(Mn(e),Mn(t))}Sn(pn),Sn(vn),function(e,t,i,r){e.forEach(function(e){t.forEach(function(t){wn(e,t,i),wn(t,e,r)})})}(vn,pn,dn,fn);var In=[1,0,0,1,0,0],En={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function On(e){var t;return e==En.XY?t=2:e==En.XYZ||e==En.XYM?t=3:e==En.XYZM&&(t=4),t}var Pn=function(e){function t(){e.call(this),this.layout=En.XY,this.stride=2,this.flatCoordinates=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeExtent=function(e){return zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Ki()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!=this.getRevision()&&(Cr(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var t=e.toString();if(this.simplifiedGeometryCache.hasOwnProperty(t))return this.simplifiedGeometryCache[t];var i=this.getSimplifiedGeometryInternal(e);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[t]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)},t.prototype.getSimplifiedGeometryInternal=function(e){return this},t.prototype.getStride=function(){return this.stride},t.prototype.setFlatCoordinates=function(e,t){this.stride=On(e),this.layout=e,this.flatCoordinates=t},t.prototype.setCoordinates=function(e,t){Ki()},t.prototype.setLayout=function(e,t,i){var r;if(e)r=On(e);else{for(var o=0;o<i;++o){if(0===t.length)return this.layout=En.XY,void(this.stride=2);t=t[0]}e=function(e){var t;2==e?t=En.XY:3==e?t=En.XYZ:4==e&&(t=En.XYZM);return t}(r=t.length)}this.layout=e,this.stride=r},t.prototype.applyTransform=function(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t.prototype.rotate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,o,n,a){for(var s=a||[],l=Math.cos(o),h=Math.sin(o),c=n[0],u=n[1],p=0,d=t;d<i;d+=r){var f=e[d]-c,y=e[d+1]-u;s[p++]=c+f*l-y*h,s[p++]=u+f*h+y*l;for(var m=d+2;m<d+r;++m)s[p++]=e[m]}a&&s.length!=p&&(s.length=p)}(i,0,i.length,r,e,t,i),this.changed()}},t.prototype.scale=function(e,t,i){var r=t;void 0===r&&(r=e);var o=i;o||(o=Bo(this.getExtent()));var n=this.getFlatCoordinates();if(n){var a=this.getStride();!function(e,t,i,r,o,n,a,s){for(var l=s||[],h=a[0],c=a[1],u=0,p=t;p<i;p+=r){var d=e[p]-h,f=e[p+1]-c;l[u++]=h+o*d,l[u++]=c+n*f;for(var y=p+2;y<p+r;++y)l[u++]=e[y]}s&&l.length!=u&&(l.length=u)}(n,0,n.length,a,e,r,o,n),this.changed()}},t.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,o,n,a){for(var s=a||[],l=0,h=t;h<i;h+=r){s[l++]=e[h]+o,s[l++]=e[h+1]+n;for(var c=h+2;c<h+r;++c)s[l++]=e[c]}a&&s.length!=l&&(s.length=l)}
12
+ t.read=function(e,t,i,r,o){var n,a,s=8*o-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?o-1:0,p=i?-1:1,d=e[t+u];for(u+=p,n=d&(1<<-c)-1,d>>=-c,c+=s;c>0;n=256*n+e[t+u],u+=p,c-=8);for(a=n&(1<<-c)-1,n>>=-c,c+=r;c>0;a=256*a+e[t+u],u+=p,c-=8);if(0===n)n=1-h;else{if(n===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),n-=h}return(d?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,o,n){var a,s,l,h=8*n-o-1,c=(1<<h)-1,u=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:n-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?p/l:p*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,o),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;e[i+d]=255&s,d+=f,s/=256,o-=8);for(a=a<<o|s,h+=o;h>0;e[i+d]=255&a,d+=f,a/=256,h-=8);e[i+d-f]|=128*y}},function(e,t,i){"use strict";i.r(t);var r={};i.r(r),i.d(r,"createBillboard",function(){return eh}),i.d(r,"createLabel",function(){return th}),i.d(r,"createModelPrimitive",function(){return ih}),i.d(r,"createObject3DAppearance",function(){return rh}),i.d(r,"createSpherePrimitive",function(){return oh}),i.d(r,"createCylinderPrimitive",function(){return nh}),i.d(r,"getShadows",function(){return ah});var o=i(0),n=1,a=2,s=3,l=4,h=5,c=484813681109536e-20,u=Math.PI/2,p=.16666666666666666,d=.04722222222222222,f=.022156084656084655,y=1e-10,m=.017453292519943295,g=57.29577951308232,v=Math.PI/4,b=2*Math.PI,_=3.14159265359,w={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},x={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},C=/[\s_\-\/\(\)]/g;function k(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),o=t.toLowerCase().replace(C,""),n=-1;++n<r.length;)if((i=r[n]).toLowerCase().replace(C,"")===o)return e[i]}var M=function(e){var t,i,r,o={},n=e.split("+").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var i=t.split("=");return i.push(!0),e[i[0].toLowerCase()]=i[1],e},{}),a={proj:"projName",datum:"datumCode",rf:function(e){o.rf=parseFloat(e)},lat_0:function(e){o.lat0=e*m},lat_1:function(e){o.lat1=e*m},lat_2:function(e){o.lat2=e*m},lat_ts:function(e){o.lat_ts=e*m},lon_0:function(e){o.long0=e*m},lon_1:function(e){o.long1=e*m},lon_2:function(e){o.long2=e*m},alpha:function(e){o.alpha=parseFloat(e)*m},gamma:function(e){o.rectified_grid_angle=parseFloat(e)},lonc:function(e){o.longc=e*m},x_0:function(e){o.x0=parseFloat(e)},y_0:function(e){o.y0=parseFloat(e)},k_0:function(e){o.k0=parseFloat(e)},k:function(e){o.k0=parseFloat(e)},a:function(e){o.a=parseFloat(e)},b:function(e){o.b=parseFloat(e)},r_a:function(){o.R_A=!0},zone:function(e){o.zone=parseInt(e,10)},south:function(){o.utmSouth=!0},towgs84:function(e){o.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){o.to_meter=parseFloat(e)},units:function(e){o.units=e;var t=k(x,e);t&&(o.to_meter=t.to_meter)},from_greenwich:function(e){o.from_greenwich=e*m},pm:function(e){var t=k(w,e);o.from_greenwich=(t||parseFloat(e))*m},nadgrids:function(e){"@null"===e?o.datumCode="none":o.nadgrids=e},axis:function(e){3===e.length&&-1!=="ewnsud".indexOf(e.substr(0,1))&&-1!=="ewnsud".indexOf(e.substr(1,1))&&-1!=="ewnsud".indexOf(e.substr(2,1))&&(o.axis=e)},approx:function(){o.approx=!0}};for(t in n)i=n[t],t in a?"function"==typeof(r=a[t])?r(i):o[r]=i:o[t]=i;return"string"==typeof o.datumCode&&"WGS84"!==o.datumCode&&(o.datumCode=o.datumCode.toLowerCase()),o},S=function(e){return new A(e).output()},T=1,I=/\s/,E=/[A-Za-z]/,O=/[A-Za-z84_]/,P=/[,\]]/,j=/[\d\.E\-\+]/;function A(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=T}function R(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,o=i.reduce(function(e,t){return z(t,e),e},r);t&&(e[t]=o)}function z(e,t){if(Array.isArray(e)){var i=e.shift();if("PARAMETER"===i&&(i=e.shift()),1===e.length)return Array.isArray(e[0])?(t[i]={},void z(e[0],t[i])):void(t[i]=e[0]);if(e.length)if("TOWGS84"!==i){if("AXIS"===i)return i in t||(t[i]=[]),void t[i].push(e);var r;switch(Array.isArray(i)||(t[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[i]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&z(e[2],t[i]));case"SPHEROID":case"ELLIPSOID":return t[i]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&z(e[3],t[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void R(t,i,e);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return z(e,t[i]);return R(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}A.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;I.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case T:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},A.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(P.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},A.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=T)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=T,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},A.prototype.number=function(e){if(!j.test(e)){if(P.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},A.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},A.prototype.keyword=function(e){if(O.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=T)}if(!P.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},A.prototype.neutral=function(e){if(E.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(j.test(e))return this.word=e,void(this.state=3);if(!P.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},A.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var D=.017453292519943295;function F(e){return e*D}var N=function(e){var t=S(e),i=t.shift(),r=t.shift();t.unshift(["name",r]),t.unshift(["type",i]);var o={};return z(t,o),function(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",i=0,r=e.AXIS.length;i<r;++i){var o=[e.AXIS[i][0].toLowerCase(),e.AXIS[i][1].toLowerCase()];-1!==o[0].indexOf("north")||("y"===o[0]||"lat"===o[0])&&"north"===o[1]?t+="n":-1!==o[0].indexOf("south")||("y"===o[0]||"lat"===o[0])&&"south"===o[1]?t+="s":-1!==o[0].indexOf("east")||("x"===o[0]||"lon"===o[0])&&"east"===o[1]?t+="e":-1===o[0].indexOf("west")&&("x"!==o[0]&&"lon"!==o[0]||"west"!==o[1])||(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var n=e.GEOGCS;function a(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(n=e),n&&(n.DATUM?e.datumCode=n.DATUM.name.toLowerCase():e.datumCode=n.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),n.DATUM&&n.DATUM.SPHEROID&&(e.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=n.DATUM.SPHEROID.a,e.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(e.datum_params=n.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",F],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",F],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",F],["lat0","latitude_of_origin",F],["lat0","standard_parallel_1",F],["lat1","standard_parallel_1",F],["lat2","standard_parallel_2",F],["azimuth","Azimuth"],["alpha","azimuth",F],["srsCode","name"]].forEach(function(t){return function(e,t){var i=t[0],r=t[1];!(i in e)&&r in e&&(e[i]=e[r],3===t.length&&(e[i]=t[2](e[i])))}(e,t)}),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName?!e.lat_ts&&e.lat0&&"Polar_Stereographic"===e.projName&&(e.lat_ts=e.lat0,e.lat0=F(e.lat0>0?90:-90)):(e.lat0=F(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(o),o};function G(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?G[e]=M(arguments[1]):G[e]=N(arguments[1]):G[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?G.apply(t,e):G(e)});if("string"==typeof e){if(e in G)return G[e]}else"EPSG"in e?G["EPSG:"+e.EPSG]=e:"ESRI"in e?G["ESRI:"+e.ESRI]=e:"IAU2000"in e?G["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(G);var V=G;var B=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var q=["3857","900913","3785","102113"];var U=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in V}(e))return V[e];if(function(e){return B.some(function(t){return e.indexOf(t)>-1})}(e)){var t=N(e);if(function(e){var t=k(e,"authority");if(t){var i=k(t,"epsg");return i&&q.indexOf(i)>-1}}(t))return V["EPSG:3857"];var i=function(e){var t=k(e,"extension");if(t)return k(t,"proj4")}(t);return i?M(i):t}return function(e){return"+"===e[0]}(e)?M(e):void 0},W=function(e,t){var i,r;if(e=e||{},!t)return e;for(r in t)void 0!==(i=t[r])&&(e[r]=i);return e},H=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},Y=function(e){return e<0?-1:1},J=function(e){return Math.abs(e)<=_?e:e-Y(e)*b},$=function(e,t,i){var r=e*i,o=.5*e;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(u-t))/r},X=function(e,t){for(var i,r,o=.5*e,n=u-2*Math.atan(t),a=0;a<=15;a++)if(i=e*Math.sin(n),n+=r=u-2*Math.atan(t*Math.pow((1-i)/(1+i),o))-n,Math.abs(r)<=1e-10)return n;return-9999};function Z(e){return e}var K=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,i,r=e.x,o=e.y;if(o*g>90&&o*g<-90&&r*g>180&&r*g<-180)return null;if(Math.abs(Math.abs(o)-u)<=y)return null;if(this.sphere)t=this.x0+this.a*this.k0*J(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*o));else{var n=Math.sin(o),a=$(this.e,o,n);t=this.x0+this.a*this.k0*J(r-this.long0),i=this.y0-this.a*this.k0*Math.log(a)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,o=e.y-this.y0;if(this.sphere)i=u-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var n=Math.exp(-o/(this.a*this.k0));if(-9999===(i=X(this.e,n)))return null}return t=J(this.long0+r/(this.a*this.k0)),e.x=t,e.y=i,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Z,inverse:Z,names:["longlat","identity"]}],Q={},ee=[];function te(e,t){var i=ee.length;return e.names?(ee[i]=e,e.names.forEach(function(e){Q[e.toLowerCase()]=i}),this):(console.log(t),!0)}var ie={start:function(){K.forEach(te)},add:te,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==Q[t]&&ee[Q[t]]?ee[Q[t]]:void 0}},re={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},oe=re.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};re.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ne={};ne.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ne.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ne.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ne.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ne.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ne.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ne.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ne.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ne.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ne.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ne.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ne.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ne.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ne.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ne.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ne.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ne.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var ae=function(e,t,i,r,o,u,p){var d={};return d.datum_type=void 0===e||"none"===e?h:l,t&&(d.datum_params=t.map(parseFloat),0===d.datum_params[0]&&0===d.datum_params[1]&&0===d.datum_params[2]||(d.datum_type=n),d.datum_params.length>3&&(0===d.datum_params[3]&&0===d.datum_params[4]&&0===d.datum_params[5]&&0===d.datum_params[6]||(d.datum_type=a,d.datum_params[3]*=c,d.datum_params[4]*=c,d.datum_params[5]*=c,d.datum_params[6]=d.datum_params[6]/1e6+1))),p&&(d.datum_type=s,d.grids=p),d.a=i,d.b=r,d.es=o,d.ep2=u,d},se={};function le(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:se[e]||null,isNull:!1}}function he(e){return e/3600*Math.PI/180}function ce(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function ue(e){return e.map(function(e){return[he(e.longitudeShift),he(e.latitudeShift)]})}function pe(e,t,i){return{name:ce(e,t+8,t+16).trim(),parent:ce(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function de(e,t,i,r){for(var o=t+176,n=[],a=0;a<i.gridNodeCount;a++){var s={latitudeShift:e.getFloat32(o+16*a,r),longitudeShift:e.getFloat32(o+16*a+4,r),latitudeAccuracy:e.getFloat32(o+16*a+8,r),longitudeAccuracy:e.getFloat32(o+16*a+12,r)};n.push(s)}return n}function fe(e,t){if(!(this instanceof fe))return new fe(e);t=t||function(e){if(e)throw e};var i=U(e);if("object"==typeof i){var r=fe.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var o=k(ne,i.datumCode);o&&(i.datum_params=i.datum_params||(o.towgs84?o.towgs84.split(","):null),i.ellps=o.ellipse,i.datumName=o.datumName?o.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var n=function(e,t,i,r,o){if(!e){var n=k(re,r);n||(n=oe),e=n.a,t=n.b,i=n.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<y)&&(o=!0,t=e),{a:e,b:t,rf:i,sphere:o}}(i.a,i.b,i.rf,i.ellps,i.sphere),a=function(e,t,i,r){var o=e*e,n=t*t,a=(o-n)/o,s=0;return r?(o=(e*=1-a*(p+a*(d+a*f)))*e,a=0):s=Math.sqrt(a),{es:a,e:s,ep2:(o-n)/n}}(n.a,n.b,n.rf,i.R_A),s=function(e){return void 0===e?null:e.split(",").map(le)}(i.nadgrids),l=i.datum||ae(i.datumCode,i.datum_params,n.a,n.b,a.es,a.ep2,s);W(this,i),W(this,r),this.a=n.a,this.b=n.b,this.rf=n.rf,this.sphere=n.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=l,this.init(),t(null,this)}else t(e)}else t(e)}fe.projections=ie,fe.projections.start();var ye=fe;function me(e,t,i){var r,o,n,a,s=e.x,l=e.y,h=e.z?e.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:e.z};if(l>u)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),o=Math.sin(l),a=Math.cos(l),n=o*o,{x:((r=i/Math.sqrt(1-t*n))+h)*a*Math.cos(s),y:(r+h)*a*Math.sin(s),z:(r*(1-t)+h)*o}}function ge(e,t,i,r){var o,n,a,s,l,h,c,p,d,f,y,m,g,v,b,_=e.x,w=e.y,x=e.z?e.z:0;if(o=Math.sqrt(_*_+w*w),n=Math.sqrt(_*_+w*w+x*x),o/i<1e-12){if(v=0,n/i<1e-12)return u,b=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(w,_);a=x/n,p=(s=o/n)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),d=a*l,g=0;do{g++,h=t*(c=i/Math.sqrt(1-t*d*d))/(c+(b=o*p+x*d-c*(1-t*d*d))),m=(y=a*(l=1/Math.sqrt(1-h*(2-h)*s*s)))*p-(f=s*(1-h)*l)*d,p=f,d=y}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(y/Math.abs(f)),z:b}}function ve(e){return e===n||e===a}var be=function(e,t,i){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===n?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==a||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return i;if(e.datum_type===h||t.datum_type===h)return i;var r=e.a,o=e.es;if(e.datum_type===s){if(0!==_e(e,!1,i))return;r=6378137,o=.0066943799901413165}var l=t.a,c=t.b,u=t.es;if(t.datum_type===s&&(l=6378137,c=6356752.314,u=.0066943799901413165),o===u&&r===l&&!ve(e.datum_type)&&!ve(t.datum_type))return i;if((i=me(i,o,r),ve(e.datum_type)&&(i=function(e,t,i){if(t===n)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===a){var r=i[0],o=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6];return{x:u*(e.x-c*e.y+h*e.z)+r,y:u*(c*e.x+e.y-l*e.z)+o,z:u*(-h*e.x+l*e.y+e.z)+s}}}(i,e.datum_type,e.datum_params)),ve(t.datum_type)&&(i=function(e,t,i){if(t===n)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===a){var r=i[0],o=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6],p=(e.x-r)/u,d=(e.y-o)/u,f=(e.z-s)/u;return{x:p+c*d-h*f,y:-c*p+d+l*f,z:h*p-l*d+f}}}(i,t.datum_type,t.datum_params)),i=ge(i,u,l,c),t.datum_type===s)&&0!==_e(t,!0,i))return;return i};function _e(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},o={x:Number.NaN,y:Number.NaN},n=[],a=0;a<e.grids.length;a++){var s=e.grids[a];if(n.push(s.name),s.isNull){o=r;break}if(s.mandatory,null!==s.grid){var l=s.grid.subgrids[0],h=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,c=l.ll[0]-h,u=l.ll[1]-h,p=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,d=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(u>r.y||c>r.x||d<r.y||p<r.x||(o=we(r,t,l),isNaN(o.x))))break}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(o.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*g+" "+r.y*g+" tried: '"+n+"'"),-1):(i.x=-o.x,i.y=o.y,0)}function we(e,t,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var o={x:e.x,y:e.y};o.x-=i.ll[0],o.y-=i.ll[1],o.x=J(o.x-Math.PI)+Math.PI;var n=xe(o,i);if(t){if(isNaN(n.x))return r;n.x=o.x-n.x,n.y=o.y-n.y;var a,s,l=9;do{if(s=xe(n,i),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}a={x:o.x-(s.x+n.x),y:o.y-(s.y+n.y)},n.x+=a.x,n.y+=a.y}while(l--&&Math.abs(a.x)>1e-12&&Math.abs(a.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=J(n.x+i.ll[0]),r.y=n.y+i.ll[1]}else isNaN(n.x)||(r.x=e.x+n.x,r.y=e.y+n.y);return r}function xe(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},o=Math.floor(r.x),n=Math.floor(r.y),a=r.x-1*o,s=r.y-1*n,l={x:Number.NaN,y:Number.NaN};if(o<0||o>=t.lim[0])return l;if(n<0||n>=t.lim[1])return l;i=n*t.lim[0]+o;var h=t.cvs[i][0],c=t.cvs[i][1];i++;var u=t.cvs[i][0],p=t.cvs[i][1];i+=t.lim[0];var d=t.cvs[i][0],f=t.cvs[i][1];i--;var y=t.cvs[i][0],m=t.cvs[i][1],g=a*s,v=a*(1-s),b=(1-a)*(1-s),_=(1-a)*s;return l.x=b*h+v*u+_*y+g*d,l.y=b*c+v*p+_*m+g*f,l}var Ce=function(e,t,i){var r,o,n,a=i.x,s=i.y,l=i.z||0,h={};for(n=0;n<3;n++)if(!t||2!==n||void 0!==i.z)switch(0===n?(r=a,o=-1!=="ew".indexOf(e.axis[n])?"x":"y"):1===n?(r=s,o=-1!=="ns".indexOf(e.axis[n])?"y":"x"):(r=l,o="z"),e.axis[n]){case"e":h[o]=r;break;case"w":h[o]=-r;break;case"n":h[o]=r;break;case"s":h[o]=-r;break;case"u":void 0!==i[o]&&(h.z=r);break;case"d":void 0!==i[o]&&(h.z=-r);break;default:return null}return h},ke=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},Me=function(e){Se(e.x),Se(e.y)};function Se(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function Te(e,t,i,r){var o,l=void 0!==(i=Array.isArray(i)?ke(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(Me(i),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===n||e.datum.datum_type===a||e.datum.datum_type===s)&&"WGS84"!==t.datumCode||(t.datum.datum_type===n||t.datum.datum_type===a||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}(e,t)&&(i=Te(e,o=new ye("WGS84"),i,r),e=o),r&&"enu"!==e.axis&&(i=Ce(e,!1,i)),"longlat"===e.projName)i={x:i.x*m,y:i.y*m,z:i.z||0};else if(e.to_meter&&(i={x:i.x*e.to_meter,y:i.y*e.to_meter,z:i.z||0}),!(i=e.inverse(i)))return;if(e.from_greenwich&&(i.x+=e.from_greenwich),i=be(e.datum,t.datum,i))return t.from_greenwich&&(i={x:i.x-t.from_greenwich,y:i.y,z:i.z||0}),"longlat"===t.projName?i={x:i.x*g,y:i.y*g,z:i.z||0}:(i=t.forward(i),t.to_meter&&(i={x:i.x/t.to_meter,y:i.y/t.to_meter,z:i.z||0})),r&&"enu"!==t.axis?Ce(t,!0,i):(l||delete i.z,i)}var Le=ye("WGS84");function Ie(e,t,i,r){var o,n,a;return Array.isArray(i)?(o=Te(e,t,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof o.z?[o.x,o.y,o.z].concat(i.splice(3)):[o.x,o.y,i[2]].concat(i.splice(3)):[o.x,o.y].concat(i.splice(2)):[o.x,o.y]):(n=Te(e,t,i,r),2===(a=Object.keys(i)).length?n:(a.forEach(function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;n[r]=i[r]}),n))}function Ee(e){return e instanceof ye?e:e.oProj?e.oProj:ye(e)}var Oe=function(e,t,i){e=Ee(e);var r,o=!1;return void 0===t?(t=e,e=Le,o=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=Le,o=!0),t=Ee(t),i?Ie(e,t,i):(r={forward:function(i,r){return Ie(e,t,i,r)},inverse:function(i,r){return Ie(t,e,i,r)}},o&&(r.oProj=t),r)},Pe=6,je="AJSAJS",Ae="AFAFAF",Re=65,ze=73,De=79,Fe=86,Ne=90,Ge={forward:Ve,inverse:function(e){var t=We(Ye(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:Be};function Ve(e,t){return t=t||5,function(e,t){var i="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+function(e,t,i){var r=He(i),o=Math.floor(e/1e5),n=Math.floor(t/1e5)%20;return function(e,t,i){var r=i-1,o=je.charCodeAt(r),n=Ae.charCodeAt(r),a=o+e-1,s=n+t,l=!1;a>Ne&&(a=a-Ne+Re-1,l=!0);(a===ze||o<ze&&a>ze||(a>ze||o<ze)&&l)&&a++;(a===De||o<De&&a>De||(a>De||o<De)&&l)&&++a===ze&&a++;a>Ne&&(a=a-Ne+Re-1);s>Fe?(s=s-Fe+Re-1,l=!0):l=!1;(s===ze||n<ze&&s>ze||(s>ze||n<ze)&&l)&&s++;(s===De||n<De&&s>De||(s>De||n<De)&&l)&&++s===ze&&s++;s>Fe&&(s=s-Fe+Re-1);return String.fromCharCode(a)+String.fromCharCode(s)}(o,n,r)}(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+r.substr(r.length-5,t)}(function(e){var t,i,r,o,n,a,s,l=e.lat,h=e.lon,c=6378137,u=qe(l),p=qe(h);s=Math.floor((h+180)/6)+1,180===h&&(s=60);l>=56&&l<64&&h>=3&&h<12&&(s=32);l>=72&&l<84&&(h>=0&&h<9?s=31:h>=9&&h<21?s=33:h>=21&&h<33?s=35:h>=33&&h<42&&(s=37));a=qe(6*(s-1)-180+3),.006739496752268451,t=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),r=.006739496752268451*Math.cos(u)*Math.cos(u),o=Math.cos(u)*(p-a),n=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var d=.9996*t*(o+(1-i+r)*o*o*o/6+(5-18*i+i*i+72*r-.39089081163157013)*o*o*o*o*o/120)+5e5,f=.9996*(n+t*Math.tan(u)*(o*o/2+(5-i+9*r+4*r*r)*o*o*o*o/24+(61-58*i+i*i+600*r-2.2240339282485886)*o*o*o*o*o*o/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(d),zoneNumber:s,zoneLetter:function(e){var t="Z";84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C");return t}(l)}}({lat:e[1],lon:e[0]}),t)}function Be(e){var t=We(Ye(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function qe(e){return e*(Math.PI/180)}function Ue(e){return e/Math.PI*180}function We(e){var t=e.northing,i=e.easting,r=e.zoneLetter,o=e.zoneNumber;if(o<0||o>60)return null;var n,a,s,l,h,c,u,p,d=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=i-5e5,m=t;r<"N"&&(m-=1e7),c=6*(o-1)-180+3,p=(u=m/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),n=d/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),s=.006739496752268451*Math.cos(p)*Math.cos(p),l=.99330562*d/Math.pow(1-.00669438*Math.sin(p)*Math.sin(p),1.5),h=y/(.9996*n);var g=p-n*Math.tan(p)/l*(h*h/2-(5+3*a+10*s-4*s*s-.06065547077041606)*h*h*h*h/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*h*h*h*h*h*h/720);g=Ue(g);var v,b=(h-(1+2*a+s)*h*h*h/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*h*h*h*h*h/120)/Math.cos(p);if(b=c+Ue(b),e.accuracy){var _=We({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:_.lat,right:_.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function He(e){var t=e%Pe;return 0===t&&(t=Pe),t}function Ye(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,o="",n=0;!/[A-Z]/.test(t=e.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+e;o+=t,n++}var a=parseInt(o,10);if(0===n||n+3>i)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(n++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(n,n+=2);for(var l=He(a),h=function(e,t){var i=je.charCodeAt(t-1),r=1e5,o=!1;for(;i!==e.charCodeAt(0);){if(++i===ze&&i++,i===De&&i++,i>Ne){if(o)throw"Bad character: "+e;i=Re,o=!0}r+=1e5}return r}(r.charAt(0),l),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var i=Ae.charCodeAt(t-1),r=0,o=!1;for(;i!==e.charCodeAt(0);){if(++i===ze&&i++,i===De&&i++,i>Fe){if(o)throw"Bad character: "+e;i=Re,o=!0}r+=1e5}return r}(r.charAt(1),l);c<Je(s);)c+=2e6;var u=i-n;if(u%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var p,d,f,y=u/2,m=0,g=0;return y>0&&(p=1e5/Math.pow(10,y),d=e.substring(n,n+y),m=parseFloat(d)*p,f=e.substring(n+y),g=parseFloat(f)*p),{easting:m+h,northing:g+c,zoneLetter:s,zoneNumber:a,accuracy:p}}function Je(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function $e(e,t,i){if(!(this instanceof $e))return new $e(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}$e.fromMGRS=function(e){return new $e(Be(e))},$e.prototype.toMGRS=function(e){return Ve([this.x,this.y],e)};var Xe=$e,Ze=.01068115234375,Ke=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Ze))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Ze)));var i=e*e;return t[2]=i*(.46875-e*(.013020833333333334+.007120768229166667*e)),i*=e,t[3]=i*(.3645833333333333-.005696614583333333*e),t[4]=i*e*.3076171875,t},Qe=function(e,t,i,r){return i*=t,t*=t,r[0]*e-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},et=function(e,t,i){for(var r=1/(1-t),o=e,n=20;n;--n){var a=Math.sin(o),s=1-t*a*a;if(o-=s=(Qe(o,a,Math.cos(o),i)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<y)return o}return o};var tt={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Ke(this.es),this.ml0=Qe(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,i,r,o=e.x,n=e.y,a=J(o-this.long0),s=Math.sin(n),l=Math.cos(n);if(this.es){var h=l*a,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),p=Math.pow(u,2),d=Math.abs(l)>y?Math.tan(n):0,f=Math.pow(d,2),m=Math.pow(f,2);t=1-this.es*Math.pow(s,2),h/=Math.sqrt(t);var g=Qe(n,s,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+m+14*u-58*f*u+c/42*(61+179*m-m*f-479*f)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*a*h/2*(1+c/12*(5-f+9*u+4*p+c/30*(61+m-58*f+270*u-330*f*u+c/56*(1385+543*m-m*f-3111*f))))))+this.y0}else{var v=l*Math.sin(a);if(Math.abs(Math.abs(v)-1)<y)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(a)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>y)return 93;r=0}else r=Math.acos(r);n<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=i,e.y=r,e},inverse:function(e){var t,i,r,o,n=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,i=et(t,this.es,this.en),Math.abs(i)<u){var s=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>y?Math.tan(i):0,c=this.ep2*Math.pow(l,2),p=Math.pow(c,2),d=Math.pow(h,2),f=Math.pow(d,2);t=1-this.es*Math.pow(s,2);var m=n*Math.sqrt(t)/this.k0,g=Math.pow(m,2);r=i-(t*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*d-9*c*d+c-4*p-g/30*(61+90*d-252*c*d+45*f+46*c-g/56*(1385+3633*d+4095*f+1574*f*d)))),o=J(this.long0+m*(1-g/6*(1+2*d+c-g/20*(5+28*d+24*f+8*c*d+6*c-g/42*(61+662*d+1320*f+720*f*d))))/l)}else r=u*Y(a),o=0;else{var v=Math.exp(n/this.k0),b=.5*(v-1/v),_=this.lat0+a/this.k0,w=Math.cos(_);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(b,2))),r=Math.asin(t),a<0&&(r=-r),o=0===b&&0===w?0:J(Math.atan2(b,w)+this.long0)}return e.x=o,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},it=function(e){var t=Math.exp(e);return t=(t-1/t)/2},rt=function(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),r=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},ot=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,i=t-1;return 0===i?e:e*Math.log(t)/i}(t*(1+t/(rt(1,t)+1))),e<0?-t:t},nt=function(e,t){for(var i,r=2*Math.cos(2*t),o=e.length-1,n=e[o],a=0;--o>=0;)i=r*n-a+e[o],a=n,n=i;return t+i*Math.sin(2*t)},at=function(e,t){for(var i,r=2*Math.cos(t),o=e.length-1,n=e[o],a=0;--o>=0;)i=r*n-a+e[o],a=n,n=i;return Math.sin(t)*i},st=function(e,t,i){for(var r,o,n=Math.sin(t),a=Math.cos(t),s=it(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*a*l,c=-2*n*s,u=e.length-1,p=e[u],d=0,f=0,y=0;--u>=0;)r=f,o=d,p=h*(f=p)-r-c*(d=y)+e[u],y=c*f-o+h*d;return[(h=n*l)*p-(c=a*s)*y,h*y+c*p]};var lt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(tt.init.apply(this),this.forward=tt.forward,this.inverse=tt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),i*=t,this.cgb[1]=i*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i*=t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),i*=t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(t*(-24832/14175)-2.4)),i*=t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i*=t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),i*=t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i*=t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i*=t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i*=t,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=nt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+at(this.gtu,2*r))},forward:function(e){var t=J(e.x-this.long0),i=e.y;i=nt(this.cbg,i);var r=Math.sin(i),o=Math.cos(i),n=Math.sin(t),a=Math.cos(t);i=Math.atan2(r,a*o),t=Math.atan2(n*o,rt(r,o*a)),t=ot(Math.tan(t));var s,l,h=st(this.gtu,2*i,2*t);return i+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e},inverse:function(e){var t,i,r=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(o=(o-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var n=st(this.utg,2*o,2*r);o+=n[0],r+=n[1],r=Math.atan(it(r));var a=Math.sin(o),s=Math.cos(o),l=Math.sin(r),h=Math.cos(r);o=Math.atan2(a*h,rt(l,h*s)),r=Math.atan2(l,h*s),t=J(r+this.long0),i=nt(this.cgb,o)}else t=1/0,i=1/0;return e.x=t,e.y=i,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ht=function(e,t){if(void 0===e){if((e=Math.floor(30*(J(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e};var ct={init:function(){var e=ht(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*m,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,lt.init.apply(this),this.forward=lt.forward,this.inverse=lt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ut=function(e,t){return Math.pow((1-e)/(1+e),t)},pt=20;var dt={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+v)/(Math.pow(Math.tan(.5*this.lat0+v),this.C)*ut(this.e*e,this.ratexp))},forward:function(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+v),this.C)*ut(this.e*Math.sin(i),this.ratexp))-u,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,i=e.y,r=Math.pow(Math.tan(.5*i+v)/this.K,1/this.C),o=pt;o>0&&(i=2*Math.atan(r*ut(this.e*Math.sin(e.y),-.5*this.e))-u,!(Math.abs(i-e.y)<1e-14));--o)e.y=i;return o?(e.x=t,e.y=i,e):null},names:["gauss"]};var ft={init:function(){dt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,i,r,o;return e.x=J(e.x-this.long0),dt.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),o=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=o*i*Math.sin(e.x),e.y=o*(this.cosc0*t-this.sinc0*i*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,i,r,o,n;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,n=Math.sqrt(e.x*e.x+e.y*e.y)){var a=2*Math.atan2(n,this.R2);t=Math.sin(a),i=Math.cos(a),o=Math.asin(i*this.sinc0+e.y*t*this.cosc0/n),r=Math.atan2(e.x*t,n*this.cosc0*i-e.y*this.sinc0*t)}else o=this.phic0,r=0;return e.x=r,e.y=o,dt.inverse.apply(this,[e]),e.x=J(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var yt={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=y&&(this.k0=.5*(1+Y(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=y&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=y&&(this.k0=.5*this.cons*H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/$(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=H(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,i,r,o,n,a,s=e.x,l=e.y,h=Math.sin(l),c=Math.cos(l),p=J(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=y&&Math.abs(l+this.lat0)<=y?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(p)),e.x=this.a*t*c*Math.sin(p)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*c*Math.cos(p))+this.y0,e):(i=2*Math.atan(this.ssfn_(l,h,this.e))-u,o=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=y?(n=$(this.e,l*this.con,this.con*h),a=2*this.a*this.k0*n/this.cons,e.x=this.x0+a*Math.sin(s-this.long0),e.y=this.y0-this.con*a*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<y?(t=2*this.a*this.k0/(1+o*Math.cos(p)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*o*Math.cos(p))),e.y=t*(this.cosX0*r-this.sinX0*o*Math.cos(p))+this.y0),e.x=t*o*Math.sin(p)+this.x0,e))},inverse:function(e){var t,i,r,o,n;e.x-=this.x0,e.y-=this.y0;var a=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,i=this.lat0,a<=y?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/a),t=Math.abs(this.coslat0)<y?this.lat0>0?J(this.long0+Math.atan2(e.x,-1*e.y)):J(this.long0+Math.atan2(e.x,e.y)):J(this.long0+Math.atan2(e.x*Math.sin(s),a*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=y){if(a<=y)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=a*this.cons/(2*this.a*this.k0),i=this.con*X(this.e,r),t=this.con*J(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else o=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=y?n=this.X0:(n=Math.asin(Math.cos(o)*this.sinX0+e.y*Math.sin(o)*this.cosX0/a),t=J(this.long0+Math.atan2(e.x*Math.sin(o),a*this.cosX0*Math.cos(o)-e.y*this.sinX0*Math.sin(o)))),i=-1*X(this.e,Math.tan(.5*(u+n)));return e.x=t,e.y=i,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,i){return t*=i,Math.tan(.5*(u+e))*Math.pow((1-t)/(1+t),.5*i)}};var mt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,o=2*r-Math.pow(r,2),n=this.e=Math.sqrt(o);this.R=this.k0*i*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+n*t)/(1-n*t));this.K=a-this.alpha*s+this.alpha*n/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+i)+this.K,o=2*(Math.atan(Math.exp(r))-Math.PI/4),n=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(n))),s=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(n));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*a+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,o=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(o))),s=this.lambda0+a/this.alpha,l=0,h=n,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=h,e},names:["somerc"]},gt=1e-7;var vt={init:function(){var e,t,i,r,o,n,a,s,l,h,c,p=0,d=0,f=0,g=0,_=0,w=0,x=0;this.no_off=function(e){var t="object"==typeof e.PROJECTION?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(t)}(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var k=!1;if("rectified_grid_angle"in this&&(k=!0),C&&(x=this.alpha),k&&(p=this.rectified_grid_angle*m),C||k)d=this.longc;else if(f=this.long1,_=this.lat1,g=this.long2,w=this.lat2,Math.abs(_-w)<=gt||(e=Math.abs(_))<=gt||Math.abs(e-u)<=gt||Math.abs(Math.abs(this.lat0)-u)<=gt||Math.abs(Math.abs(w)-u)<=gt)throw new Error;var M=1-this.es;t=Math.sqrt(M),Math.abs(this.lat0)>y?(s=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*s*s,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/M),this.A=this.B*this.k0*t/e,(o=(r=this.B*t/(i*Math.sqrt(e)))*r-1)<=0?o=0:(o=Math.sqrt(o),this.lat0<0&&(o=-o)),this.E=o+=r,this.E*=Math.pow($(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=o=1),C||k?(C?(c=Math.asin(Math.sin(x)/r),k||(p=x)):(c=p,x=Math.asin(r*Math.sin(c))),this.lam0=d-Math.asin(.5*(o-1/o)*Math.tan(c))/this.B):(n=Math.pow($(this.e,_,Math.sin(_)),this.B),a=Math.pow($(this.e,w,Math.sin(w)),this.B),o=this.E/n,l=(a-n)/(a+n),h=((h=this.E*this.E)-a*n)/(h+a*n),(e=f-g)<-Math.pi?g-=b:e>Math.pi&&(g+=b),this.lam0=J(.5*(f+g)-Math.atan(h*Math.tan(.5*this.B*(f-g))/l)/this.B),c=Math.atan(2*Math.sin(this.B*J(f-this.lam0))/(o-1/o)),p=x=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),o=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(v-o)),this.v_pole_s=this.ArB*Math.log(Math.tan(v+o))},forward:function(e){var t,i,r,o,n,a,s,l,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-u)>y){if(t=.5*((n=this.E/Math.pow($(this.e,e.y,Math.sin(e.y)),this.B))-(a=1/n)),i=.5*(n+a),o=Math.sin(this.B*e.x),r=(t*this.singam-o*this.cosgam)/i,Math.abs(Math.abs(r)-1)<y)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),a=Math.cos(this.B*e.x),s=Math.abs(a)<gt?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+o*this.singam,a)}else l=e.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*e.y;return this.no_rot?(h.x=s,h.y=l):(s-=this.u_0,h.x=l*this.cosrot+s*this.sinrot,h.y=s*this.cosrot-l*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(e){var t,i,r,o,n,a,s,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),o=.5*((r=Math.exp(-this.BrA*i))-1/r),n=.5*(r+1/r),s=((a=Math.sin(this.BrA*t))*this.cosgam+o*this.singam)/n,Math.abs(Math.abs(s)-1)<y)l.x=0,l.y=s<0?-u:u;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=X(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(o*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var bt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<y)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),i=Math.cos(this.lat1),r=H(this.e,t,i),o=$(this.e,this.lat1,t),n=Math.sin(this.lat2),a=Math.cos(this.lat2),s=H(this.e,n,a),l=$(this.e,this.lat2,n),h=$(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>y?this.ns=Math.log(r/s)/Math.log(o/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=y&&(i=Y(i)*(u-2*y));var r,o,n=Math.abs(Math.abs(i)-u);if(n>y)r=$(this.e,i,Math.sin(i)),o=this.a*this.f0*Math.pow(r,this.ns);else{if((n=i*this.ns)<=0)return null;o=0}var a=this.ns*J(t-this.long0);return e.x=this.k0*(o*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(a))+this.y0,e},inverse:function(e){var t,i,r,o,n,a=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+s*s),i=1):(t=-Math.sqrt(a*a+s*s),i=-1);var l=0;if(0!==t&&(l=Math.atan2(i*a,i*s)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(o=X(this.e,r)))return null}else o=-u;return n=J(l/this.ns+this.long0),e.x=n,e.y=o,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var _t={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,i,r,o,n,a,s,l=e.x,h=e.y,c=J(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),r=-c*this.alfa,o=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),n=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(o)),a=this.n*n,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(o/2+this.s45),this.n),e.y=s*Math.cos(a)/1,e.x=s*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,o,n,a,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),n=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(o)),i=Math.asin(Math.cos(r)*Math.sin(o)/Math.cos(t)),e.x=this.long0-i/this.alfa,a=t,s=0;var h=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(s=1),a=e.y,h+=1}while(0===s&&h<15);return h>=15?null:e},names:["Krovak","krovak"]},wt=function(e,t,i,r,o){return e*o-t*Math.sin(2*o)+i*Math.sin(4*o)-r*Math.sin(6*o)},xt=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},Ct=function(e){return.375*e*(1+.25*e*(1+.46875*e))},kt=function(e){return.05859375*e*e*(1+.75*e)},Mt=function(e){return e*e*e*(35/3072)},St=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},Tt=function(e){return Math.abs(e)<u?e:e-Y(e)*Math.PI},Lt=function(e,t,i,r,o){var n,a;n=e/t;for(var s=0;s<15;s++)if(n+=a=(e-(t*n-i*Math.sin(2*n)+r*Math.sin(4*n)-o*Math.sin(6*n)))/(t-2*i*Math.cos(2*n)+4*r*Math.cos(4*n)-6*o*Math.cos(6*n)),Math.abs(a)<=1e-10)return n;return NaN};var It={init:function(){this.sphere||(this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=kt(this.es),this.e3=Mt(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,i,r=e.x,o=e.y;if(r=J(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(o)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(o),Math.cos(r))-this.lat0);else{var n=Math.sin(o),a=Math.cos(o),s=St(this.a,this.e,n),l=Math.tan(o)*Math.tan(o),h=r*Math.cos(o),c=h*h,u=this.es*a*a/(1-this.es);t=s*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),i=this.a*wt(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*n/a*c*(.5+(5-l+6*u)*c/24)}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r=e.x/this.a,o=e.y/this.a;if(this.sphere){var n=o+this.lat0;t=Math.asin(Math.sin(n)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(n))}else{var a=this.ml0/this.a+o,s=Lt(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-u)<=y)return e.x=this.long0,e.y=u,o<0&&(e.y*=-1),e;var l=St(this.a,this.e,Math.sin(s)),h=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(s),2),p=r*this.a/l,d=p*p;t=s-l*Math.tan(s)/h*p*p*(.5-(1+3*c)*p*p/24),i=p*(1-d*(c/3+(1+3*c)*c*d/15))/Math.cos(s)}return e.x=J(i+this.long0),e.y=Tt(t),e},names:["Cassini","Cassini_Soldner","cass"]},Et=function(e,t){var i;return e>1e-7?(1-e*e)*(t/(1-(i=e*t)*i)-.5/e*Math.log((1-i)/(1+i))):2*t};var Ot=.3333333333333333,Pt=.17222222222222222,jt=.10257936507936508,At=.06388888888888888,Rt=.0664021164021164,zt=.016415012942191543;var Dt={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-u)<y?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<y?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Et(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*Ot,t=e*e,i[0]+=t*Pt,i[1]=t*At,t*=e,i[0]+=t*jt,i[1]+=t*Rt,i[2]=t*zt,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Et(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,i,r,o,n,a,s,l,h,c,p=e.x,d=e.y;if(p=J(p-this.long0),this.sphere){if(n=Math.sin(d),c=Math.cos(d),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*n+this.cosph0*c*r)<=y)return null;t=(i=Math.sqrt(2/i))*c*Math.sin(p),i*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.lat0)<y)return null;i=v-.5*d,t=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(p),i*=r}}else{switch(s=0,l=0,h=0,r=Math.cos(p),o=Math.sin(p),n=Math.sin(d),a=Et(this.e,n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=a/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:h=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:h=1+l*r;break;case this.N_POLE:h=u+d,a=this.qp-a;break;case this.S_POLE:h=d-u,a=this.qp+a}if(Math.abs(h)<y)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),i=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*s-this.sinb1*l*r):(h=Math.sqrt(2/(1+l*r)))*s*this.ymf,t=this.xmf*h*l*o;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(h=Math.sqrt(a))*o,i=r*(this.mode===this.S_POLE?h:-h)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,o,n,a,s,l=e.x/this.a,h=e.y/this.a;if(this.sphere){var c,p=0,d=0;if((i=.5*(c=Math.sqrt(l*l+h*h)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(i),p=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=y?0:Math.asin(h*d/c),l*=d,h=p*c;break;case this.OBLIQ:i=Math.abs(c)<=y?this.lat0:Math.asin(p*this.sinph0+h*d*this.cosph0/c),l*=d*this.cosph0,h=(p-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:h=-h,i=u-i;break;case this.S_POLE:i-=u}t=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,h*=this.dd,(a=Math.sqrt(l*l+h*h))<y)return e.x=this.long0,e.y=this.lat0,e;o=2*Math.asin(.5*a/this.rq),r=Math.cos(o),l*=o=Math.sin(o),this.mode===this.OBLIQ?(s=r*this.sinb1+h*o*this.cosb1/a,n=this.qp*s,h=a*this.cosb1*r-h*this.sinb1*o):(s=h*o/a,n=this.qp*s,h=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(n=l*l+h*h))return e.x=this.long0,e.y=this.lat0,e;s=1-n/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(l,h),i=function(e,t){var i=e+e;return e+t[0]*Math.sin(i)+t[1]*Math.sin(i+i)+t[2]*Math.sin(i+i+i)}(Math.asin(s),this.apa)}return e.x=J(this.long0+t),e.y=i,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Ft=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};var Nt={init:function(){Math.abs(this.lat1+this.lat2)<y||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=H(this.e3,this.sin_po,this.cos_po),this.qs1=Et(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=H(this.e3,this.sin_po,this.cos_po),this.qs2=Et(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Et(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>y?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=Et(this.e3,this.sin_phi),o=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,n=this.ns0*J(t-this.long0),a=o*Math.sin(n)+this.x0,s=this.rh-o*Math.cos(n)+this.y0;return e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o,n,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),o=0,0!==t&&(o=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,i)),n=J(o/this.ns0+this.long0),e.x=n,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,o,n,a,s=Ft(.5*t);if(e<y)return s;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(s),r=Math.cos(s),s+=a=.5*(n=1-(o=e*i)*o)*n/r*(t/(1-l)-i/n+.5/e*Math.log((1-o)/(1+o))),Math.abs(a)<=1e-7)return s;return null}};var Gt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,i,r,o,n,a,s,l=e.x,h=e.y;return r=J(l-this.long0),t=Math.sin(h),i=Math.cos(h),o=Math.cos(r),(n=this.sin_p14*t+this.cos_p14*i*o)>0||Math.abs(n)<=y?(a=this.x0+1*this.a*i*Math.sin(r)/n,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*o)/n):(a=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*o)),e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o,n,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(o=Math.atan2(t,this.rc),i=Math.sin(o),r=Math.cos(o),a=Ft(r*this.sin_p14+e.y*i*this.cos_p14/t),n=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),n=J(this.long0+n)):(a=this.phic0,n=0),e.x=n,e.y=a,e},names:["gnom"]},Vt=function(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*u:u;for(var r,o,n,a,s=Math.asin(.5*t),l=0;l<30;l++)if(o=Math.sin(s),n=Math.cos(s),a=e*o,s+=r=Math.pow(1-a*a,2)/(2*n)*(t/(1-e*e)-o/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return s;return NaN};var Bt={init:function(){this.sphere||(this.k0=H(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,o=e.y,n=J(r-this.long0);if(this.sphere)t=this.x0+this.a*n*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(o)/Math.cos(this.lat_ts);else{var a=Et(this.e,Math.sin(o));t=this.x0+this.a*this.k0*n,i=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=i,e},inverse:function(e){var t,i;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=J(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=Vt(this.e,2*e.y*this.k0/this.a),t=J(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]};var qt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,i=e.y,r=J(t-this.long0),o=Tt(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*o,e},inverse:function(e){var t=e.x,i=e.y;return e.x=J(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Tt(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ut=20;var Wt={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=kt(this.es),this.e3=Mt(this.es),this.ml0=this.a*wt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,o=e.x,n=e.y,a=J(o-this.long0);if(r=a*Math.sin(n),this.sphere)Math.abs(n)<=y?(t=this.a*a,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(n),i=this.a*(Tt(n-this.lat0)+(1-Math.cos(r))/Math.tan(n)));else if(Math.abs(n)<=y)t=this.a*a,i=-1*this.ml0;else{var s=St(this.a,this.e,Math.sin(n))/Math.tan(n);t=s*Math.sin(r),i=this.a*wt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(r))}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){var t,i,r,o,n,a,s,l,h;if(r=e.x-this.x0,o=e.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=y)t=J(r/this.a+this.long0),i=0;else{var c;for(a=this.lat0+o/this.a,s=r*r/this.a/this.a+a*a,l=a,n=Ut;n;--n)if(l+=h=-1*(a*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-a)/c-1),Math.abs(h)<=y){i=l;break}t=J(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(o+this.ml0)<=y)i=0,t=J(this.long0+r/this.a);else{var u,p,d,f,m;for(a=(this.ml0+o)/this.a,s=r*r/this.a/this.a+a*a,l=a,n=Ut;n;--n)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),p=this.a*wt(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(a*(u*(f=p/this.a)+1)-f-.5*u*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*a*f)/(4*u)+(a-f)*(u*d-2/Math.sin(2*l))-d),Math.abs(h)<=y){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=J(this.long0+Math.asin(r*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]};var Ht={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,i=e.x,r=e.y-this.lat0,o=i-this.long0,n=r/c*1e-5,a=o,s=1,l=0;for(t=1;t<=10;t++)s*=n,l+=this.A[t]*s;var h,u=l,p=a,d=1,f=0,y=0,m=0;for(t=1;t<=6;t++)h=f*u+d*p,d=d*u-f*p,f=h,y=y+this.B_re[t]*d-this.B_im[t]*f,m=m+this.B_im[t]*d+this.B_re[t]*f;return e.x=m*this.a+this.x0,e.y=y*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,o=e.y,n=r-this.x0,a=(o-this.y0)/this.a,s=n/this.a,l=1,h=0,u=0,p=0;for(t=1;t<=6;t++)i=h*a+l*s,l=l*a-h*s,h=i,u=u+this.C_re[t]*l-this.C_im[t]*h,p=p+this.C_im[t]*l+this.C_re[t]*h;for(var d=0;d<this.iterations;d++){var f,y=u,m=p,g=a,v=s;for(t=2;t<=6;t++)f=m*u+y*p,y=y*u-m*p,m=f,g+=(t-1)*(this.B_re[t]*y-this.B_im[t]*m),v+=(t-1)*(this.B_im[t]*y+this.B_re[t]*m);y=1,m=0;var b=this.B_re[1],_=this.B_im[1];for(t=2;t<=6;t++)f=m*u+y*p,y=y*u-m*p,m=f,b+=t*(this.B_re[t]*y-this.B_im[t]*m),_+=t*(this.B_im[t]*y+this.B_re[t]*m);var w=b*b+_*_;u=(g*b+v*_)/w,p=(v*b-g*_)/w}var x=u,C=p,k=1,M=0;for(t=1;t<=9;t++)k*=x,M+=this.D[t]*k;var S=this.lat0+M*c*1e5,T=this.long0+C;return e.x=T,e.y=S,e},names:["New_Zealand_Map_Grid","nzmg"]};var Yt={init:function(){},forward:function(e){var t=e.x,i=e.y,r=J(t-this.long0),o=this.x0+this.a*r,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=o,e.y=n,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=J(this.long0+e.x/this.a),i=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=i,e},names:["Miller_Cylindrical","mill"]},Jt=20;var $t={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ke(this.es)},forward:function(e){var t,i,r=e.x,o=e.y;if(r=J(r-this.long0),this.sphere){if(this.m)for(var n=this.n*Math.sin(o),a=Jt;a;--a){var s=(this.m*o+Math.sin(o)-n)/(this.m+Math.cos(o));if(o-=s,Math.abs(s)<y)break}else o=1!==this.n?Math.asin(this.n*Math.sin(o)):o;t=this.a*this.C_x*r*(this.m+Math.cos(o)),i=this.a*this.C_y*o}else{var l=Math.sin(o),h=Math.cos(o);i=this.a*Qe(o,l,h,this.en),t=this.a*r*h/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r,o;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=Ft((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Ft(Math.sin(t)/this.n)),r=J(r+this.long0),t=Tt(t)):(t=et(e.y/this.a,this.es,this.en),(o=Math.abs(t))<u?(o=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*o*o)/(this.a*Math.cos(t)),r=J(i)):o-y<u&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};var Xt={init:function(){},forward:function(e){for(var t=e.x,i=e.y,r=J(t-this.long0),o=i,n=Math.PI*Math.sin(i);;){var a=-(o+Math.sin(o)-n)/(1+Math.cos(o));if(o+=a,Math.abs(a)<y)break}o/=2,Math.PI/2-Math.abs(i)<y&&(r=0);var s=.900316316158*this.a*r*Math.cos(o)+this.x0,l=1.4142135623731*this.a*Math.sin(o)+this.y0;return e.x=s,e.y=l,e},inverse:function(e){var t,i;e.x-=this.x0,e.y-=this.y0,i=e.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),t=Math.asin(i);var r=J(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var o=Math.asin(i);return e.x=r,e.y=o,e},names:["Mollweide","moll"]};var Zt={init:function(){Math.abs(this.lat1+this.lat2)<y||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=xt(this.es),this.e1=Ct(this.es),this.e2=kt(this.es),this.e3=Mt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=H(this.e,this.sinphi,this.cosphi),this.ml1=wt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<y?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=H(this.e,this.sinphi,this.cosphi),this.ml2=wt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=wt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,i=e.x,r=e.y;if(this.sphere)t=this.a*(this.g-r);else{var o=wt(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-o)}var n=this.ns*J(i-this.long0),a=this.x0+t*Math.sin(n),s=this.y0+this.rh-t*Math.cos(n);return e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var n=0;if(0!==i&&(n=Math.atan2(t*e.x,t*e.y)),this.sphere)return o=J(this.long0+n/this.ns),r=Tt(this.g-i/this.a),e.x=o,e.y=r,e;var a=this.g-i/this.a;return r=Lt(a,this.e0,this.e1,this.e2,this.e3),o=J(this.long0+n/this.ns),e.x=o,e.y=r,e},names:["Equidistant_Conic","eqdc"]};var Kt={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,o=e.y,n=J(r-this.long0);Math.abs(o)<=y&&(t=this.x0+this.R*n,i=this.y0);var a=Ft(2*Math.abs(o/Math.PI));(Math.abs(n)<=y||Math.abs(Math.abs(o)-u)<=y)&&(t=this.x0,i=o>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/n-n/Math.PI),l=s*s,h=Math.sin(a),c=Math.cos(a),p=c/(h+c-1),d=p*p,f=p*(2/h-1),m=f*f,g=Math.PI*this.R*(s*(p-m)+Math.sqrt(l*(p-m)*(p-m)-(m+l)*(d-m)))/(m+l);n<0&&(g=-g),t=this.x0+g;var v=l+p;return g=Math.PI*this.R*(f*v-s*Math.sqrt((m+l)*(l+1)-v*v))/(m+l),i=o>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,o,n,a,s,l,h,c,u,p;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,n=(r=e.x/u)*r+(o=e.y/u)*o,u=3*(o*o/(l=-2*(a=-Math.abs(o)*(1+n))+1+2*o*o+n*n)+(2*(s=a-2*o*o+r*r)*s*s/l/l/l-9*a*s/l/l)/27)/(h=(a-s*s/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),p=Math.acos(u)/3,i=e.y>=0?(-c*Math.cos(p+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(p+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<y?this.long0:J(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(r*r-o*o)+n*n))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var Qt={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,i,r,o,n,a,s,l,h,c,p,d,f,m,g,v,b,_,w,x,C,k,M=e.x,S=e.y,T=Math.sin(e.y),L=Math.cos(e.y),I=J(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=y?(e.x=this.x0+this.a*(u-S)*Math.sin(I),e.y=this.y0-this.a*(u-S)*Math.cos(I),e):Math.abs(this.sin_p12+1)<=y?(e.x=this.x0+this.a*(u+S)*Math.sin(I),e.y=this.y0+this.a*(u+S)*Math.cos(I),e):(_=this.sin_p12*T+this.cos_p12*L*Math.cos(I),b=(v=Math.acos(_))?v/Math.sin(v):1,e.x=this.x0+this.a*b*L*Math.sin(I),e.y=this.y0+this.a*b*(this.cos_p12*T-this.sin_p12*L*Math.cos(I)),e):(t=xt(this.es),i=Ct(this.es),r=kt(this.es),o=Mt(this.es),Math.abs(this.sin_p12-1)<=y?(n=this.a*wt(t,i,r,o,u),a=this.a*wt(t,i,r,o,S),e.x=this.x0+(n-a)*Math.sin(I),e.y=this.y0-(n-a)*Math.cos(I),e):Math.abs(this.sin_p12+1)<=y?(n=this.a*wt(t,i,r,o,u),a=this.a*wt(t,i,r,o,S),e.x=this.x0+(n+a)*Math.sin(I),e.y=this.y0+(n+a)*Math.cos(I),e):(s=T/L,l=St(this.a,this.e,this.sin_p12),h=St(this.a,this.e,T),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(h*L)),w=0===(p=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(p)-Math.PI)<=y?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(I)*Math.cos(c)/Math.sin(p)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),v=l*w*(1-(x=w*w)*(g=(f=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es))*f)*(1-g)/6+(C=x*w)/8*(m=d*f)*(1-2*g)+(k=C*w)/120*(g*(4-7*g)-3*d*d*(1-7*g))-k*w/48*m),e.x=this.x0+v*Math.sin(p),e.y=this.y0+v*Math.cos(p),e))},inverse:function(e){var t,i,r,o,n,a,s,l,h,c,p,d,f,m,g,v,b,_,w,x,C,k,M;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*u*this.a)return;return i=t/this.a,r=Math.sin(i),o=Math.cos(i),n=this.long0,Math.abs(t)<=y?a=this.lat0:(a=Ft(o*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-u,n=Math.abs(s)<=y?this.lat0>=0?J(this.long0+Math.atan2(e.x,-e.y)):J(this.long0-Math.atan2(-e.x,e.y)):J(this.long0+Math.atan2(e.x*r,t*this.cos_p12*o-e.y*this.sin_p12*r))),e.x=n,e.y=a,e}return l=xt(this.es),h=Ct(this.es),c=kt(this.es),p=Mt(this.es),Math.abs(this.sin_p12-1)<=y?(d=this.a*wt(l,h,c,p,u),t=Math.sqrt(e.x*e.x+e.y*e.y),a=Lt((d-t)/this.a,l,h,c,p),n=J(this.long0+Math.atan2(e.x,-1*e.y)),e.x=n,e.y=a,e):Math.abs(this.sin_p12+1)<=y?(d=this.a*wt(l,h,c,p,u),t=Math.sqrt(e.x*e.x+e.y*e.y),a=Lt((t-d)/this.a,l,h,c,p),n=J(this.long0+Math.atan2(e.x,e.y)),e.x=n,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),f=St(this.a,this.e,this.sin_p12),v=Math.cos(g),_=-(b=this.e*this.cos_p12*v)*b/(1-this.es),w=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),k=1-_*(C=(x=t/f)-_*(1+_)*Math.pow(x,3)/6-w*(1+3*_)*Math.pow(x,4)/24)*C/2-x*C*C*C/6,m=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*v),n=J(this.long0+Math.asin(Math.sin(g)*Math.sin(C)/Math.cos(m))),M=Math.sin(m),a=Math.atan2((M-this.es*k*this.sin_p12)*Math.tan(m),M*(1-this.es)),e.x=n,e.y=a,e)},names:["Azimuthal_Equidistant","aeqd"]};var ei={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,o,n,a,s,l=e.x,h=e.y;return r=J(l-this.long0),t=Math.sin(h),i=Math.cos(h),o=Math.cos(r),((n=this.sin_p14*t+this.cos_p14*i*o)>0||Math.abs(n)<=y)&&(a=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*o)),e.x=a,e.y=s,e},inverse:function(e){var t,i,r,o,n,a,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Ft(t/this.a),r=Math.sin(i),o=Math.cos(i),a=this.long0,Math.abs(t)<=y?(s=this.lat0,e.x=a,e.y=s,e):(s=Ft(o*this.sin_p14+e.y*r*this.cos_p14/t),n=Math.abs(this.lat0)-u,Math.abs(n)<=y?(a=this.lat0>=0?J(this.long0+Math.atan2(e.x,-e.y)):J(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=s,e):(a=J(this.long0+Math.atan2(e.x*r,t*this.cos_p14*o-e.y*this.sin_p14*r)),e.x=a,e.y=s,e))},names:["ortho"]},ti={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ii={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ri(e,t,i,r){var o;return e<y?(r.value=ii.AREA_0,o=0):(o=Math.atan2(t,i),Math.abs(o)<=v?r.value=ii.AREA_0:o>v&&o<=u+v?(r.value=ii.AREA_1,o-=u):o>u+v||o<=-(u+v)?(r.value=ii.AREA_2,o=o>=0?o-_:o+_):(r.value=ii.AREA_3,o+=u)),o}function oi(e,t){var i=e+t;return i<-_?i+=b:i>+_&&(i-=b),i}var ni={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-v/2?this.face=ti.TOP:this.lat0<=-(u-v/2)?this.face=ti.BOTTOM:Math.abs(this.long0)<=v?this.face=ti.FRONT:Math.abs(this.long0)<=u+v?this.face=this.long0>0?ti.RIGHT:ti.LEFT:this.face=ti.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,i,r,o,n,a,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,i=e.x,this.face===ti.TOP)o=u-t,i>=v&&i<=u+v?(l.value=ii.AREA_0,r=i-u):i>u+v||i<=-(u+v)?(l.value=ii.AREA_1,r=i>0?i-_:i+_):i>-(u+v)&&i<=-v?(l.value=ii.AREA_2,r=i+u):(l.value=ii.AREA_3,r=i);else if(this.face===ti.BOTTOM)o=u+t,i>=v&&i<=u+v?(l.value=ii.AREA_0,r=-i+u):i<v&&i>=-v?(l.value=ii.AREA_1,r=-i):i<-v&&i>=-(u+v)?(l.value=ii.AREA_2,r=-i-u):(l.value=ii.AREA_3,r=i>0?-i+_:-i-_);else{var h,c,p,d,f,y;this.face===ti.RIGHT?i=oi(i,+u):this.face===ti.BACK?i=oi(i,+_):this.face===ti.LEFT&&(i=oi(i,-u)),d=Math.sin(t),f=Math.cos(t),y=Math.sin(i),h=f*Math.cos(i),c=f*y,p=d,this.face===ti.FRONT?r=ri(o=Math.acos(h),p,c,l):this.face===ti.RIGHT?r=ri(o=Math.acos(c),p,-h,l):this.face===ti.BACK?r=ri(o=Math.acos(-h),p,-c,l):this.face===ti.LEFT?r=ri(o=Math.acos(-c),p,h,l):(o=r=0,l.value=ii.AREA_0)}return a=Math.atan(12/_*(r+Math.acos(Math.sin(r)*Math.cos(v))-u)),n=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===ii.AREA_1?a+=u:l.value===ii.AREA_2?a+=_:l.value===ii.AREA_3&&(a+=1.5*_),s.x=n*Math.cos(a),s.y=n*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,i,r,o,n,a,s,l,h,c,p,d,f={lam:0,phi:0},y={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?y.value=ii.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(y.value=ii.AREA_1,t-=u):e.x<0&&-e.x>=Math.abs(e.y)?(y.value=ii.AREA_2,t=t<0?t+_:t-_):(y.value=ii.AREA_3,t+=u),h=_/12*Math.tan(t),n=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(n),(s=1-(r=Math.cos(t))*r*(o=Math.tan(i))*o*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===ti.TOP)l=Math.acos(s),f.phi=u-l,y.value===ii.AREA_0?f.lam=a+u:y.value===ii.AREA_1?f.lam=a<0?a+_:a-_:y.value===ii.AREA_2?f.lam=a-u:f.lam=a;else if(this.face===ti.BOTTOM)l=Math.acos(s),f.phi=l-u,y.value===ii.AREA_0?f.lam=-a+u:y.value===ii.AREA_1?f.lam=-a:y.value===ii.AREA_2?f.lam=-a-u:f.lam=a<0?-a-_:-a+_;else{var m,g,v;h=(m=s)*m,g=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(a))*v)>=1?0:Math.sqrt(1-h),y.value===ii.AREA_1?(h=g,g=-v,v=h):y.value===ii.AREA_2?(g=-g,v=-v):y.value===ii.AREA_3&&(h=g,g=v,v=-h),this.face===ti.RIGHT?(h=m,m=-g,g=h):this.face===ti.BACK?(m=-m,g=-g):this.face===ti.LEFT&&(h=m,m=g,g=-h),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(g,m),this.face===ti.RIGHT?f.lam=oi(f.lam,-u):this.face===ti.BACK?f.lam=oi(f.lam,-_):this.face===ti.LEFT&&(f.lam=oi(f.lam,+u))}return 0!==this.es&&(c=f.phi<0?1:0,p=Math.tan(f.phi),d=this.b/Math.sqrt(p*p+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),c&&(f.phi=-f.phi)),f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},ai=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],si=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],li=.8487,hi=1.3523,ci=g/5,ui=1/ci,pi=18,di=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},fi=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};var yi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=J(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*ci);r<0?r=0:r>=pi&&(r=pi-1),i=g*(i-ui*r);var o={x:di(ai[r],i)*t,y:di(si[r],i)};return e.y<0&&(o.y=-o.y),o.x=o.x*this.a*li+this.x0,o.y=o.y*this.a*hi+this.y0,o},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*li),y:Math.abs(e.y-this.y0)/(this.a*hi)};if(t.y>=1)t.x/=ai[pi][0],t.y=e.y<0?-u:u;else{var i=Math.floor(t.y*pi);for(i<0?i=0:i>=pi&&(i=pi-1);;)if(si[i][0]>t.y)--i;else{if(!(si[i+1][0]<=t.y))break;++i}var r=si[i],o=5*(t.y-r[0])/(si[i+1][0]-r[0]);o=function(e,t,i,r){for(var o=t;r;--r){var n=e(o);if(o-=n,Math.abs(n)<i)break}return o}(function(e){return(di(r,e)-t.y)/fi(r,e)},o,y,100),t.x/=di(ai[i],o),t.y=(5*i+o)*m,e.y<0&&(t.y=-t.y)}return t.x=J(t.x+this.long0),t},names:["Robinson","robin"]};var mi={init:function(){this.name="geocent"},forward:function(e){return me(e,this.es,this.a)},inverse:function(e){return ge(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},gi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},vi={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var bi={init:function(){if(Object.keys(vi).forEach(function(e){if(void 0===this[e])this[e]=vi[e].def;else{if(vi[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);vi[e].num&&(this[e]=parseFloat(this[e]))}vi[e].degrees&&(this[e]=this[e]*m)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)<y?this.mode=this.lat0<0?gi.S_POLE:gi.N_POLE:Math.abs(this.lat0)<y?this.mode=gi.EQUIT:(this.mode=gi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,i,r,o,n=Math.sin(e.y),a=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case gi.OBLIQ:i=this.sinph0*n+this.cosph0*a*s;break;case gi.EQUIT:i=a*s;break;case gi.S_POLE:i=-n;break;case gi.N_POLE:i=n}switch(t=(i=this.pn1/(this.p-i))*a*Math.sin(e.x),this.mode){case gi.OBLIQ:i*=this.cosph0*n-this.sinph0*a*s;break;case gi.EQUIT:i*=n;break;case gi.N_POLE:i*=-a*s;break;case gi.S_POLE:i*=a*s}return o=1/((r=i*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-i*this.sg)*this.cw*o,i=r*o,e.x=t*this.a,e.y=i*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,i,r,o={x:e.x,y:e.y};r=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*r,i=this.pn1*e.y*this.cw*r,e.x=t*this.cg+i*this.sg,e.y=i*this.cg-t*this.sg;var n=rt(e.x,e.y);if(Math.abs(n)<y)o.x=0,o.y=e.y;else{var a,s;switch(s=1-n*n*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/n+n/this.pn1),a=Math.sqrt(1-s*s),this.mode){case gi.OBLIQ:o.y=Math.asin(a*this.sinph0+e.y*s*this.cosph0/n),e.y=(a-this.sinph0*Math.sin(o.y))*n,e.x*=s*this.cosph0;break;case gi.EQUIT:o.y=Math.asin(e.y*s/n),e.y=a*n,e.x*=s;break;case gi.N_POLE:o.y=Math.asin(a),e.y=-e.y;break;case gi.S_POLE:o.y=-Math.asin(a)}o.x=Math.atan2(e.x,e.y)}return e.x=o.x+this.long0,e.y=o.y,e},names:["Tilted_Perspective","tpers"]};var _i={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,i,r,o,n=e.x,a=e.y;if(n-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/rt(this.radius_p*Math.cos(a),Math.sin(a));if(i=s*Math.cos(n)*Math.cos(a),r=s*Math.sin(n)*Math.cos(a),o=s*Math.sin(a),(this.radius_g-i)*i-r*r-o*o*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/rt(o,t)),e.y=this.radius_g_1*Math.atan(o/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(o/rt(r,t)))}else"sphere"===this.shape&&(t=Math.cos(a),i=Math.cos(n)*t,r=Math.sin(n)*t,o=Math.sin(a),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/rt(o,t)),e.y=this.radius_g_1*Math.atan(o/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(o/rt(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,o,n=-1,a=0,s=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*rt(1,s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*rt(1,a));var l=s/this.radius_p;if(t=a*a+l*l+n*n,(r=(i=2*this.radius_g*n)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+o*n,a*=o,s*=o,e.x=Math.atan2(a,n),e.y=Math.atan(s*Math.cos(e.x)/n),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+a*a)),t=a*a+s*s+n*n,(r=(i=2*this.radius_g*n)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+o*n,a*=o,s*=o,e.x=Math.atan2(a,n),e.y=Math.atan(s*Math.cos(e.x)/n)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};Oe.defaultDatum="WGS84",Oe.Proj=ye,Oe.WGS84=new Oe.Proj("WGS84"),Oe.Point=Xe,Oe.toPoint=ke,Oe.defs=V,Oe.nadgrid=function(e,t){var i=new DataView(t),r=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),o=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:ce(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,r);o.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var n={header:o,subgrids:function(e,t,i){for(var r=[],o=0;o<t.nSubgrids;o++){var n=pe(e,176,i),a=de(e,176,n,i),s=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),l=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);r.push({ll:[he(n.lowerLongitude),he(n.lowerLatitude)],del:[he(n.longitudeInterval),he(n.latitudeInterval)],lim:[s,l],count:n.gridNodeCount,cvs:ue(a)})}return r}(i,o,r)};return se[e]=n,n},Oe.transform=Te,Oe.mgrs=Ge,Oe.version="__VERSION__",function(e){e.Proj.projections.add(tt),e.Proj.projections.add(lt),e.Proj.projections.add(ct),e.Proj.projections.add(ft),e.Proj.projections.add(yt),e.Proj.projections.add(mt),e.Proj.projections.add(vt),e.Proj.projections.add(bt),e.Proj.projections.add(_t),e.Proj.projections.add(It),e.Proj.projections.add(Dt),e.Proj.projections.add(Nt),e.Proj.projections.add(Gt),e.Proj.projections.add(Bt),e.Proj.projections.add(qt),e.Proj.projections.add(Wt),e.Proj.projections.add(Ht),e.Proj.projections.add(Yt),e.Proj.projections.add($t),e.Proj.projections.add(Xt),e.Proj.projections.add(Zt),e.Proj.projections.add(Kt),e.Proj.projections.add(Qt),e.Proj.projections.add(ei),e.Proj.projections.add(ni),e.Proj.projections.add(yi),e.Proj.projections.add(mi),e.Proj.projections.add(bi),e.Proj.projections.add(_i)}(Oe);var wi=Oe;function xi(e,t,i){let r=e.wkid,n=e.wkt,a=void 0;if(e.isWebMercator&&(r=3857),!Object(o.defined)(r)&&!Object(o.defined)(n))return new Cesium.WebMercatorTilingScheme;if(Object(o.defined)(r)){const e=o.EPSG.find(e=>e.id===r);if(!Object(o.defined)(e))return o.Log.error("根据该空间参考系的wkid未匹配到wkt值"),new Cesium.WebMercatorTilingScheme;n=e.strProject}switch(r){case 4326:case 4490:case 4610:case 4214:Object(o.defined)(i)&&!Object(o.defined)(i.lods)?a=new Cesium.GeographicTilingScheme:(Object(o.defined)(t)||(t={xmin:-180,ymin:-90,xmax:180,ymax:90}),a=new Cesium.CustomTilingScheme({wkt:n,wkid:r,proj4:wi,tileInfo:i,numberOfLevelZeroTilesX:Object(o.defined)(i)?2:1,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax)}));break;default:Object(o.defined)(i)&&!Object(o.defined)(i.lods)?a=new Cesium.WebMercatorTilingScheme:(Object(o.defined)(t)||(t={xmin:-20037508.342787,ymin:-20037508.342787,xmax:20037508.342787,ymax:20037508.342787}),a=new Cesium.CustomTilingScheme({wkt:n,wkid:r,proj4:wi,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax)}))}return a}function Ci(e,t){let i=t.imageryLayers._layers.length;for(let r=0;r<t.imageryLayers._layers.length;r++)if(t.imageryLayers._layers[r].hasOwnProperty("_realIndex")&&e._realIndex+1<t.imageryLayers._layers[r]._realIndex){i=r;break}return i}function ki(e,t){const i={...e.extent},r=e.spatialReference.wkid,n=e.spatialReference.wkt;let a=void 0;e.spatialReference.isGeographic?a=new Cesium.Rectangle(-180,-90,180,90):e.spatialReference.isWebMercator&&(a=new Cesium.Rectangle(-20037508.342787,-20037508.342787,20037508.342787,20037508.342787)),a&&(i.xmin=Cesium.Math.clamp(i.xmin,a.west,a.east),i.ymin=Cesium.Math.clamp(i.ymin,a.south,a.north),i.xmax=Cesium.Math.clamp(i.xmax,a.west,a.east),i.ymax=Cesium.Math.clamp(i.ymax,a.south,a.north));const s=o.Projection.projectPoints({originWKID:r,originDefs:n,targetWKID:4326,points:[[i.xmin,i.ymax],[i.xmax,i.ymin]]}),[l,h]=s;l[0]=Cesium.Math.toRadians(l[0]),l[1]=Cesium.Math.toRadians(l[1]),h[0]=Cesium.Math.toRadians(h[0]),h[1]=Cesium.Math.toRadians(h[1]);const c={xmin:t.west,xmax:t.east,ymin:t.south,ymax:t.north};return i.xmin=Cesium.Math.clamp(l[0],c.xmin,c.xmax),i.xmax=Cesium.Math.clamp(h[0],c.xmin,c.xmax),i.ymin=Cesium.Math.clamp(h[1],c.ymin,c.ymax),i.ymax=Cesium.Math.clamp(l[1],c.ymin,c.ymax),i}function Mi(e){let t={};return t.url=Object(o.defaultValue)(e.url,void 0),t.id=Object(o.defaultValue)(e.id,void 0),t.show=Object(o.defaultValue)(e.show,!0),t.layerIndex=Object(o.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(o.defaultValue)(e.layerRenderIndex,0),t.igserver=!0,t=Object.assign(t,e.extendOptions)}function Si(e){const t={},i=e.range,r={xMin:i.xmin,yMin:i.ymin,xMax:i.xmax,yMax:i.ymax},n=e.range3D,a={xMin:n.xmin,yMin:n.ymin,xMax:n.xmax,yMax:n.ymax,zMin:n.zmin,zMax:n.zmax};return t.scale=Object(o.defaultValue)(e.elevationScale,void 0),t.range=r,t.range3D=a,t.requestVertexNormals=Object(o.defaultValue)(e.requestVertexNormals,!1),t.sceneIndex=0,t.layerIndex=Object(o.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(o.defaultValue)(e.layerRenderIndex,0),t.show=Object(o.defaultValue)(e.show,!0),t.autoReset=Object(o.defaultValue)(e.autoReset,!0),t}function Ti(e,t){const i=(t=Object(o.defaultValue)(t,{})).sceneIndex,r=t.layerIndex,n=t.layerRenderIndex,a=Object(o.defaultValue)(t.requestVertexNormals,!1);let s;s=t.url.indexOf("/SceneServer")>-1?`${t.url}/layers/${r}/terrains?level={z}&row={x}&col={y}&xDensity=65&yDensity=65&hasNormals=${a}`:`${t.url}/GetTerrain?sceneIndex=${i}&layerIndex=${n}&Level={z}&Row={x}&Col={y}&xdensity=65&ydensity=65&webGL=true&hasNormals=${a}`;const l=new Cesium.MapGISTerrainProvider({url:s,range:t.range,scale:t.scale,requestVertexNormals:a,terrainColorTblInfo:t.terrainColorTblInfo,range3D:t.range3D,waterHeight:t.waterHeight});return e.scene.terrainProvider=l,l.type="terrain",l}function Li(e,t,i,r,n){(e=Object(o.defaultValue)(e,{})).headers&&(e.url=new Cesium.Resource({url:e.url,headers:e.headers})),e._scene=t.scene;const a=t.scene.primitives.add(new Cesium.MapGISM3DSet(e));i._layersMap.put(e.id,a),a.readyPromise.then(function(t){t.id=e.id,t.type="m3d",r&&"function"==typeof r&&r(t)}).otherwise(function(e){n&&"function"==typeof n&&n(e)})}function Ii(e,t,i){t=Object(o.defaultValue)(t,{});const r=Object(o.defaultValue)(t.duration,0),n=Object(o.defaultValue)(t.orientation,new Cesium.HeadingPitchRange(0,-.5,2.5*e.radius));i.scene.camera.flyToBoundingSphere(e,{duration:r,offset:n}),i.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}function Ei(e,t,i,r){(t=Object(o.defaultValue)(t,{})).url=e;let n=void 0;-1!==e.indexOf("igs/rest/mrfs")&&(n="MapGIS2D"),-1!==e.indexOf("igs/rest/g3d")&&(n="MapGIS3D");let a={};switch(n){case"MapGIS2D":a=new Cesium.MapGISLabelLayer(e,r.scene,t,i);break;case"MapGIS3D":t.is3d=!0,a=new Cesium.MapGISLabelLayer(e,r.scene,t,i)}return a.type="label",a}function Oi(e,t,i){let r=e.clippingArea;if(r.type!==o.GeometryType.polygon&r.type!==o.GeometryType.extent&r.type!==o.GeometryType.circle)return;r.spatialReference.isGeographic||(r=o.Projection.project(r,new o.SpatialReference({wkid:4326})));let n={};switch(r.type){case o.GeometryType.polygon:n.outerRing=r.coordinates[0],n.holes=r.coordinates.splice(1,r.coordinates.length-1);break;case o.GeometryType.circle:n.outerRing=r.toPolygon().coordinates[0],n.holes=void 0;break;case o.GeometryType.extent:const{xmin:e,xmax:t,ymin:i,ymax:a}=r;n.outerRing=[[e,i],[t,i],[t,a],[e,a],[e,i]],n.holes=void 0;break;default:n=void 0}if(!n)return;t.swipeEnabled=!0;const a=[],s=n.outerRing;for(let e=0;e<s.length;e++)a.push(Cesium.Cartesian3.fromDegrees(s[e][0],s[e][1],0));let l=void 0;if(n.holes&&n.holes.length>0){l=[];for(let e=0;e<n.holes.length;e++){const t=[];for(let i=0;i<n.holes[e].length;i++)t.push(Cesium.Cartesian3.fromDegrees(n.holes[e][i][0],n.holes[e][i][1],0));l.push(new Cesium.PolygonHierarchy(t))}}const h=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(a,l)}),c=Cesium.PolygonGeometry.createGeometry(h),u=Cesium.GeometryPipeline.createAttributeLocations(c),p=Cesium.VertexArray.fromGeometry({context:i.scene.context,geometry:c,attributeLocations:u}),d=Cesium.ShaderProgram.fromCache({context:i.scene.context,vertexShaderSource:"\n attribute vec3 position;\n void main() {\n gl_Position = czm_viewProjection * vec4(position.xyz, 1.0);\n }\n ",fragmentShaderSource:"\n void main() {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n }\n ",attributeLocations:u}),f=Cesium.RenderState.fromCache({cull:{enabled:!0,face:Cesium.CullFace.BACK}}),y=new Cesium.DrawCommand({primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:p,shaderProgram:d,castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:f}),m=i.scene.context.drawingBufferWidth,g=i.scene.context.drawingBufferHeight,v=new Cesium.Framebuffer({context:i.scene.context,colorTextures:[new Cesium.Texture({context:i.scene.context,width:m,height:g,pixelDatatype:Cesium.PixelDatatype.UNSIGNED_BYTE,pixelFormat:Cesium.PixelFormat.RGB})],destroyAttachments:!1}),b=new Cesium.PassState(i.scene.context);b.framebuffer=v,i.scene._frameState.swipeTexture=b.framebuffer.getColorTexture(0),i.scene._frameState.swiper.type=Cesium.SwipeModeType.POLYGON,i._clipPreRenderFunction=function(){i.scene.context.uniformState.updateCamera(i.camera),new Cesium.ClearCommand({color:new Cesium.Color(0,0,0,1)}).execute(i.scene.context,b),y.execute(i.scene.context,b)},i.scene.preRender.removeEventListener(i._clipPreRenderFunction),i.scene.preRender.addEventListener(i._clipPreRenderFunction)}console.log("Zondy:",o.Zondy),console.log("GeometryType:",o.GeometryType),o.Zondy.Utils.getTilingSchemeBySpatialReference=xi,o.Zondy.Utils.getExtent=ki;class Pi{}Pi.addIGSMapImageLayer=function(e,t,i){const r=xi(e.spatialReference,e.extent),n=ki(e,r.rectangle);e._setLayers();let a=e._url;"1.0"===e._igsVersion&&(a=a.replace("/mrcs/","/mrms/"));const s={url:a,httpMethod:e.httpMethod,tileWidth:e.imageWidth,tileHeight:e.imageHeight,layers:e.layers,tilingScheme:r,guid:Object(o.getGUID)(),projectionSrs:`EPSG:${e.spatialReference.wkid}`,rectangle:Cesium.Rectangle(n.xmin,n.ymin,n.xmax,n.ymax)},l=Object(o.getIGSDynamicLayer)(e);l.length>0&&(s.dynamicLayers=JSON.stringify(l));const h=Ci(e,t),c=t.imageryLayers.addImageryProvider(new Cesium.MapGISMapServerImageryProvider(s),h);return e.clippingArea&&Oi(e,c,t),c.id=e.id,c._realIndex=e._realIndex+1,c},Pi.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var ji=Pi;class Ai{}Ai.addIGSTileLayer=function(e,t){const i=xi(e.spatialReference,e.extent,e.tileInfo),r=ki(e,i.rectangle);let o=e.url;"1.0"===e._igsVersion&&(o=`${e.url}/{level}/{row}/{col}`);const n={url:o,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:i,rectangle:Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax)},a=Ci(e,t),s=t.imageryLayers.addImageryProvider(new Cesium.MapGISTileServerImageProvider(n),a);return e.clippingArea&&Oi(e,s,t),s.id=e.id,s._realIndex=e._realIndex+1,s},Ai.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Ri=Ai;class zi{}zi.getMouseEvent=function(e,t,i){let r=null;if(t._innerView.scene.globe.depthTestAgainstTerrain&&!t._innerView.scene.globe.translucency.enabled)r=t._innerView.scene.pickPosition(e.position);else{const i=t._innerView.camera.getPickRay(e.position);r=t._innerView.scene.globe.pick(i,t._innerView.scene)}if(!r)return;const n=Cesium.Cartographic.fromCartesian(r),a=Cesium.Math.toDegrees(n.longitude),s=Cesium.Math.toDegrees(n.latitude),l={mapPoint:new o.Point({coordinates:[a,s,n.height]}),x:e.position.x,y:e.position.y,type:i};return e.originalEvent&&(l.native=e.originalEvent,l.stopPropagation=e.originalEvent.stopPropagation,l.timeStamp=e.originalEvent.timeStamp,l.button=e.originalEvent.button,l.buttons=e.originalEvent.buttons),l},zi.getKeyEvent=function(e,t,i){const r={key:e.key,stopPropagation:e.stopPropagation,timeStamp:e.timeStamp,native:e,type:i};return"key-down"===i&&(r.repeat=e.repeat),r},zi.getViewChangeEvent=function(e,t,i){const r={event:e,target:t,type:i};return r.mapView=t,r.scale=t._scale,r.zoom=t._zoom,r.center=t.center,r.extent=t._extent,r},zi.getDragEvent=function(e,t,i,r,o){return{x:e.originalEvent.layerX,y:e.originalEvent.layerY,button:void 0!==o?o:e.originalEvent.button,buttons:e.originalEvent.buttons,cancelable:e.originalEvent.cancelable,origin:i,stopPropagation:e.originalEvent.stopPropagation,timeStamp:e.originalEvent.timeStamp,native:e.originalEvent,action:r,type:"drag"}},zi.getResizeEvent=function(e,t,i,r){return e};var Di=zi;class Fi{}Fi.addSceneLayer=function(e,t,i,r,o){const n=e.activeScene.sublayers;let a=0;const s=[];for(let r=0;r<n.length;r++)switch(n[r].type){case"3":let l=Si(n[r]);l.url=e.url,l=Object.assign(l,n[r].extendOptions),s.push(Ti(t,l)),a++;break;case"4":let h=`${e.url}/GetLabels`;h=`${h}?sceneIndex=0&layerIndex=${n[r].layerRenderIndex}&level=0&row=0&col=0&format=json&srsName=EPSG:4326`,a++;const c={labelLayer:n[r].labelLayer},u=Ei(h,n[r].extendOptions,c,t);i._layersMap.put(n[r].id,u),s.push(u);break;case"2":case"10":const p=Mi(n[r]);p.url=e.url,p.url.indexOf("/igs/rest/g3d/")>-1?(p.url=`${p.url}/GetDataStreams?sceneIndex=0&layerIndex=${n[r].layerRenderIndex}&Level=0&Row=0&Col=0`,Li(p,t,i,function(e){a++,s.push(e),p.autoReset&&Ii(e.boundingSphere,p,t)},o)):p.url.indexOf("/igs/rest/services/")>-1&&p.url.indexOf("/SceneServer")>-1&&Li(p,t,i,function(e){a++,s.push(e),p.autoReset&&Ii(e.boundingSphere,p,t)},o)}const l=setInterval(function(){a===n.length&&r&&r instanceof Function&&(clearInterval(l),r(s))},50)},Fi.removeLayer=function(e,t,i){for(let r=0;r<e.length;r++)switch(e[r].type){case"m3d":t._layersMap.remove(e[r].id),i.scene.primitives.removeAndDestroy(e[r]);break;case"terrain":i.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider;break;case"label":e[r].destroy(!0),t._layersMap.remove(e[r].id)}e=[]};var Ni=Fi;class Gi{}Gi.addCesium3DTilesLayer=function(e,t,i){const r=Object.assign({show:e.visible},e.extendOptions);r.loaded=function(t){t.id=e.id,i(t)},e.layerIndex=t.scene.layers.appendCesium3DTilesetLayer(e.url,r)},Gi.removeLayer=function(e,t){t.scene.layers.removeCesium3DTilesetLayerByID(e.layerIndex)};var Vi=Gi;class Bi{}Bi.addM3DLayer=function(e,t,i,r,o){const n=Mi(e);n.url=e.url,e.url.indexOf("/igs/rest/services/")>-1?n.igserver=!0:n.igserver=!1,Li(n,t,i,function(e){n.autoReset&&Ii(e.boundingSphere,n,t),r(e)},o)},Bi.removeLayer=function(e,t,i){i._layersMap.remove(e.id),t.scene.primitives.removeAndDestroy(e)};var qi=Bi,Ui=i(4);function Wi(e,t){let i;return e.some(function(e){if(e.id==t)return i=e.source,!0}),i}const Hi=/font-family: ?([^;]*);/,Yi=/("|')/g;let Ji;const $i={},Xi=i.n(Ui).a.getNames();function Zi(e){if(e in $i)return $i[e];const t=e.map(function(e){return mb2css(e,1).split(" 1px ")[1].replace(/"/g,"")})[0];if(!function(e){if(!Ji){Ji={};const e=document.styleSheets;for(let t=0,i=e.length;t<i;++t){const i=e[t];try{const e=i.rules||i.cssRules;if(e)for(let t=0,i=e.length;t<i;++t){const i=e[t];if(5==i.type){const e=i.cssText.match(Hi);Ji[e[1].replace(Yi,"")]=!0}}}catch(e){}}}return e in Ji}(t)&&-1!==Xi.indexOf(t)){const e="https://fonts.googleapis.com/css?family="+t.replace(/ /g,"+");if(!document.querySelector('link[href="'+e+'"]')){const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(t)}}return e}function Ki(){return function(){throw new Error("Unimplemented abstract method.")}()}var Qi=0;function er(e){return e.ol_uid||(e.ol_uid=String(++Qi))}var tr="5.3.3",ir=function(e){function t(t){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===tr?tr:"v"+tr.split("-")[0])+"/doc/errors/#"+t+" for details.";e.call(this,i),this.code=t,this.name="AssertionError",this.message=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error);function rr(e,t){if(!e)throw new ir(t)}var or={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};function nr(e,t,i){return Math.min(Math.max(e,t),i)}var ar="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};function sr(e,t,i,r,o,n){var a=o-i,s=n-r;if(0!==a||0!==s){var l=((e-i)*a+(t-r)*s)/(a*a+s*s);l>1?(i=o,r=n):l>0&&(i+=a*l,r+=s*l)}return lr(e,t,i,r)}function lr(e,t,i,r){var o=i-e,n=r-t;return o*o+n*n}function hr(e,t,i){return e+i*(t-e)}var cr=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ur=/^([a-z]*)$/i;function pr(e){return"string"==typeof e?e:yr(e)}var dr=function(){var e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){var o=0;for(var n in e)0==(3&o++)&&(delete e[n],--t)}r=function(e){var t,i,r,o,n;ur.exec(e)&&(e=function(e){var t=document.createElement("div");if(t.style.color=e,""!==t.style.color){document.body.appendChild(t);var i=getComputedStyle(t).color;return document.body.removeChild(t),i}return""}(e));if(cr.exec(e)){var a,s=e.length-1;a=s<=4?1:2;var l=4===s||8===s;t=parseInt(e.substr(1+0*a,a),16),i=parseInt(e.substr(1+1*a,a),16),r=parseInt(e.substr(1+2*a,a),16),o=l?parseInt(e.substr(1+3*a,a),16):255,1==a&&(t=(t<<4)+t,i=(i<<4)+i,r=(r<<4)+r,l&&(o=(o<<4)+o)),n=[t,i,r,o/255]}else 0==e.indexOf("rgba(")?fr(n=e.slice(5,-1).split(",").map(Number)):0==e.indexOf("rgb(")?((n=e.slice(4,-1).split(",").map(Number)).push(1),fr(n)):rr(!1,14);return n}(i),e[i]=r,++t}return r}}();function fr(e){return e[0]=nr(e[0]+.5|0,0,255),e[1]=nr(e[1]+.5|0,0,255),e[2]=nr(e[2]+.5|0,0,255),e[3]=nr(e[3],0,1),e}function yr(e){var t=e[0];t!=(0|t)&&(t=t+.5|0);var i=e[1];i!=(0|i)&&(i=i+.5|0);var r=e[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+t+","+i+","+r+","+(void 0===e[3]?1:e[3])+")"}function mr(e){return Array.isArray(e)?yr(e):e}function gr(e,t){var i=document.createElement("canvas");return e&&(i.width=e),t&&(i.height=t),i.getContext("2d")}var vr="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",br=(vr.indexOf("firefox"),-1!==vr.indexOf("safari")&&vr.indexOf("chrom"),-1!==vr.indexOf("webkit")&&vr.indexOf("edge"),vr.indexOf("macintosh"),window.devicePixelRatio,function(){var e=!1;try{e=!!document.createElement("canvas").getContext("2d").setLineDash}catch(e){}return e}()),_r=(navigator,window,window,navigator.msPointerEnabled,{IDLE:0,LOADING:1,LOADED:2,ERROR:3}),wr=function(){var e,t={};return function(i){if(e||(e=document.createElement("div").style),!(i in t)){e.font=i;var r=e.fontFamily;if(e.font="",!r)return null;t[i]=r.split(/,\s?/)}return t[i]}}(),xr="function"==typeof Object.assign?Object.assign:function(e,t){var i=arguments;if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),o=1,n=arguments.length;o<n;++o){var a=i[o];if(void 0!==a&&null!==a)for(var s in a)a.hasOwnProperty(s)&&(r[s]=a[s])}return r};function Cr(e){for(var t in e)delete e[t]}function kr(e){var t;for(t in e)return!1;return!t}var Mr=function(){this.disposed_=!1};Mr.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},Mr.prototype.disposeInternal=function(){};var Sr=Mr;function Tr(e,t,i,r){for(var o,n=0,a=e.length;n<a;++n)if((o=e[n]).listener===t&&o.bindTo===i)return r&&(o.deleteIndex=n),o}function Lr(e,t){var i=Ir(e);return i?i[t]:void 0}function Ir(e,t){var i=e.ol_lm;return!i&&t&&(i=e.ol_lm={}),i}function Er(e,t){var i=Lr(e,t);if(i){for(var r=0,o=i.length;r<o;++r)e.removeEventListener(t,i[r].boundListener),Cr(i[r]);i.length=0;var n=Ir(e);n&&(delete n[t],0===Object.keys(n).length&&function(e){delete e.ol_lm}(e))}}function Or(e,t,i,r,o){var n=Ir(e,!0),a=n[t];a||(a=n[t]=[]);var s=Tr(a,i,r,!1);return s?o||(s.callOnce=!1):(s={bindTo:r,callOnce:!!o,listener:i,target:e,type:t},e.addEventListener(t,function(e){var t=function(t){var i=e.listener,r=e.bindTo||e.target;return e.callOnce&&Ar(e),i.call(r,t)};return e.boundListener=t,t}(s)),a.push(s)),s}function Pr(e,t,i,r){return Or(e,t,i,r,!0)}function jr(e,t,i,r){var o=Lr(e,t);if(o){var n=Tr(o,i,r,!0);n&&Ar(n)}}function Ar(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=Lr(e.target,e.type);if(t){var i="deleteIndex"in e?e.deleteIndex:t.indexOf(e);-1!==i&&t.splice(i,1),0===t.length&&Er(e.target,e.type)}Cr(e)}}function Rr(){}var zr=function(e){this.propagationStopped,this.type=e,this.target=null};zr.prototype.preventDefault=function(){this.propagationStopped=!0},zr.prototype.stopPropagation=function(){this.propagationStopped=!0};var Dr=zr,Fr=function(e){function t(){e.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addEventListener=function(e,t){var i=this.listeners_[e];i||(i=this.listeners_[e]=[]),-1===i.indexOf(t)&&i.push(t)},t.prototype.dispatchEvent=function(e){var t="string"==typeof e?new Dr(e):e,i=t.type;t.target=this;var r,o=this.listeners_[i];if(o){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var n=0,a=o.length;n<a;++n)if(!1===o[n].call(this,t)||t.propagationStopped){r=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var s=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];s--;)this.removeEventListener(i,Rr);delete this.dispatching_[i]}return r}},t.prototype.disposeInternal=function(){!function(e){var t=Ir(e);if(t)for(var i in t)Er(e,i)}(this)},t.prototype.getListeners=function(e){return this.listeners_[e]},t.prototype.hasListener=function(e){return e?e in this.listeners_:Object.keys(this.listeners_).length>0},t.prototype.removeEventListener=function(e,t){var i=this.listeners_[e];if(i){var r=i.indexOf(t);e in this.pendingRemovals_?(i[r]=Rr,++this.pendingRemovals_[e]):(i.splice(r,1),0===i.length&&delete this.listeners_[e])}},t}(Sr),Nr="change",Gr="clear",Vr="error",Br="load",qr=function(e){function t(t){e.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Gr)},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e,t){for(var i=this.oldest_;i;)e.call(t,i.value_,i.key_,this),i=i.newer},t.prototype.get=function(e){var t=this.entries_[e];return rr(void 0!==t,15),t===this.newest_?t.value_:(t===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(t.newer.older=t.older,t.older.newer=t.newer),t.newer=null,t.older=this.newest_,this.newest_.newer=t,this.newest_=t,t.value_)},t.prototype.remove=function(e){var t=this.entries_[e];return rr(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t},t.prototype.getValues=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},t.prototype.set=function(e,t){rr(!(e in this.entries_),16);var i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t}(Fr);new Array(6);function Ur(e,t){var i=t[0],r=t[1];return t[0]=e[0]*i+e[2]*r+e[4],t[1]=e[1]*i+e[3]*r+e[5],t}function Wr(e,t,i,r,o,n,a,s){var l=Math.sin(n),h=Math.cos(n);return e[0]=r*h,e[1]=o*l,e[2]=-r*l,e[3]=o*h,e[4]=a*r*h-s*r*l+t,e[5]=a*o*l+s*o*h+i,e}var Hr=[0,0,0,1],Yr=[],Jr=[0,0,0,1],$r=[0,0,0,0],Xr=new qr,Zr={},Kr=null,Qr={},eo=function(){var e,t,i=60,r=Zr,o="32px ",n=["monospace","serif"],a=n.length,s="wmytzilWMYTZIL@#/&?$%10";function l(e){for(var i=to(),r=100;r<=700;r+=300){for(var l=r+" ",h=!0,c=0;c<a;++c){var u=n[c];if(i.font=l+o+u,t=i.measureText(s).width,e!=u){i.font=l+o+e+","+u;var p=i.measureText(s).width;h=h&&p!=t}}if(h)return!0}return!1}function h(){var t=!0;for(var o in r)r[o]<i&&(l(o)?(r[o]=i,Cr(Qr),Kr=null,Xr.clear()):(++r[o],t=!1));t&&(clearInterval(e),e=void 0)}return function(t){var o=wr(t);if(o)for(var n=0,a=o.length;n<a;++n){var s=o[n];s in r||(r[s]=i,l(s)||(r[s]=0,void 0===e&&(e=setInterval(h,32))))}}}();function to(){return Kr||(Kr=gr(1,1)),Kr}var io=function(){var e,t=Qr;return function(i){var r=t[i];return void 0==r&&(e||((e=document.createElement("span")).textContent="M",e.style.margin=e.style.padding="0 !important",e.style.position="absolute !important",e.style.left="-99999px !important"),e.style.font=i,document.body.appendChild(e),r=t[i]=e.offsetHeight,document.body.removeChild(e)),r}}();function ro(e,t){var i=to();return e!=i.font&&(i.font=e),i.measureText(t).width}var oo=[1,0,0,1,0,0];function no(e,t,i,r,o,n,a,s,l,h,c){var u;1!=i&&(u=e.globalAlpha,e.globalAlpha=u*i),t&&e.setTransform.apply(e,t),e.drawImage(r,o,n,a,s,l,h,a*c,s*c),u&&(e.globalAlpha=u),t&&e.setTransform.apply(e,oo)}var ao=function(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale};ao.prototype.clone=function(){return new ao({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},ao.prototype.getOpacity=function(){return this.opacity_},ao.prototype.getRotateWithView=function(){return this.rotateWithView_},ao.prototype.getRotation=function(){return this.rotation_},ao.prototype.getScale=function(){return this.scale_},ao.prototype.getSnapToPixel=function(){return!1},ao.prototype.getAnchor=function(){return Ki()},ao.prototype.getImage=function(e){return Ki()},ao.prototype.getHitDetectionImage=function(e){return Ki()},ao.prototype.getImageState=function(){return Ki()},ao.prototype.getImageSize=function(){return Ki()},ao.prototype.getHitDetectionImageSize=function(){return Ki()},ao.prototype.getOrigin=function(){return Ki()},ao.prototype.getSize=function(){return Ki()},ao.prototype.setOpacity=function(e){this.opacity_=e},ao.prototype.setRotateWithView=function(e){this.rotateWithView_=e},ao.prototype.setRotation=function(e){this.rotation_=e},ao.prototype.setScale=function(e){this.scale_=e},ao.prototype.setSnapToPixel=function(e){},ao.prototype.listenImageChange=function(e,t){return Ki()},ao.prototype.load=function(){Ki()},ao.prototype.unlistenImageChange=function(e,t){Ki()};var so=ao,lo=function(e){function t(t){var i=t||{};e.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,atlasManager:i.atlasManager})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.setRadius=function(e){this.radius_=e,this.render_(this.atlasManager_)},t}(function(e){function t(t){var i=void 0!==t.rotateWithView&&t.rotateWithView;e.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==t.rotation?t.rotation:0,scale:1}),this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t.prototype.getAnchor=function(){return this.anchor_},t.prototype.getAngle=function(){return this.angle_},t.prototype.getFill=function(){return this.fill_},t.prototype.getHitDetectionImage=function(e){return this.hitDetectionCanvas_},t.prototype.getImage=function(e){return this.canvas_},t.prototype.getImageSize=function(){return this.imageSize_},t.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},t.prototype.getImageState=function(){return _r.LOADED},t.prototype.getOrigin=function(){return this.origin_},t.prototype.getPoints=function(){return this.points_},t.prototype.getRadius=function(){return this.radius_},t.prototype.getRadius2=function(){return this.radius2_},t.prototype.getSize=function(){return this.size_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.listenImageChange=function(e,t){},t.prototype.load=function(){},t.prototype.unlistenImageChange=function(e,t){},t.prototype.render_=function(e){var t,i,r="",o="",n=0,a=null,s=0,l=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=Jr),i=mr(i),void 0===(l=this.stroke_.getWidth())&&(l=1),a=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),br||(a=null,s=0),void 0===(o=this.stroke_.getLineJoin())&&(o="round"),void 0===(r=this.stroke_.getLineCap())&&(r="round"),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var h=2*(this.radius_+l)+1,c={strokeStyle:i,strokeWidth:l,size:h,lineCap:r,lineDash:a,lineDashOffset:s,lineJoin:o,miterLimit:n};if(void 0===e){var u=gr(h,h);this.canvas_=u.canvas,t=h=this.canvas_.width,this.draw_(c,u,0,0),this.createHitDetectionCanvas_(c)}else{h=Math.round(h);var p,d=!this.fill_;d&&(p=this.drawHitDetectionCanvas_.bind(this,c));var f=this.getChecksum(),y=e.add(f,h,h,this.draw_.bind(this,c),p);this.canvas_=y.image,this.origin_=[y.offsetX,y.offsetY],t=y.image.width,d?(this.hitDetectionCanvas_=y.hitImage,this.hitDetectionImageSize_=[y.hitImage.width,y.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[t,t])}this.anchor_=[h/2,h/2],this.size_=[h,h],this.imageSize_=[t,t]},t.prototype.draw_=function(e,t,i,r){var o,n,a;t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var s=this.points_;if(s===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(s*=2),o=0;o<=s;o++)n=2*o*Math.PI/s-Math.PI/2+this.angle_,a=o%2==0?this.radius_:l,t.lineTo(e.size/2+a*Math.cos(n),e.size/2+a*Math.sin(n))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=Hr),t.fillStyle=mr(h),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke()),t.closePath()},t.prototype.createHitDetectionCanvas_=function(e){if(this.hitDetectionImageSize_=[e.size,e.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var t=gr(e.size,e.size);this.hitDetectionCanvas_=t.canvas,this.drawHitDetectionCanvas_(e,t,0,0)}},t.prototype.drawHitDetectionCanvas_=function(e,t,i,r){t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var o=this.points_;if(o===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var n,a,s,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(o*=2),n=0;n<=o;n++)s=2*n*Math.PI/o-Math.PI/2+this.angle_,a=n%2==0?this.radius_:l,t.lineTo(e.size/2+a*Math.cos(s),e.size/2+a*Math.sin(s))}t.fillStyle=pr(Hr),t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.stroke()),t.closePath()},t.prototype.getChecksum=function(){var e=this.stroke_?this.stroke_.getChecksum():"-",t=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||e!=this.checksums_[1]||t!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+e+t+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,e,t,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},t}(so)),ho=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.checksum_=void 0};ho.prototype.clone=function(){var e=this.getColor();return new ho({color:Array.isArray(e)?e.slice():e||void 0})},ho.prototype.getColor=function(){return this.color_},ho.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},ho.prototype.getChecksum=function(){if(void 0===this.checksum_){var e=this.color_;e?Array.isArray(e)||"string"==typeof e?this.checksum_="f"+pr(e):this.checksum_=er(this.color_):this.checksum_="f-"}return this.checksum_};var co=ho,uo=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width,this.checksum_=void 0};uo.prototype.clone=function(){var e=this.getColor();return new uo({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},uo.prototype.getColor=function(){return this.color_},uo.prototype.getLineCap=function(){return this.lineCap_},uo.prototype.getLineDash=function(){return this.lineDash_},uo.prototype.getLineDashOffset=function(){return this.lineDashOffset_},uo.prototype.getLineJoin=function(){return this.lineJoin_},uo.prototype.getMiterLimit=function(){return this.miterLimit_},uo.prototype.getWidth=function(){return this.width_},uo.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},uo.prototype.setLineCap=function(e){this.lineCap_=e,this.checksum_=void 0},uo.prototype.setLineDash=function(e){this.lineDash_=e,this.checksum_=void 0},uo.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e,this.checksum_=void 0},uo.prototype.setLineJoin=function(e){this.lineJoin_=e,this.checksum_=void 0},uo.prototype.setMiterLimit=function(e){this.miterLimit_=e,this.checksum_=void 0},uo.prototype.setWidth=function(e){this.width_=e,this.checksum_=void 0},uo.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=er(this.color_):this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var po=uo,fo=function(e){var t=e||{};this.geometry_=null,this.geometryFunction_=yo,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex};fo.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new fo({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},fo.prototype.getRenderer=function(){return this.renderer_},fo.prototype.setRenderer=function(e){this.renderer_=e},fo.prototype.getGeometry=function(){return this.geometry_},fo.prototype.getGeometryFunction=function(){return this.geometryFunction_},fo.prototype.getFill=function(){return this.fill_},fo.prototype.setFill=function(e){this.fill_=e},fo.prototype.getImage=function(){return this.image_},fo.prototype.setImage=function(e){this.image_=e},fo.prototype.getStroke=function(){return this.stroke_},fo.prototype.setStroke=function(e){this.stroke_=e},fo.prototype.getText=function(){return this.text_},fo.prototype.setText=function(e){this.text_=e},fo.prototype.getZIndex=function(){return this.zIndex_},fo.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=yo,this.geometry_=e},fo.prototype.setZIndex=function(e){this.zIndex_=e};function yo(e){return e.getGeometry()}var mo=fo,go={FRACTION:"fraction",PIXELS:"pixels"},vo=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function bo(e,t,i){return t+":"+e+":"+(i?pr(i):"null")}vo.prototype.clear=function(){this.cache_={},this.cacheSize_=0},vo.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var e=0;for(var t in this.cache_){var i=this.cache_[t];0!=(3&e++)||i.hasListener()||(delete this.cache_[t],--this.cacheSize_)}}},vo.prototype.get=function(e,t,i){var r=bo(e,t,i);return r in this.cache_?this.cache_[r]:null},vo.prototype.set=function(e,t,i,r){var o=bo(e,t,i);this.cache_[o]=r,++this.cacheSize_},vo.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()};var _o=new vo,wo=function(e){function t(t,i,r,o,n,a){e.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==o&&(this.image_.crossOrigin=o),this.canvas_=a?document.createElement("canvas"):null,this.color_=a,this.imageListenerKeys_=null,this.imageState_=n,this.size_=r,this.src_=i,this.tainted_}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===_r.LOADED){this.tainted_=!1;var e=gr(1,1);try{e.drawImage(this.image_,0,0),e.getImageData(0,0,1,1)}catch(e){this.tainted_=!0}}return!0===this.tainted_},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Nr)},t.prototype.handleImageError_=function(){this.imageState_=_r.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=_r.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.replaceColor_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(e){return this.canvas_?this.canvas_:this.image_},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(e){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],i=this.size_[1],r=gr(t,i);r.fillRect(0,0,t,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==_r.IDLE){this.imageState_=_r.LOADING,this.imageListenerKeys_=[Pr(this.image_,Vr,this.handleImageError_,this),Pr(this.image_,Br,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(e){this.handleImageError_()}}},t.prototype.replaceColor_=function(){if(this.color_&&!this.isTainted_()){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var e=this.canvas_.getContext("2d");e.drawImage(this.image_,0,0);for(var t=e.getImageData(0,0,this.image_.width,this.image_.height),i=t.data,r=this.color_[0]/255,o=this.color_[1]/255,n=this.color_[2]/255,a=0,s=i.length;a<s;a+=4)i[a]*=r,i[a+1]*=o,i[a+2]*=n;e.putImageData(t,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ar),this.imageListenerKeys_=null},t}(Fr);var xo={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Co=function(e){function t(t){var i=t||{},r=void 0!==i.opacity?i.opacity:1,o=void 0!==i.rotation?i.rotation:0,n=void 0!==i.scale?i.scale:1,a=void 0!==i.rotateWithView&&i.rotateWithView;e.call(this,{opacity:r,rotation:o,scale:n,rotateWithView:a}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:xo.TOP_LEFT,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:go.FRACTION,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:go.FRACTION,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,l=void 0!==i.imgSize?i.imgSize:null,h=i.src;rr(!(void 0!==h&&s),4),rr(!s||s&&l,5),void 0!==h&&0!==h.length||!s||(h=s.src||er(s)),rr(void 0!==h&&h.length>0,6);var c=void 0!==i.src?_r.IDLE:_r.LOADED;this.color_=void 0!==i.color?function(e){return Array.isArray(e)?e:dr(e)}(i.color):null,this.iconImage_=function(e,t,i,r,o,n){var a=_o.get(t,r,n);return a||(a=new wo(e,t,i,r,o,n),_o.set(t,r,n,a)),a}(s,h,l,this.crossOrigin_,c,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:xo.TOP_LEFT,this.origin_=null,this.size_=void 0!==i.size?i.size:null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var e=this.anchor_,t=this.getSize();if(this.anchorXUnits_==go.FRACTION||this.anchorYUnits_==go.FRACTION){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==go.FRACTION&&(e[0]*=t[0]),this.anchorYUnits_==go.FRACTION&&(e[1]*=t[1])}if(this.anchorOrigin_!=xo.TOP_LEFT){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),this.anchorOrigin_!=xo.TOP_RIGHT&&this.anchorOrigin_!=xo.BOTTOM_RIGHT||(e[0]=-e[0]+t[0]),this.anchorOrigin_!=xo.BOTTOM_LEFT&&this.anchorOrigin_!=xo.BOTTOM_RIGHT||(e[1]=-e[1]+t[1])}return this.normalizedAnchor_=e,this.normalizedAnchor_},t.prototype.setAnchor=function(e){this.anchor_=e,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(e){return this.iconImage_.getImage(e)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(e){return this.iconImage_.getHitDetectionImage(e)},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var e=this.offset_;if(this.offsetOrigin_!=xo.TOP_LEFT){var t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),this.offsetOrigin_!=xo.TOP_RIGHT&&this.offsetOrigin_!=xo.BOTTOM_RIGHT||(e[0]=i[0]-t[0]-e[0]),this.offsetOrigin_!=xo.BOTTOM_LEFT&&this.offsetOrigin_!=xo.BOTTOM_RIGHT||(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(e,t){return Or(this.iconImage_,Nr,e,t)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(e,t){jr(this.iconImage_,Nr,e,t)},t}(so),ko="point",Mo="line",So=function(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new co({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:ko,this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding};So.prototype.clone=function(){return new So({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0})},So.prototype.getOverflow=function(){return this.overflow_},So.prototype.getFont=function(){return this.font_},So.prototype.getMaxAngle=function(){return this.maxAngle_},So.prototype.getPlacement=function(){return this.placement_},So.prototype.getOffsetX=function(){return this.offsetX_},So.prototype.getOffsetY=function(){return this.offsetY_},So.prototype.getFill=function(){return this.fill_},So.prototype.getRotateWithView=function(){return this.rotateWithView_},So.prototype.getRotation=function(){return this.rotation_},So.prototype.getScale=function(){return this.scale_},So.prototype.getStroke=function(){return this.stroke_},So.prototype.getText=function(){return this.text_},So.prototype.getTextAlign=function(){return this.textAlign_},So.prototype.getTextBaseline=function(){return this.textBaseline_},So.prototype.getBackgroundFill=function(){return this.backgroundFill_},So.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},So.prototype.getPadding=function(){return this.padding_},So.prototype.setOverflow=function(e){this.overflow_=e},So.prototype.setFont=function(e){this.font_=e},So.prototype.setMaxAngle=function(e){this.maxAngle_=e},So.prototype.setOffsetX=function(e){this.offsetX_=e},So.prototype.setOffsetY=function(e){this.offsetY_=e},So.prototype.setPlacement=function(e){this.placement_=e},So.prototype.setFill=function(e){this.fill_=e},So.prototype.setRotation=function(e){this.rotation_=e},So.prototype.setScale=function(e){this.scale_=e},So.prototype.setStroke=function(e){this.stroke_=e},So.prototype.setText=function(e){this.text_=e},So.prototype.setTextAlign=function(e){this.textAlign_=e},So.prototype.setTextBaseline=function(e){this.textBaseline_=e},So.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},So.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},So.prototype.setPadding=function(e){this.padding_=e};var To=So,Lo={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Io(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function Eo(e,t,i){var r,o;return(r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*r+(o=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*o}function Oo(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function Po(e,t){var i=e[0],r=e[1],o=e[2],n=e[3],a=t[0],s=t[1],l=Lo.UNKNOWN;return a<i?l|=Lo.LEFT:a>o&&(l|=Lo.RIGHT),s<r?l|=Lo.BELOW:s>n&&(l|=Lo.ABOVE),l===Lo.UNKNOWN&&(l=Lo.INTERSECTING),l}function jo(e,t,i,r,o){return o?(o[0]=e,o[1]=t,o[2]=i,o[3]=r,o):[e,t,i,r]}function Ao(e){return jo(1/0,1/0,-1/0,-1/0,e)}function Ro(e,t){var i=e[0],r=e[1];return jo(i,r,i,r,t)}function zo(e,t,i,r,o){return Fo(Ao(o),e,t,i,r)}function Do(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function Fo(e,t,i,r,o){for(;i<r;i+=o)No(e,t[i],t[i+1]);return e}function No(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function Go(e){return[e[0],e[1]]}function Vo(e){return[e[2],e[1]]}function Bo(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function qo(e){return e[3]-e[1]}function Uo(e){return[e[0],e[3]]}function Wo(e){return[e[2],e[3]]}function Ho(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Yo(e,t,i){var r=[e[0],e[1],e[0],e[3],e[2],e[1],e[2],e[3]];return t(r,r,2),function(e,t,i){return jo(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),i)}([r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]],i)}var Jo="propertychange";var $o=function(e){function t(){e.call(this),this.revision_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.changed=function(){++this.revision_,this.dispatchEvent(Nr)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),o=0;o<i;++o)r[o]=Or(this,e[o],t);return r}return Or(this,e,t)},t.prototype.once=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),o=0;o<i;++o)r[o]=Pr(this,e[o],t);return r}return Pr(this,e,t)},t.prototype.un=function(e,t){if(Array.isArray(e))for(var i=0,r=e.length;i<r;++i)jr(this,e[i],t);else jr(this,e,t)},t}(Fr),Xo=function(e){function t(t,i,r){e.call(this,t),this.key=i,this.oldValue=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Dr),Zo=function(e){function t(t){e.call(this),er(this),this.values_={},void 0!==t&&this.setProperties(t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t.prototype.getKeys=function(){return Object.keys(this.values_)},t.prototype.getProperties=function(){return xr({},this.values_)},t.prototype.notify=function(e,t){var i;i=function(e){return Ko.hasOwnProperty(e)?Ko[e]:Ko[e]="change:"+e}(e),this.dispatchEvent(new Xo(i,e,t)),i=Jo,this.dispatchEvent(new Xo(i,e,t))},t.prototype.set=function(e,t,i){if(i)this.values_[e]=t;else{var r=this.values_[e];this.values_[e]=t,r!==t&&this.notify(e,r)}},t.prototype.setProperties=function(e,t){for(var i in e)this.set(i,e[i],t)},t.prototype.unset=function(e,t){if(e in this.values_){var i=this.values_[e];delete this.values_[e],t||this.notify(e,i)}},t}($o),Ko={};var Qo=Zo;function en(e,t,i,r,o,n){for(var a=n||[],s=0,l=t;l<i;l+=r){var h=e[l],c=e[l+1];a[s++]=o[0]*h+o[2]*c+o[4],a[s++]=o[1]*h+o[3]*c+o[5]}return n&&a.length!=s&&(a.length=s),a}var tn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},rn={};rn[tn.DEGREES]=2*Math.PI*6370997/360,rn[tn.FEET]=.3048,rn[tn.METERS]=1,rn[tn.USFEET]=1200/3937;var on=tn,nn=function(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit};nn.prototype.canWrapX=function(){return this.canWrapX_},nn.prototype.getCode=function(){return this.code_},nn.prototype.getExtent=function(){return this.extent_},nn.prototype.getUnits=function(){return this.units_},nn.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||rn[this.units_]},nn.prototype.getWorldExtent=function(){return this.worldExtent_},nn.prototype.getAxisOrientation=function(){return this.axisOrientation_},nn.prototype.isGlobal=function(){return this.global_},nn.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},nn.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},nn.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},nn.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},nn.prototype.setWorldExtent=function(e){this.worldExtent_=e},nn.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},nn.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var an=nn,sn=6378137,ln=Math.PI*sn,hn=[-ln,-ln,ln,ln],cn=[-180,-85,180,85],un=function(e){function t(t){e.call(this,{code:t,units:on.METERS,extent:hn,global:!0,worldExtent:cn,getPointResolution:function(e,t){return e/ar(t[1]/sn)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(an),pn=[new un("EPSG:3857"),new un("EPSG:102100"),new un("EPSG:102113"),new un("EPSG:900913"),new un("urn:ogc:def:crs:EPSG:6.18:3:3857"),new un("urn:ogc:def:crs:EPSG::3857"),new un("http://www.opengis.net/gml/srs/epsg.xml#3857")];function dn(e,t,i){var r=e.length,o=i>1?i:2,n=t;void 0===n&&(n=o>2?e.slice():new Array(r));for(var a=ln,s=0;s<r;s+=o){n[s]=a*e[s]/180;var l=sn*Math.log(Math.tan(Math.PI*(e[s+1]+90)/360));l>a?l=a:l<-a&&(l=-a),n[s+1]=l}return n}function fn(e,t,i){var r=e.length,o=i>1?i:2,n=t;void 0===n&&(n=o>2?e.slice():new Array(r));for(var a=0;a<r;a+=o)n[a]=180*e[a]/ln,n[a+1]=360*Math.atan(Math.exp(e[a+1]/sn))/Math.PI-90;return n}var yn=[-180,-90,180,90],mn=6378137*Math.PI/180,gn=function(e){function t(t,i){e.call(this,{code:t,units:on.DEGREES,extent:yn,axisOrientation:i,global:!0,metersPerUnit:mn,worldExtent:yn})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(an),vn=[new gn("CRS:84"),new gn("EPSG:4326","neu"),new gn("urn:ogc:def:crs:EPSG::4326","neu"),new gn("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new gn("urn:ogc:def:crs:OGC:1.3:CRS84"),new gn("urn:ogc:def:crs:OGC:2:84"),new gn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new gn("urn:x-ogc:def:crs:EPSG:4326","neu")],bn={};var _n={};function wn(e,t,i){var r=e.getCode(),o=t.getCode();r in _n||(_n[r]={}),_n[r][o]=i}function xn(e,t,i){var r;if(void 0!==t){for(var o=0,n=e.length;o<n;++o)t[o]=e[o];r=t}else r=e.slice();return r}function Cn(e,t,i){if(void 0!==t&&e!==t){for(var r=0,o=e.length;r<o;++r)t[r]=e[r];e=t}return e}function kn(e){!function(e,t){bn[e]=t}(e.getCode(),e),wn(e,e,xn)}function Mn(e){return"string"==typeof e?function(e){return bn[e]||null}(e):e||null}function Sn(e){!function(e){e.forEach(kn)}(e),e.forEach(function(t){e.forEach(function(e){t!==e&&wn(t,e,xn)})})}function Tn(e,t){var i=function(e,t){var i;return e in _n&&t in _n[e]&&(i=_n[e][t]),i}(e.getCode(),t.getCode());return i||(i=Cn),i}function Ln(e,t){return Tn(Mn(e),Mn(t))}Sn(pn),Sn(vn),function(e,t,i,r){e.forEach(function(e){t.forEach(function(t){wn(e,t,i),wn(t,e,r)})})}(vn,pn,dn,fn);var In=[1,0,0,1,0,0],En={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function On(e){var t;return e==En.XY?t=2:e==En.XYZ||e==En.XYM?t=3:e==En.XYZM&&(t=4),t}var Pn=function(e){function t(){e.call(this),this.layout=En.XY,this.stride=2,this.flatCoordinates=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeExtent=function(e){return zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Ki()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!=this.getRevision()&&(Cr(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var t=e.toString();if(this.simplifiedGeometryCache.hasOwnProperty(t))return this.simplifiedGeometryCache[t];var i=this.getSimplifiedGeometryInternal(e);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[t]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)},t.prototype.getSimplifiedGeometryInternal=function(e){return this},t.prototype.getStride=function(){return this.stride},t.prototype.setFlatCoordinates=function(e,t){this.stride=On(e),this.layout=e,this.flatCoordinates=t},t.prototype.setCoordinates=function(e,t){Ki()},t.prototype.setLayout=function(e,t,i){var r;if(e)r=On(e);else{for(var o=0;o<i;++o){if(0===t.length)return this.layout=En.XY,void(this.stride=2);t=t[0]}e=function(e){var t;2==e?t=En.XY:3==e?t=En.XYZ:4==e&&(t=En.XYZM);return t}(r=t.length)}this.layout=e,this.stride=r},t.prototype.applyTransform=function(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t.prototype.rotate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,o,n,a){for(var s=a||[],l=Math.cos(o),h=Math.sin(o),c=n[0],u=n[1],p=0,d=t;d<i;d+=r){var f=e[d]-c,y=e[d+1]-u;s[p++]=c+f*l-y*h,s[p++]=u+f*h+y*l;for(var m=d+2;m<d+r;++m)s[p++]=e[m]}a&&s.length!=p&&(s.length=p)}(i,0,i.length,r,e,t,i),this.changed()}},t.prototype.scale=function(e,t,i){var r=t;void 0===r&&(r=e);var o=i;o||(o=Bo(this.getExtent()));var n=this.getFlatCoordinates();if(n){var a=this.getStride();!function(e,t,i,r,o,n,a,s){for(var l=s||[],h=a[0],c=a[1],u=0,p=t;p<i;p+=r){var d=e[p]-h,f=e[p+1]-c;l[u++]=h+o*d,l[u++]=c+n*f;for(var y=p+2;y<p+r;++y)l[u++]=e[y]}s&&l.length!=u&&(l.length=u)}(n,0,n.length,a,e,r,o,n),this.changed()}},t.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,o,n,a){for(var s=a||[],l=0,h=t;h<i;h+=r){s[l++]=e[h]+o,s[l++]=e[h+1]+n;for(var c=h+2;c<h+r;++c)s[l++]=e[c]}a&&s.length!=l&&(s.length=l)}
13
13
  /**
14
14
  * @license
15
15
  * Latitude/longitude spherical geodesy formulae taken from
16
16
  * http://www.movable-type.co.uk/scripts/latlong.html
17
17
  * Licensed under CC-BY-3.0.
18
- */(i,0,i.length,r,e,t,i),this.changed()}},t}(function(e){function t(){e.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return Ki()},t.prototype.closestPointXY=function(e,t,i,r){return Ki()},t.prototype.containsXY=function(e,t){return!1},t.prototype.getClosestPoint=function(e,t){var i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i},t.prototype.intersectsCoordinate=function(e){return this.containsXY(e[0],e[1])},t.prototype.computeExtent=function(e){return Ki()},t.prototype.getExtent=function(e){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}(this.extent_,e)},t.prototype.rotate=function(e,t){Ki()},t.prototype.scale=function(e,t,i){Ki()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return Ki()},t.prototype.getType=function(){return Ki()},t.prototype.applyTransform=function(e){Ki()},t.prototype.intersectsExtent=function(e){return Ki()},t.prototype.translate=function(e,t){Ki()},t.prototype.transform=function(e,t){var i=Mn(e),r=i.getUnits()==on.TILE_PIXELS?function(e,r,o){var n=i.getExtent(),a=i.getWorldExtent(),s=qo(a)/qo(n);return Wr(In,a[0],a[3],s,-s,0,0,0),en(e,0,e.length,o,In,r),Ln(i,t)(e,r,o)}:Ln(i,t);return this.applyTransform(r),this},t}(Qo));function jn(e,t,i,r){for(var o=0,n=i.length;o<n;++o)for(var a=i[o],s=0;s<r;++s)e[t++]=a[s];return t}function An(e,t,i,r,o){for(var n=o||[],a=0,s=0,l=i.length;s<l;++s){var h=jn(e,t,i[s],r);n[a++]=h,t=h}return n.length=a,n}var Rn=function(e){function t(t,i){e.call(this),this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){var o=this.flatCoordinates,n=lr(e,t,o[0],o[1]);if(n<r){for(var a=this.stride,s=0;s<a;++s)i[s]=o[s];return i.length=a,n}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(e){return Ro(this.flatCoordinates,e)},t.prototype.getType=function(){return or.POINT},t.prototype.intersectsExtent=function(e){return Oo(e,this.flatCoordinates[0],this.flatCoordinates[1])},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(e,t,i,r){for(var o=0,n=i.length;o<n;++o)e[t++]=i[o];return t}(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn),zn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Dn(e,t){const i={};for(const t in e)"ref"!==t&&(i[t]=e[t]);return zn.forEach(e=>{e in t&&(i[e]=t[e])}),i}var Fn=function(e){e=e.slice();const t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=Dn(e[i],t[e[i].ref]));return e};var Nn={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{js:"1.2.0"},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{js:"1.2.0"},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{js:"1.2.0"},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"If `symbol-sort-key` is set, sort based on that. Otherwise sort symbols by their y-position relative to the viewport."},"viewport-y":{doc:"Symbols will be sorted by their y-position relative to the viewport."},source:{doc:"Symbols will be rendered in the same order as the source data with no sorting applied."}},default:"auto",doc:"Controls the order in which overlapping symbols in the same layer are rendered","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which doesn't support the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` instead of the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"Not yet supported",android:"Not yet supported",ios:"Not yet supported",macos:"Not yet supported"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n * a single literal value; or\n * an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the deprecated `"in"` operator.\n\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:"Returns `formatted` text containing annotations for use in mixed-format `text-field` entries. If set, the `text-font` argument overrides the font specified by the root layout properties. If set, the `font-scale` argument specifies a scaling factor relative to the `text-size` specified in the root layout properties.",group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String"},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}}},Gn=i(2),Vn={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},Bn=" ",qn=/(italic|oblique)$/i,Un={};function Wn(e,t){var i=Un[e];if(!i){Array.isArray(e)||(e=[e]);for(var r="normal",o="normal",n=[],a=0,s=e.length;a<s;++a){var l=e[a].split(" "),h=l[l.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,l.pop(),h=l[l.length-1].toLowerCase()):qn.test(h)&&(h=h.replace(qn,""),o=l[l.length-1].replace(h,"")),Vn)if(h==c||h==c.replace("-","")||h==c.replace("-",Bn)){r=Vn[c],l.pop();break}"number"==typeof h&&(r=h);var u=l.join(Bn).replace("Klokantech Noto Sans","Noto Sans");-1!==u.indexOf(Bn)&&(u='"'+u+'"'),n.push(u)}i=Un[e]=[o,r,n]}return i[0]+Bn+i[1]+Bn+t+"px"+Bn+i[2]}function Hn(e){return e*Math.PI/180}const Yn=Gn.d.isFunction,Jn=Gn.d.convertFunction,$n=Gn.b.isExpression,Xn=Gn.b.createPropertyExpression,Zn={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Kn=function(e,t){const i=Xn(e,t);if("error"===i.result)throw new Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return i.value},Qn={},ea={zoom:0},ta={};function ia(e,t,i,r,o){const n=e.id;ta[n]||(ta[n]={});const a=ta[n];if(!a[i]){let r=(e[t]||Qn)[i];const o=Nn[`${t}_${e.type}`][i];void 0===r&&(r=o.default);let n=$n(r);if(!n&&Yn(r)&&(r=Jn(r,o),n=!0),n){const e=Kn(r,o);a[i]=e.evaluate.bind(e)}else"color"==o.type&&(r=Gn.a.parse(r)),a[i]=function(){return r}}return ea.zoom=r,a[i](ea,o)}const ra={};function oa(e,t,i,r){return e in ra||(ra[e]=Object(Gn.c)(t).filter),ea.zoom=r,ra[e](ea,i)}const na={};function aa(e,t){if(e&&void 0!==t){let i=na[e];i||(na[e]=i={color:e.toArray(),opacity:e.a}),(e=i.color)[3]=i.opacity*t,0===e[3]&&(e=void 0)}return e}const sa=/^([^]*)\{(.*)\}([^]*)$/;function la(e,t){let i;do{if(i=e.match(sa)){const r=t[i[2]]||"";e=i[1]+r+i[3]}}while(i);return e}var ha=function(e,t,i,r,o,n){if(!i){i=[];for(let e=78271.51696402048;i.length<21;e/=2)i.push(e)}if("string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");let a,s;if(o){const e=new Image;e.crossOrigin="anonymous",e.onload=function(){a=e,s=[e.width,e.height],e.onload=null},e.src=o}const l=document.createElement("CANVAS").getContext("2d"),h={};function c(e,t,i){const r=i+","+t+","+e;let o=h[r];if(!o){l.font=t;const n=l.measureText("M").width*i,a=e.split(" ");let s="";const c=[];for(let e=0,t=a.length;e<t;++e){const t=a[e];l.measureText(s+t).width<=n?s+=(s?" ":"")+t:(s&&c.push(s),s=t)}s&&c.push(s),h[r]=o=c.join("\n")}return o}const u=Fn(e.layers),p={},d=[];let f;for(let i=0,r=u.length;i<r;++i){const r=u[i],o=r.id;if("string"==typeof t&&r.source==t||"object"==typeof t&&t.indexOf(r.source)>=0){const t=r["source-layer"];if(!f){f=r.source;const t=e.sources[f];if(!t)throw new Error(`Source "${f}" is not defined`);const i=t.type;if("vector"!==i&&"geojson"!==i)throw new Error(`Source "${f}" is not of type "vector" or "geojson", but "${i}"`)}let n=p[t];n||(n=p[t]=[]),n.push({layer:r,index:i}),d.push(o)}delete ta[o],delete ra[o]}const y=new po,m=new co,g={},v={},b=[];return function(e,t){const o=e.getProperties(),n=p[o.layer];if(!n)return[];let l=i.indexOf(t);-1==l&&(l=function(e,t){let i=0;const r=t.length;for(;i<r;++i)if(t[i]<e&&i+1<r){const r=t[i]/t[i+1];return i+Math.log(t[i]/e)/Math.log(r)}return r-1}(t,i));const h=Zn[e.getGeometry().getType()],u={properties:o,type:h};let d=-1;for(let i=0,p=n.length;i<p;++i){const p=n[i],f=p.layer,_=f.id,w=f.layout||Qn,x=f.paint||Qn;if(!("none"===w.visibility||"minzoom"in f&&l<f.minzoom||"maxzoom"in f&&l>=f.maxzoom)){const i=f.filter;if(!i||oa(_,i,u,l)){let i,n,_,C,k,M;const S=p.index;if(3==h&&"fill"==f.type)if(n=ia(f,"paint","fill-opacity",l,u),"fill-pattern"in x){const e=ia(f,"paint","fill-pattern",l,u);if(e){const t=la(e,o);if(a&&r&&r[t]){(M=b[++d])&&M.getFill()&&!M.getStroke()&&!M.getText()||(M=b[d]=new mo({fill:new co})),_=M.getFill(),M.setZIndex(S);const e=t+"."+n;let i=v[e];if(!i){const o=r[t],s=document.createElement("canvas");s.width=o.width,s.height=o.height;const l=s.getContext("2d");l.globalAlpha=n,l.drawImage(a,o.x,o.y,o.width,o.height,0,0,o.width,o.height),i=l.createPattern(s,"repeat"),v[e]=i}_.setColor(i)}}}else(i=aa(ia(f,"paint","fill-color",l,u),n))&&((M=b[++d])&&M.getFill()&&!M.getStroke()&&!M.getText()||(M=b[d]=new mo({fill:new co})),(_=M.getFill()).setColor(i),M.setZIndex(S)),"fill-outline-color"in x&&(k=aa(ia(f,"paint","fill-outline-color",l,u),n)),k&&((M=b[++d])&&M.getStroke()&&!M.getFill()&&!M.getText()||(M=b[d]=new mo({stroke:new po})),(C=M.getStroke()).setLineCap(Nn.layout_line["line-cap"]),C.setLineJoin(Nn.layout_line["line-join"]),C.setMiterLimit(Nn.layout_line["line-miter-limit"]),C.setColor(k),C.setWidth(1),C.setLineDash(null),M.setZIndex(S));if(1!=h&&"line"==f.type){i=!("line-pattern"in x)&&"line-color"in x?aa(ia(f,"paint","line-color",l,u),ia(f,"paint","line-opacity",l,u)):void 0;const e=ia(f,"paint","line-width",l,u);i&&e>0&&((M=b[++d])&&M.getStroke()&&!M.getFill()&&!M.getText()||(M=b[d]=new mo({stroke:new po})),(C=M.getStroke()).setLineCap(ia(f,"layout","line-cap",l,u)),C.setLineJoin(ia(f,"layout","line-join",l,u)),C.setMiterLimit(ia(f,"layout","line-miter-limit",l,u)),C.setColor(i),C.setWidth(e),C.setLineDash(x["line-dasharray"]?ia(f,"paint","line-dasharray",l,u).map(function(t){return t*e}):null),M.setZIndex(S))}let T,L,I,E,O=!1,P=null,j=0;if((1==h||2==h)&&"icon-image"in w){const n=ia(f,"layout","icon-image",l,u);if(n){T=la(n,o);let c=void 0;if(a&&r&&r[T]){const o=ia(f,"layout","icon-rotation-alignment",l,u);if(2==h){const i=e.getGeometry();if(i.getFlatMidpoint){const e=i.getExtent();if(Math.sqrt(Math.max(Math.pow((e[2]-e[0])/t,2),Math.pow((e[3]-e[1])/t,2)))>150){const e=i.getFlatMidpoint();if(c=new Rn(e),"line"===ia(f,"layout","symbol-placement",l,u)&&"map"===o){const t=i.getStride(),r=i.getFlatCoordinates();for(let i=0,o=r.length-t;i<o;i+=t){const o=r[i],n=r[i+1],a=r[i+t],s=r[i+t+1],l=Math.min(o,a),h=Math.min(n,s),c=Math.max(o,a),u=Math.max(n,s);if(e[0]>=l&&e[0]<=c&&e[1]>=h&&e[1]<=u){j=Math.atan2(n-s,a-o);break}}}}}}if(2!==h||c){(M=b[++d])&&M.getImage()&&!M.getFill()&&!M.getStroke()||(M=b[d]=new mo),M.setGeometry(c);const e=ia(f,"layout","icon-size",l,u),t=void 0!==x["icon-color"]?ia(f,"paint","icon-color",l,u):null;let n=T+"."+e;if(null!==t&&(n+="."+t),!(L=g[n])){const l=r[T];if(null!==t){i=aa(t,1);const r=document.createElement("canvas");r.width=l.width,r.height=l.height;const o=r.getContext("2d");o.drawImage(a,l.x,l.y,l.width,l.height,0,0,l.width,l.height);const s=o.getImageData(0,0,r.width,r.height);for(let e=0,t=s.data.length;e<t;e+=4)s.data[e]=i[0],s.data[e+1]=i[1],s.data[e+2]=i[2];o.putImageData(s,0,0),L=g[n]=new Co({img:r,imgSize:[r.width,r.height],scale:e/l.pixelRatio})}else L=g[n]=new Co({img:a,imgSize:s,size:[l.width,l.height],offset:[l.x,l.y],rotateWithView:"map"===o,scale:e/l.pixelRatio})}L.setRotation(j+Hn(ia(f,"layout","icon-rotate",l,u))),L.setOpacity(ia(f,"paint","icon-opacity",l,u)),M.setImage(L),P=M.getText(),M.setText(void 0),M.setZIndex(99999-S),O=!0,I=!1}else I=!0}}}if(1==h&&"circle-radius"in x){(M=b[++d])&&M.getImage()&&!M.getFill()&&!M.getStroke()||(M=b[d]=new mo);const e=ia(f,"paint","circle-radius",l,u),t=ia(f,"paint","circle-stroke-color",l,u),i=ia(f,"paint","circle-color",l,u),r=ia(f,"paint","circle-opacity",l,u),o=ia(f,"paint","circle-stroke-opacity",l,u),n=ia(f,"paint","circle-stroke-width",l,u);(L=g[e+"."+t+"."+i+"."+r+"."+n])||(L=new lo({radius:e,stroke:0===n?void 0:new po({width:n,color:aa(t,o)}),fill:new co({color:aa(i,r)})})),M.setImage(L),P=M.getText(),M.setText(void 0),M.setGeometry(void 0),M.setZIndex(99999-S),O=!0}if("text-field"in w&&(E=la(ia(f,"layout","text-field",l,u).toString(),o)),E&&!I){O||((M=b[++d])&&M.getText()&&!M.getFill()&&!M.getStroke()||(M=b[d]=new mo),M.setImage(void 0),M.setGeometry(void 0)),M.getText()||M.setText(P||new To),P=M.getText();const e=ia(f,"layout","text-size",l,u),t=Wn(ia(f,"layout","text-font",l,u),e),i=w["text-transform"];"uppercase"==i?E=E.toUpperCase():"lowercase"==i&&(E=E.toLowerCase());const r=2==h?E:c(E,t,ia(f,"layout","text-max-width",l,u));P.setText(r),P.setFont(t),P.setRotation(Hn(ia(f,"layout","text-rotate",l,u)));const o=ia(f,"layout","text-anchor",l,u),a=O||1==h?"point":ia(f,"layout","symbol-placement",l,u);if(P.setPlacement(a),"point"==a){let e="center";-1!==o.indexOf("left")?e="left":-1!==o.indexOf("right")&&(e="right"),P.setTextAlign(e)}else P.setTextAlign();let s="middle";0==o.indexOf("bottom")?s="bottom":0==o.indexOf("top")&&(s="top"),P.setTextBaseline(s);const p=ia(f,"layout","text-offset",l,u);P.setOffsetX(p[0]*e),P.setOffsetY(p[1]*e),n=ia(f,"paint","text-opacity",l,u),m.setColor(aa(ia(f,"paint","text-color",l,u),n)),P.setFill(m);const g=aa(ia(f,"paint","text-halo-color",l,u),n);g?(y.setColor(g),y.setWidth(ia(f,"paint","text-halo-width",l,u)),P.setStroke(y)):P.setStroke(void 0),M.setZIndex(99999-S)}}}}return d>-1?(b.length=d+1,b):[]}},ca=i(6),ua=i.n(ca),pa=function(){this.dataProjection=null,this.defaultFeatureProjection=null};pa.prototype.getReadOptions=function(e,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(e),featureProjection:t.featureProjection}),this.adaptOptions(i)},pa.prototype.adaptOptions=function(e){return xr({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},pa.prototype.getLastExtent=function(){return null},pa.prototype.getType=function(){return Ki()},pa.prototype.readFeature=function(e,t){return Ki()},pa.prototype.readFeatures=function(e,t){return Ki()},pa.prototype.readGeometry=function(e,t){return Ki()},pa.prototype.readProjection=function(e){return Ki()},pa.prototype.writeFeature=function(e,t){return Ki()},pa.prototype.writeFeatures=function(e,t){return Ki()},pa.prototype.writeGeometry=function(e,t){return Ki()};var da=pa;function fa(e,t,i){var r,o=i?Mn(i.featureProjection):null,n=i?Mn(i.dataProjection):null;if(r=o&&n&&!function(e,t){if(e===t)return!0;var i=e.getUnits()===t.getUnits();return e.getCode()===t.getCode()?i:Tn(e,t)===xn&&i}(o,n)?Array.isArray(e)?function(e,t,i){return Yo(e,Ln(t,i))}(e,n,o):(t?e.clone():e).transform(t?o:n,t?n:o):e,t&&i&&void 0!==i.decimals&&!Array.isArray(r)){var a=Math.pow(10,i.decimals);r===e&&(r=e.clone()),r.applyTransform(function(e){for(var t=0,i=e.length;t<i;++t)e[t]=Math.round(e[t]*a)/a;return e})}return r}var ya="arraybuffer";function ma(e,t){return e>t?1:e<t?-1:0}function ga(e,t,i){for(;t<i;){var r=e[t];e[t]=e[i],e[i]=r,++t,--i}}function va(e,t){for(var i=Array.isArray(t)?t:[t],r=i.length,o=0;o<r;o++)e[e.length]=i[o]}function ba(e,t){var i=e.length;if(i!==t.length)return!1;for(var r=0;r<i;r++)if(e[r]!==t[r])return!1;return!0}function _a(e,t,i,r,o,n,a){var s,l=e[t],h=e[t+1],c=e[i]-l,u=e[i+1]-h;if(0===c&&0===u)s=t;else{var p=((o-l)*c+(n-h)*u)/(c*c+u*u);if(p>1)s=i;else{if(p>0){for(var d=0;d<r;++d)a[d]=hr(e[t+d],e[i+d],p);return void(a.length=r)}s=t}}for(var f=0;f<r;++f)a[f]=e[s+f];a.length=r}function wa(e,t,i,r,o){var n=e[t],a=e[t+1];for(t+=r;t<i;t+=r){var s=e[t],l=e[t+1],h=lr(n,a,s,l);h>o&&(o=h),n=s,a=l}return o}function xa(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n];o=wa(e,t,s,r,o),t=s}return o}function Ca(e,t,i,r,o,n,a,s,l,h,c){if(t==i)return h;var u,p;if(0===o){if((p=lr(a,s,e[t],e[t+1]))<h){for(u=0;u<r;++u)l[u]=e[t+u];return l.length=r,p}return h}for(var d=c||[NaN,NaN],f=t+r;f<i;)if(_a(e,f-r,f,r,a,s,d),(p=lr(a,s,d[0],d[1]))<h){for(h=p,u=0;u<r;++u)l[u]=d[u];l.length=r,f+=r}else f+=r*Math.max((Math.sqrt(p)-Math.sqrt(h))/o|0,1);if(n&&(_a(e,i-r,t,r,a,s,d),(p=lr(a,s,d[0],d[1]))<h)){for(h=p,u=0;u<r;++u)l[u]=d[u];l.length=r}return h}function ka(e,t,i,r,o,n,a,s,l,h,c){for(var u=c||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];h=Ca(e,t,f,r,o,n,a,s,l,h,u),t=f}return h}function Ma(e,t,i,r,o){for(var n=void 0!==o?o:[],a=0,s=t;s<i;s+=r)n[a++]=e.slice(s,s+r);return n.length=a,n}function Sa(e,t,i,r,o){for(var n=void 0!==o?o:[],a=0,s=0,l=i.length;s<l;++s){var h=i[s];n[a++]=Ma(e,t,h,r,n[a]),t=h}return n.length=a,n}function Ta(e,t,i,r,o){for(var n=void 0!==o?o:[],a=0,s=0,l=i.length;s<l;++s){var h=i[s];n[a++]=Sa(e,t,h,r,n[a]),t=h[h.length-1]}return n.length=a,n}function La(e,t,i,r,o,n){var a=NaN,s=NaN,l=(i-t)/r;if(1===l)a=e[t],s=e[t+1];else if(2==l)a=(1-o)*e[t]+o*e[t+r],s=(1-o)*e[t+1]+o*e[t+r+1];else if(0!==l){for(var h=e[t],c=e[t+1],u=0,p=[0],d=t+r;d<i;d+=r){var f=e[d],y=e[d+1];u+=Math.sqrt((f-h)*(f-h)+(y-c)*(y-c)),p.push(u),h=f,c=y}var m=o*u,g=function(e,t,i){for(var r,o,n=i||ma,a=0,s=e.length,l=!1;a<s;)(o=+n(e[r=a+(s-a>>1)],t))<0?a=r+1:(s=r,l=!o);return l?a:~a}(p,m);if(g<0){var v=(m-p[-g-2])/(p[-g-1]-p[-g-2]),b=t+(-g-2)*r;a=hr(e[b],e[b+r],v),s=hr(e[b+1],e[b+r+1],v)}else a=e[t+g*r],s=e[t+g*r+1]}return n?(n[0]=a,n[1]=s,n):[a,s]}function Ia(e,t,i,r,o,n){if(i==t)return null;var a;if(o<e[t+r-1])return n?((a=e.slice(t,t+r))[r-1]=o,a):null;if(e[i-1]<o)return n?((a=e.slice(i-r,i))[r-1]=o,a):null;if(o==e[t+r-1])return e.slice(t,t+r);for(var s=t/r,l=i/r;s<l;){var h=s+l>>1;o<e[(h+1)*r-1]?l=h:s=h+1}var c=e[s*r-1];if(o==c)return e.slice((s-1)*r,(s-1)*r+r);var u=(o-c)/(e[(s+1)*r-1]-c);a=[];for(var p=0;p<r-1;++p)a.push(hr(e[(s-1)*r+p],e[s*r+p],u));return a.push(o),a}function Ea(e,t,i,r,o){return!function(e,t,i){var r;return(r=t.call(i,Go(e)))?r:(r=t.call(i,Vo(e)))?r:(r=t.call(i,Wo(e)))?r:(r=t.call(i,Uo(e)))||!1}(o,function(o){return!Oa(e,t,i,r,o[0],o[1])})}function Oa(e,t,i,r,o,n){for(var a=0,s=e[i-r],l=e[i-r+1];t<i;t+=r){var h=e[t],c=e[t+1];l<=n?c>n&&(h-s)*(n-l)-(o-s)*(c-l)>0&&a++:c<=n&&(h-s)*(n-l)-(o-s)*(c-l)<0&&a--,s=h,l=c}return 0!==a}function Pa(e,t,i,r,o,n){if(0===i.length)return!1;if(!Oa(e,t,i[0],r,o,n))return!1;for(var a=1,s=i.length;a<s;++a)if(Oa(e,i[a-1],i[a],r,o,n))return!1;return!0}function ja(e,t,i,r,o,n){for(var a,s=[e[t],e[t+1]],l=[];t+r<i;t+=r){if(l[0]=e[t+r],l[1]=e[t+r+1],a=o.call(n,s,l))return a;s[0]=l[0],s[1]=l[1]}return!1}function Aa(e,t,i,r,o){var n=Fo([1/0,1/0,-1/0,-1/0],e,t,i,r);return!!Ho(o,n)&&(!!function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}(o,n)||(n[0]>=o[0]&&n[2]<=o[2]||(n[1]>=o[1]&&n[3]<=o[3]||ja(e,t,i,r,function(e,t){return function(e,t,i){var r=!1,o=Po(e,t),n=Po(e,i);if(o===Lo.INTERSECTING||n===Lo.INTERSECTING)r=!0;else{var a,s,l=e[0],h=e[1],c=e[2],u=e[3],p=t[0],d=t[1],f=i[0],y=i[1],m=(y-d)/(f-p);n&Lo.ABOVE&&!(o&Lo.ABOVE)&&(r=(a=f-(y-u)/m)>=l&&a<=c),r||!(n&Lo.RIGHT)||o&Lo.RIGHT||(r=(s=y-(f-c)*m)>=h&&s<=u),r||!(n&Lo.BELOW)||o&Lo.BELOW||(r=(a=f-(y-h)/m)>=l&&a<=c),r||!(n&Lo.LEFT)||o&Lo.LEFT||(r=(s=y-(f-l)*m)>=h&&s<=u)}return r}(o,e,t)}))))}function Ra(e,t,i,r,o){if(!function(e,t,i,r,o){return!!(Aa(e,t,i,r,o)||Oa(e,t,i,r,o[0],o[1])||Oa(e,t,i,r,o[0],o[3])||Oa(e,t,i,r,o[2],o[1])||Oa(e,t,i,r,o[2],o[3]))}(e,t,i[0],r,o))return!1;if(1===i.length)return!0;for(var n=1,a=i.length;n<a;++n)if(Ea(e,i[n-1],i[n],r,o)&&!Aa(e,i[n-1],i[n],r,o))return!1;return!0}function za(e,t,i,r){for(var o=e[t],n=e[t+1],a=0,s=t+r;s<i;s+=r){var l=e[s],h=e[s+1];a+=Math.sqrt((l-o)*(l-o)+(h-n)*(h-n)),o=l,n=h}return a}function Da(e,t,i,r,o,n,a){var s=(i-t)/r;if(s<3){for(;t<i;t+=r)n[a++]=e[t],n[a++]=e[t+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var h=[t,i-r],c=0;h.length>0;){for(var u=h.pop(),p=h.pop(),d=0,f=e[p],y=e[p+1],m=e[u],g=e[u+1],v=p+r;v<u;v+=r){var b=sr(e[v],e[v+1],f,y,m,g);b>d&&(c=v,d=b)}d>o&&(l[(c-t)/r]=1,p+r<c&&h.push(p,c),c+r<u&&h.push(c,u))}for(var _=0;_<s;++_)l[_]&&(n[a++]=e[t+_*r],n[a++]=e[t+_*r+1]);return a}function Fa(e,t,i,r,o,n,a,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];a=Da(e,t,c,r,o,n,a),s.push(a),t=c}return a}function Na(e,t){return t*Math.round(e/t)}function Ga(e,t,i,r,o,n,a){if(t==i)return a;var s,l,h=Na(e[t],o),c=Na(e[t+1],o);t+=r,n[a++]=h,n[a++]=c;do{if(s=Na(e[t],o),l=Na(e[t+1],o),(t+=r)==i)return n[a++]=s,n[a++]=l,a}while(s==h&&l==c);for(;t<i;){var u=Na(e[t],o),p=Na(e[t+1],o);if(t+=r,u!=s||p!=l){var d=s-h,f=l-c,y=u-h,m=p-c;d*m==f*y&&(d<0&&y<d||d==y||d>0&&y>d)&&(f<0&&m<f||f==m||f>0&&m>f)?(s=u,l=p):(n[a++]=s,n[a++]=l,h=s,c=l,s=u,l=p)}}return n[a++]=s,n[a++]=l,a}function Va(e,t,i,r,o,n,a,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];a=Ga(e,t,c,r,o,n,a),s.push(a),t=c}return a}var Ba=function(e){function t(t,i){e.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendCoordinate=function(e){this.flatCoordinates?va(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.forEachSegment=function(e){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinateAtM=function(e,t){if(this.layout!=En.XYM&&this.layout!=En.XYZM)return null;var i=void 0!==t&&t;return Ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)},t.prototype.getCoordinates=function(){return Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinateAt=function(e,t){return La(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t.prototype.getLength=function(){return za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=Da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,En.XY)},t.prototype.getType=function(){return or.LINE_STRING},t.prototype.intersectsExtent=function(e){return Aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jn(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn),qa=function(e){function t(t,i,r){if(e.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,i);else if(void 0!==i&&r)this.setFlatCoordinates(i,t),this.ends_=r;else{for(var o=this.getLayout(),n=t,a=[],s=[],l=0,h=n.length;l<h;++l){var c=n[l];0===l&&(o=c.getLayout()),va(a,c.getFlatCoordinates()),s.push(a.length)}this.setFlatCoordinates(o,a),this.ends_=s}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLineString=function(e){this.flatCoordinates?va(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(xa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ka(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.getCoordinateAtM=function(e,t,i){if(this.layout!=En.XYM&&this.layout!=En.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,o=void 0!==i&&i;return function(e,t,i,r,o,n,a){if(a)return Ia(e,t,i[i.length-1],r,o,n);var s;if(o<e[r-1])return n?((s=e.slice(0,r))[r-1]=o,s):null;if(e[e.length-1]<o)return n?((s=e.slice(e.length-r))[r-1]=o,s):null;for(var l=0,h=i.length;l<h;++l){var c=i[l];if(t!=c){if(o<e[t+r-1])return null;if(o<=e[c-1])return Ia(e,t,c,r,o,!1);t=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,e,r,o)},t.prototype.getCoordinates=function(){return Sa(this.flatCoordinates,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getLineString=function(e){return e<0||this.ends_.length<=e?null:new Ba(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLineStrings=function(){for(var e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[],o=0,n=0,a=t.length;n<a;++n){var s=t[n],l=new Ba(e.slice(o,s),i);r.push(l),o=s}return r},t.prototype.getFlatMidpoints=function(){for(var e=[],t=this.flatCoordinates,i=0,r=this.ends_,o=this.stride,n=0,a=r.length;n<a;++n){var s=r[n];va(e,La(t,i,s,o,.5)),i=s}return e},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=Fa(this.flatCoordinates,0,this.ends_,this.stride,e,i,0,r),new t(i,En.XY,r)},t.prototype.getType=function(){return or.MULTI_LINE_STRING},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){if(Aa(e,t,i[n],r,o))return!0;t=i[n]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=An(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(Pn),Ua=function(e){function t(t,i){e.call(this),i&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPoint=function(e){this.flatCoordinates?va(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){if(r<Eo(this.getExtent(),e,t))return r;for(var o=this.flatCoordinates,n=this.stride,a=0,s=o.length;a<s;a+=n){var l=lr(e,t,o[a],o[a+1]);if(l<r){r=l;for(var h=0;h<n;++h)i[h]=o[a+h];i.length=n}}return r},t.prototype.getCoordinates=function(){return Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getPoint=function(e){var t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return e<0||t<=e?null:new Rn(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)},t.prototype.getPoints=function(){for(var e=this.flatCoordinates,t=this.layout,i=this.stride,r=[],o=0,n=e.length;o<n;o+=i){var a=new Rn(e.slice(o,o+i),t);r.push(a)}return r},t.prototype.getType=function(){return or.MULTI_POINT},t.prototype.intersectsExtent=function(e){for(var t=this.flatCoordinates,i=this.stride,r=0,o=t.length;r<o;r+=i){if(Oo(e,t[r],t[r+1]))return!0}return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jn(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn);function Wa(e,t,i,r){for(var o=0,n=e[i-r],a=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];o+=a*s-n*l,n=s,a=l}return o/2}function Ha(e,t,i,r){for(var o=0,n=0,a=i.length;n<a;++n){var s=i[n];o+=Wa(e,t,s,r),t=s}return o}var Ya=function(e){function t(t,i){e.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.getArea=function(){return Wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=Da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,En.XY)},t.prototype.getType=function(){return or.LINEAR_RING},t.prototype.intersectsExtent=function(e){return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jn(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn);function Ja(e,t,i,r,o,n,a){for(var s,l,h,c,u,p,d,f=o[n+1],y=[],m=0,g=i.length;m<g;++m){var v=i[m];for(c=e[v-r],p=e[v-r+1],s=t;s<v;s+=r)u=e[s],d=e[s+1],(f<=p&&d<=f||p<=f&&f<=d)&&(h=(f-p)/(d-p)*(u-c)+c,y.push(h)),c=u,p=d}var b=NaN,_=-1/0;for(y.sort(ma),c=y[0],s=1,l=y.length;s<l;++s){u=y[s];var w=Math.abs(u-c);w>_&&Pa(e,t,i,r,h=(c+u)/2,f)&&(b=h,_=w),c=u}return isNaN(b)&&(b=o[n]),a?(a.push(b,f,_),a):[b,f,_]}function $a(e,t,i,r,o){for(var n=[],a=0,s=i.length;a<s;++a){var l=i[a];n=Ja(e,t,l,r,o,2*a,n),t=l[l.length-1]}return n}function Xa(e,t,i,r){for(;t<i-r;){for(var o=0;o<r;++o){var n=e[t+o];e[t+o]=e[i-r+o],e[i-r+o]=n}t+=r,i-=r}}function Za(e,t,i,r){for(var o=0,n=e[i-r],a=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];o+=(s-n)*(l+a),n=s,a=l}return o>0}function Ka(e,t,i,r,o){for(var n=void 0!==o&&o,a=0,s=i.length;a<s;++a){var l=i[a],h=Za(e,t,l,r);if(0===a){if(n&&h||!n&&!h)return!1}else if(n&&!h||!n&&h)return!1;t=l}return!0}function Qa(e,t,i,r,o){for(var n=void 0!==o&&o,a=0,s=i.length;a<s;++a){var l=i[a],h=Za(e,t,l,r);(0===a?n&&h||!n&&!h:n&&!h||!n&&h)&&Xa(e,t,l,r),t=l}return t}function es(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n)t=Qa(e,t,i[n],r,o);return t}var ts=function(e){function t(t,i,r){e.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==i&&r?(this.setFlatCoordinates(i,t),this.ends_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLinearRing=function(e){this.flatCoordinates?va(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(xa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ka(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return Pa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)},t.prototype.getArea=function(){return Ha(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?Qa(t=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,e):t=this.flatCoordinates,Sa(t,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=Bo(this.getExtent());this.flatInteriorPoint_=Ja(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new Rn(this.getFlatInteriorPoint(),En.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(e){return e<0||this.ends_.length<=e?null:new Ya(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLinearRings=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[],o=0,n=0,a=i.length;n<a;++n){var s=i[n],l=new Ya(t.slice(o,s),e);r.push(l),o=s}return r},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;Ka(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Qa(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=Va(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,r),new t(i,En.XY,r)},t.prototype.getType=function(){return or.POLYGON},t.prototype.intersectsExtent=function(e){return Ra(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=An(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(Pn),is=ts;function rs(e,t,i,r){for(var o=[],n=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];n=zo(e,t,l[0],r),o.push((n[0]+n[2])/2,(n[1]+n[3])/2),t=l[l.length-1]}return o}var os=function(e){function t(t,i,r){if(e.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(t[0])){for(var o=this.getLayout(),n=t,a=[],s=[],l=0,h=n.length;l<h;++l){var c=n[l];0===l&&(o=c.getLayout());for(var u=a.length,p=c.getEnds(),d=0,f=p.length;d<f;++d)p[d]+=u;va(a,c.getFlatCoordinates()),s.push(p)}i=o,t=a,r=s}void 0!==i&&r?(this.setFlatCoordinates(i,t),this.endss_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPolygon=function(e){var t;if(this.flatCoordinates){var i=this.flatCoordinates.length;va(this.flatCoordinates,e.getFlatCoordinates());for(var r=0,o=(t=e.getEnds().slice()).length;r<o;++r)t[r]+=i}else this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();this.endss_.push(t),this.changed()},t.prototype.clone=function(){for(var e=this.endss_.length,i=new Array(e),r=0;r<e;++r)i[r]=this.endss_[r].slice();return new t(this.flatCoordinates.slice(),this.layout,i)},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n];o=xa(e,t,s,r,o),t=s[s.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(e,t,i,r,o,n,a,s,l,h,c){for(var u=c||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];h=ka(e,t,f,r,o,n,a,s,l,h,u),t=f[f.length-1]}return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return function(e,t,i,r,o,n){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(Pa(e,t,l,r,o,n))return!0;t=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)},t.prototype.getArea=function(){return function(e,t,i,r){for(var o=0,n=0,a=i.length;n<a;++n){var s=i[n];o+=Ha(e,t,s,r),t=s[s.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?es(t=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,e):t=this.flatCoordinates,Ta(t,0,this.endss_,this.stride)},t.prototype.getEndss=function(){return this.endss_},t.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var e=rs(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=$a(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t.prototype.getInteriorPoints=function(){return new Ua(this.getFlatInteriorPoints().slice(),En.XYM)},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;!function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n)if(!Ka(e,t,i[n],r,o))return!1;return!0}(e,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=es(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=e,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=function(e,t,i,r,o,n,a,s){for(var l=0,h=i.length;l<h;++l){var c=i[l],u=[];a=Va(e,t,c,r,o,n,a,u),s.push(u),t=c[c.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),i,0,r),new t(i,En.XY,r)},t.prototype.getPolygon=function(e){if(e<0||this.endss_.length<=e)return null;var t;if(0===e)t=0;else{var i=this.endss_[e-1];t=i[i.length-1]}var r=this.endss_[e].slice(),o=r[r.length-1];if(0!==t)for(var n=0,a=r.length;n<a;++n)r[n]-=t;return new is(this.flatCoordinates.slice(t,o),this.layout,r)},t.prototype.getPolygons=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[],o=0,n=0,a=i.length;n<a;++n){var s=i[n].slice(),l=s[s.length-1];if(0!==o)for(var h=0,c=s.length;h<c;++h)s[h]-=o;var u=new is(t.slice(o,l),e,s);r.push(u),o=l}return r},t.prototype.getType=function(){return or.MULTI_POLYGON},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n];if(Ra(e,t,s,r,o))return!0;t=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(e,t,i,r,o){for(var n=o||[],a=0,s=0,l=i.length;s<l;++s){var h=An(e,t,i[s],r,n[a]);n[a++]=h,t=h[h.length-1]}return n.length=a,n}(this.flatCoordinates,0,e,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},t}(Pn),ns=[1,0,0,1,0,0],as=function(e,t,i,r,o){this.extent_,this.id_=o,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};as.prototype.get=function(e){return this.properties_[e]},as.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===or.POINT?Ro(this.flatCoordinates_):zo(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},as.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=Bo(this.getExtent());this.flatInteriorPoints_=Ja(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},as.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=rs(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=$a(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},as.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=La(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},as.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,i=this.ends_,r=0,o=i.length;r<o;++r){var n=i[r],a=La(e,t,n,2,.5);va(this.flatMidpoints_,a),t=n}}return this.flatMidpoints_},as.prototype.getId=function(){return this.id_},as.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},as.prototype.getGeometry=function(){return this},as.prototype.getSimplifiedGeometry=function(e){return this},as.prototype.getProperties=function(){return this.properties_},as.prototype.getStride=function(){return 2},as.prototype.getStyleFunction=function(){},as.prototype.getType=function(){return this.type_},as.prototype.transform=function(e,t){var i=(e=Mn(e)).getExtent(),r=e.getWorldExtent(),o=qo(r)/qo(i);Wr(ns,r[0],r[3],o,-o,0,0,0),en(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ns,this.flatCoordinates_)},as.prototype.getEnds=as.prototype.getEndss=function(){return this.ends_},as.prototype.getFlatCoordinates=as.prototype.getOrientedFlatCoordinates;var ss=as;function ls(e,t,i){if(3===e){var r={keys:[],values:[],features:[]},o=i.readVarint()+i.pos;i.readFields(hs,r,o),r.length=r.features.length,r.length&&(t[r.name]=r)}}function hs(e,t,i){if(15===e)t.version=i.readVarint();else if(1===e)t.name=i.readString();else if(5===e)t.extent=i.readVarint();else if(2===e)t.features.push(i.pos);else if(3===e)t.keys.push(i.readString());else if(4===e){for(var r=null,o=i.readVarint()+i.pos;i.pos<o;)r=1===(e=i.readVarint()>>3)?i.readString():2===e?i.readFloat():3===e?i.readDouble():4===e?i.readVarint64():5===e?i.readVarint():6===e?i.readSVarint():7===e?i.readBoolean():null;t.values.push(r)}}function cs(e,t,i){if(1==e)t.id=i.readVarint();else if(2==e)for(var r=i.readVarint()+i.pos;i.pos<r;){var o=t.layer.keys[i.readVarint()],n=t.layer.values[i.readVarint()];t.properties[o]=n}else 3==e?t.type=i.readVarint():4==e&&(t.geometry=i.pos)}function us(e,t,i){e.pos=t.features[i];var r=e.readVarint()+e.pos,o={layer:t,type:0,properties:{}};return e.readFields(cs,o,r),o}var ps=function(e){function t(t){e.call(this);var i=t||{};this.dataProjection=new an({code:"",units:on.TILE_PIXELS}),this.featureClass_=i.featureClass?i.featureClass:ss,this.geometryName_=i.geometryName,this.layerName_=i.layerName?i.layerName:"layer",this.layers_=i.layers?i.layers:null,this.extent_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.readRawGeometry_=function(e,t,i,r){e.pos=t.geometry;for(var o=e.readVarint()+e.pos,n=1,a=0,s=0,l=0,h=0,c=0;e.pos<o;){if(!a){var u=e.readVarint();n=7&u,a=u>>3}a--,1===n||2===n?(s+=e.readSVarint(),l+=e.readSVarint(),1===n&&h>c&&(r.push(h),c=h),i.push(s,l),h+=2):7===n?h>c&&(i.push(i[c],i[c+1]),h+=2):rr(!1,59)}h>c&&(r.push(h),c=h)},t.prototype.createFeature_=function(e,t,i){var r,o=t.type;if(0===o)return null;var n=t.id,a=t.properties;a[this.layerName_]=t.layer.name;var s=[],l=[];this.readRawGeometry_(e,t,s,l);var h=function(e,t){var i;1===e?i=1===t?or.POINT:or.MULTI_POINT:2===e?i=1===t?or.LINE_STRING:or.MULTI_LINE_STRING:3===e&&(i=or.POLYGON);return i}(o,l.length);if(this.featureClass_===ss)r=new this.featureClass_(h,s,l,a,n);else{var c;if(h==or.POLYGON){for(var u=[],p=0,d=0,f=0,y=l.length;f<y;++f){var m=l[f];Za(s,p,m,2)||(u.push(l.slice(d,f)),d=f),p=m}c=u.length>1?new os(s,En.XY,u):new is(s,En.XY,l)}else c=h===or.POINT?new Rn(s,En.XY):h===or.LINE_STRING?new Ba(s,En.XY):h===or.POLYGON?new is(s,En.XY,l):h===or.MULTI_POINT?new Ua(s,En.XY):h===or.MULTI_LINE_STRING?new qa(s,En.XY,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var g=fa(c,!1,this.adaptOptions(i));r.setGeometry(g),r.setId(n),r.setProperties(a)}return r},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return ya},t.prototype.readFeatures=function(e,t){var i=this.layers_,r=new ua.a(e),o=r.readFields(ls,{}),n=[];for(var a in o)if(!i||-1!=i.indexOf(a)){for(var s=o[a],l=0,h=s.length;l<h;++l){var c=us(r,s,l);n.push(this.createFeature_(r,c))}this.extent_=s?[0,0,s.extent,s.extent]:null}return n},t.prototype.readProjection=function(e){return this.dataProjection},t.prototype.setLayers=function(e){this.layers_=e},t}(da),ds=function(){};ds.prototype.getReplay=function(e,t){return Ki()},ds.prototype.isEmpty=function(){return Ki()},ds.prototype.addDeclutter=function(e){return Ki()};var fs=ds,ys={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function ms(e,t,i,r,o,n,a,s){for(var l,h,c,u=[],p=e[t]>e[i-r],d=o.length,f=e[t],y=e[t+1],m=e[t+=r],g=e[t+1],v=0,b=Math.sqrt(Math.pow(m-f,2)+Math.pow(g-y,2)),_="",w=0,x=0;x<d;++x){h=p?d-x-1:x;var C=o.charAt(h),k=n(_=p?C+_:_+C)-w;w+=k;for(var M=a+k/2;t<i-r&&v+b<M;)f=m,y=g,m=e[t+=r],g=e[t+1],v+=b,b=Math.sqrt(Math.pow(m-f,2)+Math.pow(g-y,2));var S=M-v,T=Math.atan2(g-y,m-f);if(p&&(T+=T>0?-Math.PI:Math.PI),void 0!==c){var L=T-c;if(L+=L>Math.PI?-2*Math.PI:L<-Math.PI?2*Math.PI:0,Math.abs(L)>s)return null}var I=S/b,E=hr(f,m,I),O=hr(y,g,I);c==T?(p&&(l[0]=E,l[1]=O,l[2]=k/2),l[4]=_):(w=k,l=[E,O,k/2,T,_=C],p?u.unshift(l):u.push(l),c=T),a+=k}return u}var gs=function(){};gs.prototype.drawCustom=function(e,t,i){},gs.prototype.drawGeometry=function(e){},gs.prototype.setStyle=function(e){},gs.prototype.drawCircle=function(e,t){},gs.prototype.drawFeature=function(e,t){},gs.prototype.drawGeometryCollection=function(e,t){},gs.prototype.drawLineString=function(e,t){},gs.prototype.drawMultiLineString=function(e,t){},gs.prototype.drawMultiPoint=function(e,t){},gs.prototype.drawMultiPolygon=function(e,t){},gs.prototype.drawPoint=function(e,t){},gs.prototype.drawPolygon=function(e,t){},gs.prototype.drawText=function(e,t){},gs.prototype.setFillStrokeStyle=function(e,t){},gs.prototype.setImageStyle=function(e,t){},gs.prototype.setTextStyle=function(e,t){};var vs=gs,bs={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},_s=[bs.FILL],ws=[bs.STROKE],xs=[bs.BEGIN_PATH],Cs=[bs.CLOSE_PATH],ks=bs,Ms=[ys.POLYGON,ys.CIRCLE,ys.LINE_STRING,ys.IMAGE,ys.TEXT,ys.DEFAULT],Ss={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ts=[1/0,1/0,-1/0,-1/0],Ls=[1,0,0,1,0,0],Is=function(e){function t(t,i,r,o,n,a){e.call(this),this.declutterTree=a,this.tolerance=t,this.maxExtent=i,this.overlaps=n,this.pixelRatio=o,this.maxLineWidth=0,this.resolution=r,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replayTextBackground_=function(e,t,i,r,o,n,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,o),e.lineTo.apply(e,t),n&&(this.alignFill_=n[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())},t.prototype.replayImage_=function(e,t,i,r,o,n,a,s,l,h,c,u,p,d,f,y,m,g){var v=m||g;t-=o*=p,i-=n*=p;var b,_,w,x,C=f+h>r.width?r.width-h:f,k=s+c>r.height?r.height-c:s,M=y[3]+C*p+y[1],S=y[0]+k*p+y[2],T=t-y[3],L=i-y[0];(v||0!==u)&&(b=[T,L],_=[T+M,L],w=[T+M,L+S],x=[T,L+S]);var I=null;if(0!==u){var E=t+o,O=i+n;I=Wr(Ls,E,O,1,1,u,-E,-O),Ao(Ts),Do(Ts,Ur(Ls,b)),Do(Ts,Ur(Ls,_)),Do(Ts,Ur(Ls,w)),Do(Ts,Ur(Ls,x))}else jo(T,L,T+M,L+S,Ts);var P=e.canvas,j=g?g[2]*p/2:0,A=Ts[0]-j<=P.width&&Ts[2]+j>=0&&Ts[1]-j<=P.height&&Ts[3]+j>=0;if(d&&(t=Math.round(t),i=Math.round(i)),a){if(!A&&1==a[4])return;!function(e,t){t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3])}(a,Ts);var R=A?[e,I?I.slice(0):null,l,r,h,c,C,k,t,i,p]:null;R&&v&&R.push(m,g,b,_,w,x),a.push(R)}else A&&(v&&this.replayTextBackground_(e,b,_,w,x,m,g),no(e,I,l,r,h,c,C,k,t,i,p))},t.prototype.applyPixelRatio=function(e){var t=this.pixelRatio;return 1==t?e:e.map(function(e){return e*t})},t.prototype.appendFlatCoordinates=function(e,t,i,r,o,n){var a=this.coordinates.length,s=this.getBufferedMaxExtent();n&&(t+=r);var l,h,c,u=[e[t],e[t+1]],p=[NaN,NaN],d=!0;for(l=t+r;l<i;l+=r)p[0]=e[l],p[1]=e[l+1],(c=Po(s,p))!==h?(d&&(this.coordinates[a++]=u[0],this.coordinates[a++]=u[1]),this.coordinates[a++]=p[0],this.coordinates[a++]=p[1],d=!1):c===Lo.INTERSECTING?(this.coordinates[a++]=p[0],this.coordinates[a++]=p[1],d=!1):d=!0,u[0]=p[0],u[1]=p[1],h=c;return(o&&d||l===t+r)&&(this.coordinates[a++]=u[0],this.coordinates[a++]=u[1]),a},t.prototype.drawCustomCoordinates_=function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n],l=this.appendFlatCoordinates(e,t,s,r,!1,!1);o.push(l),t=s}return t},t.prototype.drawCustom=function(e,t,i){this.beginGeometry(e,t);var r,o,n,a,s,l=e.getType(),h=e.getStride(),c=this.coordinates.length;if(l==or.MULTI_POLYGON){r=(e=e).getOrientedFlatCoordinates(),a=[];var u=e.getEndss();s=0;for(var p=0,d=u.length;p<d;++p){var f=[];s=this.drawCustomCoordinates_(r,s,u[p],h,f),a.push(f)}this.instructions.push([ks.CUSTOM,c,a,e,i,Ta])}else l==or.POLYGON||l==or.MULTI_LINE_STRING?(n=[],r=l==or.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,e.getEnds(),h,n),this.instructions.push([ks.CUSTOM,c,n,e,i,Sa])):l==or.LINE_STRING||l==or.MULTI_POINT?(r=e.getFlatCoordinates(),o=this.appendFlatCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([ks.CUSTOM,c,o,e,i,Ma])):l==or.POINT&&(r=e.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),o=this.coordinates.length,this.instructions.push([ks.CUSTOM,c,o,e,i]));this.endGeometry(e,t)},t.prototype.beginGeometry=function(e,t){this.beginGeometryInstruction1_=[ks.BEGIN_GEOMETRY,t,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ks.BEGIN_GEOMETRY,t,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){},t.prototype.fill_=function(e){if(this.alignFill_){var t=Ur(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.translate(t[0]%i,t[1]%i),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.setTransform.apply(e,oo)},t.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],br&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},t.prototype.renderDeclutter_=function(e,t){if(e&&e.length>5){var i=e[4];if(1==i||i==e.length-5){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var o=5,n=e.length;o<n;++o){var a=e[o];a&&(a.length>11&&this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12]),no.apply(void 0,a))}}e.length=5,Ao(e)}}},t.prototype.replay_=function(e,t,i,r,o,n,a){var s;this.pixelCoordinates_&&ba(t,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=en(this.coordinates,0,this.coordinates.length,2,t,this.pixelCoordinates_),function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5]}(this.renderedTransform_,t));for(var l,h,c,u,p,d,f,y,m,g,v,b,_=!kr(i),w=0,x=r.length,C=0,k=0,M=0,S=null,T=null,L=this.coordinateCache_,I=this.viewRotation_,E={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},O=this.instructions!=r||this.overlaps?0:200;w<x;){var P=r[w];switch(P[0]){case ks.BEGIN_GEOMETRY:g=P[1],_&&i[er(g)]||!g.getGeometry()?w=P[2]:void 0===a||Ho(a,g.getGeometry().getExtent())?++w:w=P[2]+1;break;case ks.BEGIN_PATH:k>O&&(this.fill_(e),k=0),M>O&&(e.stroke(),M=0),k||M||(e.beginPath(),u=p=NaN),++w;break;case ks.CIRCLE:var j=s[C=P[1]],A=s[C+1],R=s[C+2]-j,z=s[C+3]-A,D=Math.sqrt(R*R+z*z);e.moveTo(j+D,A),e.arc(j,A,D,0,2*Math.PI,!0),++w;break;case ks.CLOSE_PATH:e.closePath(),++w;break;case ks.CUSTOM:C=P[1],l=P[2];var F=P[3],N=P[4],G=6==P.length?P[5]:void 0;E.geometry=F,E.feature=g,w in L||(L[w]=[]);var V=L[w];G?G(s,C,l,2,V):(V[0]=s[C],V[1]=s[C+1],V.length=2),N(V,E),++w;break;case ks.DRAW_IMAGE:C=P[1],l=P[2],m=P[3],h=P[4],c=P[5],y=n?null:P[6];var B=P[7],q=P[8],U=P[9],W=P[10],H=P[11],Y=P[12],J=P[13],$=P[14],X=void 0,Z=void 0,K=void 0;for(P.length>16?(X=P[15],Z=P[16],K=P[17]):(X=$r,Z=K=!1),H&&(Y+=I);C<l;C+=2)this.replayImage_(e,s[C],s[C+1],m,h,c,y,B,q,U,W,Y,J,o,$,X,Z?S:null,K?T:null);this.renderDeclutter_(y,g),++w;break;case ks.DRAW_CHARS:var Q=P[1],ee=P[2],te=P[3];y=n?null:P[4];var ie=P[5],re=P[6],oe=P[7],ne=P[8],ae=P[9],se=P[10],le=P[11],he=P[12],ce=P[13],ue=P[14],pe=za(s,Q,ee,2),de=ne(he);if(ie||de<=pe){var fe=this.textStates[ce].textAlign,ye=ms(s,Q,ee,2,he,ne,(pe-de)*Ss[fe],oe);if(ye){var me=void 0,ge=void 0,ve=void 0,be=void 0,_e=void 0;if(se)for(me=0,ge=ye.length;me<ge;++me)ve=(_e=ye[me])[4],be=this.getImage(ve,ce,"",se),h=_e[2]+le,c=te*be.height+2*(.5-te)*le-ae,this.replayImage_(e,_e[0],_e[1],be,h,c,y,be.height,1,0,0,_e[3],ue,!1,be.width,$r,null,null);if(re)for(me=0,ge=ye.length;me<ge;++me)ve=(_e=ye[me])[4],be=this.getImage(ve,ce,re,""),h=_e[2],c=te*be.height-ae,this.replayImage_(e,_e[0],_e[1],be,h,c,y,be.height,1,0,0,_e[3],ue,!1,be.width,$r,null,null)}}this.renderDeclutter_(y,g),++w;break;case ks.END_GEOMETRY:if(void 0!==n){var we=n(g=P[1]);if(we)return we}++w;break;case ks.FILL:O?k++:this.fill_(e),++w;break;case ks.MOVE_TO_LINE_TO:for(C=P[1],l=P[2],v=s[C],f=(b=s[C+1])+.5|0,(d=v+.5|0)===u&&f===p||(e.moveTo(v,b),u=d,p=f),C+=2;C<l;C+=2)d=(v=s[C])+.5|0,f=(b=s[C+1])+.5|0,C!=l-2&&d===u&&f===p||(e.lineTo(v,b),u=d,p=f);++w;break;case ks.SET_FILL_STYLE:S=P,this.alignFill_=P[2],k&&(this.fill_(e),k=0,M&&(e.stroke(),M=0)),e.fillStyle=P[1],++w;break;case ks.SET_STROKE_STYLE:T=P,M&&(e.stroke(),M=0),this.setStrokeStyle_(e,P),++w;break;case ks.STROKE:O?M++:e.stroke(),++w;break;default:++w}}k&&this.fill_(e),M&&e.stroke()},t.prototype.replay=function(e,t,i,r,o){this.viewRotation_=i,this.replay_(e,t,r,this.instructions,o,void 0,void 0)},t.prototype.replayHitDetection=function(e,t,i,r,o,n){return this.viewRotation_=i,this.replay_(e,t,r,this.hitDetectionInstructions,!0,o,n)},t.prototype.reverseHitDetectionInstructions=function(){var e,t=this.hitDetectionInstructions;t.reverse();var i,r,o=t.length,n=-1;for(e=0;e<o;++e)(r=(i=t[e])[0])==ks.END_GEOMETRY?n=e:r==ks.BEGIN_GEOMETRY&&(i[2]=e,ga(this.hitDetectionInstructions,n,e),n=-1)},t.prototype.setFillStrokeStyle=function(e,t){var i=this.state;if(e){var r=e.getColor();i.fillStyle=mr(r||Hr)}else i.fillStyle=void 0;if(t){var o=t.getColor();i.strokeStyle=mr(o||Jr);var n=t.getLineCap();i.lineCap=void 0!==n?n:"round";var a=t.getLineDash();i.lineDash=a?a.slice():Yr;var s=t.getLineDashOffset();i.lineDashOffset=s||0;var l=t.getLineJoin();i.lineJoin=void 0!==l?l:"round";var h=t.getWidth();i.lineWidth=void 0!==h?h:1;var c=t.getMiterLimit();i.miterLimit=void 0!==c?c:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},t.prototype.createFill=function(e,t){var i=e.fillStyle,r=[ks.SET_FILL_STYLE,i];return"string"!=typeof i&&r.push(!0),r},t.prototype.applyStroke=function(e){this.instructions.push(this.createStroke(e))},t.prototype.createStroke=function(e){return[ks.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(e,t,i){var r=e.fillStyle;"string"==typeof r&&e.currentFillStyle==r||(void 0!==r&&this.instructions.push(t.call(this,e,i)),e.currentFillStyle=r)},t.prototype.updateStrokeStyle=function(e,t){var i=e.strokeStyle,r=e.lineCap,o=e.lineDash,n=e.lineDashOffset,a=e.lineJoin,s=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||o!=e.currentLineDash&&!ba(e.currentLineDash,o)||e.currentLineDashOffset!=n||e.currentLineJoin!=a||e.currentLineWidth!=s||e.currentMiterLimit!=l)&&(void 0!==i&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=o,e.currentLineDashOffset=n,e.currentLineJoin=a,e.currentLineWidth=s,e.currentMiterLimit=l)},t.prototype.endGeometry=function(e,t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[ks.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}(this.maxExtent),this.maxLineWidth>0)){var e=this.resolution*(this.maxLineWidth+1)/2;Io(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(vs),Es=function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(e,t,i,r){return this.appendFlatCoordinates(e,t,i,r,!1,!1)},t.prototype.drawPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),o=this.coordinates.length,n=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ks.DRAW_IMAGE,o,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ks.DRAW_IMAGE,o,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.drawMultiPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),o=this.coordinates.length,n=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ks.DRAW_IMAGE,o,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ks.DRAW_IMAGE,o,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0},t.prototype.setImageStyle=function(e,t){var i=e.getAnchor(),r=e.getSize(),o=e.getHitDetectionImage(1),n=e.getImage(1),a=e.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=t,this.hitDetectionImage_=o,this.image_=n,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScale(),this.width_=r[0]},t}(Is),Os=function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinates_=function(e,t,i,r){var o=this.coordinates.length,n=this.appendFlatCoordinates(e,t,i,r,!1,!1),a=[ks.MOVE_TO_LINE_TO,o,n];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},t.prototype.drawLineString=function(e,t){var i=this.state,r=i.strokeStyle,o=i.lineWidth;if(void 0!==r&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],xs);var n=e.getFlatCoordinates(),a=e.getStride();this.drawFlatCoordinates_(n,0,n.length,a),this.hitDetectionInstructions.push(ws),this.endGeometry(e,t)}},t.prototype.drawMultiLineString=function(e,t){var i=this.state,r=i.strokeStyle,o=i.lineWidth;if(void 0!==r&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],xs);for(var n=e.getEnds(),a=e.getFlatCoordinates(),s=e.getStride(),l=0,h=0,c=n.length;h<c;++h)l=this.drawFlatCoordinates_(a,l,n[h],s);this.hitDetectionInstructions.push(ws),this.endGeometry(e,t)}},t.prototype.finish=function(){var e=this.state;void 0!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ws),this.reverseHitDetectionInstructions(),this.state=null},t.prototype.applyStroke=function(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(ws),t.lastStroke=this.coordinates.length),t.lastStroke=0,e.prototype.applyStroke.call(this,t),this.instructions.push(xs)},t}(Is),Ps=function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinatess_=function(e,t,i,r){var o=this.state,n=void 0!==o.fillStyle,a=void 0!=o.strokeStyle,s=i.length;this.instructions.push(xs),this.hitDetectionInstructions.push(xs);for(var l=0;l<s;++l){var h=i[l],c=this.coordinates.length,u=this.appendFlatCoordinates(e,t,h,r,!0,!a),p=[ks.MOVE_TO_LINE_TO,c,u];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(Cs),this.hitDetectionInstructions.push(Cs)),t=h}return n&&(this.instructions.push(_s),this.hitDetectionInstructions.push(_s)),a&&(this.instructions.push(ws),this.hitDetectionInstructions.push(ws)),t},t.prototype.drawCircle=function(e,t){var i=this.state,r=i.fillStyle,o=i.strokeStyle;if(void 0!==r||void 0!==o){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ks.SET_FILL_STYLE,pr(Hr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var n=e.getFlatCoordinates(),a=e.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,a,!1,!1);var l=[ks.CIRCLE,s];this.instructions.push(xs,l),this.hitDetectionInstructions.push(xs,l),this.hitDetectionInstructions.push(_s),void 0!==i.fillStyle&&this.instructions.push(_s),void 0!==i.strokeStyle&&(this.instructions.push(ws),this.hitDetectionInstructions.push(ws)),this.endGeometry(e,t)}},t.prototype.drawPolygon=function(e,t){var i=this.state,r=i.fillStyle,o=i.strokeStyle;if(void 0!==r||void 0!==o){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ks.SET_FILL_STYLE,pr(Hr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var n=e.getEnds(),a=e.getOrientedFlatCoordinates(),s=e.getStride();this.drawFlatCoordinatess_(a,0,n,s),this.endGeometry(e,t)}},t.prototype.drawMultiPolygon=function(e,t){var i=this.state,r=i.fillStyle,o=i.strokeStyle;if(void 0!==r||void 0!==o){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ks.SET_FILL_STYLE,pr(Hr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var n=e.getEndss(),a=e.getOrientedFlatCoordinates(),s=e.getStride(),l=0,h=0,c=n.length;h<c;++h)l=this.drawFlatCoordinatess_(a,l,n[h],s);this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var t=this.coordinates,i=0,r=t.length;i<r;++i)t[i]=Na(t[i],e)},t.prototype.setFillStrokeStyles_=function(e){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill,e),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},t}(Is);function js(e,t,i,r,o){var n,a,s,l,h,c,u,p,d,f=i,y=i,m=0,g=0,v=i;for(n=i;n<r;n+=o){var b=t[n],_=t[n+1];void 0!==l&&(p=b-l,d=_-h,s=Math.sqrt(p*p+d*d),void 0!==c&&(g+=a,Math.acos((c*p+u*d)/(a*s))>e&&(g>m&&(m=g,f=v,y=n),g=0,v=n-o)),a=s,c=p,u=d),l=b,h=_}return(g+=s)>m?[v,n]:[f,y]}var As={Circle:Ps,Default:Is,Image:Es,LineString:Os,Polygon:Ps,Text:function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Xr.prune()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawText=function(e,t){var i=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||r)){var n,a,s=this.coordinates.length,l=e.getType(),h=null,c=2,u=2;if(o.placement===Mo){if(!Ho(this.getBufferedMaxExtent(),e.getExtent()))return;var p;if(h=e.getFlatCoordinates(),u=e.getStride(),l==or.LINE_STRING)p=[h.length];else if(l==or.MULTI_LINE_STRING)p=e.getEnds();else if(l==or.POLYGON)p=e.getEnds().slice(0,1);else if(l==or.MULTI_POLYGON){var d=e.getEndss();for(p=[],n=0,a=d.length;n<a;++n)p.push(d[n][0])}this.beginGeometry(e,t);for(var f,y=o.textAlign,m=0,g=0,v=p.length;g<v;++g){if(void 0==y){var b=js(o.maxAngle,h,m,p[g],u);m=b[0],f=b[1]}else f=p[g];for(n=m;n<f;n+=u)this.coordinates.push(h[n],h[n+1]);c=this.coordinates.length,m=p[g],this.drawChars_(s,c,this.declutterGroup_),s=c}this.endGeometry(e,t)}else{var _=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),w=_.width/this.pixelRatio;switch(l){case or.POINT:case or.MULTI_POINT:c=(h=e.getFlatCoordinates()).length;break;case or.LINE_STRING:h=e.getFlatMidpoint();break;case or.CIRCLE:h=e.getCenter();break;case or.MULTI_LINE_STRING:c=(h=e.getFlatMidpoints()).length;break;case or.POLYGON:if(h=e.getFlatInteriorPoint(),!o.overflow&&h[2]/this.resolution<w)return;u=3;break;case or.MULTI_POLYGON:var x=e.getFlatInteriorPoints();for(h=[],n=0,a=x.length;n<a;n+=3)(o.overflow||x[n+2]/this.resolution>=w)&&h.push(x[n],x[n+1]);if(0==(c=h.length))return}c=this.appendFlatCoordinates(h,0,c,u,!1,!1),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,e),this.hitDetectionInstructions.push(this.createFill(this.state,e))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,t),this.drawTextImage_(_,s,c),this.endGeometry(e,t)}}},t.prototype.getImage=function(e,t,i,r){var o,n=r+t+e+i+this.pixelRatio;if(!Xr.containsKey(n)){var a=r?this.strokeStates[r]||this.textStrokeState_:null,s=i?this.fillStates[i]||this.textFillState_:null,l=this.textStates[t]||this.textState_,h=this.pixelRatio,c=l.scale*h,u=Ss[l.textAlign||"center"],p=r&&a.lineWidth?a.lineWidth:0,d=e.split("\n"),f=d.length,y=[],m=function(e,t,i){for(var r=t.length,o=0,n=0;n<r;++n){var a=ro(e,t[n]);o=Math.max(o,a),i.push(a)}return o}(l.font,d,y),g=io(l.font),v=g*f,b=m+p,_=gr(Math.ceil(b*c),Math.ceil((v+p)*c));o=_.canvas,Xr.set(n,o),1!=c&&_.scale(c,c),_.font=l.font,r&&(_.strokeStyle=a.strokeStyle,_.lineWidth=p,_.lineCap=a.lineCap,_.lineJoin=a.lineJoin,_.miterLimit=a.miterLimit,br&&a.lineDash.length&&(_.setLineDash(a.lineDash),_.lineDashOffset=a.lineDashOffset)),i&&(_.fillStyle=s.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,x=.5-u,C=u*o.width/c+x*p;if(r)for(w=0;w<f;++w)_.strokeText(d[w],C+x*y[w],.5*(p+g)+w*g);if(i)for(w=0;w<f;++w)_.fillText(d[w],C+x*y[w],.5*(p+g)+w*g)}return Xr.get(n)},t.prototype.drawTextImage_=function(e,t,i){var r=this.textState_,o=this.textStrokeState_,n=this.pixelRatio,a=Ss[r.textAlign||"center"],s=Ss[r.textBaseline],l=o&&o.lineWidth?o.lineWidth:0,h=a*e.width/n+2*(.5-a)*l,c=s*e.height/n+2*(.5-s)*l;this.instructions.push([ks.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*n,(c-this.textOffsetY_)*n,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,e.width,r.padding==$r?$r:r.padding.map(function(e){return e*n}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([ks.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*n,(c-this.textOffsetY_)*n,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/n,e.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(e,t,i){var r=this.textStrokeState_,o=this.textState_,n=this.textFillState_,a=this.strokeKey_;r&&(a in this.strokeStates||(this.strokeStates[a]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var s=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:o.font,textAlign:o.textAlign||"center",scale:o.scale});var l=this.fillKey_;n&&(l in this.fillStates||(this.fillStates[l]={fillStyle:n.fillStyle}));var h=this.pixelRatio,c=Ss[o.textBaseline],u=this.textOffsetY_*h,p=this.text_,d=o.font,f=o.scale,y=r?r.lineWidth*f/2:0,m=this.widths_[d];m||(this.widths_[d]=m={}),this.instructions.push([ks.DRAW_CHARS,e,t,c,i,o.overflow,l,o.maxAngle,function(e){var t=m[e];return t||(t=m[e]=ro(d,e)),t*f*h},u,a,y*h,p,s,1]),this.hitDetectionInstructions.push([ks.DRAW_CHARS,e,t,c,i,o.overflow,l,o.maxAngle,function(e){var t=m[e];return t||(t=m[e]=ro(d,e)),t*f},u,a,y,p,s,1/h])},t.prototype.setTextStyle=function(e,t){var i,r,o;if(e){this.declutterGroup_=t;var n=e.getFill();n?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=mr(n.getColor()||Hr)):r=this.textFillState_=null;var a=e.getStroke();if(a){(o=this.textStrokeState_)||(o=this.textStrokeState_={});var s=a.getLineDash(),l=a.getLineDashOffset(),h=a.getWidth(),c=a.getMiterLimit();o.lineCap=a.getLineCap()||"round",o.lineDash=s?s.slice():Yr,o.lineDashOffset=void 0===l?0:l,o.lineJoin=a.getLineJoin()||"round",o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=mr(a.getColor()||Jr)}else o=this.textStrokeState_=null;i=this.textState_;var u=e.getFont()||"10px sans-serif";eo(u);var p=e.getScale();i.overflow=e.getOverflow(),i.font=u,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.textBaseline=e.getTextBaseline()||"middle",i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||$r,i.scale=void 0===p?1:p;var d=e.getOffsetX(),f=e.getOffsetY(),y=e.getRotateWithView(),m=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===m?0:m,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:er(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+er(r.fillStyle):""}else this.text_=""},t}(Is)},Rs=function(e){function t(t,i,r,o,n,a,s){e.call(this),this.declutterTree_=a,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=n,this.pixelRatio_=o,this.resolution_=r,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=gr(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addDeclutter=function(e){var t=null;return this.declutterTree_&&(e?(t=this.declutterGroup_)[4]++:(t=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),t},t.prototype.clip=function(e,t){var i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()},t.prototype.hasReplays=function(e){for(var t in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[t],r=0,o=e.length;r<o;++r)if(e[r]in i)return!0;return!1},t.prototype.finish=function(){for(var e in this.replaysByZIndex_){var t=this.replaysByZIndex_[e];for(var i in t)t[i].finish()}},t.prototype.forEachFeatureAtCoordinate=function(e,t,i,r,o,n,a){var s,l=2*(r=Math.round(r))+1,h=Wr(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=this.hitDetectionContext_;c.canvas.width!==l||c.canvas.height!==l?(c.canvas.width=l,c.canvas.height=l):c.clearRect(0,0,l,l),void 0!==this.renderBuffer_&&(Do(s=[1/0,1/0,-1/0,-1/0],e),Io(s,t*(this.renderBuffer_+r),s));var u,p,d=function(e){if(void 0!==zs[e])return zs[e];for(var t=2*e+1,i=new Array(t),r=0;r<t;r++)i[r]=new Array(t);var o=e,n=0,a=0;for(;o>=n;)Ds(i,e+o,e+n),Ds(i,e+n,e+o),Ds(i,e-n,e+o),Ds(i,e-o,e+n),Ds(i,e-o,e-n),Ds(i,e-n,e-o),Ds(i,e+n,e-o),Ds(i,e+o,e-n),2*((a+=1+2*++n)-o)+1>0&&(a+=1-2*(o-=1));return zs[e]=i,i}(r);function f(e){for(var t=c.getImageData(0,0,l,l).data,i=0;i<l;i++)for(var r=0;r<l;r++)if(d[i][r]&&t[4*(r*l+i)+3]>0){var o=void 0;return(!u||p!=ys.IMAGE&&p!=ys.TEXT||-1!==u.indexOf(e))&&(o=n(e)),o||void c.clearRect(0,0,l,l)}}this.declutterTree_&&(u=this.declutterTree_.all().map(function(e){return e.value}));var y,m,g,v,b,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort(ma),y=_.length-1;y>=0;--y){var w=_[y].toString();for(g=this.replaysByZIndex_[w],m=Ms.length-1;m>=0;--m)if(void 0!==(v=g[p=Ms[m]]))if(!a||p!=ys.IMAGE&&p!=ys.TEXT){if(b=v.replayHitDetection(c,h,i,o,f,s))return b}else{var x=a[w];x?x.push(v,h.slice(0)):a[w]=[v,h.slice(0)]}}},t.prototype.getClipCoords=function(e){var t=this.maxExtent_,i=t[0],r=t[1],o=t[2],n=t[3],a=[i,r,i,n,o,n,o,r];return en(a,0,8,2,e,a),a},t.prototype.getReplay=function(e,t){var i=void 0!==e?e.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var o=r[t];void 0===o&&(o=new(0,As[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[t]=o);return o},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return kr(this.replaysByZIndex_)},t.prototype.replay=function(e,t,i,r,o,n,a){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(ma),e.save(),this.clip(e,t);var l,h,c,u,p,d,f=n||Ms;for(l=0,h=s.length;l<h;++l){var y=s[l].toString();for(p=this.replaysByZIndex_[y],c=0,u=f.length;c<u;++c){var m=f[c];if(d=p[m],void 0!==d)if(!a||m!=ys.IMAGE&&m!=ys.TEXT)d.replay(e,t,i,r,o);else{var g=a[y];g?g.push(d,t.slice(0)):a[y]=[d,t.slice(0)]}}}e.restore()},t}(fs),zs={0:[[!0]]};function Ds(e,t,i){var r,o=Math.floor(e.length/2);if(t>=o)for(r=o;r<t;r++)e[r][i]=!0;else if(t<o)for(r=t+1;r<o;r++)e[r][i]=!0}var Fs=Rs,Ns={Point:function(e,t,i,r){var o=i.getImage();if(o){if(o.getImageState()!=_r.LOADED)return;var n=e.getReplay(i.getZIndex(),ys.IMAGE);n.setImageStyle(o,e.addDeclutter(!1)),n.drawPoint(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!!o)),s.drawText(t,r)}},LineString:function(e,t,i,r){var o=i.getStroke();if(o){var n=e.getReplay(i.getZIndex(),ys.LINE_STRING);n.setFillStrokeStyle(null,o),n.drawLineString(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!1)),s.drawText(t,r)}},Polygon:function(e,t,i,r){var o=i.getFill(),n=i.getStroke();if(o||n){var a=e.getReplay(i.getZIndex(),ys.POLYGON);a.setFillStrokeStyle(o,n),a.drawPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),ys.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},MultiPoint:function(e,t,i,r){var o=i.getImage();if(o){if(o.getImageState()!=_r.LOADED)return;var n=e.getReplay(i.getZIndex(),ys.IMAGE);n.setImageStyle(o,e.addDeclutter(!1)),n.drawMultiPoint(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!!o)),s.drawText(t,r)}},MultiLineString:function(e,t,i,r){var o=i.getStroke();if(o){var n=e.getReplay(i.getZIndex(),ys.LINE_STRING);n.setFillStrokeStyle(null,o),n.drawMultiLineString(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!1)),s.drawText(t,r)}},MultiPolygon:function(e,t,i,r){var o=i.getFill(),n=i.getStroke();if(n||o){var a=e.getReplay(i.getZIndex(),ys.POLYGON);a.setFillStrokeStyle(o,n),a.drawMultiPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),ys.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},GeometryCollection:function(e,t,i,r){var o,n,a=t.getGeometriesArray();for(o=0,n=a.length;o<n;++o){var s=Ns[a[o].getType()];s(e,a[o],i,r)}},Circle:function(e,t,i,r){var o=i.getFill(),n=i.getStroke();if(o||n){var a=e.getReplay(i.getZIndex(),ys.CIRCLE);a.setFillStrokeStyle(o,n),a.drawCircle(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),ys.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}}};function Gs(e,t,i,r,o,n){var a=!1,s=i.getImage();if(s){var l=s.getImageState();l==_r.LOADED||l==_r.ERROR?s.unlistenImageChange(o,n):(l==_r.IDLE&&s.load(),l=s.getImageState(),s.listenImageChange(o,n),a=!0)}return function(e,t,i,r){var o=i.getGeometryFunction()(t);if(!o)return;var n=o.getSimplifiedGeometry(r);if(i.getRenderer())!function e(t,i,r,o){if(i.getType()==or.GEOMETRY_COLLECTION){for(var n=i.getGeometries(),a=0,s=n.length;a<s;++a)e(t,n[a],r,o);return}var l=t.getReplay(r.getZIndex(),ys.DEFAULT);l.drawCustom(i,o,r.getRenderer())}(e,n,i,t);else{var a=Ns[n.getType()];a(e,n,i,t)}}(e,t,i,r),a}var Vs=i(5);class Bs{constructor(){this.queue=[]}push(e){this.queue.push(e)}remove(e){for(let t=0;t<this.queue.length;t++){let i=this.queue[t];if(i.x==e.x&&i.y==e.y&&ikt.z==e.z&&i.id==e.id)return void this.queue.splice(t,1)}}has(e){for(let t=0;t<this.queue.length;t++){let i=this.queue[t];if(i.x==e.x&&i.y==e.y&&i.z==e.z&&i.id==e.id)return!0}return!1}}const qs=[78271.51696402048,39135.75848201024,19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.8740565703525,76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032,4.777314267823516,2.388657133911758,1.194328566955879,.5971642834779395,.29858214173896974,.14929107086948487,.07464553543474244];function Us(e,t){function i(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);this.show=!e.defined(t.show)||t.show,this._tilingScheme=e.defined(t.tilingScheme)?t.tilingScheme:new e.WebMercatorTilingScheme({ellipsoid:t.ellipsoid}),this._tileWidth=e.defaultValue(t.tileWidth,512),this._tileHeight=e.defaultValue(t.tileHeight,512),this._readyPromise=e.when.resolve(!0),this._mvtParser=new ps,this.scene=t.scene,this._rectangle=e.defaultValue(t.rectangle,this._tilingScheme.rectangle),this.options=t,this._styleFun=t.style?t.style:createMapboxStreetsV6Style(),this._key=e.defaultValue(t.key,""),this._url=e.defaultValue(t.url,"https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/{z}/{x}/{y}.vector.pbf?access_token={k}"),this._resolutions=qs,this._pixelRatio=1,this._transform=[.125,0,0,.125,0,0],this._replays=["Default","Image","Polygon","LineString","Text"],this._tileQueue=new e.TileReplacementQueue,this._tileSends=new Bs,this._cacheSize=1024,this._maximumLevel=t.maximumLevel||20,this._minimumLevel=t.minimumLevel||0,this._labelsRenderMode=t.labelsRenderMode,this._labelsNoteStyle=t.labelsNoteStyle,this._dynamicEntityVisualizer=e.defined(t.dynamicEntityVisualizer)?t.dynamicEntityVisualizer:null,this._cacheCollection={},this._cacheCollectionIndex=0,this._wgs84Extent=t.wgs84Extent}function r(e,t){const i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}function n(e,t){if(!e||!t||!e._mvtLabelDetail)return;const i=e._mvtLabelDetail;Object.keys(i).forEach(function(e){const r=t[e];r&&Array.isArray(i[e])&&i[e].forEach(function(e){r.remove(e)})}),e._isLabelRemove=!0}return Object.defineProperties(i.prototype,{proxy:{get(){}},tileWidth:{get(){return this._tileWidth}},tileHeight:{get(){return this._tileHeight}},maximumLevel:{get(){return this._maximumLevel}},minimumLevel:{get(){return this._minimumLevel}},tilingScheme:{get(){return this._tilingScheme}},rectangle:{get(){return this._rectangle}},tileDiscardPolicy:{get(){}},errorEvent:{get(){return this._errorEvent}},ready:{get:()=>!0},readyPromise:{get(){return this._readyPromise}},credit:{get(){}},hasAlphaChannel:{get:()=>!0}}),i.prototype.getTileCredits=function(e,t,i){},i.prototype.requestImage=function(e,t,i,r){if(void 0==this._tilingScheme._rectangleSouthwest&&(i+=1),this._tileSends.has({x:e,y:t,z:i,id:this.options.threadId})){const r=function(e,t,i,r){let o=r.head;for(;void 0!=o&&(o.xMvt!=e||o.yMvt!=t||o.zMvt!=i);)o=o.replacementNext;return o}(e,t,i,this._tileQueue);if(void 0!=r)return function(e,t){if(!e||!t||!e._mvtLabelDetail)return;if(!e._isLabelRemove)return;const i=e._mvtLabelDetail;Object.keys(i).forEach(function(e){const r=t[e];r&&Array.isArray(i[e])&&i[e].forEach(function(e){r.add(e)})}),e._isLabelRemove=!1}(r,this._cacheCollection),r;this._tileSends.remove(e,t,i)}else this._tileSends.push({x:e,y:t,z:i,id:this.options.threadId}),this.drawTile(e,t,i)},i.prototype.drawTile=function(t,i,o){const a=this;let s=this._url;if(s=s.replace("{x}",t).replace("{y}",i).replace("{z}",o).replace("{k}",this._key),this._maximumLevel&&o>this._maximumLevel)return null;!function(t,i,l){e.Resource.createIfNeeded(s).fetchArrayBuffer().then(function(s){try{const h=document.createElement("canvas");h.width=512,h.height=512,h.xMvt=t,h.yMvt=i,h.zMvt=l,a._tileQueue.markTileRendered(h);const c=h.getContext("2d"),u=a._mvtParser.readFeatures(s),p=a._styleFun,d=[0,0,4096,4096];let f=new Fs(0,d,8,!0,512);const y=[],m={};"on-screen"===a._labelsRenderMode&&(h._mvtLabelDetail=m);for(let e=0;e<u.length;e++){const r=u[e];if("Point"===r.type_&&"on-screen"===a._labelsRenderMode){const e=p(r,a._resolutions[o]);a._parseFeature(m,r,e,t,i,o,d)}else y.push(r)}return y.forEach(e=>{const t=p(e,a._resolutions[o]);for(let i=0;i<t.length;i++)Gs(f,e,t[i],16)}),f.finish(),f.replay(c,a._transform,0,{},a._replays),a._tileQueue.count>a._cacheSize&&function(t,i,o){let a=t.tail;for(;t.count>o&&e.defined(a);){const e=a.replacementPrevious;r(t,a),n(a,i),a=null,a=e}}(a._tileQueue,a._cacheCollection,a._cacheSize/2),f=null,h}catch(e){console.log("err: ",e)}}).otherwise(function(e){return this._tileSends.remove(t,i,o),null})}(t,i,o)},i.prototype.pickFeatures=function(e,t,i,r,o){},i.prototype._parseFeature=function(t,i,r,n,a,s,l){if(this._tilingScheme&&this._tilingScheme.tileXYToRectangle){const h=this._tilingScheme._rectangleSouthwest?0:1,c=this._tilingScheme.tileXYToRectangle(n,a,s-h);if(!c)return;const u=i.properties_;if(!u)return;if(!r||Array.isArray(r)&&0===r.length)return;let p,d=u.layer;u.layer||(d="未定义图层"),this._cacheCollection[d]?p=this._cacheCollection[d]:(p=function(t,i,r){let o=void 0;return(o="label"===i?new e.LabelCollection({blendOption:e.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:r}):"ground"===i?new e.PrimitiveCollection({}):new e.BillboardCollection({blendOption:e.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:r})).__labelLayerName=t,o}(d,"",this.scene),this._cacheCollection[d]=p,this._dynamicEntityVisualizer.add(p,this._cacheCollectionIndex),this._cacheCollectionIndex+=1);const f=e.Rectangle.northwest(c),y=e.Rectangle.southeast(c);let m=function(e){const t={type:"label-symbol",color:"rgba(255,255,255,1)",haloColor:"rgba(0,0,0,0.5)",haloSize:2,lineHeight:1.1,lineWidth:80,lineMaxNum:3,angle:0,textWraps:!0,letterSpacing:"2px",xoffset:0,yoffset:0,font:{size:12,family:"微软雅黑",weight:"normal",style:"normal"},showBackground:!1,backgroundColor:"rgba(42,42,42,1)",backgroundPadding:[5,7],backgroundImage:void 0,showTextExtraIcon:!1,textExtraIcon:void 0,textExtraIconAnchor:"top",textExtraIconSize:14,showTextShadow:!1,textShadowOffsetX:1,textShadowOffsetY:1,textShadowColor:"#ffffff",textShadowBlur:2,showTextDecorationThroughline:!1,textDecorationThroughlineColor:"rgba(255,255,255,1)",textDecorationThroughlineWidth:1,showTextDecorationUnderline:!1,textDecorationUnderlineColor:"rgba(255,255,255,1)",textDecorationUnderlineWidth:1},i={};if(e){i.text=e.getText();const r=e.getFont(),o=Vs.a.parse(r,{fontSize:"12px",fontFamily:"微软雅黑",fontWeight:"normal",fontStyle:"normal"});t.font={size:parseFloat(o.fontSize),family:o.fontFamily,weight:o.fontWeight,style:o.fontStyle},t.xoffset=e.getOffsetX(),t.yoffset=e.getOffsetY(),i.scale=e.getScale()||1,t.angle=180*e.getRotation()/Math.PI;const n={left:"above-left",right:"above-right",center:"above-center",start:"above-left",end:"above-right"};n[e.getTextAlign()]&&(i.labelPlacement=n[e.getTextAlign()]);const a=e.getFill();if(a){const e=a.getColor();e&&(t.color=`rgba(${255*e[0]},${255*e[1]},${255*e[2]},${e[3]})`)}const s=e.getStroke();if(s){const e=s.getColor(),i=s.getWidth();e&&(t.haloColor=`rgba(${255*e[0]},${255*e[1]},${255*e[2]},${e[3]})`,t.haloSize=i)}const l=e.getBackgroundFill();if(l){const e=l.getColor();e&&(t.showBackground=!0,t.backgroundColor=`rgba(${255*e[0]},${255*e[1]},${255*e[2]},${e[3]})`)}}return i.symbol=t,i.heightReference=1,i}(r[0].getText());if(this._labelsNoteStyle){const e=Object.assign({},m.symbol,this._labelsNoteStyle.symbol||{}),t=Object.assign({},m,this._labelsNoteStyle||{});t.symbol=e,m=t}if(i.flatCoordinates_&&Array.isArray(i.flatCoordinates_)&&2===i.flatCoordinates_.length&&m.text){const r=i.flatCoordinates_,n=l[2],a=l[3],s=(e.Math.toDegrees(y.longitude)-e.Math.toDegrees(f.longitude))*r[0]/n+e.Math.toDegrees(f.longitude),h=(e.Math.toDegrees(y.latitude)-e.Math.toDegrees(f.latitude))*r[1]/a+e.Math.toDegrees(f.latitude);if(r[0]>n||r[1]>a)return;const c=e.Cartographic.toCartesian(new e.Cartographic(e.Math.toRadians(s),e.Math.toRadians(h),0));try{const i=e.DynamicLabelsUtil.createNoteBillBoardOptions("value",m.text,c,e.DynamicLabelsUtil.parsePointOptions(e.DynamicLabelsUtil.parseLabelsOption(new e.Style.LabelNoteStyle(m))));if(this._wgs84Extent instanceof o.Extent){if(!this._wgs84Extent.intersects(new o.Point({coordinates:[s,h]})))return}const r=p.add(i);t&&!t[d]&&(t[d]=[]),t[d].push(r)}catch(e){console.error(e)}}}},new i(t)}var Ws=class{constructor(e,t){this.viewer=e,this.scene=this.viewer.scene,this.url=t.styleUrl,!this.url&&t.ip&&(this.url=`http://${t.ip}:${t.port}/igs/rest/mrcs/vtiles/0/${t.layerName}`),this.options=t,this.callback=t.callback,this.token=t.token||"",this.opacity=t.opacity||1,this.vectortilejson=t.vectortilejson,this.threadId=t.threadId||1e4*Math.random(),this.show=t.show||!0,this.style=t.style,this.tilingScheme=t.tilingScheme,this.provider=null,this.maximumLevel=t.maximumLevel||20,this.minimumLevel=t.minimumLevel||0,this.labelsRenderMode=t.labelsRenderMode||"off-screen",this._dynamicEntityVisualizer="on-screen"===this.labelsRenderMode?new Cesium.DynamicEntityVisualizer(e.scene,{}):null,this.initDevicePixelRatio(),this._fetchService=new o.FetchServer("",{}),this._addCallback=t.addCallback||void 0,this._wgs84Extent=t.wgs84Extent,this._labelsNoteStyle=t.labelsNoteStyle,this._rectangle=t.rectangle,this.style&&("string"==typeof this.style?(this.url=this.style,this.requestVectortileJson()):(this.vectortilejson=this.style,this.requestStyleData(this.vectortilejson)))}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}bindEvent(){this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this)}requestVectortileJson(){if(!this.vectortilejson){const e=this;this._fetchService.request({url:this.url,method:"GET",success(t){e.vectortilejson=t,e.requestStyleData(e.vectortilejson)}})}}requestStyleData(e){this.vectortilejson=e;const t=function(e){const t=e.layers;let i,r,o,n,a,s=[];for(let l=0,h=t.length;l<h;++l)"background"==(i=t[l]).type||((n=i.source||Wi(t,i.ref))!=o&&(s.length&&(s=[]),a=(r=e.sources[n]).url,"vector"==r.type||"raster"==r.type||r.type,o=n),s.push(i.id));return s}(e),i=function(e){const t=e.sources;let i=[];for(const e in t)if(t.hasOwnProperty(e)){const r=t[e];r.type&&"vector"==r.type&&r.tiles&&r.tiles.length>0&&i.push(r)}return i}(e),r=function(e){let t=e.sprite;return t.indexOf("png")>0?t:t+=".png"}(e),o=this;this._fetchService.request({url:`${e.sprite}.json`,method:"GET",success(n){o.styleData={vectortilejson:e,layers:t,spritedata:n,spritepng:r,fonts:Zi,sources:i},o.addLayer(o.styleData),o._addCallback&&o._addCallback instanceof Function&&o._addCallback()}})}getLayer(){return self.provider?self.provider:void 0}addLayer(e){const t=ha(e.vectortilejson,Object.keys(e.vectortilejson.sources),null,e.spritedata,e.spritepng,e.fonts);if(e.sources.length>0){const i=e.sources[0],r=Us(Cesium,{key:this.token,url:i.tiles[0],style:t,opacity:this.opacity,threadId:this.threadId,show:this.show,tilingScheme:this.tilingScheme,maximumLevel:this.maximumLevel,minimumLevel:this.minimumLevel,scene:this.scene,dynamicEntityVisualizer:this._dynamicEntityVisualizer,labelsRenderMode:this.labelsRenderMode,wgs84Extent:this._wgs84Extent,labelsNoteStyle:this._labelsNoteStyle,rectangle:this._rectangle});this.provider=this.viewer.imageryLayers.addImageryProvider(r),this.provider.show=this.show,this.callback&&this.callback({imageryLayer:this.provider})}}updateStyle(e){this.styleData&&(this.styleData.vectortilejson=e,this.remove(),this.addLayer(this.styleData))}setLayoutProperty(e,t,i){if(!this.vectortilejson||!this.vectortilejson.layers)return;const{layers:r}=this.vectortilejson,o=r.filter(t=>t.id===e),n=o&&o.length>0?o[0]:void 0;n&&(n.layout=n.layout||{},n.layout[t]=i,this.styleData.vectortilejson=this.vectortilejson,this.remove(),this.addLayer(this.styleData))}setPaintProperty(e,t,i){if(!this.vectortilejson||!this.vectortilejson.layers)return;const{layers:r}=this.vectortilejson,o=r.filter(t=>t.id===e),n=o&&o.length>0?o[0]:void 0;n&&(n.paint=n.paint||{},n.paint[t]=i,this.remove(),this.addLayer(this.styleData))}setStyleLayerFilter(e,t){if(!this.vectortilejson||!this.vectortilejson.layers)return;const{layers:i}=this.vectortilejson,r=i.filter(t=>t.id===e),o=r&&r.length>0?r[0]:void 0;o&&(o.filter=o.filter||{},o.filter=t,this.remove(),this.addLayer(this.styleData))}unbindEvent(){}moveStartEvent(){}moveEndEvent(){}zoomStartEvent(){}zoomEndEvent(){}destroy(){this.remove()}setVisible(e){this.provider&&(this.provider.show=e)}setOpacity(e){this.provider&&(this.provider.alpha=e)}remove(){const e=this;e.provider&&(e.viewer.imageryLayers.remove(e.provider,!0),e.provider.show=!1)}};class Hs{}Hs.addIGSVectorTileLayer=function(e,t,i){const r=new Ws(t,{style:e.style||e.url,addCallback:i});return r.id=e.id,e.clippingArea&&Oi(e,r,t),r},Hs.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Ys=Hs;class Js{}Js.addTerrainCacheLayer=function(e,t,i){const r=Object.assign({url:e.url},e.extendOptions);t.terrainProvider=new Cesium.CesiumTerrainProvider(r),i()},Js.setOpacity=function(e,t){let i;1===e.opacity?(t.scene.globe.translucency.enabled=!1,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=1,t.scene.globe.baseColor=i):(t.scene.globe.translucency.enabled=!0,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=e.opacity,t.scene.globe.baseColor=i)},Js.removeLayer=function(e,t){t.terrainProvider=new Cesium.EllipsoidTerrainProvider};var $s=Js;const Xs=window.mapv||{},Zs=Xs.baiduMapLayer?Xs.baiduMapLayer.__proto__:Function;class Ks extends Zs{constructor(e,t,i,r){if(super(e,t,i),!Zs)return;this.map=e,this.scene=e.scene,this.dataSet=t;i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=r,this.stopAniamation=!1,this.animation=i.animation,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent()}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}clickEvent(e){const t=e.point;super.clickEvent(t,e)}mousemoveEvent(e){const t=e.point;super.mousemoveEvent(t,e)}addAnimatorEvent(){}animatorMovestartEvent(){const e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){this.map;this.options.methods&&(this.options.methods.click,this.options.methods.mousemove)}unbindEvent(){const e=this.map;this.options.methods&&(this.options.methods.click&&e.off("click",this.clickEvent),this.options.methods.mousemove&&e.off("mousemove",this.mousemoveEvent))}getContext(){return this.canvasLayer.canvas.getContext(this.context)}init(e){const t=this;t.options=e,this.initDataRange(e),this.context=t.options.context||"2d",t.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(t.options.zIndex),this.initAnimator()}_canvasUpdate(e){this.map;const t=this.scene;if(!this.canvasLayer||this.stopAniamation)return;const i=this,r=i.options.animation,o=i.getContext();if(i.isEnabledTime()){if(void 0===e)return void this.clear(o);"2d"===this.context&&(o.save(),o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, .1)",o.fillRect(0,0,o.canvas.width,o.canvas.height),o.restore())}else this.clear(o);if("2d"===this.context)for(const e in i.options)o[e]=i.options[e];else o.clear(o.COLOR_BUFFER_BIT);const n={transferCoordinate(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]);var r=i.map.camera.position;let o=i.map.scene.globe.ellipsoid.cartesianToCartographic(r).height;if(o+=1.2*i.map.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(r,t)>o)return;r=Cesium.Cartesian3.fromDegrees(e[0],e[1]);const n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.map.scene,r);return n?[n.x,n.y]:[0,0]}};void 0!==e&&(n.filter=function(t){const i=r.trails||10;return!!(e&&t.time>e-i&&t.time<e)});const a=i.dataSet.get(n);this.processData(a),"m"==i.options.unit&&i.options.size,i.options._size=i.options.size;let s=Cesium.SceneTransforms.wgs84ToWindowCoordinates(t,Cesium.Cartesian3.fromDegrees(0,0));s||(s=[0,0]),this.drawContext(o,new Xs.DataSet(a),i.options,s),i.options.updateCallback&&i.options.updateCallback(e)}updateData(e,t){let i=e;i&&i.get&&(i=i.get()),void 0!=i&&this.dataSet.set(i),super.update({options:t})}addData(e,t){let i=e;e&&e.get&&(i=e.get()),this.dataSet.add(i),this.update({options:t})}getData(){return this.dataSet}removeData(e){if(!this.dataSet)return;const t=this.dataSet.get({filter:t=>null==e||"function"!=typeof e||!e(t)});this.dataSet.set(t),this.stopAniamation=!0}clearData(){this.dataSet&&this.dataSet.clear(),this.stopAniamation=!0}draw(){this.canvasLayer.draw()}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}}let Qs=0;class el{}el.addMapVLayer=function(e,t){const i=new class{constructor(e,t,i,r){this.map=e,this.scene=e.scene,this.mapvBaseLayer=new Ks(e,t,i,this),this.mapVOptions=i,this.initDevicePixelRatio(),this.canvas=this._creteWidgetCanvas(),this.render=this.render.bind(this),this.handler=void 0,this.postRenderTime=0;const o=i.cesium;if(o&&(this.postRender=o.postRender||!1,this.postRenderFrame=o.postRenderFrame||30),void 0!=r)this.container=r,r.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}this.bindEvent(),this._reset()}initDevicePixelRatio(){this.devicePixelRatio=1}addInnerContainer(){this.container.appendChild(this.canvas)}bindEvent(){const e=this.map;if(this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this),this.postEventHandle=this.postEvent.bind(this),this.postStartEvent=this.postStartEvent.bind(this),this.postEndEvent=this.postEndEvent.bind(this),this.postRender)this.scene.camera.moveStart.addEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.addEventListener(this.postEndEvent,this);else{const t=new Cesium.ScreenSpaceEventHandler(this.scene.canvas);t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),e.scene.camera.moveEnd.addEventListener(this.innerMoveEnd(),this),this.handler=t}}unbindEvent(){const e=this.map;if(this.postRender)this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this);else{const t=this.handler;t&&(t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),t.destroy()),e.scene.camera.moveEnd.removeEventListener(this.innerMoveEnd(),this)}}postStartEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMovestartEvent(),this.scene.postRender.addEventListener(this._reset,this)),this._visiable()}postEndEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMoveendEvent(),this.scene.postRender.removeEventListener(this._reset,this)),this._reset(),this._visiable()}moveStartEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}moveEndEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}zoomStartEvent(){this._unvisiable()}zoomEndEvent(){this._unvisiable()}postEvent(){this.postRenderTime++,this.postRenderTime%this.postRenderFrame==0&&this.moveEndEvent()}addData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.addData(e,t)}updateData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.updateData(e,t)}getData(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}removeData(e){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer&&this.mapvBaseLayer.removeData(e)}removeAllData(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.clearData()}_visiable(){return this.canvas.style.display="block",this}_unvisiable(){return this.canvas.style.display="none",this}setOpacity(e){return this.canvas.style.opacity=e,this}_createCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${Qs++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext(this.mapVOptions.context).scale(t,t),e}_creteWidgetCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${Qs++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t),e}_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()}draw(){this._reset()}show(){this._visiable()}hide(){this._unvisiable()}destroy(){this.remove()}remove(){void 0!=this.mapvBaseLayer&&(this.unbindEvent(),this.removeAllData(),this.mapvBaseLayer.clear(this.mapvBaseLayer.getContext()),this.mapvBaseLayer=void 0,this.canvas.parentElement.removeChild(this.canvas))}update(e){void 0!=e&&this.updateData(e.data,e.options)}resizeCanvas(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth)*this.devicePixelRatio,e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight)*this.devicePixelRatio,e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t)}fixPosition(){}onResize(){}render(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer._canvasUpdate()}}(t,e.data,e.mapVOptions);return i.id=e.id,i},el.removeLayer=function(e){e.remove()};var tl=el;class il{}il.addTDTLayer=function(e,t){const i={url:`http://t${parseInt(String(Math.floor(7*Math.random())))}.tianditu.gov.cn/${e.layerType}_${e._tileMatrixSetID}/wmts?${e.tokenKey}=${e.tokenValue}`,layer:e.layerType,format:e.imageFormat,style:e.style,tileMatrixSetID:e._tileMatrixSetID},r=Ci(e,t),o=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider(i),r);return o.id=e.id,o._realIndex=e._realIndex+1,o},il.removeLayer=function(e,t){t.scene.imageryLayers.remove(e)};var rl=il;class ol{}ol.addArcGISMapImageLayer=function(e,t){const i=xi(e.spatialReference,e.extent),r=ki(e,i.rectangle),o={url:e.url,usePreCachedTilesIfAvailable:!1,layers:e.layers,tilingScheme:i,rectangle:Cesium.Rectangle.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax)},n=Ci(e,t),a=t.imageryLayers.addImageryProvider(new Cesium.ArcGisMapServerImageryProvider(o),n);return a.id=e.id,a._realIndex=e._realIndex+1,a},ol.removeLayer=function(e,t){t.imageryLayers.remove(e)};var nl=ol;class al{}al.addWebTileLayer=function(e,t){const i=xi(e.spatialReference,e.extent,e.tileInfo),r=ki(e,i.rectangle);let o=e.url;o=(o=(o=o.replace("{col}","{x}")).replace("{row}","{y}")).replace("{level}","{z}"),e.tokenKey&&e.tokenValue&&(o+=`&${e.tokenKey}=${e.tokenValue}`);const n={url:o,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:i,rectangle:Cesium.Rectangle.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax)},a=Ci(e,t),s=t.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider(n),a);return e.clippingArea&&Oi(e,s,t),s.id=e.id,s._realIndex=e._realIndex+1,s},al.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var sl=al;var ll=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this,n=xi(t.spatialReference,t.extent,t.tileInfo),a=ki(t,n.rectangle);a.spatialReference=new o.SpatialReference("EPSG:4326");const s=Cesium.Rectangle.fromDegrees(a.xmin,a.ymin,a.xmax,a.ymax);return new Promise(e=>{const o=Array.isArray(t.labelingInfo)&&t.labelingInfo.length>0?t.labelingInfo[0]:void 0;r.innerLayer=new Ws(i,{tilingScheme:n,rectangle:s,wgs84Extent:a,labelsRenderMode:t.labelsRenderMode,labelsNoteStyle:o,style:t.style,addCallback(){e(r)}}),r.innerLayer.id=t.id})}onRemove(e){return this.innerLayer.remove(),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;if(e.updateContent)for(let i=0;i<e.updateContent.length;i++){const r=e.updateContent[i],o=r.params;if(r)switch(r.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":case"setStyleLayerFilter":case"setStyleLayerZoomRange":t.updateStyle(this.layer.style);break;case"opacity":t.setOpacity(o[0]);break;case"visible":t.setVisible(o[0]);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer.provider,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;default:t.updateStyle(this.layer.style)}}return Promise.resolve(this)}};class hl{}hl.addWMSLayer=function(e,t){const i=xi(e.spatialReference,e.extent),r=ki(e,i.rectangle),o={url:e.url,layers:e.layers,parameters:{format:e.imageFormat,transparent:e.imageTransparency},tilingScheme:i,tileWidth:e.imageWidth,tileHeight:e.imageHeight,srs:`EPSG:${e.spatialReference.wkid}`,rectangle:Cesium.Rectangle.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax)},n=Ci(e,t),a=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider(o),n);return e.clippingArea&&Oi(e,a,t),a.id=e.id,a._realIndex=e._realIndex+1,a},hl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var cl=hl;function ul(e,t){let i=0;for(let r=0;r<e.length;r++)if(e[r].id===t.id){i=r-1;break}return i<0&&(i=0),i}function pl(e,t,i){const r=Ci(e,i),o=i.imageryLayers.indexOf(t);if(o>=r){for(let e=0;e<o-r;e++)i.imageryLayers.lower(t);t._realIndex=e._realIndex+1}else{for(let e=0;e<r-o;e++)i.imageryLayers.raise(t);t._realIndex=e._realIndex+1}}var dl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=cl.addWMSLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return cl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"spatialReference":cl.removeLayer(this.innerLayer,this.innerView),self.innerLayer=cl.addWMSLayer(this.layer,this.innerView);break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction))}}return Promise.resolve(this)}};class fl{}fl.addWMTSLayer=function(e,t){const{tileMatrixSetId:i,tileMatrixSets:r}=e.activeLayer,o=r.find(e=>e.id===i).tileInfo;let n=xi(e.spatialReference,e.activeLayer.extent,o);e.spatialReference.isWebMercator?o.lods[0].resolution*o.size[0]>40075016.685574&&(n=new Cesium.WebMercatorTilingScheme):e.spatialReference.isGeographic&&o.lods[0].resolution*o.size[0]>180&&(n=new Cesium.GeographicTilingScheme);const a=ki(e,n.rectangle);let s=e.url;e.tokenValue&&e.tokenKey&&(s+=`?${e.tokenKey}=${e.tokenValue}`);const l={url:s,layer:e.activeLayer.title,format:e.activeLayer.imageFormat,style:e.activeLayer.styleId,tileMatrixSetID:e.activeLayer.tileMatrixSetId,tilingScheme:n,tileWidth:e.imageWidth,tileHeight:e.imageHeight,rectangle:Cesium.Rectangle.fromDegrees(a.xmin,a.ymin,a.xmax,a.ymax),tileMatrixLabels:[]};for(let e=0;e<o.lods.length;e++)l.tileMatrixLabels.push(o.lods[e].level);const h=Ci(e,t),c=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider(l),h);return e.clippingArea&&Oi(e,c,t),c.id=e.id,c._realIndex=e._realIndex+1,c},fl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var yl=fl;var ml=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=yl.addWMTSLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return yl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction))}}return Promise.resolve(this)}};var gl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=Ri.addIGSTileLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return Ri.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Ri.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Ri.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var vl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=ji.addIGSMapImageLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return ji.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.layer.visible?this.innerLayer.alpha=this.layer.opacity:this.innerLayer.alpha=0;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":ji.removeLayer(this.innerLayer,this.innerView),self.innerLayer=ji.addIGSMapImageLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var bl=class{static applyUpdate(e,t,i,r){if(r.updateContent)for(let e=0;e<r.updateContent.length;e++){const n=r.updateContent[e];if(n)switch(n.name){case"visible":switch(t.type){case o.LayerType.wms:case o.LayerType.igsMapImage:case o.LayerType.igsTile:case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:case o.LayerType.m3dCache:i.show=!i.show}break;case"opacity":switch(t.type){case o.LayerType.wms:i.alpha=t.opacity;break;case o.LayerType.m3dCache:i.translucency=t.opacity;break;case o.LayerType.cesium3DTiles:i.style=new Cesium.Cesium3DTileStyle,i.style.color={evaluateColor(e,i){if(i)return i.alpha=t.opacity,i}}}}}if(!i)return;let n=!1;switch(t.type){case o.LayerType.igsVectorTile:i.updateStyle(t.style),n=!0}if(r.extend&&r.extend.type){switch(r.extend.type){case o.LayerEventType.layerUpdateOpacity:switch(t.type){case o.LayerType.igsMapImage:case o.LayerType.igsTile:i.alpha=t.opacity,n=!0;break;case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:(i=e._innerView.scene.layers.getLayer(t.layerIndex)).translucency=t.opacity}break;case o.LayerEventType.layerUpdateVisible:switch(t.type){case o.LayerType.igsMapImage:case o.LayerType.igsTile:case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:i.show=!i.show,n=!0}break;case o.LayerEventType.layerUpdateStyle:switch(t.type){case o.LayerType.igsVectorTile:i.updateStyle(t.style),n=!0}break;case o.LayerEventType.layerSublayerVisible:switch(t.type){case o.LayerType.igsMapImage:i._imageryProvider._layers=t.layers,n=!0}}return n?new Promise(e=>{e()}):null}}};var _l=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{qi.addM3DLayer(t,i,this.view,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return qi.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return bl.applyUpdate(this.view,this.layer,t,e),Promise.resolve(this)}};var wl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{Vi.addCesium3DTilesLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Vi.removeLayer(this.layer,this.innerView),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return bl.applyUpdate(this.view,this.layer,t,e),Promise.resolve(this)}};var xl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{this.innerLayer=[],Ni.addSceneLayer(t,i,r.view,t=>{r.innerLayer=t,e(r)})})}onRemove(e){return Ni.removeLayer(this.innerLayer,this.view,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":for(let e=0;e<this.innerLayer.length;e++)this.innerLayer[e].show=this.layer.visible;break;case"opacity":const e=this.view.getInnerLayer(this.layer);for(let i=0;i<e.length;i++)e[t].translucency=this.layer.opacity}}return Promise.resolve(this)}};var Cl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{$s.addTerrainCacheLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return $s.removeLayer(this.layer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":$s.setOpacity(this.layer,this.innerView)}}}};function kl(e,t){this._CesiumMap=e,this._CesiumScene=e.scene,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}kl.prototype.dimensions=["lng","lat"],kl.prototype.setMapOffset=function(e){this._mapOffset=e},kl.prototype.getBMap=function(){return this._CesiumMap},kl.prototype.dataToPoint=function(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]),i=this._CesiumMap.camera.position;let r=this._CesiumMap.scene.globe.ellipsoid.cartesianToCartographic(i).height;if(r+=1.2*this._CesiumMap.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(i,t)>r)return[-50,-50];const o=this._mapOffset,n=Cesium.Cartesian3.fromDegrees(e[0],e[1]);let a=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,n);return[(a=a||{x:0,y:0}).x-o[0],a.y-o[1]]},kl.prototype.pointToData=function(e){const t=this._mapOffset,i=Cesium.Cartesian3.fromDegrees(e[0]+t[0],e[1]+t[1]),r=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,i);return[r.x,r.y]},kl.prototype.getViewRect=function(){const e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},kl.prototype.getRoamTransform=function(){return echarts.matrix.create()},kl.prototype.prepareCustoms=function(){const e=echarts.util,t=this.getViewRect();return{coordSys:{type:"cesium",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,i){return i=i||[0,0],e.map([0,1],function(e){const r=i[e],o=t[e]/2,n=[],a=[];return n[e]=r-o,a[e]=r+o,n[1-e]=i[1-e],a[1-e]=i[1-e],Math.abs(this.dataToPoint(n)[e]-this.dataToPoint(a)[e])},this)},this)}}},kl.dimensions=kl.prototype.dimensions,kl.create=function(e,t){let i;e.eachComponent("cesium",function(e){const r=echarts.cesiumMap;(i=new kl(r,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"cesium"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})};var Ml=kl;let Sl=0;class Tl{constructor(e,t,i){if(this.map=e,this.scene=e.scene,this.options=t,this.initStats=!1,this.handler=void 0,this.moveEndEvent=void 0,this.postEvent=void 0,this.postStartEvent=void 0,this.postEndEvent=void 0,this.layerId=t.layerId||`echarts${Sl++}`,this.layerClass=t.layerClass||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.visible=!0,this.canvas=this._createCanvas(),this.postRenderTime=0,this.postRenderFrame=t.postRenderFrame||30,void 0!=i)this.container=i,i.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}return this.chart=echarts.init(this.canvas),this.initEcharts(),this._resizeCanvas(),this.resize(),this}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}addInnerContainer(){this.container.appendChild(this.canvas)}initEcharts(){return echarts.cesiumMap=this.map,echarts.registerCoordinateSystem("cesium",Ml),echarts.extendComponentModel({type:"cesium",getBMap(){return this.__cesium},defaultOption:{roam:!1}}),echarts.registerAction({type:"CesiumRoma",event:"CesiumRoma",update:"updateLayout"},function(e,t){}),this}_createCanvas(){const e=document.createElement("div");e.className="cesium-echarts-layer",e.setAttribute("class","cesium-echarts-layer"),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.options.zIndex||100;const t=`${parseInt(this.map.canvas.width)}px`,i=`${parseInt(this.map.canvas.height)}px`;return e.width=t,e.height=i,e.style.width=t,e.style.height=i,e}_resizeCanvas(){const e=this;window.onresize=function(){if(void 0==this.canvas||null==this.canvas)return;const t=e.canvas,i=e.map;t.style.position="absolute",t.style.top="0px",t.style.left="0px";const r=`${parseInt(i.canvas.width)}px`,o=`${parseInt(i.canvas.height)}px`;t.width=r,t.height=o,t.style.width=r,t.style.height=o,e.chart.resize()}}_visible(){this.visible=!0,this.canvas.style.visibility="visible"}_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"}addTo(e){this.endStatus=!1;const t=this;return echarts.extendComponentView({type:"cesium",render(e,i,r){let o=!0;echarts.cesiumMap;const n=r.getZr().painter.getViewportRoot(),a=e.coordinateSystem,s=function(i,s){if(o||!t.map||!t.visible)return;t._unvisible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];n.style.left=`${h[0]}px`,n.style.top=`${h[1]}px`,a.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})},l=function(i,s){if(o||!t.map)return;t._visible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];n.style.left=`${h[0]}px`,n.style.top=`${h[1]}px`,a.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})};function h(){o||(t._visible(),r.dispatchAction({type:"CesiumRoma"}))}t.moveEndEvent=l;const c=function(){h()};t.postStartEvent=function(){this.endStatus||t.scene.postRender.addEventListener(c)}.bind(t);t.postEndEvent=function(){this.endStatus||(t.scene.postRender.removeEventListener(c),t.resize(),t._visible())}.bind(t),t.handler=new Cesium.ScreenSpaceEventHandler(t.scene.canvas),0==t.initStats&&(t.initStats=!0,t.options.postRender?(t.scene.camera.moveStart.addEventListener(t.postStartEvent,t),t.scene.camera.moveEnd.addEventListener(t.postEndEvent,t)):(t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.LEFT_UP),t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.RIGHT_UP),t.map.scene.camera.moveEnd.addEventListener(function(){t.moveEndEvent()}))),this._oldMoveHandler=s,this._oldZoomEndHandler=h;e.get("roam");o=!1}}),this.chart.setOption(this.options),this}show(){this._visible()}hide(){this._unvisible()}setOpacity(e){this.canvas.style.opacity=e}resize(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width),e.height=parseInt(this.map.canvas.height),e.style.width=this.map.canvas.style.width,e.style.height=this.map.canvas.style.height}remove(){this.endStatus=!0;const e=this;return this.chart.clear(),e.options.postRender?(this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this)):(this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_UP),this.scene.camera.moveEnd.removeEventListener(function(){e.moveEndEvent()}),this.handler.destroy()),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this}}window.EchartsLayer=Tl;class Ll{}Ll.addEchartsLayer=function(e,t){const i=new Tl(t,e.echartsOptions).addTo(t);return i.id=e.id,i},Ll.removeLayer=function(e){e.remove()};var Il=Ll;var El=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return this.innerLayer=Il.addEchartsLayer(t,i),Promise.resolve(this)}onRemove(e){return Il.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.layer.visible?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};var Ol=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return this.innerLayer=tl.addMapVLayer(t,i),Promise.resolve(this)}onRemove(e){return tl.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.layer.visible?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};class Pl{}Pl.addGroupLayer=function(e,t){const i=e.layers,r=[];for(let e=0;e<i.length;e++)switch(i[e].type){case o.LayerType.wmts:r.push(yl.addWMTSLayer(i[e],t));break;case o.LayerType.wms:r.push(cl.addWMSLayer(i[e],t));break;case o.LayerType.igsMapImage:r.push(ji.addIGSMapImageLayer(i[e],t));break;case o.LayerType.igsTile:r.push(Ri.addIGSTileLayer(i[e],t));break;case o.LayerType.cesium3DTiles:Vi.addCesium3DTilesLayer(i[e],t,function(e){r.push(e)});break;case o.LayerType.echarts:r.push(Il.addEchartsLayer(i[e],t));break;case o.LayerType.m3d:qi.addM3DLayer(i[e],t,function(e){r.push(e)});break;case o.LayerType.scene:Ni.addSceneLayer(i[e],t,function(e){r.push(e)});break;case o.LayerType.igsVectorTile:r.push(Ys.addIGSVectorTileLayer(i[e],t));break;case o.LayerType.mapv:r.push(tl.addMapVLayer(i[e],t));break;case o.LayerType.terrain:$s.addTerrainCacheLayer(i[e],t,function(e){r.push(e)})}return r},Pl.setLayerVisible=function(e,t,i){switch(e.type){case o.LayerType.echarts:case o.LayerType.mapv:i?t.show():t.hide();break;case o.LayerType.wms:case o.LayerType.wmts:case o.LayerType.igsMapImage:case o.LayerType.igsTile:case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:case o.LayerType.terrain:t.show=i}},Pl.removeLayer=function(e,t,i){switch(e.type){case o.LayerType.cesium3DTiles:Vi.removeLayer(e,i);break;case o.LayerType.echarts:Il.removeLayer(t);break;case o.LayerType.m3d:qi.removeLayer(e,i);break;case o.LayerType.igsMapImage:ji.removeLayer(t,i);break;case o.LayerType.scene:Ni.removeLayer(e,i);break;case o.LayerType.igsTile:Ri.removeLayer(t,i);break;case o.LayerType.igsVectorTile:Ys.removeLayer(t,i);break;case o.LayerType.mapv:tl.removeLayer(t);break;case o.LayerType.terrain:$s.removeLayer(e,i);break;case o.LayerType.wmts:yl.removeLayer(t,i);break;case o.LayerType.wms:cl.removeLayer(t,i)}},Pl.getLayerViews=function(e,t,i){const r=e.layers,o=[];for(let e=0;e<r.length;e++){const n=Bh(i,r[e]);for(let i=0;i<t.length;i++)if(t[i].id===r[e].id){n.innerLayer=t[i];break}o.push(n)}return o};var jl=Pl;var Al=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=jl.addGroupLayer(t,i),n.layerViews=jl.getLayerViews(t,n.innerLayer,n.view),clearInterval(a),e(n))},1)})}onRemove(e){for(let e=0;e<this.layer.layers.length;e++)switch(this.layer.layers[e].type){case o.LayerType.wms:case o.LayerType.wmts:case o.LayerType.igsTile:case o.LayerType.igsMapImage:this.innerView.scene.imageryLayers.remove(this.innerLayer[e]);break;case o.LayerType.echarts:case o.LayerType.mapv:this.innerLayer[e].remove();break;case o.LayerType.cesium3DTiles:this.innerView.scene.layers.removeCesium3DTilesetLayerByID(this.innerLayer[e].layerIndex);break;case o.LayerType.m3d:this.innerView.scene.layers.removeM3DLayerByID(this.innerLayer[e].layerIndex);break;case o.LayerType.scene:case o.LayerType.terrain:this.innerView.scene.layers.removeSceneLayerByID(this.innerLayer[e].layerIndex);break;case o.LayerType.igsVectorTile:this.innerView.imageryLayers.remove(this.innerLayer[e])}return Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":for(let e=0;e<this.layer.layers.length;e++)jl.setLayerVisible(this.layer.layers[e],this.innerLayer[e],this.layer.visible);break;case"opacity":for(let e=0;e<this.layer.layers.length;e++)switch(this.layer.layers[e].type){case o.LayerType.echarts:case o.LayerType.mapv:this.innerLayer[e].setOpacity(this.layer.opacity);break;case o.LayerType.wms:case o.LayerType.wmts:case o.LayerType.igsMapImage:case o.LayerType.igsTile:this.innerLayer[e].alpha=this.layer.opacity;break;case o.LayerType.terrain:$s.setOpacity(this.layer,this.innerView)}break;case"removeSubLayer":const e=i.params[0];for(let t=0;t<this.layer.layers.length;t++)if(this.layer.layers[t].id===e.id){jl.removeLayer(this.layer.layers[t],this.innerLayer[t],this.innerView);break}break;case"removeAllSubLayer":for(let e=0;e<this.layer.layers.length;e++)jl.removeLayer(this.layer.layers[e],this.innerLayer[e],this.innerView);this.innerLayer=[];break;case"addSubLayer":const t=this,r=i.params[0];for(let e=0;e<this.layer.layers.length;e++)if(this.layer.layers[e].id===r.id){switch(this.layer.layers[e].type){case o.LayerType.cesium3DTiles:Vi.addCesium3DTilesLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.echarts:t.innerLayer.push(Il.addEchartsLayer(r,t.innerView));break;case o.LayerType.m3d:qi.addM3DLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.igsMapImage:t.innerLayer.push(ji.addIGSMapImageLayer(r,t.innerView));break;case o.LayerType.scene:Ni.addSceneLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.igsTile:t.innerLayer.push(Ri.addIGSTileLayer(r,t.innerView));break;case o.LayerType.igsVectorTile:t.innerLayer.push(Ys.addIGSVectorTileLayer(r,t.innerView));break;case o.LayerType.mapv:t.innerLayer.push(tl.addMapVLayer(r,t.innerView));break;case o.LayerType.terrain:$s.addTerrainCacheLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.wmts:t.innerLayer.push(yl.addWMTSLayer(r,t.innerView));break;case o.LayerType.wms:t.innerLayer.push(cl.addWMSLayer(r,t.innerView))}break}}}return Promise.resolve(this)}};function Rl(e,t,i,r){if(i.elevationInfo.mode===o.ElevationMode.OnTheGround||i.elevationInfo.mode===o.ElevationMode.OnTheScene||i.elevationInfo.mode===o.ElevationMode.OnTheGroundAndScene){new Cesium.SampleElevationTool(t,e,"terrain",function(e){r&&r instanceof Function&&r(e)}).start({level:12})}return e}function zl(e){const t=e.geometry;let i=0;e.elevationInfo.mode===o.ElevationMode.AbsoluteHeight&&(i+=e.elevationInfo.offset);const r=[];let n;switch(t.type){case o.GeometryType.point:n=Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],t.coordinates[2]+i),r.push(n);break;case o.GeometryType.multiPoint:for(let e=0;e<t.coordinates.length;e++)n=Cesium.Cartesian3.fromDegrees(t.coordinates[e][0],t.coordinates[e][1],t.coordinates[e][2]+i),r.push(n);break;case o.GeometryType.polygon:const e=o.Geometry.fromJSON(t).centroid;n=Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]+i),r.push(n);break;case o.GeometryType.multiPolygon:const a=o.Geometry.fromJSON(t).toPolygonArray();for(let e=0;e<a.length;e++){const t=a[e].centroid;n=Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],t.coordinates[2]+i),r.push(n)}break;case o.GeometryType.extent:n=Cesium.Cartesian3.fromDegrees((t.xmin+t.xmax)/2,(t.ymin+t.ymax)/2,(t.zmin+t.zmax)/2+i),r.push(n);break;case o.GeometryType.circle:n=Cesium.Cartesian3.fromDegrees(t.center[0],t.center[1],t.center[2]+i),r.push(n)}return r}function Dl(e){let t=void 0;switch(e){case o.ElevationMode.OnTheGround:t=Cesium.ClassificationType.TERRAIN;break;case o.ElevationMode.OnTheScene:t=Cesium.ClassificationType.CESIUM_3D_TILE;break;case o.ElevationMode.OnTheGroundAndScene:t=Cesium.ClassificationType.BOTH}return t}function Fl(e,t){let i=void 0;switch(t){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:e,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:e})}return i}function Nl(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}function Gl(e,t){return(e=Object(o.defaultValue)(e,0))+t}function Vl(e,t){let i;Rl(t,e._viewer,e._feature,t=>{for(let t=0;t<e._pointsCollection._pointPrimitives.length;t++)e._pointsCollection._pointPrimitives[t]&&e._pointsCollection._pointPrimitives[t].id===e.id&&e._pointsCollection.remove(e._pointsCollection._pointPrimitives[t]);for(let r=0;r<t.length;r++)i=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromDegrees(t[r].longitude,t[r].latitude,t[r].height))),e._savePoint(i)})}function Bl(e,t){let i;Rl(t,e._viewer,e._feature,t=>{for(let t=0;t<e._billboardsCollection._billboards.length;t++)e._billboardsCollection._billboards[t]&&e._billboardsCollection._billboards[t].id===e.id&&e._billboardsCollection.remove(e._billboardsCollection._billboards[t]);for(let r=0;r<t.length;r++)i=e._billboardsCollection.add(e._createBillboardOptions(Cesium.Cartesian3.fromDegrees(t[r].longitude,t[r].latitude,t[r].height))),e._saveBillboard(i)})}function ql(e,t){let i;Rl(t,e._viewer,e._feature,t=>{for(let t=0;t<e._labelsCollection._labels.length;t++)e._labelsCollection._labels[t]&&e._labelsCollection._labels[t].id===e.id&&e._labelsCollection.remove(e._labelsCollection._labels[t]);for(let r=0;r<t.length;r++)i=e._labelsCollection.add(e._createLabelOptions(Cesium.Cartesian3.fromDegrees(t[r].longitude,t[r].latitude,t[r].height))),e._saveLabel(i)})}function Ul(e){let t=!1;return e.elevationInfo.mode!==o.ElevationMode.OnTheGround&&e.elevationInfo.mode!==o.ElevationMode.OnTheScene&&e.elevationInfo.mode!==o.ElevationMode.OnTheGroundAndScene||(t=!0),t}var Wl=class{constructor(e){e=Cesium.defaultValue(e,{}),this.commonLayerId=Cesium.defaultValue(e.layerId,null),this._feature=e.feature,this._feature||o.Log.error("feature不能为空!"),this._feature=o.Feature.fromJSON(this._feature.toJSON()),this._addZCoordinate(),this.checkSymbol()&&(this.id=Cesium.defaultValue(this._feature.id,Cesium.createGuid()),this.show=Cesium.defaultValue(this._feature.visible,!0),this._layerOpacity=Cesium.defaultValue(e.layerOpacity,1),this._primitivesCollection=Cesium.defaultValue(e.primitivesCollection,void 0),this._pointsCollection=Cesium.defaultValue(e.pointsCollection,void 0),this._billboardsCollection=Cesium.defaultValue(e.billboardsCollection,void 0),this._labelsCollection=Cesium.defaultValue(e.labelsCollection,void 0),this._points=[],this._billboards=[],this._labels=[],this._primitives=[],this._canvas=void 0,this._symbol=this._feature.symbol,this._elevationInfo=this._feature.elevationInfo,this._viewer=Cesium.defaultValue(e.viewer,void 0),this._createPrimitive())}update(e){this._feature=e,this._addZCoordinate(),this.show=this._feature.visible,this._removePrimitives(),this._createPrimitive()}destroy(){this._removePrimitives(),this.id=void 0,this.show=void 0,this._layerOpacity=void 0,this._feature=void 0,this._canvas=void 0,this._symbol=void 0,this._points=void 0,this._billboards=void 0,this._labels=void 0,this._primitives=void 0,this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0}checkSymbol(){return!0}setVisible(e){for(let t=0;t<this._points.length;t++)this._points[t].show=e;for(let t=0;t<this._labels.length;t++)this._labels[t].show=e;for(let t=0;t<this._billboards.length;t++)this._billboards[t].show=e;for(let t=0;t<this._primitives.length;t++)this._primitives[t].show=e}_getCesiumColor(e){return new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha)}_getCesiumColorByOpacity(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}_createAppearance(){}_createPrimitive(){}_getPositions(){const e=this._feature.geometry;let t=0;this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight&&(t+=this._elevationInfo.offset);const i=[];switch(e.type){case o.GeometryType.point:i.push(Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],Gl(e.coordinates[2],t)));break;case o.GeometryType.multiPoint:case o.GeometryType.lineString:for(let r=0;r<e.coordinates.length;r++)i.push(Cesium.Cartesian3.fromDegrees(e.coordinates[r][0],e.coordinates[r][1],Gl(e.coordinates[r][2],t)));break;case o.GeometryType.multiLineString:case o.GeometryType.polygon:for(let r=0;r<e.coordinates.length;r++){i.push([]);for(let o=0;o<e.coordinates[r].length;o++)i[r].push(Cesium.Cartesian3.fromDegrees(e.coordinates[r][o][0],e.coordinates[r][o][1],Gl(e.coordinates[r][o][2],t)))}break;case o.GeometryType.multiPolygon:for(let r=0;r<e.coordinates.length;r++){i.push([]);for(let o=0;o<e.coordinates[r].length;o++){i[r].push([]);for(let n=0;n<e.coordinates[r][o].length;n++)i[r][o].push(Cesium.Cartesian3.fromDegrees(e.coordinates[r][o][n][0],e.coordinates[r][o][n][1],Gl(e.coordinates[r][o][n][2],t)))}}break;case o.GeometryType.extent:i.push([]),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmin,e.ymin,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmax,e.ymin,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmax,e.ymax,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmin,e.ymax,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmin,e.ymin,Gl(e.zmin,t)));break;case o.GeometryType.circle:case o.GeometryType.arc:const r=e.toPolygon();for(let e=0;e<r.coordinates.length;e++){i.push([]);for(let o=0;o<r.coordinates[e].length;o++)i[e].push(Cesium.Cartesian3.fromDegrees(r.coordinates[e][o][0],r.coordinates[e][o][1],Gl(r.coordinates[e][o][2],t)))}}return 0===i.length&&o.Log.error("顶点数组为空,无法正常创建图形!"),i}_addZCoordinate(){const e=this._feature.geometry;if(!e.hasZ)switch(e.type){case o.GeometryType.point:e.coordinates.push(0);break;case o.GeometryType.multiPoint:case o.GeometryType.lineString:for(let t=0;t<e.coordinates.length;t++)e.coordinates[t].push(0);break;case o.GeometryType.multiLineString:case o.GeometryType.polygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)e.coordinates[t][i].push(0);break;case o.GeometryType.multiPolygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)for(let r=0;r<e.coordinates[t][i].length;r++)e.coordinates[t][i][r].push(0);break;case o.GeometryType.extent:e.zmin=0,e.zmax=0;break;case o.GeometryType.circle:e.center.push(0)}}_removePrimitives(){for(let e=0;e<this._points.length;e++)this._pointsCollection.remove(this._points[e]);this._points=[];for(let e=0;e<this._billboards.length;e++)this._billboardsCollection.remove(this._billboards[e]);this._billboards=[];for(let e=0;e<this._labels.length;e++)this._labelsCollection.remove(this._labels[e]);this._labels=[];for(let e=0;e<this._primitives.length;e++)this._primitivesCollection.remove(this._primitives[e]);this._primitives=[]}_saveBillboard(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._billboards.push(e)}_savePoint(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._points.push(e)}_saveLabel(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._labels.push(e)}};var Hl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.SimpleMarkerSymbol||(o.Log.info("要素的符号类型不是SimpleMarkerSymbol!"),!1)}_createPrimitive(){if(!this._feature.symbol.style)return;const e=Ul(this._feature);switch(this._feature.symbol.style){case"circle":this._createPointPrimitive(e);break;default:this._createBillBoardPrimitive(e)}}_getPositions(){return zl(this._feature)}_symbolEquals(e,t){let i=!0;return e.size===t.size&&e.style===t.style&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha||(i=!1),("circle"===e.style&&"circle"!==t.style||"circle"!==e.style&&"circle"===t.style)&&(this._primitiveCollection=void 0),i}_createBillBoardPrimitive(e){const t=this._feature.symbol;this._canvas?this._symbolEquals(t,this._symbol)||(this._canvas=Object(o.createSimpleMarkerSymbolCanvas)(t),this._symbol=t):this._canvas=Object(o.createSimpleMarkerSymbolCanvas)(t);const i=this._feature.geometry;let r,n=[];switch(i.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:e?(n.push(Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],0)),Bl(this,n)):(r=this._billboardsCollection.add(this._createBillboardOptions(this._getPositions()[0])),this._saveBillboard(r));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(n=this._getPositions(),e)Bl(this,n);else for(let e=0;e<n.length;e++)r=this._billboardsCollection.add(this._createBillboardOptions(n[e])),this._saveBillboard(r)}}_createBillboardOptions(e){const t=this._feature.symbol;return{position:e,image:this._canvas,color:new Cesium.Color(1,1,1,this._layerOpacity),width:t.size,height:t.size,pixelOffset:new Cesium.Cartesian2(t.xoffset,-1*t.yoffset)}}_createPointPrimitive(e){let t,i=[];const r=this._feature.geometry;switch(r.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:e?(i.push(Cesium.Cartesian3.fromDegrees(r.coordinates[0],r.coordinates[1],0)),Vl(this,i)):(t=this._pointsCollection.add(this._createPointOptions(this._getPositions()[0])),this._savePoint(t));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(i=this._getPositions(),e)Vl(this,i);else for(let e=0;e<i.length;e++)t=this._pointsCollection.add(this._createPointOptions(i[e])),this._savePoint(t);break;default:o.Log.error("要素的几何类型是不支持的类型!")}}_createPointOptions(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color);i.alpha*=this._layerOpacity;const r=this._getCesiumColor(t.outline.color);return r.alpha*=this._layerOpacity,{position:e,color:i,outlineColor:r,outlineWidth:t.outline.width,pixelSize:t.size}}};var Yl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.PictureMarkerSymbol||(o.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_createPrimitive(){const e=Ul(this._feature),t=this._feature.geometry;let i,r=[];switch(t.type){case o.GeometryType.point:e?(r.push(Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],0)),Bl(this,r)):(i=this._billboardsCollection.add(this._createBillboardOptions(this._getPositions()[0])),this._saveBillboard(i));break;case o.GeometryType.multiPoint:if(r=this._getPositions(),e)Bl(this,r);else for(let e=0;e<r.length;e++){const t=this._billboardsCollection.add(this._createBillboardOptions(r[e]));this._saveBillboard(t)}}}_createBillboardOptions(e){const t=this._feature.symbol;return{position:e,image:t.url,color:new Cesium.Color(1,1,1,this._layerOpacity),width:t.width,height:t.height,rotation:Cesium.Math.toRadians(t.angle),pixelOffset:new Cesium.Cartesian2(t.xoffset,-1*t.yoffset)}}};var Jl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.SimpleLineSymbol||(o.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(){switch(this._feature.geometry.type){case o.GeometryType.lineString:case o.GeometryType.arc:const e=this._primitivesCollection.add(this._createLinePrimitive(this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case o.GeometryType.multiLineString:const t=this._getPositions();for(let e=0;e<t.length;e++){const i=this._primitivesCollection.add(this._createLinePrimitive(t[e]));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i)}}}_createLinePrimitive(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color);let r;if(i.alpha*=this._layerOpacity,this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:e,width:t.width,arcType:Cesium.ArcType.NONE}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1});else{const o=Dl(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:e,width:t.width,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:o})}return r}_createAppearance(){const e=this._feature.symbol;let t=void 0;switch(this._feature.geometry.type){case o.GeometryType.lineString:case o.GeometryType.multiLineString:switch(e.type){case o.SymbolType.simpleLine:switch(e.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return t=this._createLineMaterial(),new Cesium.PolylineMaterialAppearance({material:t,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:return t=Cesium.Material.fromType("Color",{color:this._getCesiumColor(e.color)}),new Cesium.PolylineColorAppearance({material:t,renderState:{depthTest:{enabled:!0}}})}}break;default:o.Log.error("要素几何为不支持的类型!")}}_createLineMaterial(){const e=this._feature.symbol,t=this._getCesiumColor(e.color);t.alpha*=this._layerOpacity;let i=void 0;switch(e.style){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:t,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:t})}return i}};var $l=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.SimpleFillSymbol||(o.Log.info("要素的符号类型不是SimpleFillSymbol!"),!1)}_createPrimitive(){this._feature.symbol.style&&(this._createAllPolygonPrimitive(),this._createAllOutlinePrimitive())}_createAllPolygonPrimitive(){const e=this._feature.geometry,t=this._getPositions();switch(e.type){case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:case o.GeometryType.arc:const i=this._createPolygonPrimitive(t);i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i);break;case o.GeometryType.multiPolygon:for(let e=0;e<t.length;e++){const i=this._createPolygonPrimitive(t[e]);i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i)}}}_createPolygonPrimitive(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color),r=[];for(let t=1;t<e.length;t++)r.push(new Cesium.PolygonHierarchy(e[t]));let n=void 0;const a=this._feature.geometry;a.type===o.GeometryType.extent&&(n=a.zmax);const s=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(e[0],r),extrudedHeight:n,perPositionHeight:!0}),l=new Cesium.MaterialAppearance({material:this._createPolygonMaterial(),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),appearance:l,asynchronous:!1});else{const e=Dl(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),appearance:l,asynchronous:!1,classificationType:e})}return h=this._primitivesCollection.add(h)}_createAllOutlinePrimitive(){const e=this._feature.geometry;let t=[];switch(e.type){case o.GeometryType.polygon:t=this._createPolygonOutlineGraphic(e.coordinates);break;case o.GeometryType.extent:const i=this._getPositions();t=this._createPolygonOutlineGraphic(i);break;case o.GeometryType.circle:case o.GeometryType.arc:t=this._createPolygonOutlineGraphic([]);break;case o.GeometryType.multiPolygon:for(let i=0;i<e.coordinates.length;i++){const r=this._createPolygonOutlineGraphic(e.coordinates[i]);t=t.concat(r)}break;default:o.Log.info("要素为未支持的几何类型")}this._primitives=this._primitives.concat(t)}_createPolygonOutlineGraphic(e){const t=this._feature.symbol;let i=[];const r=this._feature.geometry;if(r.type===o.GeometryType.extent)i.push([]),i[0].push([r.xmin,r.ymin,r.zmin]),i[0].push([r.xmax,r.ymin,r.zmin]),i[0].push([r.xmax,r.ymax,r.zmin]),i[0].push([r.xmin,r.ymax,r.zmin]),i[0].push([r.xmin,r.ymin,r.zmin]),i[0].push([i[0][0][0]+(i[0][1][0]-i[0][0][0])/1e4,i[0][0][1]+(i[0][1][1]-i[0][0][1])/1e4,i[0][0][2]+(i[0][1][2]-i[0][0][2])/1e4]);else if(r.type===o.GeometryType.circle||r.type===o.GeometryType.arc)i=r.toPolygon().coordinates;else for(let t=0;t<e.length;t++){i.push([]);for(let r=0;r<e[t].length;r++)i[t].push(e[t][r]);i[t].push([i[t][0][0]+(i[t][1][0]-i[t][0][0])/1e4,i[t][0][1]+(i[t][1][1]-i[t][0][1])/1e4,i[t][0][2]+(i[t][1][2]-i[t][0][2])/1e4])}const n=new o.MultiLineString({coordinates:i}),a=new o.Feature({geometry:n,symbol:t.outline,elevationInfo:this._elevationInfo,visible:this.show});return new Jl({feature:a,layerOpacity:this._layerOpacity,primitivesCollection:this._primitivesCollection})._primitives}_createPolygonMaterial(){const e=this._feature.symbol;let t;switch(e.style){case"backward-diagonal":case"cross":case"diagonal-cross":case"forward-diagonal":case"horizontal":case"vertical":this._canvas?(this._symbol||(this._symbol=this._feature.symbol),this._symbolEquals(e,this._symbol)||(this._canvas=Object(o.createSimpleFillSymbolCanvas)(e),this._symbol=e)):this._canvas=Object(o.createSimpleFillSymbolCanvas)(e),t=Cesium.Material.fromType("TextImage",{image:this._canvas,repeat:new Cesium.Cartesian2(4,4),alpha:this._layerOpacity});break;default:const i=this._getCesiumColor(e.color);i.alpha*=this._layerOpacity,t=Cesium.Material.fromType("Color",{color:i})}return t}_symbolEquals(e,t){return e.style===t.style&&e.color.red===t.color.red&&e.color.green===t.color.green&&e.color.blue===t.color.blue&&e.color.alpha===t.color.alpha&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha}};var Xl=class extends $l{constructor(e){super(e)}_createPrimitive(){this._createAllPolygonPrimitive(),this._createAllOutlinePrimitive()}checkSymbol(){return this._feature.symbol instanceof o.PictureFillSymbol||(o.Log.info("要素的符号类型不是PictureFillSymbol!"),!1)}_createPolygonMaterial(){const e=this._feature.symbol,{url:t,xscale:i,yscale:r}=e;return new Cesium.Material({fabric:{type:"Image",uniforms:{color:new Cesium.Color(1,1,1,this._layerOpacity),image:t,repeat:{x:1/i,y:1/r}}}})}},Zl=i(1);var Kl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.TextSymbol||(o.Log.info("要素的符号类型不是TextSymbol!"),!1)}_createPrimitive(){const e=Ul(this._feature);let t,i=[];const r=this._feature.geometry;switch(this._primitiveCollection||(this._primitiveCollection=new Cesium.LabelCollection),r.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:e?(i.push(Cesium.Cartesian3.fromDegrees(r.coordinates[0],r.coordinates[1],0)),ql(this,i)):(t=this._labelsCollection.add(this._createLabelOptions(this._getPositions()[0])),this._saveLabel(t));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(i=this._getPositions(),e)ql(this,i);else for(let e=0;e<i.length;e++){const t=this._labelsCollection.add(this._createLabelOptions(i[e]));this._saveLabel(t)}}}_getPositions(){return zl(this._feature,this._viewer)}_createLabelOptions(e){const t=this._feature.symbol;return Cesium.DynamicLabelsUtil.createLabelOptions(this._feature.id,t.text,e,Zl.a.convertTextSymbolToLabelNoteStyle(t,{layerOpacity:this._layerOpacity}))}};var Ql=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.MapGISTextSymbol||(o.Log.info("要素的符号类型不是MapGISTextSymbol!"),!1)}_createPrimitive(){Ul(this._feature);let e,t=[];const i=this._feature.geometry;switch(this._billboardsCollection||(this._billboardsCollection=new Cesium.BillboardsCollection),i.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:Ul?(t.push(Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],0)),Bl(this,t)):(e=this._billboardsCollection.add(this._createBillboardOptions(this._getPositions()[0])),this._saveBillboard(e));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(t=this._getPositions(),Ul)Bl(this,t);else for(let i=0;i<t.length;i++)e=this._billboardsCollection.add(this._createBillboardOptions(t[i])),this._saveBillboard(e)}}_getPositions(){return zl(this._feature,this._viewer)}_createBillboardOptions(e){const t=this._feature.symbol;return Cesium.DynamicLabelsUtil.createNoteBillBoardOptions(this._feature.id,t.text,e,Zl.a.convertTextSymbolToLabelNoteStyle(t,{layerOpacity:this._layerOpacity}))}};function eh(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=e.anchorPosition,a=function(e){const t={horizontalOrigin:void 0,verticalOrigin:void 0};switch(e){case o.AnchorType.center:default:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case o.AnchorType.left:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case o.AnchorType.right:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case o.AnchorType.top:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case o.AnchorType.bottom:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case o.AnchorType.topLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case o.AnchorType.topRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case o.AnchorType.bottomLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case o.AnchorType.bottomRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM}return t}(e.anchor);return{show:i.show,position:t,image:i.image,color:Nl(r.color,i.layerOpacity),width:e.size,height:e.size,horizontalOrigin:a.horizontalOrigin,verticalOrigin:a.verticalOrigin,pixelOffset:new Cesium.Cartesian2(n.coordinates[0],-1*n.coordinates[1])}}function th(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=e.font;let a,s;switch(e.horizontalAlignment){case o.HorizontalAlignment.center:default:a=Cesium.HorizontalOrigin.CENTER;break;case o.HorizontalAlignment.right:a=Cesium.HorizontalOrigin.RIGHT;break;case o.HorizontalAlignment.left:a=Cesium.HorizontalOrigin.LEFT}switch(e.verticalAlignment){case o.VerticalAlignment.baseline:default:s=Cesium.VerticalOrigin.BASELINE;break;case o.VerticalAlignment.top:s=Cesium.VerticalOrigin.TOP;break;case o.VerticalAlignment.bottom:s=Cesium.VerticalOrigin.BOTTOM;break;case o.VerticalAlignment.middle:s=Cesium.VerticalOrigin.CENTER}return{show:i.show,position:t,text:e.text,fillColor:Nl(r.color,i.layerOpacity),font:`${e.size} ${n.family}`,backgroundColor:Nl(e.background,i.layerOpacity),horizontalOrigin:a,verticalOrigin:s}}function ih(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),a={show:i.show,url:e.resource.href,shadows:e.castShadows,scale:1,color:Nl(r.color,i.layerOpacity),modelMatrix:n,asynchronous:!1};return Cesium.Model.fromGltf(a)}function rh(e,t){t=Object(o.defaultValue)(t,{layerOpacity:1});const i=e.material;switch(i.type){case o.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Nl(i.color,t.layerOpacity)})})}}function oh(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),a=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Nl(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:a,appearance:rh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function nh(e,t,i){i=Object(o.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128,layerOpacity:1,show:!0});const r=e.material,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),a=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Nl(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:n,appearance:rh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function ah(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}function sh(e){const t=e.color,i=e.outline.color;return{color:new Cesium.Color(t.red/255,t.green/255,t.blue/255,t.alpha),pixelSize:e.size,show:"none"!==e.style,outlineColor:new Cesium.Color(i.red/255,i.green/255,i.blue/255,i.alpha),outlineWidth:e.outline.width}}var lh=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.LabelSymbol3D||(o.Log.info("要素的符号类型不是LabelSymbol3D!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const n=e.items[r];switch(t.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:i=this._getPositions(),this._createLabel(n,i[0]);break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLabel(n,i[e])}}}_getPositions(){return zl(this._feature,this._viewer)}_createLabel(e,t){const i=this._labelsCollection.add(r.createLabel(e,t,{show:this.show,layerOpacity:this._layerOpacity}));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._labels.push(i)}};var hh=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.id=Object(o.defaultValue)(e.id,Object(o.getGUID)()),this.opacity=Object(o.defaultValue)(e.opacity,1),this.elevationInfo=Object(o.defaultValue)(e.elevationInfo,new o.ElevationInfo),this._graphicsCollection=new o.Collection,this._primitivesCollection=new Cesium.PrimitiveCollection,this._pointsCollection=new Cesium.PointPrimitiveCollection,this._billboardsCollection=new Cesium.BillboardCollection,this._labelsCollection=new Cesium.LabelCollection,this._viewer=e.viewer,this._viewer.scene.primitives.add(this._primitivesCollection),this._viewer.scene.primitives.add(this._pointsCollection),this._viewer.scene.primitives.add(this._billboardsCollection),this._viewer.scene.primitives.add(this._labelsCollection)}add(e){let t,i=o.Feature.fromJSON(e);switch(i.elevationInfo||(i.elevationInfo=this.elevationInfo),i.additional&&i.additional.hasOwnProperty("arc3")&&(i=Object(o.editFeatureByArc3)(i)),i.symbol.type){case o.SymbolType.simpleMarker:t=new Hl({layerId:this.id,feature:i,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.pictureMarker:t=new Yl({layerId:this.id,feature:i,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.text:t=new Kl({layerId:this.id,feature:i,layerOpacity:this.opacity,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case o.SymbolType.mapgisText:t=new Ql({layerId:this.id,feature:i,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.simpleLine:t=new Jl({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.simpleFill:t=new $l({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.pictureFill:t=new Xl({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.line3D:t=new ph({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.polygon3D:t=new dh({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.point3D:t=new fh({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case o.SymbolType.label3D:t=new lh({layerId:this.id,feature:i,layerOpacity:this.opacity,labelsCollection:this._labelsCollection,viewer:this._viewer});break;default:o.Log.error("要素的符号暂时不支持!")}t&&this._graphicsCollection.add(t)}removeByID(e){const t=this._findGraphicById(e);this._graphicsCollection.remove(t),t.destroy()}update(e){let t=o.Feature.fromJSON(e.toJSON());t.additional.hasOwnProperty("arc3")&&(t=Object(o.editFeatureByArc3)(t));const i=this._findGraphicById(e.id);i._feature.symbol.type!==t.symbol.type?(this.removeByID(e.id),this.add(e)):i.update(t)}findByID(e){return this._findGraphicById(e)}getAll(){return this._graphicsCollection}remove(e){this.removeByID(e.id)}removeAll(){this._graphicsCollection.forEach(function(e){e.destroy()}),this._graphicsCollection.items=[]}destroy(){this.id=void 0,this.opacity=void 0,this._graphicsCollection=void 0,this._primitivesCollection.destroy(),this._primitivesCollection=void 0,this._pointsCollection.destroy(),this._pointsCollection=void 0,this._billboardsCollection.destroy(),this._billboardsCollection=void 0,this._labelsCollection.destroy(),this._labelsCollection=void 0,this._viewer=void 0}setVisible(e){this._graphicsCollection.forEach(function(t){t.setVisible(e)})}setOpacity(e){let t=e;t<0&&(t=0),t>1&&(t=1),this.opacity=t,this._graphicsCollection.forEach(function(e){e._layerOpacity=t,e.update(e._feature)})}_findGraphicById(e){let t=void 0;return this._graphicsCollection.forEach(function(i){i.id===e&&(t=i)}),t}};var ch=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.id=Object(o.defaultValue)(e.id,Object(o.getGUID)()),this._viewer=e.viewer,this._renderer=e.renderer,this._dataSource=new Cesium.CustomDataSource(this.id),this._initCluster()}_initCluster(){this._dataSourcePromise=this._viewer.dataSources.add(this._dataSource,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas});const e=this;this._dataSourcePromise.then(function(t){t.clustering.enabled=!0,t.clustering.pixelRange=e._renderer.radius,t.clustering.clusterEvent.addEventListener(function(t,i){i.label.show=!1,i.billboard.show=!1,i.point.show=!1;const r=e._renderer.clusterInfos,o=e._renderer.defaultSymbol;if(r instanceof Array&&r.length>0){let n=!1;for(let o=0;o<r.length;o++)if(t.length>=r[o].minValue&&t.length<r[o].maxValue){e._setClusterEntity(i,r[o].symbol,r[o].labelSymbol),n=!0;break}n||e._setClusterEntity(i,o)}else e._setClusterEntity(i,o)})})}_setClusterEntity(e,t,i){switch(t.type){case o.SymbolType.simpleMarker:switch(t.style){case"circle":this._setClusterPoint(e,t),i&&this._setClusterLabel(e,i,{});break;default:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{})}break;case o.SymbolType.pictureMarker:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{pictureMarkerSymbol:t})}}_setClusterLabel(e,t,i){i=Object(o.defaultValue)(i,{});const r=Object(o.defaultValue)(i.pictureMarkerSymbol,void 0);t&&t instanceof o.TextSymbol&&(e.label.show=!0,e.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.label.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.label.font=`${t.font.size}px ${t.font.family}`,e.label.fillColor=new Cesium.Color(t.color.red/255,t.color.green/255,t.color.blue/255,t.color.alpha),e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset)),r&&r instanceof o.PictureMarkerSymbol&&(e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset+-1*r.height))}_setClusterBillBoard(e,t){t&&(t instanceof o.PictureMarkerSymbol?(e.billboard.show=!0,e.billboard.image=t.url,e.billboard.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.billboard.width=t.width,e.billboard.height=t.height,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)):t instanceof o.SimpleMarkerSymbol&&(e.billboard.show=!0,e.billboard.image=Object(o.createSimpleMarkerSymbolCanvas)(t),e.billboard.width=t.size,e.billboard.height=t.size,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)))}_setClusterPoint(e,t){const i=sh(t);e.point.show=!0,e.point.color=i.color,e.point.pixelSize=i.pixelSize,e.point.outlineColor=i.outlineColor,e.point.outlineWidth=i.outlineWidth}add(e){e=Object(o.defaultValue)(e,{});const t={position:Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],1e3)},i=e.symbol;switch(i.type){case o.SymbolType.simpleMarker:switch(i.style){case"circle":t.point=sh(i),t.point.id=e.id;break;default:t.billboard=function(e){return{show:"none"!==e.style,image:Object(o.createSimpleMarkerSymbolCanvas)(e)}}(i),t.billboard.id=e.id}break;case o.SymbolType.pictureMarker:t.billboard=function(e){return{image:e.url,width:e.width,height:e.height,pixelOffset:new Cesium.Cartesian2(e.xoffset,e.yoffset),rotation:Cesium.Math.toRadians(e.angle)}}(i),t.billboard.id=e.id}this._dataSource.entities.add(t)}};var uh=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.id=Object(o.defaultValue)(e.id,Object(o.getGUID)()),this._field=Object(o.defaultValue)(e.field,void 0),this._valueExpression=Object(o.defaultValue)(e.valueExpression,void 0),this._features=Object(o.defaultValue)(e.features,[]),this._radius=Object(o.defaultValue)(e.radius,void 0),this._radiusFactor=Object(o.defaultValue)(e.radiusFactor,60),this._minDataValue=Object(o.defaultValue)(e.minDataValue,0),this._maxDataValue=Object(o.defaultValue)(e.maxDataValue,0),this._minCanvasSize=Object(o.defaultValue)(e.minCanvasSize,700),this._maxCanvasSize=Object(o.defaultValue)(e.maxCanvasSize,2e3),this._spacingFactor=Object(o.defaultValue)(e.spacingFactor,1.5),this._opacity=Object(o.defaultValue)(e.opacity,1),this._blur=Object(o.defaultValue)(e.blur,.85),this._gradient=Object(o.defaultValue)(e.gradient,{}),this._canChange=Object(o.defaultValue)(e.canChange,!0),this._viewer=Object(o.defaultValue)(e.viewer,void 0),this._heatMap=void 0,this._initHeatMap()}_initHeatMap(){this._viewer||o.Log.error("Cesium视图对象不能为空!"),this._features&&this._features instanceof Array||o.Log.error("热力图数据不能为空或者不是数组!"),this._field||this._valueExpression||o.Log.error("字段名或字段表达式不能为空!");const e=this._getHeatMapData(),t=this._getBounds(e),i=this._getGradient();this._heatMap=Cesium.CesiumHeatmap.create(this._viewer,t,{radius:this._radius,radiusFactor:this._radiusFactor,minCanvasSize:this._minCanvasSize,maxCanvasSize:this._maxCanvasSize,spacingFactor:this._spacingFactor,alpha:this._opacity,blur:this._blur,gradient:i,canChange:this._canChange}),this._heatMap.setWGS84Data(this._minDataValue,this._maxDataValue,e)}_getBounds(e){const t=[[]];for(let i=0;i<e.length;i++)t[0].push([e[i].x,e[i].y]);t[0].push(t[0][0]);const i=new o.Polygon({coordinates:t});return{west:i.extent.xmin,east:i.extent.xmax,south:i.extent.ymin,north:i.extent.ymax}}_getHeatMapData(){const e=[];for(let t=0;t<this._features.length;t++){const i=this._features[t],r=i.geometry;let n;switch(this._valueExpression?(n=Zl.a.parseExpression(i,this._valueExpression),n=Number(n)):n=Number(i.attributes[this._field]),r.type){case o.GeometryType.point:e.push({x:r.coordinates[0],y:r.coordinates[1],value:n});break;case o.GeometryType.multiPoint:for(let t=0;t<r.coordinates.length;t++)e.push({x:r.coordinates[t][0],y:r.coordinates[t][1],value:n});break;case o.GeometryType.lineString:e.push({x:r.extent.center.coordinates[0],y:r.extent.center.coordinates[1],value:n});break;case o.GeometryType.multiLineString:for(let i=0;i<r.coordinates.length;i++){const i=new o.LineString({coordinates:r.coordinates[t]});e.push({x:i.extent.center.coordinates[0],y:i.extent.center.coordinates[1],value:n})}break;case o.GeometryType.polygon:e.push({x:r.centroid.coordinates[0],y:r.centroid.coordinates[1],value:n});break;case o.GeometryType.multiPolygon:for(let i=0;i<r.coordinates.length;i++){const i=new o.Polygon({coordinates:r.coordinates[t]});e.push({x:i.centroid.coordinates[0],y:i.centroid.coordinates[1],value:n})}break;case o.GeometryType.extent:e.push({x:r.center.coordinates[0],y:r.center.coordinates[1],value:n});break;case o.GeometryType.circle:e.push({x:r.center[0],y:r.center[1],value:n})}}return e}_getGradient(){const e={};for(let t=0;t<this._gradient.length;t++)e[this._gradient[t].ratio]=this._gradient[t].color.toCssRGBAString();return e}destroy(){this._heatMap.removeLayer()}};var ph=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.LineSymbol3D||(o.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;for(let i=0;i<e.items.length;i++){const r=e.items[i];switch(r.type){case o.Symbol3DLayerType.line:default:switch(t.type){case o.GeometryType.lineString:case o.GeometryType.arc:const e=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case o.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}break;case o.Symbol3DLayerType.path:switch(t.type){case o.GeometryType.lineString:case o.GeometryType.arc:const e=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case o.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:Cesium.ArcType.NONE}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const i=Dl(this._elevationInfo.mode),o=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(_color)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:i})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let n=void 0;switch(i.type){case o.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:n,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case o.LineMarkerStyle.arrow:n=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:n,renderState:{depthTest:{enabled:!0}}})}}}_createPathSymbol3DLayerPrimitive(e,t){switch(e.profile){case o.ProfileType.circle:default:return this._createPolylineVolumePrimitive(e,t);case o.ProfileType.quad:return this._createCorridorPrimitive(e,t)}}_createPolylineVolumePrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),o=this._getCornerType(e),n=new Cesium.PolylineVolumeGeometry({polylinePositions:t,shapePositions:this._computeCircle(e.width>e.height?e.width:e.height),cornerType:o});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_computeCircle(e){const t=[];for(let i=0;i<360;i++){const r=Cesium.Math.toRadians(i);t.push(new Cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t}_createCorridorPrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),o=this._getCornerType(e),n=new Cesium.CorridorGeometry({positions:t,width:e.width,height:e.height,extrudedHeight:0,cornerType:o});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_createPathAppearance(e){switch(e.type){case o.MaterialType.color:default:const t=this._getCesiumColorByOpacity(e.color,this._layerOpacity);return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{_color:t})})}}_getCornerType(e){let t=void 0;switch(e.join){case o.LineJoinType.round:default:t=Cesium.CornerType.ROUNDED;break;case o.LineJoinType.bevel:t=Cesium.CornerType.BEVELED;break;case o.LineJoinType.miter:t=Cesium.CornerType.MITERED}return t}_getShadows(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}};var dh=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.PolygonSymbol3D||(o.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const n=e.items[r];switch(n.type){case o.Symbol3DLayerType.line:switch(t.type){case o.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLine(n,i[r]);break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;e++)this._createLine(n,i[e][t])}break;case o.Symbol3DLayerType.fill:default:switch(t.type){case o.GeometryType.polygon:this._createPolygon(n,this._getPositions());break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(n,i[e])}break;case o.Symbol3DLayerType.extrude:switch(t.type){case o.GeometryType.polygon:this._createPolygon(n,this._getPositions(),n.size);break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(n,i[e],n.size)}break;case o.Symbol3DLayerType.icon:switch(t.type){case o.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)this._createBillBoard(n,i[e][t]);break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)for(let r=0;r<i[e][t].length;r++)this._createBillBoard(n,i[e][t][r])}break;case o.Symbol3DLayerType.object:switch(t.type){case o.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length-1;t++)this._createObject(n,i[e][t]);break;case o.GeometryType.multiPolygon:i=this._getPositions()}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:Cesium.ArcType.NONE}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const o=Dl(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1,classificationType:o})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let n=void 0;switch(i.type){case o.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:n,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case o.LineMarkerStyle.arrow:n=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:n,renderState:{depthTest:{enabled:!0}}})}}}_createLine(e,t){const i=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(e,t));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i)}_createPolygon(e,t,i){const r=this._primitivesCollection.add(this._createFillSymbol3DLayerPrimitive(e,t,i));r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createFillSymbol3DLayerPrimitive(e,t,i){const n=e.material,a=[];for(let e=1;e<t.length;e++)a.push(new Cesium.PolygonHierarchy(t[e]));let s;s=i?new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],a),perPositionHeight:!0,height:i,extrudedHeight:i}):new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],a),perPositionHeight:!0});const l=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(n.color,this._layerOpacity)}),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(n.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,shadows:r.getShadows(e)});else{const t=Dl(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(n.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,classificationType:t,shadows:r.getShadows(e)})}return h=this._primitivesCollection.add(h)}_createIconSymbol3dLayerPrimitive(e,t){const i=e.material;return{position:t,image:e.resource.href,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),width:e.size,height:e.size,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}_createBillBoard(e,t){const i=this._billboardsCollection.add(this._createIconSymbol3dLayerPrimitive(e,t));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._billboards.push(i)}_createObject(e,t){const i=e.resource;let r;if(i.href)r=this._primitivesCollection.add(this._createModelPrimitive(e,t));else{let o;switch(i.primitive){case"sphere":r=this._primitivesCollection.add(this._createSpherePrimitive(e,t));break;case"cylinder":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:o,bottomRadius:o}));break;case"cone":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:o}));break;case"inverted-cone":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:o,bottomRadius:0}));break;case"tetrahedron":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:o,slices:3}))}}r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createSpherePrimitive(e,t){const i=e.material,r=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),o=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,modelMatrix:o,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createCylinderPrimitive(e,t,i){i=Object(o.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128});const r=e.material,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),a=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,modelMatrix:n,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createModelPrimitive(e,t){const i=e.material,r=Cesium.Transforms.eastNorthUpToFixedFrame(t),o={show:this.show,url:e.resource.href,shadows:e.castShadows,scale:1e3,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),modelMatrix:r,asynchronous:!1};return Cesium.Model.fromGltf(o)}_createObject3DAppearance(e){const t=e.material;switch(t.type){case o.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(t.color,this._layerOpacity)})})}}};var fh=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.PointSymbol3D||(o.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const n=e.items[r];switch(t.type){case o.GeometryType.point:i=this._getPositions(),this._createPointSymbol3D(n,i[0]);break;case o.GeometryType.multiPoint:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPointSymbol3D(n,i[e])}}}_createPointSymbol3D(e,t){switch(e.type){case o.Symbol3DLayerType.icon:default:this._createBillboard(e,t);break;case o.Symbol3DLayerType.text:this._createLabel(e,t);break;case o.Symbol3DLayerType.object:this._createObject(e,t)}}_createBillboard(e,t){let i;const n=e.resource;if(n.href)i=this._billboardsCollection.add(r.createBillboard(e,t,{image:n.href,show:this.show,layerOpacity:this._layerOpacity}));else{const a=new o.SimpleMarkerSymbol({style:n.primitive,size:e.size,color:e.material.color,outline:new o.SimpleLineSymbol({color:e.outline.color,width:e.outline.size})}),s=Object(o.createSimpleMarkerSymbolCanvas)(a);i=this._billboardsCollection.add(r.createBillboard(e,t,{image:s,show:this.show,layerOpacity:this._layerOpacity}))}i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._billboards.push(i)}_createLabel(e,t){const i=this._labelsCollection.add(r.createLabel(e,t,{show:this.show,layerOpacity:this._layerOpacity}));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._labels.push(i)}_createObject(e,t){const i={show:this.show,layerOpacity:this._layerOpacity},o=e.resource;let n;if(o.href)n=this._primitivesCollection.add(r.createModelPrimitive(e,t,i));else{let a;switch(o.primitive){case"sphere":n=this._primitivesCollection.add(r.createSpherePrimitive(e,t,{show:this.show,layerOpacity:this._layerOpacity}));break;case"cylinder":a=e.width>e.height?e.width:e.height,i.topRadius=a,i.bottomRadius=a,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i));break;case"cone":a=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=a,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i));break;case"inverted-cone":a=e.width>e.height?e.width:e.height,i.topRadius=a,i.bottomRadius=0,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i));break;case"tetrahedron":a=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=a,i.slices=3,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i))}}n.id=this._feature.id,n.commonFeatureId=this._feature.id,n.commonLayerId=this.commonLayerId,this._primitives.push(n)}};var yh=class extends o.BaseGraphicsLayerView{onAdd(e){const t=this.layer,i=this.innerView,r=t.graphics||[];this.innerLayer=new hh({id:t.id,viewer:i,opacity:this.layer.opacity,elevationInfo:t.elevationInfo});const o=this._projectFeatures(r);return this.render.drawFeature(this.innerLayer,o),Promise.resolve(this)}onRemove(e){return this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(e=>{if(e&&"property"===e.operationType)switch(e.name){case"opacity":{const i=e.params;t.setOpacity(i[0]);break}case"visible":{const i=e.params;t.setVisible(i[0]);break}}if(e&&"method"===e.operationType)switch(e.name){case"add":{const i=e.params,r=this._projectFeatures([i[0]]);this.render.drawFeature(t,r);break}case"remove":{const i=e.params;t.remove(i[0]);break}case"addMany":{const i=e.params,r=this._projectFeatures(i[0]);this.render.drawFeature(t,r);break}case"removeMany":e.params[0].forEach(e=>{t.remove(e)});break;case"removeAll":t.removeAll()}}),Promise.resolve(this)}_projectFeatures(e){const t=[];if(e instanceof o.FeatureSet)for(let i=0;i<e.features.length;i++)t.push(this._projectFeature(e.features[i]));else if(e instanceof o.FeatureCollection)e.forEach(e=>{t.push(this._projectFeature(e))});else for(let i=0;i<e.length;i++)t.push(this._projectFeature(e[i]));return t}_projectFeature(e){const t=o.Feature.fromJSON(e);return t.geometry.spatialReference.isGeographic||(t.geometry=o.Projection.project(t.geometry,new o.SpatialReference({wkid:4326}))),t}};function mh(e,t){return e.length>2?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]+t):Cesium.Cartesian3.fromDegrees(e[0],e[1],t)}function gh(e,t,i,r){const o=[];for(let n,a=0,s=e.length;a<s;a++)n=t?gh(e[a],t-1,i,r):(i||mh)(e[a],r),o.push(n);return o}function vh(e,t){return"4326"!==String(e.wkid)?(t.spatialReference=e,o.Projection.project(t,new o.SpatialReference("EPSG:4326"))):t}var bh=class{static toCartesian3Array(e,t){let i=[];const r=Object(o.defaultValue)(t,{}),n=Object(o.defaultValue)(r.offsetHeight,0);if(!(e instanceof o.Geometry))return i;let a=Object(o.defaultValue)(r.spatialReference,new o.SpatialReference("EPSG:4326"));switch(e.spatialReference&&(a=e.spatialReference),e.type){case o.GeometryType.point:{let t=e.clone();const r=(t=vh(a,t)).coordinates;i.push(mh(r,n));break}case o.GeometryType.multiPoint:case o.GeometryType.lineString:{let t=e.clone();i=gh((t=vh(a,t)).coordinates,0,mh,n);break}case o.GeometryType.multiLineString:case o.GeometryType.polygon:{let t=e.clone();i=gh((t=vh(a,t)).coordinates,1,mh,n);break}case o.GeometryType.multiPolygon:{let t=e.clone();i=gh((t=vh(a,t)).coordinates,2,mh,n);break}case o.GeometryType.extent:{let t=e.clone();const r=(t=vh(a,t)).xmin,o=t.xmax,s=t.ymin,l=t.ymax,h=t.zmin,c=t.zmax;let u,p;t.hasZ?(u=Cesium.Cartesian3.fromDegrees(r,s,h+n),p=Cesium.Cartesian3.fromDegrees(o,l,c+n)):(u=Cesium.Cartesian3.fromDegrees(r,s,n),p=Cesium.Cartesian3.fromDegrees(o,l,n)),i.push(u),i.push(p);break}case o.GeometryType.circle:{let t,r=e.clone();const o=(r=vh(a,r)).center;t=r.hasZ?Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]+n):Cesium.Cartesian3.fromDegrees(o[0],o[1],n),i.push(t);break}}return i}};function _h(e){let t,i,r,o,n=0;const a=e,s=[];for(t=1;t<a.length;t++)i=a[t],r=a[t-1],n+=o=Cesium.Cartesian3.distance(i,r),s.push(o);this.lenArr=s,this.len=n,this.coords=a}_h.prototype.getTotalLength=function(){return this.len},_h.prototype.getDetail=function(e){let t,i,r=e;r>=1&&(r=1),r<=0&&(r=0);const o=r*this.len;let n,a=0;const s=this.coords;for(n=0;n<this.lenArr.length;n++){if(o<=this.lenArr[n]+a){t=n,i=(o-a)/this.lenArr[n];break}a+=this.lenArr[n]}const l=new Cesium.Cartesian3;return Cesium.Cartesian3.lerp(s[t],s[t+1],i,l),{position:l,angle:180*window.Math.atan2(s[t+1].y-s[t].y,s[t+1].x-s[t].x)/window.Math.PI}},_h.prototype.getPartsByLength=function(e){const t=window.Math.round(e/this.len*1e3)/1e3,i=window.Math.ceil(this.len/e),r=[];if(1===i)r.push({startRate:0,endRate:1});else{let e;for(e=1;e<i;e++)r.push({startRate:(e-1)*t,endRate:e*t})}return r};var wh=_h;const xh=bh.toCartesian3Array;function Ch(e,t){const{symbol:i}=t,r=Zl.a.convertTextSymbolToLabelNoteStyle(i).symbol,o=Object.assign({},t,{symbol:r});return Cesium.DynamicLabelsUtil.parseNoteOptions(e,o)}function kh(e){return e instanceof Cesium.LabelCollection?Cesium.DynamicLabelsUtil.createLabelOptions:e instanceof Cesium.BillboardCollection?Cesium.DynamicLabelsUtil.createNoteBillBoardOptions:Cesium.DynamicLabelsUtil.createGroundOptions}function Mh(e,t,i,r,o,n,a){const s=function(e,t,i,r,o){let n=o-r;(n<=0||n>=1)&&(n=.4);const a=t-e,s=n*a;return{spaceRate:r*a+e,parseRate:Math.round(s/i*1e3)/1e3}}(i,r,o.length,a.repeatStartRate,a.repeatEndRate);for(let i=0;i<o.length;i++){const r=e.getDetail(s.spaceRate+s.parseRate*i),l=kh(t)(n,o[i],r.position,a);t.add(l)}}function Sh(e){const t=o.T.bbox(e),i=Math.PI,r=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[3]/180*i)),n=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[1]/180*i)),a=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[2]/180*i,t[3]/180*i));let s;return function(e,t,i,r,n,a,s){const l=o.T.lineSegment(t),h=0===e,c=h?(n-r)/i:(s-a)/i,u=[];let p,d;for(p=0;p<i;p++){const e=h?o.T.lineString([[r+p*c,s],[r+p*c,a]]):o.T.lineString([[n,s-p*c],[r,s-p*c]]),t=o.T.lineIntersect(e,l),i=t.features.length,f=[];let y;if(!(i<1)){for(d=0;d<i;d++)f.push(o.T.getCoord(t.features[d]));if(1===i)y=f[0],u.push(y);else{let e=0;for(let t=0;t<i;t+=2){const i=f[t],r=f[t+1];let o;h?(o=Math.abs(r[1]-i[1]))>=e&&(e=o,y=[i[0],(r[1]-i[1])/2+i[1]]):(o=Math.abs(r[0]-i[0]))>=e&&(e=o,y=[i[0]+(r[0]-i[0])/2,i[1]])}u.push(y)}}}return u}(s=Cesium.Cartesian3.distance(r,a)>Cesium.Cartesian3.distance(r,n)?0:1,e,20,t[0],t[2],t[1],t[3])}var Th=class{static renderLabel(e,t,i){if(t=t||[],!Array.isArray(t)||t.length<=0)return;const r=t[0].geometry.type;let n;n=[o.GeometryType.multiPolygon,o.GeometryType.polygon].some(e=>e===r)?Ch("Polygon",i):[o.GeometryType.lineString,o.GeometryType.multiLineString].some(e=>e===r)?Ch("Line",i):Ch("Point",i);const{currentAttributeName:a,labelExpression:s}=i,l=a?`$feature.${a}`:s;if(!l)return;const h=kh(e);t.forEach(t=>{const i=t.geometry,r=i.type;let a=xh(i);const s=Zl.a.parseExpression(t,l),c=t.id;if(s)switch(r){case o.GeometryType.point:case o.GeometryType.multiPoint:a.forEach(t=>{e.add(h(c,s,t,n))});break;case o.GeometryType.multiLineString:case o.GeometryType.lineString:r===o.GeometryType.lineString&&(a=[a]),a.forEach(t=>{let i=n.lineLabelSpread;const r=n.repeatLabel,o=n.repeatLabelDistance,a=n.labelPositionAlong;if(!s)return;let l;const u=new wh(t);if("auto-spread"===i&&(i=new RegExp("^[A-Za-z0-9]+$").test(s)?"centralization-spread":"decentralize-spread"),"decentralize-spread"===i){const t=s.split("");r?u.getPartsByLength(o).forEach(function(i){const r=i.startRate,o=i.endRate;Mh(u,e,r,o,t,c,n)}):Mh(u,e,0,1,t,c,n)}else"centralization-spread"===i&&(r?u.getPartsByLength(o).forEach(function(t){const i=t.startRate,r=t.endRate;"start"===a?(l=u.getDetail(i).position,e.add(h(c,s,l,n))):"end"===a?(l=u.getDetail(r).position,e.add(h(c,s,l,n))):(l=u.getDetail((r-i)/2+i).position,e.add(h(c,s,l,n)))}):"start"===a?(l=u.getDetail(0).position,e.add(h(c,s,l,n))):"end"===a?(l=u.getDetail(1).position,e.add(h(c,s,l,n))):(l=u.getDetail(.5).position,e.add(h(c,s,l,n))))});break;case o.GeometryType.multiPolygon:case o.GeometryType.polygon:r===o.GeometryType.polygon&&(a=[a]),a.forEach(t=>{t.forEach(t=>{const i=n.type,r=function(e){if(!e||0===e.length)return null;const t=e.length;let i;const r=[];let o,n;for(i=0;i<t;i++){const t=Cesium.Cartographic.fromCartesian(e[i]);r.push([180*t.longitude/Math.PI,180*t.latitude/Math.PI]),0===i&&(o=t.height,n=t.height),o=Math.max(o,t.height),n=Math.min(n,t.height)}return{latlngArr:r,maxHeight:o,minHeight:n}}(t),a=r.maxHeight,l=r.minHeight,u=o.T.polygon([r.latlngArr]),p=o.T.getCoord(o.T.centroid(u));let d=new Cesium.Cartesian3;if("parallel"===i)d=Cesium.Cartesian3.fromDegrees(p[0],p[1],(a+l)/2),e.add(h(c,s,d,n));else if("outside"===i||"bottom"===i){const t=o.T.bbox(u),r=o.T.lineSegment(u),p=[t[0],t[1]],f=[t[2],t[3]],y=o.T.lineString([f,p]),m=o.T.lineIntersect(y,r);let g;if(0===m.features.length)g="outside"===i?f:p;else{const e="outside"===i?f:p;g=o.T.getCoord(o.T.nearestPoint(o.T.point(e),m))}n.positionOffsetXRate=1,n.positionOffsetYRate=1,d=Cesium.Cartesian3.fromDegrees(g[0],g[1],(a+l)/2),e.add(h(c,s,d,n))}else if("straight"===i||"skeleton"===i){const t=Sh(u);if(t.length<2)return;const r=[],o=s.split("");t.forEach(function(e){r.push(Cesium.Cartographic.toCartesian(new Cesium.Cartographic(e[0]/180*Math.PI,e[1]/180*Math.PI,0)))});const a=new wh(r);if("skeleton"===i)Mh(a,e,n.skeletonLineStartRate,n.skeletonLineEndRate,o,c,n);else{const t=a.getDetail(.5);e.add(h(c,s,t.position,n))}}})})}})}};class Lh extends o.BaseFeatureLayerView{constructor(e){super(e),this._labelClass=null,this._dynamicEntityVisualizer=null,this.dynamicLabelCollection=null,Lh.dynamicEntityVisualizer||(Lh.dynamicEntityVisualizer=new Cesium.DynamicEntityVisualizer(this.innerView.scene))}_processData(){return new Promise(e=>{e()})}onAdd(e){const t=this,i=this.innerView,r=this.layer,n=this.layer.renderer;return this._processData().then(e=>new Promise(a=>{if(t.innerLayer&&t.innerLayer.destroy(),t._initDynamicLabel(),n instanceof o.ClusterRenderer){t.innerLayer=new ch({id:r.id,viewer:i,renderer:n});const a=Object(o.getFeaturesFromFeatureSet)(e);for(let e=0;e<a.length;e++)a[e].symbol=o.Symbol.fromJSON(n.defaultSymbol.toJSON());for(let e=0;e<a.length;e++)t.innerLayer.add(a[e])}else if(n instanceof o.HeatmapRenderer)t.innerLayer=new uh({id:r.id,viewer:i,field:n.field,valueExpression:n.valueExpression,radius:n.radius,alpha:r.opacity,gradient:n.colorStops,minDataValue:n.minDataValue,maxDataValue:n.maxDataValue,features:Object(o.getFeaturesFromFeatureSet)(e)});else{if(t.innerLayer=new hh({id:r.id,viewer:i,opacity:t.layer.opacity,elevationInfo:t.layer.elevationInfo}),e.features.length>0&&!e.features[0].geometry.spatialReference.isGeographic)for(let t=0;t<e.features.length;t++)e.features[t].geometry=o.Projection.project(e.features[t].geometry,new o.SpatialReference({wkid:4326}));t._initFeatures(e,n)}a(t)}))}_initDynamicLabel(){const{innerView:e}=this,{labelingInfo:t,labelsVisible:i}=this.layer;if(!i||!t||!Array.isArray(t)||t.length<=0)return;const r=t[0];if(!r)return;this._labelClass=r;const{renderMode:o,deconflictionStrategy:n="static"}=r;let a;switch(o){case"label":a=new Cesium.LabelCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e.scene});break;case"ground":a=new Cesium.PrimitiveCollection;break;default:a=new Cesium.BillboardCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e.scene})}"static"===n?(this._dynamicEntityVisualizer=Lh.dynamicEntityVisualizer,this.dynamicLabelCollection=this._dynamicEntityVisualizer.add(a)):this.dynamicLabelCollection=e.scene.primitives.add(a)}_renderDynamicLabel(e,t,i){i&&Th.renderLabel(e,t,i)}_onFeatureSetCacheChange(e){super._onFeatureSetCacheChange(e);const{added:t=[],removed:i=[]}=e;Array.isArray(t)&&this._renderDynamicLabel(this.dynamicLabelCollection,t,this._labelClass)}_removeDynamicLabel(){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.remove(this.dynamicLabelCollection):this.innerView&&this.innerView.scene.primitives.remove(this.dynamicLabelCollection),this.dynamicLabelCollection=null}_setDynamicLabelVisibleOrOpacity(e,t){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.show=e:this.dynamicLabelCollection&&(this.dynamicLabelCollection.show=e)}onRemove(e){return this._removeDynamicLabel(),this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(i=>{if(i&&"property"===i.operationType)switch(i.name){case"opacity":{const e=i.params;t.setOpacity(e[0]),this._setDynamicLabelVisibleOrOpacity(this.layer.visible&&this.layer.labelsVisible,this.layer.opacity);break}case"visible":{const e=i.params;this._setDynamicLabelVisibleOrOpacity(this.layer.visible&&this.layer.labelsVisible,this.layer.opacity),t.setVisible(e[0]);break}case"renderer":this.onAdd(e)}if(i&&"method"===i.operationType)switch(i.name){case"refresh":this.onAdd(e)}}),Promise.resolve(this)}}var Ih=Lh;var Eh=class extends Ih{_processData(){const e=this.layer,t=e._createQueryOption();return t.resultRecordCount=1e5,e.queryFeatures(t).then(e=>e)}onAdd(e){const t=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){let e;e=i.spatialReference?xi(i.spatialReference,i.extent):new Cesium.GeographicTilingScheme({rectangle:Cesium.Rectangle.fromDegrees(-180,-90,180,90),ellipsoid:Cesium.Ellipsoid.WGS84,numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1});const n=i.url,a=Object(o.getBaseUrl)(n);let s;return s="1.0"===i._igsVersion?{url:`${a}/igs/rest/mrms/layers`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""}:{url:`${a}/igs/rest/services/system/ResourceServer/tempData`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""},this.innerLayer=r.imageryLayers.addImageryProvider(new Cesium.MapGISMapServerImageryProvider(s)),Promise.resolve(t)}return super.onAdd(e)}onRemove(e){const t=this;return this.layer.gdbp?(this.innerView.imageryLayers.remove(this.innerLayer),Promise.resolve(t)):super.onRemove(e)}};var Oh=class extends Ih{_processData(){return this.layer.queryFeatures()}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var Ph=class extends Ih{_processData(){return this.layer.queryFeatures().then(e=>e)}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var jh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=rl.addTDTLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return rl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"layerType":rl.removeLayer(this.innerLayer,this.innerView),this.innerLayer=rl.addTDTLayer(this.layer,this.innerView);break;case"index":pl(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Ah=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{qi.addM3DLayer(t,i,this.view,t=>{r.innerLayer=t,e(r)})})}onRemove(e){return qi.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return bl.applyUpdate(this.view,this.layer,t,e),Promise.resolve(this)}};var Rh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=nl.addArcGISMapImageLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return nl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};class zh{}zh.addArcGISTileLayer=function(e,t){const i=xi(e.spatialReference,e.extent,e.tileInfo),r=ki(e,i.rectangle),o={url:`${e.url}/tile/{z}/{y}/{x}`,tilingScheme:i,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,rectangle:Cesium.Rectangle.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax)},n=new Cesium.UrlTemplateImageryProvider(o),a=Ci(e,t);return t.imageryLayers.addImageryProvider(n,a),n.id=e.id,n._realIndex=e._realIndex+1,n},zh.removeLayer=function(e,t){t.imageryLayers.remove(e)};var Dh=zh;var Fh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=Dh.addArcGISTileLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return Dh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Nh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this,n=xi(t.spatialReference,t.extent,t.tileInfo),a=ki(t,n.rectangle);a.spatialReference=new o.SpatialReference("EPSG:4326");const s=Cesium.Rectangle.fromDegrees(a.xmin,a.ymin,a.xmax,a.ymax);return new Promise(e=>{const o=Array.isArray(t.labelingInfo)&&t.labelingInfo.length>0?t.labelingInfo[0]:void 0;r.innerLayer=new Ws(i,{tilingScheme:n,rectangle:s,wgs84Extent:a,labelsRenderMode:t.labelsRenderMode,labelsNoteStyle:o,style:t.style,addCallback(){e(r)}}),r.innerLayer.id=t.id})}onRemove(e){return this.innerLayer.remove(),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;if(e.updateContent)for(let i=0;i<e.updateContent.length;i++){const r=e.updateContent[i],o=r.params;if(r)switch(r.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":case"setStyleLayerFilter":case"setStyleLayerZoomRange":t.updateStyle(this.layer.style);break;case"opacity":t.setOpacity(o[0]);break;case"visible":t.setVisible(o[0]);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer.provider,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;default:t.updateStyle(this.layer.style)}}return Promise.resolve(this)}};var Gh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=sl.addWebTileLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return sl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":sl.removeLayer(this.innerLayer,this.innerView),self.innerLayer=sl.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var Vh=class extends o.FeatureRender{drawFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.add(t[i])}updateFeature(e,t,i){if(e)for(let i=0;i<t.length;i++)e.update(t[i])}clearFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.remove(t[i])}clear(e){e&&e.removeAll()}};function Bh(e,t){let i=null;switch(t.type){case o.LayerType.igsVectorTile:i=new ll({view:e,layer:t});break;case o.LayerType.wmts:i=new ml({view:e,layer:t});break;case o.LayerType.igsMapImage:i=new vl({view:e,layer:t});break;case o.LayerType.igsTile:i=new gl({view:e,layer:t});break;case o.LayerType.wms:i=new dl({view:e,layer:t});break;case o.LayerType.m3d:i=new _l({view:e,layer:t});break;case o.LayerType.cesium3DTiles:i=new wl({view:e,layer:t});break;case o.LayerType.scene:i=new xl({view:e,layer:t});break;case o.LayerType.terrain:i=new Cl({view:e,layer:t});break;case o.LayerType.echarts:i=new El({view:e,layer:t});break;case o.LayerType.mapv:i=new Ol({view:e,layer:t});break;case o.LayerType.group:i=new Al({view:e,layer:t});break;case o.LayerType.graphics:i=new yh({view:e,layer:t,render:new Vh});break;case o.LayerType.igsFeature:i=new Eh({view:e,layer:t,render:new Vh});break;case o.LayerType.geojson:i=new Oh({view:e,layer:t,render:new Vh});break;case o.LayerType.wfs:i=new Ph({view:e,layer:t,render:new Vh});break;case o.LayerType.tdt:i=new jh({view:e,layer:t});break;case o.LayerType.m3dCache:i=new Ah({view:e,layer:t});break;case o.LayerType.arcgisMapImage:i=new Rh({view:e,layer:t});break;case o.LayerType.arcgisTile:i=new Fh({view:e,layer:t});break;case o.LayerType.arcgisVectorTile:i=new Nh({view:e,layer:t});break;case o.LayerType.webTileLayer:i=new Gh({view:e,layer:t})}return i}var qh=class extends o.Evented{constructor(e){super(e),e=Object(o.defaultValue)(e,{}),this.view=Object(o.defaultValue)(e.view,""),this.location=Object(o.defaultValue)(e.location,""),this.title=Object(o.defaultValue)(e.title,""),this.content=Object(o.defaultValue)(e.content,""),this.alignment=Object(o.defaultValue)(e.alignment,"bottom-center"),this.defaultButtons=Object(o.defaultValue)(e.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initDefaultClass()}open(e){this._popup?(this.close(),this._popup=void 0,this.openPopup(e)):this.openPopup(e)}openPopup(e){if(e.view){const t=e.view._innerView;this.view&&e.view.id===this.view.id?this._popupLayer||(this._popupLayer=new Cesium.GraphicsLayer(t,{})):(this.view=e.view,this._popupLayer&&this.view._innerView.remove(this._popupLayer),this._popupLayer=new Cesium.GraphicsLayer(t,{}))}else if(!this._popupLayer){if(!this.view)return;this._popupLayer=new Cesium.GraphicsLayer(this.view._innerView,{})}this.location=e.location?e.location:this.location,this.title=e.title?e.title:this.title,this.content=e.content?e.content:this.content,this.alignment=e.alignment?e.alignment:this.alignment;const t=this.location.coordinates[0],i=this.location.coordinates[1],r=this._initDefaultUI(this.title,this.content);r.style.display="block";const o=new Cesium.Graphic({type:"div",positions:[Cesium.Cartesian3.fromDegrees(t,i,0)],style:{html:r}});this._popup=this._popupLayer.addGraphic(o),this._popup.style.pixelOffset=this._getOffset()}_contentUI(e,t){const i=this;let r=void 0;const o=function(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes};(r=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const n=document.createElement("div");n.setAttribute("class","zondy-popup__header"),n.setAttribute("style","display: flex;");const a=o('<div class="zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],s=o('<div class="zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(e){const t=o('<div style="flex: 1;"></div>')[0];if(n.appendChild(t),"object"==typeof e?e instanceof Node?t.appendChild(e):e instanceof NodeList&&e.forEach(e=>{t.appendChild(e)}):t.innerHTML=e,this.defaultButtons.indexOf("toggle")>-1){n.appendChild(a);let e=!0;a.onclick=function(){e=!e,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=e?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(n.appendChild(s),s.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content"),t)if("object"==typeof t){if(t instanceof Node)l.appendChild(t);else if(t instanceof NodeList)for(let e=0;e<t.length;e++)l.appendChild(t[e]),e--}else l.innerHTML=t;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer");const c=o('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(c),c.onclick=function(){i.view._setZoomAndCenter({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer zondy-popup__footer-division"),r.appendChild(n),r.appendChild(l),r.appendChild(h),r}_initDefaultUI(e,t){const i=document.createElement("div");i.setAttribute("class","zondy-popup");const r=document.createElement("div");r.setAttribute("class","zondy-popup__container");const o=this._contentUI(e,t);r.appendChild(o),i.appendChild(r);const n=document.createElement("div");return n.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),n.innerHTML="<div class='zondy-popup__tip' style='width: 17px;height: 17px;padding: 1px;margin: -10px auto 0;pointer-events: auto;transform: rotate(45deg);'>\n </div>",i.appendChild(n),i}_initDefaultClass(){let e=!1;const t=document.head.getElementsByTagName("style");if(t)for(let i=0;i<t.length;i++)if(t[i].innerHTML.indexOf("styleDomString")>-1){e=!0;break}if(!e){const e=document.createElement("style");e.innerHTML="\n .zondy-popup__container{background-color: #fff;padding:0;border-radius: 10px;}\n .zondy-popup__tip{\n background-color: #fff;\n }\n .zondy-popup__header{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n white-space: nowrap;\n }\n .zondy-popup__content{\n padding: 8px;\n }\n .zondy-popup__footer{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle,.zondy-popup__close{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(e)}}_getOffset(){let e=null;if(this._popup&&this._popup.style&&this._popup.style.html&&this.alignment){const t=this._popup.style.html.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,t.width,t.height);e=new L.Point(i.x,i.y)}return e}_getOffsetByAlignment(e,t,i){let r=0,o=0;switch(e){case"top-left":o=-i;break;case"top-center":r=-t/2,o=-i;break;case"top-right":r=-t,o=-i;break;case"bottom-left":break;case"auto":case"bottom-center":r=-t/2;break;case"bottom-right":r=-t}return{x:r,y:o}}close(){this._popup.remove()}destroy(){this._popupLayer&&this.view._innerView.remove(this._popupLayer)}};var Uh=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.view=Object(o.defaultValue)(e.view,null),this.format=Object(o.defaultValue)(e.format,o.PictureFormat.png),this.filename=Object(o.defaultValue)(e.filename,"screenshotFile"),this.width=Object(o.defaultValue)(e.width,void 0),this.height=Object(o.defaultValue)(e.height,void 0),this.x=Object(o.defaultValue)(e.x,0),this.y=Object(o.defaultValue)(e.y,0),this.isDownload=Object(o.defaultValue)(e.isDownload,!0)}_addView(){const e=this;this.view._innerView.render();const t=this.view._innerView.canvas;let i=null;this.format===o.PictureFormat.png?i=t.toDataURL():this.format===o.PictureFormat.jpeg?i=t.toDataURL("image/jpeg"):"svg"===this.format&&(i=t.toDataURL());const r=document.createElement("canvas");r.width=this.width,r.height=this.height;const n=r.getContext("2d"),a=function(e,t){const i=document.createElement("a");i.href=e,i.download=t,document.body.appendChild(i),i.click()};return new Promise(t=>{if(this.width&&this.height){const s=new Image;s.src=i,s.onload=function(){n.drawImage(s,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let i=null;e.format===o.PictureFormat.png?i=r.toDataURL():e.format===o.PictureFormat.jpeg?i=r.toDataURL("image/jpeg"):"svg"===e.format&&(i=r.toDataURL()),e.isDownload&&a(i,e.filename),t({dataUrl:i})}}else e.isDownload&&a(i,this.filename),t({dataUrl:i})})}_removeView(){}};class Wh extends o.BaseView{constructor(e){super(e),e=Object(o.defaultValue)(e,{}),this._center=Object(o.defaultValue)(e.center,new o.Point({coordinates:[0,0]})),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new o.Point({coordinates:[this._center[0],this._center[1],this._center[2]]})),this._scale=Object(o.defaultValue)(e.scale,void 0),this._zoom=Object(o.defaultValue)(e.zoom,3),this.minZoom=Object(o.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(o.defaultValue)(e.maxZoom,void 0),this._extent=Object(o.defaultValue)(e.extent,void 0),this.width=void 0,this.height=void 0,this._spatialReference=new o.SpatialReference("EPSG:4326"),this.popup=Object(o.defaultValue)(e.popup,void 0),this.stationary=!0,this.extendOptions=Object(o.defaultValue)(e.extendOptions,{}),this._innerView=new Cesium.Viewer(this._viewId,this.extendOptions),this._layersMap=new Cesium.HashMap,Cesium.Config(o.Config),this._initSize(),this._extent?this._initExtent():(this._initScale(),this._initZoom()),this._initViewEvent(),this._initPopup(),this._map._initCesiumView=!0}_initViewEvent(){const e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(o.ViewEventType.click,Di.getMouseEvent(t,e))},300),e.fire(o.ViewEventType.immediateClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(o.ViewEventType.click,Di.getMouseEvent(t,e))},300),e.fire(o.ViewEventType.immediateClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(o.ViewEventType.click,Di.getMouseEvent(t,e))},300),e.fire(o.ViewEventType.immediateClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore&&(clearTimeout(e._clickStore),e._clickStore=null),e.fire(o.ViewEventType.doubleClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerDown,Di.getMouseEvent(t,e)),this._dragParams.isDrag||(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.LEFT_DOWN),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerUp,Di.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.LEFT_UP),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerDown,Di.getMouseEvent(t,e)),this._dragParams.isDrag||(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerUp,Di.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.RIGHT_UP),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerDown,Di.getMouseEvent(t,e)),this._dragParams.isDrag||(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerUp,Di.getMouseEvent(t,e)),e._dragParams.isDrag&&(this._dragParams.action="end",e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action)),e._dragParams={isDrag:!1,origin:null,action:"",button:null})},Cesium.ScreenSpaceEventType.MIDDLE_UP),this._innerView.screenSpaceEventHandler.setInputAction(t=>{t.position=t.endPosition,e.fire(o.ViewEventType.pointerMove,Di.getMouseEvent(t,e)),e._dragParams.isDrag?(e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,e._dragParams.action,e._dragParams.button)),e._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",e._dragParams.isDrag=!0)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._map.layers.forEach(function(t){switch(t.type){case o.LayerType.igsFeature:case o.LayerType.graphics:Object(o.showLayerByScale)(e,t)}}),e.fire(o.ViewEventType.wheel,{})},Cesium.ScreenSpaceEventType.WHEEL),this._innerView.camera.moveEnd.addEventListener(t=>{e._mouseMoveHandler(),e.fire(o.ViewEventType.viewChange,Di.getViewChangeEvent(t,e))}),this._innerView.camera.moveStart.addEventListener(()=>{e.stationary=!1}),this._innerView.camera.moveEnd.addEventListener(()=>{e.stationary=!0}),this._listenResize(),this._listenKey()}_listenResize(){const e=this;this._lastSize=this.getSize(),new ResizeObserver(t=>{const i=t.length>0?{x:t[0].contentRect.width,y:t[0].contentRect.height}:{width:null,height:null};e.fire(o.ViewEventType.resize,{oldWidth:e._lastSize.x,oldHeight:e._lastSize.y,width:i.x,height:i.y}),this._lastSize=i}).observe(this._innerView._container)}_listenKey(){const e=this,t=this._innerView.canvas;t.setAttribute("tabIndex","-1"),t.onclick=(()=>{t.focus()}),t.addEventListener("keydown",t=>{e.fire(o.ViewEventType.keyDown,Di.getKeyEvent(t,e))}),t.addEventListener("keyup",t=>{e.fire(o.ViewEventType.keyUp,Di.getKeyEvent(t,e))})}_mapActionControl(e,t){"drag-pan"===e&&(this._innerView.scene.screenSpaceCameraController.enableRotate=t)}flyTo(e){e=Object(o.defaultValue)(e,{});const t=Object(o.defaultValue)(e.duration,2),i=Object(o.defaultValue)(e.orientation,void 0),r=Object(o.defaultValue)(e.complete,void 0),n=Object(o.defaultValue)(e.cancel,void 0),a=Object(o.defaultValue)(e.endTransform,void 0),s=Object(o.defaultValue)(e.maximumHeight,void 0),l=Object(o.defaultValue)(e.flyOverLongitude,void 0),h=Object(o.defaultValue)(e.flyOverLongitudeWeight,void 0),c=Object(o.defaultValue)(e.convert,void 0),u=Object(o.defaultValue)(e.easingFunction,void 0),p=this._getFlyToCenter(e),d=this._getFlyToExtent(e);Object(o.isNull)(p)?Object(o.isNull)(d)||this._innerView.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(d.xmin,d.ymin,d.xmax,d.ymax),duration:t,orientation:i,complete:r,cancel:n,endTransform:a,maximumHeight:s,flyOverLongitude:l,flyOverLongitudeWeight:h,convert:c,easingFunction:u}):this._innerView.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(p.coordinates[0],p.coordinates[1],p.coordinates[2]),duration:t,orientation:i,complete:r,cancel:n,endTransform:a,maximumHeight:s,flyOverLongitude:l,flyOverLongitudeWeight:h,convert:c,easingFunction:u})}_createLayerView(e){return Bh(this,e)||null}toJSON(){return{viewId:this._viewId,skyBox:this.skyBox,skyAtmosphere:this.skyAtmosphere,enableFPSWidget:this.enableFPSWidget,map:this._map?this._map.toJSON():[]}}toMap(e){let t=null;if(this._innerView.scene.globe.translucency.enabled||!this._innerView.scene.globe.depthTestAgainstTerrain){const i=this._innerView.camera.getPickRay(e);t=this._innerView.scene.globe.pick(i,this._innerView.scene)}else t=this._innerView.scene.pickPosition(e);let i=null;if(t&&!Object(o.isNull)(t)){const e=this._innerView.scene.globe.ellipsoid.cartesianToCartographic(t),r=Cesium.Math.toDegrees(e.longitude),n=Cesium.Math.toDegrees(e.latitude),a=e.height;i=new o.Point({coordinates:[r,n,a]})}else i=new o.Point({coordinates:[0,0,0]});return i}toScreen(e){const t=Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]);return Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._innerView.scene,t)}getSize(){return{x:this._innerView._container.clientWidth,y:this._innerView._container.clientHeight}}getCenter(){const e=Cesium.Cartographic.fromCartesian(this._innerView.camera.position),t=Cesium.Math.toDegrees(e.longitude),i=Cesium.Math.toDegrees(e.latitude),r=e.height,n=new o.Point({coordinates:[t,i,r]});return this._center=n,n}setCenter(e){if(!this._innerView||!this._center)return;let t=!1;const i=this._center.coordinates[2];Array.isArray(e)&&e.length>1?(this._center=new o.Point({coordinates:[e[0],e[1],i]}),t=!0):e instanceof o.Point&&(this._center=new o.Point({coordinates:[e.coordinates[0],e.coordinates[1],i]}),t=!0),t&&this.flyTo({center:this._center})}getExtent(){if(!this._innerView)return;const e=this._innerView.camera.computeViewRectangle(),t=new o.Extent({xmin:e.west/Math.PI*180,ymin:e.south/Math.PI*180,xmax:e.east/Math.PI*180,ymax:e.north/Math.PI*180});return this._extent=t,t}setExtent(e){this._innerView&&(this._extent=e,this.flyTo({extent:e}))}getInnerLayer(e){if(e instanceof o.Layer)return super.getInnerLayer(e);if(e instanceof o.IGSSceneSubLayer){const t=super.getInnerLayer(e.layer);for(let i=0;i<t.length;i++)if(t[i]._layerIndex===e.layerIndex)return t[i]}}_initPopup(){this.popup=new qh({view:this})}hitTest(e){const t=[];return this._innerView.scene.drillPick({x:e.x,y:e.y}).forEach(i=>{if(i.primitive){const r=i.primitive,n=this.getLayer(r.commonLayerId);if(Object(o.isNull)(r.commonLayerId))return;let a=null;if(n.type===o.LayerType.igsFeature||n.type===o.LayerType.geojson){a=this._getLayerView(n)._featureSetCache.filter(e=>{if(e.id===r.commonFeatureId)return e})}else n.type===o.LayerType.graphics&&(a=n.graphics.filter(e=>{if(e.id===r.commonFeatureId)return e}));const s={graphic:a&&a.items.length>0?a.items[0]:null,layer:n,mapPoint:this.toMap(e),type:"graphic"};t.push(s)}}),t}_mouseMoveHandler(){this.getCenter(),this.getExtent(),this.getZoom(),this.getScale()}_initSize(){const e=this._innerView.canvas;this.width=e.width,this.height=e.height}_initScale(){if(this.scale&&this._center){const e=this.getZoomByScale(this.scale),t=this._getAltitudeByZoom(e);if(t){this.zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new o.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}}_initZoom(){if(!this.scale&&!Object(o.isNull)(this._zoom)&&this._center&&this._center.coordinates[2]){const e=this._getZoomByAltitude(this._center.coordinates[2]),t=this._getAltitudeByZoom(this._zoom);if(t){this._zoom=e,this.scale=this.getScaleByZoom(this.zoom);const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new o.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}if(this.maxZoom){const e=this._getAltitudeByZoom(this.maxZoom);this._innerView.scene.screenSpaceCameraController.minimumZoomDistance=e}if(this.minZoom){const e=this._getAltitudeByZoom(this.minZoom);this._innerView.scene.screenSpaceCameraController.maximumZoomDistance=e}}_initExtent(){this.flyTo({extent:this._extent})}getZoom(){const e=this._getZoomByAltitude(this._center.coordinates[2]);this._zoom=e}setZoom(e){if(this._innerView&&!Object(o.isNull)(this._zoom)&&this._center){const t=this._getAltitudeByZoom(e);if(t){this._zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1],n=new o.Point({coordinates:[i,r,t]});this.flyTo({center:n})}}}_setZoomAndCenter(e){if(this._innerView&&!Object(o.isNull)(e.zoom)&&!Object(o.isNull)(e.center)){const t=e.center.coordinates[0],i=e.center.coordinates[1],r=this._getAltitudeByZoom(e.zoom);if(r){this._zoom=e.zoom;const n=new o.Point({coordinates:[t,i,r]});this._center=n,this.flyTo({center:n})}}}getScale(){const e=this.getScaleByZoom(this._zoom);return this._scale=e,e}setScale(e){if(this._innerView&&this._scale&&this._center){this._scale=e;const t=this.getZoomByScale(e),i=this._getAltitudeByZoom(t);if(i){const e=this._center.coordinates[0],t=this._center.coordinates[1],r=new o.Point({coordinates:[e,t,i]});this.flyTo({center:r})}}}getZoomByScale(e){const t=e/(96/.0254);return Math.round(Math.log2(156543.03392804062/t))}getScaleByZoom(e){return 96/.0254*(156543.03392804062/Math.pow(2,e))}takeScreenshot(e){e.view=this;let t=null;return this._screenshot?t=this._screenshot._addView():(this._screenshot=new Uh(e),t=this._screenshot._addView()),t}_getZoomByAltitude(e){const t=-40467.74;return Math.round(t+80955.31/(1+Math.pow(e/91610.74,7096758e-11)))}_getAltitudeByZoom(e){const t=-40467.74;return 91610.74*Math.pow(80955.31/(e-t)-1,1/7096758e-11)}}Wh.fromJSON=function(e){return e=Object(o.defaultValue)(e,{}),new Wh(e)},Object.defineProperties(Wh.prototype,{scale:{get(){return this._scale},set(e){this.setScale(e)}},zoom:{get(){return this._zoom},set(e){this.setZoom(e)}},center:{get(){return this._center},set(e){this.setCenter(e)}},extent:{get(){return this._extent},set(e){this.setExtent(e)}},spatialReference:{get(){return this._spatialReference},set(e){this._spatialReference=e}}}),o.Zondy.PluginVersion="16.8.0",o.Zondy.SceneView=Wh;var Hh=Wh;class Yh extends o.SketchEditor3D{constructor(e){super(e)}addVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.addVertex(e,t)}updateVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.updateVertex(e,t)}removeVertex(e){return this._drawTool.removeVertex(e)}split(e,t){return super.split(e,t)}drawPolylineToPolygon(e){super.drawPolylineToPolygon(e)}_initLayerEvent(){}_hitTestSketchEvent(){const e=this;this.view.on(o.ViewEventType.mouseDown,t=>{if(!t||!t.x||!t.y)return;let i=void 0,r=!1;e._drawTool&&e._drawTool.sketchStage&&e._drawTool.sketchStage.selectBoxGraphics.length>0&&e.view._innerView.scene.drillPick({x:t.x,y:t.y}).forEach(o=>{if(o.primitive&&e.layer.id===o.primitive.commonLayerId&&e._drawTool.sketchStage.entityGraphic.id===o.primitive.commonFeatureId){const n=e.view._innerView.camera.getPickRay({x:t.x,y:t.y}),a=e.view._innerView.scene.pickFromRay(n,[o.primitive]);a&&a.object&&a.object.primitive&&(r=!0,i=a.object)}});if(r||(i=e.view._innerView.scene.pick({x:t.x,y:t.y})),i&&i.primitive&&e.layer.id===i.primitive.commonLayerId){let r=e._drawTool?e._drawTool._getDrawToolByFeatureId(i.primitive.commonFeatureId):void 0;if(!r&&(!e._drawTool||e._drawTool.sketchStage.entityGraphic&&"drawn"===e._drawTool.state)){const t=e.view.getLayer(i.primitive.commonLayerId).graphics.filter(e=>{if(e.id===i.primitive.commonFeatureId)return e});if(!(t&&t.items.length>0))return;{const i=t.items[0];e._drawTool&&e._drawTool._clearEditGraphics(e._drawTool._editMode),this._addFeatureToSketchEditor(i),e._undoRedoManager.reset(),e._drawTools=[e._drawTool],r=e._drawTool}}if(!r||r===e._drawTool&&"drawn"!==r.state)return;if(0===r.editOption._hitTestMode){const i=()=>{e._editable&&(void 0!==e._drawTool&&null!==e._drawTool&&3===e._drawTool._editMode||(r.hitTestFeature(r.sketchStage.entityGraphic,t),e.fire("selected",{isSelected:!0,selectedDrawTool:e._drawTool,selectedGeometry:e._drawTool.sketchStage.entityGraphic.geometry},e),e.view.off(o.ViewEventType.mouseUp,i)))};e.view.on(o.ViewEventType.mouseUp,i)}else{if(!e._editable)return;if(void 0!==e._drawTool&&null!==e._drawTool&&3===e._drawTool._editMode)return;r.hitTestFeature(r.sketchStage.entityGraphic,t)}}})}_getCenterCoordinate(e,t){const i=e.concat(t),r=new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)).positions,o=Cesium.BoundingSphere.fromPoints(r).center,n=Cesium.Cartographic.fromCartesian(o);return[Cesium.Math.toDegrees(n.longitude),Cesium.Math.toDegrees(n.latitude),0]}_getHight(){return 0}}o.Zondy.SketchEditorCesium=Yh;var Jh=Yh;i.d(t,"SceneView",function(){return Hh}),i.d(t,"SketchEditorCesium",function(){return Jh}),i.d(t,"CesiumInnerGraphicsLayer",function(){return hh}),i.d(t,"getTilingSchemeBySpatialReference",function(){return xi}),i.d(t,"getExtent",function(){return ki})}]);
18
+ */(i,0,i.length,r,e,t,i),this.changed()}},t}(function(e){function t(){e.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return Ki()},t.prototype.closestPointXY=function(e,t,i,r){return Ki()},t.prototype.containsXY=function(e,t){return!1},t.prototype.getClosestPoint=function(e,t){var i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i},t.prototype.intersectsCoordinate=function(e){return this.containsXY(e[0],e[1])},t.prototype.computeExtent=function(e){return Ki()},t.prototype.getExtent=function(e){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}(this.extent_,e)},t.prototype.rotate=function(e,t){Ki()},t.prototype.scale=function(e,t,i){Ki()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return Ki()},t.prototype.getType=function(){return Ki()},t.prototype.applyTransform=function(e){Ki()},t.prototype.intersectsExtent=function(e){return Ki()},t.prototype.translate=function(e,t){Ki()},t.prototype.transform=function(e,t){var i=Mn(e),r=i.getUnits()==on.TILE_PIXELS?function(e,r,o){var n=i.getExtent(),a=i.getWorldExtent(),s=qo(a)/qo(n);return Wr(In,a[0],a[3],s,-s,0,0,0),en(e,0,e.length,o,In,r),Ln(i,t)(e,r,o)}:Ln(i,t);return this.applyTransform(r),this},t}(Qo));function jn(e,t,i,r){for(var o=0,n=i.length;o<n;++o)for(var a=i[o],s=0;s<r;++s)e[t++]=a[s];return t}function An(e,t,i,r,o){for(var n=o||[],a=0,s=0,l=i.length;s<l;++s){var h=jn(e,t,i[s],r);n[a++]=h,t=h}return n.length=a,n}var Rn=function(e){function t(t,i){e.call(this),this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){var o=this.flatCoordinates,n=lr(e,t,o[0],o[1]);if(n<r){for(var a=this.stride,s=0;s<a;++s)i[s]=o[s];return i.length=a,n}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(e){return Ro(this.flatCoordinates,e)},t.prototype.getType=function(){return or.POINT},t.prototype.intersectsExtent=function(e){return Oo(e,this.flatCoordinates[0],this.flatCoordinates[1])},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(e,t,i,r){for(var o=0,n=i.length;o<n;++o)e[t++]=i[o];return t}(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn),zn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Dn(e,t){const i={};for(const t in e)"ref"!==t&&(i[t]=e[t]);return zn.forEach(e=>{e in t&&(i[e]=t[e])}),i}var Fn=function(e){e=e.slice();const t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=Dn(e[i],t[e[i].ref]));return e};var Nn={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{js:"1.2.0"},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{js:"1.2.0"},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{js:"1.2.0"},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"If `symbol-sort-key` is set, sort based on that. Otherwise sort symbols by their y-position relative to the viewport."},"viewport-y":{doc:"Symbols will be sorted by their y-position relative to the viewport."},source:{doc:"Symbols will be rendered in the same order as the source data with no sorting applied."}},default:"auto",doc:"Controls the order in which overlapping symbols in the same layer are rendered","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which doesn't support the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` instead of the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"Not yet supported",android:"Not yet supported",ios:"Not yet supported",macos:"Not yet supported"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n * a single literal value; or\n * an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the deprecated `"in"` operator.\n\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:"Returns `formatted` text containing annotations for use in mixed-format `text-field` entries. If set, the `text-font` argument overrides the font specified by the root layout properties. If set, the `font-scale` argument specifies a scaling factor relative to the `text-size` specified in the root layout properties.",group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String"},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}}},Gn=i(2),Vn={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},Bn=" ",qn=/(italic|oblique)$/i,Un={};function Wn(e,t){var i=Un[e];if(!i){Array.isArray(e)||(e=[e]);for(var r="normal",o="normal",n=[],a=0,s=e.length;a<s;++a){var l=e[a].split(" "),h=l[l.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,l.pop(),h=l[l.length-1].toLowerCase()):qn.test(h)&&(h=h.replace(qn,""),o=l[l.length-1].replace(h,"")),Vn)if(h==c||h==c.replace("-","")||h==c.replace("-",Bn)){r=Vn[c],l.pop();break}"number"==typeof h&&(r=h);var u=l.join(Bn).replace("Klokantech Noto Sans","Noto Sans");-1!==u.indexOf(Bn)&&(u='"'+u+'"'),n.push(u)}i=Un[e]=[o,r,n]}return i[0]+Bn+i[1]+Bn+t+"px"+Bn+i[2]}function Hn(e){return e*Math.PI/180}const Yn=Gn.d.isFunction,Jn=Gn.d.convertFunction,$n=Gn.b.isExpression,Xn=Gn.b.createPropertyExpression,Zn={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Kn=function(e,t){const i=Xn(e,t);if("error"===i.result)throw new Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return i.value},Qn={},ea={zoom:0},ta={};function ia(e,t,i,r,o){const n=e.id;ta[n]||(ta[n]={});const a=ta[n];if(!a[i]){let r=(e[t]||Qn)[i];const o=Nn[`${t}_${e.type}`][i];void 0===r&&(r=o.default);let n=$n(r);if(!n&&Yn(r)&&(r=Jn(r,o),n=!0),n){const e=Kn(r,o);a[i]=e.evaluate.bind(e)}else"color"==o.type&&(r=Gn.a.parse(r)),a[i]=function(){return r}}return ea.zoom=r,a[i](ea,o)}const ra={};function oa(e,t,i,r){return e in ra||(ra[e]=Object(Gn.c)(t).filter),ea.zoom=r,ra[e](ea,i)}const na={};function aa(e,t){if(e&&void 0!==t){let i=na[e];i||(na[e]=i={color:e.toArray(),opacity:e.a}),(e=i.color)[3]=i.opacity*t,0===e[3]&&(e=void 0)}return e}const sa=/^([^]*)\{(.*)\}([^]*)$/;function la(e,t){let i;do{if(i=e.match(sa)){const r=t[i[2]]||"";e=i[1]+r+i[3]}}while(i);return e}var ha=function(e,t,i,r,o,n){if(!i){i=[];for(let e=78271.51696402048;i.length<21;e/=2)i.push(e)}if("string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");let a,s;if(o){const e=new Image;e.crossOrigin="anonymous",e.onload=function(){a=e,s=[e.width,e.height],e.onload=null},e.src=o}const l=document.createElement("CANVAS").getContext("2d"),h={};function c(e,t,i){const r=i+","+t+","+e;let o=h[r];if(!o){l.font=t;const n=l.measureText("M").width*i,a=e.split(" ");let s="";const c=[];for(let e=0,t=a.length;e<t;++e){const t=a[e];l.measureText(s+t).width<=n?s+=(s?" ":"")+t:(s&&c.push(s),s=t)}s&&c.push(s),h[r]=o=c.join("\n")}return o}const u=Fn(e.layers),p={},d=[];let f;for(let i=0,r=u.length;i<r;++i){const r=u[i],o=r.id;if("string"==typeof t&&r.source==t||"object"==typeof t&&t.indexOf(r.source)>=0){const t=r["source-layer"];if(!f){f=r.source;const t=e.sources[f];if(!t)throw new Error(`Source "${f}" is not defined`);const i=t.type;if("vector"!==i&&"geojson"!==i)throw new Error(`Source "${f}" is not of type "vector" or "geojson", but "${i}"`)}let n=p[t];n||(n=p[t]=[]),n.push({layer:r,index:i}),d.push(o)}delete ta[o],delete ra[o]}const y=new po,m=new co,g={},v={},b=[];return function(e,t){const o=e.getProperties(),n=p[o.layer];if(!n)return[];let l=i.indexOf(t);-1==l&&(l=function(e,t){let i=0;const r=t.length;for(;i<r;++i)if(t[i]<e&&i+1<r){const r=t[i]/t[i+1];return i+Math.log(t[i]/e)/Math.log(r)}return r-1}(t,i));const h=Zn[e.getGeometry().getType()],u={properties:o,type:h};let d=-1;for(let i=0,p=n.length;i<p;++i){const p=n[i],f=p.layer,_=f.id,w=f.layout||Qn,x=f.paint||Qn;if(!("none"===w.visibility||"minzoom"in f&&l<f.minzoom||"maxzoom"in f&&l>=f.maxzoom)){const i=f.filter;if(!i||oa(_,i,u,l)){let i,n,_,C,k,M;const S=p.index;if(3==h&&"fill"==f.type)if(n=ia(f,"paint","fill-opacity",l,u),"fill-pattern"in x){const e=ia(f,"paint","fill-pattern",l,u);if(e){const t=la(e,o);if(a&&r&&r[t]){(M=b[++d])&&M.getFill()&&!M.getStroke()&&!M.getText()||(M=b[d]=new mo({fill:new co})),_=M.getFill(),M.setZIndex(S);const e=t+"."+n;let i=v[e];if(!i){const o=r[t],s=document.createElement("canvas");s.width=o.width,s.height=o.height;const l=s.getContext("2d");l.globalAlpha=n,l.drawImage(a,o.x,o.y,o.width,o.height,0,0,o.width,o.height),i=l.createPattern(s,"repeat"),v[e]=i}_.setColor(i)}}}else(i=aa(ia(f,"paint","fill-color",l,u),n))&&((M=b[++d])&&M.getFill()&&!M.getStroke()&&!M.getText()||(M=b[d]=new mo({fill:new co})),(_=M.getFill()).setColor(i),M.setZIndex(S)),"fill-outline-color"in x&&(k=aa(ia(f,"paint","fill-outline-color",l,u),n)),k&&((M=b[++d])&&M.getStroke()&&!M.getFill()&&!M.getText()||(M=b[d]=new mo({stroke:new po})),(C=M.getStroke()).setLineCap(Nn.layout_line["line-cap"]),C.setLineJoin(Nn.layout_line["line-join"]),C.setMiterLimit(Nn.layout_line["line-miter-limit"]),C.setColor(k),C.setWidth(1),C.setLineDash(null),M.setZIndex(S));if(1!=h&&"line"==f.type){i=!("line-pattern"in x)&&"line-color"in x?aa(ia(f,"paint","line-color",l,u),ia(f,"paint","line-opacity",l,u)):void 0;const e=ia(f,"paint","line-width",l,u);i&&e>0&&((M=b[++d])&&M.getStroke()&&!M.getFill()&&!M.getText()||(M=b[d]=new mo({stroke:new po})),(C=M.getStroke()).setLineCap(ia(f,"layout","line-cap",l,u)),C.setLineJoin(ia(f,"layout","line-join",l,u)),C.setMiterLimit(ia(f,"layout","line-miter-limit",l,u)),C.setColor(i),C.setWidth(e),C.setLineDash(x["line-dasharray"]?ia(f,"paint","line-dasharray",l,u).map(function(t){return t*e}):null),M.setZIndex(S))}let T,L,I,E,O=!1,P=null,j=0;if((1==h||2==h)&&"icon-image"in w){const n=ia(f,"layout","icon-image",l,u);if(n){T=la(n,o);let c=void 0;if(a&&r&&r[T]){const o=ia(f,"layout","icon-rotation-alignment",l,u);if(2==h){const i=e.getGeometry();if(i.getFlatMidpoint){const e=i.getExtent();if(Math.sqrt(Math.max(Math.pow((e[2]-e[0])/t,2),Math.pow((e[3]-e[1])/t,2)))>150){const e=i.getFlatMidpoint();if(c=new Rn(e),"line"===ia(f,"layout","symbol-placement",l,u)&&"map"===o){const t=i.getStride(),r=i.getFlatCoordinates();for(let i=0,o=r.length-t;i<o;i+=t){const o=r[i],n=r[i+1],a=r[i+t],s=r[i+t+1],l=Math.min(o,a),h=Math.min(n,s),c=Math.max(o,a),u=Math.max(n,s);if(e[0]>=l&&e[0]<=c&&e[1]>=h&&e[1]<=u){j=Math.atan2(n-s,a-o);break}}}}}}if(2!==h||c){(M=b[++d])&&M.getImage()&&!M.getFill()&&!M.getStroke()||(M=b[d]=new mo),M.setGeometry(c);const e=ia(f,"layout","icon-size",l,u),t=void 0!==x["icon-color"]?ia(f,"paint","icon-color",l,u):null;let n=T+"."+e;if(null!==t&&(n+="."+t),!(L=g[n])){const l=r[T];if(null!==t){i=aa(t,1);const r=document.createElement("canvas");r.width=l.width,r.height=l.height;const o=r.getContext("2d");o.drawImage(a,l.x,l.y,l.width,l.height,0,0,l.width,l.height);const s=o.getImageData(0,0,r.width,r.height);for(let e=0,t=s.data.length;e<t;e+=4)s.data[e]=i[0],s.data[e+1]=i[1],s.data[e+2]=i[2];o.putImageData(s,0,0),L=g[n]=new Co({img:r,imgSize:[r.width,r.height],scale:e/l.pixelRatio})}else L=g[n]=new Co({img:a,imgSize:s,size:[l.width,l.height],offset:[l.x,l.y],rotateWithView:"map"===o,scale:e/l.pixelRatio})}L.setRotation(j+Hn(ia(f,"layout","icon-rotate",l,u))),L.setOpacity(ia(f,"paint","icon-opacity",l,u)),M.setImage(L),P=M.getText(),M.setText(void 0),M.setZIndex(99999-S),O=!0,I=!1}else I=!0}}}if(1==h&&"circle-radius"in x){(M=b[++d])&&M.getImage()&&!M.getFill()&&!M.getStroke()||(M=b[d]=new mo);const e=ia(f,"paint","circle-radius",l,u),t=ia(f,"paint","circle-stroke-color",l,u),i=ia(f,"paint","circle-color",l,u),r=ia(f,"paint","circle-opacity",l,u),o=ia(f,"paint","circle-stroke-opacity",l,u),n=ia(f,"paint","circle-stroke-width",l,u);(L=g[e+"."+t+"."+i+"."+r+"."+n])||(L=new lo({radius:e,stroke:0===n?void 0:new po({width:n,color:aa(t,o)}),fill:new co({color:aa(i,r)})})),M.setImage(L),P=M.getText(),M.setText(void 0),M.setGeometry(void 0),M.setZIndex(99999-S),O=!0}if("text-field"in w&&(E=la(ia(f,"layout","text-field",l,u).toString(),o)),E&&!I){O||((M=b[++d])&&M.getText()&&!M.getFill()&&!M.getStroke()||(M=b[d]=new mo),M.setImage(void 0),M.setGeometry(void 0)),M.getText()||M.setText(P||new To),P=M.getText();const e=ia(f,"layout","text-size",l,u),t=Wn(ia(f,"layout","text-font",l,u),e),i=w["text-transform"];"uppercase"==i?E=E.toUpperCase():"lowercase"==i&&(E=E.toLowerCase());const r=2==h?E:c(E,t,ia(f,"layout","text-max-width",l,u));P.setText(r),P.setFont(t),P.setRotation(Hn(ia(f,"layout","text-rotate",l,u)));const o=ia(f,"layout","text-anchor",l,u),a=O||1==h?"point":ia(f,"layout","symbol-placement",l,u);if(P.setPlacement(a),"point"==a){let e="center";-1!==o.indexOf("left")?e="left":-1!==o.indexOf("right")&&(e="right"),P.setTextAlign(e)}else P.setTextAlign();let s="middle";0==o.indexOf("bottom")?s="bottom":0==o.indexOf("top")&&(s="top"),P.setTextBaseline(s);const p=ia(f,"layout","text-offset",l,u);P.setOffsetX(p[0]*e),P.setOffsetY(p[1]*e),n=ia(f,"paint","text-opacity",l,u),m.setColor(aa(ia(f,"paint","text-color",l,u),n)),P.setFill(m);const g=aa(ia(f,"paint","text-halo-color",l,u),n);g?(y.setColor(g),y.setWidth(ia(f,"paint","text-halo-width",l,u)),P.setStroke(y)):P.setStroke(void 0),M.setZIndex(99999-S)}}}}return d>-1?(b.length=d+1,b):[]}},ca=i(6),ua=i.n(ca),pa=function(){this.dataProjection=null,this.defaultFeatureProjection=null};pa.prototype.getReadOptions=function(e,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(e),featureProjection:t.featureProjection}),this.adaptOptions(i)},pa.prototype.adaptOptions=function(e){return xr({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},pa.prototype.getLastExtent=function(){return null},pa.prototype.getType=function(){return Ki()},pa.prototype.readFeature=function(e,t){return Ki()},pa.prototype.readFeatures=function(e,t){return Ki()},pa.prototype.readGeometry=function(e,t){return Ki()},pa.prototype.readProjection=function(e){return Ki()},pa.prototype.writeFeature=function(e,t){return Ki()},pa.prototype.writeFeatures=function(e,t){return Ki()},pa.prototype.writeGeometry=function(e,t){return Ki()};var da=pa;function fa(e,t,i){var r,o=i?Mn(i.featureProjection):null,n=i?Mn(i.dataProjection):null;if(r=o&&n&&!function(e,t){if(e===t)return!0;var i=e.getUnits()===t.getUnits();return e.getCode()===t.getCode()?i:Tn(e,t)===xn&&i}(o,n)?Array.isArray(e)?function(e,t,i){return Yo(e,Ln(t,i))}(e,n,o):(t?e.clone():e).transform(t?o:n,t?n:o):e,t&&i&&void 0!==i.decimals&&!Array.isArray(r)){var a=Math.pow(10,i.decimals);r===e&&(r=e.clone()),r.applyTransform(function(e){for(var t=0,i=e.length;t<i;++t)e[t]=Math.round(e[t]*a)/a;return e})}return r}var ya="arraybuffer";function ma(e,t){return e>t?1:e<t?-1:0}function ga(e,t,i){for(;t<i;){var r=e[t];e[t]=e[i],e[i]=r,++t,--i}}function va(e,t){for(var i=Array.isArray(t)?t:[t],r=i.length,o=0;o<r;o++)e[e.length]=i[o]}function ba(e,t){var i=e.length;if(i!==t.length)return!1;for(var r=0;r<i;r++)if(e[r]!==t[r])return!1;return!0}function _a(e,t,i,r,o,n,a){var s,l=e[t],h=e[t+1],c=e[i]-l,u=e[i+1]-h;if(0===c&&0===u)s=t;else{var p=((o-l)*c+(n-h)*u)/(c*c+u*u);if(p>1)s=i;else{if(p>0){for(var d=0;d<r;++d)a[d]=hr(e[t+d],e[i+d],p);return void(a.length=r)}s=t}}for(var f=0;f<r;++f)a[f]=e[s+f];a.length=r}function wa(e,t,i,r,o){var n=e[t],a=e[t+1];for(t+=r;t<i;t+=r){var s=e[t],l=e[t+1],h=lr(n,a,s,l);h>o&&(o=h),n=s,a=l}return o}function xa(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n];o=wa(e,t,s,r,o),t=s}return o}function Ca(e,t,i,r,o,n,a,s,l,h,c){if(t==i)return h;var u,p;if(0===o){if((p=lr(a,s,e[t],e[t+1]))<h){for(u=0;u<r;++u)l[u]=e[t+u];return l.length=r,p}return h}for(var d=c||[NaN,NaN],f=t+r;f<i;)if(_a(e,f-r,f,r,a,s,d),(p=lr(a,s,d[0],d[1]))<h){for(h=p,u=0;u<r;++u)l[u]=d[u];l.length=r,f+=r}else f+=r*Math.max((Math.sqrt(p)-Math.sqrt(h))/o|0,1);if(n&&(_a(e,i-r,t,r,a,s,d),(p=lr(a,s,d[0],d[1]))<h)){for(h=p,u=0;u<r;++u)l[u]=d[u];l.length=r}return h}function ka(e,t,i,r,o,n,a,s,l,h,c){for(var u=c||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];h=Ca(e,t,f,r,o,n,a,s,l,h,u),t=f}return h}function Ma(e,t,i,r,o){for(var n=void 0!==o?o:[],a=0,s=t;s<i;s+=r)n[a++]=e.slice(s,s+r);return n.length=a,n}function Sa(e,t,i,r,o){for(var n=void 0!==o?o:[],a=0,s=0,l=i.length;s<l;++s){var h=i[s];n[a++]=Ma(e,t,h,r,n[a]),t=h}return n.length=a,n}function Ta(e,t,i,r,o){for(var n=void 0!==o?o:[],a=0,s=0,l=i.length;s<l;++s){var h=i[s];n[a++]=Sa(e,t,h,r,n[a]),t=h[h.length-1]}return n.length=a,n}function La(e,t,i,r,o,n){var a=NaN,s=NaN,l=(i-t)/r;if(1===l)a=e[t],s=e[t+1];else if(2==l)a=(1-o)*e[t]+o*e[t+r],s=(1-o)*e[t+1]+o*e[t+r+1];else if(0!==l){for(var h=e[t],c=e[t+1],u=0,p=[0],d=t+r;d<i;d+=r){var f=e[d],y=e[d+1];u+=Math.sqrt((f-h)*(f-h)+(y-c)*(y-c)),p.push(u),h=f,c=y}var m=o*u,g=function(e,t,i){for(var r,o,n=i||ma,a=0,s=e.length,l=!1;a<s;)(o=+n(e[r=a+(s-a>>1)],t))<0?a=r+1:(s=r,l=!o);return l?a:~a}(p,m);if(g<0){var v=(m-p[-g-2])/(p[-g-1]-p[-g-2]),b=t+(-g-2)*r;a=hr(e[b],e[b+r],v),s=hr(e[b+1],e[b+r+1],v)}else a=e[t+g*r],s=e[t+g*r+1]}return n?(n[0]=a,n[1]=s,n):[a,s]}function Ia(e,t,i,r,o,n){if(i==t)return null;var a;if(o<e[t+r-1])return n?((a=e.slice(t,t+r))[r-1]=o,a):null;if(e[i-1]<o)return n?((a=e.slice(i-r,i))[r-1]=o,a):null;if(o==e[t+r-1])return e.slice(t,t+r);for(var s=t/r,l=i/r;s<l;){var h=s+l>>1;o<e[(h+1)*r-1]?l=h:s=h+1}var c=e[s*r-1];if(o==c)return e.slice((s-1)*r,(s-1)*r+r);var u=(o-c)/(e[(s+1)*r-1]-c);a=[];for(var p=0;p<r-1;++p)a.push(hr(e[(s-1)*r+p],e[s*r+p],u));return a.push(o),a}function Ea(e,t,i,r,o){return!function(e,t,i){var r;return(r=t.call(i,Go(e)))?r:(r=t.call(i,Vo(e)))?r:(r=t.call(i,Wo(e)))?r:(r=t.call(i,Uo(e)))||!1}(o,function(o){return!Oa(e,t,i,r,o[0],o[1])})}function Oa(e,t,i,r,o,n){for(var a=0,s=e[i-r],l=e[i-r+1];t<i;t+=r){var h=e[t],c=e[t+1];l<=n?c>n&&(h-s)*(n-l)-(o-s)*(c-l)>0&&a++:c<=n&&(h-s)*(n-l)-(o-s)*(c-l)<0&&a--,s=h,l=c}return 0!==a}function Pa(e,t,i,r,o,n){if(0===i.length)return!1;if(!Oa(e,t,i[0],r,o,n))return!1;for(var a=1,s=i.length;a<s;++a)if(Oa(e,i[a-1],i[a],r,o,n))return!1;return!0}function ja(e,t,i,r,o,n){for(var a,s=[e[t],e[t+1]],l=[];t+r<i;t+=r){if(l[0]=e[t+r],l[1]=e[t+r+1],a=o.call(n,s,l))return a;s[0]=l[0],s[1]=l[1]}return!1}function Aa(e,t,i,r,o){var n=Fo([1/0,1/0,-1/0,-1/0],e,t,i,r);return!!Ho(o,n)&&(!!function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}(o,n)||(n[0]>=o[0]&&n[2]<=o[2]||(n[1]>=o[1]&&n[3]<=o[3]||ja(e,t,i,r,function(e,t){return function(e,t,i){var r=!1,o=Po(e,t),n=Po(e,i);if(o===Lo.INTERSECTING||n===Lo.INTERSECTING)r=!0;else{var a,s,l=e[0],h=e[1],c=e[2],u=e[3],p=t[0],d=t[1],f=i[0],y=i[1],m=(y-d)/(f-p);n&Lo.ABOVE&&!(o&Lo.ABOVE)&&(r=(a=f-(y-u)/m)>=l&&a<=c),r||!(n&Lo.RIGHT)||o&Lo.RIGHT||(r=(s=y-(f-c)*m)>=h&&s<=u),r||!(n&Lo.BELOW)||o&Lo.BELOW||(r=(a=f-(y-h)/m)>=l&&a<=c),r||!(n&Lo.LEFT)||o&Lo.LEFT||(r=(s=y-(f-l)*m)>=h&&s<=u)}return r}(o,e,t)}))))}function Ra(e,t,i,r,o){if(!function(e,t,i,r,o){return!!(Aa(e,t,i,r,o)||Oa(e,t,i,r,o[0],o[1])||Oa(e,t,i,r,o[0],o[3])||Oa(e,t,i,r,o[2],o[1])||Oa(e,t,i,r,o[2],o[3]))}(e,t,i[0],r,o))return!1;if(1===i.length)return!0;for(var n=1,a=i.length;n<a;++n)if(Ea(e,i[n-1],i[n],r,o)&&!Aa(e,i[n-1],i[n],r,o))return!1;return!0}function za(e,t,i,r){for(var o=e[t],n=e[t+1],a=0,s=t+r;s<i;s+=r){var l=e[s],h=e[s+1];a+=Math.sqrt((l-o)*(l-o)+(h-n)*(h-n)),o=l,n=h}return a}function Da(e,t,i,r,o,n,a){var s=(i-t)/r;if(s<3){for(;t<i;t+=r)n[a++]=e[t],n[a++]=e[t+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var h=[t,i-r],c=0;h.length>0;){for(var u=h.pop(),p=h.pop(),d=0,f=e[p],y=e[p+1],m=e[u],g=e[u+1],v=p+r;v<u;v+=r){var b=sr(e[v],e[v+1],f,y,m,g);b>d&&(c=v,d=b)}d>o&&(l[(c-t)/r]=1,p+r<c&&h.push(p,c),c+r<u&&h.push(c,u))}for(var _=0;_<s;++_)l[_]&&(n[a++]=e[t+_*r],n[a++]=e[t+_*r+1]);return a}function Fa(e,t,i,r,o,n,a,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];a=Da(e,t,c,r,o,n,a),s.push(a),t=c}return a}function Na(e,t){return t*Math.round(e/t)}function Ga(e,t,i,r,o,n,a){if(t==i)return a;var s,l,h=Na(e[t],o),c=Na(e[t+1],o);t+=r,n[a++]=h,n[a++]=c;do{if(s=Na(e[t],o),l=Na(e[t+1],o),(t+=r)==i)return n[a++]=s,n[a++]=l,a}while(s==h&&l==c);for(;t<i;){var u=Na(e[t],o),p=Na(e[t+1],o);if(t+=r,u!=s||p!=l){var d=s-h,f=l-c,y=u-h,m=p-c;d*m==f*y&&(d<0&&y<d||d==y||d>0&&y>d)&&(f<0&&m<f||f==m||f>0&&m>f)?(s=u,l=p):(n[a++]=s,n[a++]=l,h=s,c=l,s=u,l=p)}}return n[a++]=s,n[a++]=l,a}function Va(e,t,i,r,o,n,a,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];a=Ga(e,t,c,r,o,n,a),s.push(a),t=c}return a}var Ba=function(e){function t(t,i){e.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendCoordinate=function(e){this.flatCoordinates?va(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.forEachSegment=function(e){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinateAtM=function(e,t){if(this.layout!=En.XYM&&this.layout!=En.XYZM)return null;var i=void 0!==t&&t;return Ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)},t.prototype.getCoordinates=function(){return Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinateAt=function(e,t){return La(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t.prototype.getLength=function(){return za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=Da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,En.XY)},t.prototype.getType=function(){return or.LINE_STRING},t.prototype.intersectsExtent=function(e){return Aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jn(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn),qa=function(e){function t(t,i,r){if(e.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,i);else if(void 0!==i&&r)this.setFlatCoordinates(i,t),this.ends_=r;else{for(var o=this.getLayout(),n=t,a=[],s=[],l=0,h=n.length;l<h;++l){var c=n[l];0===l&&(o=c.getLayout()),va(a,c.getFlatCoordinates()),s.push(a.length)}this.setFlatCoordinates(o,a),this.ends_=s}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLineString=function(e){this.flatCoordinates?va(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(xa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ka(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.getCoordinateAtM=function(e,t,i){if(this.layout!=En.XYM&&this.layout!=En.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,o=void 0!==i&&i;return function(e,t,i,r,o,n,a){if(a)return Ia(e,t,i[i.length-1],r,o,n);var s;if(o<e[r-1])return n?((s=e.slice(0,r))[r-1]=o,s):null;if(e[e.length-1]<o)return n?((s=e.slice(e.length-r))[r-1]=o,s):null;for(var l=0,h=i.length;l<h;++l){var c=i[l];if(t!=c){if(o<e[t+r-1])return null;if(o<=e[c-1])return Ia(e,t,c,r,o,!1);t=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,e,r,o)},t.prototype.getCoordinates=function(){return Sa(this.flatCoordinates,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getLineString=function(e){return e<0||this.ends_.length<=e?null:new Ba(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLineStrings=function(){for(var e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[],o=0,n=0,a=t.length;n<a;++n){var s=t[n],l=new Ba(e.slice(o,s),i);r.push(l),o=s}return r},t.prototype.getFlatMidpoints=function(){for(var e=[],t=this.flatCoordinates,i=0,r=this.ends_,o=this.stride,n=0,a=r.length;n<a;++n){var s=r[n];va(e,La(t,i,s,o,.5)),i=s}return e},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=Fa(this.flatCoordinates,0,this.ends_,this.stride,e,i,0,r),new t(i,En.XY,r)},t.prototype.getType=function(){return or.MULTI_LINE_STRING},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){if(Aa(e,t,i[n],r,o))return!0;t=i[n]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=An(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(Pn),Ua=function(e){function t(t,i){e.call(this),i&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPoint=function(e){this.flatCoordinates?va(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){if(r<Eo(this.getExtent(),e,t))return r;for(var o=this.flatCoordinates,n=this.stride,a=0,s=o.length;a<s;a+=n){var l=lr(e,t,o[a],o[a+1]);if(l<r){r=l;for(var h=0;h<n;++h)i[h]=o[a+h];i.length=n}}return r},t.prototype.getCoordinates=function(){return Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getPoint=function(e){var t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return e<0||t<=e?null:new Rn(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)},t.prototype.getPoints=function(){for(var e=this.flatCoordinates,t=this.layout,i=this.stride,r=[],o=0,n=e.length;o<n;o+=i){var a=new Rn(e.slice(o,o+i),t);r.push(a)}return r},t.prototype.getType=function(){return or.MULTI_POINT},t.prototype.intersectsExtent=function(e){for(var t=this.flatCoordinates,i=this.stride,r=0,o=t.length;r<o;r+=i){if(Oo(e,t[r],t[r+1]))return!0}return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jn(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn);function Wa(e,t,i,r){for(var o=0,n=e[i-r],a=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];o+=a*s-n*l,n=s,a=l}return o/2}function Ha(e,t,i,r){for(var o=0,n=0,a=i.length;n<a;++n){var s=i[n];o+=Wa(e,t,s,r),t=s}return o}var Ya=function(e){function t(t,i){e.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.getArea=function(){return Wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=Da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,En.XY)},t.prototype.getType=function(){return or.LINEAR_RING},t.prototype.intersectsExtent=function(e){return!1},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jn(this.flatCoordinates,0,e,this.stride),this.changed()},t}(Pn);function Ja(e,t,i,r,o,n,a){for(var s,l,h,c,u,p,d,f=o[n+1],y=[],m=0,g=i.length;m<g;++m){var v=i[m];for(c=e[v-r],p=e[v-r+1],s=t;s<v;s+=r)u=e[s],d=e[s+1],(f<=p&&d<=f||p<=f&&f<=d)&&(h=(f-p)/(d-p)*(u-c)+c,y.push(h)),c=u,p=d}var b=NaN,_=-1/0;for(y.sort(ma),c=y[0],s=1,l=y.length;s<l;++s){u=y[s];var w=Math.abs(u-c);w>_&&Pa(e,t,i,r,h=(c+u)/2,f)&&(b=h,_=w),c=u}return isNaN(b)&&(b=o[n]),a?(a.push(b,f,_),a):[b,f,_]}function $a(e,t,i,r,o){for(var n=[],a=0,s=i.length;a<s;++a){var l=i[a];n=Ja(e,t,l,r,o,2*a,n),t=l[l.length-1]}return n}function Xa(e,t,i,r){for(;t<i-r;){for(var o=0;o<r;++o){var n=e[t+o];e[t+o]=e[i-r+o],e[i-r+o]=n}t+=r,i-=r}}function Za(e,t,i,r){for(var o=0,n=e[i-r],a=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];o+=(s-n)*(l+a),n=s,a=l}return o>0}function Ka(e,t,i,r,o){for(var n=void 0!==o&&o,a=0,s=i.length;a<s;++a){var l=i[a],h=Za(e,t,l,r);if(0===a){if(n&&h||!n&&!h)return!1}else if(n&&!h||!n&&h)return!1;t=l}return!0}function Qa(e,t,i,r,o){for(var n=void 0!==o&&o,a=0,s=i.length;a<s;++a){var l=i[a],h=Za(e,t,l,r);(0===a?n&&h||!n&&!h:n&&!h||!n&&h)&&Xa(e,t,l,r),t=l}return t}function es(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n)t=Qa(e,t,i[n],r,o);return t}var ts=function(e){function t(t,i,r){e.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==i&&r?(this.setFlatCoordinates(i,t),this.ends_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendLinearRing=function(e){this.flatCoordinates?va(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(xa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ka(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return Pa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)},t.prototype.getArea=function(){return Ha(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?Qa(t=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,e):t=this.flatCoordinates,Sa(t,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=Bo(this.getExtent());this.flatInteriorPoint_=Ja(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new Rn(this.getFlatInteriorPoint(),En.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(e){return e<0||this.ends_.length<=e?null:new Ya(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)},t.prototype.getLinearRings=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[],o=0,n=0,a=i.length;n<a;++n){var s=i[n],l=new Ya(t.slice(o,s),e);r.push(l),o=s}return r},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;Ka(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Qa(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=Va(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,r),new t(i,En.XY,r)},t.prototype.getType=function(){return or.POLYGON},t.prototype.intersectsExtent=function(e){return Ra(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=An(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(Pn),is=ts;function rs(e,t,i,r){for(var o=[],n=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];n=zo(e,t,l[0],r),o.push((n[0]+n[2])/2,(n[1]+n[3])/2),t=l[l.length-1]}return o}var os=function(e){function t(t,i,r){if(e.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(t[0])){for(var o=this.getLayout(),n=t,a=[],s=[],l=0,h=n.length;l<h;++l){var c=n[l];0===l&&(o=c.getLayout());for(var u=a.length,p=c.getEnds(),d=0,f=p.length;d<f;++d)p[d]+=u;va(a,c.getFlatCoordinates()),s.push(p)}i=o,t=a,r=s}void 0!==i&&r?(this.setFlatCoordinates(i,t),this.endss_=r):this.setCoordinates(t,i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPolygon=function(e){var t;if(this.flatCoordinates){var i=this.flatCoordinates.length;va(this.flatCoordinates,e.getFlatCoordinates());for(var r=0,o=(t=e.getEnds().slice()).length;r<o;++r)t[r]+=i}else this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();this.endss_.push(t),this.changed()},t.prototype.clone=function(){for(var e=this.endss_.length,i=new Array(e),r=0;r<e;++r)i[r]=this.endss_[r].slice();return new t(this.flatCoordinates.slice(),this.layout,i)},t.prototype.closestPointXY=function(e,t,i,r){return r<Eo(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n];o=xa(e,t,s,r,o),t=s[s.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(e,t,i,r,o,n,a,s,l,h,c){for(var u=c||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];h=ka(e,t,f,r,o,n,a,s,l,h,u),t=f[f.length-1]}return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return function(e,t,i,r,o,n){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(Pa(e,t,l,r,o,n))return!0;t=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)},t.prototype.getArea=function(){return function(e,t,i,r){for(var o=0,n=0,a=i.length;n<a;++n){var s=i[n];o+=Ha(e,t,s,r),t=s[s.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?es(t=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,e):t=this.flatCoordinates,Ta(t,0,this.endss_,this.stride)},t.prototype.getEndss=function(){return this.endss_},t.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var e=rs(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=$a(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t.prototype.getInteriorPoints=function(){return new Ua(this.getFlatInteriorPoints().slice(),En.XYM)},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;!function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n)if(!Ka(e,t,i[n],r,o))return!1;return!0}(e,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=es(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=e,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=function(e,t,i,r,o,n,a,s){for(var l=0,h=i.length;l<h;++l){var c=i[l],u=[];a=Va(e,t,c,r,o,n,a,u),s.push(u),t=c[c.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),i,0,r),new t(i,En.XY,r)},t.prototype.getPolygon=function(e){if(e<0||this.endss_.length<=e)return null;var t;if(0===e)t=0;else{var i=this.endss_[e-1];t=i[i.length-1]}var r=this.endss_[e].slice(),o=r[r.length-1];if(0!==t)for(var n=0,a=r.length;n<a;++n)r[n]-=t;return new is(this.flatCoordinates.slice(t,o),this.layout,r)},t.prototype.getPolygons=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[],o=0,n=0,a=i.length;n<a;++n){var s=i[n].slice(),l=s[s.length-1];if(0!==o)for(var h=0,c=s.length;h<c;++h)s[h]-=o;var u=new is(t.slice(o,l),e,s);r.push(u),o=l}return r},t.prototype.getType=function(){return or.MULTI_POLYGON},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n];if(Ra(e,t,s,r,o))return!0;t=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)},t.prototype.setCoordinates=function(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(e,t,i,r,o){for(var n=o||[],a=0,s=0,l=i.length;s<l;++s){var h=An(e,t,i[s],r,n[a]);n[a++]=h,t=h[h.length-1]}return n.length=a,n}(this.flatCoordinates,0,e,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},t}(Pn),ns=[1,0,0,1,0,0],as=function(e,t,i,r,o){this.extent_,this.id_=o,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};as.prototype.get=function(e){return this.properties_[e]},as.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===or.POINT?Ro(this.flatCoordinates_):zo(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},as.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=Bo(this.getExtent());this.flatInteriorPoints_=Ja(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},as.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=rs(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=$a(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},as.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=La(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},as.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,i=this.ends_,r=0,o=i.length;r<o;++r){var n=i[r],a=La(e,t,n,2,.5);va(this.flatMidpoints_,a),t=n}}return this.flatMidpoints_},as.prototype.getId=function(){return this.id_},as.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},as.prototype.getGeometry=function(){return this},as.prototype.getSimplifiedGeometry=function(e){return this},as.prototype.getProperties=function(){return this.properties_},as.prototype.getStride=function(){return 2},as.prototype.getStyleFunction=function(){},as.prototype.getType=function(){return this.type_},as.prototype.transform=function(e,t){var i=(e=Mn(e)).getExtent(),r=e.getWorldExtent(),o=qo(r)/qo(i);Wr(ns,r[0],r[3],o,-o,0,0,0),en(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ns,this.flatCoordinates_)},as.prototype.getEnds=as.prototype.getEndss=function(){return this.ends_},as.prototype.getFlatCoordinates=as.prototype.getOrientedFlatCoordinates;var ss=as;function ls(e,t,i){if(3===e){var r={keys:[],values:[],features:[]},o=i.readVarint()+i.pos;i.readFields(hs,r,o),r.length=r.features.length,r.length&&(t[r.name]=r)}}function hs(e,t,i){if(15===e)t.version=i.readVarint();else if(1===e)t.name=i.readString();else if(5===e)t.extent=i.readVarint();else if(2===e)t.features.push(i.pos);else if(3===e)t.keys.push(i.readString());else if(4===e){for(var r=null,o=i.readVarint()+i.pos;i.pos<o;)r=1===(e=i.readVarint()>>3)?i.readString():2===e?i.readFloat():3===e?i.readDouble():4===e?i.readVarint64():5===e?i.readVarint():6===e?i.readSVarint():7===e?i.readBoolean():null;t.values.push(r)}}function cs(e,t,i){if(1==e)t.id=i.readVarint();else if(2==e)for(var r=i.readVarint()+i.pos;i.pos<r;){var o=t.layer.keys[i.readVarint()],n=t.layer.values[i.readVarint()];t.properties[o]=n}else 3==e?t.type=i.readVarint():4==e&&(t.geometry=i.pos)}function us(e,t,i){e.pos=t.features[i];var r=e.readVarint()+e.pos,o={layer:t,type:0,properties:{}};return e.readFields(cs,o,r),o}var ps=function(e){function t(t){e.call(this);var i=t||{};this.dataProjection=new an({code:"",units:on.TILE_PIXELS}),this.featureClass_=i.featureClass?i.featureClass:ss,this.geometryName_=i.geometryName,this.layerName_=i.layerName?i.layerName:"layer",this.layers_=i.layers?i.layers:null,this.extent_=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.readRawGeometry_=function(e,t,i,r){e.pos=t.geometry;for(var o=e.readVarint()+e.pos,n=1,a=0,s=0,l=0,h=0,c=0;e.pos<o;){if(!a){var u=e.readVarint();n=7&u,a=u>>3}a--,1===n||2===n?(s+=e.readSVarint(),l+=e.readSVarint(),1===n&&h>c&&(r.push(h),c=h),i.push(s,l),h+=2):7===n?h>c&&(i.push(i[c],i[c+1]),h+=2):rr(!1,59)}h>c&&(r.push(h),c=h)},t.prototype.createFeature_=function(e,t,i){var r,o=t.type;if(0===o)return null;var n=t.id,a=t.properties;a[this.layerName_]=t.layer.name;var s=[],l=[];this.readRawGeometry_(e,t,s,l);var h=function(e,t){var i;1===e?i=1===t?or.POINT:or.MULTI_POINT:2===e?i=1===t?or.LINE_STRING:or.MULTI_LINE_STRING:3===e&&(i=or.POLYGON);return i}(o,l.length);if(this.featureClass_===ss)r=new this.featureClass_(h,s,l,a,n);else{var c;if(h==or.POLYGON){for(var u=[],p=0,d=0,f=0,y=l.length;f<y;++f){var m=l[f];Za(s,p,m,2)||(u.push(l.slice(d,f)),d=f),p=m}c=u.length>1?new os(s,En.XY,u):new is(s,En.XY,l)}else c=h===or.POINT?new Rn(s,En.XY):h===or.LINE_STRING?new Ba(s,En.XY):h===or.POLYGON?new is(s,En.XY,l):h===or.MULTI_POINT?new Ua(s,En.XY):h===or.MULTI_LINE_STRING?new qa(s,En.XY,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var g=fa(c,!1,this.adaptOptions(i));r.setGeometry(g),r.setId(n),r.setProperties(a)}return r},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return ya},t.prototype.readFeatures=function(e,t){var i=this.layers_,r=new ua.a(e),o=r.readFields(ls,{}),n=[];for(var a in o)if(!i||-1!=i.indexOf(a)){for(var s=o[a],l=0,h=s.length;l<h;++l){var c=us(r,s,l);n.push(this.createFeature_(r,c))}this.extent_=s?[0,0,s.extent,s.extent]:null}return n},t.prototype.readProjection=function(e){return this.dataProjection},t.prototype.setLayers=function(e){this.layers_=e},t}(da),ds=function(){};ds.prototype.getReplay=function(e,t){return Ki()},ds.prototype.isEmpty=function(){return Ki()},ds.prototype.addDeclutter=function(e){return Ki()};var fs=ds,ys={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function ms(e,t,i,r,o,n,a,s){for(var l,h,c,u=[],p=e[t]>e[i-r],d=o.length,f=e[t],y=e[t+1],m=e[t+=r],g=e[t+1],v=0,b=Math.sqrt(Math.pow(m-f,2)+Math.pow(g-y,2)),_="",w=0,x=0;x<d;++x){h=p?d-x-1:x;var C=o.charAt(h),k=n(_=p?C+_:_+C)-w;w+=k;for(var M=a+k/2;t<i-r&&v+b<M;)f=m,y=g,m=e[t+=r],g=e[t+1],v+=b,b=Math.sqrt(Math.pow(m-f,2)+Math.pow(g-y,2));var S=M-v,T=Math.atan2(g-y,m-f);if(p&&(T+=T>0?-Math.PI:Math.PI),void 0!==c){var L=T-c;if(L+=L>Math.PI?-2*Math.PI:L<-Math.PI?2*Math.PI:0,Math.abs(L)>s)return null}var I=S/b,E=hr(f,m,I),O=hr(y,g,I);c==T?(p&&(l[0]=E,l[1]=O,l[2]=k/2),l[4]=_):(w=k,l=[E,O,k/2,T,_=C],p?u.unshift(l):u.push(l),c=T),a+=k}return u}var gs=function(){};gs.prototype.drawCustom=function(e,t,i){},gs.prototype.drawGeometry=function(e){},gs.prototype.setStyle=function(e){},gs.prototype.drawCircle=function(e,t){},gs.prototype.drawFeature=function(e,t){},gs.prototype.drawGeometryCollection=function(e,t){},gs.prototype.drawLineString=function(e,t){},gs.prototype.drawMultiLineString=function(e,t){},gs.prototype.drawMultiPoint=function(e,t){},gs.prototype.drawMultiPolygon=function(e,t){},gs.prototype.drawPoint=function(e,t){},gs.prototype.drawPolygon=function(e,t){},gs.prototype.drawText=function(e,t){},gs.prototype.setFillStrokeStyle=function(e,t){},gs.prototype.setImageStyle=function(e,t){},gs.prototype.setTextStyle=function(e,t){};var vs=gs,bs={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},_s=[bs.FILL],ws=[bs.STROKE],xs=[bs.BEGIN_PATH],Cs=[bs.CLOSE_PATH],ks=bs,Ms=[ys.POLYGON,ys.CIRCLE,ys.LINE_STRING,ys.IMAGE,ys.TEXT,ys.DEFAULT],Ss={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ts=[1/0,1/0,-1/0,-1/0],Ls=[1,0,0,1,0,0],Is=function(e){function t(t,i,r,o,n,a){e.call(this),this.declutterTree=a,this.tolerance=t,this.maxExtent=i,this.overlaps=n,this.pixelRatio=o,this.maxLineWidth=0,this.resolution=r,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replayTextBackground_=function(e,t,i,r,o,n,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,o),e.lineTo.apply(e,t),n&&(this.alignFill_=n[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())},t.prototype.replayImage_=function(e,t,i,r,o,n,a,s,l,h,c,u,p,d,f,y,m,g){var v=m||g;t-=o*=p,i-=n*=p;var b,_,w,x,C=f+h>r.width?r.width-h:f,k=s+c>r.height?r.height-c:s,M=y[3]+C*p+y[1],S=y[0]+k*p+y[2],T=t-y[3],L=i-y[0];(v||0!==u)&&(b=[T,L],_=[T+M,L],w=[T+M,L+S],x=[T,L+S]);var I=null;if(0!==u){var E=t+o,O=i+n;I=Wr(Ls,E,O,1,1,u,-E,-O),Ao(Ts),Do(Ts,Ur(Ls,b)),Do(Ts,Ur(Ls,_)),Do(Ts,Ur(Ls,w)),Do(Ts,Ur(Ls,x))}else jo(T,L,T+M,L+S,Ts);var P=e.canvas,j=g?g[2]*p/2:0,A=Ts[0]-j<=P.width&&Ts[2]+j>=0&&Ts[1]-j<=P.height&&Ts[3]+j>=0;if(d&&(t=Math.round(t),i=Math.round(i)),a){if(!A&&1==a[4])return;!function(e,t){t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3])}(a,Ts);var R=A?[e,I?I.slice(0):null,l,r,h,c,C,k,t,i,p]:null;R&&v&&R.push(m,g,b,_,w,x),a.push(R)}else A&&(v&&this.replayTextBackground_(e,b,_,w,x,m,g),no(e,I,l,r,h,c,C,k,t,i,p))},t.prototype.applyPixelRatio=function(e){var t=this.pixelRatio;return 1==t?e:e.map(function(e){return e*t})},t.prototype.appendFlatCoordinates=function(e,t,i,r,o,n){var a=this.coordinates.length,s=this.getBufferedMaxExtent();n&&(t+=r);var l,h,c,u=[e[t],e[t+1]],p=[NaN,NaN],d=!0;for(l=t+r;l<i;l+=r)p[0]=e[l],p[1]=e[l+1],(c=Po(s,p))!==h?(d&&(this.coordinates[a++]=u[0],this.coordinates[a++]=u[1]),this.coordinates[a++]=p[0],this.coordinates[a++]=p[1],d=!1):c===Lo.INTERSECTING?(this.coordinates[a++]=p[0],this.coordinates[a++]=p[1],d=!1):d=!0,u[0]=p[0],u[1]=p[1],h=c;return(o&&d||l===t+r)&&(this.coordinates[a++]=u[0],this.coordinates[a++]=u[1]),a},t.prototype.drawCustomCoordinates_=function(e,t,i,r,o){for(var n=0,a=i.length;n<a;++n){var s=i[n],l=this.appendFlatCoordinates(e,t,s,r,!1,!1);o.push(l),t=s}return t},t.prototype.drawCustom=function(e,t,i){this.beginGeometry(e,t);var r,o,n,a,s,l=e.getType(),h=e.getStride(),c=this.coordinates.length;if(l==or.MULTI_POLYGON){r=(e=e).getOrientedFlatCoordinates(),a=[];var u=e.getEndss();s=0;for(var p=0,d=u.length;p<d;++p){var f=[];s=this.drawCustomCoordinates_(r,s,u[p],h,f),a.push(f)}this.instructions.push([ks.CUSTOM,c,a,e,i,Ta])}else l==or.POLYGON||l==or.MULTI_LINE_STRING?(n=[],r=l==or.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,e.getEnds(),h,n),this.instructions.push([ks.CUSTOM,c,n,e,i,Sa])):l==or.LINE_STRING||l==or.MULTI_POINT?(r=e.getFlatCoordinates(),o=this.appendFlatCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([ks.CUSTOM,c,o,e,i,Ma])):l==or.POINT&&(r=e.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),o=this.coordinates.length,this.instructions.push([ks.CUSTOM,c,o,e,i]));this.endGeometry(e,t)},t.prototype.beginGeometry=function(e,t){this.beginGeometryInstruction1_=[ks.BEGIN_GEOMETRY,t,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ks.BEGIN_GEOMETRY,t,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){},t.prototype.fill_=function(e){if(this.alignFill_){var t=Ur(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.translate(t[0]%i,t[1]%i),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.setTransform.apply(e,oo)},t.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],br&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},t.prototype.renderDeclutter_=function(e,t){if(e&&e.length>5){var i=e[4];if(1==i||i==e.length-5){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var o=5,n=e.length;o<n;++o){var a=e[o];a&&(a.length>11&&this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12]),no.apply(void 0,a))}}e.length=5,Ao(e)}}},t.prototype.replay_=function(e,t,i,r,o,n,a){var s;this.pixelCoordinates_&&ba(t,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=en(this.coordinates,0,this.coordinates.length,2,t,this.pixelCoordinates_),function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5]}(this.renderedTransform_,t));for(var l,h,c,u,p,d,f,y,m,g,v,b,_=!kr(i),w=0,x=r.length,C=0,k=0,M=0,S=null,T=null,L=this.coordinateCache_,I=this.viewRotation_,E={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},O=this.instructions!=r||this.overlaps?0:200;w<x;){var P=r[w];switch(P[0]){case ks.BEGIN_GEOMETRY:g=P[1],_&&i[er(g)]||!g.getGeometry()?w=P[2]:void 0===a||Ho(a,g.getGeometry().getExtent())?++w:w=P[2]+1;break;case ks.BEGIN_PATH:k>O&&(this.fill_(e),k=0),M>O&&(e.stroke(),M=0),k||M||(e.beginPath(),u=p=NaN),++w;break;case ks.CIRCLE:var j=s[C=P[1]],A=s[C+1],R=s[C+2]-j,z=s[C+3]-A,D=Math.sqrt(R*R+z*z);e.moveTo(j+D,A),e.arc(j,A,D,0,2*Math.PI,!0),++w;break;case ks.CLOSE_PATH:e.closePath(),++w;break;case ks.CUSTOM:C=P[1],l=P[2];var F=P[3],N=P[4],G=6==P.length?P[5]:void 0;E.geometry=F,E.feature=g,w in L||(L[w]=[]);var V=L[w];G?G(s,C,l,2,V):(V[0]=s[C],V[1]=s[C+1],V.length=2),N(V,E),++w;break;case ks.DRAW_IMAGE:C=P[1],l=P[2],m=P[3],h=P[4],c=P[5],y=n?null:P[6];var B=P[7],q=P[8],U=P[9],W=P[10],H=P[11],Y=P[12],J=P[13],$=P[14],X=void 0,Z=void 0,K=void 0;for(P.length>16?(X=P[15],Z=P[16],K=P[17]):(X=$r,Z=K=!1),H&&(Y+=I);C<l;C+=2)this.replayImage_(e,s[C],s[C+1],m,h,c,y,B,q,U,W,Y,J,o,$,X,Z?S:null,K?T:null);this.renderDeclutter_(y,g),++w;break;case ks.DRAW_CHARS:var Q=P[1],ee=P[2],te=P[3];y=n?null:P[4];var ie=P[5],re=P[6],oe=P[7],ne=P[8],ae=P[9],se=P[10],le=P[11],he=P[12],ce=P[13],ue=P[14],pe=za(s,Q,ee,2),de=ne(he);if(ie||de<=pe){var fe=this.textStates[ce].textAlign,ye=ms(s,Q,ee,2,he,ne,(pe-de)*Ss[fe],oe);if(ye){var me=void 0,ge=void 0,ve=void 0,be=void 0,_e=void 0;if(se)for(me=0,ge=ye.length;me<ge;++me)ve=(_e=ye[me])[4],be=this.getImage(ve,ce,"",se),h=_e[2]+le,c=te*be.height+2*(.5-te)*le-ae,this.replayImage_(e,_e[0],_e[1],be,h,c,y,be.height,1,0,0,_e[3],ue,!1,be.width,$r,null,null);if(re)for(me=0,ge=ye.length;me<ge;++me)ve=(_e=ye[me])[4],be=this.getImage(ve,ce,re,""),h=_e[2],c=te*be.height-ae,this.replayImage_(e,_e[0],_e[1],be,h,c,y,be.height,1,0,0,_e[3],ue,!1,be.width,$r,null,null)}}this.renderDeclutter_(y,g),++w;break;case ks.END_GEOMETRY:if(void 0!==n){var we=n(g=P[1]);if(we)return we}++w;break;case ks.FILL:O?k++:this.fill_(e),++w;break;case ks.MOVE_TO_LINE_TO:for(C=P[1],l=P[2],v=s[C],f=(b=s[C+1])+.5|0,(d=v+.5|0)===u&&f===p||(e.moveTo(v,b),u=d,p=f),C+=2;C<l;C+=2)d=(v=s[C])+.5|0,f=(b=s[C+1])+.5|0,C!=l-2&&d===u&&f===p||(e.lineTo(v,b),u=d,p=f);++w;break;case ks.SET_FILL_STYLE:S=P,this.alignFill_=P[2],k&&(this.fill_(e),k=0,M&&(e.stroke(),M=0)),e.fillStyle=P[1],++w;break;case ks.SET_STROKE_STYLE:T=P,M&&(e.stroke(),M=0),this.setStrokeStyle_(e,P),++w;break;case ks.STROKE:O?M++:e.stroke(),++w;break;default:++w}}k&&this.fill_(e),M&&e.stroke()},t.prototype.replay=function(e,t,i,r,o){this.viewRotation_=i,this.replay_(e,t,r,this.instructions,o,void 0,void 0)},t.prototype.replayHitDetection=function(e,t,i,r,o,n){return this.viewRotation_=i,this.replay_(e,t,r,this.hitDetectionInstructions,!0,o,n)},t.prototype.reverseHitDetectionInstructions=function(){var e,t=this.hitDetectionInstructions;t.reverse();var i,r,o=t.length,n=-1;for(e=0;e<o;++e)(r=(i=t[e])[0])==ks.END_GEOMETRY?n=e:r==ks.BEGIN_GEOMETRY&&(i[2]=e,ga(this.hitDetectionInstructions,n,e),n=-1)},t.prototype.setFillStrokeStyle=function(e,t){var i=this.state;if(e){var r=e.getColor();i.fillStyle=mr(r||Hr)}else i.fillStyle=void 0;if(t){var o=t.getColor();i.strokeStyle=mr(o||Jr);var n=t.getLineCap();i.lineCap=void 0!==n?n:"round";var a=t.getLineDash();i.lineDash=a?a.slice():Yr;var s=t.getLineDashOffset();i.lineDashOffset=s||0;var l=t.getLineJoin();i.lineJoin=void 0!==l?l:"round";var h=t.getWidth();i.lineWidth=void 0!==h?h:1;var c=t.getMiterLimit();i.miterLimit=void 0!==c?c:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},t.prototype.createFill=function(e,t){var i=e.fillStyle,r=[ks.SET_FILL_STYLE,i];return"string"!=typeof i&&r.push(!0),r},t.prototype.applyStroke=function(e){this.instructions.push(this.createStroke(e))},t.prototype.createStroke=function(e){return[ks.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(e,t,i){var r=e.fillStyle;"string"==typeof r&&e.currentFillStyle==r||(void 0!==r&&this.instructions.push(t.call(this,e,i)),e.currentFillStyle=r)},t.prototype.updateStrokeStyle=function(e,t){var i=e.strokeStyle,r=e.lineCap,o=e.lineDash,n=e.lineDashOffset,a=e.lineJoin,s=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||o!=e.currentLineDash&&!ba(e.currentLineDash,o)||e.currentLineDashOffset!=n||e.currentLineJoin!=a||e.currentLineWidth!=s||e.currentMiterLimit!=l)&&(void 0!==i&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=o,e.currentLineDashOffset=n,e.currentLineJoin=a,e.currentLineWidth=s,e.currentMiterLimit=l)},t.prototype.endGeometry=function(e,t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[ks.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}(this.maxExtent),this.maxLineWidth>0)){var e=this.resolution*(this.maxLineWidth+1)/2;Io(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(vs),Es=function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawCoordinates_=function(e,t,i,r){return this.appendFlatCoordinates(e,t,i,r,!1,!1)},t.prototype.drawPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),o=this.coordinates.length,n=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ks.DRAW_IMAGE,o,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ks.DRAW_IMAGE,o,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.drawMultiPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),o=this.coordinates.length,n=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ks.DRAW_IMAGE,o,n,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([ks.DRAW_IMAGE,o,n,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0},t.prototype.setImageStyle=function(e,t){var i=e.getAnchor(),r=e.getSize(),o=e.getHitDetectionImage(1),n=e.getImage(1),a=e.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=t,this.hitDetectionImage_=o,this.image_=n,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScale(),this.width_=r[0]},t}(Is),Os=function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinates_=function(e,t,i,r){var o=this.coordinates.length,n=this.appendFlatCoordinates(e,t,i,r,!1,!1),a=[ks.MOVE_TO_LINE_TO,o,n];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},t.prototype.drawLineString=function(e,t){var i=this.state,r=i.strokeStyle,o=i.lineWidth;if(void 0!==r&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],xs);var n=e.getFlatCoordinates(),a=e.getStride();this.drawFlatCoordinates_(n,0,n.length,a),this.hitDetectionInstructions.push(ws),this.endGeometry(e,t)}},t.prototype.drawMultiLineString=function(e,t){var i=this.state,r=i.strokeStyle,o=i.lineWidth;if(void 0!==r&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],xs);for(var n=e.getEnds(),a=e.getFlatCoordinates(),s=e.getStride(),l=0,h=0,c=n.length;h<c;++h)l=this.drawFlatCoordinates_(a,l,n[h],s);this.hitDetectionInstructions.push(ws),this.endGeometry(e,t)}},t.prototype.finish=function(){var e=this.state;void 0!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ws),this.reverseHitDetectionInstructions(),this.state=null},t.prototype.applyStroke=function(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(ws),t.lastStroke=this.coordinates.length),t.lastStroke=0,e.prototype.applyStroke.call(this,t),this.instructions.push(xs)},t}(Is),Ps=function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawFlatCoordinatess_=function(e,t,i,r){var o=this.state,n=void 0!==o.fillStyle,a=void 0!=o.strokeStyle,s=i.length;this.instructions.push(xs),this.hitDetectionInstructions.push(xs);for(var l=0;l<s;++l){var h=i[l],c=this.coordinates.length,u=this.appendFlatCoordinates(e,t,h,r,!0,!a),p=[ks.MOVE_TO_LINE_TO,c,u];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(Cs),this.hitDetectionInstructions.push(Cs)),t=h}return n&&(this.instructions.push(_s),this.hitDetectionInstructions.push(_s)),a&&(this.instructions.push(ws),this.hitDetectionInstructions.push(ws)),t},t.prototype.drawCircle=function(e,t){var i=this.state,r=i.fillStyle,o=i.strokeStyle;if(void 0!==r||void 0!==o){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ks.SET_FILL_STYLE,pr(Hr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var n=e.getFlatCoordinates(),a=e.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(n,0,n.length,a,!1,!1);var l=[ks.CIRCLE,s];this.instructions.push(xs,l),this.hitDetectionInstructions.push(xs,l),this.hitDetectionInstructions.push(_s),void 0!==i.fillStyle&&this.instructions.push(_s),void 0!==i.strokeStyle&&(this.instructions.push(ws),this.hitDetectionInstructions.push(ws)),this.endGeometry(e,t)}},t.prototype.drawPolygon=function(e,t){var i=this.state,r=i.fillStyle,o=i.strokeStyle;if(void 0!==r||void 0!==o){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ks.SET_FILL_STYLE,pr(Hr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var n=e.getEnds(),a=e.getOrientedFlatCoordinates(),s=e.getStride();this.drawFlatCoordinatess_(a,0,n,s),this.endGeometry(e,t)}},t.prototype.drawMultiPolygon=function(e,t){var i=this.state,r=i.fillStyle,o=i.strokeStyle;if(void 0!==r||void 0!==o){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ks.SET_FILL_STYLE,pr(Hr)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ks.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var n=e.getEndss(),a=e.getOrientedFlatCoordinates(),s=e.getStride(),l=0,h=0,c=n.length;h<c;++h)l=this.drawFlatCoordinatess_(a,l,n[h],s);this.endGeometry(e,t)}},t.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var t=this.coordinates,i=0,r=t.length;i<r;++i)t[i]=Na(t[i],e)},t.prototype.setFillStrokeStyles_=function(e){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill,e),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},t}(Is);function js(e,t,i,r,o){var n,a,s,l,h,c,u,p,d,f=i,y=i,m=0,g=0,v=i;for(n=i;n<r;n+=o){var b=t[n],_=t[n+1];void 0!==l&&(p=b-l,d=_-h,s=Math.sqrt(p*p+d*d),void 0!==c&&(g+=a,Math.acos((c*p+u*d)/(a*s))>e&&(g>m&&(m=g,f=v,y=n),g=0,v=n-o)),a=s,c=p,u=d),l=b,h=_}return(g+=s)>m?[v,n]:[f,y]}var As={Circle:Ps,Default:Is,Image:Es,LineString:Os,Polygon:Ps,Text:function(e){function t(t,i,r,o,n,a){e.call(this,t,i,r,o,n,a),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Xr.prune()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.drawText=function(e,t){var i=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||r)){var n,a,s=this.coordinates.length,l=e.getType(),h=null,c=2,u=2;if(o.placement===Mo){if(!Ho(this.getBufferedMaxExtent(),e.getExtent()))return;var p;if(h=e.getFlatCoordinates(),u=e.getStride(),l==or.LINE_STRING)p=[h.length];else if(l==or.MULTI_LINE_STRING)p=e.getEnds();else if(l==or.POLYGON)p=e.getEnds().slice(0,1);else if(l==or.MULTI_POLYGON){var d=e.getEndss();for(p=[],n=0,a=d.length;n<a;++n)p.push(d[n][0])}this.beginGeometry(e,t);for(var f,y=o.textAlign,m=0,g=0,v=p.length;g<v;++g){if(void 0==y){var b=js(o.maxAngle,h,m,p[g],u);m=b[0],f=b[1]}else f=p[g];for(n=m;n<f;n+=u)this.coordinates.push(h[n],h[n+1]);c=this.coordinates.length,m=p[g],this.drawChars_(s,c,this.declutterGroup_),s=c}this.endGeometry(e,t)}else{var _=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),w=_.width/this.pixelRatio;switch(l){case or.POINT:case or.MULTI_POINT:c=(h=e.getFlatCoordinates()).length;break;case or.LINE_STRING:h=e.getFlatMidpoint();break;case or.CIRCLE:h=e.getCenter();break;case or.MULTI_LINE_STRING:c=(h=e.getFlatMidpoints()).length;break;case or.POLYGON:if(h=e.getFlatInteriorPoint(),!o.overflow&&h[2]/this.resolution<w)return;u=3;break;case or.MULTI_POLYGON:var x=e.getFlatInteriorPoints();for(h=[],n=0,a=x.length;n<a;n+=3)(o.overflow||x[n+2]/this.resolution>=w)&&h.push(x[n],x[n+1]);if(0==(c=h.length))return}c=this.appendFlatCoordinates(h,0,c,u,!1,!1),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,e),this.hitDetectionInstructions.push(this.createFill(this.state,e))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,t),this.drawTextImage_(_,s,c),this.endGeometry(e,t)}}},t.prototype.getImage=function(e,t,i,r){var o,n=r+t+e+i+this.pixelRatio;if(!Xr.containsKey(n)){var a=r?this.strokeStates[r]||this.textStrokeState_:null,s=i?this.fillStates[i]||this.textFillState_:null,l=this.textStates[t]||this.textState_,h=this.pixelRatio,c=l.scale*h,u=Ss[l.textAlign||"center"],p=r&&a.lineWidth?a.lineWidth:0,d=e.split("\n"),f=d.length,y=[],m=function(e,t,i){for(var r=t.length,o=0,n=0;n<r;++n){var a=ro(e,t[n]);o=Math.max(o,a),i.push(a)}return o}(l.font,d,y),g=io(l.font),v=g*f,b=m+p,_=gr(Math.ceil(b*c),Math.ceil((v+p)*c));o=_.canvas,Xr.set(n,o),1!=c&&_.scale(c,c),_.font=l.font,r&&(_.strokeStyle=a.strokeStyle,_.lineWidth=p,_.lineCap=a.lineCap,_.lineJoin=a.lineJoin,_.miterLimit=a.miterLimit,br&&a.lineDash.length&&(_.setLineDash(a.lineDash),_.lineDashOffset=a.lineDashOffset)),i&&(_.fillStyle=s.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,x=.5-u,C=u*o.width/c+x*p;if(r)for(w=0;w<f;++w)_.strokeText(d[w],C+x*y[w],.5*(p+g)+w*g);if(i)for(w=0;w<f;++w)_.fillText(d[w],C+x*y[w],.5*(p+g)+w*g)}return Xr.get(n)},t.prototype.drawTextImage_=function(e,t,i){var r=this.textState_,o=this.textStrokeState_,n=this.pixelRatio,a=Ss[r.textAlign||"center"],s=Ss[r.textBaseline],l=o&&o.lineWidth?o.lineWidth:0,h=a*e.width/n+2*(.5-a)*l,c=s*e.height/n+2*(.5-s)*l;this.instructions.push([ks.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*n,(c-this.textOffsetY_)*n,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,e.width,r.padding==$r?$r:r.padding.map(function(e){return e*n}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([ks.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*n,(c-this.textOffsetY_)*n,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/n,e.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(e,t,i){var r=this.textStrokeState_,o=this.textState_,n=this.textFillState_,a=this.strokeKey_;r&&(a in this.strokeStates||(this.strokeStates[a]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var s=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:o.font,textAlign:o.textAlign||"center",scale:o.scale});var l=this.fillKey_;n&&(l in this.fillStates||(this.fillStates[l]={fillStyle:n.fillStyle}));var h=this.pixelRatio,c=Ss[o.textBaseline],u=this.textOffsetY_*h,p=this.text_,d=o.font,f=o.scale,y=r?r.lineWidth*f/2:0,m=this.widths_[d];m||(this.widths_[d]=m={}),this.instructions.push([ks.DRAW_CHARS,e,t,c,i,o.overflow,l,o.maxAngle,function(e){var t=m[e];return t||(t=m[e]=ro(d,e)),t*f*h},u,a,y*h,p,s,1]),this.hitDetectionInstructions.push([ks.DRAW_CHARS,e,t,c,i,o.overflow,l,o.maxAngle,function(e){var t=m[e];return t||(t=m[e]=ro(d,e)),t*f},u,a,y,p,s,1/h])},t.prototype.setTextStyle=function(e,t){var i,r,o;if(e){this.declutterGroup_=t;var n=e.getFill();n?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=mr(n.getColor()||Hr)):r=this.textFillState_=null;var a=e.getStroke();if(a){(o=this.textStrokeState_)||(o=this.textStrokeState_={});var s=a.getLineDash(),l=a.getLineDashOffset(),h=a.getWidth(),c=a.getMiterLimit();o.lineCap=a.getLineCap()||"round",o.lineDash=s?s.slice():Yr,o.lineDashOffset=void 0===l?0:l,o.lineJoin=a.getLineJoin()||"round",o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=mr(a.getColor()||Jr)}else o=this.textStrokeState_=null;i=this.textState_;var u=e.getFont()||"10px sans-serif";eo(u);var p=e.getScale();i.overflow=e.getOverflow(),i.font=u,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.textBaseline=e.getTextBaseline()||"middle",i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||$r,i.scale=void 0===p?1:p;var d=e.getOffsetX(),f=e.getOffsetY(),y=e.getRotateWithView(),m=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===m?0:m,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:er(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+er(r.fillStyle):""}else this.text_=""},t}(Is)},Rs=function(e){function t(t,i,r,o,n,a,s){e.call(this),this.declutterTree_=a,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=n,this.pixelRatio_=o,this.resolution_=r,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=gr(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addDeclutter=function(e){var t=null;return this.declutterTree_&&(e?(t=this.declutterGroup_)[4]++:(t=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),t},t.prototype.clip=function(e,t){var i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()},t.prototype.hasReplays=function(e){for(var t in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[t],r=0,o=e.length;r<o;++r)if(e[r]in i)return!0;return!1},t.prototype.finish=function(){for(var e in this.replaysByZIndex_){var t=this.replaysByZIndex_[e];for(var i in t)t[i].finish()}},t.prototype.forEachFeatureAtCoordinate=function(e,t,i,r,o,n,a){var s,l=2*(r=Math.round(r))+1,h=Wr(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=this.hitDetectionContext_;c.canvas.width!==l||c.canvas.height!==l?(c.canvas.width=l,c.canvas.height=l):c.clearRect(0,0,l,l),void 0!==this.renderBuffer_&&(Do(s=[1/0,1/0,-1/0,-1/0],e),Io(s,t*(this.renderBuffer_+r),s));var u,p,d=function(e){if(void 0!==zs[e])return zs[e];for(var t=2*e+1,i=new Array(t),r=0;r<t;r++)i[r]=new Array(t);var o=e,n=0,a=0;for(;o>=n;)Ds(i,e+o,e+n),Ds(i,e+n,e+o),Ds(i,e-n,e+o),Ds(i,e-o,e+n),Ds(i,e-o,e-n),Ds(i,e-n,e-o),Ds(i,e+n,e-o),Ds(i,e+o,e-n),2*((a+=1+2*++n)-o)+1>0&&(a+=1-2*(o-=1));return zs[e]=i,i}(r);function f(e){for(var t=c.getImageData(0,0,l,l).data,i=0;i<l;i++)for(var r=0;r<l;r++)if(d[i][r]&&t[4*(r*l+i)+3]>0){var o=void 0;return(!u||p!=ys.IMAGE&&p!=ys.TEXT||-1!==u.indexOf(e))&&(o=n(e)),o||void c.clearRect(0,0,l,l)}}this.declutterTree_&&(u=this.declutterTree_.all().map(function(e){return e.value}));var y,m,g,v,b,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort(ma),y=_.length-1;y>=0;--y){var w=_[y].toString();for(g=this.replaysByZIndex_[w],m=Ms.length-1;m>=0;--m)if(void 0!==(v=g[p=Ms[m]]))if(!a||p!=ys.IMAGE&&p!=ys.TEXT){if(b=v.replayHitDetection(c,h,i,o,f,s))return b}else{var x=a[w];x?x.push(v,h.slice(0)):a[w]=[v,h.slice(0)]}}},t.prototype.getClipCoords=function(e){var t=this.maxExtent_,i=t[0],r=t[1],o=t[2],n=t[3],a=[i,r,i,n,o,n,o,r];return en(a,0,8,2,e,a),a},t.prototype.getReplay=function(e,t){var i=void 0!==e?e.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var o=r[t];void 0===o&&(o=new(0,As[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[t]=o);return o},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return kr(this.replaysByZIndex_)},t.prototype.replay=function(e,t,i,r,o,n,a){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(ma),e.save(),this.clip(e,t);var l,h,c,u,p,d,f=n||Ms;for(l=0,h=s.length;l<h;++l){var y=s[l].toString();for(p=this.replaysByZIndex_[y],c=0,u=f.length;c<u;++c){var m=f[c];if(d=p[m],void 0!==d)if(!a||m!=ys.IMAGE&&m!=ys.TEXT)d.replay(e,t,i,r,o);else{var g=a[y];g?g.push(d,t.slice(0)):a[y]=[d,t.slice(0)]}}}e.restore()},t}(fs),zs={0:[[!0]]};function Ds(e,t,i){var r,o=Math.floor(e.length/2);if(t>=o)for(r=o;r<t;r++)e[r][i]=!0;else if(t<o)for(r=t+1;r<o;r++)e[r][i]=!0}var Fs=Rs,Ns={Point:function(e,t,i,r){var o=i.getImage();if(o){if(o.getImageState()!=_r.LOADED)return;var n=e.getReplay(i.getZIndex(),ys.IMAGE);n.setImageStyle(o,e.addDeclutter(!1)),n.drawPoint(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!!o)),s.drawText(t,r)}},LineString:function(e,t,i,r){var o=i.getStroke();if(o){var n=e.getReplay(i.getZIndex(),ys.LINE_STRING);n.setFillStrokeStyle(null,o),n.drawLineString(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!1)),s.drawText(t,r)}},Polygon:function(e,t,i,r){var o=i.getFill(),n=i.getStroke();if(o||n){var a=e.getReplay(i.getZIndex(),ys.POLYGON);a.setFillStrokeStyle(o,n),a.drawPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),ys.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},MultiPoint:function(e,t,i,r){var o=i.getImage();if(o){if(o.getImageState()!=_r.LOADED)return;var n=e.getReplay(i.getZIndex(),ys.IMAGE);n.setImageStyle(o,e.addDeclutter(!1)),n.drawMultiPoint(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!!o)),s.drawText(t,r)}},MultiLineString:function(e,t,i,r){var o=i.getStroke();if(o){var n=e.getReplay(i.getZIndex(),ys.LINE_STRING);n.setFillStrokeStyle(null,o),n.drawMultiLineString(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),ys.TEXT);s.setTextStyle(a,e.addDeclutter(!1)),s.drawText(t,r)}},MultiPolygon:function(e,t,i,r){var o=i.getFill(),n=i.getStroke();if(n||o){var a=e.getReplay(i.getZIndex(),ys.POLYGON);a.setFillStrokeStyle(o,n),a.drawMultiPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),ys.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},GeometryCollection:function(e,t,i,r){var o,n,a=t.getGeometriesArray();for(o=0,n=a.length;o<n;++o){var s=Ns[a[o].getType()];s(e,a[o],i,r)}},Circle:function(e,t,i,r){var o=i.getFill(),n=i.getStroke();if(o||n){var a=e.getReplay(i.getZIndex(),ys.CIRCLE);a.setFillStrokeStyle(o,n),a.drawCircle(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),ys.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}}};function Gs(e,t,i,r,o,n){var a=!1,s=i.getImage();if(s){var l=s.getImageState();l==_r.LOADED||l==_r.ERROR?s.unlistenImageChange(o,n):(l==_r.IDLE&&s.load(),l=s.getImageState(),s.listenImageChange(o,n),a=!0)}return function(e,t,i,r){var o=i.getGeometryFunction()(t);if(!o)return;var n=o.getSimplifiedGeometry(r);if(i.getRenderer())!function e(t,i,r,o){if(i.getType()==or.GEOMETRY_COLLECTION){for(var n=i.getGeometries(),a=0,s=n.length;a<s;++a)e(t,n[a],r,o);return}var l=t.getReplay(r.getZIndex(),ys.DEFAULT);l.drawCustom(i,o,r.getRenderer())}(e,n,i,t);else{var a=Ns[n.getType()];a(e,n,i,t)}}(e,t,i,r),a}var Vs=i(5);class Bs{constructor(){this.queue=[]}push(e){this.queue.push(e)}remove(e){for(let t=0;t<this.queue.length;t++){let i=this.queue[t];if(i.x==e.x&&i.y==e.y&&ikt.z==e.z&&i.id==e.id)return void this.queue.splice(t,1)}}has(e){for(let t=0;t<this.queue.length;t++){let i=this.queue[t];if(i.x==e.x&&i.y==e.y&&i.z==e.z&&i.id==e.id)return!0}return!1}}const qs=[78271.51696402048,39135.75848201024,19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.8740565703525,76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032,4.777314267823516,2.388657133911758,1.194328566955879,.5971642834779395,.29858214173896974,.14929107086948487,.07464553543474244];function Us(e,t){function i(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT);this.show=!e.defined(t.show)||t.show,this._tilingScheme=e.defined(t.tilingScheme)?t.tilingScheme:new e.WebMercatorTilingScheme({ellipsoid:t.ellipsoid}),this._tileWidth=e.defaultValue(t.tileWidth,512),this._tileHeight=e.defaultValue(t.tileHeight,512),this._readyPromise=e.when.resolve(!0),this._mvtParser=new ps,this.scene=t.scene,this._rectangle=e.defaultValue(t.rectangle,this._tilingScheme.rectangle),this.options=t,this._styleFun=t.style?t.style:createMapboxStreetsV6Style(),this._key=e.defaultValue(t.key,""),this._url=e.defaultValue(t.url,"https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/{z}/{x}/{y}.vector.pbf?access_token={k}"),this._resolutions=qs,this._pixelRatio=1,this._transform=[.125,0,0,.125,0,0],this._replays=["Default","Image","Polygon","LineString","Text"],this._tileQueue=new e.TileReplacementQueue,this._tileSends=new Bs,this._cacheSize=1024,this._maximumLevel=t.maximumLevel||20,this._minimumLevel=t.minimumLevel||0,this._labelsRenderMode=t.labelsRenderMode,this._labelsNoteStyle=t.labelsNoteStyle,this._dynamicEntityVisualizer=e.defined(t.dynamicEntityVisualizer)?t.dynamicEntityVisualizer:null,this._cacheCollection={},this._cacheCollectionIndex=0,this._wgs84Extent=t.wgs84Extent}function r(e,t){const i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}function n(e,t){if(!e||!t||!e._mvtLabelDetail)return;const i=e._mvtLabelDetail;Object.keys(i).forEach(function(e){const r=t[e];r&&Array.isArray(i[e])&&i[e].forEach(function(e){r.remove(e)})}),e._isLabelRemove=!0}return Object.defineProperties(i.prototype,{proxy:{get(){}},tileWidth:{get(){return this._tileWidth}},tileHeight:{get(){return this._tileHeight}},maximumLevel:{get(){return this._maximumLevel}},minimumLevel:{get(){return this._minimumLevel}},tilingScheme:{get(){return this._tilingScheme}},rectangle:{get(){return this._rectangle}},tileDiscardPolicy:{get(){}},errorEvent:{get(){return this._errorEvent}},ready:{get:()=>!0},readyPromise:{get(){return this._readyPromise}},credit:{get(){}},hasAlphaChannel:{get:()=>!0}}),i.prototype.getTileCredits=function(e,t,i){},i.prototype.requestImage=function(e,t,i,r){if(void 0==this._tilingScheme._rectangleSouthwest&&(i+=1),this._tileSends.has({x:e,y:t,z:i,id:this.options.threadId})){const r=function(e,t,i,r){let o=r.head;for(;void 0!=o&&(o.xMvt!=e||o.yMvt!=t||o.zMvt!=i);)o=o.replacementNext;return o}(e,t,i,this._tileQueue);if(void 0!=r)return function(e,t){if(!e||!t||!e._mvtLabelDetail)return;if(!e._isLabelRemove)return;const i=e._mvtLabelDetail;Object.keys(i).forEach(function(e){const r=t[e];r&&Array.isArray(i[e])&&i[e].forEach(function(e){r.add(e)})}),e._isLabelRemove=!1}(r,this._cacheCollection),r;this._tileSends.remove(e,t,i)}else this._tileSends.push({x:e,y:t,z:i,id:this.options.threadId}),this.drawTile(e,t,i)},i.prototype.drawTile=function(t,i,o){const a=this;let s=this._url;if(s=s.replace("{x}",t).replace("{y}",i).replace("{z}",o).replace("{k}",this._key),this._maximumLevel&&o>this._maximumLevel)return null;!function(t,i,l){e.Resource.createIfNeeded(s).fetchArrayBuffer().then(function(s){try{const h=document.createElement("canvas");h.width=512,h.height=512,h.xMvt=t,h.yMvt=i,h.zMvt=l,a._tileQueue.markTileRendered(h);const c=h.getContext("2d"),u=a._mvtParser.readFeatures(s),p=a._styleFun,d=[0,0,4096,4096];let f=new Fs(0,d,8,!0,512);const y=[],m={};"on-screen"===a._labelsRenderMode&&(h._mvtLabelDetail=m);for(let e=0;e<u.length;e++){const r=u[e];if("Point"===r.type_&&"on-screen"===a._labelsRenderMode){const e=p(r,a._resolutions[o]);a._parseFeature(m,r,e,t,i,o,d)}else y.push(r)}return y.forEach(e=>{const t=p(e,a._resolutions[o]);for(let i=0;i<t.length;i++)Gs(f,e,t[i],16)}),f.finish(),f.replay(c,a._transform,0,{},a._replays),a._tileQueue.count>a._cacheSize&&function(t,i,o){let a=t.tail;for(;t.count>o&&e.defined(a);){const e=a.replacementPrevious;r(t,a),n(a,i),a=null,a=e}}(a._tileQueue,a._cacheCollection,a._cacheSize/2),f=null,h}catch(e){console.log("err: ",e)}}).otherwise(function(e){return this._tileSends.remove(t,i,o),null})}(t,i,o)},i.prototype.pickFeatures=function(e,t,i,r,o){},i.prototype._parseFeature=function(t,i,r,n,a,s,l){if(this._tilingScheme&&this._tilingScheme.tileXYToRectangle){const h=this._tilingScheme._rectangleSouthwest?0:1,c=this._tilingScheme.tileXYToRectangle(n,a,s-h);if(!c)return;const u=i.properties_;if(!u)return;if(!r||Array.isArray(r)&&0===r.length)return;let p,d=u.layer;u.layer||(d="未定义图层"),this._cacheCollection[d]?p=this._cacheCollection[d]:(p=function(t,i,r){let o=void 0;return(o="label"===i?new e.LabelCollection({blendOption:e.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:r}):"ground"===i?new e.PrimitiveCollection({}):new e.BillboardCollection({blendOption:e.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:r})).__labelLayerName=t,o}(d,"",this.scene),this._cacheCollection[d]=p,this._dynamicEntityVisualizer.add(p,this._cacheCollectionIndex),this._cacheCollectionIndex+=1);const f=e.Rectangle.northwest(c),y=e.Rectangle.southeast(c);let m=function(e){const t={type:"label-symbol",color:"rgba(255,255,255,1)",haloColor:"rgba(0,0,0,0.5)",haloSize:2,lineHeight:1.1,lineWidth:80,lineMaxNum:3,angle:0,textWraps:!0,letterSpacing:"2px",xoffset:0,yoffset:0,font:{size:12,family:"微软雅黑",weight:"normal",style:"normal"},showBackground:!1,backgroundColor:"rgba(42,42,42,1)",backgroundPadding:[5,7],backgroundImage:void 0,showTextExtraIcon:!1,textExtraIcon:void 0,textExtraIconAnchor:"top",textExtraIconSize:14,showTextShadow:!1,textShadowOffsetX:1,textShadowOffsetY:1,textShadowColor:"#ffffff",textShadowBlur:2,showTextDecorationThroughline:!1,textDecorationThroughlineColor:"rgba(255,255,255,1)",textDecorationThroughlineWidth:1,showTextDecorationUnderline:!1,textDecorationUnderlineColor:"rgba(255,255,255,1)",textDecorationUnderlineWidth:1},i={};if(e){i.text=e.getText();const r=e.getFont(),o=Vs.a.parse(r,{fontSize:"12px",fontFamily:"微软雅黑",fontWeight:"normal",fontStyle:"normal"});t.font={size:parseFloat(o.fontSize),family:o.fontFamily,weight:o.fontWeight,style:o.fontStyle},t.xoffset=e.getOffsetX(),t.yoffset=e.getOffsetY(),i.scale=e.getScale()||1,t.angle=180*e.getRotation()/Math.PI;const n={left:"above-left",right:"above-right",center:"above-center",start:"above-left",end:"above-right"};n[e.getTextAlign()]&&(i.labelPlacement=n[e.getTextAlign()]);const a=e.getFill();if(a){const e=a.getColor();e&&(t.color=`rgba(${255*e[0]},${255*e[1]},${255*e[2]},${e[3]})`)}const s=e.getStroke();if(s){const e=s.getColor(),i=s.getWidth();e&&(t.haloColor=`rgba(${255*e[0]},${255*e[1]},${255*e[2]},${e[3]})`,t.haloSize=i)}const l=e.getBackgroundFill();if(l){const e=l.getColor();e&&(t.showBackground=!0,t.backgroundColor=`rgba(${255*e[0]},${255*e[1]},${255*e[2]},${e[3]})`)}}return i.symbol=t,i.heightReference=1,i}(r[0].getText());if(this._labelsNoteStyle){const e=Object.assign({},m.symbol,this._labelsNoteStyle.symbol||{}),t=Object.assign({},m,this._labelsNoteStyle||{});t.symbol=e,m=t}if(i.flatCoordinates_&&Array.isArray(i.flatCoordinates_)&&2===i.flatCoordinates_.length&&m.text){const r=i.flatCoordinates_,n=l[2],a=l[3],s=(e.Math.toDegrees(y.longitude)-e.Math.toDegrees(f.longitude))*r[0]/n+e.Math.toDegrees(f.longitude),h=(e.Math.toDegrees(y.latitude)-e.Math.toDegrees(f.latitude))*r[1]/a+e.Math.toDegrees(f.latitude);if(r[0]>n||r[1]>a)return;const c=e.Cartographic.toCartesian(new e.Cartographic(e.Math.toRadians(s),e.Math.toRadians(h),0));try{const i=e.DynamicLabelsUtil.createNoteBillBoardOptions("value",m.text,c,e.DynamicLabelsUtil.parsePointOptions(e.DynamicLabelsUtil.parseLabelsOption(new e.Style.LabelNoteStyle(m))));if(this._wgs84Extent instanceof o.Extent){if(!this._wgs84Extent.intersects(new o.Point({coordinates:[s,h]})))return}const r=p.add(i);t&&!t[d]&&(t[d]=[]),t[d].push(r)}catch(e){console.error(e)}}}},new i(t)}var Ws=class{constructor(e,t){this.viewer=e,this.scene=this.viewer.scene,this.url=t.styleUrl,!this.url&&t.ip&&(this.url=`http://${t.ip}:${t.port}/igs/rest/mrcs/vtiles/0/${t.layerName}`),this.options=t,this.callback=t.callback,this.token=t.token||"",this.opacity=t.opacity||1,this.vectortilejson=t.vectortilejson,this.threadId=t.threadId||1e4*Math.random(),this.show=t.show||!0,this.style=t.style,this.tilingScheme=t.tilingScheme,this.provider=null,this.maximumLevel=t.maximumLevel||20,this.minimumLevel=t.minimumLevel||0,this.labelsRenderMode=t.labelsRenderMode||"off-screen",this._dynamicEntityVisualizer="on-screen"===this.labelsRenderMode?new Cesium.DynamicEntityVisualizer(e.scene,{}):null,this.initDevicePixelRatio(),this._fetchService=new o.FetchServer("",{}),this._addCallback=t.addCallback||void 0,this._wgs84Extent=t.wgs84Extent,this._labelsNoteStyle=t.labelsNoteStyle,this._rectangle=t.rectangle,this.style&&("string"==typeof this.style?(this.url=this.style,this.requestVectortileJson()):(this.vectortilejson=this.style,this.requestStyleData(this.vectortilejson)))}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}bindEvent(){this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this)}requestVectortileJson(){if(!this.vectortilejson){const e=this;this._fetchService.request({url:this.url,method:"GET",success(t){e.vectortilejson=t,e.requestStyleData(e.vectortilejson)}})}}requestStyleData(e){this.vectortilejson=e;const t=function(e){const t=e.layers;let i,r,o,n,a,s=[];for(let l=0,h=t.length;l<h;++l)"background"==(i=t[l]).type||((n=i.source||Wi(t,i.ref))!=o&&(s.length&&(s=[]),a=(r=e.sources[n]).url,"vector"==r.type||"raster"==r.type||r.type,o=n),s.push(i.id));return s}(e),i=function(e){const t=e.sources;let i=[];for(const e in t)if(t.hasOwnProperty(e)){const r=t[e];r.type&&"vector"==r.type&&r.tiles&&r.tiles.length>0&&i.push(r)}return i}(e),r=function(e){let t=e.sprite;return t.indexOf("png")>0?t:t+=".png"}(e),o=this;this._fetchService.request({url:`${e.sprite}.json`,method:"GET",success(n){o.styleData={vectortilejson:e,layers:t,spritedata:n,spritepng:r,fonts:Zi,sources:i},o.addLayer(o.styleData),o._addCallback&&o._addCallback instanceof Function&&o._addCallback()}})}getLayer(){return self.provider?self.provider:void 0}addLayer(e){const t=ha(e.vectortilejson,Object.keys(e.vectortilejson.sources),null,e.spritedata,e.spritepng,e.fonts);if(e.sources.length>0){const i=e.sources[0],r=Us(Cesium,{key:this.token,url:i.tiles[0],style:t,opacity:this.opacity,threadId:this.threadId,show:this.show,tilingScheme:this.tilingScheme,maximumLevel:this.maximumLevel,minimumLevel:this.minimumLevel,scene:this.scene,dynamicEntityVisualizer:this._dynamicEntityVisualizer,labelsRenderMode:this.labelsRenderMode,wgs84Extent:this._wgs84Extent,labelsNoteStyle:this._labelsNoteStyle,rectangle:this._rectangle});this.provider=this.viewer.imageryLayers.addImageryProvider(r),this.provider.show=this.show,this.callback&&this.callback({imageryLayer:this.provider})}}updateStyle(e){this.styleData&&(this.styleData.vectortilejson=e,this.remove(),this.addLayer(this.styleData))}setLayoutProperty(e,t,i){if(!this.vectortilejson||!this.vectortilejson.layers)return;const{layers:r}=this.vectortilejson,o=r.filter(t=>t.id===e),n=o&&o.length>0?o[0]:void 0;n&&(n.layout=n.layout||{},n.layout[t]=i,this.styleData.vectortilejson=this.vectortilejson,this.remove(),this.addLayer(this.styleData))}setPaintProperty(e,t,i){if(!this.vectortilejson||!this.vectortilejson.layers)return;const{layers:r}=this.vectortilejson,o=r.filter(t=>t.id===e),n=o&&o.length>0?o[0]:void 0;n&&(n.paint=n.paint||{},n.paint[t]=i,this.remove(),this.addLayer(this.styleData))}setStyleLayerFilter(e,t){if(!this.vectortilejson||!this.vectortilejson.layers)return;const{layers:i}=this.vectortilejson,r=i.filter(t=>t.id===e),o=r&&r.length>0?r[0]:void 0;o&&(o.filter=o.filter||{},o.filter=t,this.remove(),this.addLayer(this.styleData))}unbindEvent(){}moveStartEvent(){}moveEndEvent(){}zoomStartEvent(){}zoomEndEvent(){}destroy(){this.remove()}setVisible(e){this.provider&&(this.provider.show=e)}setOpacity(e){this.provider&&(this.provider.alpha=e)}remove(){const e=this;e.provider&&(e.viewer.imageryLayers.remove(e.provider,!0),e.provider.show=!1)}};class Hs{}Hs.addIGSVectorTileLayer=function(e,t,i){const r=new Ws(t,{style:e.style||e.url,addCallback:i});return r.id=e.id,e.clippingArea&&Oi(e,r,t),r},Hs.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Ys=Hs;class Js{}Js.addTerrainCacheLayer=function(e,t,i){const r=Object.assign({url:e.url},e.extendOptions);t.terrainProvider=new Cesium.CesiumTerrainProvider(r),i()},Js.setOpacity=function(e,t){let i;1===e.opacity?(t.scene.globe.translucency.enabled=!1,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=1,t.scene.globe.baseColor=i):(t.scene.globe.translucency.enabled=!0,(i=new Cesium.Color.clone(t.scene.globe.baseColor)).alpha=e.opacity,t.scene.globe.baseColor=i)},Js.removeLayer=function(e,t){t.terrainProvider=new Cesium.EllipsoidTerrainProvider};var $s=Js;const Xs=window.mapv||{},Zs=Xs.baiduMapLayer?Xs.baiduMapLayer.__proto__:Function;class Ks extends Zs{constructor(e,t,i,r){if(super(e,t,i),!Zs)return;this.map=e,this.scene=e.scene,this.dataSet=t;i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=r,this.stopAniamation=!1,this.animation=i.animation,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent()}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}clickEvent(e){const t=e.point;super.clickEvent(t,e)}mousemoveEvent(e){const t=e.point;super.mousemoveEvent(t,e)}addAnimatorEvent(){}animatorMovestartEvent(){const e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){this.map;this.options.methods&&(this.options.methods.click,this.options.methods.mousemove)}unbindEvent(){const e=this.map;this.options.methods&&(this.options.methods.click&&e.off("click",this.clickEvent),this.options.methods.mousemove&&e.off("mousemove",this.mousemoveEvent))}getContext(){return this.canvasLayer.canvas.getContext(this.context)}init(e){const t=this;t.options=e,this.initDataRange(e),this.context=t.options.context||"2d",t.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(t.options.zIndex),this.initAnimator()}_canvasUpdate(e){this.map;const t=this.scene;if(!this.canvasLayer||this.stopAniamation)return;const i=this,r=i.options.animation,o=i.getContext();if(i.isEnabledTime()){if(void 0===e)return void this.clear(o);"2d"===this.context&&(o.save(),o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, .1)",o.fillRect(0,0,o.canvas.width,o.canvas.height),o.restore())}else this.clear(o);if("2d"===this.context)for(const e in i.options)o[e]=i.options[e];else o.clear(o.COLOR_BUFFER_BIT);const n={transferCoordinate(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]);var r=i.map.camera.position;let o=i.map.scene.globe.ellipsoid.cartesianToCartographic(r).height;if(o+=1.2*i.map.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(r,t)>o)return;r=Cesium.Cartesian3.fromDegrees(e[0],e[1]);const n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.map.scene,r);return n?[n.x,n.y]:[0,0]}};void 0!==e&&(n.filter=function(t){const i=r.trails||10;return!!(e&&t.time>e-i&&t.time<e)});const a=i.dataSet.get(n);this.processData(a),"m"==i.options.unit&&i.options.size,i.options._size=i.options.size;let s=Cesium.SceneTransforms.wgs84ToWindowCoordinates(t,Cesium.Cartesian3.fromDegrees(0,0));s||(s=[0,0]),this.drawContext(o,new Xs.DataSet(a),i.options,s),i.options.updateCallback&&i.options.updateCallback(e)}updateData(e,t){let i=e;i&&i.get&&(i=i.get()),void 0!=i&&this.dataSet.set(i),super.update({options:t})}addData(e,t){let i=e;e&&e.get&&(i=e.get()),this.dataSet.add(i),this.update({options:t})}getData(){return this.dataSet}removeData(e){if(!this.dataSet)return;const t=this.dataSet.get({filter:t=>null==e||"function"!=typeof e||!e(t)});this.dataSet.set(t),this.stopAniamation=!0}clearData(){this.dataSet&&this.dataSet.clear(),this.stopAniamation=!0}draw(){this.canvasLayer.draw()}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}}let Qs=0;class el{}el.addMapVLayer=function(e,t){const i=new class{constructor(e,t,i,r){this.map=e,this.scene=e.scene,this.mapvBaseLayer=new Ks(e,t,i,this),this.mapVOptions=i,this.initDevicePixelRatio(),this.canvas=this._creteWidgetCanvas(),this.render=this.render.bind(this),this.handler=void 0,this.postRenderTime=0;const o=i.cesium;if(o&&(this.postRender=o.postRender||!1,this.postRenderFrame=o.postRenderFrame||30),void 0!=r)this.container=r,r.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}this.bindEvent(),this._reset()}initDevicePixelRatio(){this.devicePixelRatio=1}addInnerContainer(){this.container.appendChild(this.canvas)}bindEvent(){const e=this.map;if(this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.innnerZoomStart=this.zoomStartEvent.bind(this),this.innnerZoomEnd=this.zoomEndEvent.bind(this),this.postEventHandle=this.postEvent.bind(this),this.postStartEvent=this.postStartEvent.bind(this),this.postEndEvent=this.postEndEvent.bind(this),this.postRender)this.scene.camera.moveStart.addEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.addEventListener(this.postEndEvent,this);else{const t=new Cesium.ScreenSpaceEventHandler(this.scene.canvas);t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.setInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),e.scene.camera.moveEnd.addEventListener(this.innerMoveEnd(),this),this.handler=t}}unbindEvent(){const e=this.map;if(this.postRender)this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this);else{const t=this.handler;t&&(t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.WHEEL),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(this.innerMoveStart,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(this.innerMoveEnd,Cesium.ScreenSpaceEventType.RIGHT_UP),t.destroy()),e.scene.camera.moveEnd.removeEventListener(this.innerMoveEnd(),this)}}postStartEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMovestartEvent(),this.scene.postRender.addEventListener(this._reset,this)),this._visiable()}postEndEvent(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMoveendEvent(),this.scene.postRender.removeEventListener(this._reset,this)),this._reset(),this._visiable()}moveStartEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()}moveEndEvent(){this.mapvBaseLayer&&this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()}zoomStartEvent(){this._unvisiable()}zoomEndEvent(){this._unvisiable()}postEvent(){this.postRenderTime++,this.postRenderTime%this.postRenderFrame==0&&this.moveEndEvent()}addData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.addData(e,t)}updateData(e,t){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.updateData(e,t)}getData(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}removeData(e){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer&&this.mapvBaseLayer.removeData(e)}removeAllData(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer.clearData()}_visiable(){return this.canvas.style.display="block",this}_unvisiable(){return this.canvas.style.display="none",this}setOpacity(e){return this.canvas.style.opacity=e,this}_createCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${Qs++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext(this.mapVOptions.context).scale(t,t),e}_creteWidgetCanvas(){const e=document.createElement("canvas");e.id=this.mapVOptions.layerid||`mapv${Qs++}`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.mapVOptions.zIndex||100,e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth),e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight),e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;return"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t),e}_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()}draw(){this._reset()}show(){this._visiable()}hide(){this._unvisiable()}destroy(){this.remove()}remove(){void 0!=this.mapvBaseLayer&&(this.unbindEvent(),this.removeAllData(),this.mapvBaseLayer.clear(this.mapvBaseLayer.getContext()),this.mapvBaseLayer=void 0,this.canvas.parentElement.removeChild(this.canvas))}update(e){void 0!=e&&this.updateData(e.data,e.options)}resizeCanvas(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width)||parseInt(this.map.container.offsetWidth)*this.devicePixelRatio,e.height=parseInt(this.map.canvas.height)||parseInt(this.map.container.offsetHeight)*this.devicePixelRatio,e.style.width=`${parseInt(this.map.container.offsetWidth)}px`,e.style.height=`${parseInt(this.map.container.offsetHeight)}px`;const t=this.devicePixelRatio;"2d"==this.mapVOptions.context&&e.getContext("2d").scale(t,t)}fixPosition(){}onResize(){}render(){void 0!=this.mapvBaseLayer&&this.mapvBaseLayer._canvasUpdate()}}(t,e.data,e.mapVOptions);return i.id=e.id,i},el.removeLayer=function(e){e.remove()};var tl=el;class il{}il.addTDTLayer=function(e,t){const i={url:`http://t${parseInt(String(Math.floor(7*Math.random())))}.tianditu.gov.cn/${e.layerType}_${e._tileMatrixSetID}/wmts?${e.tokenKey}=${e.tokenValue}`,layer:e.layerType,format:e.imageFormat,style:e.style,tileMatrixSetID:e._tileMatrixSetID},r=Ci(e,t),o=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider(i),r);return o.id=e.id,o._realIndex=e._realIndex+1,o},il.removeLayer=function(e,t){t.scene.imageryLayers.remove(e)};var rl=il;class ol{}ol.addArcGISMapImageLayer=function(e,t){const i=xi(e.spatialReference,e.extent),r=ki(e,i.rectangle),o={url:e.url,usePreCachedTilesIfAvailable:!1,layers:e.layers,tilingScheme:i,rectangle:Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax)},n=Ci(e,t),a=t.imageryLayers.addImageryProvider(new Cesium.ArcGisMapServerImageryProvider(o),n);return a.id=e.id,a._realIndex=e._realIndex+1,a},ol.removeLayer=function(e,t){t.imageryLayers.remove(e)};var nl=ol;class al{}al.addWebTileLayer=function(e,t){const i=xi(e.spatialReference,e.extent,e.tileInfo),r=ki(e,i.rectangle);let o=e.url;o=(o=(o=o.replace("{col}","{x}")).replace("{row}","{y}")).replace("{level}","{z}"),e.tokenKey&&e.tokenValue&&(o+=`&${e.tokenKey}=${e.tokenValue}`);const n={url:o,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:i,rectangle:Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax)},a=Ci(e,t),s=t.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider(n),a);return e.clippingArea&&Oi(e,s,t),s.id=e.id,s._realIndex=e._realIndex+1,s},al.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var sl=al;var ll=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this,n=xi(t.spatialReference,t.extent,t.tileInfo),a=ki(t,n.rectangle);a.spatialReference=new o.SpatialReference("EPSG:4326");const s=Cesium.Rectangle(a.xmin,a.ymin,a.xmax,a.ymax);return new Promise(e=>{const o=Array.isArray(t.labelingInfo)&&t.labelingInfo.length>0?t.labelingInfo[0]:void 0;r.innerLayer=new Ws(i,{tilingScheme:n,rectangle:s,wgs84Extent:a,labelsRenderMode:t.labelsRenderMode,labelsNoteStyle:o,style:t.style,addCallback(){e(r)}}),r.innerLayer.id=t.id})}onRemove(e){return this.innerLayer.remove(),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;if(e.updateContent)for(let i=0;i<e.updateContent.length;i++){const r=e.updateContent[i],o=r.params;if(r)switch(r.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":case"setStyleLayerFilter":case"setStyleLayerZoomRange":t.updateStyle(this.layer.style);break;case"opacity":t.setOpacity(o[0]);break;case"visible":t.setVisible(o[0]);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer.provider,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;default:t.updateStyle(this.layer.style)}}return Promise.resolve(this)}};class hl{}hl.addWMSLayer=function(e,t){const i=xi(e.spatialReference,e.extent),r=ki(e,i.rectangle),o={url:e.url,layers:e.layers,parameters:{format:e.imageFormat,transparent:e.imageTransparency},tilingScheme:i,tileWidth:e.imageWidth,tileHeight:e.imageHeight,srs:`EPSG:${e.spatialReference.wkid}`,rectangle:Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax)},n=Ci(e,t),a=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider(o),n);return e.clippingArea&&Oi(e,a,t),a.id=e.id,a._realIndex=e._realIndex+1,a},hl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var cl=hl;function ul(e,t){let i=0;for(let r=0;r<e.length;r++)if(e[r].id===t.id){i=r-1;break}return i<0&&(i=0),i}function pl(e,t,i){const r=Ci(e,i),o=i.imageryLayers.indexOf(t);if(o>=r){for(let e=0;e<o-r;e++)i.imageryLayers.lower(t);t._realIndex=e._realIndex+1}else{for(let e=0;e<r-o;e++)i.imageryLayers.raise(t);t._realIndex=e._realIndex+1}}var dl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=cl.addWMSLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return cl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"spatialReference":cl.removeLayer(this.innerLayer,this.innerView),self.innerLayer=cl.addWMSLayer(this.layer,this.innerView);break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction))}}return Promise.resolve(this)}};class fl{}fl.addWMTSLayer=function(e,t){const{tileMatrixSetId:i,tileMatrixSets:r}=e.activeLayer,o=r.find(e=>e.id===i).tileInfo;let n=xi(e.spatialReference,e.activeLayer.extent,o);e.spatialReference.isWebMercator?o.lods[0].resolution*o.size[0]>40075016.685574&&(n=new Cesium.WebMercatorTilingScheme):e.spatialReference.isGeographic&&o.lods[0].resolution*o.size[0]>180&&(n=new Cesium.GeographicTilingScheme);const a=ki(e,n.rectangle);let s=e.url;e.tokenValue&&e.tokenKey&&(s+=`?${e.tokenKey}=${e.tokenValue}`);const l={url:s,layer:e.activeLayer.title,format:e.activeLayer.imageFormat,style:e.activeLayer.styleId,tileMatrixSetID:e.activeLayer.tileMatrixSetId,tilingScheme:n,tileWidth:e.imageWidth,tileHeight:e.imageHeight,rectangle:Cesium.Rectangle(a.xmin,a.ymin,a.xmax,a.ymax),tileMatrixLabels:[]};for(let e=0;e<o.lods.length;e++)l.tileMatrixLabels.push(o.lods[e].level);const h=Ci(e,t),c=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider(l),h);return e.clippingArea&&Oi(e,c,t),c.id=e.id,c._realIndex=e._realIndex+1,c},fl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var yl=fl;var ml=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=yl.addWMTSLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return yl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction))}}return Promise.resolve(this)}};var gl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=Ri.addIGSTileLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return Ri.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Ri.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Ri.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var vl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=ji.addIGSMapImageLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return ji.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.layer.visible?this.innerLayer.alpha=this.layer.opacity:this.innerLayer.alpha=0;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":ji.removeLayer(this.innerLayer,this.innerView),self.innerLayer=ji.addIGSMapImageLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var bl=class{static applyUpdate(e,t,i,r){if(r.updateContent)for(let e=0;e<r.updateContent.length;e++){const n=r.updateContent[e];if(n)switch(n.name){case"visible":switch(t.type){case o.LayerType.wms:case o.LayerType.igsMapImage:case o.LayerType.igsTile:case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:case o.LayerType.m3dCache:i.show=!i.show}break;case"opacity":switch(t.type){case o.LayerType.wms:i.alpha=t.opacity;break;case o.LayerType.m3dCache:i.translucency=t.opacity;break;case o.LayerType.cesium3DTiles:i.style=new Cesium.Cesium3DTileStyle,i.style.color={evaluateColor(e,i){if(i)return i.alpha=t.opacity,i}}}}}if(!i)return;let n=!1;switch(t.type){case o.LayerType.igsVectorTile:i.updateStyle(t.style),n=!0}if(r.extend&&r.extend.type){switch(r.extend.type){case o.LayerEventType.layerUpdateOpacity:switch(t.type){case o.LayerType.igsMapImage:case o.LayerType.igsTile:i.alpha=t.opacity,n=!0;break;case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:(i=e._innerView.scene.layers.getLayer(t.layerIndex)).translucency=t.opacity}break;case o.LayerEventType.layerUpdateVisible:switch(t.type){case o.LayerType.igsMapImage:case o.LayerType.igsTile:case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:i.show=!i.show,n=!0}break;case o.LayerEventType.layerUpdateStyle:switch(t.type){case o.LayerType.igsVectorTile:i.updateStyle(t.style),n=!0}break;case o.LayerEventType.layerSublayerVisible:switch(t.type){case o.LayerType.igsMapImage:i._imageryProvider._layers=t.layers,n=!0}}return n?new Promise(e=>{e()}):null}}};var _l=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{qi.addM3DLayer(t,i,this.view,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return qi.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return bl.applyUpdate(this.view,this.layer,t,e),Promise.resolve(this)}};var wl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{Vi.addCesium3DTilesLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Vi.removeLayer(this.layer,this.innerView),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return bl.applyUpdate(this.view,this.layer,t,e),Promise.resolve(this)}};var xl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{this.innerLayer=[],Ni.addSceneLayer(t,i,r.view,t=>{r.innerLayer=t,e(r)})})}onRemove(e){return Ni.removeLayer(this.innerLayer,this.view,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":for(let e=0;e<this.innerLayer.length;e++)this.innerLayer[e].show=this.layer.visible;break;case"opacity":const e=this.view.getInnerLayer(this.layer);for(let i=0;i<e.length;i++)e[t].translucency=this.layer.opacity}}return Promise.resolve(this)}};var Cl=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{$s.addTerrainCacheLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return $s.removeLayer(this.layer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":$s.setOpacity(this.layer,this.innerView)}}}};function kl(e,t){this._CesiumMap=e,this._CesiumScene=e.scene,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}kl.prototype.dimensions=["lng","lat"],kl.prototype.setMapOffset=function(e){this._mapOffset=e},kl.prototype.getBMap=function(){return this._CesiumMap},kl.prototype.dataToPoint=function(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]),i=this._CesiumMap.camera.position;let r=this._CesiumMap.scene.globe.ellipsoid.cartesianToCartographic(i).height;if(r+=1.2*this._CesiumMap.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(i,t)>r)return[-50,-50];const o=this._mapOffset,n=Cesium.Cartesian3.fromDegrees(e[0],e[1]);let a=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,n);return[(a=a||{x:0,y:0}).x-o[0],a.y-o[1]]},kl.prototype.pointToData=function(e){const t=this._mapOffset,i=Cesium.Cartesian3.fromDegrees(e[0]+t[0],e[1]+t[1]),r=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,i);return[r.x,r.y]},kl.prototype.getViewRect=function(){const e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},kl.prototype.getRoamTransform=function(){return echarts.matrix.create()},kl.prototype.prepareCustoms=function(){const e=echarts.util,t=this.getViewRect();return{coordSys:{type:"cesium",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,i){return i=i||[0,0],e.map([0,1],function(e){const r=i[e],o=t[e]/2,n=[],a=[];return n[e]=r-o,a[e]=r+o,n[1-e]=i[1-e],a[1-e]=i[1-e],Math.abs(this.dataToPoint(n)[e]-this.dataToPoint(a)[e])},this)},this)}}},kl.dimensions=kl.prototype.dimensions,kl.create=function(e,t){let i;e.eachComponent("cesium",function(e){const r=echarts.cesiumMap;(i=new kl(r,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"cesium"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})};var Ml=kl;let Sl=0;class Tl{constructor(e,t,i){if(this.map=e,this.scene=e.scene,this.options=t,this.initStats=!1,this.handler=void 0,this.moveEndEvent=void 0,this.postEvent=void 0,this.postStartEvent=void 0,this.postEndEvent=void 0,this.layerId=t.layerId||`echarts${Sl++}`,this.layerClass=t.layerClass||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.visible=!0,this.canvas=this._createCanvas(),this.postRenderTime=0,this.postRenderFrame=t.postRenderFrame||30,void 0!=i)this.container=i,i.appendChild(this.canvas);else{const t=document.getElementsByClassName("cesium-widget"),i=t.length>0?t[0]:e.container;this.container=i,this.addInnerContainer()}return this.chart=echarts.init(this.canvas),this.initEcharts(),this._resizeCanvas(),this.resize(),this}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}addInnerContainer(){this.container.appendChild(this.canvas)}initEcharts(){return echarts.cesiumMap=this.map,echarts.registerCoordinateSystem("cesium",Ml),echarts.extendComponentModel({type:"cesium",getBMap(){return this.__cesium},defaultOption:{roam:!1}}),echarts.registerAction({type:"CesiumRoma",event:"CesiumRoma",update:"updateLayout"},function(e,t){}),this}_createCanvas(){const e=document.createElement("div");e.className="cesium-echarts-layer",e.setAttribute("class","cesium-echarts-layer"),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=this.options.zIndex||100;const t=`${parseInt(this.map.canvas.width)}px`,i=`${parseInt(this.map.canvas.height)}px`;return e.width=t,e.height=i,e.style.width=t,e.style.height=i,e}_resizeCanvas(){const e=this;window.onresize=function(){if(void 0==this.canvas||null==this.canvas)return;const t=e.canvas,i=e.map;t.style.position="absolute",t.style.top="0px",t.style.left="0px";const r=`${parseInt(i.canvas.width)}px`,o=`${parseInt(i.canvas.height)}px`;t.width=r,t.height=o,t.style.width=r,t.style.height=o,e.chart.resize()}}_visible(){this.visible=!0,this.canvas.style.visibility="visible"}_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"}addTo(e){this.endStatus=!1;const t=this;return echarts.extendComponentView({type:"cesium",render(e,i,r){let o=!0;echarts.cesiumMap;const n=r.getZr().painter.getViewportRoot(),a=e.coordinateSystem,s=function(i,s){if(o||!t.map||!t.visible)return;t._unvisible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];n.style.left=`${h[0]}px`,n.style.top=`${h[1]}px`,a.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})},l=function(i,s){if(o||!t.map)return;t._visible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];n.style.left=`${h[0]}px`,n.style.top=`${h[1]}px`,a.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})};function h(){o||(t._visible(),r.dispatchAction({type:"CesiumRoma"}))}t.moveEndEvent=l;const c=function(){h()};t.postStartEvent=function(){this.endStatus||t.scene.postRender.addEventListener(c)}.bind(t);t.postEndEvent=function(){this.endStatus||(t.scene.postRender.removeEventListener(c),t.resize(),t._visible())}.bind(t),t.handler=new Cesium.ScreenSpaceEventHandler(t.scene.canvas),0==t.initStats&&(t.initStats=!0,t.options.postRender?(t.scene.camera.moveStart.addEventListener(t.postStartEvent,t),t.scene.camera.moveEnd.addEventListener(t.postEndEvent,t)):(t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.LEFT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.LEFT_UP),t.handler.setInputAction(s,Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.handler.setInputAction(l,Cesium.ScreenSpaceEventType.RIGHT_UP),t.map.scene.camera.moveEnd.addEventListener(function(){t.moveEndEvent()}))),this._oldMoveHandler=s,this._oldZoomEndHandler=h;e.get("roam");o=!1}}),this.chart.setOption(this.options),this}show(){this._visible()}hide(){this._unvisible()}setOpacity(e){this.canvas.style.opacity=e}resize(){if(void 0==this.canvas||null==this.canvas)return;const e=this.canvas;e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.width=parseInt(this.map.canvas.width),e.height=parseInt(this.map.canvas.height),e.style.width=this.map.canvas.style.width,e.style.height=this.map.canvas.style.height}remove(){this.endStatus=!0;const e=this;return this.chart.clear(),e.options.postRender?(this.scene.camera.moveStart.removeEventListener(this.postStartEvent,this),this.scene.camera.moveEnd.removeEventListener(this.postEndEvent,this)):(this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_UP),this.scene.camera.moveEnd.removeEventListener(function(){e.moveEndEvent()}),this.handler.destroy()),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this}}window.EchartsLayer=Tl;class Ll{}Ll.addEchartsLayer=function(e,t){const i=new Tl(t,e.echartsOptions).addTo(t);return i.id=e.id,i},Ll.removeLayer=function(e){e.remove()};var Il=Ll;var El=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return this.innerLayer=Il.addEchartsLayer(t,i),Promise.resolve(this)}onRemove(e){return Il.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.layer.visible?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};var Ol=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return this.innerLayer=tl.addMapVLayer(t,i),Promise.resolve(this)}onRemove(e){return tl.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.layer.visible?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};class Pl{}Pl.addGroupLayer=function(e,t){const i=e.layers,r=[];for(let e=0;e<i.length;e++)switch(i[e].type){case o.LayerType.wmts:r.push(yl.addWMTSLayer(i[e],t));break;case o.LayerType.wms:r.push(cl.addWMSLayer(i[e],t));break;case o.LayerType.igsMapImage:r.push(ji.addIGSMapImageLayer(i[e],t));break;case o.LayerType.igsTile:r.push(Ri.addIGSTileLayer(i[e],t));break;case o.LayerType.cesium3DTiles:Vi.addCesium3DTilesLayer(i[e],t,function(e){r.push(e)});break;case o.LayerType.echarts:r.push(Il.addEchartsLayer(i[e],t));break;case o.LayerType.m3d:qi.addM3DLayer(i[e],t,function(e){r.push(e)});break;case o.LayerType.scene:Ni.addSceneLayer(i[e],t,function(e){r.push(e)});break;case o.LayerType.igsVectorTile:r.push(Ys.addIGSVectorTileLayer(i[e],t));break;case o.LayerType.mapv:r.push(tl.addMapVLayer(i[e],t));break;case o.LayerType.terrain:$s.addTerrainCacheLayer(i[e],t,function(e){r.push(e)})}return r},Pl.setLayerVisible=function(e,t,i){switch(e.type){case o.LayerType.echarts:case o.LayerType.mapv:i?t.show():t.hide();break;case o.LayerType.wms:case o.LayerType.wmts:case o.LayerType.igsMapImage:case o.LayerType.igsTile:case o.LayerType.m3d:case o.LayerType.scene:case o.LayerType.cesium3DTiles:case o.LayerType.terrain:t.show=i}},Pl.removeLayer=function(e,t,i){switch(e.type){case o.LayerType.cesium3DTiles:Vi.removeLayer(e,i);break;case o.LayerType.echarts:Il.removeLayer(t);break;case o.LayerType.m3d:qi.removeLayer(e,i);break;case o.LayerType.igsMapImage:ji.removeLayer(t,i);break;case o.LayerType.scene:Ni.removeLayer(e,i);break;case o.LayerType.igsTile:Ri.removeLayer(t,i);break;case o.LayerType.igsVectorTile:Ys.removeLayer(t,i);break;case o.LayerType.mapv:tl.removeLayer(t);break;case o.LayerType.terrain:$s.removeLayer(e,i);break;case o.LayerType.wmts:yl.removeLayer(t,i);break;case o.LayerType.wms:cl.removeLayer(t,i)}},Pl.getLayerViews=function(e,t,i){const r=e.layers,o=[];for(let e=0;e<r.length;e++){const n=Bh(i,r[e]);for(let i=0;i<t.length;i++)if(t[i].id===r[e].id){n.innerLayer=t[i];break}o.push(n)}return o};var jl=Pl;var Al=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=jl.addGroupLayer(t,i),n.layerViews=jl.getLayerViews(t,n.innerLayer,n.view),clearInterval(a),e(n))},1)})}onRemove(e){for(let e=0;e<this.layer.layers.length;e++)switch(this.layer.layers[e].type){case o.LayerType.wms:case o.LayerType.wmts:case o.LayerType.igsTile:case o.LayerType.igsMapImage:this.innerView.scene.imageryLayers.remove(this.innerLayer[e]);break;case o.LayerType.echarts:case o.LayerType.mapv:this.innerLayer[e].remove();break;case o.LayerType.cesium3DTiles:this.innerView.scene.layers.removeCesium3DTilesetLayerByID(this.innerLayer[e].layerIndex);break;case o.LayerType.m3d:this.innerView.scene.layers.removeM3DLayerByID(this.innerLayer[e].layerIndex);break;case o.LayerType.scene:case o.LayerType.terrain:this.innerView.scene.layers.removeSceneLayerByID(this.innerLayer[e].layerIndex);break;case o.LayerType.igsVectorTile:this.innerView.imageryLayers.remove(this.innerLayer[e])}return Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":for(let e=0;e<this.layer.layers.length;e++)jl.setLayerVisible(this.layer.layers[e],this.innerLayer[e],this.layer.visible);break;case"opacity":for(let e=0;e<this.layer.layers.length;e++)switch(this.layer.layers[e].type){case o.LayerType.echarts:case o.LayerType.mapv:this.innerLayer[e].setOpacity(this.layer.opacity);break;case o.LayerType.wms:case o.LayerType.wmts:case o.LayerType.igsMapImage:case o.LayerType.igsTile:this.innerLayer[e].alpha=this.layer.opacity;break;case o.LayerType.terrain:$s.setOpacity(this.layer,this.innerView)}break;case"removeSubLayer":const e=i.params[0];for(let t=0;t<this.layer.layers.length;t++)if(this.layer.layers[t].id===e.id){jl.removeLayer(this.layer.layers[t],this.innerLayer[t],this.innerView);break}break;case"removeAllSubLayer":for(let e=0;e<this.layer.layers.length;e++)jl.removeLayer(this.layer.layers[e],this.innerLayer[e],this.innerView);this.innerLayer=[];break;case"addSubLayer":const t=this,r=i.params[0];for(let e=0;e<this.layer.layers.length;e++)if(this.layer.layers[e].id===r.id){switch(this.layer.layers[e].type){case o.LayerType.cesium3DTiles:Vi.addCesium3DTilesLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.echarts:t.innerLayer.push(Il.addEchartsLayer(r,t.innerView));break;case o.LayerType.m3d:qi.addM3DLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.igsMapImage:t.innerLayer.push(ji.addIGSMapImageLayer(r,t.innerView));break;case o.LayerType.scene:Ni.addSceneLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.igsTile:t.innerLayer.push(Ri.addIGSTileLayer(r,t.innerView));break;case o.LayerType.igsVectorTile:t.innerLayer.push(Ys.addIGSVectorTileLayer(r,t.innerView));break;case o.LayerType.mapv:t.innerLayer.push(tl.addMapVLayer(r,t.innerView));break;case o.LayerType.terrain:$s.addTerrainCacheLayer(r,t.innerView,function(e){t.innerLayer.push(e)});break;case o.LayerType.wmts:t.innerLayer.push(yl.addWMTSLayer(r,t.innerView));break;case o.LayerType.wms:t.innerLayer.push(cl.addWMSLayer(r,t.innerView))}break}}}return Promise.resolve(this)}};function Rl(e,t,i,r){if(i.elevationInfo.mode===o.ElevationMode.OnTheGround||i.elevationInfo.mode===o.ElevationMode.OnTheScene||i.elevationInfo.mode===o.ElevationMode.OnTheGroundAndScene){new Cesium.SampleElevationTool(t,e,"terrain",function(e){r&&r instanceof Function&&r(e)}).start({level:12})}return e}function zl(e){const t=e.geometry;let i=0;e.elevationInfo.mode===o.ElevationMode.AbsoluteHeight&&(i+=e.elevationInfo.offset);const r=[];let n;switch(t.type){case o.GeometryType.point:n=Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],t.coordinates[2]+i),r.push(n);break;case o.GeometryType.multiPoint:for(let e=0;e<t.coordinates.length;e++)n=Cesium.Cartesian3.fromDegrees(t.coordinates[e][0],t.coordinates[e][1],t.coordinates[e][2]+i),r.push(n);break;case o.GeometryType.polygon:const e=o.Geometry.fromJSON(t).centroid;n=Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]+i),r.push(n);break;case o.GeometryType.multiPolygon:const a=o.Geometry.fromJSON(t).toPolygonArray();for(let e=0;e<a.length;e++){const t=a[e].centroid;n=Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],t.coordinates[2]+i),r.push(n)}break;case o.GeometryType.extent:n=Cesium.Cartesian3.fromDegrees((t.xmin+t.xmax)/2,(t.ymin+t.ymax)/2,(t.zmin+t.zmax)/2+i),r.push(n);break;case o.GeometryType.circle:n=Cesium.Cartesian3.fromDegrees(t.center[0],t.center[1],t.center[2]+i),r.push(n)}return r}function Dl(e){let t=void 0;switch(e){case o.ElevationMode.OnTheGround:t=Cesium.ClassificationType.TERRAIN;break;case o.ElevationMode.OnTheScene:t=Cesium.ClassificationType.CESIUM_3D_TILE;break;case o.ElevationMode.OnTheGroundAndScene:t=Cesium.ClassificationType.BOTH}return t}function Fl(e,t){let i=void 0;switch(t){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:e,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:e,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:e})}return i}function Nl(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}function Gl(e,t){return(e=Object(o.defaultValue)(e,0))+t}function Vl(e,t){let i;Rl(t,e._viewer,e._feature,t=>{for(let t=0;t<e._pointsCollection._pointPrimitives.length;t++)e._pointsCollection._pointPrimitives[t]&&e._pointsCollection._pointPrimitives[t].id===e.id&&e._pointsCollection.remove(e._pointsCollection._pointPrimitives[t]);for(let r=0;r<t.length;r++)i=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromDegrees(t[r].longitude,t[r].latitude,t[r].height))),e._savePoint(i)})}function Bl(e,t){let i;Rl(t,e._viewer,e._feature,t=>{for(let t=0;t<e._billboardsCollection._billboards.length;t++)e._billboardsCollection._billboards[t]&&e._billboardsCollection._billboards[t].id===e.id&&e._billboardsCollection.remove(e._billboardsCollection._billboards[t]);for(let r=0;r<t.length;r++)i=e._billboardsCollection.add(e._createBillboardOptions(Cesium.Cartesian3.fromDegrees(t[r].longitude,t[r].latitude,t[r].height))),e._saveBillboard(i)})}function ql(e,t){let i;Rl(t,e._viewer,e._feature,t=>{for(let t=0;t<e._labelsCollection._labels.length;t++)e._labelsCollection._labels[t]&&e._labelsCollection._labels[t].id===e.id&&e._labelsCollection.remove(e._labelsCollection._labels[t]);for(let r=0;r<t.length;r++)i=e._labelsCollection.add(e._createLabelOptions(Cesium.Cartesian3.fromDegrees(t[r].longitude,t[r].latitude,t[r].height))),e._saveLabel(i)})}function Ul(e){let t=!1;return e.elevationInfo.mode!==o.ElevationMode.OnTheGround&&e.elevationInfo.mode!==o.ElevationMode.OnTheScene&&e.elevationInfo.mode!==o.ElevationMode.OnTheGroundAndScene||(t=!0),t}var Wl=class{constructor(e){e=Cesium.defaultValue(e,{}),this.commonLayerId=Cesium.defaultValue(e.layerId,null),this._feature=e.feature,this._feature||o.Log.error("feature不能为空!"),this._feature=o.Feature.fromJSON(this._feature.toJSON()),this._addZCoordinate(),this.checkSymbol()&&(this.id=Cesium.defaultValue(this._feature.id,Cesium.createGuid()),this.show=Cesium.defaultValue(this._feature.visible,!0),this._layerOpacity=Cesium.defaultValue(e.layerOpacity,1),this._primitivesCollection=Cesium.defaultValue(e.primitivesCollection,void 0),this._pointsCollection=Cesium.defaultValue(e.pointsCollection,void 0),this._billboardsCollection=Cesium.defaultValue(e.billboardsCollection,void 0),this._labelsCollection=Cesium.defaultValue(e.labelsCollection,void 0),this._points=[],this._billboards=[],this._labels=[],this._primitives=[],this._canvas=void 0,this._symbol=this._feature.symbol,this._elevationInfo=this._feature.elevationInfo,this._viewer=Cesium.defaultValue(e.viewer,void 0),this._createPrimitive())}update(e){this._feature=e,this._addZCoordinate(),this.show=this._feature.visible,this._removePrimitives(),this._createPrimitive()}destroy(){this._removePrimitives(),this.id=void 0,this.show=void 0,this._layerOpacity=void 0,this._feature=void 0,this._canvas=void 0,this._symbol=void 0,this._points=void 0,this._billboards=void 0,this._labels=void 0,this._primitives=void 0,this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0}checkSymbol(){return!0}setVisible(e){for(let t=0;t<this._points.length;t++)this._points[t].show=e;for(let t=0;t<this._labels.length;t++)this._labels[t].show=e;for(let t=0;t<this._billboards.length;t++)this._billboards[t].show=e;for(let t=0;t<this._primitives.length;t++)this._primitives[t].show=e}_getCesiumColor(e){return new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha)}_getCesiumColorByOpacity(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}_createAppearance(){}_createPrimitive(){}_getPositions(){const e=this._feature.geometry;let t=0;this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight&&(t+=this._elevationInfo.offset);const i=[];switch(e.type){case o.GeometryType.point:i.push(Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],Gl(e.coordinates[2],t)));break;case o.GeometryType.multiPoint:case o.GeometryType.lineString:for(let r=0;r<e.coordinates.length;r++)i.push(Cesium.Cartesian3.fromDegrees(e.coordinates[r][0],e.coordinates[r][1],Gl(e.coordinates[r][2],t)));break;case o.GeometryType.multiLineString:case o.GeometryType.polygon:for(let r=0;r<e.coordinates.length;r++){i.push([]);for(let o=0;o<e.coordinates[r].length;o++)i[r].push(Cesium.Cartesian3.fromDegrees(e.coordinates[r][o][0],e.coordinates[r][o][1],Gl(e.coordinates[r][o][2],t)))}break;case o.GeometryType.multiPolygon:for(let r=0;r<e.coordinates.length;r++){i.push([]);for(let o=0;o<e.coordinates[r].length;o++){i[r].push([]);for(let n=0;n<e.coordinates[r][o].length;n++)i[r][o].push(Cesium.Cartesian3.fromDegrees(e.coordinates[r][o][n][0],e.coordinates[r][o][n][1],Gl(e.coordinates[r][o][n][2],t)))}}break;case o.GeometryType.extent:i.push([]),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmin,e.ymin,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmax,e.ymin,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmax,e.ymax,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmin,e.ymax,Gl(e.zmin,t))),i[0].push(Cesium.Cartesian3.fromDegrees(e.xmin,e.ymin,Gl(e.zmin,t)));break;case o.GeometryType.circle:case o.GeometryType.arc:const r=e.toPolygon();for(let e=0;e<r.coordinates.length;e++){i.push([]);for(let o=0;o<r.coordinates[e].length;o++)i[e].push(Cesium.Cartesian3.fromDegrees(r.coordinates[e][o][0],r.coordinates[e][o][1],Gl(r.coordinates[e][o][2],t)))}}return 0===i.length&&o.Log.error("顶点数组为空,无法正常创建图形!"),i}_addZCoordinate(){const e=this._feature.geometry;if(!e.hasZ)switch(e.type){case o.GeometryType.point:e.coordinates.push(0);break;case o.GeometryType.multiPoint:case o.GeometryType.lineString:for(let t=0;t<e.coordinates.length;t++)e.coordinates[t].push(0);break;case o.GeometryType.multiLineString:case o.GeometryType.polygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)e.coordinates[t][i].push(0);break;case o.GeometryType.multiPolygon:for(let t=0;t<e.coordinates.length;t++)for(let i=0;i<e.coordinates[t].length;i++)for(let r=0;r<e.coordinates[t][i].length;r++)e.coordinates[t][i][r].push(0);break;case o.GeometryType.extent:e.zmin=0,e.zmax=0;break;case o.GeometryType.circle:e.center.push(0)}}_removePrimitives(){for(let e=0;e<this._points.length;e++)this._pointsCollection.remove(this._points[e]);this._points=[];for(let e=0;e<this._billboards.length;e++)this._billboardsCollection.remove(this._billboards[e]);this._billboards=[];for(let e=0;e<this._labels.length;e++)this._labelsCollection.remove(this._labels[e]);this._labels=[];for(let e=0;e<this._primitives.length;e++)this._primitivesCollection.remove(this._primitives[e]);this._primitives=[]}_saveBillboard(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._billboards.push(e)}_savePoint(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._points.push(e)}_saveLabel(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._labels.push(e)}};var Hl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.SimpleMarkerSymbol||(o.Log.info("要素的符号类型不是SimpleMarkerSymbol!"),!1)}_createPrimitive(){if(!this._feature.symbol.style)return;const e=Ul(this._feature);switch(this._feature.symbol.style){case"circle":this._createPointPrimitive(e);break;default:this._createBillBoardPrimitive(e)}}_getPositions(){return zl(this._feature)}_symbolEquals(e,t){let i=!0;return e.size===t.size&&e.style===t.style&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha||(i=!1),("circle"===e.style&&"circle"!==t.style||"circle"!==e.style&&"circle"===t.style)&&(this._primitiveCollection=void 0),i}_createBillBoardPrimitive(e){const t=this._feature.symbol;this._canvas?this._symbolEquals(t,this._symbol)||(this._canvas=Object(o.createSimpleMarkerSymbolCanvas)(t),this._symbol=t):this._canvas=Object(o.createSimpleMarkerSymbolCanvas)(t);const i=this._feature.geometry;let r,n=[];switch(i.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:e?(n.push(Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],0)),Bl(this,n)):(r=this._billboardsCollection.add(this._createBillboardOptions(this._getPositions()[0])),this._saveBillboard(r));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(n=this._getPositions(),e)Bl(this,n);else for(let e=0;e<n.length;e++)r=this._billboardsCollection.add(this._createBillboardOptions(n[e])),this._saveBillboard(r)}}_createBillboardOptions(e){const t=this._feature.symbol;return{position:e,image:this._canvas,color:new Cesium.Color(1,1,1,this._layerOpacity),width:t.size,height:t.size,pixelOffset:new Cesium.Cartesian2(t.xoffset,-1*t.yoffset)}}_createPointPrimitive(e){let t,i=[];const r=this._feature.geometry;switch(r.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:e?(i.push(Cesium.Cartesian3.fromDegrees(r.coordinates[0],r.coordinates[1],0)),Vl(this,i)):(t=this._pointsCollection.add(this._createPointOptions(this._getPositions()[0])),this._savePoint(t));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(i=this._getPositions(),e)Vl(this,i);else for(let e=0;e<i.length;e++)t=this._pointsCollection.add(this._createPointOptions(i[e])),this._savePoint(t);break;default:o.Log.error("要素的几何类型是不支持的类型!")}}_createPointOptions(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color);i.alpha*=this._layerOpacity;const r=this._getCesiumColor(t.outline.color);return r.alpha*=this._layerOpacity,{position:e,color:i,outlineColor:r,outlineWidth:t.outline.width,pixelSize:t.size}}};var Yl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.PictureMarkerSymbol||(o.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_createPrimitive(){const e=Ul(this._feature),t=this._feature.geometry;let i,r=[];switch(t.type){case o.GeometryType.point:e?(r.push(Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],0)),Bl(this,r)):(i=this._billboardsCollection.add(this._createBillboardOptions(this._getPositions()[0])),this._saveBillboard(i));break;case o.GeometryType.multiPoint:if(r=this._getPositions(),e)Bl(this,r);else for(let e=0;e<r.length;e++){const t=this._billboardsCollection.add(this._createBillboardOptions(r[e]));this._saveBillboard(t)}}}_createBillboardOptions(e){const t=this._feature.symbol;return{position:e,image:t.url,color:new Cesium.Color(1,1,1,this._layerOpacity),width:t.width,height:t.height,rotation:Cesium.Math.toRadians(t.angle),pixelOffset:new Cesium.Cartesian2(t.xoffset,-1*t.yoffset)}}};var Jl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.SimpleLineSymbol||(o.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(){switch(this._feature.geometry.type){case o.GeometryType.lineString:case o.GeometryType.arc:const e=this._primitivesCollection.add(this._createLinePrimitive(this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case o.GeometryType.multiLineString:const t=this._getPositions();for(let e=0;e<t.length;e++){const i=this._primitivesCollection.add(this._createLinePrimitive(t[e]));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i)}}}_createLinePrimitive(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color);let r;if(i.alpha*=this._layerOpacity,this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:e,width:t.width,arcType:Cesium.ArcType.NONE}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1});else{const o=Dl(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:e,width:t.width,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:o})}return r}_createAppearance(){const e=this._feature.symbol;let t=void 0;switch(this._feature.geometry.type){case o.GeometryType.lineString:case o.GeometryType.multiLineString:switch(e.type){case o.SymbolType.simpleLine:switch(e.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return t=this._createLineMaterial(),new Cesium.PolylineMaterialAppearance({material:t,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:return t=Cesium.Material.fromType("Color",{color:this._getCesiumColor(e.color)}),new Cesium.PolylineColorAppearance({material:t,renderState:{depthTest:{enabled:!0}}})}}break;default:o.Log.error("要素几何为不支持的类型!")}}_createLineMaterial(){const e=this._feature.symbol,t=this._getCesiumColor(e.color);t.alpha*=this._layerOpacity;let i=void 0;switch(e.style){case"dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32});break;case"dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"dot":i=Cesium.Material.fromType("PolylineDash",{color:t,gapColor:new Cesium.Color(0,0,0,0),dashPattern:240});break;case"long-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64});break;case"long-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2,maskTestFactor:1.5});break;case"long-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:64,maskIndexFactor:2});break;case"short-dash":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:16});break;case"short-dash-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2,maskTestFactor:1.5});break;case"short-dash-dot-dot":i=Cesium.Material.fromType("PolylineDash",{color:new Cesium.Color(0,0,0,0),gapColor:t,dashPattern:120,dashLength:32,maskIndexFactor:2});break;default:i=Cesium.Material.fromType("Color",{color:t})}return i}};var $l=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.SimpleFillSymbol||(o.Log.info("要素的符号类型不是SimpleFillSymbol!"),!1)}_createPrimitive(){this._feature.symbol.style&&(this._createAllPolygonPrimitive(),this._createAllOutlinePrimitive())}_createAllPolygonPrimitive(){const e=this._feature.geometry,t=this._getPositions();switch(e.type){case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:case o.GeometryType.arc:const i=this._createPolygonPrimitive(t);i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i);break;case o.GeometryType.multiPolygon:for(let e=0;e<t.length;e++){const i=this._createPolygonPrimitive(t[e]);i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i)}}}_createPolygonPrimitive(e){const t=this._feature.symbol,i=this._getCesiumColor(t.color),r=[];for(let t=1;t<e.length;t++)r.push(new Cesium.PolygonHierarchy(e[t]));let n=void 0;const a=this._feature.geometry;a.type===o.GeometryType.extent&&(n=a.zmax);const s=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(e[0],r),extrudedHeight:n,perPositionHeight:!0}),l=new Cesium.MaterialAppearance({material:this._createPolygonMaterial(),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),appearance:l,asynchronous:!1});else{const e=Dl(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}}),appearance:l,asynchronous:!1,classificationType:e})}return h=this._primitivesCollection.add(h)}_createAllOutlinePrimitive(){const e=this._feature.geometry;let t=[];switch(e.type){case o.GeometryType.polygon:t=this._createPolygonOutlineGraphic(e.coordinates);break;case o.GeometryType.extent:const i=this._getPositions();t=this._createPolygonOutlineGraphic(i);break;case o.GeometryType.circle:case o.GeometryType.arc:t=this._createPolygonOutlineGraphic([]);break;case o.GeometryType.multiPolygon:for(let i=0;i<e.coordinates.length;i++){const r=this._createPolygonOutlineGraphic(e.coordinates[i]);t=t.concat(r)}break;default:o.Log.info("要素为未支持的几何类型")}this._primitives=this._primitives.concat(t)}_createPolygonOutlineGraphic(e){const t=this._feature.symbol;let i=[];const r=this._feature.geometry;if(r.type===o.GeometryType.extent)i.push([]),i[0].push([r.xmin,r.ymin,r.zmin]),i[0].push([r.xmax,r.ymin,r.zmin]),i[0].push([r.xmax,r.ymax,r.zmin]),i[0].push([r.xmin,r.ymax,r.zmin]),i[0].push([r.xmin,r.ymin,r.zmin]),i[0].push([i[0][0][0]+(i[0][1][0]-i[0][0][0])/1e4,i[0][0][1]+(i[0][1][1]-i[0][0][1])/1e4,i[0][0][2]+(i[0][1][2]-i[0][0][2])/1e4]);else if(r.type===o.GeometryType.circle||r.type===o.GeometryType.arc)i=r.toPolygon().coordinates;else for(let t=0;t<e.length;t++){i.push([]);for(let r=0;r<e[t].length;r++)i[t].push(e[t][r]);i[t].push([i[t][0][0]+(i[t][1][0]-i[t][0][0])/1e4,i[t][0][1]+(i[t][1][1]-i[t][0][1])/1e4,i[t][0][2]+(i[t][1][2]-i[t][0][2])/1e4])}const n=new o.MultiLineString({coordinates:i}),a=new o.Feature({geometry:n,symbol:t.outline,elevationInfo:this._elevationInfo,visible:this.show});return new Jl({feature:a,layerOpacity:this._layerOpacity,primitivesCollection:this._primitivesCollection})._primitives}_createPolygonMaterial(){const e=this._feature.symbol;let t;switch(e.style){case"backward-diagonal":case"cross":case"diagonal-cross":case"forward-diagonal":case"horizontal":case"vertical":this._canvas?(this._symbol||(this._symbol=this._feature.symbol),this._symbolEquals(e,this._symbol)||(this._canvas=Object(o.createSimpleFillSymbolCanvas)(e),this._symbol=e)):this._canvas=Object(o.createSimpleFillSymbolCanvas)(e),t=Cesium.Material.fromType("TextImage",{image:this._canvas,repeat:new Cesium.Cartesian2(4,4),alpha:this._layerOpacity});break;default:const i=this._getCesiumColor(e.color);i.alpha*=this._layerOpacity,t=Cesium.Material.fromType("Color",{color:i})}return t}_symbolEquals(e,t){return e.style===t.style&&e.color.red===t.color.red&&e.color.green===t.color.green&&e.color.blue===t.color.blue&&e.color.alpha===t.color.alpha&&e.outline.width===t.outline.width&&e.outline.color.red===t.outline.color.red&&e.outline.color.green===t.outline.color.green&&e.outline.color.blue===t.outline.color.blue&&e.outline.color.alpha===t.outline.color.alpha}};var Xl=class extends $l{constructor(e){super(e)}_createPrimitive(){this._createAllPolygonPrimitive(),this._createAllOutlinePrimitive()}checkSymbol(){return this._feature.symbol instanceof o.PictureFillSymbol||(o.Log.info("要素的符号类型不是PictureFillSymbol!"),!1)}_createPolygonMaterial(){const e=this._feature.symbol,{url:t,xscale:i,yscale:r}=e;return new Cesium.Material({fabric:{type:"Image",uniforms:{color:new Cesium.Color(1,1,1,this._layerOpacity),image:t,repeat:{x:1/i,y:1/r}}}})}},Zl=i(1);var Kl=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.TextSymbol||(o.Log.info("要素的符号类型不是TextSymbol!"),!1)}_createPrimitive(){const e=Ul(this._feature);let t,i=[];const r=this._feature.geometry;switch(this._primitiveCollection||(this._primitiveCollection=new Cesium.LabelCollection),r.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:e?(i.push(Cesium.Cartesian3.fromDegrees(r.coordinates[0],r.coordinates[1],0)),ql(this,i)):(t=this._labelsCollection.add(this._createLabelOptions(this._getPositions()[0])),this._saveLabel(t));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(i=this._getPositions(),e)ql(this,i);else for(let e=0;e<i.length;e++){const t=this._labelsCollection.add(this._createLabelOptions(i[e]));this._saveLabel(t)}}}_getPositions(){return zl(this._feature,this._viewer)}_createLabelOptions(e){const t=this._feature.symbol;return Cesium.DynamicLabelsUtil.createLabelOptions(this._feature.id,t.text,e,Zl.a.convertTextSymbolToLabelNoteStyle(t,{layerOpacity:this._layerOpacity}))}};var Ql=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.MapGISTextSymbol||(o.Log.info("要素的符号类型不是MapGISTextSymbol!"),!1)}_createPrimitive(){Ul(this._feature);let e,t=[];const i=this._feature.geometry;switch(this._billboardsCollection||(this._billboardsCollection=new Cesium.BillboardsCollection),i.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:Ul?(t.push(Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],0)),Bl(this,t)):(e=this._billboardsCollection.add(this._createBillboardOptions(this._getPositions()[0])),this._saveBillboard(e));break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:if(t=this._getPositions(),Ul)Bl(this,t);else for(let i=0;i<t.length;i++)e=this._billboardsCollection.add(this._createBillboardOptions(t[i])),this._saveBillboard(e)}}_getPositions(){return zl(this._feature,this._viewer)}_createBillboardOptions(e){const t=this._feature.symbol;return Cesium.DynamicLabelsUtil.createNoteBillBoardOptions(this._feature.id,t.text,e,Zl.a.convertTextSymbolToLabelNoteStyle(t,{layerOpacity:this._layerOpacity}))}};function eh(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=e.anchorPosition,a=function(e){const t={horizontalOrigin:void 0,verticalOrigin:void 0};switch(e){case o.AnchorType.center:default:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case o.AnchorType.left:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case o.AnchorType.right:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case o.AnchorType.top:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case o.AnchorType.bottom:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case o.AnchorType.topLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case o.AnchorType.topRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case o.AnchorType.bottomLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case o.AnchorType.bottomRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM}return t}(e.anchor);return{show:i.show,position:t,image:i.image,color:Nl(r.color,i.layerOpacity),width:e.size,height:e.size,horizontalOrigin:a.horizontalOrigin,verticalOrigin:a.verticalOrigin,pixelOffset:new Cesium.Cartesian2(n.coordinates[0],-1*n.coordinates[1])}}function th(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=e.font;let a,s;switch(e.horizontalAlignment){case o.HorizontalAlignment.center:default:a=Cesium.HorizontalOrigin.CENTER;break;case o.HorizontalAlignment.right:a=Cesium.HorizontalOrigin.RIGHT;break;case o.HorizontalAlignment.left:a=Cesium.HorizontalOrigin.LEFT}switch(e.verticalAlignment){case o.VerticalAlignment.baseline:default:s=Cesium.VerticalOrigin.BASELINE;break;case o.VerticalAlignment.top:s=Cesium.VerticalOrigin.TOP;break;case o.VerticalAlignment.bottom:s=Cesium.VerticalOrigin.BOTTOM;break;case o.VerticalAlignment.middle:s=Cesium.VerticalOrigin.CENTER}return{show:i.show,position:t,text:e.text,fillColor:Nl(r.color,i.layerOpacity),font:`${e.size} ${n.family}`,backgroundColor:Nl(e.background,i.layerOpacity),horizontalOrigin:a,verticalOrigin:s}}function ih(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),a={show:i.show,url:e.resource.href,shadows:e.castShadows,scale:1,color:Nl(r.color,i.layerOpacity),modelMatrix:n,asynchronous:!1};return Cesium.Model.fromGltf(a)}function rh(e,t){t=Object(o.defaultValue)(t,{layerOpacity:1});const i=e.material;switch(i.type){case o.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Nl(i.color,t.layerOpacity)})})}}function oh(e,t,i){i=Object(o.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,n=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),a=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Nl(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:a,appearance:rh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function nh(e,t,i){i=Object(o.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128,layerOpacity:1,show:!0});const r=e.material,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),a=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Nl(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:n,appearance:rh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function ah(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}function sh(e){const t=e.color,i=e.outline.color;return{color:new Cesium.Color(t.red/255,t.green/255,t.blue/255,t.alpha),pixelSize:e.size,show:"none"!==e.style,outlineColor:new Cesium.Color(i.red/255,i.green/255,i.blue/255,i.alpha),outlineWidth:e.outline.width}}var lh=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.LabelSymbol3D||(o.Log.info("要素的符号类型不是LabelSymbol3D!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const n=e.items[r];switch(t.type){case o.GeometryType.point:case o.GeometryType.polygon:case o.GeometryType.extent:case o.GeometryType.circle:i=this._getPositions(),this._createLabel(n,i[0]);break;case o.GeometryType.multiPoint:case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLabel(n,i[e])}}}_getPositions(){return zl(this._feature,this._viewer)}_createLabel(e,t){const i=this._labelsCollection.add(r.createLabel(e,t,{show:this.show,layerOpacity:this._layerOpacity}));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._labels.push(i)}};var hh=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.id=Object(o.defaultValue)(e.id,Object(o.getGUID)()),this.opacity=Object(o.defaultValue)(e.opacity,1),this.elevationInfo=Object(o.defaultValue)(e.elevationInfo,new o.ElevationInfo),this._graphicsCollection=new o.Collection,this._primitivesCollection=new Cesium.PrimitiveCollection,this._pointsCollection=new Cesium.PointPrimitiveCollection,this._billboardsCollection=new Cesium.BillboardCollection,this._labelsCollection=new Cesium.LabelCollection,this._viewer=e.viewer,this._viewer.scene.primitives.add(this._primitivesCollection),this._viewer.scene.primitives.add(this._pointsCollection),this._viewer.scene.primitives.add(this._billboardsCollection),this._viewer.scene.primitives.add(this._labelsCollection)}add(e){let t,i=o.Feature.fromJSON(e);switch(i.elevationInfo||(i.elevationInfo=this.elevationInfo),i.additional&&i.additional.hasOwnProperty("arc3")&&(i=Object(o.editFeatureByArc3)(i)),i.symbol.type){case o.SymbolType.simpleMarker:t=new Hl({layerId:this.id,feature:i,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.pictureMarker:t=new Yl({layerId:this.id,feature:i,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.text:t=new Kl({layerId:this.id,feature:i,layerOpacity:this.opacity,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case o.SymbolType.mapgisText:t=new Ql({layerId:this.id,feature:i,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.simpleLine:t=new Jl({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.simpleFill:t=new $l({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.pictureFill:t=new Xl({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.line3D:t=new ph({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case o.SymbolType.polygon3D:t=new dh({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case o.SymbolType.point3D:t=new fh({layerId:this.id,feature:i,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case o.SymbolType.label3D:t=new lh({layerId:this.id,feature:i,layerOpacity:this.opacity,labelsCollection:this._labelsCollection,viewer:this._viewer});break;default:o.Log.error("要素的符号暂时不支持!")}t&&this._graphicsCollection.add(t)}removeByID(e){const t=this._findGraphicById(e);this._graphicsCollection.remove(t),t.destroy()}update(e){let t=o.Feature.fromJSON(e.toJSON());t.additional.hasOwnProperty("arc3")&&(t=Object(o.editFeatureByArc3)(t));const i=this._findGraphicById(e.id);i._feature.symbol.type!==t.symbol.type?(this.removeByID(e.id),this.add(e)):i.update(t)}findByID(e){return this._findGraphicById(e)}getAll(){return this._graphicsCollection}remove(e){this.removeByID(e.id)}removeAll(){this._graphicsCollection.forEach(function(e){e.destroy()}),this._graphicsCollection.items=[]}destroy(){this.id=void 0,this.opacity=void 0,this._graphicsCollection=void 0,this._primitivesCollection.destroy(),this._primitivesCollection=void 0,this._pointsCollection.destroy(),this._pointsCollection=void 0,this._billboardsCollection.destroy(),this._billboardsCollection=void 0,this._labelsCollection.destroy(),this._labelsCollection=void 0,this._viewer=void 0}setVisible(e){this._graphicsCollection.forEach(function(t){t.setVisible(e)})}setOpacity(e){let t=e;t<0&&(t=0),t>1&&(t=1),this.opacity=t,this._graphicsCollection.forEach(function(e){e._layerOpacity=t,e.update(e._feature)})}_findGraphicById(e){let t=void 0;return this._graphicsCollection.forEach(function(i){i.id===e&&(t=i)}),t}};var ch=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.id=Object(o.defaultValue)(e.id,Object(o.getGUID)()),this._viewer=e.viewer,this._renderer=e.renderer,this._dataSource=new Cesium.CustomDataSource(this.id),this._initCluster()}_initCluster(){this._dataSourcePromise=this._viewer.dataSources.add(this._dataSource,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas});const e=this;this._dataSourcePromise.then(function(t){t.clustering.enabled=!0,t.clustering.pixelRange=e._renderer.radius,t.clustering.clusterEvent.addEventListener(function(t,i){i.label.show=!1,i.billboard.show=!1,i.point.show=!1;const r=e._renderer.clusterInfos,o=e._renderer.defaultSymbol;if(r instanceof Array&&r.length>0){let n=!1;for(let o=0;o<r.length;o++)if(t.length>=r[o].minValue&&t.length<r[o].maxValue){e._setClusterEntity(i,r[o].symbol,r[o].labelSymbol),n=!0;break}n||e._setClusterEntity(i,o)}else e._setClusterEntity(i,o)})})}_setClusterEntity(e,t,i){switch(t.type){case o.SymbolType.simpleMarker:switch(t.style){case"circle":this._setClusterPoint(e,t),i&&this._setClusterLabel(e,i,{});break;default:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{})}break;case o.SymbolType.pictureMarker:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{pictureMarkerSymbol:t})}}_setClusterLabel(e,t,i){i=Object(o.defaultValue)(i,{});const r=Object(o.defaultValue)(i.pictureMarkerSymbol,void 0);t&&t instanceof o.TextSymbol&&(e.label.show=!0,e.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.label.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.label.font=`${t.font.size}px ${t.font.family}`,e.label.fillColor=new Cesium.Color(t.color.red/255,t.color.green/255,t.color.blue/255,t.color.alpha),e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset)),r&&r instanceof o.PictureMarkerSymbol&&(e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset+-1*r.height))}_setClusterBillBoard(e,t){t&&(t instanceof o.PictureMarkerSymbol?(e.billboard.show=!0,e.billboard.image=t.url,e.billboard.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,e.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER,e.billboard.width=t.width,e.billboard.height=t.height,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)):t instanceof o.SimpleMarkerSymbol&&(e.billboard.show=!0,e.billboard.image=Object(o.createSimpleMarkerSymbolCanvas)(t),e.billboard.width=t.size,e.billboard.height=t.size,e.billboard.pixelOffset=new Cesium.Cartesian2(t.xoffset,t.yoffset),e.billboard.rotation=Cesium.Math.toRadians(t.angle)))}_setClusterPoint(e,t){const i=sh(t);e.point.show=!0,e.point.color=i.color,e.point.pixelSize=i.pixelSize,e.point.outlineColor=i.outlineColor,e.point.outlineWidth=i.outlineWidth}add(e){e=Object(o.defaultValue)(e,{});const t={position:Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],1e3)},i=e.symbol;switch(i.type){case o.SymbolType.simpleMarker:switch(i.style){case"circle":t.point=sh(i),t.point.id=e.id;break;default:t.billboard=function(e){return{show:"none"!==e.style,image:Object(o.createSimpleMarkerSymbolCanvas)(e)}}(i),t.billboard.id=e.id}break;case o.SymbolType.pictureMarker:t.billboard=function(e){return{image:e.url,width:e.width,height:e.height,pixelOffset:new Cesium.Cartesian2(e.xoffset,e.yoffset),rotation:Cesium.Math.toRadians(e.angle)}}(i),t.billboard.id=e.id}this._dataSource.entities.add(t)}};var uh=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.id=Object(o.defaultValue)(e.id,Object(o.getGUID)()),this._field=Object(o.defaultValue)(e.field,void 0),this._valueExpression=Object(o.defaultValue)(e.valueExpression,void 0),this._features=Object(o.defaultValue)(e.features,[]),this._radius=Object(o.defaultValue)(e.radius,void 0),this._radiusFactor=Object(o.defaultValue)(e.radiusFactor,60),this._minDataValue=Object(o.defaultValue)(e.minDataValue,0),this._maxDataValue=Object(o.defaultValue)(e.maxDataValue,0),this._minCanvasSize=Object(o.defaultValue)(e.minCanvasSize,700),this._maxCanvasSize=Object(o.defaultValue)(e.maxCanvasSize,2e3),this._spacingFactor=Object(o.defaultValue)(e.spacingFactor,1.5),this._opacity=Object(o.defaultValue)(e.opacity,1),this._blur=Object(o.defaultValue)(e.blur,.85),this._gradient=Object(o.defaultValue)(e.gradient,{}),this._canChange=Object(o.defaultValue)(e.canChange,!0),this._viewer=Object(o.defaultValue)(e.viewer,void 0),this._heatMap=void 0,this._initHeatMap()}_initHeatMap(){this._viewer||o.Log.error("Cesium视图对象不能为空!"),this._features&&this._features instanceof Array||o.Log.error("热力图数据不能为空或者不是数组!"),this._field||this._valueExpression||o.Log.error("字段名或字段表达式不能为空!");const e=this._getHeatMapData(),t=this._getBounds(e),i=this._getGradient();this._heatMap=Cesium.CesiumHeatmap.create(this._viewer,t,{radius:this._radius,radiusFactor:this._radiusFactor,minCanvasSize:this._minCanvasSize,maxCanvasSize:this._maxCanvasSize,spacingFactor:this._spacingFactor,alpha:this._opacity,blur:this._blur,gradient:i,canChange:this._canChange}),this._heatMap.setWGS84Data(this._minDataValue,this._maxDataValue,e)}_getBounds(e){const t=[[]];for(let i=0;i<e.length;i++)t[0].push([e[i].x,e[i].y]);t[0].push(t[0][0]);const i=new o.Polygon({coordinates:t});return{west:i.extent.xmin,east:i.extent.xmax,south:i.extent.ymin,north:i.extent.ymax}}_getHeatMapData(){const e=[];for(let t=0;t<this._features.length;t++){const i=this._features[t],r=i.geometry;let n;switch(this._valueExpression?(n=Zl.a.parseExpression(i,this._valueExpression),n=Number(n)):n=Number(i.attributes[this._field]),r.type){case o.GeometryType.point:e.push({x:r.coordinates[0],y:r.coordinates[1],value:n});break;case o.GeometryType.multiPoint:for(let t=0;t<r.coordinates.length;t++)e.push({x:r.coordinates[t][0],y:r.coordinates[t][1],value:n});break;case o.GeometryType.lineString:e.push({x:r.extent.center.coordinates[0],y:r.extent.center.coordinates[1],value:n});break;case o.GeometryType.multiLineString:for(let i=0;i<r.coordinates.length;i++){const i=new o.LineString({coordinates:r.coordinates[t]});e.push({x:i.extent.center.coordinates[0],y:i.extent.center.coordinates[1],value:n})}break;case o.GeometryType.polygon:e.push({x:r.centroid.coordinates[0],y:r.centroid.coordinates[1],value:n});break;case o.GeometryType.multiPolygon:for(let i=0;i<r.coordinates.length;i++){const i=new o.Polygon({coordinates:r.coordinates[t]});e.push({x:i.centroid.coordinates[0],y:i.centroid.coordinates[1],value:n})}break;case o.GeometryType.extent:e.push({x:r.center.coordinates[0],y:r.center.coordinates[1],value:n});break;case o.GeometryType.circle:e.push({x:r.center[0],y:r.center[1],value:n})}}return e}_getGradient(){const e={};for(let t=0;t<this._gradient.length;t++)e[this._gradient[t].ratio]=this._gradient[t].color.toCssRGBAString();return e}destroy(){this._heatMap.removeLayer()}};var ph=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.LineSymbol3D||(o.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;for(let i=0;i<e.items.length;i++){const r=e.items[i];switch(r.type){case o.Symbol3DLayerType.line:default:switch(t.type){case o.GeometryType.lineString:case o.GeometryType.arc:const e=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case o.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}break;case o.Symbol3DLayerType.path:switch(t.type){case o.GeometryType.lineString:case o.GeometryType.arc:const e=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,this._getPositions()));e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e);break;case o.GeometryType.multiLineString:const i=this._getPositions();for(let e=0;e<i.length;e++){const t=this._primitivesCollection.add(this._createPathSymbol3DLayerPrimitive(r,i[e]));t.id=this._feature.id,t.commonFeatureId=this._feature.id,t.commonLayerId=this.commonLayerId,this._primitives.push(t)}}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:Cesium.ArcType.NONE}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const i=Dl(this._elevationInfo.mode),o=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(_color)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:i})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let n=void 0;switch(i.type){case o.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:n,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case o.LineMarkerStyle.arrow:n=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:n,renderState:{depthTest:{enabled:!0}}})}}}_createPathSymbol3DLayerPrimitive(e,t){switch(e.profile){case o.ProfileType.circle:default:return this._createPolylineVolumePrimitive(e,t);case o.ProfileType.quad:return this._createCorridorPrimitive(e,t)}}_createPolylineVolumePrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),o=this._getCornerType(e),n=new Cesium.PolylineVolumeGeometry({polylinePositions:t,shapePositions:this._computeCircle(e.width>e.height?e.width:e.height),cornerType:o});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_computeCircle(e){const t=[];for(let i=0;i<360;i++){const r=Cesium.Math.toRadians(i);t.push(new Cesium.Cartesian2(e*Math.cos(r),e*Math.sin(r)))}return t}_createCorridorPrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),o=this._getCornerType(e),n=new Cesium.CorridorGeometry({positions:t,width:e.width,height:e.height,extrudedHeight:0,cornerType:o});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createPathAppearance(i),asynchronous:!1,shadows:this._getShadows(e)})}_createPathAppearance(e){switch(e.type){case o.MaterialType.color:default:const t=this._getCesiumColorByOpacity(e.color,this._layerOpacity);return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{_color:t})})}}_getCornerType(e){let t=void 0;switch(e.join){case o.LineJoinType.round:default:t=Cesium.CornerType.ROUNDED;break;case o.LineJoinType.bevel:t=Cesium.CornerType.BEVELED;break;case o.LineJoinType.miter:t=Cesium.CornerType.MITERED}return t}_getShadows(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}};var dh=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.PolygonSymbol3D||(o.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const n=e.items[r];switch(n.type){case o.Symbol3DLayerType.line:switch(t.type){case o.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLine(n,i[r]);break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;e++)this._createLine(n,i[e][t])}break;case o.Symbol3DLayerType.fill:default:switch(t.type){case o.GeometryType.polygon:this._createPolygon(n,this._getPositions());break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(n,i[e])}break;case o.Symbol3DLayerType.extrude:switch(t.type){case o.GeometryType.polygon:this._createPolygon(n,this._getPositions(),n.size);break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(n,i[e],n.size)}break;case o.Symbol3DLayerType.icon:switch(t.type){case o.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)this._createBillBoard(n,i[e][t]);break;case o.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)for(let r=0;r<i[e][t].length;r++)this._createBillBoard(n,i[e][t][r])}break;case o.Symbol3DLayerType.object:switch(t.type){case o.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length-1;t++)this._createObject(n,i[e][t]);break;case o.GeometryType.multiPolygon:i=this._getPositions()}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:Cesium.ArcType.NONE}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const o=Dl(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1,classificationType:o})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let n=void 0;switch(i.type){case o.MaterialType.color:default:switch(t.style){case"dash":case"dash-dot":case"dot":case"long-dash":case"long-dash-dot":case"long-dash-dot-dot":case"short-dash":case"short-dash-dot":case"short-dash-dot-dot":return n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:n,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case o.LineMarkerStyle.arrow:n=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else n=Fl(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:n,renderState:{depthTest:{enabled:!0}}})}}}_createLine(e,t){const i=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(e,t));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._primitives.push(i)}_createPolygon(e,t,i){const r=this._primitivesCollection.add(this._createFillSymbol3DLayerPrimitive(e,t,i));r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createFillSymbol3DLayerPrimitive(e,t,i){const n=e.material,a=[];for(let e=1;e<t.length;e++)a.push(new Cesium.PolygonHierarchy(t[e]));let s;s=i?new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],a),perPositionHeight:!0,height:i,extrudedHeight:i}):new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],a),perPositionHeight:!0});const l=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(n.color,this._layerOpacity)}),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===o.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(n.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,shadows:r.getShadows(e)});else{const t=Dl(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(n.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,classificationType:t,shadows:r.getShadows(e)})}return h=this._primitivesCollection.add(h)}_createIconSymbol3dLayerPrimitive(e,t){const i=e.material;return{position:t,image:e.resource.href,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),width:e.size,height:e.size,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}_createBillBoard(e,t){const i=this._billboardsCollection.add(this._createIconSymbol3dLayerPrimitive(e,t));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._billboards.push(i)}_createObject(e,t){const i=e.resource;let r;if(i.href)r=this._primitivesCollection.add(this._createModelPrimitive(e,t));else{let o;switch(i.primitive){case"sphere":r=this._primitivesCollection.add(this._createSpherePrimitive(e,t));break;case"cylinder":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:o,bottomRadius:o}));break;case"cone":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:o}));break;case"inverted-cone":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:o,bottomRadius:0}));break;case"tetrahedron":o=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:o,slices:3}))}}r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createSpherePrimitive(e,t){const i=e.material,r=new Cesium.EllipsoidGeometry({radii:new Cesium.Cartesian3(e.width,e.height,e.depth),innerRadii:new Cesium.Cartesian3(e.width,e.height,e.depth)}),o=Cesium.Transforms.eastNorthUpToFixedFrame(t);return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,modelMatrix:o,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createCylinderPrimitive(e,t,i){i=Object(o.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128});const r=e.material,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),a=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,modelMatrix:n,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createModelPrimitive(e,t){const i=e.material,r=Cesium.Transforms.eastNorthUpToFixedFrame(t),o={show:this.show,url:e.resource.href,shadows:e.castShadows,scale:1e3,color:this._getCesiumColorByOpacity(i.color,this._layerOpacity),modelMatrix:r,asynchronous:!1};return Cesium.Model.fromGltf(o)}_createObject3DAppearance(e){const t=e.material;switch(t.type){case o.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(t.color,this._layerOpacity)})})}}};var fh=class extends Wl{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof o.PointSymbol3D||(o.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const n=e.items[r];switch(t.type){case o.GeometryType.point:i=this._getPositions(),this._createPointSymbol3D(n,i[0]);break;case o.GeometryType.multiPoint:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPointSymbol3D(n,i[e])}}}_createPointSymbol3D(e,t){switch(e.type){case o.Symbol3DLayerType.icon:default:this._createBillboard(e,t);break;case o.Symbol3DLayerType.text:this._createLabel(e,t);break;case o.Symbol3DLayerType.object:this._createObject(e,t)}}_createBillboard(e,t){let i;const n=e.resource;if(n.href)i=this._billboardsCollection.add(r.createBillboard(e,t,{image:n.href,show:this.show,layerOpacity:this._layerOpacity}));else{const a=new o.SimpleMarkerSymbol({style:n.primitive,size:e.size,color:e.material.color,outline:new o.SimpleLineSymbol({color:e.outline.color,width:e.outline.size})}),s=Object(o.createSimpleMarkerSymbolCanvas)(a);i=this._billboardsCollection.add(r.createBillboard(e,t,{image:s,show:this.show,layerOpacity:this._layerOpacity}))}i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._billboards.push(i)}_createLabel(e,t){const i=this._labelsCollection.add(r.createLabel(e,t,{show:this.show,layerOpacity:this._layerOpacity}));i.id=this._feature.id,i.commonFeatureId=this._feature.id,i.commonLayerId=this.commonLayerId,this._labels.push(i)}_createObject(e,t){const i={show:this.show,layerOpacity:this._layerOpacity},o=e.resource;let n;if(o.href)n=this._primitivesCollection.add(r.createModelPrimitive(e,t,i));else{let a;switch(o.primitive){case"sphere":n=this._primitivesCollection.add(r.createSpherePrimitive(e,t,{show:this.show,layerOpacity:this._layerOpacity}));break;case"cylinder":a=e.width>e.height?e.width:e.height,i.topRadius=a,i.bottomRadius=a,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i));break;case"cone":a=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=a,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i));break;case"inverted-cone":a=e.width>e.height?e.width:e.height,i.topRadius=a,i.bottomRadius=0,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i));break;case"tetrahedron":a=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=a,i.slices=3,n=this._primitivesCollection.add(r.createCylinderPrimitive(e,t,i))}}n.id=this._feature.id,n.commonFeatureId=this._feature.id,n.commonLayerId=this.commonLayerId,this._primitives.push(n)}};var yh=class extends o.BaseGraphicsLayerView{onAdd(e){const t=this.layer,i=this.innerView,r=t.graphics||[];this.innerLayer=new hh({id:t.id,viewer:i,opacity:this.layer.opacity,elevationInfo:t.elevationInfo});const o=this._projectFeatures(r);return this.render.drawFeature(this.innerLayer,o),Promise.resolve(this)}onRemove(e){return this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(e=>{if(e&&"property"===e.operationType)switch(e.name){case"opacity":{const i=e.params;t.setOpacity(i[0]);break}case"visible":{const i=e.params;t.setVisible(i[0]);break}}if(e&&"method"===e.operationType)switch(e.name){case"add":{const i=e.params,r=this._projectFeatures([i[0]]);this.render.drawFeature(t,r);break}case"remove":{const i=e.params;t.remove(i[0]);break}case"addMany":{const i=e.params,r=this._projectFeatures(i[0]);this.render.drawFeature(t,r);break}case"removeMany":e.params[0].forEach(e=>{t.remove(e)});break;case"removeAll":t.removeAll()}}),Promise.resolve(this)}_projectFeatures(e){const t=[];if(e instanceof o.FeatureSet)for(let i=0;i<e.features.length;i++)t.push(this._projectFeature(e.features[i]));else if(e instanceof o.FeatureCollection)e.forEach(e=>{t.push(this._projectFeature(e))});else for(let i=0;i<e.length;i++)t.push(this._projectFeature(e[i]));return t}_projectFeature(e){const t=o.Feature.fromJSON(e);return t.geometry.spatialReference.isGeographic||(t.geometry=o.Projection.project(t.geometry,new o.SpatialReference({wkid:4326}))),t}};function mh(e,t){return e.length>2?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]+t):Cesium.Cartesian3.fromDegrees(e[0],e[1],t)}function gh(e,t,i,r){const o=[];for(let n,a=0,s=e.length;a<s;a++)n=t?gh(e[a],t-1,i,r):(i||mh)(e[a],r),o.push(n);return o}function vh(e,t){return"4326"!==String(e.wkid)?(t.spatialReference=e,o.Projection.project(t,new o.SpatialReference("EPSG:4326"))):t}var bh=class{static toCartesian3Array(e,t){let i=[];const r=Object(o.defaultValue)(t,{}),n=Object(o.defaultValue)(r.offsetHeight,0);if(!(e instanceof o.Geometry))return i;let a=Object(o.defaultValue)(r.spatialReference,new o.SpatialReference("EPSG:4326"));switch(e.spatialReference&&(a=e.spatialReference),e.type){case o.GeometryType.point:{let t=e.clone();const r=(t=vh(a,t)).coordinates;i.push(mh(r,n));break}case o.GeometryType.multiPoint:case o.GeometryType.lineString:{let t=e.clone();i=gh((t=vh(a,t)).coordinates,0,mh,n);break}case o.GeometryType.multiLineString:case o.GeometryType.polygon:{let t=e.clone();i=gh((t=vh(a,t)).coordinates,1,mh,n);break}case o.GeometryType.multiPolygon:{let t=e.clone();i=gh((t=vh(a,t)).coordinates,2,mh,n);break}case o.GeometryType.extent:{let t=e.clone();const r=(t=vh(a,t)).xmin,o=t.xmax,s=t.ymin,l=t.ymax,h=t.zmin,c=t.zmax;let u,p;t.hasZ?(u=Cesium.Cartesian3.fromDegrees(r,s,h+n),p=Cesium.Cartesian3.fromDegrees(o,l,c+n)):(u=Cesium.Cartesian3.fromDegrees(r,s,n),p=Cesium.Cartesian3.fromDegrees(o,l,n)),i.push(u),i.push(p);break}case o.GeometryType.circle:{let t,r=e.clone();const o=(r=vh(a,r)).center;t=r.hasZ?Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]+n):Cesium.Cartesian3.fromDegrees(o[0],o[1],n),i.push(t);break}}return i}};function _h(e){let t,i,r,o,n=0;const a=e,s=[];for(t=1;t<a.length;t++)i=a[t],r=a[t-1],n+=o=Cesium.Cartesian3.distance(i,r),s.push(o);this.lenArr=s,this.len=n,this.coords=a}_h.prototype.getTotalLength=function(){return this.len},_h.prototype.getDetail=function(e){let t,i,r=e;r>=1&&(r=1),r<=0&&(r=0);const o=r*this.len;let n,a=0;const s=this.coords;for(n=0;n<this.lenArr.length;n++){if(o<=this.lenArr[n]+a){t=n,i=(o-a)/this.lenArr[n];break}a+=this.lenArr[n]}const l=new Cesium.Cartesian3;return Cesium.Cartesian3.lerp(s[t],s[t+1],i,l),{position:l,angle:180*window.Math.atan2(s[t+1].y-s[t].y,s[t+1].x-s[t].x)/window.Math.PI}},_h.prototype.getPartsByLength=function(e){const t=window.Math.round(e/this.len*1e3)/1e3,i=window.Math.ceil(this.len/e),r=[];if(1===i)r.push({startRate:0,endRate:1});else{let e;for(e=1;e<i;e++)r.push({startRate:(e-1)*t,endRate:e*t})}return r};var wh=_h;const xh=bh.toCartesian3Array;function Ch(e,t){const{symbol:i}=t,r=Zl.a.convertTextSymbolToLabelNoteStyle(i).symbol,o=Object.assign({},t,{symbol:r});return Cesium.DynamicLabelsUtil.parseNoteOptions(e,o)}function kh(e){return e instanceof Cesium.LabelCollection?Cesium.DynamicLabelsUtil.createLabelOptions:e instanceof Cesium.BillboardCollection?Cesium.DynamicLabelsUtil.createNoteBillBoardOptions:Cesium.DynamicLabelsUtil.createGroundOptions}function Mh(e,t,i,r,o,n,a){const s=function(e,t,i,r,o){let n=o-r;(n<=0||n>=1)&&(n=.4);const a=t-e,s=n*a;return{spaceRate:r*a+e,parseRate:Math.round(s/i*1e3)/1e3}}(i,r,o.length,a.repeatStartRate,a.repeatEndRate);for(let i=0;i<o.length;i++){const r=e.getDetail(s.spaceRate+s.parseRate*i),l=kh(t)(n,o[i],r.position,a);t.add(l)}}function Sh(e){const t=o.T.bbox(e),i=Math.PI,r=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[3]/180*i)),n=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[1]/180*i)),a=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[2]/180*i,t[3]/180*i));let s;return function(e,t,i,r,n,a,s){const l=o.T.lineSegment(t),h=0===e,c=h?(n-r)/i:(s-a)/i,u=[];let p,d;for(p=0;p<i;p++){const e=h?o.T.lineString([[r+p*c,s],[r+p*c,a]]):o.T.lineString([[n,s-p*c],[r,s-p*c]]),t=o.T.lineIntersect(e,l),i=t.features.length,f=[];let y;if(!(i<1)){for(d=0;d<i;d++)f.push(o.T.getCoord(t.features[d]));if(1===i)y=f[0],u.push(y);else{let e=0;for(let t=0;t<i;t+=2){const i=f[t],r=f[t+1];let o;h?(o=Math.abs(r[1]-i[1]))>=e&&(e=o,y=[i[0],(r[1]-i[1])/2+i[1]]):(o=Math.abs(r[0]-i[0]))>=e&&(e=o,y=[i[0]+(r[0]-i[0])/2,i[1]])}u.push(y)}}}return u}(s=Cesium.Cartesian3.distance(r,a)>Cesium.Cartesian3.distance(r,n)?0:1,e,20,t[0],t[2],t[1],t[3])}var Th=class{static renderLabel(e,t,i){if(t=t||[],!Array.isArray(t)||t.length<=0)return;const r=t[0].geometry.type;let n;n=[o.GeometryType.multiPolygon,o.GeometryType.polygon].some(e=>e===r)?Ch("Polygon",i):[o.GeometryType.lineString,o.GeometryType.multiLineString].some(e=>e===r)?Ch("Line",i):Ch("Point",i);const{currentAttributeName:a,labelExpression:s}=i,l=a?`$feature.${a}`:s;if(!l)return;const h=kh(e);t.forEach(t=>{const i=t.geometry,r=i.type;let a=xh(i);const s=Zl.a.parseExpression(t,l),c=t.id;if(s)switch(r){case o.GeometryType.point:case o.GeometryType.multiPoint:a.forEach(t=>{e.add(h(c,s,t,n))});break;case o.GeometryType.multiLineString:case o.GeometryType.lineString:r===o.GeometryType.lineString&&(a=[a]),a.forEach(t=>{let i=n.lineLabelSpread;const r=n.repeatLabel,o=n.repeatLabelDistance,a=n.labelPositionAlong;if(!s)return;let l;const u=new wh(t);if("auto-spread"===i&&(i=new RegExp("^[A-Za-z0-9]+$").test(s)?"centralization-spread":"decentralize-spread"),"decentralize-spread"===i){const t=s.split("");r?u.getPartsByLength(o).forEach(function(i){const r=i.startRate,o=i.endRate;Mh(u,e,r,o,t,c,n)}):Mh(u,e,0,1,t,c,n)}else"centralization-spread"===i&&(r?u.getPartsByLength(o).forEach(function(t){const i=t.startRate,r=t.endRate;"start"===a?(l=u.getDetail(i).position,e.add(h(c,s,l,n))):"end"===a?(l=u.getDetail(r).position,e.add(h(c,s,l,n))):(l=u.getDetail((r-i)/2+i).position,e.add(h(c,s,l,n)))}):"start"===a?(l=u.getDetail(0).position,e.add(h(c,s,l,n))):"end"===a?(l=u.getDetail(1).position,e.add(h(c,s,l,n))):(l=u.getDetail(.5).position,e.add(h(c,s,l,n))))});break;case o.GeometryType.multiPolygon:case o.GeometryType.polygon:r===o.GeometryType.polygon&&(a=[a]),a.forEach(t=>{t.forEach(t=>{const i=n.type,r=function(e){if(!e||0===e.length)return null;const t=e.length;let i;const r=[];let o,n;for(i=0;i<t;i++){const t=Cesium.Cartographic.fromCartesian(e[i]);r.push([180*t.longitude/Math.PI,180*t.latitude/Math.PI]),0===i&&(o=t.height,n=t.height),o=Math.max(o,t.height),n=Math.min(n,t.height)}return{latlngArr:r,maxHeight:o,minHeight:n}}(t),a=r.maxHeight,l=r.minHeight,u=o.T.polygon([r.latlngArr]),p=o.T.getCoord(o.T.centroid(u));let d=new Cesium.Cartesian3;if("parallel"===i)d=Cesium.Cartesian3.fromDegrees(p[0],p[1],(a+l)/2),e.add(h(c,s,d,n));else if("outside"===i||"bottom"===i){const t=o.T.bbox(u),r=o.T.lineSegment(u),p=[t[0],t[1]],f=[t[2],t[3]],y=o.T.lineString([f,p]),m=o.T.lineIntersect(y,r);let g;if(0===m.features.length)g="outside"===i?f:p;else{const e="outside"===i?f:p;g=o.T.getCoord(o.T.nearestPoint(o.T.point(e),m))}n.positionOffsetXRate=1,n.positionOffsetYRate=1,d=Cesium.Cartesian3.fromDegrees(g[0],g[1],(a+l)/2),e.add(h(c,s,d,n))}else if("straight"===i||"skeleton"===i){const t=Sh(u);if(t.length<2)return;const r=[],o=s.split("");t.forEach(function(e){r.push(Cesium.Cartographic.toCartesian(new Cesium.Cartographic(e[0]/180*Math.PI,e[1]/180*Math.PI,0)))});const a=new wh(r);if("skeleton"===i)Mh(a,e,n.skeletonLineStartRate,n.skeletonLineEndRate,o,c,n);else{const t=a.getDetail(.5);e.add(h(c,s,t.position,n))}}})})}})}};class Lh extends o.BaseFeatureLayerView{constructor(e){super(e),this._labelClass=null,this._dynamicEntityVisualizer=null,this.dynamicLabelCollection=null,Lh.dynamicEntityVisualizer||(Lh.dynamicEntityVisualizer=new Cesium.DynamicEntityVisualizer(this.innerView.scene))}_processData(){return new Promise(e=>{e()})}onAdd(e){const t=this,i=this.innerView,r=this.layer,n=this.layer.renderer;return this._processData().then(e=>new Promise(a=>{if(t.innerLayer&&t.innerLayer.destroy(),t._initDynamicLabel(),n instanceof o.ClusterRenderer){t.innerLayer=new ch({id:r.id,viewer:i,renderer:n});const a=Object(o.getFeaturesFromFeatureSet)(e);for(let e=0;e<a.length;e++)a[e].symbol=o.Symbol.fromJSON(n.defaultSymbol.toJSON());for(let e=0;e<a.length;e++)t.innerLayer.add(a[e])}else if(n instanceof o.HeatmapRenderer)t.innerLayer=new uh({id:r.id,viewer:i,field:n.field,valueExpression:n.valueExpression,radius:n.radius,alpha:r.opacity,gradient:n.colorStops,minDataValue:n.minDataValue,maxDataValue:n.maxDataValue,features:Object(o.getFeaturesFromFeatureSet)(e)});else{if(t.innerLayer=new hh({id:r.id,viewer:i,opacity:t.layer.opacity,elevationInfo:t.layer.elevationInfo}),e.features.length>0&&!e.features[0].geometry.spatialReference.isGeographic)for(let t=0;t<e.features.length;t++)e.features[t].geometry=o.Projection.project(e.features[t].geometry,new o.SpatialReference({wkid:4326}));t._initFeatures(e,n)}a(t)}))}_initDynamicLabel(){const{innerView:e}=this,{labelingInfo:t,labelsVisible:i}=this.layer;if(!i||!t||!Array.isArray(t)||t.length<=0)return;const r=t[0];if(!r)return;this._labelClass=r;const{renderMode:o,deconflictionStrategy:n="static"}=r;let a;switch(o){case"label":a=new Cesium.LabelCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e.scene});break;case"ground":a=new Cesium.PrimitiveCollection;break;default:a=new Cesium.BillboardCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e.scene})}"static"===n?(this._dynamicEntityVisualizer=Lh.dynamicEntityVisualizer,this.dynamicLabelCollection=this._dynamicEntityVisualizer.add(a)):this.dynamicLabelCollection=e.scene.primitives.add(a)}_renderDynamicLabel(e,t,i){i&&Th.renderLabel(e,t,i)}_onFeatureSetCacheChange(e){super._onFeatureSetCacheChange(e);const{added:t=[],removed:i=[]}=e;Array.isArray(t)&&this._renderDynamicLabel(this.dynamicLabelCollection,t,this._labelClass)}_removeDynamicLabel(){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.remove(this.dynamicLabelCollection):this.innerView&&this.innerView.scene.primitives.remove(this.dynamicLabelCollection),this.dynamicLabelCollection=null}_setDynamicLabelVisibleOrOpacity(e,t){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.show=e:this.dynamicLabelCollection&&(this.dynamicLabelCollection.show=e)}onRemove(e){return this._removeDynamicLabel(),this.innerLayer.destroy(),this.innerLayer=null,Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return e.updateContent&&t&&e.updateContent.forEach(i=>{if(i&&"property"===i.operationType)switch(i.name){case"opacity":{const e=i.params;t.setOpacity(e[0]),this._setDynamicLabelVisibleOrOpacity(this.layer.visible&&this.layer.labelsVisible,this.layer.opacity);break}case"visible":{const e=i.params;this._setDynamicLabelVisibleOrOpacity(this.layer.visible&&this.layer.labelsVisible,this.layer.opacity),t.setVisible(e[0]);break}case"renderer":this.onAdd(e)}if(i&&"method"===i.operationType)switch(i.name){case"refresh":this.onAdd(e)}}),Promise.resolve(this)}}var Ih=Lh;var Eh=class extends Ih{_processData(){const e=this.layer,t=e._createQueryOption();return t.resultRecordCount=1e5,e.queryFeatures(t).then(e=>e)}onAdd(e){const t=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){let e;e=i.spatialReference?xi(i.spatialReference,i.extent):new Cesium.GeographicTilingScheme({rectangle:Cesium.Rectangle.fromDegrees(-180,-90,180,90),ellipsoid:Cesium.Ellipsoid.WGS84,numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1});const n=i.url,a=Object(o.getBaseUrl)(n);let s;return s="1.0"===i._igsVersion?{url:`${a}/igs/rest/mrms/layers`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""}:{url:`${a}/igs/rest/services/system/ResourceServer/tempData`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""},this.innerLayer=r.imageryLayers.addImageryProvider(new Cesium.MapGISMapServerImageryProvider(s)),Promise.resolve(t)}return super.onAdd(e)}onRemove(e){const t=this;return this.layer.gdbp?(this.innerView.imageryLayers.remove(this.innerLayer),Promise.resolve(t)):super.onRemove(e)}};var Oh=class extends Ih{_processData(){return this.layer.queryFeatures()}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var Ph=class extends Ih{_processData(){return this.layer.queryFeatures().then(e=>e)}onUpdate(e){let t=!1;return e.updateContent&&this.innerLayer&&e.updateContent.forEach(i=>{i&&"property"===i.operationType&&("renderer"===i.name?(super.onRemove(e),super.onAdd(e)):t=!0)}),t&&super.onUpdate(e),Promise.resolve(this)}};var jh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=rl.addTDTLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return rl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=this.layer.visible;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"layerType":rl.removeLayer(this.innerLayer,this.innerView),this.innerLayer=rl.addTDTLayer(this.layer,this.innerView);break;case"index":pl(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Ah=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{qi.addM3DLayer(t,i,this.view,t=>{r.innerLayer=t,e(r)})})}onRemove(e){return qi.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return bl.applyUpdate(this.view,this.layer,t,e),Promise.resolve(this)}};var Rh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=nl.addArcGISMapImageLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return nl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};class zh{}zh.addArcGISTileLayer=function(e,t){const i=xi(e.spatialReference,e.extent,e.tileInfo),r=ki(e,i.rectangle),o={url:`${e.url}/tile/{z}/{y}/{x}`,tilingScheme:i,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,rectangle:Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax)},n=new Cesium.UrlTemplateImageryProvider(o),a=Ci(e,t);return t.imageryLayers.addImageryProvider(n,a),n.id=e.id,n._realIndex=e._realIndex+1,n},zh.removeLayer=function(e,t){t.imageryLayers.remove(e)};var Dh=zh;var Fh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=Dh.addArcGISTileLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return Dh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Nh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this,n=xi(t.spatialReference,t.extent,t.tileInfo),a=ki(t,n.rectangle);a.spatialReference=new o.SpatialReference("EPSG:4326");const s=Cesium.Rectangle(a.xmin,a.ymin,a.xmax,a.ymax);return new Promise(e=>{const o=Array.isArray(t.labelingInfo)&&t.labelingInfo.length>0?t.labelingInfo[0]:void 0;r.innerLayer=new Ws(i,{tilingScheme:n,rectangle:s,wgs84Extent:a,labelsRenderMode:t.labelsRenderMode,labelsNoteStyle:o,style:t.style,addCallback(){e(r)}}),r.innerLayer.id=t.id})}onRemove(e){return this.innerLayer.remove(),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;if(e.updateContent)for(let i=0;i<e.updateContent.length;i++){const r=e.updateContent[i],o=r.params;if(r)switch(r.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":case"setStyleLayerFilter":case"setStyleLayerZoomRange":t.updateStyle(this.layer.style);break;case"opacity":t.setOpacity(o[0]);break;case"visible":t.setVisible(o[0]);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer.provider,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;default:t.updateStyle(this.layer.style)}}return Promise.resolve(this)}};var Gh=class extends o.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this.view._map.layers.items,o=ul(r,t),n=this;return new Promise(e=>{const a=setInterval(function(){"loaded"===r[o].loadStatus&&(n.innerLayer=sl.addWebTileLayer(t,i),clearInterval(a),e(n))},1)})}onRemove(e){return sl.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":this.innerLayer.show=!this.innerLayer.show;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":pl(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?Oi(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":sl.removeLayer(this.innerLayer,this.innerView),self.innerLayer=sl.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var Vh=class extends o.FeatureRender{drawFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.add(t[i])}updateFeature(e,t,i){if(e)for(let i=0;i<t.length;i++)e.update(t[i])}clearFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.remove(t[i])}clear(e){e&&e.removeAll()}};function Bh(e,t){let i=null;switch(t.type){case o.LayerType.igsVectorTile:i=new ll({view:e,layer:t});break;case o.LayerType.wmts:i=new ml({view:e,layer:t});break;case o.LayerType.igsMapImage:i=new vl({view:e,layer:t});break;case o.LayerType.igsTile:i=new gl({view:e,layer:t});break;case o.LayerType.wms:i=new dl({view:e,layer:t});break;case o.LayerType.m3d:i=new _l({view:e,layer:t});break;case o.LayerType.cesium3DTiles:i=new wl({view:e,layer:t});break;case o.LayerType.scene:i=new xl({view:e,layer:t});break;case o.LayerType.terrain:i=new Cl({view:e,layer:t});break;case o.LayerType.echarts:i=new El({view:e,layer:t});break;case o.LayerType.mapv:i=new Ol({view:e,layer:t});break;case o.LayerType.group:i=new Al({view:e,layer:t});break;case o.LayerType.graphics:i=new yh({view:e,layer:t,render:new Vh});break;case o.LayerType.igsFeature:i=new Eh({view:e,layer:t,render:new Vh});break;case o.LayerType.geojson:i=new Oh({view:e,layer:t,render:new Vh});break;case o.LayerType.wfs:i=new Ph({view:e,layer:t,render:new Vh});break;case o.LayerType.tdt:i=new jh({view:e,layer:t});break;case o.LayerType.m3dCache:i=new Ah({view:e,layer:t});break;case o.LayerType.arcgisMapImage:i=new Rh({view:e,layer:t});break;case o.LayerType.arcgisTile:i=new Fh({view:e,layer:t});break;case o.LayerType.arcgisVectorTile:i=new Nh({view:e,layer:t});break;case o.LayerType.webTileLayer:i=new Gh({view:e,layer:t})}return i}var qh=class extends o.Evented{constructor(e){super(e),e=Object(o.defaultValue)(e,{}),this.view=Object(o.defaultValue)(e.view,""),this.location=Object(o.defaultValue)(e.location,""),this.title=Object(o.defaultValue)(e.title,""),this.content=Object(o.defaultValue)(e.content,""),this.alignment=Object(o.defaultValue)(e.alignment,"bottom-center"),this.defaultButtons=Object(o.defaultValue)(e.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initDefaultClass()}open(e){this._popup?(this.close(),this._popup=void 0,this.openPopup(e)):this.openPopup(e)}openPopup(e){if(e.view){const t=e.view._innerView;this.view&&e.view.id===this.view.id?this._popupLayer||(this._popupLayer=new Cesium.GraphicsLayer(t,{})):(this.view=e.view,this._popupLayer&&this.view._innerView.remove(this._popupLayer),this._popupLayer=new Cesium.GraphicsLayer(t,{}))}else if(!this._popupLayer){if(!this.view)return;this._popupLayer=new Cesium.GraphicsLayer(this.view._innerView,{})}this.location=e.location?e.location:this.location,this.title=e.title?e.title:this.title,this.content=e.content?e.content:this.content,this.alignment=e.alignment?e.alignment:this.alignment;const t=this.location.coordinates[0],i=this.location.coordinates[1],r=this._initDefaultUI(this.title,this.content);r.style.display="block";const o=new Cesium.Graphic({type:"div",positions:[Cesium.Cartesian3.fromDegrees(t,i,0)],style:{html:r}});this._popup=this._popupLayer.addGraphic(o),this._popup.style.pixelOffset=this._getOffset()}_contentUI(e,t){const i=this;let r=void 0;const o=function(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes};(r=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const n=document.createElement("div");n.setAttribute("class","zondy-popup__header"),n.setAttribute("style","display: flex;");const a=o('<div class="zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],s=o('<div class="zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(e){const t=o('<div style="flex: 1;"></div>')[0];if(n.appendChild(t),"object"==typeof e?e instanceof Node?t.appendChild(e):e instanceof NodeList&&e.forEach(e=>{t.appendChild(e)}):t.innerHTML=e,this.defaultButtons.indexOf("toggle")>-1){n.appendChild(a);let e=!0;a.onclick=function(){e=!e,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=e?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(n.appendChild(s),s.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content"),t)if("object"==typeof t){if(t instanceof Node)l.appendChild(t);else if(t instanceof NodeList)for(let e=0;e<t.length;e++)l.appendChild(t[e]),e--}else l.innerHTML=t;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer");const c=o('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(c),c.onclick=function(){i.view._setZoomAndCenter({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer zondy-popup__footer-division"),r.appendChild(n),r.appendChild(l),r.appendChild(h),r}_initDefaultUI(e,t){const i=document.createElement("div");i.setAttribute("class","zondy-popup");const r=document.createElement("div");r.setAttribute("class","zondy-popup__container");const o=this._contentUI(e,t);r.appendChild(o),i.appendChild(r);const n=document.createElement("div");return n.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),n.innerHTML="<div class='zondy-popup__tip' style='width: 17px;height: 17px;padding: 1px;margin: -10px auto 0;pointer-events: auto;transform: rotate(45deg);'>\n </div>",i.appendChild(n),i}_initDefaultClass(){let e=!1;const t=document.head.getElementsByTagName("style");if(t)for(let i=0;i<t.length;i++)if(t[i].innerHTML.indexOf("styleDomString")>-1){e=!0;break}if(!e){const e=document.createElement("style");e.innerHTML="\n .zondy-popup__container{background-color: #fff;padding:0;border-radius: 10px;}\n .zondy-popup__tip{\n background-color: #fff;\n }\n .zondy-popup__header{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n white-space: nowrap;\n }\n .zondy-popup__content{\n padding: 8px;\n }\n .zondy-popup__footer{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle,.zondy-popup__close{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(e)}}_getOffset(){let e=null;if(this._popup&&this._popup.style&&this._popup.style.html&&this.alignment){const t=this._popup.style.html.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,t.width,t.height);e=new L.Point(i.x,i.y)}return e}_getOffsetByAlignment(e,t,i){let r=0,o=0;switch(e){case"top-left":o=-i;break;case"top-center":r=-t/2,o=-i;break;case"top-right":r=-t,o=-i;break;case"bottom-left":break;case"auto":case"bottom-center":r=-t/2;break;case"bottom-right":r=-t}return{x:r,y:o}}close(){this._popup.remove()}destroy(){this._popupLayer&&this.view._innerView.remove(this._popupLayer)}};var Uh=class{constructor(e){e=Object(o.defaultValue)(e,{}),this.view=Object(o.defaultValue)(e.view,null),this.format=Object(o.defaultValue)(e.format,o.PictureFormat.png),this.filename=Object(o.defaultValue)(e.filename,"screenshotFile"),this.width=Object(o.defaultValue)(e.width,void 0),this.height=Object(o.defaultValue)(e.height,void 0),this.x=Object(o.defaultValue)(e.x,0),this.y=Object(o.defaultValue)(e.y,0),this.isDownload=Object(o.defaultValue)(e.isDownload,!0)}_addView(){const e=this;this.view._innerView.render();const t=this.view._innerView.canvas;let i=null;this.format===o.PictureFormat.png?i=t.toDataURL():this.format===o.PictureFormat.jpeg?i=t.toDataURL("image/jpeg"):"svg"===this.format&&(i=t.toDataURL());const r=document.createElement("canvas");r.width=this.width,r.height=this.height;const n=r.getContext("2d"),a=function(e,t){const i=document.createElement("a");i.href=e,i.download=t,document.body.appendChild(i),i.click()};return new Promise(t=>{if(this.width&&this.height){const s=new Image;s.src=i,s.onload=function(){n.drawImage(s,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let i=null;e.format===o.PictureFormat.png?i=r.toDataURL():e.format===o.PictureFormat.jpeg?i=r.toDataURL("image/jpeg"):"svg"===e.format&&(i=r.toDataURL()),e.isDownload&&a(i,e.filename),t({dataUrl:i})}}else e.isDownload&&a(i,this.filename),t({dataUrl:i})})}_removeView(){}};class Wh extends o.BaseView{constructor(e){super(e),e=Object(o.defaultValue)(e,{}),this._center=Object(o.defaultValue)(e.center,new o.Point({coordinates:[0,0]})),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new o.Point({coordinates:[this._center[0],this._center[1],this._center[2]]})),this._scale=Object(o.defaultValue)(e.scale,void 0),this._zoom=Object(o.defaultValue)(e.zoom,3),this.minZoom=Object(o.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(o.defaultValue)(e.maxZoom,void 0),this._extent=Object(o.defaultValue)(e.extent,void 0),this.width=void 0,this.height=void 0,this._spatialReference=new o.SpatialReference("EPSG:4326"),this.popup=Object(o.defaultValue)(e.popup,void 0),this.stationary=!0,this.extendOptions=Object(o.defaultValue)(e.extendOptions,{}),this._innerView=new Cesium.Viewer(this._viewId,this.extendOptions),this._layersMap=new Cesium.HashMap,Cesium.Config(o.Config),this._initSize(),this._extent?this._initExtent():(this._initScale(),this._initZoom()),this._initViewEvent(),this._initPopup(),this._map._initCesiumView=!0}_initViewEvent(){const e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(o.ViewEventType.click,Di.getMouseEvent(t,e))},300),e.fire(o.ViewEventType.immediateClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(o.ViewEventType.click,Di.getMouseEvent(t,e))},300),e.fire(o.ViewEventType.immediateClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(o.ViewEventType.click,Di.getMouseEvent(t,e))},300),e.fire(o.ViewEventType.immediateClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._clickStore&&(clearTimeout(e._clickStore),e._clickStore=null),e.fire(o.ViewEventType.doubleClick,Di.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerDown,Di.getMouseEvent(t,e)),this._dragParams.isDrag||(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.LEFT_DOWN),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerUp,Di.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.LEFT_UP),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerDown,Di.getMouseEvent(t,e)),this._dragParams.isDrag||(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerUp,Di.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.RIGHT_UP),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerDown,Di.getMouseEvent(t,e)),this._dragParams.isDrag||(this._dragParams.origin={x:t.originalEvent.layerX,y:t.originalEvent.layerY},this._dragParams.button=t.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)},Cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e.fire(o.ViewEventType.pointerUp,Di.getMouseEvent(t,e)),e._dragParams.isDrag&&(this._dragParams.action="end",e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action)),e._dragParams={isDrag:!1,origin:null,action:"",button:null})},Cesium.ScreenSpaceEventType.MIDDLE_UP),this._innerView.screenSpaceEventHandler.setInputAction(t=>{t.position=t.endPosition,e.fire(o.ViewEventType.pointerMove,Di.getMouseEvent(t,e)),e._dragParams.isDrag?(e.fire(o.ViewEventType.drag,Di.getDragEvent(t,e,e._dragParams.origin,e._dragParams.action,e._dragParams.button)),e._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",e._dragParams.isDrag=!0)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._innerView.screenSpaceEventHandler.setInputAction(t=>{e._map.layers.forEach(function(t){switch(t.type){case o.LayerType.igsFeature:case o.LayerType.graphics:Object(o.showLayerByScale)(e,t)}}),e.fire(o.ViewEventType.wheel,{})},Cesium.ScreenSpaceEventType.WHEEL),this._innerView.camera.moveEnd.addEventListener(t=>{e._mouseMoveHandler(),e.fire(o.ViewEventType.viewChange,Di.getViewChangeEvent(t,e))}),this._innerView.camera.moveStart.addEventListener(()=>{e.stationary=!1}),this._innerView.camera.moveEnd.addEventListener(()=>{e.stationary=!0}),this._listenResize(),this._listenKey()}_listenResize(){const e=this;this._lastSize=this.getSize(),new ResizeObserver(t=>{const i=t.length>0?{x:t[0].contentRect.width,y:t[0].contentRect.height}:{width:null,height:null};e.fire(o.ViewEventType.resize,{oldWidth:e._lastSize.x,oldHeight:e._lastSize.y,width:i.x,height:i.y}),this._lastSize=i}).observe(this._innerView._container)}_listenKey(){const e=this,t=this._innerView.canvas;t.setAttribute("tabIndex","-1"),t.onclick=(()=>{t.focus()}),t.addEventListener("keydown",t=>{e.fire(o.ViewEventType.keyDown,Di.getKeyEvent(t,e))}),t.addEventListener("keyup",t=>{e.fire(o.ViewEventType.keyUp,Di.getKeyEvent(t,e))})}_mapActionControl(e,t){"drag-pan"===e&&(this._innerView.scene.screenSpaceCameraController.enableRotate=t)}flyTo(e){e=Object(o.defaultValue)(e,{});const t=Object(o.defaultValue)(e.duration,2),i=Object(o.defaultValue)(e.orientation,void 0),r=Object(o.defaultValue)(e.complete,void 0),n=Object(o.defaultValue)(e.cancel,void 0),a=Object(o.defaultValue)(e.endTransform,void 0),s=Object(o.defaultValue)(e.maximumHeight,void 0),l=Object(o.defaultValue)(e.flyOverLongitude,void 0),h=Object(o.defaultValue)(e.flyOverLongitudeWeight,void 0),c=Object(o.defaultValue)(e.convert,void 0),u=Object(o.defaultValue)(e.easingFunction,void 0),p=this._getFlyToCenter(e),d=this._getFlyToExtent(e);Object(o.isNull)(p)?Object(o.isNull)(d)||this._innerView.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(d.xmin,d.ymin,d.xmax,d.ymax),duration:t,orientation:i,complete:r,cancel:n,endTransform:a,maximumHeight:s,flyOverLongitude:l,flyOverLongitudeWeight:h,convert:c,easingFunction:u}):this._innerView.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(p.coordinates[0],p.coordinates[1],p.coordinates[2]),duration:t,orientation:i,complete:r,cancel:n,endTransform:a,maximumHeight:s,flyOverLongitude:l,flyOverLongitudeWeight:h,convert:c,easingFunction:u})}_createLayerView(e){return Bh(this,e)||null}toJSON(){return{viewId:this._viewId,skyBox:this.skyBox,skyAtmosphere:this.skyAtmosphere,enableFPSWidget:this.enableFPSWidget,map:this._map?this._map.toJSON():[]}}toMap(e){let t=null;if(this._innerView.scene.globe.translucency.enabled||!this._innerView.scene.globe.depthTestAgainstTerrain){const i=this._innerView.camera.getPickRay(e);t=this._innerView.scene.globe.pick(i,this._innerView.scene)}else t=this._innerView.scene.pickPosition(e);let i=null;if(t&&!Object(o.isNull)(t)){const e=this._innerView.scene.globe.ellipsoid.cartesianToCartographic(t),r=Cesium.Math.toDegrees(e.longitude),n=Cesium.Math.toDegrees(e.latitude),a=e.height;i=new o.Point({coordinates:[r,n,a]})}else i=new o.Point({coordinates:[0,0,0]});return i}toScreen(e){const t=Cesium.Cartesian3.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]);return Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._innerView.scene,t)}getSize(){return{x:this._innerView._container.clientWidth,y:this._innerView._container.clientHeight}}getCenter(){const e=Cesium.Cartographic.fromCartesian(this._innerView.camera.position),t=Cesium.Math.toDegrees(e.longitude),i=Cesium.Math.toDegrees(e.latitude),r=e.height,n=new o.Point({coordinates:[t,i,r]});return this._center=n,n}setCenter(e){if(!this._innerView||!this._center)return;let t=!1;const i=this._center.coordinates[2];Array.isArray(e)&&e.length>1?(this._center=new o.Point({coordinates:[e[0],e[1],i]}),t=!0):e instanceof o.Point&&(this._center=new o.Point({coordinates:[e.coordinates[0],e.coordinates[1],i]}),t=!0),t&&this.flyTo({center:this._center})}getExtent(){if(!this._innerView)return;const e=this._innerView.camera.computeViewRectangle(),t=new o.Extent({xmin:e.west/Math.PI*180,ymin:e.south/Math.PI*180,xmax:e.east/Math.PI*180,ymax:e.north/Math.PI*180});return this._extent=t,t}setExtent(e){this._innerView&&(this._extent=e,this.flyTo({extent:e}))}getInnerLayer(e){if(e instanceof o.Layer)return super.getInnerLayer(e);if(e instanceof o.IGSSceneSubLayer){const t=super.getInnerLayer(e.layer);for(let i=0;i<t.length;i++)if(t[i]._layerIndex===e.layerIndex)return t[i]}}_initPopup(){this.popup=new qh({view:this})}hitTest(e){const t=[];return this._innerView.scene.drillPick({x:e.x,y:e.y}).forEach(i=>{if(i.primitive){const r=i.primitive,n=this.getLayer(r.commonLayerId);if(Object(o.isNull)(r.commonLayerId))return;let a=null;if(n.type===o.LayerType.igsFeature||n.type===o.LayerType.geojson){a=this._getLayerView(n)._featureSetCache.filter(e=>{if(e.id===r.commonFeatureId)return e})}else n.type===o.LayerType.graphics&&(a=n.graphics.filter(e=>{if(e.id===r.commonFeatureId)return e}));const s={graphic:a&&a.items.length>0?a.items[0]:null,layer:n,mapPoint:this.toMap(e),type:"graphic"};t.push(s)}}),t}_mouseMoveHandler(){this.getCenter(),this.getExtent(),this.getZoom(),this.getScale()}_initSize(){const e=this._innerView.canvas;this.width=e.width,this.height=e.height}_initScale(){if(this.scale&&this._center){const e=this.getZoomByScale(this.scale),t=this._getAltitudeByZoom(e);if(t){this.zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new o.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}}_initZoom(){if(!this.scale&&!Object(o.isNull)(this._zoom)&&this._center&&this._center.coordinates[2]){const e=this._getZoomByAltitude(this._center.coordinates[2]),t=this._getAltitudeByZoom(this._zoom);if(t){this._zoom=e,this.scale=this.getScaleByZoom(this.zoom);const i=this._center.coordinates[0],r=this._center.coordinates[1];this._center=new o.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}if(this.maxZoom){const e=this._getAltitudeByZoom(this.maxZoom);this._innerView.scene.screenSpaceCameraController.minimumZoomDistance=e}if(this.minZoom){const e=this._getAltitudeByZoom(this.minZoom);this._innerView.scene.screenSpaceCameraController.maximumZoomDistance=e}}_initExtent(){this.flyTo({extent:this._extent})}getZoom(){const e=this._getZoomByAltitude(this._center.coordinates[2]);this._zoom=e}setZoom(e){if(this._innerView&&!Object(o.isNull)(this._zoom)&&this._center){const t=this._getAltitudeByZoom(e);if(t){this._zoom=e;const i=this._center.coordinates[0],r=this._center.coordinates[1],n=new o.Point({coordinates:[i,r,t]});this.flyTo({center:n})}}}_setZoomAndCenter(e){if(this._innerView&&!Object(o.isNull)(e.zoom)&&!Object(o.isNull)(e.center)){const t=e.center.coordinates[0],i=e.center.coordinates[1],r=this._getAltitudeByZoom(e.zoom);if(r){this._zoom=e.zoom;const n=new o.Point({coordinates:[t,i,r]});this._center=n,this.flyTo({center:n})}}}getScale(){const e=this.getScaleByZoom(this._zoom);return this._scale=e,e}setScale(e){if(this._innerView&&this._scale&&this._center){this._scale=e;const t=this.getZoomByScale(e),i=this._getAltitudeByZoom(t);if(i){const e=this._center.coordinates[0],t=this._center.coordinates[1],r=new o.Point({coordinates:[e,t,i]});this.flyTo({center:r})}}}getZoomByScale(e){const t=e/(96/.0254);return Math.round(Math.log2(156543.03392804062/t))}getScaleByZoom(e){return 96/.0254*(156543.03392804062/Math.pow(2,e))}takeScreenshot(e){e.view=this;let t=null;return this._screenshot?t=this._screenshot._addView():(this._screenshot=new Uh(e),t=this._screenshot._addView()),t}_getZoomByAltitude(e){const t=-40467.74;return Math.round(t+80955.31/(1+Math.pow(e/91610.74,7096758e-11)))}_getAltitudeByZoom(e){const t=-40467.74;return 91610.74*Math.pow(80955.31/(e-t)-1,1/7096758e-11)}}Wh.fromJSON=function(e){return e=Object(o.defaultValue)(e,{}),new Wh(e)},Object.defineProperties(Wh.prototype,{scale:{get(){return this._scale},set(e){this.setScale(e)}},zoom:{get(){return this._zoom},set(e){this.setZoom(e)}},center:{get(){return this._center},set(e){this.setCenter(e)}},extent:{get(){return this._extent},set(e){this.setExtent(e)}},spatialReference:{get(){return this._spatialReference},set(e){this._spatialReference=e}}}),o.Zondy.PluginVersion="16.8.0",o.Zondy.SceneView=Wh;var Hh=Wh;class Yh extends o.SketchEditor3D{constructor(e){super(e)}addVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.addVertex(e,t)}updateVertex(e,t){return this._getHight&&(e.coordinates[2]=this._getHight()),this._drawTool.updateVertex(e,t)}removeVertex(e){return this._drawTool.removeVertex(e)}split(e,t){return super.split(e,t)}drawPolylineToPolygon(e){super.drawPolylineToPolygon(e)}_initLayerEvent(){}_hitTestSketchEvent(){const e=this;this.view.on(o.ViewEventType.mouseDown,t=>{if(!t||!t.x||!t.y)return;let i=void 0,r=!1;e._drawTool&&e._drawTool.sketchStage&&e._drawTool.sketchStage.selectBoxGraphics.length>0&&e.view._innerView.scene.drillPick({x:t.x,y:t.y}).forEach(o=>{if(o.primitive&&e.layer.id===o.primitive.commonLayerId&&e._drawTool.sketchStage.entityGraphic.id===o.primitive.commonFeatureId){const n=e.view._innerView.camera.getPickRay({x:t.x,y:t.y}),a=e.view._innerView.scene.pickFromRay(n,[o.primitive]);a&&a.object&&a.object.primitive&&(r=!0,i=a.object)}});if(r||(i=e.view._innerView.scene.pick({x:t.x,y:t.y})),i&&i.primitive&&e.layer.id===i.primitive.commonLayerId){let r=e._drawTool?e._drawTool._getDrawToolByFeatureId(i.primitive.commonFeatureId):void 0;if(!r&&(!e._drawTool||e._drawTool.sketchStage.entityGraphic&&"drawn"===e._drawTool.state)){const t=e.view.getLayer(i.primitive.commonLayerId).graphics.filter(e=>{if(e.id===i.primitive.commonFeatureId)return e});if(!(t&&t.items.length>0))return;{const i=t.items[0];e._drawTool&&e._drawTool._clearEditGraphics(e._drawTool._editMode),this._addFeatureToSketchEditor(i),e._undoRedoManager.reset(),e._drawTools=[e._drawTool],r=e._drawTool}}if(!r||r===e._drawTool&&"drawn"!==r.state)return;if(0===r.editOption._hitTestMode){const i=()=>{e._editable&&(void 0!==e._drawTool&&null!==e._drawTool&&3===e._drawTool._editMode||(r.hitTestFeature(r.sketchStage.entityGraphic,t),e.fire("selected",{isSelected:!0,selectedDrawTool:e._drawTool,selectedGeometry:e._drawTool.sketchStage.entityGraphic.geometry},e),e.view.off(o.ViewEventType.mouseUp,i)))};e.view.on(o.ViewEventType.mouseUp,i)}else{if(!e._editable)return;if(void 0!==e._drawTool&&null!==e._drawTool&&3===e._drawTool._editMode)return;r.hitTestFeature(r.sketchStage.entityGraphic,t)}}})}_getCenterCoordinate(e,t){const i=e.concat(t),r=new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)).positions,o=Cesium.BoundingSphere.fromPoints(r).center,n=Cesium.Cartographic.fromCartesian(o);return[Cesium.Math.toDegrees(n.longitude),Cesium.Math.toDegrees(n.latitude),0]}_getHight(){return 0}}o.Zondy.SketchEditorCesium=Yh;var Jh=Yh;i.d(t,"SceneView",function(){return Hh}),i.d(t,"SketchEditorCesium",function(){return Jh}),i.d(t,"CesiumInnerGraphicsLayer",function(){return hh}),i.d(t,"getTilingSchemeBySpatialReference",function(){return xi}),i.d(t,"getExtent",function(){return ki})}]);