@mapgis/webclient-cesium-plugin 17.2.4 → 17.2.6

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(12),n=i(13),a=i(14);function o(){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,n){var a,o,s=8*n-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?n-1:0,d=i?-1:1,p=e[t+u];for(u+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+u],u+=d,c-=8);if(0===a)a=1-h;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=h}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,i,r,n,a){var o,s,l,h=8*a-n-1,c=(1<<h)-1,u=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,n),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(o=o<<n|s,h+=n;h>0;e[i+p]=255&o,p+=f,o/=256,h-=8);e[i+p-f]|=128*m}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t){
11
11
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
12
- t.read=function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?n-1:0,d=i?-1:1,p=e[t+u];for(u+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+u],u+=d,c-=8);if(0===a)a=1-h;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=h}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,i,r,n,a){var o,s,l,h=8*a-n-1,c=(1<<h)-1,u=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,n),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(o=o<<n|s,h+=n;h>0;e[i+p]=255&o,p+=f,o/=256,h-=8);e[i+p-f]|=128*m}},function(e,t,i){"use strict";i.r(t);var r={};i.r(r),i.d(r,"createBillboard",function(){return Nh}),i.d(r,"createLabel",function(){return Gh}),i.d(r,"createModelPrimitive",function(){return Fh}),i.d(r,"createObject3DAppearance",function(){return Bh}),i.d(r,"createSpherePrimitive",function(){return qh}),i.d(r,"createCylinderPrimitive",function(){return Uh}),i.d(r,"getShadows",function(){return Wh});var n=i(0),a=1,o=2,s=3,l=4,h=5,c=484813681109536e-20,u=Math.PI/2,d=.16666666666666666,p=.04722222222222222,f=.022156084656084655,m=1e-10,y=.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 S(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),n=t.toLowerCase().replace(C,""),a=-1;++a<r.length;)if((i=r[a]).toLowerCase().replace(C,"")===n)return e[i]}var M=function(e){var t,i,r,n={},a=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},{}),o={proj:"projName",datum:"datumCode",rf:function(e){n.rf=parseFloat(e)},lat_0:function(e){n.lat0=e*y},lat_1:function(e){n.lat1=e*y},lat_2:function(e){n.lat2=e*y},lat_ts:function(e){n.lat_ts=e*y},lon_0:function(e){n.long0=e*y},lon_1:function(e){n.long1=e*y},lon_2:function(e){n.long2=e*y},alpha:function(e){n.alpha=parseFloat(e)*y},gamma:function(e){n.rectified_grid_angle=parseFloat(e)},lonc:function(e){n.longc=e*y},x_0:function(e){n.x0=parseFloat(e)},y_0:function(e){n.y0=parseFloat(e)},k_0:function(e){n.k0=parseFloat(e)},k:function(e){n.k0=parseFloat(e)},a:function(e){n.a=parseFloat(e)},b:function(e){n.b=parseFloat(e)},r_a:function(){n.R_A=!0},zone:function(e){n.zone=parseInt(e,10)},south:function(){n.utmSouth=!0},towgs84:function(e){n.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){n.to_meter=parseFloat(e)},units:function(e){n.units=e;var t=S(x,e);t&&(n.to_meter=t.to_meter)},from_greenwich:function(e){n.from_greenwich=e*y},pm:function(e){var t=S(w,e);n.from_greenwich=(t||parseFloat(e))*y},nadgrids:function(e){"@null"===e?n.datumCode="none":n.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))&&(n.axis=e)},approx:function(){n.approx=!0}};for(t in a)i=a[t],t in o?"function"==typeof(r=o[t])?r(i):n[r]=i:n[t]=i;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n},k=function(e){return new j(e).output()},T=1,I=/\s/,O=/[A-Za-z]/,E=/[A-Za-z84_]/,P=/[,\]]/,R=/[\d\.E\-\+]/;function j(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 A(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,n=i.reduce(function(e,t){return z(t,e),e},r);t&&(e[t]=n)}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"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return e[0]=["name",e[0]],void A(t,i,e);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return e[0]=["name",e[0]],A(t,i,e),void(t[i].type=i);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return z(e,t[i]);return A(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}j.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}},j.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)},j.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},j.prototype.number=function(e){if(!R.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},j.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},j.prototype.keyword=function(e){if(E.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)}},j.prototype.neutral=function(e){if(O.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(R.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)},j.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,V=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function N(e){return e*D}function G(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+":"+e.AUTHORITY[t])}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 i="",r=0,n=e.AXIS.length;r<n;++r){var a=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?i+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?i+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?i+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(e.axis=i)}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 o=e.GEOGCS;function s(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"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"),"belge_1972"===e.datumCode&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.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",N],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",N],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",N],["lat0","latitude_of_origin",N],["lat0","standard_parallel_1",N],["lat1","standard_parallel_1",N],["lat2","standard_parallel_2",N],["azimuth","Azimuth"],["alpha","azimuth",N],["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=N(e.lat0>0?90:-90)):(e.lat0=N(e.lat1>0?90:-90),e.lat_ts=e.lat1)}var F=function(e){var t=k(e),i=t[0],r={};return z(t,r),function e(t){for(var i=Object.keys(t),r=0,n=i.length;r<n;++r){var a=i[r];-1!==V.indexOf(a)&&G(t[a]),"object"==typeof t[a]&&e(t[a])}}(r),r[i]};function B(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?B[e]=M(arguments[1]):B[e]=F(arguments[1]):B[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?B.apply(t,e):B(e)});if("string"==typeof e){if(e in B)return B[e]}else"EPSG"in e?B["EPSG:"+e.EPSG]=e:"ESRI"in e?B["ESRI:"+e.ESRI]=e:"IAU2000"in e?B["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"]}(B);var q=B;var U=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var W=["3857","900913","3785","102113"];var H=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in q}(e))return q[e];if(function(e){return U.some(function(t){return e.indexOf(t)>-1})}(e)){var t=F(e);if(function(e){var t=S(e,"authority");if(t){var i=S(t,"epsg");return i&&W.indexOf(i)>-1}}(t))return q["EPSG:3857"];var i=function(e){var t=S(e,"extension");if(t)return S(t,"proj4")}(t);return i?M(i):t}return function(e){return"+"===e[0]}(e)?M(e):void 0},Y=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},X=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},J=function(e){return e<0?-1:1},$=function(e){return Math.abs(e)<=_?e:e-J(e)*b},K=function(e,t,i){var r=e*i,n=.5*e;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(u-t))/r},Z=function(e,t){for(var i,r,n=.5*e,a=u-2*Math.atan(t),o=0;o<=15;o++)if(i=e*Math.sin(a),a+=r=u-2*Math.atan(t*Math.pow((1-i)/(1+i),n))-a,Math.abs(r)<=1e-10)return a;return-9999};function Q(e){return e}var ee=[{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=X(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,n=e.y;if(n*g>90&&n*g<-90&&r*g>180&&r*g<-180)return null;if(Math.abs(Math.abs(n)-u)<=m)return null;if(this.sphere)t=this.x0+this.a*this.k0*$(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*n));else{var a=Math.sin(n),o=K(this.e,n,a);t=this.x0+this.a*this.k0*$(r-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,n=e.y-this.y0;if(this.sphere)i=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var a=Math.exp(-n/(this.a*this.k0));if(-9999===(i=Z(this.e,a)))return null}return t=$(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:Q,inverse:Q,names:["longlat","identity"]}],te={},ie=[];function re(e,t){var i=ie.length;return e.names?(ie[i]=e,e.names.forEach(function(e){te[e.toLowerCase()]=i}),this):(console.log(t),!0)}var ne={start:function(){ee.forEach(re)},add:re,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==te[t]&&ie[te[t]]?ie[te[t]]:void 0}},ae={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=ae.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ae.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var se={};se.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},se.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},se.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},se.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},se.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},se.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},se.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},se.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},se.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},se.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},se.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},se.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},se.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},se.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},se.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},se.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},se.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var le=function(e,t,i,r,n,u,d){var p={};return p.datum_type=void 0===e||"none"===e?h:l,t&&(p.datum_params=t.map(parseFloat),0===p.datum_params[0]&&0===p.datum_params[1]&&0===p.datum_params[2]||(p.datum_type=a),p.datum_params.length>3&&(0===p.datum_params[3]&&0===p.datum_params[4]&&0===p.datum_params[5]&&0===p.datum_params[6]||(p.datum_type=o,p.datum_params[3]*=c,p.datum_params[4]*=c,p.datum_params[5]*=c,p.datum_params[6]=p.datum_params[6]/1e6+1))),d&&(p.datum_type=s,p.grids=d),p.a=i,p.b=r,p.es=n,p.ep2=u,p},he={};function ce(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:he[e]||null,isNull:!1}}function ue(e){return e/3600*Math.PI/180}function de(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function pe(e){return e.map(function(e){return[ue(e.longitudeShift),ue(e.latitudeShift)]})}function fe(e,t,i){return{name:de(e,t+8,t+16).trim(),parent:de(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 me(e,t,i,r){for(var n=t+176,a=[],o=0;o<i.gridNodeCount;o++){var s={latitudeShift:e.getFloat32(n+16*o,r),longitudeShift:e.getFloat32(n+16*o+4,r),latitudeAccuracy:e.getFloat32(n+16*o+8,r),longitudeAccuracy:e.getFloat32(n+16*o+12,r)};a.push(s)}return a}function ye(e,t){if(!(this instanceof ye))return new ye(e);t=t||function(e){if(e)throw e};var i=H(e);if("object"==typeof i){var r=ye.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var n=S(se,i.datumCode);n&&(i.datum_params=i.datum_params||(n.towgs84?n.towgs84.split(","):null),i.ellps=n.ellipse,i.datumName=n.datumName?n.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 a=function(e,t,i,r,n){if(!e){var a=S(ae,r);a||(a=oe),e=a.a,t=a.b,i=a.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<m)&&(n=!0,t=e),{a:e,b:t,rf:i,sphere:n}}(i.a,i.b,i.rf,i.ellps,i.sphere),o=function(e,t,i,r){var n=e*e,a=t*t,o=(n-a)/n,s=0;return r?(n=(e*=1-o*(d+o*(p+o*f)))*e,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(n-a)/a}}(a.a,a.b,a.rf,i.R_A),s=function(e){return void 0===e?null:e.split(",").map(ce)}(i.nadgrids),l=i.datum||le(i.datumCode,i.datum_params,a.a,a.b,o.es,o.ep2,s);Y(this,i),Y(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),t(null,this)}else t(e)}else t(e)}ye.projections=ne,ye.projections.start();var ge=ye;function ve(e,t,i){var r,n,a,o,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),n=Math.sin(l),o=Math.cos(l),a=n*n,{x:((r=i/Math.sqrt(1-t*a))+h)*o*Math.cos(s),y:(r+h)*o*Math.sin(s),z:(r*(1-t)+h)*n}}function be(e,t,i,r){var n,a,o,s,l,h,c,d,p,f,m,y,g,v,b,_=e.x,w=e.y,x=e.z?e.z:0;if(n=Math.sqrt(_*_+w*w),a=Math.sqrt(_*_+w*w+x*x),n/i<1e-12){if(v=0,a/i<1e-12)return u,b=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(w,_);o=x/a,d=(s=n/a)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),p=o*l,g=0;do{g++,h=t*(c=i/Math.sqrt(1-t*p*p))/(c+(b=n*d+x*p-c*(1-t*p*p))),y=(m=o*(l=1/Math.sqrt(1-h*(2-h)*s*s)))*d-(f=s*(1-h)*l)*p,d=f,p=m}while(y*y>1e-24&&g<30);return{x:v,y:Math.atan(m/Math.abs(f)),z:b}}function _e(e){return e===a||e===o}var we=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===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_type!==o||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,n=e.es;if(e.datum_type===s){if(0!==xe(e,!1,i))return;r=6378137,n=.0066943799901413165}var l=t.a,c=t.b,u=t.es;if(t.datum_type===s&&(l=6378137,c=6356752.314,u=.0066943799901413165),n===u&&r===l&&!_e(e.datum_type)&&!_e(t.datum_type))return i;if((i=ve(i,n,r),_e(e.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===o){var r=i[0],n=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)+n,z:u*(-h*e.x+l*e.y+e.z)+s}}}(i,e.datum_type,e.datum_params)),_e(t.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===o){var r=i[0],n=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6],d=(e.x-r)/u,p=(e.y-n)/u,f=(e.z-s)/u;return{x:d+c*p-h*f,y:-c*d+p+l*f,z:h*d-l*p+f}}}(i,t.datum_type,t.datum_params)),i=be(i,u,l,c),t.datum_type===s)&&0!==xe(t,!0,i))return;return i};function xe(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},n={x:Number.NaN,y:Number.NaN},a=[],o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){n=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,d=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,p=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(u>r.y||c>r.x||p<r.y||d<r.x||(n=Ce(r,t,l),isNaN(n.x))))break}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*g+" "+r.y*g+" tried: '"+a+"'"),-1):(i.x=-n.x,i.y=n.y,0)}function Ce(e,t,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var n={x:e.x,y:e.y};n.x-=i.ll[0],n.y-=i.ll[1],n.x=$(n.x-Math.PI)+Math.PI;var a=Se(n,i);if(t){if(isNaN(a.x))return r;a.x=n.x-a.x,a.y=n.y-a.y;var o,s,l=9;do{if(s=Se(a,i),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:n.x-(s.x+a.x),y:n.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=$(a.x+i.ll[0]),r.y=a.y+i.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function Se(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},n=Math.floor(r.x),a=Math.floor(r.y),o=r.x-1*n,s=r.y-1*a,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=t.lim[0])return l;if(a<0||a>=t.lim[1])return l;i=a*t.lim[0]+n;var h=t.cvs[i][0],c=t.cvs[i][1];i++;var u=t.cvs[i][0],d=t.cvs[i][1];i+=t.lim[0];var p=t.cvs[i][0],f=t.cvs[i][1];i--;var m=t.cvs[i][0],y=t.cvs[i][1],g=o*s,v=o*(1-s),b=(1-o)*(1-s),_=(1-o)*s;return l.x=b*h+v*u+_*m+g*p,l.y=b*c+v*d+_*y+g*f,l}var Me=function(e,t,i){var r,n,a,o=i.x,s=i.y,l=i.z||0,h={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==i.z)switch(0===a?(r=o,n=-1!=="ew".indexOf(e.axis[a])?"x":"y"):1===a?(r=s,n=-1!=="ns".indexOf(e.axis[a])?"y":"x"):(r=l,n="z"),e.axis[a]){case"e":h[n]=r;break;case"w":h[n]=-r;break;case"n":h[n]=r;break;case"s":h[n]=-r;break;case"u":void 0!==i[n]&&(h.z=r);break;case"d":void 0!==i[n]&&(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},Te=function(e){Ie(e.x),Ie(e.y)};function Ie(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 Oe(e,t,i,r){var n,l=void 0!==(i=Array.isArray(i)?ke(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(Te(i),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===a||e.datum.datum_type===o||e.datum.datum_type===s)&&"WGS84"!==t.datumCode||(t.datum.datum_type===a||t.datum.datum_type===o||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}(e,t)&&(i=Oe(e,n=new ge("WGS84"),i,r),e=n),r&&"enu"!==e.axis&&(i=Me(e,!1,i)),"longlat"===e.projName)i={x:i.x*y,y:i.y*y,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=we(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?Me(t,!0,i):(l||delete i.z,i)}var Ee=ge("WGS84");function Le(e,t,i,r){var n,a,o;return Array.isArray(i)?(n=Oe(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 n.z?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(a=Oe(e,t,i,r),2===(o=Object.keys(i)).length?a:(o.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;a[r]=i[r]}),a))}function Pe(e){return e instanceof ge?e:e.oProj?e.oProj:ge(e)}var Re=function(e,t,i){e=Pe(e);var r,n=!1;return void 0===t?(t=e,e=Ee,n=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=Ee,n=!0),t=Pe(t),i?Le(e,t,i):(r={forward:function(i,r){return Le(e,t,i,r)},inverse:function(i,r){return Le(t,e,i,r)}},n&&(r.oProj=t),r)},je=6,Ae="AJSAJS",ze="AFAFAF",De=65,Ve=73,Ne=79,Ge=86,Fe=90,Be={forward:qe,inverse:function(e){var t=Ye(Je(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:Ue};function qe(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=Xe(i),n=Math.floor(e/1e5),a=Math.floor(t/1e5)%20;return function(e,t,i){var r=i-1,n=Ae.charCodeAt(r),a=ze.charCodeAt(r),o=n+e-1,s=a+t,l=!1;o>Fe&&(o=o-Fe+De-1,l=!0);(o===Ve||n<Ve&&o>Ve||(o>Ve||n<Ve)&&l)&&o++;(o===Ne||n<Ne&&o>Ne||(o>Ne||n<Ne)&&l)&&++o===Ve&&o++;o>Fe&&(o=o-Fe+De-1);s>Ge?(s=s-Ge+De-1,l=!0):l=!1;(s===Ve||a<Ve&&s>Ve||(s>Ve||a<Ve)&&l)&&s++;(s===Ne||a<Ne&&s>Ne||(s>Ne||a<Ne)&&l)&&++s===Ve&&s++;s>Ge&&(s=s-Ge+De-1);return String.fromCharCode(o)+String.fromCharCode(s)}(n,a,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,n,a,o,s,l=e.lat,h=e.lon,c=6378137,u=We(l),d=We(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));o=We(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),n=Math.cos(u)*(d-o),a=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p=.9996*t*(n+(1-i+r)*n*n*n/6+(5-18*i+i*i+72*r-.39089081163157013)*n*n*n*n*n/120)+5e5,f=.9996*(a+t*Math.tan(u)*(n*n/2+(5-i+9*r+4*r*r)*n*n*n*n/24+(61-58*i+i*i+600*r-2.2240339282485886)*n*n*n*n*n*n/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(p),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 Ue(e){var t=Ye(Je(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function We(e){return e*(Math.PI/180)}function He(e){return e/Math.PI*180}function Ye(e){var t=e.northing,i=e.easting,r=e.zoneLetter,n=e.zoneNumber;if(n<0||n>60)return null;var a,o,s,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,y=t;r<"N"&&(y-=1e7),c=6*(n-1)-180+3,d=(u=y/.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),a=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),s=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*a);var g=d-a*Math.tan(d)/l*(h*h/2-(5+3*o+10*s-4*s*s-.06065547077041606)*h*h*h*h/24+(61+90*o+298*s+45*o*o-1.6983531815716497-3*s*s)*h*h*h*h*h*h/720);g=He(g);var v,b=(h-(1+2*o+s)*h*h*h/6+(5-2*s+28*o-3*s*s+.05391597401814761+24*o*o)*h*h*h*h*h/120)/Math.cos(d);if(b=c+He(b),e.accuracy){var _=Ye({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 Xe(e){var t=e%je;return 0===t&&(t=je),t}function Je(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,n="",a=0;!/[A-Z]/.test(t=e.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+e;n+=t,a++}var o=parseInt(n,10);if(0===a||a+3>i)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(a,a+=2);for(var l=Xe(o),h=function(e,t){var i=Ae.charCodeAt(t-1),r=1e5,n=!1;for(;i!==e.charCodeAt(0);){if(++i===Ve&&i++,i===Ne&&i++,i>Fe){if(n)throw"Bad character: "+e;i=De,n=!0}r+=1e5}return r}(r.charAt(0),l),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var i=ze.charCodeAt(t-1),r=0,n=!1;for(;i!==e.charCodeAt(0);){if(++i===Ve&&i++,i===Ne&&i++,i>Ge){if(n)throw"Bad character: "+e;i=De,n=!0}r+=1e5}return r}(r.charAt(1),l);c<$e(s);)c+=2e6;var u=i-a;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 d,p,f,m=u/2,y=0,g=0;return m>0&&(d=1e5/Math.pow(10,m),p=e.substring(a,a+m),y=parseFloat(p)*d,f=e.substring(a+m),g=parseFloat(f)*d),{easting:y+h,northing:g+c,zoneLetter:s,zoneNumber:o,accuracy:d}}function $e(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 Ke(e,t,i){if(!(this instanceof Ke))return new Ke(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")}Ke.fromMGRS=function(e){return new Ke(Ue(e))},Ke.prototype.toMGRS=function(e){return qe([this.x,this.y],e)};var Ze=Ke,Qe=.01068115234375,et=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Qe))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Qe)));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},tt=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])))},it=function(e,t,i){for(var r=1/(1-t),n=e,a=20;a;--a){var o=Math.sin(n),s=1-t*o*o;if(n-=s=(tt(n,o,Math.cos(n),i)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<m)return n}return n};var rt={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=et(this.es),this.ml0=tt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,i,r,n=e.x,a=e.y,o=$(n-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var h=l*o,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>m?Math.tan(a):0,f=Math.pow(p,2),y=Math.pow(f,2);t=1-this.es*Math.pow(s,2),h/=Math.sqrt(t);var g=tt(a,s,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+y+14*u-58*f*u+c/42*(61+179*y-y*f-479*f)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*o*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+y-58*f+270*u-330*f*u+c/56*(1385+543*y-y*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<m)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>m)return 93;r=0}else r=Math.acos(r);a<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,n,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,i=it(t,this.es,this.en),Math.abs(i)<u){var s=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>m?Math.tan(i):0,c=this.ep2*Math.pow(l,2),d=Math.pow(c,2),p=Math.pow(h,2),f=Math.pow(p,2);t=1-this.es*Math.pow(s,2);var y=a*Math.sqrt(t)/this.k0,g=Math.pow(y,2);r=i-(t*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*c*p+c-4*d-g/30*(61+90*p-252*c*p+45*f+46*c-g/56*(1385+3633*p+4095*f+1574*f*p)))),n=$(this.long0+y*(1-g/6*(1+2*p+c-g/20*(5+28*p+24*f+8*c*p+6*c-g/42*(61+662*p+1320*f+720*f*p))))/l)}else r=u*J(o),n=0;else{var v=Math.exp(a/this.k0),b=.5*(v-1/v),_=this.lat0+o/this.k0,w=Math.cos(_);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(b,2))),r=Math.asin(t),o<0&&(r=-r),n=0===b&&0===w?0:$(Math.atan2(b,w)+this.long0)}return e.x=n,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},nt=function(e){var t=Math.exp(e);return t=(t-1/t)/2},at=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/(at(1,t)+1))),e<0?-t:t},st=function(e,t){for(var i,r=2*Math.cos(2*t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return t+i*Math.sin(2*t)},lt=function(e,t){for(var i,r=2*Math.cos(t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return Math.sin(t)*i},ht=function(e,t,i){for(var r,n,a=Math.sin(t),o=Math.cos(t),s=nt(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*o*l,c=-2*a*s,u=e.length-1,d=e[u],p=0,f=0,m=0;--u>=0;)r=f,n=p,d=h*(f=d)-r-c*(p=m)+e[u],m=c*f-n+h*p;return[(h=a*l)*d-(c=o*s)*m,h*m+c*d]};var ct={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&&(rt.init.apply(this),this.forward=rt.forward,this.inverse=rt.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=st(this.cbg,this.lat0);this.Zb=-this.Qn*(r+lt(this.gtu,2*r))},forward:function(e){var t=$(e.x-this.long0),i=e.y;i=st(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),a=Math.sin(t),o=Math.cos(t);i=Math.atan2(r,o*n),t=Math.atan2(a*n,at(r,n*o)),t=ot(Math.tan(t));var s,l,h=ht(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),n=(e.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var a=ht(this.utg,2*n,2*r);n+=a[0],r+=a[1],r=Math.atan(nt(r));var o=Math.sin(n),s=Math.cos(n),l=Math.sin(r),h=Math.cos(r);n=Math.atan2(o*h,at(l,h*s)),r=Math.atan2(l,h*s),t=$(r+this.long0),i=st(this.cgb,n)}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"]},ut=function(e,t){if(void 0===e){if((e=Math.floor(30*($(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e};var dt={init:function(){var e=ut(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*y,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ct.init.apply(this),this.forward=ct.forward,this.inverse=ct.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},pt=function(e,t){return Math.pow((1-e)/(1+e),t)},ft=20;var mt={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)*pt(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)*pt(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),n=ft;n>0&&(i=2*Math.atan(r*pt(this.e*Math.sin(e.y),-.5*this.e))-u,!(Math.abs(i-e.y)<1e-14));--n)e.y=i;return n?(e.x=t,e.y=i,e):null},names:["gauss"]};var yt={init:function(){mt.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,n;return e.x=$(e.x-this.long0),mt.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=n*i*Math.sin(e.x),e.y=n*(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,n,a;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,a=Math.sqrt(e.x*e.x+e.y*e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),i=Math.cos(o),n=Math.asin(i*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*i-e.y*this.sinc0*t)}else n=this.phic0,r=0;return e.x=r,e.y=n,mt.inverse.apply(this,[e]),e.x=$(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var gt={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)<=m&&(this.k0=.5*(1+J(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=m&&(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)<=m&&(this.k0=.5*this.cons*X(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/K(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=X(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,n,a,o,s=e.x,l=e.y,h=Math.sin(l),c=Math.cos(l),d=$(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=m&&Math.abs(l+this.lat0)<=m?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(d)),e.x=this.a*t*c*Math.sin(d)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*c*Math.cos(d))+this.y0,e):(i=2*Math.atan(this.ssfn_(l,h,this.e))-u,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=m?(a=K(this.e,l*this.con,this.con*h),o=2*this.a*this.k0*a/this.cons,e.x=this.x0+o*Math.sin(s-this.long0),e.y=this.y0-this.con*o*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<m?(t=2*this.a*this.k0/(1+n*Math.cos(d)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(d))),e.y=t*(this.cosX0*r-this.sinX0*n*Math.cos(d))+this.y0),e.x=t*n*Math.sin(d)+this.x0,e))},inverse:function(e){var t,i,r,n,a;e.x-=this.x0,e.y-=this.y0;var o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,i=this.lat0,o<=m?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<m?this.lat0>0?$(this.long0+Math.atan2(e.x,-1*e.y)):$(this.long0+Math.atan2(e.x,e.y)):$(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=m){if(o<=m)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*Z(this.e,r),t=this.con*$(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=m?a=this.X0:(a=Math.asin(Math.cos(n)*this.sinX0+e.y*Math.sin(n)*this.cosX0/o),t=$(this.long0+Math.atan2(e.x*Math.sin(n),o*this.cosX0*Math.cos(n)-e.y*this.sinX0*Math.sin(n)))),i=-1*Z(this.e,Math.tan(.5*(u+a)));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 vt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,n=2*r-Math.pow(r,2),a=this.e=Math.sqrt(n);this.R=this.k0*i*Math.sqrt(1-n)/(1-n*Math.pow(t,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/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,n=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,n=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),s=this.lambda0+o/this.alpha,l=0,h=a,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+a/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"]},bt=1e-7;var _t={init:function(){var e,t,i,r,n,a,o,s,l,h,c,d=0,p=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 S=!1;if("rectified_grid_angle"in this&&(S=!0),C&&(x=this.alpha),S&&(d=this.rectified_grid_angle*y),C||S)p=this.longc;else if(f=this.long1,_=this.lat1,g=this.long2,w=this.lat2,Math.abs(_-w)<=bt||(e=Math.abs(_))<=bt||Math.abs(e-u)<=bt||Math.abs(Math.abs(this.lat0)-u)<=bt||Math.abs(Math.abs(w)-u)<=bt)throw new Error;var M=1-this.es;t=Math.sqrt(M),Math.abs(this.lat0)>m?(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,(n=(r=this.B*t/(i*Math.sqrt(e)))*r-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(K(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=n=1),C||S?(C?(c=Math.asin(Math.sin(x)/r),S||(d=x)):(c=d,x=Math.asin(r*Math.sin(c))),this.lam0=p-Math.asin(.5*(n-1/n)*Math.tan(c))/this.B):(a=Math.pow(K(this.e,_,Math.sin(_)),this.B),o=Math.pow(K(this.e,w,Math.sin(w)),this.B),n=this.E/a,l=(o-a)/(o+a),h=((h=this.E*this.E)-o*a)/(h+o*a),(e=f-g)<-Math.pi?g-=b:e>Math.pi&&(g+=b),this.lam0=$(.5*(f+g)-Math.atan(h*Math.tan(.5*this.B*(f-g))/l)/this.B),c=Math.atan(2*Math.sin(this.B*$(f-this.lam0))/(n-1/n)),d=x=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),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)),n=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(v-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(v+n))},forward:function(e){var t,i,r,n,a,o,s,l,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-u)>m){if(t=.5*((a=this.E/Math.pow(K(this.e,e.y,Math.sin(e.y)),this.B))-(o=1/a)),i=.5*(a+o),n=Math.sin(this.B*e.x),r=(t*this.singam-n*this.cosgam)/i,Math.abs(Math.abs(r)-1)<m)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*e.x),s=Math.abs(o)<bt?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+n*this.singam,o)}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,n,a,o,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),n=.5*((r=Math.exp(-this.BrA*i))-1/r),a=.5*(r+1/r),s=((o=Math.sin(this.BrA*t))*this.cosgam+n*this.singam)/a,Math.abs(Math.abs(s)-1)<m)l.x=0,l.y=s<0?-u:u;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=Z(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(n*this.cosgam-o*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 wt={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)<m)){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=X(this.e,t,i),n=K(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=X(this.e,a,o),l=K(this.e,this.lat2,a),h=K(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>m?this.ns=Math.log(r/s)/Math.log(n/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(n,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)<=m&&(i=J(i)*(u-2*m));var r,n,a=Math.abs(Math.abs(i)-u);if(a>m)r=K(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((a=i*this.ns)<=0)return null;n=0}var o=this.ns*$(t-this.long0);return e.x=this.k0*(n*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,e},inverse:function(e){var t,i,r,n,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),i=1):(t=-Math.sqrt(o*o+s*s),i=-1);var l=0;if(0!==t&&(l=Math.atan2(i*o,i*s)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(n=Z(this.e,r)))return null}else n=-u;return a=$(l/this.ns+this.long0),e.x=a,e.y=n,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 xt={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,n,a,o,s,l=e.x,h=e.y,c=$(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,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),a=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,n,a,o,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,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(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(t)),e.x=this.long0-i/this.alfa,o=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(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(s=1),o=e.y,h+=1}while(0===s&&h<15);return h>=15?null:e},names:["Krovak","krovak"]},Ct=function(e,t,i,r,n){return e*n-t*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},St=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},Mt=function(e){return.375*e*(1+.25*e*(1+.46875*e))},kt=function(e){return.05859375*e*e*(1+.75*e)},Tt=function(e){return e*e*e*(35/3072)},It=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},Ot=function(e){return Math.abs(e)<u?e:e-J(e)*Math.PI},Et=function(e,t,i,r,n){var a,o;a=e/t;for(var s=0;s<15;s++)if(a+=o=(e-(t*a-i*Math.sin(2*a)+r*Math.sin(4*a)-n*Math.sin(6*a)))/(t-2*i*Math.cos(2*a)+4*r*Math.cos(4*a)-6*n*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN};var Lt={init:function(){this.sphere||(this.e0=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.ml0=this.a*Ct(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,i,r=e.x,n=e.y;if(r=$(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var a=Math.sin(n),o=Math.cos(n),s=It(this.a,this.e,a),l=Math.tan(n)*Math.tan(n),h=r*Math.cos(n),c=h*h,u=this.es*o*o/(1-this.es);t=s*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),i=this.a*Ct(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*a/o*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,n=e.y/this.a;if(this.sphere){var a=n+this.lat0;t=Math.asin(Math.sin(a)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(a))}else{var o=this.ml0/this.a+n,s=Et(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-u)<=m)return e.x=this.long0,e.y=u,n<0&&(e.y*=-1),e;var l=It(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),d=r*this.a/l,p=d*d;t=s-l*Math.tan(s)/h*d*d*(.5-(1+3*c)*d*d/24),i=d*(1-p*(c/3+(1+3*c)*c*p/15))/Math.cos(s)}return e.x=$(i+this.long0),e.y=Ot(t),e},names:["Cassini","Cassini_Soldner","cass"]},Pt=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 Rt=.3333333333333333,jt=.17222222222222222,At=.10257936507936508,zt=.06388888888888888,Dt=.0664021164021164,Vt=.016415012942191543;var Nt={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-u)<m?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<m?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Pt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*Rt,t=e*e,i[0]+=t*jt,i[1]=t*zt,t*=e,i[0]+=t*At,i[1]+=t*Dt,i[2]=t*Vt,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=Pt(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,n,a,o,s,l,h,c,d=e.x,p=e.y;if(d=$(d-this.long0),this.sphere){if(a=Math.sin(p),c=Math.cos(p),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*a+this.cosph0*c*r)<=m)return null;t=(i=Math.sqrt(2/i))*c*Math.sin(d),i*=this.mode===this.EQUIT?a:this.cosph0*a-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(p+this.lat0)<m)return null;i=v-.5*p,t=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(d),i*=r}}else{switch(s=0,l=0,h=0,r=Math.cos(d),n=Math.sin(d),a=Math.sin(p),o=Pt(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/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+p,o=this.qp-o;break;case this.S_POLE:h=p-u,o=this.qp+o}if(Math.abs(h)<m)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*n;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(h=Math.sqrt(o))*n,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,n,a,o,s,l=e.x/this.a,h=e.y/this.a;if(this.sphere){var c,d=0,p=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||(p=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=m?0:Math.asin(h*p/c),l*=p,h=d*c;break;case this.OBLIQ:i=Math.abs(c)<=m?this.lat0:Math.asin(d*this.sinph0+h*p*this.cosph0/c),l*=p*this.cosph0,h=(d-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,(o=Math.sqrt(l*l+h*h))<m)return e.x=this.long0,e.y=this.lat0,e;n=2*Math.asin(.5*o/this.rq),r=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(s=r*this.sinb1+h*n*this.cosb1/o,a=this.qp*s,h=o*this.cosb1*r-h*this.sinb1*n):(s=h*n/o,a=this.qp*s,h=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(a=l*l+h*h))return e.x=this.long0,e.y=this.lat0,e;s=1-a/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=$(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},Gt=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};var Ft={init:function(){Math.abs(this.lat1+this.lat2)<m||(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=X(this.e3,this.sin_po,this.cos_po),this.qs1=Pt(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=X(this.e3,this.sin_po,this.cos_po),this.qs2=Pt(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=Pt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>m?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=Pt(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*$(t-this.long0),o=n*Math.sin(a)+this.x0,s=this.rh-n*Math.cos(a)+this.y0;return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;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),n=0,0!==t&&(n=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,i)),a=$(n/this.ns0+this.long0),e.x=a,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,n,a,o,s=Gt(.5*t);if(e<m)return s;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(s),r=Math.cos(s),s+=o=.5*(a=1-(n=e*i)*n)*a/r*(t/(1-l)-i/a+.5/e*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return s;return null}};var Bt={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,n,a,o,s,l=e.x,h=e.y;return r=$(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),(a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m?(o=this.x0+1*this.a*i*Math.sin(r)/a,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)/a):(o=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;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))?(n=Math.atan2(t,this.rc),i=Math.sin(n),r=Math.cos(n),o=Gt(r*this.sin_p14+e.y*i*this.cos_p14/t),a=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),a=$(this.long0+a)):(o=this.phic0,a=0),e.x=a,e.y=o,e},names:["gnom"]},qt=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,n,a,o,s=Math.asin(.5*t),l=0;l<30;l++)if(n=Math.sin(s),a=Math.cos(s),o=e*n,s+=r=Math.pow(1-o*o,2)/(2*a)*(t/(1-e*e)-n/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return s;return NaN};var Ut={init:function(){this.sphere||(this.k0=X(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,n=e.y,a=$(r-this.long0);if(this.sphere)t=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=Pt(this.e,Math.sin(n));t=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.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=$(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=qt(this.e,2*e.y*this.k0/this.a),t=$(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]};var Wt={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=$(t-this.long0),n=Ot(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*n,e},inverse:function(e){var t=e.x,i=e.y;return e.x=$(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Ot(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ht=20;var Yt={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.ml0=this.a*Ct(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,n=e.x,a=e.y,o=$(n-this.long0);if(r=o*Math.sin(a),this.sphere)Math.abs(a)<=m?(t=this.a*o,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(a),i=this.a*(Ot(a-this.lat0)+(1-Math.cos(r))/Math.tan(a)));else if(Math.abs(a)<=m)t=this.a*o,i=-1*this.ml0;else{var s=It(this.a,this.e,Math.sin(a))/Math.tan(a);t=s*Math.sin(r),i=this.a*Ct(this.e0,this.e1,this.e2,this.e3,a)-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,n,a,o,s,l,h;if(r=e.x-this.x0,n=e.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=m)t=$(r/this.a+this.long0),i=0;else{var c;for(o=this.lat0+n/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ht;a;--a)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-o)/c-1),Math.abs(h)<=m){i=l;break}t=$(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=m)i=0,t=$(this.long0+r/this.a);else{var u,d,p,f,y;for(o=(this.ml0+n)/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ht;a;--a)if(y=this.e*Math.sin(l),u=Math.sqrt(1-y*y)*Math.tan(l),d=this.a*Ct(this.e0,this.e1,this.e2,this.e3,l),p=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=(o*(u*(f=d/this.a)+1)-f-.5*u*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*o*f)/(4*u)+(o-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=m){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=$(this.long0+Math.asin(r*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]};var Xt={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,n=i-this.long0,a=r/c*1e-5,o=n,s=1,l=0;for(t=1;t<=10;t++)s*=a,l+=this.A[t]*s;var h,u=l,d=o,p=1,f=0,m=0,y=0;for(t=1;t<=6;t++)h=f*u+p*d,p=p*u-f*d,f=h,m=m+this.B_re[t]*p-this.B_im[t]*f,y=y+this.B_im[t]*p+this.B_re[t]*f;return e.x=y*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,n=e.y,a=r-this.x0,o=(n-this.y0)/this.a,s=a/this.a,l=1,h=0,u=0,d=0;for(t=1;t<=6;t++)i=h*o+l*s,l=l*o-h*s,h=i,u=u+this.C_re[t]*l-this.C_im[t]*h,d=d+this.C_im[t]*l+this.C_re[t]*h;for(var p=0;p<this.iterations;p++){var f,m=u,y=d,g=o,v=s;for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,g+=(t-1)*(this.B_re[t]*m-this.B_im[t]*y),v+=(t-1)*(this.B_im[t]*m+this.B_re[t]*y);m=1,y=0;var b=this.B_re[1],_=this.B_im[1];for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,b+=t*(this.B_re[t]*m-this.B_im[t]*y),_+=t*(this.B_im[t]*m+this.B_re[t]*y);var w=b*b+_*_;u=(g*b+v*_)/w,d=(v*b-g*_)/w}var x=u,C=d,S=1,M=0;for(t=1;t<=9;t++)S*=x,M+=this.D[t]*S;var k=this.lat0+M*c*1e5,T=this.long0+C;return e.x=T,e.y=k,e},names:["New_Zealand_Map_Grid","nzmg"]};var Jt={init:function(){},forward:function(e){var t=e.x,i=e.y,r=$(t-this.long0),n=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=n,e.y=a,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=$(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"]},$t=20;var Kt={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=et(this.es)},forward:function(e){var t,i,r=e.x,n=e.y;if(r=$(r-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(n),o=$t;o;--o){var s=(this.m*n+Math.sin(n)-a)/(this.m+Math.cos(n));if(n-=s,Math.abs(s)<m)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;t=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var l=Math.sin(n),h=Math.cos(n);i=this.a*tt(n,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,n;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=Gt((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Gt(Math.sin(t)/this.n)),r=$(r+this.long0),t=Ot(t)):(t=it(e.y/this.a,this.es,this.en),(n=Math.abs(t))<u?(n=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),r=$(i)):n-m<u&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};var Zt={init:function(){},forward:function(e){for(var t=e.x,i=e.y,r=$(t-this.long0),n=i,a=Math.PI*Math.sin(i);;){var o=-(n+Math.sin(n)-a)/(1+Math.cos(n));if(n+=o,Math.abs(o)<m)break}n/=2,Math.PI/2-Math.abs(i)<m&&(r=0);var s=.900316316158*this.a*r*Math.cos(n)+this.x0,l=1.4142135623731*this.a*Math.sin(n)+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=$(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 n=Math.asin(i);return e.x=r,e.y=n,e},names:["Mollweide","moll"]};var Qt={init:function(){Math.abs(this.lat1+this.lat2)<m||(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=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=X(this.e,this.sinphi,this.cosphi),this.ml1=Ct(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<m?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=X(this.e,this.sinphi,this.cosphi),this.ml2=Ct(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=Ct(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 n=Ct(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-n)}var a=this.ns*$(i-this.long0),o=this.x0+t*Math.sin(a),s=this.y0+this.rh-t*Math.cos(a);return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n;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 a=0;if(0!==i&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere)return n=$(this.long0+a/this.ns),r=Ot(this.g-i/this.a),e.x=n,e.y=r,e;var o=this.g-i/this.a;return r=Et(o,this.e0,this.e1,this.e2,this.e3),n=$(this.long0+a/this.ns),e.x=n,e.y=r,e},names:["Equidistant_Conic","eqdc"]};var ei={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,n=e.y,a=$(r-this.long0);Math.abs(n)<=m&&(t=this.x0+this.R*a,i=this.y0);var o=Gt(2*Math.abs(n/Math.PI));(Math.abs(a)<=m||Math.abs(Math.abs(n)-u)<=m)&&(t=this.x0,i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,h=Math.sin(o),c=Math.cos(o),d=c/(h+c-1),p=d*d,f=d*(2/h-1),y=f*f,g=Math.PI*this.R*(s*(d-y)+Math.sqrt(l*(d-y)*(d-y)-(y+l)*(p-y)))/(y+l);a<0&&(g=-g),t=this.x0+g;var v=l+d;return g=Math.PI*this.R*(f*v-s*Math.sqrt((y+l)*(l+1)-v*v))/(y+l),i=n>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,u,d;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,a=(r=e.x/u)*r+(n=e.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+a))+1+2*n*n+a*a)+(2*(s=o-2*n*n+r*r)*s*s/l/l/l-9*o*s/l/l)/27)/(h=(o-s*s/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=e.y>=0?(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<m?this.long0:$(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-n*n)+a*a))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var ti={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,M=e.x,k=e.y,T=Math.sin(e.y),I=Math.cos(e.y),O=$(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=m?(e.x=this.x0+this.a*(u-k)*Math.sin(O),e.y=this.y0-this.a*(u-k)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(e.x=this.x0+this.a*(u+k)*Math.sin(O),e.y=this.y0+this.a*(u+k)*Math.cos(O),e):(_=this.sin_p12*T+this.cos_p12*I*Math.cos(O),b=(v=Math.acos(_))?v/Math.sin(v):1,e.x=this.x0+this.a*b*I*Math.sin(O),e.y=this.y0+this.a*b*(this.cos_p12*T-this.sin_p12*I*Math.cos(O)),e):(t=St(this.es),i=Mt(this.es),r=kt(this.es),n=Tt(this.es),Math.abs(this.sin_p12-1)<=m?(a=this.a*Ct(t,i,r,n,u),o=this.a*Ct(t,i,r,n,k),e.x=this.x0+(a-o)*Math.sin(O),e.y=this.y0-(a-o)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(a=this.a*Ct(t,i,r,n,u),o=this.a*Ct(t,i,r,n,k),e.x=this.x0+(a+o)*Math.sin(O),e.y=this.y0+(a+o)*Math.cos(O),e):(s=T/I,l=It(this.a,this.e,this.sin_p12),h=It(this.a,this.e,T),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(h*I)),w=0===(d=Math.atan2(Math.sin(O),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(O)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(d)-Math.PI)<=m?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(O)*Math.cos(c)/Math.sin(d)),p=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(d)/Math.sqrt(1-this.es))*f)*(1-g)/6+(C=x*w)/8*(y=p*f)*(1-2*g)+(S=C*w)/120*(g*(4-7*g)-3*p*p*(1-7*g))-S*w/48*y),e.x=this.x0+v*Math.sin(d),e.y=this.y0+v*Math.cos(d),e))},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,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),n=Math.cos(i),a=this.long0,Math.abs(t)<=m?o=this.lat0:(o=Gt(n*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-u,a=Math.abs(s)<=m?this.lat0>=0?$(this.long0+Math.atan2(e.x,-e.y)):$(this.long0-Math.atan2(-e.x,e.y)):$(this.long0+Math.atan2(e.x*r,t*this.cos_p12*n-e.y*this.sin_p12*r))),e.x=a,e.y=o,e}return l=St(this.es),h=Mt(this.es),c=kt(this.es),d=Tt(this.es),Math.abs(this.sin_p12-1)<=m?(p=this.a*Ct(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=Et((p-t)/this.a,l,h,c,d),a=$(this.long0+Math.atan2(e.x,-1*e.y)),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=m?(p=this.a*Ct(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=Et((t-p)/this.a,l,h,c,d),a=$(this.long0+Math.atan2(e.x,e.y)),e.x=a,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),f=It(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),S=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,y=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*v),a=$(this.long0+Math.asin(Math.sin(g)*Math.sin(C)/Math.cos(y))),M=Math.sin(y),o=Math.atan2((M-this.es*S*this.sin_p12)*Math.tan(y),M*(1-this.es)),e.x=a,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]};var ii={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l=e.x,h=e.y;return r=$(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),((a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m)&&(o=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Gt(t/this.a),r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(t)<=m?(s=this.lat0,e.x=o,e.y=s,e):(s=Gt(n*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(this.lat0)-u,Math.abs(a)<=m?(o=this.lat0>=0?$(this.long0+Math.atan2(e.x,-e.y)):$(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=s,e):(o=$(this.long0+Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r)),e.x=o,e.y=s,e))},names:["ortho"]},ri={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ni={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ai(e,t,i,r){var n;return e<m?(r.value=ni.AREA_0,n=0):(n=Math.atan2(t,i),Math.abs(n)<=v?r.value=ni.AREA_0:n>v&&n<=u+v?(r.value=ni.AREA_1,n-=u):n>u+v||n<=-(u+v)?(r.value=ni.AREA_2,n=n>=0?n-_:n+_):(r.value=ni.AREA_3,n+=u)),n}function oi(e,t){var i=e+t;return i<-_?i+=b:i>+_&&(i-=b),i}var si={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=ri.TOP:this.lat0<=-(u-v/2)?this.face=ri.BOTTOM:Math.abs(this.long0)<=v?this.face=ri.FRONT:Math.abs(this.long0)<=u+v?this.face=this.long0>0?ri.RIGHT:ri.LEFT:this.face=ri.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,n,a,o,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===ri.TOP)n=u-t,i>=v&&i<=u+v?(l.value=ni.AREA_0,r=i-u):i>u+v||i<=-(u+v)?(l.value=ni.AREA_1,r=i>0?i-_:i+_):i>-(u+v)&&i<=-v?(l.value=ni.AREA_2,r=i+u):(l.value=ni.AREA_3,r=i);else if(this.face===ri.BOTTOM)n=u+t,i>=v&&i<=u+v?(l.value=ni.AREA_0,r=-i+u):i<v&&i>=-v?(l.value=ni.AREA_1,r=-i):i<-v&&i>=-(u+v)?(l.value=ni.AREA_2,r=-i-u):(l.value=ni.AREA_3,r=i>0?-i+_:-i-_);else{var h,c,d,p,f,m;this.face===ri.RIGHT?i=oi(i,+u):this.face===ri.BACK?i=oi(i,+_):this.face===ri.LEFT&&(i=oi(i,-u)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(i),h=f*Math.cos(i),c=f*m,d=p,this.face===ri.FRONT?r=ai(n=Math.acos(h),d,c,l):this.face===ri.RIGHT?r=ai(n=Math.acos(c),d,-h,l):this.face===ri.BACK?r=ai(n=Math.acos(-h),d,-c,l):this.face===ri.LEFT?r=ai(n=Math.acos(-c),d,h,l):(n=r=0,l.value=ni.AREA_0)}return o=Math.atan(12/_*(r+Math.acos(Math.sin(r)*Math.cos(v))-u)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===ni.AREA_1?o+=u:l.value===ni.AREA_2?o+=_:l.value===ni.AREA_3&&(o+=1.5*_),s.x=a*Math.cos(o),s.y=a*Math.sin(o),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,n,a,o,s,l,h,c,d,p,f={lam:0,phi:0},m={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)?m.value=ni.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(m.value=ni.AREA_1,t-=u):e.x<0&&-e.x>=Math.abs(e.y)?(m.value=ni.AREA_2,t=t<0?t+_:t-_):(m.value=ni.AREA_3,t+=u),h=_/12*Math.tan(t),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(r=Math.cos(t))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===ri.TOP)l=Math.acos(s),f.phi=u-l,m.value===ni.AREA_0?f.lam=o+u:m.value===ni.AREA_1?f.lam=o<0?o+_:o-_:m.value===ni.AREA_2?f.lam=o-u:f.lam=o;else if(this.face===ri.BOTTOM)l=Math.acos(s),f.phi=l-u,m.value===ni.AREA_0?f.lam=-o+u:m.value===ni.AREA_1?f.lam=-o:m.value===ni.AREA_2?f.lam=-o-u:f.lam=o<0?-o-_:-o+_;else{var y,g,v;h=(y=s)*y,g=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(o))*v)>=1?0:Math.sqrt(1-h),m.value===ni.AREA_1?(h=g,g=-v,v=h):m.value===ni.AREA_2?(g=-g,v=-v):m.value===ni.AREA_3&&(h=g,g=v,v=-h),this.face===ri.RIGHT?(h=y,y=-g,g=h):this.face===ri.BACK?(y=-y,g=-g):this.face===ri.LEFT&&(h=y,y=g,g=-h),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(g,y),this.face===ri.RIGHT?f.lam=oi(f.lam,-u):this.face===ri.BACK?f.lam=oi(f.lam,-_):this.face===ri.LEFT&&(f.lam=oi(f.lam,+u))}return 0!==this.es&&(c=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),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"]},li=[[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]],hi=[[-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]],ci=.8487,ui=1.3523,di=g/5,pi=1/di,fi=18,mi=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},yi=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};var gi={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=$(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*di);r<0?r=0:r>=fi&&(r=fi-1),i=g*(i-pi*r);var n={x:mi(li[r],i)*t,y:mi(hi[r],i)};return e.y<0&&(n.y=-n.y),n.x=n.x*this.a*ci+this.x0,n.y=n.y*this.a*ui+this.y0,n},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*ci),y:Math.abs(e.y-this.y0)/(this.a*ui)};if(t.y>=1)t.x/=li[fi][0],t.y=e.y<0?-u:u;else{var i=Math.floor(t.y*fi);for(i<0?i=0:i>=fi&&(i=fi-1);;)if(hi[i][0]>t.y)--i;else{if(!(hi[i+1][0]<=t.y))break;++i}var r=hi[i],n=5*(t.y-r[0])/(hi[i+1][0]-r[0]);n=function(e,t,i,r){for(var n=t;r;--r){var a=e(n);if(n-=a,Math.abs(a)<i)break}return n}(function(e){return(mi(r,e)-t.y)/yi(r,e)},n,m,100),t.x/=mi(li[i],n),t.y=(5*i+n)*y,e.y<0&&(t.y=-t.y)}return t.x=$(t.x+this.long0),t},names:["Robinson","robin"]};var vi={init:function(){this.name="geocent"},forward:function(e){return ve(e,this.es,this.a)},inverse:function(e){return be(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},bi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},_i={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 wi={init:function(){if(Object.keys(_i).forEach(function(e){if(void 0===this[e])this[e]=_i[e].def;else{if(_i[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);_i[e].num&&(this[e]=parseFloat(this[e]))}_i[e].degrees&&(this[e]=this[e]*y)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)<m?this.mode=this.lat0<0?bi.S_POLE:bi.N_POLE:Math.abs(this.lat0)<m?this.mode=bi.EQUIT:(this.mode=bi.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,n,a=Math.sin(e.y),o=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case bi.OBLIQ:i=this.sinph0*a+this.cosph0*o*s;break;case bi.EQUIT:i=o*s;break;case bi.S_POLE:i=-a;break;case bi.N_POLE:i=a}switch(t=(i=this.pn1/(this.p-i))*o*Math.sin(e.x),this.mode){case bi.OBLIQ:i*=this.cosph0*a-this.sinph0*o*s;break;case bi.EQUIT:i*=a;break;case bi.N_POLE:i*=-o*s;break;case bi.S_POLE:i*=o*s}return n=1/((r=i*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-i*this.sg)*this.cw*n,i=r*n,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,n={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 a=at(e.x,e.y);if(Math.abs(a)<m)n.x=0,n.y=e.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case bi.OBLIQ:n.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(n.y))*a,e.x*=s*this.cosph0;break;case bi.EQUIT:n.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case bi.N_POLE:n.y=Math.asin(o),e.y=-e.y;break;case bi.S_POLE:n.y=-Math.asin(o)}n.x=Math.atan2(e.x,e.y)}return e.x=n.x+this.long0,e.y=n.y,e},names:["Tilted_Perspective","tpers"]};var xi={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,n,a=e.x,o=e.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/at(this.radius_p*Math.cos(o),Math.sin(o));if(i=s*Math.cos(a)*Math.cos(o),r=s*Math.sin(a)*Math.cos(o),n=s*Math.sin(o),(this.radius_g-i)*i-r*r-n*n*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/at(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/at(r,t)))}else"sphere"===this.shape&&(t=Math.cos(o),i=Math.cos(a)*t,r=Math.sin(a)*t,n=Math.sin(o),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/at(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/at(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,n,a=-1,o=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),o=Math.tan(e.x/this.radius_g_1)*at(1,s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*at(1,o));var l=s/this.radius_p;if(t=o*o+l*l+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a),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),o=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+o*o)),t=o*o+s*s+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};Re.defaultDatum="WGS84",Re.Proj=ge,Re.WGS84=new Re.Proj("WGS84"),Re.Point=Ze,Re.toPoint=ke,Re.defs=q,Re.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),n=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:de(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);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a={header:n,subgrids:function(e,t,i){for(var r=[],n=0;n<t.nSubgrids;n++){var a=fe(e,176,i),o=me(e,176,a,i),s=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),l=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);r.push({ll:[ue(a.lowerLongitude),ue(a.lowerLatitude)],del:[ue(a.longitudeInterval),ue(a.latitudeInterval)],lim:[s,l],count:a.gridNodeCount,cvs:pe(o)})}return r}(i,n,r)};return he[e]=a,a},Re.transform=Oe,Re.mgrs=Be,Re.version="__VERSION__",function(e){e.Proj.projections.add(rt),e.Proj.projections.add(ct),e.Proj.projections.add(dt),e.Proj.projections.add(yt),e.Proj.projections.add(gt),e.Proj.projections.add(vt),e.Proj.projections.add(_t),e.Proj.projections.add(wt),e.Proj.projections.add(xt),e.Proj.projections.add(Lt),e.Proj.projections.add(Nt),e.Proj.projections.add(Ft),e.Proj.projections.add(Bt),e.Proj.projections.add(Ut),e.Proj.projections.add(Wt),e.Proj.projections.add(Yt),e.Proj.projections.add(Xt),e.Proj.projections.add(Jt),e.Proj.projections.add(Kt),e.Proj.projections.add(Zt),e.Proj.projections.add(Qt),e.Proj.projections.add(ei),e.Proj.projections.add(ti),e.Proj.projections.add(ii),e.Proj.projections.add(si),e.Proj.projections.add(gi),e.Proj.projections.add(vi),e.Proj.projections.add(wi),e.Proj.projections.add(xi)}(Re);var Ci=Re;function Si(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 Mi(e,t,i,r){const n=[];for(let a,o=0,s=e.length;o<s;o++)a=t?Mi(e[o],t-1,i,r):(i||Si)(e[o],r),n.push(a);return n}function ki(e,t){return"4326"!==String(e.wkid)?(t.spatialReference=e,n.Projection.project(t,new n.SpatialReference("EPSG:4326"))):t}var Ti=class{static toCartesian3Array(e,t){let i=[];const r=Object(n.defaultValue)(t,{}),a=Object(n.defaultValue)(r.offsetHeight,0);if(!(e instanceof n.Geometry))return i;let o=Object(n.defaultValue)(r.spatialReference,new n.SpatialReference("EPSG:4326"));switch(e.spatialReference&&(o=e.spatialReference),e.type){case n.GeometryType.point:{let t=e.clone();const r=(t=ki(o,t)).coordinates;i.push(Si(r,a));break}case n.GeometryType.multiPoint:case n.GeometryType.lineString:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,0,Si,a);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,1,Si,a);break}case n.GeometryType.multiPolygon:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,2,Si,a);break}case n.GeometryType.extent:{let t=e.clone();const r=(t=ki(o,t)).xmin,n=t.xmax,s=t.ymin,l=t.ymax,h=t.zmin,c=t.zmax;let u,d;t.hasZ?(u=Cesium.Cartesian3.fromDegrees(r,s,h+a),d=Cesium.Cartesian3.fromDegrees(n,l,c+a)):(u=Cesium.Cartesian3.fromDegrees(r,s,a),d=Cesium.Cartesian3.fromDegrees(n,l,a)),i.push(u),i.push(d);break}case n.GeometryType.circle:{let t,r=e.clone();const n=(r=ki(o,r)).center;t=r.hasZ?Cesium.Cartesian3.fromDegrees(n[0],n[1],n[2]+a):Cesium.Cartesian3.fromDegrees(n[0],n[1],a),i.push(t);break}}return i}},Ii=i(1);function Oi(e){let t,i,r,n,a=0;const o=e,s=[];for(t=1;t<o.length;t++)i=o[t],r=o[t-1],a+=n=Cesium.Cartesian3.distance(i,r),s.push(n);this.lenArr=s,this.len=a,this.coords=o}Oi.prototype.getTotalLength=function(){return this.len},Oi.prototype.getDetail=function(e){let t,i,r=e;r>=1&&(r=1),r<=0&&(r=0);const n=r*this.len;let a,o=0;const s=this.coords;for(a=0;a<this.lenArr.length;a++){if(n<=this.lenArr[a]+o){t=a,i=(n-o)/this.lenArr[a];break}o+=this.lenArr[a]}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}},Oi.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 Ei=Oi,Li=i(2);const Pi=Ti.toCartesian3Array;function Ri(e,t){const i=Ii.a.convertLabelClassToLabelNoteStyle(t);return Li.a.parseNoteOptions(e,i)}function ji(e){return e instanceof Cesium.LabelCollection?Li.a.createLabelOptions:e instanceof Cesium.BillboardCollection?Li.a.createNoteBillBoardOptions:Li.a.createGroundOptions}function Ai(e,t,i,r,n,a,o){const s=[],l=function(e,t,i,r,n){let a=n-r;(a<=0||a>=1)&&(a=.4);const o=t-e,s=a*o;return{spaceRate:r*o+e,parseRate:Math.round(s/i*1e3)/1e3}}(i,r,n.length,o.repeatStartRate,o.repeatEndRate);for(let i=0;i<n.length;i++){const r=e.getDetail(l.spaceRate+l.parseRate*i),h=ji(t)(a,n[i],r.position,o);s.push(h)}return s}function zi(e){const t=n.T.bbox(e),i=Math.PI,r=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[3]/180*i)),a=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[1]/180*i)),o=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[2]/180*i,t[3]/180*i));let s;return function(e,t,i,r,a,o,s){const l=n.T.lineSegment(t),h=0===e,c=h?(a-r)/i:(s-o)/i,u=[];let d,p;for(d=0;d<i;d++){const e=h?n.T.lineString([[r+d*c,s],[r+d*c,o]]):n.T.lineString([[a,s-d*c],[r,s-d*c]]),t=n.T.lineIntersect(e,l),i=t.features.length,f=[];let m;if(!(i<1)){for(p=0;p<i;p++)f.push(n.T.getCoord(t.features[p]));if(1===i)m=f[0],u.push(m);else{let e=0;for(let t=0;t<i;t+=2){const i=f[t],r=f[t+1];let n;h?(n=Math.abs(r[1]-i[1]))>=e&&(e=n,m=[i[0],(r[1]-i[1])/2+i[1]]):(n=Math.abs(r[0]-i[0]))>=e&&(e=n,m=[i[0]+(r[0]-i[0])/2,i[1]])}u.push(m)}}}return u}(s=Cesium.Cartesian3.distance(r,o)>Cesium.Cartesian3.distance(r,a)?0:1,e,20,t[0],t[2],t[1],t[3])}class Di{static renderLabel(e,t,i){const r=Di.createLabels(e,t,i);return r.forEach(t=>{e.add(t)}),r}static removeLabels(e,t){const i=e._labels||e._billboards||e._primitives,r=[];t.forEach(e=>{const t=e.id;for(let e=0;e<i.length;e++)i[e].id===t&&r.push(i[e])}),r.forEach(t=>{e.remove(t)})}static createLabels(e,t,i){let r=[];if(t=t||[],!Array.isArray(t)||t.length<=0)return r;const a=t[0].geometry.type;let o;o=[n.GeometryType.multiPolygon,n.GeometryType.polygon].some(e=>e===a)?Ri("Polygon",i):[n.GeometryType.lineString,n.GeometryType.multiLineString].some(e=>e===a)?Ri("Line",i):Ri("Point",i);const{currentAttributeName:s,labelExpression:l,symbol:h={}}=i,c=s?`$feature.${s}`:l,u=ji(e);return t.forEach(t=>{const i=t.geometry,a=i.type;let s=Pi(i);const l=Ii.a.parseExpression(t,c)||h.text||t.symbol.text,d=t.id;if(!l)return r;switch(a){case n.GeometryType.point:case n.GeometryType.multiPoint:{const e=a===n.GeometryType.point?[i.coordinates]:i.coordinates;s.forEach((t,i)=>{const n=u(d,l,t,o);n.__latLng__=e[i],r.push(n)});break}case n.GeometryType.multiLineString:case n.GeometryType.lineString:a===n.GeometryType.lineString&&(s=[s]),s.forEach(t=>{let i=o.lineLabelSpread;const n=o.repeatLabel,a=o.repeatLabelDistance,s=o.labelPositionAlong;if(!l)return r;let h;const c=new Ei(t);if("auto-spread"===i){i=new RegExp("^[A-Za-z0-9]+$").test(l)?"centralization-spread":"decentralize-spread"}if("decentralize-spread"===i){const t=l.split("");if(n){c.getPartsByLength(a).forEach(function(i){const n=i.startRate,a=i.endRate,s=Ai(c,e,n,a,t,d,o);r=r.concat(s)})}else{const i=Ai(c,e,0,1,t,d,o);r=r.concat(i)}}else if("centralization-spread"===i)if(n){c.getPartsByLength(a).forEach(function(e){const t=e.startRate,i=e.endRate;if("start"===s){h=c.getDetail(t).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(i).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail((i-t)/2+t).position;const e=u(d,l,h,o);r.push(e)}})}else if("start"===s){h=c.getDetail(0).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(1).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail(.5).position;const e=u(d,l,h,o);r.push(e)}});break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:a===n.GeometryType.polygon&&(s=[s]),s.forEach(t=>{t.forEach(t=>{const i=o.type,a=function(e){if(!e||0===e.length)return null;const t=e.length;let i;const r=[];let n,a;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&&(n=t.height,a=t.height),n=Math.max(n,t.height),a=Math.min(a,t.height)}return{latlngArr:r,maxHeight:n,minHeight:a}}(t),s=a.maxHeight,h=a.minHeight,c=n.T.polygon([a.latlngArr]),p=n.T.getCoord(n.T.centroid(c));let f=new Cesium.Cartesian3;if("parallel"===i){f=Cesium.Cartesian3.fromDegrees(p[0],p[1],(s+h)/2);const e=u(d,l,f,o);r.push(e)}else if("outside"===i||"bottom"===i){const e=n.T.bbox(c),t=n.T.lineSegment(c),a=[e[0],e[1]],p=[e[2],e[3]],m=n.T.lineString([p,a]),y=n.T.lineIntersect(m,t);let g;if(0===y.features.length)g="outside"===i?p:a;else{const e="outside"===i?p:a;g=n.T.getCoord(n.T.nearestPoint(n.T.point(e),y))}o.positionOffsetXRate=1,o.positionOffsetYRate=1,f=Cesium.Cartesian3.fromDegrees(g[0],g[1],(s+h)/2);const v=u(d,l,f,o);r.push(v)}else if("straight"===i||"skeleton"===i){const t=zi(c);if(t.length<2)return r;const n=[],a=l.split("");t.forEach(function(e){n.push(Cesium.Cartographic.toCartesian(new Cesium.Cartographic(e[0]/180*Math.PI,e[1]/180*Math.PI,0)))});const s=new Ei(n);if("skeleton"===i){const t=Ai(s,e,o.skeletonLineStartRate,o.skeletonLineEndRate,a,d,o);r=r.concat(t)}else{const e=s.getDetail(.5),t=u(d,l,e.position,o);r.push(t)}}})})}}),r}}var Vi=Di;function Ni(e,t,i,r,n){!function e(t,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,s=i-r+1,l=Math.log(o),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(o-h)/o)*(s-o/2<0?-1:1),u=Math.max(r,Math.floor(i-s*h/o+c)),d=Math.min(n,Math.floor(i+(o-s)*h/o+c));e(t,i,u,d,a)}var p=t[i],f=r,m=n;for(Gi(t,r,i),a(t[n],p)>0&&Gi(t,r,n);f<m;){for(Gi(t,f,m),f++,m--;a(t[f],p)<0;)f++;for(;a(t[m],p)>0;)m--}0===a(t[r],p)?Gi(t,r,m):Gi(t,++m,n),m<=i&&(r=m+1),i<=m&&(n=m-1)}}(e,t,i||0,r||e.length-1,n||Fi)}function Gi(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Fi(e,t){return e<t?-1:e>t?1:0}function Bi(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function qi(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function Ui(e,t){Wi(e,0,e.children.length,t,e)}function Wi(e,t,i,r,n){n||(n=tr(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a=t;a<i;a++){var o=e.children[a];Hi(n,e.leaf?r(o):o)}return n}function Hi(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Yi(e,t){return e.minX-t.minX}function Xi(e,t){return e.minY-t.minY}function Ji(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function $i(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Ki(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Zi(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,a-r)}function Qi(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function er(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function tr(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ir(e,t,i,r,n){for(var a=[t,i];a.length;)if(!((i=a.pop())-(t=a.pop())<=r)){var o=t+Math.ceil((i-t)/r/2)*r;Ni(e,o,t,i,n),a.push(t,o,o,i)}}Bi.prototype.all=function(){return this._all(this.data,[])},Bi.prototype.search=function(e){var t=this.data,i=[];if(!er(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var a=0;a<t.children.length;a++){var o=t.children[a],s=t.leaf?r(o):o;er(e,s)&&(t.leaf?i.push(o):Qi(e,s)?this._all(o,i):n.push(o))}t=n.pop()}return i},Bi.prototype.collides=function(e){var t=this.data;if(!er(e,t))return!1;for(var i=[];t;){for(var r=0;r<t.children.length;r++){var n=t.children[r],a=t.leaf?this.toBBox(n):n;if(er(e,a)){if(t.leaf||Qi(e,a))return!0;i.push(n)}}t=i.pop()}return!1},Bi.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},Bi.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},Bi.prototype.clear=function(){return this.data=tr([]),this},Bi.prototype.remove=function(e,t){if(!e)return this;for(var i,r,n,a=this.data,o=this.toBBox(e),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],i=l.pop(),n=!0),a.leaf){var h=qi(e,a.children,t);if(-1!==h)return a.children.splice(h,1),s.push(a),this._condense(s),this}n||a.leaf||!Qi(a,o)?r?(i++,a=r.children[i],n=!1):a=null:(s.push(a),l.push(i),i=0,r=a,a=a.children[0])}return this},Bi.prototype.toBBox=function(e){return e},Bi.prototype.compareMinX=function(e,t){return e.minX-t.minX},Bi.prototype.compareMinY=function(e,t){return e.minY-t.minY},Bi.prototype.toJSON=function(){return this.data},Bi.prototype.fromJSON=function(e){return this.data=e,this},Bi.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},Bi.prototype._build=function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return Ui(n=tr(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=tr([])).leaf=!1,n.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));ir(e,t,i,l,this.compareMinX);for(var h=t;h<=i;h+=l){var c=Math.min(h+l-1,i);ir(e,h,c,s,this.compareMinY);for(var u=h;u<=c;u+=s){var d=Math.min(u+s-1,c);n.children.push(this._build(e,u,d,r-1))}}return Ui(n,this.toBBox),n},Bi.prototype._chooseSubtree=function(e,t,i,r){for(;r.push(t),!t.leaf&&r.length-1!==i;){for(var n=1/0,a=1/0,o=void 0,s=0;s<t.children.length;s++){var l=t.children[s],h=Ji(l),c=Ki(e,l)-h;c<a?(a=c,n=h<n?h:n,o=l):c===a&&h<n&&(n=h,o=l)}t=o||t.children[0]}return t},Bi.prototype._insert=function(e,t,i){var r=i?e:this.toBBox(e),n=[],a=this._chooseSubtree(r,this.data,t,n);for(a.children.push(e),Hi(a,r);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},Bi.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=tr(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,Ui(i,this.toBBox),Ui(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},Bi.prototype._splitRoot=function(e,t){this.data=tr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ui(this.data,this.toBBox)},Bi.prototype._chooseSplitIndex=function(e,t,i){for(var r,n=1/0,a=1/0,o=t;o<=i-t;o++){var s=Wi(e,0,o,this.toBBox),l=Wi(e,o,i,this.toBBox),h=Zi(s,l),c=Ji(s)+Ji(l);h<n?(n=h,r=o,a=c<a?c:a):h===n&&c<a&&(a=c,r=o)}return r||i-t},Bi.prototype._chooseSplitAxis=function(e,t,i){var r=e.leaf?this.compareMinX:Yi,n=e.leaf?this.compareMinY:Xi;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},Bi.prototype._allDistMargin=function(e,t,i,r){e.children.sort(r);for(var n=this.toBBox,a=Wi(e,0,t,n),o=Wi(e,i-t,i,n),s=$i(a)+$i(o),l=t;l<i-t;l++){var h=e.children[l];Hi(a,e.leaf?n(h):h),s+=$i(a)}for(var c=i-t-1;c>=t;c--){var u=e.children[c];Hi(o,e.leaf?n(u):u),s+=$i(o)}return s},Bi.prototype._adjustParentBBoxes=function(e,t,i){for(var r=i;r>=0;r--)Hi(t[r],e)},Bi.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():Ui(e[t],this.toBBox)};var rr=Bi;function nr(e,t){if(t=Cesium.defaultValue(t,Cesium.defaultValue.EMPTY_OBJECT),this.show=Cesium.defaultValue(t.show,!0),this._scene=e,!Cesium.defined(this._scene))throw new Cesium.RuntimeError("必须传入Scene.");this._enabled=Cesium.defaultValue(t.enabled,!0),this._labelFilterFunction=Cesium.defaultValue(t.labelFilterFunction,null),this._guid=Cesium.createGuid(),this._primitives=[],this._rbush=void 0,this._removeEventListener=void 0,this._cacheEntityMap={},this._rBushRefreshTime=100,this._rBushRefreshFunction=null,this._rBushDitry=!0,this.init()}function ar(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function or(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function sr(e,t){let i=e.data;if(!or(t,i))return;const r=[];for(;i;){for(let n=0;n<i.children.length;n++){const a=i.children[n],o=i.leaf?e.toBBox(a):a;if(or(t,o)){if(i.leaf||ar(t,o))return o;r.push(a)}}i=r.pop()}}function lr(e,t){const i=e.canvas.clientWidth,r=e.canvas.clientHeight,n=t.maxX,a=t.maxY,o=t.minX,s=t.minY;return o>i&&s>r||n<0&&a<0}function hr(e,t){let i;if(e instanceof Cesium.Billboard){if(!e||!e.color)return;if(e.show&&t&&e.color.alpha>=1)return;if(!t&&e.color.alpha<=0)return;e._labelRaq&&window.cancelAnimationFrame(e._labelRaq),function r(n){if(e){let n=e.color.alpha;t?(e.show=!0,(n+=.06)>=1?(n=1,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)):(n-=.06)<=0?(e.show=!1,n=0,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)}}()}else e.show=t}function cr(e){return e instanceof Cesium.BillboardCollection?Array.isArray(e._billboards)?e._billboards.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.LabelCollection?Array.isArray(e._labels)?e._labels.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.PrimitiveCollection&&Array.isArray(e._primitives)?e._primitives.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]}nr.prototype.init=function(){Cesium.defined(this._scene)&&(this._rbush=new rr,this._initUpdateFunction(),this._removeEventListener=this._scene.camera.changed.addEventListener(()=>{this._rBushDitry=!0}))},nr.prototype._initUpdateFunction=function(){return this._rBushRefreshFunction?this._rBushRefreshFunction:(this._rBushRefreshFunction=Object(n.throttle)(()=>{try{this._rBushDitry=!1,this._updateVisual()}catch(e){console.error(e)}},this._rBushRefreshTime,this),this._rBushRefreshFunction)},nr.prototype.add=function(e,t,i){const r=Cesium.defined(t);if(!Cesium.defined(e))throw new Cesium.DeveloperError("primitive is required.");if(r){if(t<0)throw new Cesium.DeveloperError("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new Cesium.DeveloperError("index must be less than or equal to the number of primitives.")}const n=e._external=e._external||{};return(n._composites=n._composites||{})[this._guid]={collection:this},r?this._primitives.splice(t,0,e):this._primitives.push(e),e._dynamicEntityVisualizer_uuid||(e._dynamicEntityVisualizer_uuid=Cesium.createGuid()),this._cacheEntityMap[e._dynamicEntityVisualizer_uuid]={itemCollection:cr(e),zIndex:Cesium.defined(i)?i:0},e},nr.prototype.remove=function(e){const t=this._primitives.indexOf(e);t>-1&&(this._primitives.splice(t,1),delete this._cacheEntityMap[e._dynamicEntityVisualizer_uuid])},nr.prototype.setLabelVisible=function(e,t){e&&(e.notRendering=!t)},nr.prototype.getLabelVisible=function(e){return!e||e.notRendering},nr.prototype.removeAll=function(){const e=this._primitives,t=e.length;for(let i=0;i<t;++i)delete e[i]._external._composites[this._guid],e[i].destroy();this._primitives=[],this._cacheEntityMap={}},nr.prototype._forceVisual=function(){this._rBushRefreshFunction()},nr.prototype._updateVisual=function(){const e=this._scene;if(!e)return;const t=this._rbush;if(t){t.clear();const i=this._primitives,r=this;i.sort(function(e,t){let i=0,n=0;const a=r._cacheEntityMap[e._dynamicEntityVisualizer_uuid],o=r._cacheEntityMap[t._dynamicEntityVisualizer_uuid];return a&&Cesium.defined(a.zIndex)&&(i=a.zIndex),o&&Cesium.defined(o.zIndex)&&(n=o.zIndex),n-i}),i.forEach(function(i,n){const a=r._cacheEntityMap[i._dynamicEntityVisualizer_uuid];(a?a.itemCollection:[]).forEach(function(e){e instanceof Cesium.Billboard&&e._imageIndexPromise?e._imageIndexPromise.then(function(){e._isInitEntityVisualizer=!0}):e._isInitEntityVisualizer=!0}),function(e,t,i){let r=i._billboards||i._labels||i._primitives||[];const n=!!(i instanceof Cesium.PrimitiveCollection),a=e.camera.computeViewRectangle();if(a){const{east:e,north:t,south:i,west:o}=a,s=[180*o/Math.PI,180*e/Math.PI],l=[180*i/Math.PI,180*t/Math.PI];r=r.filter(e=>{if(e&&e.__latLng__){const t=e.__latLng__;return!!(t&&t[0]>s[0]&&t[0]<s[1]&&t[1]>l[0]&&t[1]<l[1])||(n?e.show=!1:hr(e,!1),!1)}return!0})}if(i instanceof Cesium.BillboardCollection||i instanceof Cesium.LabelCollection){const i=e.camera.position,n=(r=function(e,t){return e.slice(0).sort(function(e,i){const r=e&&e.position?Cesium.Cartesian3.distance(t,e.position):0,n=i&&i.position?Cesium.Cartesian3.distance(t,i.position):0;return r-n})}(r,i)).length;for(let i=0;i<n;++i){const n=r[i];if(n&&n.computeScreenSpacePosition){const i=new Cesium.Cartesian2;if(n.computeScreenSpacePosition(e,i),i){let r=new Cesium.BoundingRectangle;if(r=n instanceof Cesium.Label?Cesium.Label.getScreenSpaceBoundingBox(n,i,r):Cesium.Billboard.getScreenSpaceBoundingBox(n,i,r),isNaN(r.width)||isNaN(r.height)){hr(n,!1);continue}if(n.notRendering){hr(n,!1);continue}const a={minX:r.x,maxX:r.x+r.width,minY:r.y,maxY:r.y+r.height,data:n};if(lr(e,a)||Math.abs(a.minX-a.maxX)<3||Math.abs(a.minY-a.maxY)<3){hr(n,!1);continue}const o=sr(t,a);o?hr(n,!1):(hr(n,!0),t.insert(a))}}}}else if(i instanceof Cesium.PrimitiveCollection){const r=i._primitives||[];r.forEach(function(i){if(i instanceof Cesium.GroundPrimitive&&i._cacheGroundRect){if(i.notRendering)return void(i.show=!1);const r=i._cacheGroundRect.east,n=i._cacheGroundRect.west,a=i._cacheGroundRect.north,o=i._cacheGroundRect.south,s=[[r,a],[r,o],[n,a],[n,o]];let l,h,c,u;s.forEach(function(t){const i=Cesium.Cartographic.fromRadians(t[0],t[1],0),r=Cesium.Cartographic.toCartesian(i),n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(e,r);n&&(Cesium.defined(l)||(l=n.x),Cesium.defined(h)||(h=n.y),Cesium.defined(c)||(c=n.x),Cesium.defined(u)||(u=n.y),n.x>l&&(l=n.x),n.x<c&&(c=n.x),n.y>h&&(h=n.y),n.y<u&&(u=n.y))});const d={minX:c,maxX:l,minY:u,maxY:h,data:i};if(!(Cesium.defined(c)&&Cesium.defined(l)&&Cesium.defined(u)&&Cesium.defined(h)))return void(d.data.show=!1);if(lr(e,d)||Math.abs(c-l)<3||Math.abs(u-h)<3)return void(d.data.show=!1);const p=sr(t,d);p?d.data.show=!1:(t.insert(d),d.data.show=!0)}})}}(e,t,i)})}},Object.defineProperties(nr.prototype,{}),nr.prototype.update=function(e){if(!this.show)return;const t=this;this._primitives.forEach(function(e){const i=cr(e);i.forEach(function(e){e.show=!1});const r=t._cacheEntityMap[e._dynamicEntityVisualizer_uuid];r&&(r.itemCollection=i,0!==i.length&&(t._rBushDitry=!0))}),this._rBushDitry&&this._rBushRefreshFunction(),this._primitives.forEach(function(t){t.update(e)})},nr.prototype.isDestroyed=function(){return!1},nr.prototype.destroy=function(){this.removeAll()};var ur=nr;class dr{constructor(e){if(e=Object(n.defaultValue)(e,{}),this._scene=e.scene,!this._scene)throw new Error("缺少场景对象Scene");if(this._opacity=Object(n.defaultValue)(e.opacity,1),this._visible=Object(n.defaultValue)(e.visible,!0),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._labelingInfo=Object(n.defaultValue)(e.labelingInfo,[new n.LabelClass]),(!Array.isArray(e.labelingInfo)||Array.isArray(e.labelingInfo)&&0===e.labelingInfo.length)&&(this._labelingInfo=[new n.LabelClass]),!Array.isArray(this._labelingInfo)||this._labelingInfo.length<=0)throw new Error("缺少动态注记样式参数");this._collection=null,this._dynamicEntityVisualizer=null,this._initCollection()}_initCollection(){const e=this._scene,t=this._labelingInfo[0],{renderMode:i,deconflictionStrategy:r="static"}=t;let n;switch(i){case"label":n=new Cesium.LabelCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;case"ground":n=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;default:n=new Cesium.BillboardCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse})}dr.dynamicEntityVisualizer||(dr.dynamicEntityVisualizer=new ur(e),e.primitives.add(dr.dynamicEntityVisualizer)),"static"===r?(this._dynamicEntityVisualizer=dr.dynamicEntityVisualizer,this._collection=this._dynamicEntityVisualizer.add(n)):this._collection=e.primitives.add(n),this._collection.show=this._visible}add(e,t){return Vi.renderLabel(this._collection,e,t||this._labelingInfo[0])}remove(e){Vi.removeLabels(this._collection,e)}createLabels(e,t){return Vi.createLabels(this._collection,e,t||this._labelingInfo[0])}addLabels(e){const t=[];if(!e||!Array.isArray(e))return t;for(let i=0;i<e.length;i++)this._collection.contains(e[i])||t.push(this._collection.add(e[i]));return t}removeLabels(e){if(e&&Array.isArray(e))for(let t=0;t<e.length;t++)this._collection.contains(e[t])&&this._collection.remove(e[t])}destroyed(){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.remove(this._collection):this._scene.primitives.remove(this._collection),this._collection=null}}Object.defineProperties(dr.prototype,{show:{get(){return this._visible},set(e){this._visible=e,this._collection&&(this._collection.show=e)}},translucency:{get(){return this._opacity},set(e){this._opacity=e}},swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._collection.swipeEnabled=e)}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._collection.swipeInverse=e)}}});var pr=dr;class fr{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),e.wkt?this._wkt=e.wkt:e.wkid?this._wkid=e.wkid:this._wkt=n.Projection.getEPSGByWKID(3857).strProject,this.isGeographic()&&(this._geographicProjection=new Cesium.GeographicProjection(this._ellipsoid))}project(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartographic");let i;t=t||{};const r=[Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)],a=(i=n.Projection.projectPoints({points:[r],originWKID:4326,targetWKID:this._wkid,targetDefs:this._wkt})[0])[0],o=i[1],s=e.height;return this.isGeographic()&&this._geographicProjection.project({longitude:i[0],latitude:i[1],height:e.height},t),Cesium.defined(t)?(t.x=a,t.y=o,t.z=s,t):new Cesium.Cartesian3(a,o,s)}unproject(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartesian");let i;t=t||{},this.isGeographic()?this._geographicProjection.unproject(e,i):i=[e.x,e.y],t=n.Projection.isCustomWKID(this._wkid)?n.Projection.projectPoints({points:[i],originWKID:this._wkid,targetWKID:4326})[0]:n.Projection.projectPoints({points:[i],originDefs:this._wkt,targetWKID:4326})[0];const r=Cesium.Math.toRadians(t[0]),a=Cesium.Math.toRadians(t[1]),o=e.z;return Cesium.defined(t)?(t.longitude=r,t.latitude=a,t.height=o,t):new Cesium.Cartographic(r,a,o)}isGeographic(){return!!(this._wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this._wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this._wkt)))}}Object.defineProperties(fr.prototype,{ellipsoid:{get(){return this._ellipsoid}},wkt:{get(){return this._wkt}},wkid:{get(){return this._wkid}}});var mr=fr;class yr{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),!Cesium.defined(e.wkt)&&!Cesium.defined(e.wkid))throw new Cesium.DeveloperError("必须传入wkt或wkid");var t,i,r,a;this._wkt=e.wkt,this._wkid=e.wkid,this._tileInfo=e.tileInfo,this._axisDirection=Cesium.defaultValue(e.axisDirection,{x:1,y:-1}),n.Projection.isCustomWKID(this._wkid)?this._projection=new mr({ellipsoid:this._ellipsoid,wkid:this._wkid}):(this._projection=new mr({ellipsoid:this._ellipsoid,wkt:this._wkt,proj4:e.proj4}),t=e.rectangleSouthwest,i=e.rectangleNortheast,this._rectangleSouthwest=e.rectangleSouthwest,this._rectangleNortheast=e.rectangleNortheast);this._tileInfo.lods[0].resolution;if(this._tileSize={width:this._tileInfo.size[0],height:this._tileInfo.size[1]},this._transformOrigin={x:this._tileInfo.origin.coordinates[0],y:this._tileInfo.origin.coordinates[1]},e.rectangleSouthwest&&e.rectangleNortheast){const n=this._tileInfo.lods[0].level,o=function(e,t){const i=this.getResolutionAtLevel(t);return{x:Math.floor(this._axisDirection.x*(e.x-this._transformOrigin.x)/(this._tileSize.width*i)),y:Math.floor(-this._axisDirection.y*(this._transformOrigin.y-e.y)/(this._tileSize.height*i))}}.bind(this),s=function(e,t,i){const r=this.getResolutionAtLevel(i);let n,a,o,s;return this._axisDirection.x>0?(n=this._transformOrigin.x+e*(this._tileSize.width*r),o=this._transformOrigin.x+(e+1)*(this._tileSize.width*r)):(n=this._transformOrigin.x-(e+1)*(this._tileSize.width*r),o=this._transformOrigin.x-e*(this._tileSize.width*r)),this._axisDirection.y<0?(a=this._transformOrigin.y-(t+1)*(this._tileSize.height*r),s=this._transformOrigin.y-t*(this._tileSize.height*r)):(a=this._transformOrigin.y+t*(this._tileSize.height*r),s=this._transformOrigin.y+(t+1)*(this._tileSize.height*r)),{west:n,south:a,east:o,north:s}}.bind(this),l=e.rectangleSouthwest,h=e.rectangleNortheast,c=new Cesium.Cartesian2(l.x,h.y),u=new Cesium.Cartesian2(h.x,l.y),d=o(l,n),p=s(d.x,d.y,n),f=o(h,n),m=s(f.x,f.y,n),y=o(c,n),g=s(y.x,y.y,n),v=o(u,n),b=s(v.x,v.y,n);t=new Cesium.Cartesian2(p.west,p.south),i=new Cesium.Cartesian2(m.east,m.north),r=new Cesium.Cartesian2(g.west,g.north),a=new Cesium.Cartesian2(b.east,b.south)}else{if(this.isGeographic())t=new Cesium.Cartesian2(-180,-90),i=new Cesium.Cartesian2(180,90);else{const e=this._ellipsoid.maximumRadius*Math.PI;t=new Cesium.Cartesian2(-e,-e),i=new Cesium.Cartesian2(e,e)}r=new Cesium.Cartesian2(t.x,i.y),a=new Cesium.Cartesian2(i.x,t.y),this._rectangleSouthwest=Cesium.Cartesian2.clone(t),this._rectangleNortheast=Cesium.Cartesian2.clone(i)}(this.isGeographic()||this.isWebMercator())&&this.scratchProjectionBounds(t,i);let o,s,l,h,c=void 0,u=void 0,d=void 0,p=void 0;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(c={longitude:Cesium.Math.toRadians(t.x),latitude:Cesium.Math.toRadians(t.y)},u={longitude:Cesium.Math.toRadians(i.x),latitude:Cesium.Math.toRadians(i.y)},d={longitude:Cesium.Math.toRadians(r.x),latitude:Cesium.Math.toRadians(r.y)},p={longitude:Cesium.Math.toRadians(a.x),latitude:Cesium.Math.toRadians(a.y)}):(c=this._projection.unproject(t),u=this._projection.unproject(i),d=this._projection.unproject(r),p=this._projection.unproject(a)),Cesium.defined(this._tileInfo)&&!(this.isGeographic()||isFinite(p.longitude)&&isFinite(p.latitude))){const t=Cesium.Math.toRadians(Cesium.Math.toDegrees(this.getNumberOfXTilesAtLevel(this._tileInfo.lods[0].level)*(this._tileInfo.lods[0].resolution*this._tileSize.width)/this._ellipsoid.maximumRadius));p=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)).clone(),u.longitude=c.longitude+t}this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(o={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)},s={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},l={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},h={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)}):(o=this._projection.unproject(e.rectangleSouthwest),s=this._projection.unproject(e.rectangleNortheast),l=this._projection.unproject(new Cesium.Cartesian2(e.rectangleSouthwest.x,e.rectangleNortheast.y)),h=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)));const f=Math.min(c.longitude,d.longitude,o.longitude,l.longitude),m=Math.min(c.latitude,p.latitude,o.latitude,h.latitude),y=Math.max(u.longitude,p.longitude,s.longitude,h.longitude),g=Math.max(u.latitude,d.latitude,s.latitude,l.latitude);this._rectangle=new Cesium.Rectangle(f,m,y,g)}getNumberOfXTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.x-this._rectangleSouthwest.x)/(this._tileSize.width*i)))?1:t}getNumberOfYTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.y-this._rectangleSouthwest.y)/(this._tileSize.height*i)))?1:t}rectangleToNativeRectangle(e,t){const i=this._projection,r=i.project(Cesium.Rectangle.southwest(e)),n=i.project(Cesium.Rectangle.northeast(e));return Cesium.defined(t)?(t.west=r.x,t.south=r.y,t.east=n.x,t.north=n.y,t):new Cesium.Rectangle(r.x,r.y,n.x,n.y)}tileXYToNativeRectangle(e,t,i,r){const n=new Cesium.Rectangle,a=this.getResolutionAtLevel(i);return this._axisDirection.x>0?(n.west=this._transformOrigin.x+e*(this._tileSize.width*a),n.east=this._transformOrigin.x+(e+1)*(this._tileSize.width*a)):(n.west=this._transformOrigin.x-(e+1)*(this._tileSize.width*a),n.east=this._transformOrigin.x-e*(this._tileSize.width*a)),this._axisDirection.y<0?(n.south=this._transformOrigin.y-(t+1)*(this._tileSize.height*a),n.north=this._transformOrigin.y-t*(this._tileSize.height*a)):(n.south=this._transformOrigin.y+t*(this._tileSize.height*a),n.north=this._transformOrigin.y+(t+1)*(this._tileSize.height*a)),Cesium.defined(r)?(r.west=n.west,r.south=n.south,r.east=n.east,r.north=n.north,r):n}tileXYToRectangle(e,t,i,r){const a=this.tileXYToNativeRectangle(e,t,i,r);if(!isFinite(a.height)||!isFinite(a.width))return this._rectangle;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))a.west=Cesium.Math.toRadians(a.west),a.south=Cesium.Math.toRadians(a.south),a.east=Cesium.Math.toRadians(a.east),a.north=Cesium.Math.toRadians(a.north);else{const e=this._projection,t=e.unproject(new Cesium.Cartesian2(a.west,a.north)),i=e.unproject(new Cesium.Cartesian2(a.east,a.south));a.west=t.longitude,a.south=i.latitude,a.east=i.longitude,a.north=t.latitude}return isFinite(a.height)&&isFinite(a.width)?a:this._rectangle}positionToTileXY(e,t,i){let r=void 0;const a=new Cesium.Cartesian2;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))r={x:Cesium.Math.toDegrees(e.longitude),y:Cesium.Math.toDegrees(e.latitude)};else{r=this._projection.project(e)}const o=this.getResolutionAtLevel(t),s=this._axisDirection.x*(r.x-this._transformOrigin.x)/(this._tileSize.width*o),l=-this._axisDirection.y*(this._transformOrigin.y-r.y)/(this._tileSize.height*o);return a.x=Math.floor(s),a.y=Math.floor(l),Math.abs(s)<Math.pow(10,-8)&&(a.x=0),Math.abs(l)<Math.pow(10,-8)&&(a.y=0),Cesium.defined(i)?(i.x=a.x,i.y=a.y,i):a}getResolutionAtLevel(e){const t=this._tileInfo.lods.find((t,i)=>i===e);return t?t.resolution:void 0}getTileLevelByResolution(e){let t=0,i=0;if(this._tileInfo&&this._tileInfo.lods.length>1)if(Math.abs(e-this._tileInfo.lods[0].resolution)<Math.pow(10,-7))t=this._tileInfo.lods[0].level,i=0;else if(e<this._tileInfo.lods[this._tileInfo.lods.length-1].resolution)t=this._tileInfo.lods[this._tileInfo.lods.length-1].level,i=this._tileInfo.lods.length-1;else for(let r=0;r<this._tileInfo.lods.length-1;r++){const n=this._tileInfo.lods[r],a=this._tileInfo.lods[r+1];if(e<=n.resolution&&e>a.resolution){const o=(n.resolution-e)/(n.resolution-a.resolution);t=o<.5?n.level:n.level+1,i=o<.5?r:r+1;break}}return i}isGeographic(){return!!(this.wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this.wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this.wkt)))}isWebMercator(){return[3857,102113,102100,900913,n.CustomWKID.bd09mc,n.CustomWKID.gcj02mc].includes(this._wkid)}scratchProjectionBounds(e,t){let i=void 0;this.isGeographic()?i=new Cesium.Rectangle(-180,-90,180,90):this.isWebMercator()&&(i=new Cesium.Rectangle(-20037508.34,-20037508.34,20037508.34,20037508.34)),e.x=Cesium.Math.clamp(e.x,i.west,i.east),e.y=Cesium.Math.clamp(e.y,i.south,i.north),t.x=Cesium.Math.clamp(t.x,i.west,i.east),t.y=Cesium.Math.clamp(t.y,i.south,i.north)}}Object.defineProperties(yr.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}},wkid:{get:function(){return this._wkid}},wkt:{get:function(){return this._wkt}}});var gr=yr;var vr=class extends n.LayerView{onAdd(){return new Promise(e=>{this.innerLayer=[],wr.addSceneLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(){return wr.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r=[]}=i;if(i){let e;switch(i.name){case"visible":wr.setVisible(r[0],this);break;case"sbuLayerVisible":wr.setSubLayerVisible(r[0],r[1],this);break;case"opacity":wr.setOpacity(r[0],this);break;case"subLayerOpacity":wr.setSubLayerOpacity(r[0],r[1],this);break;case"renderer":e=this.view.getInnerLayer(this.layer);const t=i.params[0],n=i.params[1];for(let i=0;i<e.length;i++)n===e[i].id&&(e[i].renderer=Ql(t));break;case"reset":wr.reset(r[0],this);break;case"labelingInfo":wr.removeLayer(this),wr.addSceneLayer(this,e=>{this.innerLayer=e})}}}return Promise.resolve(this)}};class br{}function _r(e,t){e.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider,setTimeout(()=>{e.scene.terrainProvider=t},0)}br.addSceneLayer=function(e,t,i){const{layer:r,innerView:a,view:o}=e,s=r.activeScene.allSublayers;let l=0;const h=[];s.forEach(t=>{switch(t.type){case n.SceneSubLayerType.label:const s=br.toPrimitive(t,a,e),{_labelLayer:c}=s;c.id=t.id,h.push(c),l++;break;case n.SceneSubLayerType.mapRef:const u=br.initializeOptions(t,a);u.show=t.visible*e._getLayerViewVisible(r.visible);const d=function(e,t){const i=(e=Object(n.defaultValue)(e,{})).url||"";let r=void 0;i.includes("/igs/rest/g3d/")?r=Jl.addWebTileLayer(e,t):i.includes("/igs/rest/services/")&&i.includes("/SceneServer")&&(e._url=i,r=lh.addIGSMapImageLayer(e,t));return r}(u,a);h.push(d),l++;break;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const p=br.initializeOptions(t,a),f={};f.show=p.show,p.show=t.visible*e._getLayerViewVisible(r.visible),th(p,a,o,function(e){l++,h.push(e),e._backupProperties=f,e._backupProperties.translucency=e.translucency;const i=t.opacity*r.opacity;i<1&&i>=0&&(e.translucency=i),p.autoReset&&ih(e.boundingSphere,p,a)},i)}});const c=br.addTerrainService(e);c&&(h.push(c),l++);const u=setInterval(function(){l===s.items.length&&t&&t instanceof Function&&(clearInterval(u),t(h))},50)},br.toTerrainProvider=function(e){let t=void 0;if(e.type===n.SceneSubLayerType.terrain){const i=br.initializeOptions(e);t=new Mr(i)}return t},br.initTerrainProvider=function(e,t){const{innerView:i,view:r}=e,a=[];let o;t=Object(n.defaultValue)(t,[]);const{allLayerViews:s}=r;let l=[];const h=[];if(l.push(e),(l=l.concat(s._items)).forEach(e=>{t.indexOf(e)<0&&h.push(e)}),h.forEach(e=>{if(e instanceof vr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&a.push(e)})}}),a.length>0){const e=br.initializeOptions(a[0]),t=[];a.forEach(e=>{const i=br.initializeOptions(e);t.push({url:i.url,range:i.range,range3D:i.range3D,requestVertexNormals:i.requestVertexNormals})}),e.url=t,o=new Mr(e),i.scene.terrainProvider=o}return o},br.addTerrainService=function(e,t){const{innerView:i,view:r}=e;let a=[];t=Object(n.defaultValue)(t,[]);let o=void 0;if(!e.layer)return;const s=Object(n.defaultValue)(e.layer.visible,!0);if((a=br.getAllTerrainLayers(e)).length>0){const e=br.initializeOptions(a[0]),t=[];a.forEach(e=>{const{url:i,range:r,range3D:n,requestVertexNormals:a,show:o}=br.initializeOptions(e);t.push({url:i,range:r,range3D:n,requestVertexNormals:a,show:o&&s})}),i.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider?(e.url=void 0,e.serviceList=t,o=new Mr(e),i.scene.terrainProvider=o):((o=i.scene.terrainProvider)._serviceList.push(e),o.addService(e),_r(i,o))}return o},br.getAllTerrainLayers=function(e){const t=[];if(e instanceof vr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&t.push(e)})}return t},br.toPrimitive=function(e,t,i){const r=br.initializeOptions(e,t,i);switch(e.type){case n.SceneSubLayerType.label:const t=r._dynamicEntityVisualizer?r._dynamicEntityVisualizer:r._collection;return t._labelLayer=r,t;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:return new Cesium.MapGISM3DSet(r)}},br.initializeOptions=function(e,t,i){switch(e.type){case n.SceneSubLayerType.terrain:let r=function(e){const t={},i=e.range,r={xMin:i.xmin,yMin:i.ymin,xMax:i.xmax,yMax:i.ymax},a=e.range3D,o={xMin:a.xmin,yMin:a.ymin,xMax:a.xmax,yMax:a.ymax,zMin:a.zmin,zMax:a.zmax};return t.id=Object(n.defaultValue)(e.id,void 0),t.scale=Object(n.defaultValue)(e.elevationScale,void 0),t.range=r,t.range3D=o,t.requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0,t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.show=Object(n.defaultValue)(e.visible,!0),t.autoReset=Object(n.defaultValue)(e.autoReset,!0),t.url=e.layer.url,t}(e);r=Object.assign(r,e.extensionOptions);const{sceneIndex:a,layerIndex:o,layerRenderIndex:s,requestVertexNormals:l,url:h}=r;return h.includes("/SceneServer")?r.url=`${h}/layers/${o}/terrains?level={z}&row={x}&col={y}&xDensity=65&yDensity=65&hasNormals=${l}`:r.url=`${h}/GetTerrain?sceneIndex=${a}&layerIndex=${s}&Level={z}&Row={x}&Col={y}&xdensity=65&ydensity=65&webGL=true&hasNormals=${l}`,r;case n.SceneSubLayerType.label:{let r=e.layer.url,a=e.layer.sceneIndex;r=r.includes("/SceneServer")?`${r}/layers/${e.layerIndex}/labels?level=0&row=0&col=0&format=json&srsName=EPSG:4326`:`${r}/GetLabels?sceneIndex=${a}&layerIndex=${e.layerRenderIndex}&level=0&row=0&col=0&format=json&srsName=EPSG:4326`;const{labelLayer:o,labelingInfo:s,opacity:l}=e,h={labelLayer:o,labelingInfo:s,opacity:l,visible:e.visible&&i._getLayerViewVisible(e.layer.visible)};return function(e,t,i,r){t=Object(n.defaultValue)(t,{}),i=Object(n.defaultValue)(i,{});const a=Object(n.defaultValue)(i.labelingInfo,[]),o=Object(n.defaultValue)(i.visible,!0),s=Object(n.defaultValue)(i.opacity,1),l=r.scene,h=Object(n.defaultValue)(i.layerInfo,{}),c=Object(n.defaultValue)(h.symbolScale,1),u=new Cesium.Resource({url:e}),d=new pr({scene:l,visible:o,opacity:s,labelingInfo:a});return u.fetchJson().then(e=>{Array.isArray(e)&&e.forEach(e=>{const t=Object(n.defaultValue)(e.dot,{}),i=Object(n.defaultValue)(t.x,0),r=Object(n.defaultValue)(t.y,0),o=Object(n.defaultValue)(t.z,0),s=function(e,t,i){Object(n.defaultValue)(e.dot,{});const r=Object(n.defaultValue)(e.geoAnno,{}),a="rgb("+Object(n.defaultValue)(r.color,"255,255,255")+")",o=Object(n.defaultValue)(r.font,"宋体"),s=Object(n.defaultValue)(r.offsetx,0),l=Object(n.defaultValue)(r.offsety,0),h=Object(n.defaultValue)(r.size,20)*t,c=Object(n.defaultValue)(r.text,"");let u=Object(n.defaultValue)(r.italic?"italic":"normal","normal");const d=Object(n.defaultValue)(r.italicType,0),p=Object(n.defaultValue)(r.bold?"bold":"normal","normal"),f=Object(n.defaultValue)(r.angle,0),m=Object(n.defaultValue)(r.shadow,!1),y=Object(n.defaultValue)(r.hollow,!1),g=Object(n.defaultValue)(r.outLine,!1),v=Object(n.defaultValue)(r.strikeOut,!1),b=Object(n.defaultValue)(r.underLine,!1),_=Object(n.defaultValue)(r.space,0),w=Object(n.defaultValue)(r.back,!1),x="rgb("+Object(n.defaultValue)(r.backClr,"255,255,255")+")",C=Object(n.defaultValue)(r.backExp,0);0!==d&&(u="italic ");const S=!1,M="rgb(191, 191, 191)",k=2,T=1,I=1;(m||g)&&(S=!0,g&&(M=x,k=C,T=0,I=0));let O=new n.LabelClass({symbol:{color:y?"rgba(255,255,255,0)":Object(n.defaultValue)(a,"rgba(255,255,255,1)"),haloColor:y?a:"rgba(255,255,255,0)",haloSize:1,lineHeight:1.1,xoffset:s,yoffset:l,angle:f,font:{size:h,family:o,weight:p,style:u},text:c,letterSpacing:_,backgroundColor:w?x:void 0,backgroundPadding:[C,C],textDecorationUnderlineColor:b?a:void 0,textDecorationUnderlineWidth:b?1:0,textDecorationThroughlineColor:v?a:void 0,textDecorationThroughlineWidth:v?1:0,textShadowOffsetX:T,textShadowOffsetY:I,textShadowColor:S?M:void 0,textShadowBlur:k},renderMode:"canvas"});if(i){let e=O.symbol.toJSON();const t=i.symbol?i.symbol:{};(e=Object.assign({},e,t)).text=c;let r=O.toJSON();(r=Object.assign({},r,i)).symbol=e,O=new n.LabelClass(r)}return O}(e,c,Array.isArray(a)&&a.length>0?a[0]:void 0);d.add([new n.Feature({geometry:new n.Point({coordinates:[i,r,o]})})],s)})}),d.type="label",d}(r,e.extensionOptions,h,t)}case n.SceneSubLayerType.mapRef:return function(e){let t={};t.spatialReference=Object(n.defaultValue)(e.spatialReference,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.igserver=!0,t.renderer=Ql(e.renderer),t.translucency=e.opacity,t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0;const i=e.layer.url,r=function(e){let t="";e.includes("/igs/rest/g3d/")?t="g3d":e.includes("/igs/rest/services/")&&e.includes("/SceneServer")&&(t="sceneserver");return t}(i);if("g3d"===r){t.url=`${i}/GetCovering?sceneIndex=${t.sceneIndex}&&layerIndex=${e.layerRenderIndex}&level={z}&row={y}&col={x}`;const{tileInfo:r,extent:a}=function(e){let t=void 0,i=void 0;const r=e.range,a=Math.round((r.xmax-r.xmin)/e.maxFrameSize.wid),o=Math.round((r.ymax-r.ymin)/e.maxFrameSize.hel),s=r.xmin,l=r.ymax,h=s+a*e.maxFrameSize.wid,c=l-o*e.maxFrameSize.hel;t=new n.Extent({xmin:s,ymin:c,xmax:h,ymax:l,spatialReference:r.spatialReference});const u=new n.Point({coordinates:[s,c],spatialReference:r.spatialReference});return i=n.TileInfoUtil.createCommonTileInfo({extent:t,origin:u,numberOfMinLevelTilesX:a}),{extent:t,tileInfo:i}}(e);t.tileInfo=r,t.extent=a,t.tileSliceType="tms"}else"sceneserver"===r&&(t.extent=e.range,t.spatialReference=e.spatialReference,t.httpMethod=e.httpMethod,t.imageWidth=e.imageWidth,t.imageHeight=e.imageHeight,t.url=`${i}/layers/${e.layerIndex}/coverings`);return t}(e);case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const c=eh(e);return c.url=e.layer.url,c.url.includes("/igs/rest/g3d/")?c.url=`${c.url}/GetDataStreams?sceneIndex=${e.layer.sceneIndex}&layerIndex=${e.layerRenderIndex}&Level=0&Row=0&Col=0`:c.url.includes("/igs/rest/services/")&&c.url.includes("/SceneServer"),c.headers&&(c.url=new Cesium.Resource({url:c.url,headers:c.headers})),t&&(c._scene=t.scene),c}},br.removeLayer=function(e){let{innerLayer:t}=e;const{innerView:i}=e;for(let e=0;e<t.length;e++)t[e]instanceof Cesium.MapGISM3DSet?i.scene.primitives.removeAndDestroy(t[e]):t[e]instanceof pr?t[e].destroyed():t[e]instanceof Cesium.ImageryLayer?i.scene.imageryLayers.remove(t[e]):t[e]instanceof Mr&&(t[e]=new Cesium.EllipsoidTerrainProvider,i.scene.terrainProvider=t[e]);t=[]},br.setVisible=function(e,t){const{innerLayer:i,innerView:r}=t,n=t._getLayerViewVisible(e);for(let a=0;a<i.length;a++)if(i[a]instanceof Cesium.MapGISM3DSet)i[a].show=i[a]._backupProperties.show&&n;else if(i[a]instanceof pr)i[a].show=n;else if(i[a]instanceof Cesium.ImageryLayer)i[a].show=n;else if(i[a]instanceof Mr)if(!0===e)br.addTerrainService(t);else if(!1===e){const e=[];br.getAllTerrainLayers(t).forEach(t=>{e.push(br.initializeOptions(t))}),i[a].removeServices(e),_r(r,i[a])}},br.setSubLayerVisible=function(e,t,i){const{innerLayer:r,layer:n,innerView:a}=i,o=e&&n.visible,s=i._getLayerViewVisible(o);for(let n=0;n<r.length;n++)if(String(r[n].id)===String(t)){if(r[n]instanceof Cesium.MapGISM3DSet)r[n].show=s,r[n]._backupProperties.show=e;else if(r[n]instanceof pr)r[n].show=s;else if(r[n]instanceof Cesium.ImageryLayer)r[n].show=s;else if(r[n]instanceof Mr)if(!0===e)br.addTerrainService(i);else if(!1===e){const e=[];br.getAllTerrainLayers(i).forEach(t=>{e.push(br.initializeOptions(t))}),r[n].removeServices(e),_r(a,r[n])}break}},br.setOpacity=function(e,t){const{innerLayer:i}=t;for(let t=0;t<i.length;t++)i[t]instanceof Cesium.MapGISM3DSet&&(i[t].translucency=i[t]._backupProperties.translucency*e)},br.setSubLayerOpacity=function(e,t,i){const{innerLayer:r,layer:n}=i;for(let i=0;i<r.length;i++)if(String(r[i].id)===String(t)){r[i]instanceof Cesium.MapGISM3DSet&&(r[i].translucency=e*n.opacity,r[i]._backupProperties.translucency=e);break}},br.reset=function(e,t){const{innerLayer:i,innerView:r}=t;for(let t=0;t<i.length;t++)if(String(i[t].id)===String(e)){ih(i[t].boundingSphere,{},r);break}};var wr=br;function xr(e,t,i,r){let n;if(1===e.length)n=e[0];else for(let a=0;a<e.length;++a){const o=e[a];if(o.availability&&o.availability.isTileAvailable(t,i,r)){n=o;break}}return n}var Cr=class{constructor(e){this._layers=Object(n.defaultValue)(e,[])}addAvailableTileRange(e,t,i,r,n){const a=xr(this._layers,e,(t+r)/2,(i+n)/2);a&&a.availability.addAvailableTileRange(e,t,i,r,n)}computeMaximumLevelAtPosition(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeMaximumLevelAtPosition(e))>0);i++);return t}computeBestAvailableLevelOverRectangle(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeBestAvailableLevelOverRectangle(e))>0);i++);return t}isTileAvailable(e,t,i){const r=xr(this._layers,e,t,i);return!!r&&r.availability.isTileAvailable(e,t,i)}computeChildMaskForTile(e,t,i){const r=this._getLayerToUse(e,t,i);let n=0;return r&&(n=r.availability.computeChildMaskForTile(e,t,i)),n}_getLayerToUse(e,t,i){let r;if(1===this._layers.length)r=this._layers[0];else for(let n=0;n<this._layers.length;++n){const a=this._layers[n];if(a.availability&&a.availability.isTileAvailable(e,t,i)){r=a;break}}return r}};class Sr{constructor(e){this.url=Object(n.defaultValue)(e.url,void 0),this.range=Object(n.defaultValue)(e.range,void 0),this.range3D=Object(n.defaultValue)(e.range3D,void 0),this.proxy=Object(n.defaultValue)(e.proxy,void 0),this.maxLevel=Object(n.defaultValue)(e.maxLevel,20),this.terrainColorTblInfo=Object(n.defaultValue)(e.terrainColorTblInfo,void 0),this.terrainColorTblMinHeight=Object(n.defaultValue)(e.terrainColorTblMinHeight,void 0),this.terrainColorTblMaxHeight=Object(n.defaultValue)(e.terrainColorTblMaxHeight,void 0),this.id=Object(n.defaultValue)(e.id,void 0),this._tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.GeographicTilingScheme),this._requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure={heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},this._ready=!1,this._readyPromise=new Promise((e,t)=>{}),this._layers=[];const t=Object(n.defaultValue)(e.serviceList,[]);this._serviceList=Object(n.cloneObject)(t),this.show=Object(n.defaultValue)(e.show,!0),this._repeat=Object(n.defaultValue)(e.repeat,new Cesium.Cartesian2(1,1)),this._layerToUse=void 0,this._availability=void 0;let i=Object(n.defaultValue)(e.credit,void 0);"string"==typeof i&&(i=new Cesium.Credit(i)),this._credit=i,this._init()}static async fromUrl(e,t){const i=new n.IGSSceneLayer({url:e}),r=(await i.load()).activeScene.sublayers.items;let a=void 0;for(let e=0;e<r.length;e++)if(r[e].type===n.SceneSubLayerType.terrain){const i=wr.initializeOptions(r[e]);a=new Sr({...i,...t})}return a}requestTileGeometry(e,t,i,r){if(this._ready||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),0===i&&0===e&&0===t||0===i&&1===e&&0===t)return Promise.resolve(this._getEmptyHeightMap());if(1===this._layers.length)this._layerToUse=this._layers[0];else for(let r=0;r<this._layers.length;++r){const n=this._layers[r];if(n.availability&&n.availability.isTileAvailable(i,e,t)){this._layerToUse=n;break}}if(!Cesium.defined(this._layerToUse))return this._getDefaultHeightMapData();0===this._layerToUse.tileUrlTemplates.length&&n.Log.error("请求地形数据的接口模板没有设置!");const a=this._getRequestHeader();let o=this._tilingScheme.getNumberOfYTilesAtLevel(i)-t-1,s=this._layerToUse.resource.url.replace("{z}",i).replace("{x}",e).replace("{y}",o),l=this._layerToUse.resource.getDerivedResource({url:s,headers:a,request:r,proxy:this.proxy}).fetchArrayBuffer();return Cesium.defined(l)?l.then(e=>{if(1===e.byteLength){"@"===new TextDecoder("utf-8").decode(e)&&(e=new Uint16Array(this._heightmapWidth*this._heightmapWidth))}return this._createHeightMapByTerrainData(e)}):void 0}_getDefaultHeightMapData(){const e=new Uint16Array(this._heightmapWidth*this._heightmapWidth);return this._createHeightMapByTerrainData(e)}getLevelMaximumGeometricError(e){return this._levelZeroMaximumGeometricError/(1<<e)}getTileDataAvailable(e,t,i){let r=!1;for(let n=0;n<this._layers.length;n++){const a=this._layers[n].availability;if(a&&a.isTileAvailable(i,e,t)){r=!0;break}}return r}loadTileDataAvailability(e,t,i){function r(e,t,i,r){if(0!==r){var n=e.availabilityLevels,a=r%n==0?r-n:(r/n|0)*n,o=1<<r-a;return{level:a,x:t/o|0,y:i/o|0}}}var n=xr(this._layers,i,e,t);if(!(!n.availability||i>n._availability._maximumLevel||n._availability.isTileAvailable(i,e,t))&&this.hasMetadata){var a=function(e,t,i,n,a){if(!a.availabilityLevels)return{result:!1};for(var o,s=function(){delete a.availabilityPromiseCache[o]},l=a.availabilityTilesLoaded,h=a.availability,c=r(a,t,i,n);c;){if(h.isTileAvailable(c.level,c.x,c.y)&&!l.isTileAvailable(c.level,c.x,c.y)){let t;if(o=c.level+"-"+c.x+"-"+c.y,!(t=a.availabilityPromiseCache[o])){var u=new Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.TERRAIN});(t=e.requestTileGeometry(e,c.x,c.y,c.level,u))&&(a.availabilityPromiseCache[o]=t,t.then(s))}return{result:!0,promise:t}}c=r(a,c.x,c.y,c.level)}return{result:!1}}(this,e,t,i,n);return a.promise?a.promise:void 0}}_init(){if(this.url){const e={url:this.url,maxLevel:this.maxLevel,requestVertexNormals:this._requestVertexNormals,range:this.range,tilingScheme:this._tilingScheme,show:this.show};this._serviceList.push(e),this.addService(e)}else this._serviceList instanceof Array&&this._serviceList.length>0&&(this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range),this._serviceList.forEach(e=>{this.addService(e)}));this._availability=new Cr(this._layers)}addService(e){this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range);const t=Object(n.defaultValue)(e.maxLevel,this.maxLevel),i=Object(n.defaultValue)(e.range,this.range),r=Object(n.defaultValue)(e.url,void 0),a=Object(n.defaultValue)(e.show,!0);this._customTerrainInfo({url:r,tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"],maxzoom:t,requestVertexNormals:Object(n.defaultValue)(e.requestVertexNormals,this._requestVertexNormals),available:this._calcAvailability(i,t,this._tilingScheme),show:a})}removeServices(e){const t=[];e.forEach(e=>{const i=this._removeServiceFromServiceList(e);i>-1&&t.push(i)})}removeService(e){_removeServiceFromServiceList}_removeServiceFromServiceList(e){let t=-1;return this._serviceList.forEach((i,r)=>{i.url===e.url&&(t=r)}),t>-1&&(this._serviceList.splice(t,1),this._layers.splice(t,1)),t}_combineRange(e){e=Object(n.defaultValue)(e,"2D");const t=[];if(this._serviceList.forEach(i=>{let r;(r="2D"===e?i.range:i.range3D)&&t.push(r)}),t.length>0){let i,r,n,a=t[0].xMin,o=t[0].xMax,s=t[0].yMin,l=t[0].yMax;"3D"===e&&(i=t[0].zMin,r=t[0].zMax),t.forEach(t=>{t.xMin<a&&(a=t.xMin),t.xMax>o&&(o=t.xMax),t.yMin<s&&(s=t.yMin),t.yMax>l&&(l=t.yMax),"3D"===e&&(t.zMin<i&&(i=t.zMin),t.zMax>r&&(r=t.zMax))}),(n="2D"===e?this.range:this.range3D)?(a<n.xMin&&(n.xMin=a),o>n.xMax&&(n.xMax=o),s<n.yMin&&(n.yMin=s),l>n.yMax&&(n.yMax=l),"3D"===e&&(i<n.zMin&&(n.yMin=s),r>n.zMax&&(n.zMax=r))):"2D"===e?this.range={xMin:a,xMax:o,yMin:s,yMax:l}:this.range3D={xMin:a,xMax:o,yMin:s,yMax:l,zMin:i,zMax:r}}else this.range||n.Log.error("地形二维范围不存在!")}_customTerrainInfo(e){const{tiles:t,available:i,requestVertexNormals:r}=e,n=new Cesium.TileAvailability(this._tilingScheme,i.length);for(let e=0;e<i.length;++e){let t=i[e];for(let i=0;i<t.length;++i){let r=t[i];n.addAvailableTileRange(e,r.startX,r.startY,r.endX,r.endY)}}const a=Cesium.Resource.createIfNeeded(e.url);a.queryParameters.hasOwnProperty("hasNormals")||(a.queryParameters.hasNormals=r),this._layers.push(this._initTerrainLayer({resource:a,version:e.version,isHeightmap:!0,tileUrlTemplates:t,availability:n,hasVertexNormals:this.hasVertexNormals,littleEndianExtensionSize:!0})),this._ready=!0,this._readyPromise=new Promise((e,t)=>{e()})}_formatRange(e){(e.yMin<-84||e.yMin>84)&&(e.yMin=-84),e.yMax>84&&(e.yMax=84),e.xMax>180&&(e.xMax=180),(e.xMin<-180||e.xMin>180)&&(e.xMin=-180)}_calcAvailability(e,t,i){let r,n,a,o=Cesium.Cartographic.fromDegrees(e.xMin,e.yMin,new Cesium.Cartographic),s=Cesium.Cartographic.fromDegrees(e.xMax,e.yMax,new Cesium.Cartographic),l=[[{endX:1,endY:0,startX:0,startY:0}]];for(let e=1;e<t;++e)n=i.positionToTileXY(o,e),a=i.positionToTileXY(s,e),r={startX:n.x,startY:a.y,endX:a.x,endY:n.y},l.push([r]);return l}_getEmptyHeightMap(){return new Cesium.HeightmapTerrainData({buffer:new Uint16Array(this._heightmapWidth*this._heightmapWidth),width:this._heightmapWidth,height:this._heightmapWidth})}_initTerrainLayer(e){return{resource:e.resource,version:e.version,isHeightmap:e.isHeightmap,tileUrlTemplates:e.tileUrlTemplates,availability:e.availability,hasVertexNormals:e.hasVertexNormals,hasMetadata:e.hasMetadata,availabilityLevels:e.availabilityLevels,availabilityTilesLoaded:e.availabilityTilesLoaded,littleEndianExtensionSize:e.littleEndianExtensionSize,availabilityPromiseCache:{},show:e.show}}_getRequestHeader(){return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}_createHeightMapByTerrainData(e){let t,i,r;const n=this._heightmapWidth*this._heightmapWidth*Uint16Array.BYTES_PER_ELEMENT+Uint16Array.BYTES_PER_ELEMENT;if(t=e.byteLength>n?new Float32Array(e,0,this._heightmapWidth*this._heightmapWidth):new Uint16Array(e,0,this._heightmapWidth*this._heightmapWidth),this.hasVertexNormals){i=new Uint8Array(this._heightmapWidth*this._heightmapWidth*2);const t=(this._heightmapWidth*this._heightmapWidth+1)*Float32Array.BYTES_PER_ELEMENT;r=new Uint8Array(e,t,(this._heightmapWidth+2)*(this._heightmapWidth+2)*2);for(let e=0;e<this._heightmapWidth;e++)for(let t=0;t<this._heightmapWidth;t++){const n=e*this._heightmapWidth+t,a=(e+1)*(this._heightmapWidth+2)+t+1;i[2*n]=r[2*a],i[2*n+1]=r[2*a+1]}}return new Cesium.HeightmapTerrainData({buffer:t,width:this._heightmapWidth,height:this._heightmapWidth,structure:this._heightmapStructure,encodedNormals:i,childTileMask:15,repeat:this._repeat})}}Object.defineProperties(Sr.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._ready||n.Log.error("credit must not be called before the terrain provider is ready."),this._credit}},tilingScheme:{get:function(){return this._ready||n.Log.error("tilingScheme must not be called before the terrain provider is ready."),this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},hasMetadata:{get:function(){return this._ready||n.Log.error("hasMetadata must not be called before the terrain provider is ready."),!0}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},repeat:{get:function(){return this._repeat},set:function(e){this._repeat=e}},availability:{get:function(){return this._ready&&this._layerToUse||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),this._availability}}});var Mr=Sr;class kr{static isGeographic(e){let t=!1;return(e instanceof Cesium.GeographicProjection||e.isGeographic&&e.isGeographic())&&(t=!0),t}}class Tr{constructor(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.headers,{}),i=Object.assign({},e);i.extensions=[];const r=Object(n.defaultValue)(e.extensions,[]),a=Object(n.defaultValue)(e.url,"");let o;(o=a instanceof Cesium.Resource?a:new Cesium.Resource({url:a})).headers=t,r&&r instanceof Array&&(e.tokenKey&&e.tokenValue&&r.push({key:e.tokenKey,value:e.tokenValue}),r.forEach(e=>{e&&(o.queryParameters[e.key]=e.value)})),i.url=o;const s=new Cesium.ArcGisMapServerImageryProvider(i);return s._transparent=e.transparent,s._format=e.format,s.requestImage=((e,t,i,r)=>{if(!s._ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");return Cesium.ImageryProvider.loadImage(s,this._buildImageResource(s,e,t,i,r))}),s}static async fromUrl(e,t){const i=new n.ArcGISMapImageLayer({url:e}),r=await i.load(),a=Er.initializeOptions(r),o=new Tr({...a,...t});return Cesium.defined(o._resource)||(o._resource=Cesium.Resource.createIfNeeded(e),o._resource.appendForwardSlash()),o}_buildImageResource(e,t,i,r,n){let a;if(e._useTiles)a=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n,queryParameters:e._resource.queryParameters});else{const o=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s={bbox:o.west+","+o.south+","+o.east+","+o.north,size:e._tileWidth+","+e._tileHeight,format:e._format,transparent:e._transparent,f:"image"};kr.isGeographic(e._tilingScheme.projection)?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers="show:"+e.layers);const l=Object.assign(e._resource.queryParameters,s);a=e._resource.getDerivedResource({url:"export",request:n,queryParameters:l})}return a}}var Ir=Tr;class Or{}Or.addArcGISMapImageLayer=function(e,t){const i=Or.initializeOptions(e),r=Kl(e,t),n=new Ir(i);Cesium.defined(n._resource)||(n._resource=Cesium.Resource.createIfNeeded(i.url),n._resource.appendForwardSlash());const a=t.imageryLayers.addImageryProvider(n,r);return a.id=e.id,a._realIndex=e._realIndex+1,a},Or.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),{extensionOptions:o={}}=e;let s={url:e.url,usePreCachedTilesIfAvailable:!1,layers:e.layers,tilingScheme:i,rectangle:a,headers:e.headers,tokenKey:e.tokenKey,tokenValue:e.tokenValue,transparent:e.imageTransparency,format:e.imageFormat};return s=Object.assign(s,o)},Or.removeLayer=function(e,t){t.imageryLayers.remove(e)};var Er=Or;class Lr{}Lr.addWMSLayer=function(e,t){const i=Lr.initializeOptions(e),r=Kl(e,t),n=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Lr.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),o=Object(n.isWMSReverse)(e.version,e.spatialReference);let s=e.url;e.tokenKey&&e.tokenValue&&(s=`${s}?${e.tokenKey}=${e.tokenValue}`);let l={url:s,layers:e.layers,parameters:{format:e.imageFormat,transparent:e.imageTransparency,version:e.version},tilingScheme:i,tileWidth:e.imageWidth,tileHeight:e.imageHeight,srs:`EPSG:${e.spatialReference.wkid}`,crs:`EPSG:${e.spatialReference.wkid}`,isReverseBBOX:o,rectangle:a};const{extensionOptions:h={}}=e;return l=Object.assign(l,h)},Lr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Pr=Lr;class Rr{}Rr.addArcGISTileLayer=function(e,t){const i=Rr.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider(i),r);return n.id=e.id,n._realIndex=e._realIndex+1,n},Rr.initializeOptions=function(e){const t=$l(e.spatialReference,e.extent,e.tileInfo),i=Zl(e,t.rectangle),r=new Cesium.Rectangle(i.xmin,i.ymin,i.xmax,i.ymax);let n={url:`${e.url}/tile/{z}/{y}/{x}`,tilingScheme:t,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,rectangle:r};const{extensionOptions:a={}}=e;return n=Object.assign(n,a)},Rr.removeLayer=function(e,t){t.imageryLayers.remove(e)};var jr=Rr;class Ar{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._imageVersion=Cesium.defaultValue(e.imageVersion,"0"),this._resource=Cesium.Resource.createIfNeeded(e.url),this._mapStyle=e.mapStyle,this._proxy=e.proxy,this._imageInfoUrl=e.url,this._url=e.url,this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this.isStretchImage=Cesium.defaultValue(e.isStretchImage,!1),this._mapgisOffset=Cesium.defaultValue(e.mapgisOffset,0),this._buildImageResource=Cesium.defaultValue(e.buildImageResource,void 0),this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS"))}static async fromUrl(e,t){const i=new n.IGSTileLayer({url:e}),r=await i.load(),a=Vr.initializeOptions(r);return new Ar({...a,...t})}buildImageResource(e,t,i,r){if(this._buildImageResource&&this._buildImageResource instanceof Function)return this._buildImageResource(this,e,t,i,r);let n=this._resource.url;return n.includes("/igs/rest/services/")&&n.includes("/TileServer")?(512!==this._tileWidth&&"mapgis-tianditu"!==this._mapStyle||(i+=1),n=`${this._resource.url}/tileImage/${i}/${t}/${e}/?f=image`):n=(n=(n=512===this._tileWidth||"mapgis-tianditu"===this._mapStyle?n.replace("{level}",i+1):n.replace("{level}",i)).replace("{row}",t)).replace("{col}",e),this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return i+=this.mapgisOffset,Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);r=(r=(r=r.replace("{row}",t)).replace("{col}",e)).replace("{level}",i),this._isHistoryImage&&(r=r.replace("{version}",this._imageVersion));return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(e=>{const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(Ar.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},mapgisOffset:{get:function(){return this._mapgisOffset}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});var zr=Ar;class Dr{}Dr.addIGSTileLayer=function(e,t){const i=Dr.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new zr(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Dr.initializeOptions=function(e){const t=e.tileInfo.clone(),i=t.lods;for(;i.length>0&&0!==i[0].level;){const e=i[0];i.unshift(n.LOD.fromJSON({level:e.level-1,resolution:2*e.resolution,scale:2*e.scale}))}const r=$l(e.spatialReference,e.extent,t),a=Zl(e,r.rectangle),o=new Cesium.Rectangle(a.xmin,a.ymin,a.xmax,a.ymax),[s,l]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let h=e.url;"1.0"===e._igsVersion&&(h=`${e.url}/{level}/{row}/{col}`);let c={url:h,tileWidth:t.cols,tileHeight:t.cols,tilingScheme:r,rectangle:o,minimumLevel:s,maximumLevel:l};const{extensionOptions:u={}}=e;return c=Object.assign(c,u)},Dr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Vr=Dr;class Nr{}Nr.addWMTSLayer=function(e,t){const i=Nr.initializeOptions(e),r=Kl(e,t),a=new Cesium.WebMapTileServiceImageryProvider(i);a.isStretchImage=Object(n.defaultValue)(i.isStretchImage,!1);const o=t.scene.imageryLayers.addImageryProvider(a,r);return e.clippingArea&&rh(e,o,t),o.id=e.id,o._realIndex=e._realIndex+1,o},Nr.initializeOptions=function(e){const t=e.getCurrentTileInfo();let i=$l(e.spatialReference,e.activeLayer.extent,t);e.spatialReference.isWebMercator?t.lods[0].resolution*t.size[0]>40075016.685574&&(i=new Cesium.WebMercatorTilingScheme):e.spatialReference.isGeographic&&t.lods[0].resolution*t.size[0]>180&&(i=new Cesium.GeographicTilingScheme);const r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(t);let l=e.url;e.tokenValue&&e.tokenKey&&(l+=`?${e.tokenKey}=${e.tokenValue}`);let h={url:l,layer:e.activeLayer.title,format:e.activeLayer.imageFormat,style:e.activeLayer.styleId,tileMatrixSetID:e.activeLayer.tileMatrixSetId,tilingScheme:i,tileWidth:t.size[0],tileHeight:t.size[1],rectangle:a,minimumLevel:o,maximumLevel:s};const{extensionOptions:c={}}=e;return h=Object.assign(h,c)},Nr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Gr=Nr;function Fr(){return function(){throw new Error("Unimplemented abstract method.")}()}var Br=0;function qr(e){return e.ol_uid||(e.ol_uid=String(++Br))}var Ur="5.3.3",Wr=function(e){function t(t){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===Ur?Ur:"v"+Ur.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 Hr(e,t){if(!e)throw new Wr(t)}var Yr=i(8),Xr=i.n(Yr),Jr="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),n=1,a=arguments.length;n<a;++n){var o=i[n];if(void 0!==o&&null!==o)for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])}return r};function $r(e){for(var t in e)delete e[t]}function Kr(e){var t;for(t in e)return!1;return!t}function Zr(e,t,i){return Math.min(Math.max(e,t),i)}var Qr="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};function en(e,t,i,r,n,a){var o=n-i,s=a-r;if(0!==o||0!==s){var l=((e-i)*o+(t-r)*s)/(o*o+s*s);l>1?(i=n,r=a):l>0&&(i+=o*l,r+=s*l)}return tn(e,t,i,r)}function tn(e,t,i,r){var n=i-e,a=r-t;return n*n+a*a}function rn(e,t,i){return e+i*(t-e)}var nn={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"};
12
+ t.read=function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,h=l>>1,c=-7,u=i?n-1:0,d=i?-1:1,p=e[t+u];for(u+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+u],u+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+u],u+=d,c-=8);if(0===a)a=1-h;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=h}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,i,r,n,a){var o,s,l,h=8*a-n-1,c=(1<<h)-1,u=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(s=0,o=c):o+u>=1?(s=(t*l-1)*Math.pow(2,n),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(o=o<<n|s,h+=n;h>0;e[i+p]=255&o,p+=f,o/=256,h-=8);e[i+p-f]|=128*m}},function(e,t,i){"use strict";i.r(t);var r={};i.r(r),i.d(r,"createBillboard",function(){return Nh}),i.d(r,"createLabel",function(){return Gh}),i.d(r,"createModelPrimitive",function(){return Fh}),i.d(r,"createObject3DAppearance",function(){return Bh}),i.d(r,"createSpherePrimitive",function(){return qh}),i.d(r,"createCylinderPrimitive",function(){return Uh}),i.d(r,"getShadows",function(){return Wh});var n=i(0),a=1,o=2,s=3,l=4,h=5,c=484813681109536e-20,u=Math.PI/2,d=.16666666666666666,p=.04722222222222222,f=.022156084656084655,m=1e-10,y=.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 S(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),n=t.toLowerCase().replace(C,""),a=-1;++a<r.length;)if((i=r[a]).toLowerCase().replace(C,"")===n)return e[i]}var M=function(e){var t,i,r,n={},a=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},{}),o={proj:"projName",datum:"datumCode",rf:function(e){n.rf=parseFloat(e)},lat_0:function(e){n.lat0=e*y},lat_1:function(e){n.lat1=e*y},lat_2:function(e){n.lat2=e*y},lat_ts:function(e){n.lat_ts=e*y},lon_0:function(e){n.long0=e*y},lon_1:function(e){n.long1=e*y},lon_2:function(e){n.long2=e*y},alpha:function(e){n.alpha=parseFloat(e)*y},gamma:function(e){n.rectified_grid_angle=parseFloat(e)},lonc:function(e){n.longc=e*y},x_0:function(e){n.x0=parseFloat(e)},y_0:function(e){n.y0=parseFloat(e)},k_0:function(e){n.k0=parseFloat(e)},k:function(e){n.k0=parseFloat(e)},a:function(e){n.a=parseFloat(e)},b:function(e){n.b=parseFloat(e)},r_a:function(){n.R_A=!0},zone:function(e){n.zone=parseInt(e,10)},south:function(){n.utmSouth=!0},towgs84:function(e){n.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){n.to_meter=parseFloat(e)},units:function(e){n.units=e;var t=S(x,e);t&&(n.to_meter=t.to_meter)},from_greenwich:function(e){n.from_greenwich=e*y},pm:function(e){var t=S(w,e);n.from_greenwich=(t||parseFloat(e))*y},nadgrids:function(e){"@null"===e?n.datumCode="none":n.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))&&(n.axis=e)},approx:function(){n.approx=!0}};for(t in a)i=a[t],t in o?"function"==typeof(r=o[t])?r(i):n[r]=i:n[t]=i;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n},k=function(e){return new j(e).output()},T=1,I=/\s/,O=/[A-Za-z]/,E=/[A-Za-z84_]/,P=/[,\]]/,R=/[\d\.E\-\+]/;function j(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 A(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,n=i.reduce(function(e,t){return z(t,e),e},r);t&&(e[t]=n)}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"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return e[0]=["name",e[0]],void A(t,i,e);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return e[0]=["name",e[0]],A(t,i,e),void(t[i].type=i);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return z(e,t[i]);return A(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}j.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}},j.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)},j.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},j.prototype.number=function(e){if(!R.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},j.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},j.prototype.keyword=function(e){if(E.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)}},j.prototype.neutral=function(e){if(O.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(R.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)},j.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,V=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function N(e){return e*D}function G(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+":"+e.AUTHORITY[t])}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 i="",r=0,n=e.AXIS.length;r<n;++r){var a=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?i+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?i+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?i+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(e.axis=i)}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 o=e.GEOGCS;function s(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"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"),"belge_1972"===e.datumCode&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.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",N],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",N],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",N],["lat0","latitude_of_origin",N],["lat0","standard_parallel_1",N],["lat1","standard_parallel_1",N],["lat2","standard_parallel_2",N],["azimuth","Azimuth"],["alpha","azimuth",N],["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=N(e.lat0>0?90:-90)):(e.lat0=N(e.lat1>0?90:-90),e.lat_ts=e.lat1)}var F=function(e){var t=k(e),i=t[0],r={};return z(t,r),function e(t){for(var i=Object.keys(t),r=0,n=i.length;r<n;++r){var a=i[r];-1!==V.indexOf(a)&&G(t[a]),"object"==typeof t[a]&&e(t[a])}}(r),r[i]};function B(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?B[e]=M(arguments[1]):B[e]=F(arguments[1]):B[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?B.apply(t,e):B(e)});if("string"==typeof e){if(e in B)return B[e]}else"EPSG"in e?B["EPSG:"+e.EPSG]=e:"ESRI"in e?B["ESRI:"+e.ESRI]=e:"IAU2000"in e?B["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"]}(B);var q=B;var U=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var W=["3857","900913","3785","102113"];var H=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in q}(e))return q[e];if(function(e){return U.some(function(t){return e.indexOf(t)>-1})}(e)){var t=F(e);if(function(e){var t=S(e,"authority");if(t){var i=S(t,"epsg");return i&&W.indexOf(i)>-1}}(t))return q["EPSG:3857"];var i=function(e){var t=S(e,"extension");if(t)return S(t,"proj4")}(t);return i?M(i):t}return function(e){return"+"===e[0]}(e)?M(e):void 0},Y=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},X=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},J=function(e){return e<0?-1:1},$=function(e){return Math.abs(e)<=_?e:e-J(e)*b},K=function(e,t,i){var r=e*i,n=.5*e;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(u-t))/r},Z=function(e,t){for(var i,r,n=.5*e,a=u-2*Math.atan(t),o=0;o<=15;o++)if(i=e*Math.sin(a),a+=r=u-2*Math.atan(t*Math.pow((1-i)/(1+i),n))-a,Math.abs(r)<=1e-10)return a;return-9999};function Q(e){return e}var ee=[{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=X(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,n=e.y;if(n*g>90&&n*g<-90&&r*g>180&&r*g<-180)return null;if(Math.abs(Math.abs(n)-u)<=m)return null;if(this.sphere)t=this.x0+this.a*this.k0*$(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*n));else{var a=Math.sin(n),o=K(this.e,n,a);t=this.x0+this.a*this.k0*$(r-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,n=e.y-this.y0;if(this.sphere)i=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var a=Math.exp(-n/(this.a*this.k0));if(-9999===(i=Z(this.e,a)))return null}return t=$(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:Q,inverse:Q,names:["longlat","identity"]}],te={},ie=[];function re(e,t){var i=ie.length;return e.names?(ie[i]=e,e.names.forEach(function(e){te[e.toLowerCase()]=i}),this):(console.log(t),!0)}var ne={start:function(){ee.forEach(re)},add:re,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==te[t]&&ie[te[t]]?ie[te[t]]:void 0}},ae={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=ae.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ae.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var se={};se.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},se.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},se.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},se.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},se.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},se.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},se.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},se.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},se.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},se.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},se.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},se.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},se.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},se.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},se.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},se.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},se.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var le=function(e,t,i,r,n,u,d){var p={};return p.datum_type=void 0===e||"none"===e?h:l,t&&(p.datum_params=t.map(parseFloat),0===p.datum_params[0]&&0===p.datum_params[1]&&0===p.datum_params[2]||(p.datum_type=a),p.datum_params.length>3&&(0===p.datum_params[3]&&0===p.datum_params[4]&&0===p.datum_params[5]&&0===p.datum_params[6]||(p.datum_type=o,p.datum_params[3]*=c,p.datum_params[4]*=c,p.datum_params[5]*=c,p.datum_params[6]=p.datum_params[6]/1e6+1))),d&&(p.datum_type=s,p.grids=d),p.a=i,p.b=r,p.es=n,p.ep2=u,p},he={};function ce(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:he[e]||null,isNull:!1}}function ue(e){return e/3600*Math.PI/180}function de(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function pe(e){return e.map(function(e){return[ue(e.longitudeShift),ue(e.latitudeShift)]})}function fe(e,t,i){return{name:de(e,t+8,t+16).trim(),parent:de(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 me(e,t,i,r){for(var n=t+176,a=[],o=0;o<i.gridNodeCount;o++){var s={latitudeShift:e.getFloat32(n+16*o,r),longitudeShift:e.getFloat32(n+16*o+4,r),latitudeAccuracy:e.getFloat32(n+16*o+8,r),longitudeAccuracy:e.getFloat32(n+16*o+12,r)};a.push(s)}return a}function ye(e,t){if(!(this instanceof ye))return new ye(e);t=t||function(e){if(e)throw e};var i=H(e);if("object"==typeof i){var r=ye.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var n=S(se,i.datumCode);n&&(i.datum_params=i.datum_params||(n.towgs84?n.towgs84.split(","):null),i.ellps=n.ellipse,i.datumName=n.datumName?n.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 a=function(e,t,i,r,n){if(!e){var a=S(ae,r);a||(a=oe),e=a.a,t=a.b,i=a.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<m)&&(n=!0,t=e),{a:e,b:t,rf:i,sphere:n}}(i.a,i.b,i.rf,i.ellps,i.sphere),o=function(e,t,i,r){var n=e*e,a=t*t,o=(n-a)/n,s=0;return r?(n=(e*=1-o*(d+o*(p+o*f)))*e,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(n-a)/a}}(a.a,a.b,a.rf,i.R_A),s=function(e){return void 0===e?null:e.split(",").map(ce)}(i.nadgrids),l=i.datum||le(i.datumCode,i.datum_params,a.a,a.b,o.es,o.ep2,s);Y(this,i),Y(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),t(null,this)}else t(e)}else t(e)}ye.projections=ne,ye.projections.start();var ge=ye;function ve(e,t,i){var r,n,a,o,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),n=Math.sin(l),o=Math.cos(l),a=n*n,{x:((r=i/Math.sqrt(1-t*a))+h)*o*Math.cos(s),y:(r+h)*o*Math.sin(s),z:(r*(1-t)+h)*n}}function be(e,t,i,r){var n,a,o,s,l,h,c,d,p,f,m,y,g,v,b,_=e.x,w=e.y,x=e.z?e.z:0;if(n=Math.sqrt(_*_+w*w),a=Math.sqrt(_*_+w*w+x*x),n/i<1e-12){if(v=0,a/i<1e-12)return u,b=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(w,_);o=x/a,d=(s=n/a)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),p=o*l,g=0;do{g++,h=t*(c=i/Math.sqrt(1-t*p*p))/(c+(b=n*d+x*p-c*(1-t*p*p))),y=(m=o*(l=1/Math.sqrt(1-h*(2-h)*s*s)))*d-(f=s*(1-h)*l)*p,d=f,p=m}while(y*y>1e-24&&g<30);return{x:v,y:Math.atan(m/Math.abs(f)),z:b}}function _e(e){return e===a||e===o}var we=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===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_type!==o||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,n=e.es;if(e.datum_type===s){if(0!==xe(e,!1,i))return;r=6378137,n=.0066943799901413165}var l=t.a,c=t.b,u=t.es;if(t.datum_type===s&&(l=6378137,c=6356752.314,u=.0066943799901413165),n===u&&r===l&&!_e(e.datum_type)&&!_e(t.datum_type))return i;if((i=ve(i,n,r),_e(e.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===o){var r=i[0],n=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)+n,z:u*(-h*e.x+l*e.y+e.z)+s}}}(i,e.datum_type,e.datum_params)),_e(t.datum_type)&&(i=function(e,t,i){if(t===a)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===o){var r=i[0],n=i[1],s=i[2],l=i[3],h=i[4],c=i[5],u=i[6],d=(e.x-r)/u,p=(e.y-n)/u,f=(e.z-s)/u;return{x:d+c*p-h*f,y:-c*d+p+l*f,z:h*d-l*p+f}}}(i,t.datum_type,t.datum_params)),i=be(i,u,l,c),t.datum_type===s)&&0!==xe(t,!0,i))return;return i};function xe(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},n={x:Number.NaN,y:Number.NaN},a=[],o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){n=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,d=l.ll[0]+(l.lim[0]-1)*l.del[0]+h,p=l.ll[1]+(l.lim[1]-1)*l.del[1]+h;if(!(u>r.y||c>r.x||p<r.y||d<r.x||(n=Ce(r,t,l),isNaN(n.x))))break}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*g+" "+r.y*g+" tried: '"+a+"'"),-1):(i.x=-n.x,i.y=n.y,0)}function Ce(e,t,i){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var n={x:e.x,y:e.y};n.x-=i.ll[0],n.y-=i.ll[1],n.x=$(n.x-Math.PI)+Math.PI;var a=Se(n,i);if(t){if(isNaN(a.x))return r;a.x=n.x-a.x,a.y=n.y-a.y;var o,s,l=9;do{if(s=Se(a,i),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:n.x-(s.x+a.x),y:n.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=$(a.x+i.ll[0]),r.y=a.y+i.ll[1]}else isNaN(a.x)||(r.x=e.x+a.x,r.y=e.y+a.y);return r}function Se(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},n=Math.floor(r.x),a=Math.floor(r.y),o=r.x-1*n,s=r.y-1*a,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=t.lim[0])return l;if(a<0||a>=t.lim[1])return l;i=a*t.lim[0]+n;var h=t.cvs[i][0],c=t.cvs[i][1];i++;var u=t.cvs[i][0],d=t.cvs[i][1];i+=t.lim[0];var p=t.cvs[i][0],f=t.cvs[i][1];i--;var m=t.cvs[i][0],y=t.cvs[i][1],g=o*s,v=o*(1-s),b=(1-o)*(1-s),_=(1-o)*s;return l.x=b*h+v*u+_*m+g*p,l.y=b*c+v*d+_*y+g*f,l}var Me=function(e,t,i){var r,n,a,o=i.x,s=i.y,l=i.z||0,h={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==i.z)switch(0===a?(r=o,n=-1!=="ew".indexOf(e.axis[a])?"x":"y"):1===a?(r=s,n=-1!=="ns".indexOf(e.axis[a])?"y":"x"):(r=l,n="z"),e.axis[a]){case"e":h[n]=r;break;case"w":h[n]=-r;break;case"n":h[n]=r;break;case"s":h[n]=-r;break;case"u":void 0!==i[n]&&(h.z=r);break;case"d":void 0!==i[n]&&(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},Te=function(e){Ie(e.x),Ie(e.y)};function Ie(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 Oe(e,t,i,r){var n,l=void 0!==(i=Array.isArray(i)?ke(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(Te(i),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===a||e.datum.datum_type===o||e.datum.datum_type===s)&&"WGS84"!==t.datumCode||(t.datum.datum_type===a||t.datum.datum_type===o||t.datum.datum_type===s)&&"WGS84"!==e.datumCode}(e,t)&&(i=Oe(e,n=new ge("WGS84"),i,r),e=n),r&&"enu"!==e.axis&&(i=Me(e,!1,i)),"longlat"===e.projName)i={x:i.x*y,y:i.y*y,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=we(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?Me(t,!0,i):(l||delete i.z,i)}var Ee=ge("WGS84");function Le(e,t,i,r){var n,a,o;return Array.isArray(i)?(n=Oe(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 n.z?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(a=Oe(e,t,i,r),2===(o=Object.keys(i)).length?a:(o.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;a[r]=i[r]}),a))}function Pe(e){return e instanceof ge?e:e.oProj?e.oProj:ge(e)}var Re=function(e,t,i){e=Pe(e);var r,n=!1;return void 0===t?(t=e,e=Ee,n=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=Ee,n=!0),t=Pe(t),i?Le(e,t,i):(r={forward:function(i,r){return Le(e,t,i,r)},inverse:function(i,r){return Le(t,e,i,r)}},n&&(r.oProj=t),r)},je=6,Ae="AJSAJS",ze="AFAFAF",De=65,Ve=73,Ne=79,Ge=86,Fe=90,Be={forward:qe,inverse:function(e){var t=Ye(Je(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:Ue};function qe(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=Xe(i),n=Math.floor(e/1e5),a=Math.floor(t/1e5)%20;return function(e,t,i){var r=i-1,n=Ae.charCodeAt(r),a=ze.charCodeAt(r),o=n+e-1,s=a+t,l=!1;o>Fe&&(o=o-Fe+De-1,l=!0);(o===Ve||n<Ve&&o>Ve||(o>Ve||n<Ve)&&l)&&o++;(o===Ne||n<Ne&&o>Ne||(o>Ne||n<Ne)&&l)&&++o===Ve&&o++;o>Fe&&(o=o-Fe+De-1);s>Ge?(s=s-Ge+De-1,l=!0):l=!1;(s===Ve||a<Ve&&s>Ve||(s>Ve||a<Ve)&&l)&&s++;(s===Ne||a<Ne&&s>Ne||(s>Ne||a<Ne)&&l)&&++s===Ve&&s++;s>Ge&&(s=s-Ge+De-1);return String.fromCharCode(o)+String.fromCharCode(s)}(n,a,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,n,a,o,s,l=e.lat,h=e.lon,c=6378137,u=We(l),d=We(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));o=We(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),n=Math.cos(u)*(d-o),a=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p=.9996*t*(n+(1-i+r)*n*n*n/6+(5-18*i+i*i+72*r-.39089081163157013)*n*n*n*n*n/120)+5e5,f=.9996*(a+t*Math.tan(u)*(n*n/2+(5-i+9*r+4*r*r)*n*n*n*n/24+(61-58*i+i*i+600*r-2.2240339282485886)*n*n*n*n*n*n/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(p),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 Ue(e){var t=Ye(Je(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function We(e){return e*(Math.PI/180)}function He(e){return e/Math.PI*180}function Ye(e){var t=e.northing,i=e.easting,r=e.zoneLetter,n=e.zoneNumber;if(n<0||n>60)return null;var a,o,s,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,y=t;r<"N"&&(y-=1e7),c=6*(n-1)-180+3,d=(u=y/.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),a=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),o=Math.tan(d)*Math.tan(d),s=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*a);var g=d-a*Math.tan(d)/l*(h*h/2-(5+3*o+10*s-4*s*s-.06065547077041606)*h*h*h*h/24+(61+90*o+298*s+45*o*o-1.6983531815716497-3*s*s)*h*h*h*h*h*h/720);g=He(g);var v,b=(h-(1+2*o+s)*h*h*h/6+(5-2*s+28*o-3*s*s+.05391597401814761+24*o*o)*h*h*h*h*h/120)/Math.cos(d);if(b=c+He(b),e.accuracy){var _=Ye({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 Xe(e){var t=e%je;return 0===t&&(t=je),t}function Je(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,n="",a=0;!/[A-Z]/.test(t=e.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+e;n+=t,a++}var o=parseInt(n,10);if(0===a||a+3>i)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(a,a+=2);for(var l=Xe(o),h=function(e,t){var i=Ae.charCodeAt(t-1),r=1e5,n=!1;for(;i!==e.charCodeAt(0);){if(++i===Ve&&i++,i===Ne&&i++,i>Fe){if(n)throw"Bad character: "+e;i=De,n=!0}r+=1e5}return r}(r.charAt(0),l),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var i=ze.charCodeAt(t-1),r=0,n=!1;for(;i!==e.charCodeAt(0);){if(++i===Ve&&i++,i===Ne&&i++,i>Ge){if(n)throw"Bad character: "+e;i=De,n=!0}r+=1e5}return r}(r.charAt(1),l);c<$e(s);)c+=2e6;var u=i-a;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 d,p,f,m=u/2,y=0,g=0;return m>0&&(d=1e5/Math.pow(10,m),p=e.substring(a,a+m),y=parseFloat(p)*d,f=e.substring(a+m),g=parseFloat(f)*d),{easting:y+h,northing:g+c,zoneLetter:s,zoneNumber:o,accuracy:d}}function $e(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 Ke(e,t,i){if(!(this instanceof Ke))return new Ke(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")}Ke.fromMGRS=function(e){return new Ke(Ue(e))},Ke.prototype.toMGRS=function(e){return qe([this.x,this.y],e)};var Ze=Ke,Qe=.01068115234375,et=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Qe))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Qe)));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},tt=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])))},it=function(e,t,i){for(var r=1/(1-t),n=e,a=20;a;--a){var o=Math.sin(n),s=1-t*o*o;if(n-=s=(tt(n,o,Math.cos(n),i)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<m)return n}return n};var rt={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=et(this.es),this.ml0=tt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,i,r,n=e.x,a=e.y,o=$(n-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var h=l*o,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>m?Math.tan(a):0,f=Math.pow(p,2),y=Math.pow(f,2);t=1-this.es*Math.pow(s,2),h/=Math.sqrt(t);var g=tt(a,s,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+y+14*u-58*f*u+c/42*(61+179*y-y*f-479*f)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+s*o*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+y-58*f+270*u-330*f*u+c/56*(1385+543*y-y*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<m)return 93;if(i=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>m)return 93;r=0}else r=Math.acos(r);a<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,n,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,i=it(t,this.es,this.en),Math.abs(i)<u){var s=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>m?Math.tan(i):0,c=this.ep2*Math.pow(l,2),d=Math.pow(c,2),p=Math.pow(h,2),f=Math.pow(p,2);t=1-this.es*Math.pow(s,2);var y=a*Math.sqrt(t)/this.k0,g=Math.pow(y,2);r=i-(t*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*c*p+c-4*d-g/30*(61+90*p-252*c*p+45*f+46*c-g/56*(1385+3633*p+4095*f+1574*f*p)))),n=$(this.long0+y*(1-g/6*(1+2*p+c-g/20*(5+28*p+24*f+8*c*p+6*c-g/42*(61+662*p+1320*f+720*f*p))))/l)}else r=u*J(o),n=0;else{var v=Math.exp(a/this.k0),b=.5*(v-1/v),_=this.lat0+o/this.k0,w=Math.cos(_);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(b,2))),r=Math.asin(t),o<0&&(r=-r),n=0===b&&0===w?0:$(Math.atan2(b,w)+this.long0)}return e.x=n,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},nt=function(e){var t=Math.exp(e);return t=(t-1/t)/2},at=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/(at(1,t)+1))),e<0?-t:t},st=function(e,t){for(var i,r=2*Math.cos(2*t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return t+i*Math.sin(2*t)},lt=function(e,t){for(var i,r=2*Math.cos(t),n=e.length-1,a=e[n],o=0;--n>=0;)i=r*a-o+e[n],o=a,a=i;return Math.sin(t)*i},ht=function(e,t,i){for(var r,n,a=Math.sin(t),o=Math.cos(t),s=nt(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*o*l,c=-2*a*s,u=e.length-1,d=e[u],p=0,f=0,m=0;--u>=0;)r=f,n=p,d=h*(f=d)-r-c*(p=m)+e[u],m=c*f-n+h*p;return[(h=a*l)*d-(c=o*s)*m,h*m+c*d]};var ct={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&&(rt.init.apply(this),this.forward=rt.forward,this.inverse=rt.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=st(this.cbg,this.lat0);this.Zb=-this.Qn*(r+lt(this.gtu,2*r))},forward:function(e){var t=$(e.x-this.long0),i=e.y;i=st(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),a=Math.sin(t),o=Math.cos(t);i=Math.atan2(r,o*n),t=Math.atan2(a*n,at(r,n*o)),t=ot(Math.tan(t));var s,l,h=ht(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),n=(e.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var a=ht(this.utg,2*n,2*r);n+=a[0],r+=a[1],r=Math.atan(nt(r));var o=Math.sin(n),s=Math.cos(n),l=Math.sin(r),h=Math.cos(r);n=Math.atan2(o*h,at(l,h*s)),r=Math.atan2(l,h*s),t=$(r+this.long0),i=st(this.cgb,n)}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"]},ut=function(e,t){if(void 0===e){if((e=Math.floor(30*($(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e};var dt={init:function(){var e=ut(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*y,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ct.init.apply(this),this.forward=ct.forward,this.inverse=ct.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},pt=function(e,t){return Math.pow((1-e)/(1+e),t)},ft=20;var mt={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)*pt(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)*pt(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),n=ft;n>0&&(i=2*Math.atan(r*pt(this.e*Math.sin(e.y),-.5*this.e))-u,!(Math.abs(i-e.y)<1e-14));--n)e.y=i;return n?(e.x=t,e.y=i,e):null},names:["gauss"]};var yt={init:function(){mt.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,n;return e.x=$(e.x-this.long0),mt.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=n*i*Math.sin(e.x),e.y=n*(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,n,a;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,a=Math.sqrt(e.x*e.x+e.y*e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),i=Math.cos(o),n=Math.asin(i*this.sinc0+e.y*t*this.cosc0/a),r=Math.atan2(e.x*t,a*this.cosc0*i-e.y*this.sinc0*t)}else n=this.phic0,r=0;return e.x=r,e.y=n,mt.inverse.apply(this,[e]),e.x=$(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var gt={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)<=m&&(this.k0=.5*(1+J(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=m&&(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)<=m&&(this.k0=.5*this.cons*X(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/K(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=X(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,n,a,o,s=e.x,l=e.y,h=Math.sin(l),c=Math.cos(l),d=$(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=m&&Math.abs(l+this.lat0)<=m?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(d)),e.x=this.a*t*c*Math.sin(d)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*c*Math.cos(d))+this.y0,e):(i=2*Math.atan(this.ssfn_(l,h,this.e))-u,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=m?(a=K(this.e,l*this.con,this.con*h),o=2*this.a*this.k0*a/this.cons,e.x=this.x0+o*Math.sin(s-this.long0),e.y=this.y0-this.con*o*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<m?(t=2*this.a*this.k0/(1+n*Math.cos(d)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(d))),e.y=t*(this.cosX0*r-this.sinX0*n*Math.cos(d))+this.y0),e.x=t*n*Math.sin(d)+this.x0,e))},inverse:function(e){var t,i,r,n,a;e.x-=this.x0,e.y-=this.y0;var o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,i=this.lat0,o<=m?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<m?this.lat0>0?$(this.long0+Math.atan2(e.x,-1*e.y)):$(this.long0+Math.atan2(e.x,e.y)):$(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=m){if(o<=m)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*Z(this.e,r),t=this.con*$(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=m?a=this.X0:(a=Math.asin(Math.cos(n)*this.sinX0+e.y*Math.sin(n)*this.cosX0/o),t=$(this.long0+Math.atan2(e.x*Math.sin(n),o*this.cosX0*Math.cos(n)-e.y*this.sinX0*Math.sin(n)))),i=-1*Z(this.e,Math.tan(.5*(u+a)));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 vt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,n=2*r-Math.pow(r,2),a=this.e=Math.sqrt(n);this.R=this.k0*i*Math.sqrt(1-n)/(1-n*Math.pow(t,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/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,n=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,n=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),s=this.lambda0+o/this.alpha,l=0,h=a,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+a/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"]},bt=1e-7;var _t={init:function(){var e,t,i,r,n,a,o,s,l,h,c,d=0,p=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 S=!1;if("rectified_grid_angle"in this&&(S=!0),C&&(x=this.alpha),S&&(d=this.rectified_grid_angle*y),C||S)p=this.longc;else if(f=this.long1,_=this.lat1,g=this.long2,w=this.lat2,Math.abs(_-w)<=bt||(e=Math.abs(_))<=bt||Math.abs(e-u)<=bt||Math.abs(Math.abs(this.lat0)-u)<=bt||Math.abs(Math.abs(w)-u)<=bt)throw new Error;var M=1-this.es;t=Math.sqrt(M),Math.abs(this.lat0)>m?(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,(n=(r=this.B*t/(i*Math.sqrt(e)))*r-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(K(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=n=1),C||S?(C?(c=Math.asin(Math.sin(x)/r),S||(d=x)):(c=d,x=Math.asin(r*Math.sin(c))),this.lam0=p-Math.asin(.5*(n-1/n)*Math.tan(c))/this.B):(a=Math.pow(K(this.e,_,Math.sin(_)),this.B),o=Math.pow(K(this.e,w,Math.sin(w)),this.B),n=this.E/a,l=(o-a)/(o+a),h=((h=this.E*this.E)-o*a)/(h+o*a),(e=f-g)<-Math.pi?g-=b:e>Math.pi&&(g+=b),this.lam0=$(.5*(f+g)-Math.atan(h*Math.tan(.5*this.B*(f-g))/l)/this.B),c=Math.atan(2*Math.sin(this.B*$(f-this.lam0))/(n-1/n)),d=x=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),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)),n=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(v-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(v+n))},forward:function(e){var t,i,r,n,a,o,s,l,h={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-u)>m){if(t=.5*((a=this.E/Math.pow(K(this.e,e.y,Math.sin(e.y)),this.B))-(o=1/a)),i=.5*(a+o),n=Math.sin(this.B*e.x),r=(t*this.singam-n*this.cosgam)/i,Math.abs(Math.abs(r)-1)<m)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),o=Math.cos(this.B*e.x),s=Math.abs(o)<bt?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+n*this.singam,o)}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,n,a,o,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),n=.5*((r=Math.exp(-this.BrA*i))-1/r),a=.5*(r+1/r),s=((o=Math.sin(this.BrA*t))*this.cosgam+n*this.singam)/a,Math.abs(Math.abs(s)-1)<m)l.x=0,l.y=s<0?-u:u;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=Z(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(n*this.cosgam-o*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 wt={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)<m)){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=X(this.e,t,i),n=K(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=X(this.e,a,o),l=K(this.e,this.lat2,a),h=K(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>m?this.ns=Math.log(r/s)/Math.log(n/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(n,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)<=m&&(i=J(i)*(u-2*m));var r,n,a=Math.abs(Math.abs(i)-u);if(a>m)r=K(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((a=i*this.ns)<=0)return null;n=0}var o=this.ns*$(t-this.long0);return e.x=this.k0*(n*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,e},inverse:function(e){var t,i,r,n,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),i=1):(t=-Math.sqrt(o*o+s*s),i=-1);var l=0;if(0!==t&&(l=Math.atan2(i*o,i*s)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(n=Z(this.e,r)))return null}else n=-u;return a=$(l/this.ns+this.long0),e.x=a,e.y=n,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 xt={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,n,a,o,s,l=e.x,h=e.y,c=$(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,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),a=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,n,a,o,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,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(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(t)),e.x=this.long0-i/this.alfa,o=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(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(s=1),o=e.y,h+=1}while(0===s&&h<15);return h>=15?null:e},names:["Krovak","krovak"]},Ct=function(e,t,i,r,n){return e*n-t*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},St=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},Mt=function(e){return.375*e*(1+.25*e*(1+.46875*e))},kt=function(e){return.05859375*e*e*(1+.75*e)},Tt=function(e){return e*e*e*(35/3072)},It=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},Ot=function(e){return Math.abs(e)<u?e:e-J(e)*Math.PI},Et=function(e,t,i,r,n){var a,o;a=e/t;for(var s=0;s<15;s++)if(a+=o=(e-(t*a-i*Math.sin(2*a)+r*Math.sin(4*a)-n*Math.sin(6*a)))/(t-2*i*Math.cos(2*a)+4*r*Math.cos(4*a)-6*n*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN};var Lt={init:function(){this.sphere||(this.e0=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.ml0=this.a*Ct(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,i,r=e.x,n=e.y;if(r=$(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var a=Math.sin(n),o=Math.cos(n),s=It(this.a,this.e,a),l=Math.tan(n)*Math.tan(n),h=r*Math.cos(n),c=h*h,u=this.es*o*o/(1-this.es);t=s*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),i=this.a*Ct(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*a/o*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,n=e.y/this.a;if(this.sphere){var a=n+this.lat0;t=Math.asin(Math.sin(a)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(a))}else{var o=this.ml0/this.a+n,s=Et(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-u)<=m)return e.x=this.long0,e.y=u,n<0&&(e.y*=-1),e;var l=It(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),d=r*this.a/l,p=d*d;t=s-l*Math.tan(s)/h*d*d*(.5-(1+3*c)*d*d/24),i=d*(1-p*(c/3+(1+3*c)*c*p/15))/Math.cos(s)}return e.x=$(i+this.long0),e.y=Ot(t),e},names:["Cassini","Cassini_Soldner","cass"]},Pt=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 Rt=.3333333333333333,jt=.17222222222222222,At=.10257936507936508,zt=.06388888888888888,Dt=.0664021164021164,Vt=.016415012942191543;var Nt={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-u)<m?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<m?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Pt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*Rt,t=e*e,i[0]+=t*jt,i[1]=t*zt,t*=e,i[0]+=t*At,i[1]+=t*Dt,i[2]=t*Vt,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=Pt(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,n,a,o,s,l,h,c,d=e.x,p=e.y;if(d=$(d-this.long0),this.sphere){if(a=Math.sin(p),c=Math.cos(p),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*a+this.cosph0*c*r)<=m)return null;t=(i=Math.sqrt(2/i))*c*Math.sin(d),i*=this.mode===this.EQUIT?a:this.cosph0*a-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(p+this.lat0)<m)return null;i=v-.5*p,t=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(d),i*=r}}else{switch(s=0,l=0,h=0,r=Math.cos(d),n=Math.sin(d),a=Math.sin(p),o=Pt(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/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+p,o=this.qp-o;break;case this.S_POLE:h=p-u,o=this.qp+o}if(Math.abs(h)<m)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*n;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(h=Math.sqrt(o))*n,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,n,a,o,s,l=e.x/this.a,h=e.y/this.a;if(this.sphere){var c,d=0,p=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||(p=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=m?0:Math.asin(h*p/c),l*=p,h=d*c;break;case this.OBLIQ:i=Math.abs(c)<=m?this.lat0:Math.asin(d*this.sinph0+h*p*this.cosph0/c),l*=p*this.cosph0,h=(d-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,(o=Math.sqrt(l*l+h*h))<m)return e.x=this.long0,e.y=this.lat0,e;n=2*Math.asin(.5*o/this.rq),r=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(s=r*this.sinb1+h*n*this.cosb1/o,a=this.qp*s,h=o*this.cosb1*r-h*this.sinb1*n):(s=h*n/o,a=this.qp*s,h=o*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(a=l*l+h*h))return e.x=this.long0,e.y=this.lat0,e;s=1-a/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=$(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},Gt=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};var Ft={init:function(){Math.abs(this.lat1+this.lat2)<m||(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=X(this.e3,this.sin_po,this.cos_po),this.qs1=Pt(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=X(this.e3,this.sin_po,this.cos_po),this.qs2=Pt(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=Pt(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>m?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=Pt(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*$(t-this.long0),o=n*Math.sin(a)+this.x0,s=this.rh-n*Math.cos(a)+this.y0;return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;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),n=0,0!==t&&(n=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,i)),a=$(n/this.ns0+this.long0),e.x=a,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,n,a,o,s=Gt(.5*t);if(e<m)return s;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(s),r=Math.cos(s),s+=o=.5*(a=1-(n=e*i)*n)*a/r*(t/(1-l)-i/a+.5/e*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return s;return null}};var Bt={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,n,a,o,s,l=e.x,h=e.y;return r=$(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),(a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m?(o=this.x0+1*this.a*i*Math.sin(r)/a,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)/a):(o=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o;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))?(n=Math.atan2(t,this.rc),i=Math.sin(n),r=Math.cos(n),o=Gt(r*this.sin_p14+e.y*i*this.cos_p14/t),a=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),a=$(this.long0+a)):(o=this.phic0,a=0),e.x=a,e.y=o,e},names:["gnom"]},qt=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,n,a,o,s=Math.asin(.5*t),l=0;l<30;l++)if(n=Math.sin(s),a=Math.cos(s),o=e*n,s+=r=Math.pow(1-o*o,2)/(2*a)*(t/(1-e*e)-n/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),Math.abs(r)<=1e-10)return s;return NaN};var Ut={init:function(){this.sphere||(this.k0=X(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,n=e.y,a=$(r-this.long0);if(this.sphere)t=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=Pt(this.e,Math.sin(n));t=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.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=$(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=qt(this.e,2*e.y*this.k0/this.a),t=$(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]};var Wt={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=$(t-this.long0),n=Ot(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*n,e},inverse:function(e){var t=e.x,i=e.y;return e.x=$(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Ot(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ht=20;var Yt={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.ml0=this.a*Ct(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,n=e.x,a=e.y,o=$(n-this.long0);if(r=o*Math.sin(a),this.sphere)Math.abs(a)<=m?(t=this.a*o,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(a),i=this.a*(Ot(a-this.lat0)+(1-Math.cos(r))/Math.tan(a)));else if(Math.abs(a)<=m)t=this.a*o,i=-1*this.ml0;else{var s=It(this.a,this.e,Math.sin(a))/Math.tan(a);t=s*Math.sin(r),i=this.a*Ct(this.e0,this.e1,this.e2,this.e3,a)-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,n,a,o,s,l,h;if(r=e.x-this.x0,n=e.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=m)t=$(r/this.a+this.long0),i=0;else{var c;for(o=this.lat0+n/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ht;a;--a)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-o)/c-1),Math.abs(h)<=m){i=l;break}t=$(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=m)i=0,t=$(this.long0+r/this.a);else{var u,d,p,f,y;for(o=(this.ml0+n)/this.a,s=r*r/this.a/this.a+o*o,l=o,a=Ht;a;--a)if(y=this.e*Math.sin(l),u=Math.sqrt(1-y*y)*Math.tan(l),d=this.a*Ct(this.e0,this.e1,this.e2,this.e3,l),p=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=(o*(u*(f=d/this.a)+1)-f-.5*u*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*o*f)/(4*u)+(o-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=m){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=$(this.long0+Math.asin(r*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]};var Xt={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,n=i-this.long0,a=r/c*1e-5,o=n,s=1,l=0;for(t=1;t<=10;t++)s*=a,l+=this.A[t]*s;var h,u=l,d=o,p=1,f=0,m=0,y=0;for(t=1;t<=6;t++)h=f*u+p*d,p=p*u-f*d,f=h,m=m+this.B_re[t]*p-this.B_im[t]*f,y=y+this.B_im[t]*p+this.B_re[t]*f;return e.x=y*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,n=e.y,a=r-this.x0,o=(n-this.y0)/this.a,s=a/this.a,l=1,h=0,u=0,d=0;for(t=1;t<=6;t++)i=h*o+l*s,l=l*o-h*s,h=i,u=u+this.C_re[t]*l-this.C_im[t]*h,d=d+this.C_im[t]*l+this.C_re[t]*h;for(var p=0;p<this.iterations;p++){var f,m=u,y=d,g=o,v=s;for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,g+=(t-1)*(this.B_re[t]*m-this.B_im[t]*y),v+=(t-1)*(this.B_im[t]*m+this.B_re[t]*y);m=1,y=0;var b=this.B_re[1],_=this.B_im[1];for(t=2;t<=6;t++)f=y*u+m*d,m=m*u-y*d,y=f,b+=t*(this.B_re[t]*m-this.B_im[t]*y),_+=t*(this.B_im[t]*m+this.B_re[t]*y);var w=b*b+_*_;u=(g*b+v*_)/w,d=(v*b-g*_)/w}var x=u,C=d,S=1,M=0;for(t=1;t<=9;t++)S*=x,M+=this.D[t]*S;var k=this.lat0+M*c*1e5,T=this.long0+C;return e.x=T,e.y=k,e},names:["New_Zealand_Map_Grid","nzmg"]};var Jt={init:function(){},forward:function(e){var t=e.x,i=e.y,r=$(t-this.long0),n=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=n,e.y=a,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=$(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"]},$t=20;var Kt={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=et(this.es)},forward:function(e){var t,i,r=e.x,n=e.y;if(r=$(r-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(n),o=$t;o;--o){var s=(this.m*n+Math.sin(n)-a)/(this.m+Math.cos(n));if(n-=s,Math.abs(s)<m)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;t=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var l=Math.sin(n),h=Math.cos(n);i=this.a*tt(n,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,n;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=Gt((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=Gt(Math.sin(t)/this.n)),r=$(r+this.long0),t=Ot(t)):(t=it(e.y/this.a,this.es,this.en),(n=Math.abs(t))<u?(n=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),r=$(i)):n-m<u&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]};var Zt={init:function(){},forward:function(e){for(var t=e.x,i=e.y,r=$(t-this.long0),n=i,a=Math.PI*Math.sin(i);;){var o=-(n+Math.sin(n)-a)/(1+Math.cos(n));if(n+=o,Math.abs(o)<m)break}n/=2,Math.PI/2-Math.abs(i)<m&&(r=0);var s=.900316316158*this.a*r*Math.cos(n)+this.x0,l=1.4142135623731*this.a*Math.sin(n)+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=$(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 n=Math.asin(i);return e.x=r,e.y=n,e},names:["Mollweide","moll"]};var Qt={init:function(){Math.abs(this.lat1+this.lat2)<m||(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=St(this.es),this.e1=Mt(this.es),this.e2=kt(this.es),this.e3=Tt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=X(this.e,this.sinphi,this.cosphi),this.ml1=Ct(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<m?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=X(this.e,this.sinphi,this.cosphi),this.ml2=Ct(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=Ct(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 n=Ct(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-n)}var a=this.ns*$(i-this.long0),o=this.x0+t*Math.sin(a),s=this.y0+this.rh-t*Math.cos(a);return e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n;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 a=0;if(0!==i&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere)return n=$(this.long0+a/this.ns),r=Ot(this.g-i/this.a),e.x=n,e.y=r,e;var o=this.g-i/this.a;return r=Et(o,this.e0,this.e1,this.e2,this.e3),n=$(this.long0+a/this.ns),e.x=n,e.y=r,e},names:["Equidistant_Conic","eqdc"]};var ei={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,n=e.y,a=$(r-this.long0);Math.abs(n)<=m&&(t=this.x0+this.R*a,i=this.y0);var o=Gt(2*Math.abs(n/Math.PI));(Math.abs(a)<=m||Math.abs(Math.abs(n)-u)<=m)&&(t=this.x0,i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,h=Math.sin(o),c=Math.cos(o),d=c/(h+c-1),p=d*d,f=d*(2/h-1),y=f*f,g=Math.PI*this.R*(s*(d-y)+Math.sqrt(l*(d-y)*(d-y)-(y+l)*(p-y)))/(y+l);a<0&&(g=-g),t=this.x0+g;var v=l+d;return g=Math.PI*this.R*(f*v-s*Math.sqrt((y+l)*(l+1)-v*v))/(y+l),i=n>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,u,d;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,a=(r=e.x/u)*r+(n=e.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+a))+1+2*n*n+a*a)+(2*(s=o-2*n*n+r*r)*s*s/l/l/l-9*o*s/l/l)/27)/(h=(o-s*s/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=e.y>=0?(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<m?this.long0:$(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-n*n)+a*a))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var ti={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,M=e.x,k=e.y,T=Math.sin(e.y),I=Math.cos(e.y),O=$(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=m?(e.x=this.x0+this.a*(u-k)*Math.sin(O),e.y=this.y0-this.a*(u-k)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(e.x=this.x0+this.a*(u+k)*Math.sin(O),e.y=this.y0+this.a*(u+k)*Math.cos(O),e):(_=this.sin_p12*T+this.cos_p12*I*Math.cos(O),b=(v=Math.acos(_))?v/Math.sin(v):1,e.x=this.x0+this.a*b*I*Math.sin(O),e.y=this.y0+this.a*b*(this.cos_p12*T-this.sin_p12*I*Math.cos(O)),e):(t=St(this.es),i=Mt(this.es),r=kt(this.es),n=Tt(this.es),Math.abs(this.sin_p12-1)<=m?(a=this.a*Ct(t,i,r,n,u),o=this.a*Ct(t,i,r,n,k),e.x=this.x0+(a-o)*Math.sin(O),e.y=this.y0-(a-o)*Math.cos(O),e):Math.abs(this.sin_p12+1)<=m?(a=this.a*Ct(t,i,r,n,u),o=this.a*Ct(t,i,r,n,k),e.x=this.x0+(a+o)*Math.sin(O),e.y=this.y0+(a+o)*Math.cos(O),e):(s=T/I,l=It(this.a,this.e,this.sin_p12),h=It(this.a,this.e,T),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(h*I)),w=0===(d=Math.atan2(Math.sin(O),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(O)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(d)-Math.PI)<=m?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(O)*Math.cos(c)/Math.sin(d)),p=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(d)/Math.sqrt(1-this.es))*f)*(1-g)/6+(C=x*w)/8*(y=p*f)*(1-2*g)+(S=C*w)/120*(g*(4-7*g)-3*p*p*(1-7*g))-S*w/48*y),e.x=this.x0+v*Math.sin(d),e.y=this.y0+v*Math.cos(d),e))},inverse:function(e){var t,i,r,n,a,o,s,l,h,c,d,p,f,y,g,v,b,_,w,x,C,S,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),n=Math.cos(i),a=this.long0,Math.abs(t)<=m?o=this.lat0:(o=Gt(n*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-u,a=Math.abs(s)<=m?this.lat0>=0?$(this.long0+Math.atan2(e.x,-e.y)):$(this.long0-Math.atan2(-e.x,e.y)):$(this.long0+Math.atan2(e.x*r,t*this.cos_p12*n-e.y*this.sin_p12*r))),e.x=a,e.y=o,e}return l=St(this.es),h=Mt(this.es),c=kt(this.es),d=Tt(this.es),Math.abs(this.sin_p12-1)<=m?(p=this.a*Ct(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=Et((p-t)/this.a,l,h,c,d),a=$(this.long0+Math.atan2(e.x,-1*e.y)),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=m?(p=this.a*Ct(l,h,c,d,u),t=Math.sqrt(e.x*e.x+e.y*e.y),o=Et((t-p)/this.a,l,h,c,d),a=$(this.long0+Math.atan2(e.x,e.y)),e.x=a,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),f=It(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),S=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,y=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*v),a=$(this.long0+Math.asin(Math.sin(g)*Math.sin(C)/Math.cos(y))),M=Math.sin(y),o=Math.atan2((M-this.es*S*this.sin_p12)*Math.tan(y),M*(1-this.es)),e.x=a,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]};var ii={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,n,a,o,s,l=e.x,h=e.y;return r=$(l-this.long0),t=Math.sin(h),i=Math.cos(h),n=Math.cos(r),((a=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(a)<=m)&&(o=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)),e.x=o,e.y=s,e},inverse:function(e){var t,i,r,n,a,o,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Gt(t/this.a),r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(t)<=m?(s=this.lat0,e.x=o,e.y=s,e):(s=Gt(n*this.sin_p14+e.y*r*this.cos_p14/t),a=Math.abs(this.lat0)-u,Math.abs(a)<=m?(o=this.lat0>=0?$(this.long0+Math.atan2(e.x,-e.y)):$(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=s,e):(o=$(this.long0+Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r)),e.x=o,e.y=s,e))},names:["ortho"]},ri={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ni={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function ai(e,t,i,r){var n;return e<m?(r.value=ni.AREA_0,n=0):(n=Math.atan2(t,i),Math.abs(n)<=v?r.value=ni.AREA_0:n>v&&n<=u+v?(r.value=ni.AREA_1,n-=u):n>u+v||n<=-(u+v)?(r.value=ni.AREA_2,n=n>=0?n-_:n+_):(r.value=ni.AREA_3,n+=u)),n}function oi(e,t){var i=e+t;return i<-_?i+=b:i>+_&&(i-=b),i}var si={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=ri.TOP:this.lat0<=-(u-v/2)?this.face=ri.BOTTOM:Math.abs(this.long0)<=v?this.face=ri.FRONT:Math.abs(this.long0)<=u+v?this.face=this.long0>0?ri.RIGHT:ri.LEFT:this.face=ri.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,n,a,o,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===ri.TOP)n=u-t,i>=v&&i<=u+v?(l.value=ni.AREA_0,r=i-u):i>u+v||i<=-(u+v)?(l.value=ni.AREA_1,r=i>0?i-_:i+_):i>-(u+v)&&i<=-v?(l.value=ni.AREA_2,r=i+u):(l.value=ni.AREA_3,r=i);else if(this.face===ri.BOTTOM)n=u+t,i>=v&&i<=u+v?(l.value=ni.AREA_0,r=-i+u):i<v&&i>=-v?(l.value=ni.AREA_1,r=-i):i<-v&&i>=-(u+v)?(l.value=ni.AREA_2,r=-i-u):(l.value=ni.AREA_3,r=i>0?-i+_:-i-_);else{var h,c,d,p,f,m;this.face===ri.RIGHT?i=oi(i,+u):this.face===ri.BACK?i=oi(i,+_):this.face===ri.LEFT&&(i=oi(i,-u)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(i),h=f*Math.cos(i),c=f*m,d=p,this.face===ri.FRONT?r=ai(n=Math.acos(h),d,c,l):this.face===ri.RIGHT?r=ai(n=Math.acos(c),d,-h,l):this.face===ri.BACK?r=ai(n=Math.acos(-h),d,-c,l):this.face===ri.LEFT?r=ai(n=Math.acos(-c),d,h,l):(n=r=0,l.value=ni.AREA_0)}return o=Math.atan(12/_*(r+Math.acos(Math.sin(r)*Math.cos(v))-u)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===ni.AREA_1?o+=u:l.value===ni.AREA_2?o+=_:l.value===ni.AREA_3&&(o+=1.5*_),s.x=a*Math.cos(o),s.y=a*Math.sin(o),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,n,a,o,s,l,h,c,d,p,f={lam:0,phi:0},m={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)?m.value=ni.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(m.value=ni.AREA_1,t-=u):e.x<0&&-e.x>=Math.abs(e.y)?(m.value=ni.AREA_2,t=t<0?t+_:t-_):(m.value=ni.AREA_3,t+=u),h=_/12*Math.tan(t),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(r=Math.cos(t))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===ri.TOP)l=Math.acos(s),f.phi=u-l,m.value===ni.AREA_0?f.lam=o+u:m.value===ni.AREA_1?f.lam=o<0?o+_:o-_:m.value===ni.AREA_2?f.lam=o-u:f.lam=o;else if(this.face===ri.BOTTOM)l=Math.acos(s),f.phi=l-u,m.value===ni.AREA_0?f.lam=-o+u:m.value===ni.AREA_1?f.lam=-o:m.value===ni.AREA_2?f.lam=-o-u:f.lam=o<0?-o-_:-o+_;else{var y,g,v;h=(y=s)*y,g=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(o))*v)>=1?0:Math.sqrt(1-h),m.value===ni.AREA_1?(h=g,g=-v,v=h):m.value===ni.AREA_2?(g=-g,v=-v):m.value===ni.AREA_3&&(h=g,g=v,v=-h),this.face===ri.RIGHT?(h=y,y=-g,g=h):this.face===ri.BACK?(y=-y,g=-g):this.face===ri.LEFT&&(h=y,y=g,g=-h),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(g,y),this.face===ri.RIGHT?f.lam=oi(f.lam,-u):this.face===ri.BACK?f.lam=oi(f.lam,-_):this.face===ri.LEFT&&(f.lam=oi(f.lam,+u))}return 0!==this.es&&(c=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),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"]},li=[[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]],hi=[[-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]],ci=.8487,ui=1.3523,di=g/5,pi=1/di,fi=18,mi=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},yi=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};var gi={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=$(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*di);r<0?r=0:r>=fi&&(r=fi-1),i=g*(i-pi*r);var n={x:mi(li[r],i)*t,y:mi(hi[r],i)};return e.y<0&&(n.y=-n.y),n.x=n.x*this.a*ci+this.x0,n.y=n.y*this.a*ui+this.y0,n},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*ci),y:Math.abs(e.y-this.y0)/(this.a*ui)};if(t.y>=1)t.x/=li[fi][0],t.y=e.y<0?-u:u;else{var i=Math.floor(t.y*fi);for(i<0?i=0:i>=fi&&(i=fi-1);;)if(hi[i][0]>t.y)--i;else{if(!(hi[i+1][0]<=t.y))break;++i}var r=hi[i],n=5*(t.y-r[0])/(hi[i+1][0]-r[0]);n=function(e,t,i,r){for(var n=t;r;--r){var a=e(n);if(n-=a,Math.abs(a)<i)break}return n}(function(e){return(mi(r,e)-t.y)/yi(r,e)},n,m,100),t.x/=mi(li[i],n),t.y=(5*i+n)*y,e.y<0&&(t.y=-t.y)}return t.x=$(t.x+this.long0),t},names:["Robinson","robin"]};var vi={init:function(){this.name="geocent"},forward:function(e){return ve(e,this.es,this.a)},inverse:function(e){return be(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},bi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},_i={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 wi={init:function(){if(Object.keys(_i).forEach(function(e){if(void 0===this[e])this[e]=_i[e].def;else{if(_i[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);_i[e].num&&(this[e]=parseFloat(this[e]))}_i[e].degrees&&(this[e]=this[e]*y)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)<m?this.mode=this.lat0<0?bi.S_POLE:bi.N_POLE:Math.abs(this.lat0)<m?this.mode=bi.EQUIT:(this.mode=bi.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,n,a=Math.sin(e.y),o=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case bi.OBLIQ:i=this.sinph0*a+this.cosph0*o*s;break;case bi.EQUIT:i=o*s;break;case bi.S_POLE:i=-a;break;case bi.N_POLE:i=a}switch(t=(i=this.pn1/(this.p-i))*o*Math.sin(e.x),this.mode){case bi.OBLIQ:i*=this.cosph0*a-this.sinph0*o*s;break;case bi.EQUIT:i*=a;break;case bi.N_POLE:i*=-o*s;break;case bi.S_POLE:i*=o*s}return n=1/((r=i*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-i*this.sg)*this.cw*n,i=r*n,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,n={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 a=at(e.x,e.y);if(Math.abs(a)<m)n.x=0,n.y=e.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case bi.OBLIQ:n.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(n.y))*a,e.x*=s*this.cosph0;break;case bi.EQUIT:n.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case bi.N_POLE:n.y=Math.asin(o),e.y=-e.y;break;case bi.S_POLE:n.y=-Math.asin(o)}n.x=Math.atan2(e.x,e.y)}return e.x=n.x+this.long0,e.y=n.y,e},names:["Tilted_Perspective","tpers"]};var xi={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,n,a=e.x,o=e.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/at(this.radius_p*Math.cos(o),Math.sin(o));if(i=s*Math.cos(a)*Math.cos(o),r=s*Math.sin(a)*Math.cos(o),n=s*Math.sin(o),(this.radius_g-i)*i-r*r-n*n*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/at(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/at(r,t)))}else"sphere"===this.shape&&(t=Math.cos(o),i=Math.cos(a)*t,r=Math.sin(a)*t,n=Math.sin(o),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/at(n,t)),e.y=this.radius_g_1*Math.atan(n/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(n/at(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,n,a=-1,o=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),o=Math.tan(e.x/this.radius_g_1)*at(1,s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*at(1,o));var l=s/this.radius_p;if(t=o*o+l*l+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a),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),o=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+o*o)),t=o*o+s*s+a*a,(r=(i=2*this.radius_g*a)*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=(-i-Math.sqrt(r))/(2*t),a=this.radius_g+n*a,o*=n,s*=n,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};Re.defaultDatum="WGS84",Re.Proj=ge,Re.WGS84=new Re.Proj("WGS84"),Re.Point=Ze,Re.toPoint=ke,Re.defs=q,Re.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),n=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:de(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);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a={header:n,subgrids:function(e,t,i){for(var r=[],n=0;n<t.nSubgrids;n++){var a=fe(e,176,i),o=me(e,176,a,i),s=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),l=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);r.push({ll:[ue(a.lowerLongitude),ue(a.lowerLatitude)],del:[ue(a.longitudeInterval),ue(a.latitudeInterval)],lim:[s,l],count:a.gridNodeCount,cvs:pe(o)})}return r}(i,n,r)};return he[e]=a,a},Re.transform=Oe,Re.mgrs=Be,Re.version="__VERSION__",function(e){e.Proj.projections.add(rt),e.Proj.projections.add(ct),e.Proj.projections.add(dt),e.Proj.projections.add(yt),e.Proj.projections.add(gt),e.Proj.projections.add(vt),e.Proj.projections.add(_t),e.Proj.projections.add(wt),e.Proj.projections.add(xt),e.Proj.projections.add(Lt),e.Proj.projections.add(Nt),e.Proj.projections.add(Ft),e.Proj.projections.add(Bt),e.Proj.projections.add(Ut),e.Proj.projections.add(Wt),e.Proj.projections.add(Yt),e.Proj.projections.add(Xt),e.Proj.projections.add(Jt),e.Proj.projections.add(Kt),e.Proj.projections.add(Zt),e.Proj.projections.add(Qt),e.Proj.projections.add(ei),e.Proj.projections.add(ti),e.Proj.projections.add(ii),e.Proj.projections.add(si),e.Proj.projections.add(gi),e.Proj.projections.add(vi),e.Proj.projections.add(wi),e.Proj.projections.add(xi)}(Re);var Ci=Re;function Si(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 Mi(e,t,i,r){const n=[];for(let a,o=0,s=e.length;o<s;o++)a=t?Mi(e[o],t-1,i,r):(i||Si)(e[o],r),n.push(a);return n}function ki(e,t){return"4326"!==String(e.wkid)?(t.spatialReference=e,n.Projection.project(t,new n.SpatialReference("EPSG:4326"))):t}var Ti=class{static toCartesian3Array(e,t){let i=[];const r=Object(n.defaultValue)(t,{}),a=Object(n.defaultValue)(r.offsetHeight,0);if(!(e instanceof n.Geometry))return i;let o=Object(n.defaultValue)(r.spatialReference,new n.SpatialReference("EPSG:4326"));switch(e.spatialReference&&(o=e.spatialReference),e.type){case n.GeometryType.point:{let t=e.clone();const r=(t=ki(o,t)).coordinates;i.push(Si(r,a));break}case n.GeometryType.multiPoint:case n.GeometryType.lineString:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,0,Si,a);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,1,Si,a);break}case n.GeometryType.multiPolygon:{let t=e.clone();i=Mi((t=ki(o,t)).coordinates,2,Si,a);break}case n.GeometryType.extent:{let t=e.clone();const r=(t=ki(o,t)).xmin,n=t.xmax,s=t.ymin,l=t.ymax,h=t.zmin,c=t.zmax;let u,d;t.hasZ?(u=Cesium.Cartesian3.fromDegrees(r,s,h+a),d=Cesium.Cartesian3.fromDegrees(n,l,c+a)):(u=Cesium.Cartesian3.fromDegrees(r,s,a),d=Cesium.Cartesian3.fromDegrees(n,l,a)),i.push(u),i.push(d);break}case n.GeometryType.circle:{let t,r=e.clone();const n=(r=ki(o,r)).center;t=r.hasZ?Cesium.Cartesian3.fromDegrees(n[0],n[1],n[2]+a):Cesium.Cartesian3.fromDegrees(n[0],n[1],a),i.push(t);break}}return i}},Ii=i(1);function Oi(e){let t,i,r,n,a=0;const o=e,s=[];for(t=1;t<o.length;t++)i=o[t],r=o[t-1],a+=n=Cesium.Cartesian3.distance(i,r),s.push(n);this.lenArr=s,this.len=a,this.coords=o}Oi.prototype.getTotalLength=function(){return this.len},Oi.prototype.getDetail=function(e){let t,i,r=e;r>=1&&(r=1),r<=0&&(r=0);const n=r*this.len;let a,o=0;const s=this.coords;for(a=0;a<this.lenArr.length;a++){if(n<=this.lenArr[a]+o){t=a,i=(n-o)/this.lenArr[a];break}o+=this.lenArr[a]}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}},Oi.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 Ei=Oi,Li=i(2);const Pi=Ti.toCartesian3Array;function Ri(e,t){const i=Ii.a.convertLabelClassToLabelNoteStyle(t);return Li.a.parseNoteOptions(e,i)}function ji(e){return e instanceof Cesium.LabelCollection?Li.a.createLabelOptions:e instanceof Cesium.BillboardCollection?Li.a.createNoteBillBoardOptions:Li.a.createGroundOptions}function Ai(e,t,i,r,n,a,o){const s=[],l=function(e,t,i,r,n){let a=n-r;(a<=0||a>=1)&&(a=.4);const o=t-e,s=a*o;return{spaceRate:r*o+e,parseRate:Math.round(s/i*1e3)/1e3}}(i,r,n.length,o.repeatStartRate,o.repeatEndRate);for(let i=0;i<n.length;i++){const r=e.getDetail(l.spaceRate+l.parseRate*i),h=ji(t)(a,n[i],r.position,o);s.push(h)}return s}function zi(e){const t=n.T.bbox(e),i=Math.PI,r=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[3]/180*i)),a=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[0]/180*i,t[1]/180*i)),o=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(t[2]/180*i,t[3]/180*i));let s;return function(e,t,i,r,a,o,s){const l=n.T.lineSegment(t),h=0===e,c=h?(a-r)/i:(s-o)/i,u=[];let d,p;for(d=0;d<i;d++){const e=h?n.T.lineString([[r+d*c,s],[r+d*c,o]]):n.T.lineString([[a,s-d*c],[r,s-d*c]]),t=n.T.lineIntersect(e,l),i=t.features.length,f=[];let m;if(!(i<1)){for(p=0;p<i;p++)f.push(n.T.getCoord(t.features[p]));if(1===i)m=f[0],u.push(m);else{let e=0;for(let t=0;t<i;t+=2){const i=f[t],r=f[t+1];let n;h?(n=Math.abs(r[1]-i[1]))>=e&&(e=n,m=[i[0],(r[1]-i[1])/2+i[1]]):(n=Math.abs(r[0]-i[0]))>=e&&(e=n,m=[i[0]+(r[0]-i[0])/2,i[1]])}u.push(m)}}}return u}(s=Cesium.Cartesian3.distance(r,o)>Cesium.Cartesian3.distance(r,a)?0:1,e,20,t[0],t[2],t[1],t[3])}class Di{static renderLabel(e,t,i){const r=Di.createLabels(e,t,i);return r.forEach(t=>{e.add(t)}),r}static removeLabels(e,t){const i=e._labels||e._billboards||e._primitives,r=[];t.forEach(e=>{const t=e.id;for(let e=0;e<i.length;e++)i[e].id===t&&r.push(i[e])}),r.forEach(t=>{e.remove(t)})}static createLabels(e,t,i){let r=[];if(t=t||[],!Array.isArray(t)||t.length<=0)return r;const a=t[0].geometry.type;let o;o=[n.GeometryType.multiPolygon,n.GeometryType.polygon].some(e=>e===a)?Ri("Polygon",i):[n.GeometryType.lineString,n.GeometryType.multiLineString].some(e=>e===a)?Ri("Line",i):Ri("Point",i);const{currentAttributeName:s,labelExpression:l,symbol:h={}}=i,c=s?`$feature.${s}`:l,u=ji(e);return t.forEach(t=>{const i=t.geometry,a=i.type;let s=Pi(i);const l=Ii.a.parseExpression(t,c)||h.text||t.symbol.text,d=t.id;if(!l)return r;switch(a){case n.GeometryType.point:case n.GeometryType.multiPoint:{const e=a===n.GeometryType.point?[i.coordinates]:i.coordinates;s.forEach((t,i)=>{const n=u(d,l,t,o);n.__latLng__=e[i],r.push(n)});break}case n.GeometryType.multiLineString:case n.GeometryType.lineString:a===n.GeometryType.lineString&&(s=[s]),s.forEach(t=>{let i=o.lineLabelSpread;const n=o.repeatLabel,a=o.repeatLabelDistance,s=o.labelPositionAlong;if(!l)return r;let h;const c=new Ei(t);if("auto-spread"===i){i=new RegExp("^[A-Za-z0-9]+$").test(l)?"centralization-spread":"decentralize-spread"}if("decentralize-spread"===i){const t=l.split("");if(n){c.getPartsByLength(a).forEach(function(i){const n=i.startRate,a=i.endRate,s=Ai(c,e,n,a,t,d,o);r=r.concat(s)})}else{const i=Ai(c,e,0,1,t,d,o);r=r.concat(i)}}else if("centralization-spread"===i)if(n){c.getPartsByLength(a).forEach(function(e){const t=e.startRate,i=e.endRate;if("start"===s){h=c.getDetail(t).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(i).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail((i-t)/2+t).position;const e=u(d,l,h,o);r.push(e)}})}else if("start"===s){h=c.getDetail(0).position;const e=u(d,l,h,o);r.push(e)}else if("end"===s){h=c.getDetail(1).position;const e=u(d,l,h,o);r.push(e)}else{h=c.getDetail(.5).position;const e=u(d,l,h,o);r.push(e)}});break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:a===n.GeometryType.polygon&&(s=[s]),s.forEach(t=>{t.forEach(t=>{const i=o.type,a=function(e){if(!e||0===e.length)return null;const t=e.length;let i;const r=[];let n,a;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&&(n=t.height,a=t.height),n=Math.max(n,t.height),a=Math.min(a,t.height)}return{latlngArr:r,maxHeight:n,minHeight:a}}(t),s=a.maxHeight,h=a.minHeight,c=n.T.polygon([a.latlngArr]),p=n.T.getCoord(n.T.centroid(c));let f=new Cesium.Cartesian3;if("parallel"===i){f=Cesium.Cartesian3.fromDegrees(p[0],p[1],(s+h)/2);const e=u(d,l,f,o);r.push(e)}else if("outside"===i||"bottom"===i){const e=n.T.bbox(c),t=n.T.lineSegment(c),a=[e[0],e[1]],p=[e[2],e[3]],m=n.T.lineString([p,a]),y=n.T.lineIntersect(m,t);let g;if(0===y.features.length)g="outside"===i?p:a;else{const e="outside"===i?p:a;g=n.T.getCoord(n.T.nearestPoint(n.T.point(e),y))}o.positionOffsetXRate=1,o.positionOffsetYRate=1,f=Cesium.Cartesian3.fromDegrees(g[0],g[1],(s+h)/2);const v=u(d,l,f,o);r.push(v)}else if("straight"===i||"skeleton"===i){const t=zi(c);if(t.length<2)return r;const n=[],a=l.split("");t.forEach(function(e){n.push(Cesium.Cartographic.toCartesian(new Cesium.Cartographic(e[0]/180*Math.PI,e[1]/180*Math.PI,0)))});const s=new Ei(n);if("skeleton"===i){const t=Ai(s,e,o.skeletonLineStartRate,o.skeletonLineEndRate,a,d,o);r=r.concat(t)}else{const e=s.getDetail(.5),t=u(d,l,e.position,o);r.push(t)}}})})}}),r}}var Vi=Di;function Ni(e,t,i,r,n){!function e(t,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,s=i-r+1,l=Math.log(o),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(o-h)/o)*(s-o/2<0?-1:1),u=Math.max(r,Math.floor(i-s*h/o+c)),d=Math.min(n,Math.floor(i+(o-s)*h/o+c));e(t,i,u,d,a)}var p=t[i],f=r,m=n;for(Gi(t,r,i),a(t[n],p)>0&&Gi(t,r,n);f<m;){for(Gi(t,f,m),f++,m--;a(t[f],p)<0;)f++;for(;a(t[m],p)>0;)m--}0===a(t[r],p)?Gi(t,r,m):Gi(t,++m,n),m<=i&&(r=m+1),i<=m&&(n=m-1)}}(e,t,i||0,r||e.length-1,n||Fi)}function Gi(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Fi(e,t){return e<t?-1:e>t?1:0}function Bi(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function qi(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function Ui(e,t){Wi(e,0,e.children.length,t,e)}function Wi(e,t,i,r,n){n||(n=tr(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a=t;a<i;a++){var o=e.children[a];Hi(n,e.leaf?r(o):o)}return n}function Hi(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Yi(e,t){return e.minX-t.minX}function Xi(e,t){return e.minY-t.minY}function Ji(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function $i(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Ki(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Zi(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,a-r)}function Qi(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function er(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function tr(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ir(e,t,i,r,n){for(var a=[t,i];a.length;)if(!((i=a.pop())-(t=a.pop())<=r)){var o=t+Math.ceil((i-t)/r/2)*r;Ni(e,o,t,i,n),a.push(t,o,o,i)}}Bi.prototype.all=function(){return this._all(this.data,[])},Bi.prototype.search=function(e){var t=this.data,i=[];if(!er(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var a=0;a<t.children.length;a++){var o=t.children[a],s=t.leaf?r(o):o;er(e,s)&&(t.leaf?i.push(o):Qi(e,s)?this._all(o,i):n.push(o))}t=n.pop()}return i},Bi.prototype.collides=function(e){var t=this.data;if(!er(e,t))return!1;for(var i=[];t;){for(var r=0;r<t.children.length;r++){var n=t.children[r],a=t.leaf?this.toBBox(n):n;if(er(e,a)){if(t.leaf||Qi(e,a))return!0;i.push(n)}}t=i.pop()}return!1},Bi.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},Bi.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},Bi.prototype.clear=function(){return this.data=tr([]),this},Bi.prototype.remove=function(e,t){if(!e)return this;for(var i,r,n,a=this.data,o=this.toBBox(e),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],i=l.pop(),n=!0),a.leaf){var h=qi(e,a.children,t);if(-1!==h)return a.children.splice(h,1),s.push(a),this._condense(s),this}n||a.leaf||!Qi(a,o)?r?(i++,a=r.children[i],n=!1):a=null:(s.push(a),l.push(i),i=0,r=a,a=a.children[0])}return this},Bi.prototype.toBBox=function(e){return e},Bi.prototype.compareMinX=function(e,t){return e.minX-t.minX},Bi.prototype.compareMinY=function(e,t){return e.minY-t.minY},Bi.prototype.toJSON=function(){return this.data},Bi.prototype.fromJSON=function(e){return this.data=e,this},Bi.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},Bi.prototype._build=function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return Ui(n=tr(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=tr([])).leaf=!1,n.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));ir(e,t,i,l,this.compareMinX);for(var h=t;h<=i;h+=l){var c=Math.min(h+l-1,i);ir(e,h,c,s,this.compareMinY);for(var u=h;u<=c;u+=s){var d=Math.min(u+s-1,c);n.children.push(this._build(e,u,d,r-1))}}return Ui(n,this.toBBox),n},Bi.prototype._chooseSubtree=function(e,t,i,r){for(;r.push(t),!t.leaf&&r.length-1!==i;){for(var n=1/0,a=1/0,o=void 0,s=0;s<t.children.length;s++){var l=t.children[s],h=Ji(l),c=Ki(e,l)-h;c<a?(a=c,n=h<n?h:n,o=l):c===a&&h<n&&(n=h,o=l)}t=o||t.children[0]}return t},Bi.prototype._insert=function(e,t,i){var r=i?e:this.toBBox(e),n=[],a=this._chooseSubtree(r,this.data,t,n);for(a.children.push(e),Hi(a,r);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},Bi.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=tr(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,Ui(i,this.toBBox),Ui(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},Bi.prototype._splitRoot=function(e,t){this.data=tr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ui(this.data,this.toBBox)},Bi.prototype._chooseSplitIndex=function(e,t,i){for(var r,n=1/0,a=1/0,o=t;o<=i-t;o++){var s=Wi(e,0,o,this.toBBox),l=Wi(e,o,i,this.toBBox),h=Zi(s,l),c=Ji(s)+Ji(l);h<n?(n=h,r=o,a=c<a?c:a):h===n&&c<a&&(a=c,r=o)}return r||i-t},Bi.prototype._chooseSplitAxis=function(e,t,i){var r=e.leaf?this.compareMinX:Yi,n=e.leaf?this.compareMinY:Xi;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},Bi.prototype._allDistMargin=function(e,t,i,r){e.children.sort(r);for(var n=this.toBBox,a=Wi(e,0,t,n),o=Wi(e,i-t,i,n),s=$i(a)+$i(o),l=t;l<i-t;l++){var h=e.children[l];Hi(a,e.leaf?n(h):h),s+=$i(a)}for(var c=i-t-1;c>=t;c--){var u=e.children[c];Hi(o,e.leaf?n(u):u),s+=$i(o)}return s},Bi.prototype._adjustParentBBoxes=function(e,t,i){for(var r=i;r>=0;r--)Hi(t[r],e)},Bi.prototype._condense=function(e){for(var t=e.length-1,i=void 0;t>=0;t--)0===e[t].children.length?t>0?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():Ui(e[t],this.toBBox)};var rr=Bi;function nr(e,t){if(t=Cesium.defaultValue(t,Cesium.defaultValue.EMPTY_OBJECT),this.show=Cesium.defaultValue(t.show,!0),this._scene=e,!Cesium.defined(this._scene))throw new Cesium.RuntimeError("必须传入Scene.");this._enabled=Cesium.defaultValue(t.enabled,!0),this._labelFilterFunction=Cesium.defaultValue(t.labelFilterFunction,null),this._guid=Cesium.createGuid(),this._primitives=[],this._rbush=void 0,this._removeEventListener=void 0,this._cacheEntityMap={},this._rBushRefreshTime=100,this._rBushRefreshFunction=null,this._rBushDitry=!0,this.init()}function ar(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function or(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function sr(e,t){let i=e.data;if(!or(t,i))return;const r=[];for(;i;){for(let n=0;n<i.children.length;n++){const a=i.children[n],o=i.leaf?e.toBBox(a):a;if(or(t,o)){if(i.leaf||ar(t,o))return o;r.push(a)}}i=r.pop()}}function lr(e,t){const i=e.canvas.clientWidth,r=e.canvas.clientHeight,n=t.maxX,a=t.maxY,o=t.minX,s=t.minY;return o>i&&s>r||n<0&&a<0}function hr(e,t){let i;if(e instanceof Cesium.Billboard){if(!e||!e.color)return;if(e.show&&t&&e.color.alpha>=1)return;if(!t&&e.color.alpha<=0)return;e._labelRaq&&window.cancelAnimationFrame(e._labelRaq),function r(n){if(e){let n=e.color.alpha;t?(e.show=!0,(n+=.06)>=1?(n=1,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)):(n-=.06)<=0?(e.show=!1,n=0,e.color=e.color.withAlpha(n),window.cancelAnimationFrame(i)):(e.color=e.color.withAlpha(n),i=window.requestAnimationFrame(r),e._labelRaq=i)}}()}else e.show=t}function cr(e){return e instanceof Cesium.BillboardCollection?Array.isArray(e._billboards)?e._billboards.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.LabelCollection?Array.isArray(e._labels)?e._labels.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]:e instanceof Cesium.PrimitiveCollection&&Array.isArray(e._primitives)?e._primitives.slice(0).filter(function(e){return e?!e._isInitEntityVisualizer:e}):[]}nr.prototype.init=function(){Cesium.defined(this._scene)&&(this._rbush=new rr,this._initUpdateFunction(),this._removeEventListener=this._scene.camera.changed.addEventListener(()=>{this._rBushDitry=!0}))},nr.prototype._initUpdateFunction=function(){return this._rBushRefreshFunction?this._rBushRefreshFunction:(this._rBushRefreshFunction=Object(n.throttle)(()=>{try{this._rBushDitry=!1,this._updateVisual()}catch(e){console.error(e)}},this._rBushRefreshTime,this),this._rBushRefreshFunction)},nr.prototype.add=function(e,t,i){const r=Cesium.defined(t);if(!Cesium.defined(e))throw new Cesium.DeveloperError("primitive is required.");if(r){if(t<0)throw new Cesium.DeveloperError("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new Cesium.DeveloperError("index must be less than or equal to the number of primitives.")}const n=e._external=e._external||{};return(n._composites=n._composites||{})[this._guid]={collection:this},r?this._primitives.splice(t,0,e):this._primitives.push(e),e._dynamicEntityVisualizer_uuid||(e._dynamicEntityVisualizer_uuid=Cesium.createGuid()),this._cacheEntityMap[e._dynamicEntityVisualizer_uuid]={itemCollection:cr(e),zIndex:Cesium.defined(i)?i:0},e},nr.prototype.remove=function(e){const t=this._primitives.indexOf(e);t>-1&&(this._primitives.splice(t,1),delete this._cacheEntityMap[e._dynamicEntityVisualizer_uuid])},nr.prototype.setLabelVisible=function(e,t){e&&(e.notRendering=!t)},nr.prototype.getLabelVisible=function(e){return!e||e.notRendering},nr.prototype.removeAll=function(){const e=this._primitives,t=e.length;for(let i=0;i<t;++i)delete e[i]._external._composites[this._guid],e[i].destroy();this._primitives=[],this._cacheEntityMap={}},nr.prototype._forceVisual=function(){this._rBushRefreshFunction()},nr.prototype._updateVisual=function(){const e=this._scene;if(!e)return;const t=this._rbush;if(t){t.clear();const i=this._primitives,r=this;i.sort(function(e,t){let i=0,n=0;const a=r._cacheEntityMap[e._dynamicEntityVisualizer_uuid],o=r._cacheEntityMap[t._dynamicEntityVisualizer_uuid];return a&&Cesium.defined(a.zIndex)&&(i=a.zIndex),o&&Cesium.defined(o.zIndex)&&(n=o.zIndex),n-i}),i.forEach(function(i,n){const a=r._cacheEntityMap[i._dynamicEntityVisualizer_uuid];(a?a.itemCollection:[]).forEach(function(e){e instanceof Cesium.Billboard&&e._imageIndexPromise?e._imageIndexPromise.then(function(){e._isInitEntityVisualizer=!0}):e._isInitEntityVisualizer=!0}),function(e,t,i){let r=i._billboards||i._labels||i._primitives||[];const n=!!(i instanceof Cesium.PrimitiveCollection),a=e.camera.computeViewRectangle();if(a){const{east:e,north:t,south:i,west:o}=a,s=[180*o/Math.PI,180*e/Math.PI],l=[180*i/Math.PI,180*t/Math.PI];r=r.filter(e=>{if(e&&e.__latLng__){const t=e.__latLng__;return!!(t&&t[0]>s[0]&&t[0]<s[1]&&t[1]>l[0]&&t[1]<l[1])||(n?e.show=!1:hr(e,!1),!1)}return!0})}if(i instanceof Cesium.BillboardCollection||i instanceof Cesium.LabelCollection){const i=e.camera.position,n=(r=function(e,t){return e.slice(0).sort(function(e,i){const r=e&&e.position?Cesium.Cartesian3.distance(t,e.position):0,n=i&&i.position?Cesium.Cartesian3.distance(t,i.position):0;return r-n})}(r,i)).length;for(let i=0;i<n;++i){const n=r[i];if(n&&n.computeScreenSpacePosition){const i=new Cesium.Cartesian2;if(n.computeScreenSpacePosition(e,i),i){let r=new Cesium.BoundingRectangle;if(r=n instanceof Cesium.Label?Cesium.Label.getScreenSpaceBoundingBox(n,i,r):Cesium.Billboard.getScreenSpaceBoundingBox(n,i,r),isNaN(r.width)||isNaN(r.height)){hr(n,!1);continue}if(n.notRendering){hr(n,!1);continue}const a={minX:r.x,maxX:r.x+r.width,minY:r.y,maxY:r.y+r.height,data:n};if(lr(e,a)||Math.abs(a.minX-a.maxX)<3||Math.abs(a.minY-a.maxY)<3){hr(n,!1);continue}const o=sr(t,a);o?hr(n,!1):(hr(n,!0),t.insert(a))}}}}else if(i instanceof Cesium.PrimitiveCollection){const r=i._primitives||[];r.forEach(function(i){if(i instanceof Cesium.GroundPrimitive&&i._cacheGroundRect){if(i.notRendering)return void(i.show=!1);const r=i._cacheGroundRect.east,n=i._cacheGroundRect.west,a=i._cacheGroundRect.north,o=i._cacheGroundRect.south,s=[[r,a],[r,o],[n,a],[n,o]];let l,h,c,u;s.forEach(function(t){const i=Cesium.Cartographic.fromRadians(t[0],t[1],0),r=Cesium.Cartographic.toCartesian(i),n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(e,r);n&&(Cesium.defined(l)||(l=n.x),Cesium.defined(h)||(h=n.y),Cesium.defined(c)||(c=n.x),Cesium.defined(u)||(u=n.y),n.x>l&&(l=n.x),n.x<c&&(c=n.x),n.y>h&&(h=n.y),n.y<u&&(u=n.y))});const d={minX:c,maxX:l,minY:u,maxY:h,data:i};if(!(Cesium.defined(c)&&Cesium.defined(l)&&Cesium.defined(u)&&Cesium.defined(h)))return void(d.data.show=!1);if(lr(e,d)||Math.abs(c-l)<3||Math.abs(u-h)<3)return void(d.data.show=!1);const p=sr(t,d);p?d.data.show=!1:(t.insert(d),d.data.show=!0)}})}}(e,t,i)})}},Object.defineProperties(nr.prototype,{}),nr.prototype.update=function(e){if(!this.show)return;const t=this;this._primitives.forEach(function(e){const i=cr(e);i.forEach(function(e){e.show=!1});const r=t._cacheEntityMap[e._dynamicEntityVisualizer_uuid];r&&(r.itemCollection=i,0!==i.length&&(t._rBushDitry=!0))}),this._rBushDitry&&this._rBushRefreshFunction(),this._primitives.forEach(function(t){t.update(e)})},nr.prototype.isDestroyed=function(){return!1},nr.prototype.destroy=function(){this.removeAll()};var ur=nr;class dr{constructor(e){if(e=Object(n.defaultValue)(e,{}),this._scene=e.scene,!this._scene)throw new Error("缺少场景对象Scene");if(this._opacity=Object(n.defaultValue)(e.opacity,1),this._visible=Object(n.defaultValue)(e.visible,!0),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._labelingInfo=Object(n.defaultValue)(e.labelingInfo,[new n.LabelClass]),(!Array.isArray(e.labelingInfo)||Array.isArray(e.labelingInfo)&&0===e.labelingInfo.length)&&(this._labelingInfo=[new n.LabelClass]),!Array.isArray(this._labelingInfo)||this._labelingInfo.length<=0)throw new Error("缺少动态注记样式参数");this._collection=null,this._dynamicEntityVisualizer=null,this._initCollection()}_initCollection(){const e=this._scene,t=this._labelingInfo[0],{renderMode:i,deconflictionStrategy:r="static"}=t;let n;switch(i){case"label":n=new Cesium.LabelCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;case"ground":n=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse});break;default:n=new Cesium.BillboardCollection({blendOption:Cesium.BlendOption.OPAQUE_AND_TRANSLUCENT,scene:e,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse})}dr.dynamicEntityVisualizer||(dr.dynamicEntityVisualizer=new ur(e),e.primitives.add(dr.dynamicEntityVisualizer)),"static"===r?(this._dynamicEntityVisualizer=dr.dynamicEntityVisualizer,this._collection=this._dynamicEntityVisualizer.add(n)):this._collection=e.primitives.add(n),this._collection.show=this._visible}add(e,t){return Vi.renderLabel(this._collection,e,t||this._labelingInfo[0])}remove(e){Vi.removeLabels(this._collection,e)}createLabels(e,t){return Vi.createLabels(this._collection,e,t||this._labelingInfo[0])}addLabels(e){const t=[];if(!e||!Array.isArray(e))return t;for(let i=0;i<e.length;i++)this._collection.contains(e[i])||t.push(this._collection.add(e[i]));return t}removeLabels(e){if(e&&Array.isArray(e))for(let t=0;t<e.length;t++)this._collection.contains(e[t])&&this._collection.remove(e[t])}destroyed(){this._dynamicEntityVisualizer?this._dynamicEntityVisualizer.remove(this._collection):this._scene.primitives.remove(this._collection),this._collection=null}}Object.defineProperties(dr.prototype,{show:{get(){return this._visible},set(e){this._visible=e,this._collection&&(this._collection.show=e)}},translucency:{get(){return this._opacity},set(e){this._opacity=e}},swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._collection.swipeEnabled=e)}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._collection.swipeInverse=e)}}});var pr=dr;class fr{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),e.wkt?this._wkt=e.wkt:e.wkid?this._wkid=e.wkid:this._wkt=n.Projection.getEPSGByWKID(3857).strProject,this.isGeographic()&&(this._geographicProjection=new Cesium.GeographicProjection(this._ellipsoid))}project(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartographic");let i;t=t||{};const r=[Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)],a=(i=n.Projection.projectPoints({points:[r],originWKID:4326,targetWKID:this._wkid,targetDefs:this._wkt})[0])[0],o=i[1],s=e.height;return this.isGeographic()&&this._geographicProjection.project({longitude:i[0],latitude:i[1],height:e.height},t),Cesium.defined(t)?(t.x=a,t.y=o,t.z=s,t):new Cesium.Cartesian3(a,o,s)}unproject(e,t){if(!Cesium.defined(e))throw new Cesium.DeveloperError("必须传入cartesian");let i;t=t||{},this.isGeographic()?this._geographicProjection.unproject(e,i):i=[e.x,e.y],t=n.Projection.isCustomWKID(this._wkid)?n.Projection.projectPoints({points:[i],originWKID:this._wkid,targetWKID:4326})[0]:n.Projection.projectPoints({points:[i],originDefs:this._wkt,targetWKID:4326})[0];const r=Cesium.Math.toRadians(t[0]),a=Cesium.Math.toRadians(t[1]),o=e.z;return Cesium.defined(t)?(t.longitude=r,t.latitude=a,t.height=o,t):new Cesium.Cartographic(r,a,o)}isGeographic(){return!!(this._wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this._wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this._wkt)))}}Object.defineProperties(fr.prototype,{ellipsoid:{get(){return this._ellipsoid}},wkt:{get(){return this._wkt}},wkid:{get(){return this._wkid}}});var mr=fr;class yr{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._ellipsoid=Cesium.defaultValue(e.ellipsoid,Cesium.Ellipsoid.WGS84),!Cesium.defined(e.wkt)&&!Cesium.defined(e.wkid))throw new Cesium.DeveloperError("必须传入wkt或wkid");var t,i,r,a;this._wkt=e.wkt,this._wkid=e.wkid,this._tileInfo=e.tileInfo,this._axisDirection=Cesium.defaultValue(e.axisDirection,{x:1,y:-1}),n.Projection.isCustomWKID(this._wkid)?this._projection=new mr({ellipsoid:this._ellipsoid,wkid:this._wkid}):(this._projection=new mr({ellipsoid:this._ellipsoid,wkt:this._wkt,proj4:e.proj4}),t=e.rectangleSouthwest,i=e.rectangleNortheast,this._rectangleSouthwest=e.rectangleSouthwest,this._rectangleNortheast=e.rectangleNortheast);this._tileInfo.lods[0].resolution;if(this._tileSize={width:this._tileInfo.size[0],height:this._tileInfo.size[1]},this._transformOrigin={x:this._tileInfo.origin.coordinates[0],y:this._tileInfo.origin.coordinates[1]},e.rectangleSouthwest&&e.rectangleNortheast){const n=this._tileInfo.lods[0].level,o=function(e,t){const i=this.getResolutionAtLevel(t);return{x:Math.floor(this._axisDirection.x*(e.x-this._transformOrigin.x)/(this._tileSize.width*i)),y:Math.floor(-this._axisDirection.y*(this._transformOrigin.y-e.y)/(this._tileSize.height*i))}}.bind(this),s=function(e,t,i){const r=this.getResolutionAtLevel(i);let n,a,o,s;return this._axisDirection.x>0?(n=this._transformOrigin.x+e*(this._tileSize.width*r),o=this._transformOrigin.x+(e+1)*(this._tileSize.width*r)):(n=this._transformOrigin.x-(e+1)*(this._tileSize.width*r),o=this._transformOrigin.x-e*(this._tileSize.width*r)),this._axisDirection.y<0?(a=this._transformOrigin.y-(t+1)*(this._tileSize.height*r),s=this._transformOrigin.y-t*(this._tileSize.height*r)):(a=this._transformOrigin.y+t*(this._tileSize.height*r),s=this._transformOrigin.y+(t+1)*(this._tileSize.height*r)),{west:n,south:a,east:o,north:s}}.bind(this),l=e.rectangleSouthwest,h=e.rectangleNortheast,c=new Cesium.Cartesian2(l.x,h.y),u=new Cesium.Cartesian2(h.x,l.y),d=o(l,n),p=s(d.x,d.y,n),f=o(h,n),m=s(f.x,f.y,n),y=o(c,n),g=s(y.x,y.y,n),v=o(u,n),b=s(v.x,v.y,n);t=new Cesium.Cartesian2(p.west,p.south),i=new Cesium.Cartesian2(m.east,m.north),r=new Cesium.Cartesian2(g.west,g.north),a=new Cesium.Cartesian2(b.east,b.south)}else{if(this.isGeographic())t=new Cesium.Cartesian2(-180,-90),i=new Cesium.Cartesian2(180,90);else{const e=this._ellipsoid.maximumRadius*Math.PI;t=new Cesium.Cartesian2(-e,-e),i=new Cesium.Cartesian2(e,e)}r=new Cesium.Cartesian2(t.x,i.y),a=new Cesium.Cartesian2(i.x,t.y),this._rectangleSouthwest=Cesium.Cartesian2.clone(t),this._rectangleNortheast=Cesium.Cartesian2.clone(i)}(this.isGeographic()||this.isWebMercator())&&this.scratchProjectionBounds(t,i);let o,s,l,h,c=void 0,u=void 0,d=void 0,p=void 0;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(c={longitude:Cesium.Math.toRadians(t.x),latitude:Cesium.Math.toRadians(t.y)},u={longitude:Cesium.Math.toRadians(i.x),latitude:Cesium.Math.toRadians(i.y)},d={longitude:Cesium.Math.toRadians(r.x),latitude:Cesium.Math.toRadians(r.y)},p={longitude:Cesium.Math.toRadians(a.x),latitude:Cesium.Math.toRadians(a.y)}):(c=this._projection.unproject(t),u=this._projection.unproject(i),d=this._projection.unproject(r),p=this._projection.unproject(a)),Cesium.defined(this._tileInfo)&&!(this.isGeographic()||isFinite(p.longitude)&&isFinite(p.latitude))){const t=Cesium.Math.toRadians(Cesium.Math.toDegrees(this.getNumberOfXTilesAtLevel(this._tileInfo.lods[0].level)*(this._tileInfo.lods[0].resolution*this._tileSize.width)/this._ellipsoid.maximumRadius));p=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)).clone(),u.longitude=c.longitude+t}this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid)?(o={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)},s={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},l={longitude:Cesium.Math.toRadians(e.rectangleSouthwest.x),latitude:Cesium.Math.toRadians(e.rectangleNortheast.y)},h={longitude:Cesium.Math.toRadians(e.rectangleNortheast.x),latitude:Cesium.Math.toRadians(e.rectangleSouthwest.y)}):(o=this._projection.unproject(e.rectangleSouthwest),s=this._projection.unproject(e.rectangleNortheast),l=this._projection.unproject(new Cesium.Cartesian2(e.rectangleSouthwest.x,e.rectangleNortheast.y)),h=this._projection.unproject(new Cesium.Cartesian2(e.rectangleNortheast.x,e.rectangleSouthwest.y)));const f=Math.min(c.longitude,d.longitude,o.longitude,l.longitude),m=Math.min(c.latitude,p.latitude,o.latitude,h.latitude),y=Math.max(u.longitude,p.longitude,s.longitude,h.longitude),g=Math.max(u.latitude,d.latitude,s.latitude,l.latitude);this._rectangle=new Cesium.Rectangle(f,m,y,g)}getNumberOfXTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.x-this._rectangleSouthwest.x)/(this._tileSize.width*i)))?1:t}getNumberOfYTilesAtLevel(e){let t=1;const i=this.getResolutionAtLevel(e);return 0===(t=Math.round(Math.abs(this._rectangleNortheast.y-this._rectangleSouthwest.y)/(this._tileSize.height*i)))?1:t}rectangleToNativeRectangle(e,t){const i=this._projection,r=i.project(Cesium.Rectangle.southwest(e)),n=i.project(Cesium.Rectangle.northeast(e));return Cesium.defined(t)?(t.west=r.x,t.south=r.y,t.east=n.x,t.north=n.y,t):new Cesium.Rectangle(r.x,r.y,n.x,n.y)}tileXYToNativeRectangle(e,t,i,r){const n=new Cesium.Rectangle,a=this.getResolutionAtLevel(i);return this._axisDirection.x>0?(n.west=this._transformOrigin.x+e*(this._tileSize.width*a),n.east=this._transformOrigin.x+(e+1)*(this._tileSize.width*a)):(n.west=this._transformOrigin.x-(e+1)*(this._tileSize.width*a),n.east=this._transformOrigin.x-e*(this._tileSize.width*a)),this._axisDirection.y<0?(n.south=this._transformOrigin.y-(t+1)*(this._tileSize.height*a),n.north=this._transformOrigin.y-t*(this._tileSize.height*a)):(n.south=this._transformOrigin.y+t*(this._tileSize.height*a),n.north=this._transformOrigin.y+(t+1)*(this._tileSize.height*a)),Cesium.defined(r)?(r.west=n.west,r.south=n.south,r.east=n.east,r.north=n.north,r):n}tileXYToRectangle(e,t,i,r){const a=this.tileXYToNativeRectangle(e,t,i,r);if(!isFinite(a.height)||!isFinite(a.width))return this._rectangle;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))a.west=Cesium.Math.toRadians(a.west),a.south=Cesium.Math.toRadians(a.south),a.east=Cesium.Math.toRadians(a.east),a.north=Cesium.Math.toRadians(a.north);else{const e=this._projection,t=e.unproject(new Cesium.Cartesian2(a.west,a.north)),i=e.unproject(new Cesium.Cartesian2(a.east,a.south));a.west=t.longitude,a.south=i.latitude,a.east=i.longitude,a.north=t.latitude}return isFinite(a.height)&&isFinite(a.width)?a:this._rectangle}positionToTileXY(e,t,i){let r=void 0;const a=new Cesium.Cartesian2;if(this.isGeographic()&&!n.Projection.isCustomWKID(this._wkid))r={x:Cesium.Math.toDegrees(e.longitude),y:Cesium.Math.toDegrees(e.latitude)};else{r=this._projection.project(e)}const o=this.getResolutionAtLevel(t),s=this._axisDirection.x*(r.x-this._transformOrigin.x)/(this._tileSize.width*o),l=-this._axisDirection.y*(this._transformOrigin.y-r.y)/(this._tileSize.height*o);return a.x=Math.floor(s),a.y=Math.floor(l),Math.abs(s)<Math.pow(10,-8)&&(a.x=0),Math.abs(l)<Math.pow(10,-8)&&(a.y=0),Cesium.defined(i)?(i.x=a.x,i.y=a.y,i):a}getResolutionAtLevel(e){const t=this._tileInfo.lods.find((t,i)=>i===e);return t?t.resolution:void 0}getTileLevelByResolution(e){let t=0,i=0;if(this._tileInfo&&this._tileInfo.lods.length>1)if(Math.abs(e-this._tileInfo.lods[0].resolution)<Math.pow(10,-7))t=this._tileInfo.lods[0].level,i=0;else if(e<this._tileInfo.lods[this._tileInfo.lods.length-1].resolution)t=this._tileInfo.lods[this._tileInfo.lods.length-1].level,i=this._tileInfo.lods.length-1;else for(let r=0;r<this._tileInfo.lods.length-1;r++){const n=this._tileInfo.lods[r],a=this._tileInfo.lods[r+1];if(e<=n.resolution&&e>a.resolution){const o=(n.resolution-e)/(n.resolution-a.resolution);t=o<.5?n.level:n.level+1,i=o<.5?r:r+1;break}}return i}isGeographic(){return!!(this.wkid&&[4326,4490,4610,4214,n.CustomWKID.bd09ll,n.CustomWKID.gcj02ll].includes(this._wkid)||this.wkt&&(/^GEOGCS/.test(this.wkt)||/^[+]proj=longlat/.test(this.wkt)))}isWebMercator(){return[3857,102113,102100,900913,n.CustomWKID.bd09mc,n.CustomWKID.gcj02mc].includes(this._wkid)}scratchProjectionBounds(e,t){let i=void 0;this.isGeographic()?i=new Cesium.Rectangle(-180,-90,180,90):this.isWebMercator()&&(i=new Cesium.Rectangle(-20037508.34,-20037508.34,20037508.34,20037508.34)),e.x=Cesium.Math.clamp(e.x,i.west,i.east),e.y=Cesium.Math.clamp(e.y,i.south,i.north),t.x=Cesium.Math.clamp(t.x,i.west,i.east),t.y=Cesium.Math.clamp(t.y,i.south,i.north)}}Object.defineProperties(yr.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}},wkid:{get:function(){return this._wkid}},wkt:{get:function(){return this._wkt}}});var gr=yr;var vr=class extends n.LayerView{onAdd(){return new Promise(e=>{this.innerLayer=[],wr.addSceneLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(){return wr.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r=[]}=i;if(i){let e;switch(i.name){case"visible":wr.setVisible(r[0],this);break;case"sbuLayerVisible":wr.setSubLayerVisible(r[0],r[1],this);break;case"opacity":wr.setOpacity(r[0],this);break;case"subLayerOpacity":wr.setSubLayerOpacity(r[0],r[1],this);break;case"renderer":e=this.view.getInnerLayer(this.layer);const t=i.params[0],n=i.params[1];for(let i=0;i<e.length;i++)n===e[i].id&&(e[i].renderer=Ql(t));break;case"reset":wr.reset(r[0],this);break;case"labelingInfo":wr.removeLayer(this),wr.addSceneLayer(this,e=>{this.innerLayer=e})}}}return Promise.resolve(this)}};class br{}function _r(e,t){e.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider,setTimeout(()=>{e.scene.terrainProvider=t},0)}br.addSceneLayer=function(e,t,i){const{layer:r,innerView:a,view:o}=e,s=r.activeScene.allSublayers;let l=0;const h=[];s.forEach(t=>{switch(t.type){case n.SceneSubLayerType.label:const s=br.toPrimitive(t,a,e),{_labelLayer:c}=s;c.id=t.id,h.push(c),l++;break;case n.SceneSubLayerType.mapRef:const u=br.initializeOptions(t,a);u.show=t.visible*e._getLayerViewVisible(r.visible);const d=function(e,t){const i=(e=Object(n.defaultValue)(e,{})).url||"";let r=void 0;i.includes("/igs/rest/g3d/")?r=Jl.addWebTileLayer(e,t):i.includes("/igs/rest/services/")&&i.includes("/SceneServer")&&(e._url=i,r=lh.addIGSMapImageLayer(e,t));return r}(u,a);h.push(d),l++;break;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const p=br.initializeOptions(t,a),f={};f.show=p.show,p.show=t.visible*e._getLayerViewVisible(r.visible),th(p,a,o,function(e){l++,h.push(e),e._backupProperties=f,e._backupProperties.translucency=e.translucency;const i=t.opacity*r.opacity;i<1&&i>=0&&(e.translucency=i),p.autoReset&&ih(e.boundingSphere,p,a)},i)}});const c=br.addTerrainService(e);c&&(h.push(c),l++);const u=setInterval(function(){l===s.items.length&&t&&t instanceof Function&&(clearInterval(u),t(h))},50)},br.toTerrainProvider=function(e){let t=void 0;if(e.type===n.SceneSubLayerType.terrain){const i=br.initializeOptions(e);t=new Mr(i)}return t},br.initTerrainProvider=function(e,t){const{innerView:i,view:r}=e,a=[];let o;t=Object(n.defaultValue)(t,[]);const{allLayerViews:s}=r;let l=[];const h=[];if(l.push(e),(l=l.concat(s._items)).forEach(e=>{t.indexOf(e)<0&&h.push(e)}),h.forEach(e=>{if(e instanceof vr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&a.push(e)})}}),a.length>0){const e=br.initializeOptions(a[0]),t=[];a.forEach(e=>{const i=br.initializeOptions(e);t.push({url:i.url,range:i.range,range3D:i.range3D,requestVertexNormals:i.requestVertexNormals})}),e.url=t,o=new Mr(e),i.scene.terrainProvider=o}return o},br.addTerrainService=function(e,t){const{innerView:i,view:r}=e;let a=[];t=Object(n.defaultValue)(t,[]);let o=void 0;if(!e.layer)return;const s=Object(n.defaultValue)(e.layer.visible,!0);if((a=br.getAllTerrainLayers(e)).length>0){const e=br.initializeOptions(a[0]),t=[];a.forEach(e=>{const{url:i,range:r,range3D:n,requestVertexNormals:a,show:o}=br.initializeOptions(e);t.push({url:i,range:r,range3D:n,requestVertexNormals:a,show:o&&s})}),i.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider?(e.url=void 0,e.serviceList=t,o=new Mr(e),i.scene.terrainProvider=o):((o=i.scene.terrainProvider)._serviceList.push(e),o.addService(e),_r(i,o))}return o},br.getAllTerrainLayers=function(e){const t=[];if(e instanceof vr){e.layer.activeScene.allSublayers.forEach(e=>{e.type===n.SceneSubLayerType.terrain&&t.push(e)})}return t},br.toPrimitive=function(e,t,i){const r=br.initializeOptions(e,t,i);switch(e.type){case n.SceneSubLayerType.label:const t=r._dynamicEntityVisualizer?r._dynamicEntityVisualizer:r._collection;return t._labelLayer=r,t;case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:return new Cesium.MapGISM3DSet(r)}},br.initializeOptions=function(e,t,i){switch(e.type){case n.SceneSubLayerType.terrain:let r=function(e){const t={},i=e.range,r={xMin:i.xmin,yMin:i.ymin,xMax:i.xmax,yMax:i.ymax},a=e.range3D,o={xMin:a.xmin,yMin:a.ymin,xMax:a.xmax,yMax:a.ymax,zMin:a.zmin,zMax:a.zmax};return t.id=Object(n.defaultValue)(e.id,void 0),t.scale=Object(n.defaultValue)(e.elevationScale,void 0),t.range=r,t.range3D=o,t.requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0,t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.show=Object(n.defaultValue)(e.visible,!0),t.autoReset=Object(n.defaultValue)(e.autoReset,!0),t.url=e.layer.url,t}(e);r=Object.assign(r,e.extensionOptions);const{sceneIndex:a,layerIndex:o,layerRenderIndex:s,requestVertexNormals:l,url:h}=r;return h.includes("/SceneServer")?r.url=`${h}/layers/${o}/terrains?level={z}&row={x}&col={y}&xDensity=65&yDensity=65&hasNormals=${l}`:r.url=`${h}/GetTerrain?sceneIndex=${a}&layerIndex=${s}&Level={z}&Row={x}&Col={y}&xdensity=65&ydensity=65&webGL=true&hasNormals=${l}`,r;case n.SceneSubLayerType.label:{let r=e.layer.url,a=e.layer.sceneIndex;r=r.includes("/SceneServer")?`${r}/layers/${e.layerIndex}/labels?level=0&row=0&col=0&format=json&srsName=EPSG:4326`:`${r}/GetLabels?sceneIndex=${a}&layerIndex=${e.layerRenderIndex}&level=0&row=0&col=0&format=json&srsName=EPSG:4326`;const{labelLayer:o,labelingInfo:s,opacity:l}=e,h={labelLayer:o,labelingInfo:s,opacity:l,visible:e.visible&&i._getLayerViewVisible(e.layer.visible)};return function(e,t,i,r){t=Object(n.defaultValue)(t,{}),i=Object(n.defaultValue)(i,{});const a=Object(n.defaultValue)(i.labelingInfo,[]),o=Object(n.defaultValue)(i.visible,!0),s=Object(n.defaultValue)(i.opacity,1),l=r.scene,h=Object(n.defaultValue)(i.layerInfo,{}),c=Object(n.defaultValue)(h.symbolScale,1),u=new Cesium.Resource({url:e}),d=new pr({scene:l,visible:o,opacity:s,labelingInfo:a});return u.fetchJson().then(e=>{Array.isArray(e)&&e.forEach(e=>{const t=Object(n.defaultValue)(e.dot,{}),i=Object(n.defaultValue)(t.x,0),r=Object(n.defaultValue)(t.y,0),o=Object(n.defaultValue)(t.z,0),s=function(e,t,i){Object(n.defaultValue)(e.dot,{});const r=Object(n.defaultValue)(e.geoAnno,{}),a="rgb("+Object(n.defaultValue)(r.color,"255,255,255")+")",o=Object(n.defaultValue)(r.font,"宋体"),s=Object(n.defaultValue)(r.offsetx,0),l=Object(n.defaultValue)(r.offsety,0),h=Object(n.defaultValue)(r.size,20)*t,c=Object(n.defaultValue)(r.text,"");let u=Object(n.defaultValue)(r.italic?"italic":"normal","normal");const d=Object(n.defaultValue)(r.italicType,0),p=Object(n.defaultValue)(r.bold?"bold":"normal","normal"),f=Object(n.defaultValue)(r.angle,0),m=Object(n.defaultValue)(r.shadow,!1),y=Object(n.defaultValue)(r.hollow,!1),g=Object(n.defaultValue)(r.outLine,!1),v=Object(n.defaultValue)(r.strikeOut,!1),b=Object(n.defaultValue)(r.underLine,!1),_=Object(n.defaultValue)(r.space,0),w=Object(n.defaultValue)(r.back,!1),x="rgb("+Object(n.defaultValue)(r.backClr,"255,255,255")+")",C=Object(n.defaultValue)(r.backExp,0);0!==d&&(u="italic ");let S=!1,M="rgb(191, 191, 191)",k=2,T=1,I=1;(m||g)&&(S=!0,g&&(M=x,k=C,T=0,I=0));let O=new n.LabelClass({symbol:{color:y?"rgba(255,255,255,0)":Object(n.defaultValue)(a,"rgba(255,255,255,1)"),haloColor:y?a:"rgba(255,255,255,0)",haloSize:1,lineHeight:1.1,xoffset:s,yoffset:l,angle:f,font:{size:h,family:o,weight:p,style:u},text:c,letterSpacing:_,backgroundColor:w?x:void 0,backgroundPadding:[C,C],textDecorationUnderlineColor:b?a:void 0,textDecorationUnderlineWidth:b?1:0,textDecorationThroughlineColor:v?a:void 0,textDecorationThroughlineWidth:v?1:0,textShadowOffsetX:T,textShadowOffsetY:I,textShadowColor:S?M:void 0,textShadowBlur:k},renderMode:"canvas"});if(i){let e=O.symbol.toJSON();const t=i.symbol?i.symbol:{};(e=Object.assign({},e,t)).text=c;let r=O.toJSON();(r=Object.assign({},r,i)).symbol=e,O=new n.LabelClass(r)}return O}(e,c,Array.isArray(a)&&a.length>0?a[0]:void 0);d.add([new n.Feature({geometry:new n.Point({coordinates:[i,r,o]})})],s)})}),d.type="label",d}(r,e.extensionOptions,h,t)}case n.SceneSubLayerType.mapRef:return function(e){let t={};t.spatialReference=Object(n.defaultValue)(e.spatialReference,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.igserver=!0,t.renderer=Ql(e.renderer),t.translucency=e.opacity,t.sceneIndex=e.layer&&void 0!==e.layer.sceneIndex?e.layer.sceneIndex:0;const i=e.layer.url,r=function(e){let t="";e.includes("/igs/rest/g3d/")?t="g3d":e.includes("/igs/rest/services/")&&e.includes("/SceneServer")&&(t="sceneserver");return t}(i);if("g3d"===r){t.url=`${i}/GetCovering?sceneIndex=${t.sceneIndex}&&layerIndex=${e.layerRenderIndex}&level={z}&row={y}&col={x}`;const{tileInfo:r,extent:a}=function(e){let t=void 0,i=void 0;const r=e.range,a=Math.round((r.xmax-r.xmin)/e.maxFrameSize.wid),o=Math.round((r.ymax-r.ymin)/e.maxFrameSize.hel),s=r.xmin,l=r.ymax,h=s+a*e.maxFrameSize.wid,c=l-o*e.maxFrameSize.hel;t=new n.Extent({xmin:s,ymin:c,xmax:h,ymax:l,spatialReference:r.spatialReference});const u=new n.Point({coordinates:[s,c],spatialReference:r.spatialReference});return i=n.TileInfoUtil.createCommonTileInfo({extent:t,origin:u,numberOfMinLevelTilesX:a}),{extent:t,tileInfo:i}}(e);t.tileInfo=r,t.extent=a,t.tileSliceType="tms"}else"sceneserver"===r&&(t.extent=e.range,t.spatialReference=e.spatialReference,t.httpMethod=e.httpMethod,t.imageWidth=e.imageWidth,t.imageHeight=e.imageHeight,t.url=`${i}/layers/${e.layerIndex}/coverings`);return t}(e);case n.SceneSubLayerType.model:case n.SceneSubLayerType.modelCache:const c=eh(e);return c.url=e.layer.url,c.url.includes("/igs/rest/g3d/")?c.url=`${c.url}/GetDataStreams?sceneIndex=${e.layer.sceneIndex}&layerIndex=${e.layerRenderIndex}&Level=0&Row=0&Col=0`:c.url.includes("/igs/rest/services/")&&c.url.includes("/SceneServer"),c.headers&&(c.url=new Cesium.Resource({url:c.url,headers:c.headers})),t&&(c._scene=t.scene),c}},br.removeLayer=function(e){let{innerLayer:t}=e;const{innerView:i}=e;for(let e=0;e<t.length;e++)t[e]instanceof Cesium.MapGISM3DSet?i.scene.primitives.removeAndDestroy(t[e]):t[e]instanceof pr?t[e].destroyed():t[e]instanceof Cesium.ImageryLayer?i.scene.imageryLayers.remove(t[e]):t[e]instanceof Mr&&(t[e]=new Cesium.EllipsoidTerrainProvider,i.scene.terrainProvider=t[e]);t=[]},br.setVisible=function(e,t){const{innerLayer:i,innerView:r}=t,n=t._getLayerViewVisible(e);for(let a=0;a<i.length;a++)if(i[a]instanceof Cesium.MapGISM3DSet)i[a].show=i[a]._backupProperties.show&&n;else if(i[a]instanceof pr)i[a].show=n;else if(i[a]instanceof Cesium.ImageryLayer)i[a].show=n;else if(i[a]instanceof Mr)if(!0===e)br.addTerrainService(t);else if(!1===e){const e=[];br.getAllTerrainLayers(t).forEach(t=>{e.push(br.initializeOptions(t))}),i[a].removeServices(e),_r(r,i[a])}},br.setSubLayerVisible=function(e,t,i){const{innerLayer:r,layer:n,innerView:a}=i,o=e&&n.visible,s=i._getLayerViewVisible(o);for(let n=0;n<r.length;n++)if(String(r[n].id)===String(t)){if(r[n]instanceof Cesium.MapGISM3DSet)r[n].show=s,r[n]._backupProperties.show=e;else if(r[n]instanceof pr)r[n].show=s;else if(r[n]instanceof Cesium.ImageryLayer)r[n].show=s;else if(r[n]instanceof Mr)if(!0===e)br.addTerrainService(i);else if(!1===e){const e=[];br.getAllTerrainLayers(i).forEach(t=>{e.push(br.initializeOptions(t))}),r[n].removeServices(e),_r(a,r[n])}break}},br.setOpacity=function(e,t){const{innerLayer:i}=t;for(let t=0;t<i.length;t++)i[t]instanceof Cesium.MapGISM3DSet&&(i[t].translucency=i[t]._backupProperties.translucency*e)},br.setSubLayerOpacity=function(e,t,i){const{innerLayer:r,layer:n}=i;for(let i=0;i<r.length;i++)if(String(r[i].id)===String(t)){r[i]instanceof Cesium.MapGISM3DSet&&(r[i].translucency=e*n.opacity,r[i]._backupProperties.translucency=e);break}},br.reset=function(e,t){const{innerLayer:i,innerView:r}=t;for(let t=0;t<i.length;t++)if(String(i[t].id)===String(e)){ih(i[t].boundingSphere,{},r);break}};var wr=br;function xr(e,t,i,r){let n;if(1===e.length)n=e[0];else for(let a=0;a<e.length;++a){const o=e[a];if(o.availability&&o.availability.isTileAvailable(t,i,r)){n=o;break}}return n}var Cr=class{constructor(e){this._layers=Object(n.defaultValue)(e,[])}addAvailableTileRange(e,t,i,r,n){const a=xr(this._layers,e,(t+r)/2,(i+n)/2);a&&a.availability.addAvailableTileRange(e,t,i,r,n)}computeMaximumLevelAtPosition(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeMaximumLevelAtPosition(e))>0);i++);return t}computeBestAvailableLevelOverRectangle(e){let t=0;for(let i=0;i<this._layers.length&&!((t=this._layers[i].availability.computeBestAvailableLevelOverRectangle(e))>0);i++);return t}isTileAvailable(e,t,i){const r=xr(this._layers,e,t,i);return!!r&&r.availability.isTileAvailable(e,t,i)}computeChildMaskForTile(e,t,i){const r=this._getLayerToUse(e,t,i);let n=0;return r&&(n=r.availability.computeChildMaskForTile(e,t,i)),n}_getLayerToUse(e,t,i){let r;if(1===this._layers.length)r=this._layers[0];else for(let n=0;n<this._layers.length;++n){const a=this._layers[n];if(a.availability&&a.availability.isTileAvailable(e,t,i)){r=a;break}}return r}};class Sr{constructor(e){this.url=Object(n.defaultValue)(e.url,void 0),this.range=Object(n.defaultValue)(e.range,void 0),this.range3D=Object(n.defaultValue)(e.range3D,void 0),this.proxy=Object(n.defaultValue)(e.proxy,void 0),this.maxLevel=Object(n.defaultValue)(e.maxLevel,20),this.terrainColorTblInfo=Object(n.defaultValue)(e.terrainColorTblInfo,void 0),this.terrainColorTblMinHeight=Object(n.defaultValue)(e.terrainColorTblMinHeight,void 0),this.terrainColorTblMaxHeight=Object(n.defaultValue)(e.terrainColorTblMaxHeight,void 0),this.id=Object(n.defaultValue)(e.id,void 0),this._tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.GeographicTilingScheme),this._requestVertexNormals=Object(n.defaultValue)(e.requestVertexNormals,!1),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure={heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},this._ready=!1,this._readyPromise=new Promise((e,t)=>{}),this._layers=[];const t=Object(n.defaultValue)(e.serviceList,[]);this._serviceList=Object(n.cloneObject)(t),this.show=Object(n.defaultValue)(e.show,!0),this._repeat=Object(n.defaultValue)(e.repeat,new Cesium.Cartesian2(1,1)),this._layerToUse=void 0,this._availability=void 0;let i=Object(n.defaultValue)(e.credit,void 0);"string"==typeof i&&(i=new Cesium.Credit(i)),this._credit=i,this._init()}static async fromUrl(e,t){const i=new n.IGSSceneLayer({url:e}),r=(await i.load()).activeScene.sublayers.items;let a=void 0;for(let e=0;e<r.length;e++)if(r[e].type===n.SceneSubLayerType.terrain){const i=wr.initializeOptions(r[e]);a=new Sr({...i,...t})}return a}requestTileGeometry(e,t,i,r){if(this._ready||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),0===i&&0===e&&0===t||0===i&&1===e&&0===t)return Promise.resolve(this._getEmptyHeightMap());if(1===this._layers.length)this._layerToUse=this._layers[0];else for(let r=0;r<this._layers.length;++r){const n=this._layers[r];if(n.availability&&n.availability.isTileAvailable(i,e,t)){this._layerToUse=n;break}}if(!Cesium.defined(this._layerToUse))return this._getDefaultHeightMapData();0===this._layerToUse.tileUrlTemplates.length&&n.Log.error("请求地形数据的接口模板没有设置!");const a=this._getRequestHeader();let o=this._tilingScheme.getNumberOfYTilesAtLevel(i)-t-1,s=this._layerToUse.resource.url.replace("{z}",i).replace("{x}",e).replace("{y}",o),l=this._layerToUse.resource.getDerivedResource({url:s,headers:a,request:r,proxy:this.proxy}).fetchArrayBuffer();return Cesium.defined(l)?l.then(e=>{if(1===e.byteLength){"@"===new TextDecoder("utf-8").decode(e)&&(e=new Uint16Array(this._heightmapWidth*this._heightmapWidth))}return this._createHeightMapByTerrainData(e)}):void 0}_getDefaultHeightMapData(){const e=new Uint16Array(this._heightmapWidth*this._heightmapWidth);return this._createHeightMapByTerrainData(e)}getLevelMaximumGeometricError(e){return this._levelZeroMaximumGeometricError/(1<<e)}getTileDataAvailable(e,t,i){let r=!1;for(let n=0;n<this._layers.length;n++){const a=this._layers[n].availability;if(a&&a.isTileAvailable(i,e,t)){r=!0;break}}return r}loadTileDataAvailability(e,t,i){function r(e,t,i,r){if(0!==r){var n=e.availabilityLevels,a=r%n==0?r-n:(r/n|0)*n,o=1<<r-a;return{level:a,x:t/o|0,y:i/o|0}}}var n=xr(this._layers,i,e,t);if(!(!n.availability||i>n._availability._maximumLevel||n._availability.isTileAvailable(i,e,t))&&this.hasMetadata){var a=function(e,t,i,n,a){if(!a.availabilityLevels)return{result:!1};for(var o,s=function(){delete a.availabilityPromiseCache[o]},l=a.availabilityTilesLoaded,h=a.availability,c=r(a,t,i,n);c;){if(h.isTileAvailable(c.level,c.x,c.y)&&!l.isTileAvailable(c.level,c.x,c.y)){let t;if(o=c.level+"-"+c.x+"-"+c.y,!(t=a.availabilityPromiseCache[o])){var u=new Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.TERRAIN});(t=e.requestTileGeometry(e,c.x,c.y,c.level,u))&&(a.availabilityPromiseCache[o]=t,t.then(s))}return{result:!0,promise:t}}c=r(a,c.x,c.y,c.level)}return{result:!1}}(this,e,t,i,n);return a.promise?a.promise:void 0}}_init(){if(this.url){const e={url:this.url,maxLevel:this.maxLevel,requestVertexNormals:this._requestVertexNormals,range:this.range,tilingScheme:this._tilingScheme,show:this.show};this._serviceList.push(e),this.addService(e)}else this._serviceList instanceof Array&&this._serviceList.length>0&&(this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range),this._serviceList.forEach(e=>{this.addService(e)}));this._availability=new Cr(this._layers)}addService(e){this._combineRange("2D"),this._combineRange("3D"),this._formatRange(this.range);const t=Object(n.defaultValue)(e.maxLevel,this.maxLevel),i=Object(n.defaultValue)(e.range,this.range),r=Object(n.defaultValue)(e.url,void 0),a=Object(n.defaultValue)(e.show,!0);this._customTerrainInfo({url:r,tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"],maxzoom:t,requestVertexNormals:Object(n.defaultValue)(e.requestVertexNormals,this._requestVertexNormals),available:this._calcAvailability(i,t,this._tilingScheme),show:a})}removeServices(e){const t=[];e.forEach(e=>{const i=this._removeServiceFromServiceList(e);i>-1&&t.push(i)})}removeService(e){_removeServiceFromServiceList}_removeServiceFromServiceList(e){let t=-1;return this._serviceList.forEach((i,r)=>{i.url===e.url&&(t=r)}),t>-1&&(this._serviceList.splice(t,1),this._layers.splice(t,1)),t}_combineRange(e){e=Object(n.defaultValue)(e,"2D");const t=[];if(this._serviceList.forEach(i=>{let r;(r="2D"===e?i.range:i.range3D)&&t.push(r)}),t.length>0){let i,r,n,a=t[0].xMin,o=t[0].xMax,s=t[0].yMin,l=t[0].yMax;"3D"===e&&(i=t[0].zMin,r=t[0].zMax),t.forEach(t=>{t.xMin<a&&(a=t.xMin),t.xMax>o&&(o=t.xMax),t.yMin<s&&(s=t.yMin),t.yMax>l&&(l=t.yMax),"3D"===e&&(t.zMin<i&&(i=t.zMin),t.zMax>r&&(r=t.zMax))}),(n="2D"===e?this.range:this.range3D)?(a<n.xMin&&(n.xMin=a),o>n.xMax&&(n.xMax=o),s<n.yMin&&(n.yMin=s),l>n.yMax&&(n.yMax=l),"3D"===e&&(i<n.zMin&&(n.yMin=s),r>n.zMax&&(n.zMax=r))):"2D"===e?this.range={xMin:a,xMax:o,yMin:s,yMax:l}:this.range3D={xMin:a,xMax:o,yMin:s,yMax:l,zMin:i,zMax:r}}else this.range||n.Log.error("地形二维范围不存在!")}_customTerrainInfo(e){const{tiles:t,available:i,requestVertexNormals:r}=e,n=new Cesium.TileAvailability(this._tilingScheme,i.length);for(let e=0;e<i.length;++e){let t=i[e];for(let i=0;i<t.length;++i){let r=t[i];n.addAvailableTileRange(e,r.startX,r.startY,r.endX,r.endY)}}const a=Cesium.Resource.createIfNeeded(e.url);a.queryParameters.hasOwnProperty("hasNormals")||(a.queryParameters.hasNormals=r),this._layers.push(this._initTerrainLayer({resource:a,version:e.version,isHeightmap:!0,tileUrlTemplates:t,availability:n,hasVertexNormals:this.hasVertexNormals,littleEndianExtensionSize:!0})),this._ready=!0,this._readyPromise=new Promise((e,t)=>{e()})}_formatRange(e){(e.yMin<-84||e.yMin>84)&&(e.yMin=-84),e.yMax>84&&(e.yMax=84),e.xMax>180&&(e.xMax=180),(e.xMin<-180||e.xMin>180)&&(e.xMin=-180)}_calcAvailability(e,t,i){let r,n,a,o=Cesium.Cartographic.fromDegrees(e.xMin,e.yMin,new Cesium.Cartographic),s=Cesium.Cartographic.fromDegrees(e.xMax,e.yMax,new Cesium.Cartographic),l=[[{endX:1,endY:0,startX:0,startY:0}]];for(let e=1;e<t;++e)n=i.positionToTileXY(o,e),a=i.positionToTileXY(s,e),r={startX:n.x,startY:a.y,endX:a.x,endY:n.y},l.push([r]);return l}_getEmptyHeightMap(){return new Cesium.HeightmapTerrainData({buffer:new Uint16Array(this._heightmapWidth*this._heightmapWidth),width:this._heightmapWidth,height:this._heightmapWidth})}_initTerrainLayer(e){return{resource:e.resource,version:e.version,isHeightmap:e.isHeightmap,tileUrlTemplates:e.tileUrlTemplates,availability:e.availability,hasVertexNormals:e.hasVertexNormals,hasMetadata:e.hasMetadata,availabilityLevels:e.availabilityLevels,availabilityTilesLoaded:e.availabilityTilesLoaded,littleEndianExtensionSize:e.littleEndianExtensionSize,availabilityPromiseCache:{},show:e.show}}_getRequestHeader(){return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}_createHeightMapByTerrainData(e){let t,i,r;const n=this._heightmapWidth*this._heightmapWidth*Uint16Array.BYTES_PER_ELEMENT+Uint16Array.BYTES_PER_ELEMENT;if(t=e.byteLength>n?new Float32Array(e,0,this._heightmapWidth*this._heightmapWidth):new Uint16Array(e,0,this._heightmapWidth*this._heightmapWidth),this.hasVertexNormals){i=new Uint8Array(this._heightmapWidth*this._heightmapWidth*2);const t=(this._heightmapWidth*this._heightmapWidth+1)*Float32Array.BYTES_PER_ELEMENT;r=new Uint8Array(e,t,(this._heightmapWidth+2)*(this._heightmapWidth+2)*2);for(let e=0;e<this._heightmapWidth;e++)for(let t=0;t<this._heightmapWidth;t++){const n=e*this._heightmapWidth+t,a=(e+1)*(this._heightmapWidth+2)+t+1;i[2*n]=r[2*a],i[2*n+1]=r[2*a+1]}}return new Cesium.HeightmapTerrainData({buffer:t,width:this._heightmapWidth,height:this._heightmapWidth,structure:this._heightmapStructure,encodedNormals:i,childTileMask:15,repeat:this._repeat})}}Object.defineProperties(Sr.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._ready||n.Log.error("credit must not be called before the terrain provider is ready."),this._credit}},tilingScheme:{get:function(){return this._ready||n.Log.error("tilingScheme must not be called before the terrain provider is ready."),this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},hasMetadata:{get:function(){return this._ready||n.Log.error("hasMetadata must not be called before the terrain provider is ready."),!0}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},repeat:{get:function(){return this._repeat},set:function(e){this._repeat=e}},availability:{get:function(){return this._ready&&this._layerToUse||n.Log.error("必须等待地形图层初始化完毕后才能请求地形瓦片数据!"),this._availability}}});var Mr=Sr;class kr{static isGeographic(e){let t=!1;return(e instanceof Cesium.GeographicProjection||e.isGeographic&&e.isGeographic())&&(t=!0),t}}class Tr{constructor(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.headers,{}),i=Object.assign({},e);i.extensions=[];const r=Object(n.defaultValue)(e.extensions,[]),a=Object(n.defaultValue)(e.url,"");let o;(o=a instanceof Cesium.Resource?a:new Cesium.Resource({url:a})).headers=t,r&&r instanceof Array&&(e.tokenKey&&e.tokenValue&&r.push({key:e.tokenKey,value:e.tokenValue}),r.forEach(e=>{e&&(o.queryParameters[e.key]=e.value)})),i.url=o;const s=new Cesium.ArcGisMapServerImageryProvider(i);return s._transparent=e.transparent,s._format=e.format,s.requestImage=((e,t,i,r)=>{if(!s._ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");return Cesium.ImageryProvider.loadImage(s,this._buildImageResource(s,e,t,i,r))}),s}static async fromUrl(e,t){const i=new n.ArcGISMapImageLayer({url:e}),r=await i.load(),a=Er.initializeOptions(r),o=new Tr({...a,...t});return Cesium.defined(o._resource)||(o._resource=Cesium.Resource.createIfNeeded(e),o._resource.appendForwardSlash()),o}_buildImageResource(e,t,i,r,n){let a;if(e._useTiles)a=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n,queryParameters:e._resource.queryParameters});else{const o=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s={bbox:o.west+","+o.south+","+o.east+","+o.north,size:e._tileWidth+","+e._tileHeight,format:e._format,transparent:e._transparent,f:"image"};kr.isGeographic(e._tilingScheme.projection)?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers="show:"+e.layers);const l=Object.assign(e._resource.queryParameters,s);a=e._resource.getDerivedResource({url:"export",request:n,queryParameters:l})}return a}}var Ir=Tr;class Or{}Or.addArcGISMapImageLayer=function(e,t){const i=Or.initializeOptions(e),r=Kl(e,t),n=new Ir(i);Cesium.defined(n._resource)||(n._resource=Cesium.Resource.createIfNeeded(i.url),n._resource.appendForwardSlash());const a=t.imageryLayers.addImageryProvider(n,r);return a.id=e.id,a._realIndex=e._realIndex+1,a},Or.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),{extensionOptions:o={}}=e;let s={url:e.url,usePreCachedTilesIfAvailable:!1,layers:e.layers,tilingScheme:i,rectangle:a,headers:e.headers,tokenKey:e.tokenKey,tokenValue:e.tokenValue,transparent:e.imageTransparency,format:e.imageFormat};return s=Object.assign(s,o)},Or.removeLayer=function(e,t){t.imageryLayers.remove(e)};var Er=Or;class Lr{}Lr.addWMSLayer=function(e,t){const i=Lr.initializeOptions(e),r=Kl(e,t),n=t.scene.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Lr.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),o=Object(n.isWMSReverse)(e.version,e.spatialReference);let s=e.url;e.tokenKey&&e.tokenValue&&(s=`${s}?${e.tokenKey}=${e.tokenValue}`);let l={url:s,layers:e.layers,parameters:{format:e.imageFormat,transparent:e.imageTransparency,version:e.version},tilingScheme:i,tileWidth:e.imageWidth,tileHeight:e.imageHeight,srs:`EPSG:${e.spatialReference.wkid}`,crs:`EPSG:${e.spatialReference.wkid}`,isReverseBBOX:o,rectangle:a};const{extensionOptions:h={}}=e;return l=Object.assign(l,h)},Lr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Pr=Lr;class Rr{}Rr.addArcGISTileLayer=function(e,t){const i=Rr.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider(i),r);return n.id=e.id,n._realIndex=e._realIndex+1,n},Rr.initializeOptions=function(e){const t=$l(e.spatialReference,e.extent,e.tileInfo),i=Zl(e,t.rectangle),r=new Cesium.Rectangle(i.xmin,i.ymin,i.xmax,i.ymax);let n={url:`${e.url}/tile/{z}/{y}/{x}`,tilingScheme:t,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,rectangle:r};const{extensionOptions:a={}}=e;return n=Object.assign(n,a)},Rr.removeLayer=function(e,t){t.imageryLayers.remove(e)};var jr=Rr;class Ar{constructor(e){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),this._imageVersion=Cesium.defaultValue(e.imageVersion,"0"),this._resource=Cesium.Resource.createIfNeeded(e.url),this._mapStyle=e.mapStyle,this._proxy=e.proxy,this._imageInfoUrl=e.url,this._url=e.url,this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this.isStretchImage=Cesium.defaultValue(e.isStretchImage,!1),this._mapgisOffset=Cesium.defaultValue(e.mapgisOffset,0),this._buildImageResource=Cesium.defaultValue(e.buildImageResource,void 0),this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS"))}static async fromUrl(e,t){const i=new n.IGSTileLayer({url:e}),r=await i.load(),a=Vr.initializeOptions(r);return new Ar({...a,...t})}buildImageResource(e,t,i,r){if(this._buildImageResource&&this._buildImageResource instanceof Function)return this._buildImageResource(this,e,t,i,r);let n=this._resource.url;return n.includes("/igs/rest/services/")&&n.includes("/TileServer")?(512!==this._tileWidth&&"mapgis-tianditu"!==this._mapStyle||(i+=1),n=`${this._resource.url}/tileImage/${i}/${t}/${e}/?f=image`):n=(n=(n=512===this._tileWidth||"mapgis-tianditu"===this._mapStyle?n.replace("{level}",i+1):n.replace("{level}",i)).replace("{row}",t)).replace("{col}",e),this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return i+=this.mapgisOffset,Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);r=(r=(r=r.replace("{row}",t)).replace("{col}",e)).replace("{level}",i),this._isHistoryImage&&(r=r.replace("{version}",this._imageVersion));return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(e=>{const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(Ar.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},mapgisOffset:{get:function(){return this._mapgisOffset}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});var zr=Ar;class Dr{}Dr.addIGSTileLayer=function(e,t){const i=Dr.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new zr(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},Dr.initializeOptions=function(e){const t=e.tileInfo.clone(),i=t.lods;for(;i.length>0&&0!==i[0].level;){const e=i[0];i.unshift(n.LOD.fromJSON({level:e.level-1,resolution:2*e.resolution,scale:2*e.scale}))}const r=$l(e.spatialReference,e.extent,t),a=Zl(e,r.rectangle),o=new Cesium.Rectangle(a.xmin,a.ymin,a.xmax,a.ymax),[s,l]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let h=e.url;"1.0"===e._igsVersion&&(h=`${e.url}/{level}/{row}/{col}`);let c={url:h,tileWidth:t.cols,tileHeight:t.cols,tilingScheme:r,rectangle:o,minimumLevel:s,maximumLevel:l};const{extensionOptions:u={}}=e;return c=Object.assign(c,u)},Dr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Vr=Dr;class Nr{}Nr.addWMTSLayer=function(e,t){const i=Nr.initializeOptions(e),r=Kl(e,t),a=new Cesium.WebMapTileServiceImageryProvider(i);a.isStretchImage=Object(n.defaultValue)(i.isStretchImage,!1);const o=t.scene.imageryLayers.addImageryProvider(a,r);return e.clippingArea&&rh(e,o,t),o.id=e.id,o._realIndex=e._realIndex+1,o},Nr.initializeOptions=function(e){const t=e.getCurrentTileInfo();let i=$l(e.spatialReference,e.activeLayer.extent,t);e.spatialReference.isWebMercator?t.lods[0].resolution*t.size[0]>40075016.685574&&(i=new Cesium.WebMercatorTilingScheme):e.spatialReference.isGeographic&&t.lods[0].resolution*t.size[0]>180&&(i=new Cesium.GeographicTilingScheme);const r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(t);let l=e.url;e.tokenValue&&e.tokenKey&&(l+=`?${e.tokenKey}=${e.tokenValue}`);let h={url:l,layer:e.activeLayer.title,format:e.activeLayer.imageFormat,style:e.activeLayer.styleId,tileMatrixSetID:e.activeLayer.tileMatrixSetId,tilingScheme:i,tileWidth:t.size[0],tileHeight:t.size[1],rectangle:a,minimumLevel:o,maximumLevel:s};const{extensionOptions:c={}}=e;return h=Object.assign(h,c)},Nr.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Gr=Nr;function Fr(){return function(){throw new Error("Unimplemented abstract method.")}()}var Br=0;function qr(e){return e.ol_uid||(e.ol_uid=String(++Br))}var Ur="5.3.3",Wr=function(e){function t(t){var i="Assertion failed. See https://openlayers.org/en/"+("latest"===Ur?Ur:"v"+Ur.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 Hr(e,t){if(!e)throw new Wr(t)}var Yr=i(8),Xr=i.n(Yr),Jr="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),n=1,a=arguments.length;n<a;++n){var o=i[n];if(void 0!==o&&null!==o)for(var s in o)o.hasOwnProperty(s)&&(r[s]=o[s])}return r};function $r(e){for(var t in e)delete e[t]}function Kr(e){var t;for(t in e)return!1;return!t}function Zr(e,t,i){return Math.min(Math.max(e,t),i)}var Qr="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2};function en(e,t,i,r,n,a){var o=n-i,s=a-r;if(0!==o||0!==s){var l=((e-i)*o+(t-r)*s)/(o*o+s*s);l>1?(i=n,r=a):l>0&&(i+=o*l,r+=s*l)}return tn(e,t,i,r)}function tn(e,t,i,r){var n=i-e,a=r-t;return n*n+a*a}function rn(e,t,i){return e+i*(t-e)}var nn={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"};
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
- */var an={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function on(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 sn(e,t,i){var r,n;return(r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*r+(n=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*n}function ln(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function hn(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=t[0],s=t[1],l=an.UNKNOWN;return o<i?l|=an.LEFT:o>n&&(l|=an.RIGHT),s<r?l|=an.BELOW:s>a&&(l|=an.ABOVE),l===an.UNKNOWN&&(l=an.INTERSECTING),l}function cn(e,t,i,r,n){return n?(n[0]=e,n[1]=t,n[2]=i,n[3]=r,n):[e,t,i,r]}function un(e){return cn(1/0,1/0,-1/0,-1/0,e)}function dn(e,t){var i=e[0],r=e[1];return cn(i,r,i,r,t)}function pn(e,t,i,r,n){return mn(un(n),e,t,i,r)}function fn(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 mn(e,t,i,r,n){for(;i<r;i+=n)yn(e,t[i],t[i+1]);return e}function yn(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 gn(e){return[e[0],e[1]]}function vn(e){return[e[2],e[1]]}function bn(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function _n(e){return e[3]-e[1]}function wn(e){return[e[0],e[3]]}function xn(e){return[e[2],e[3]]}function Cn(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Sn(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 cn(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 Mn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},kn={};kn[Mn.DEGREES]=2*Math.PI*6370997/360,kn[Mn.FEET]=.3048,kn[Mn.METERS]=1,kn[Mn.USFEET]=1200/3937;var Tn=Mn,In=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};In.prototype.canWrapX=function(){return this.canWrapX_},In.prototype.getCode=function(){return this.code_},In.prototype.getExtent=function(){return this.extent_},In.prototype.getUnits=function(){return this.units_},In.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||kn[this.units_]},In.prototype.getWorldExtent=function(){return this.worldExtent_},In.prototype.getAxisOrientation=function(){return this.axisOrientation_},In.prototype.isGlobal=function(){return this.global_},In.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},In.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},In.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},In.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},In.prototype.setWorldExtent=function(e){this.worldExtent_=e},In.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},In.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var On=In,En=6378137,Ln=Math.PI*En,Pn=[-Ln,-Ln,Ln,Ln],Rn=[-180,-85,180,85],jn=function(e){function t(t){e.call(this,{code:t,units:Tn.METERS,extent:Pn,global:!0,worldExtent:Rn,getPointResolution:function(e,t){return e/Qr(t[1]/En)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(On),An=[new jn("EPSG:3857"),new jn("EPSG:102100"),new jn("EPSG:102113"),new jn("EPSG:900913"),new jn("urn:ogc:def:crs:EPSG:6.18:3:3857"),new jn("urn:ogc:def:crs:EPSG::3857"),new jn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function zn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=Ln,s=0;s<r;s+=n){a[s]=o*e[s]/180;var l=En*Math.log(Math.tan(Math.PI*(e[s+1]+90)/360));l>o?l=o:l<-o&&(l=-o),a[s+1]=l}return a}function Dn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=0;o<r;o+=n)a[o]=180*e[o]/Ln,a[o+1]=360*Math.atan(Math.exp(e[o+1]/En))/Math.PI-90;return a}var Vn=[-180,-90,180,90],Nn=6378137*Math.PI/180,Gn=function(e){function t(t,i){e.call(this,{code:t,units:Tn.DEGREES,extent:Vn,axisOrientation:i,global:!0,metersPerUnit:Nn,worldExtent:Vn})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(On),Fn=[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 qn={};function Un(e,t,i){var r=e.getCode(),n=t.getCode();r in qn||(qn[r]={}),qn[r][n]=i}function Wn(e,t,i){var r;if(void 0!==t){for(var n=0,a=e.length;n<a;++n)t[n]=e[n];r=t}else r=e.slice();return r}function Hn(e,t,i){if(void 0!==t&&e!==t){for(var r=0,n=e.length;r<n;++r)t[r]=e[r];e=t}return e}function Yn(e){!function(e,t){Bn[e]=t}(e.getCode(),e),Un(e,e,Wn)}function Xn(e){return"string"==typeof e?function(e){return Bn[e]||null}(e):e||null}function Jn(e){!function(e){e.forEach(Yn)}(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Un(t,e,Wn)})})}function $n(e,t){var i=function(e,t){var i;return e in qn&&t in qn[e]&&(i=qn[e][t]),i}(e.getCode(),t.getCode());return i||(i=Hn),i}function Kn(e,t){return $n(Xn(e),Xn(t))}Jn(An),Jn(Fn),function(e,t,i,r){e.forEach(function(e){t.forEach(function(t){Un(e,t,i),Un(t,e,r)})})}(Fn,An,zn,Dn);var Zn=function(){this.dataProjection=null,this.defaultFeatureProjection=null};Zn.prototype.getReadOptions=function(e,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(e),featureProjection:t.featureProjection}),this.adaptOptions(i)},Zn.prototype.adaptOptions=function(e){return Jr({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},Zn.prototype.getLastExtent=function(){return null},Zn.prototype.getType=function(){return Fr()},Zn.prototype.readFeature=function(e,t){return Fr()},Zn.prototype.readFeatures=function(e,t){return Fr()},Zn.prototype.readGeometry=function(e,t){return Fr()},Zn.prototype.readProjection=function(e){return Fr()},Zn.prototype.writeFeature=function(e,t){return Fr()},Zn.prototype.writeFeatures=function(e,t){return Fr()},Zn.prototype.writeGeometry=function(e,t){return Fr()};var Qn=Zn;function ea(e,t,i){var r,n=i?Xn(i.featureProjection):null,a=i?Xn(i.dataProjection):null;if(r=n&&a&&!function(e,t){if(e===t)return!0;var i=e.getUnits()===t.getUnits();return e.getCode()===t.getCode()?i:$n(e,t)===Wn&&i}(n,a)?Array.isArray(e)?function(e,t,i){return Sn(e,Kn(t,i))}(e,a,n):(t?e.clone():e).transform(t?n:a,t?a:n):e,t&&i&&void 0!==i.decimals&&!Array.isArray(r)){var o=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]*o)/o;return e})}return r}var ta="arraybuffer",ia={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function ra(e,t){return e>t?1:e<t?-1:0}function na(e,t,i){for(;t<i;){var r=e[t];e[t]=e[i],e[i]=r,++t,--i}}function aa(e,t){for(var i=Array.isArray(t)?t:[t],r=i.length,n=0;n<r;n++)e[e.length]=i[n]}function oa(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}var sa="propertychange";function la(e,t,i,r){for(var n,a=0,o=e.length;a<o;++a)if((n=e[a]).listener===t&&n.bindTo===i)return r&&(n.deleteIndex=a),n}function ha(e,t){var i=ca(e);return i?i[t]:void 0}function ca(e,t){var i=e.ol_lm;return!i&&t&&(i=e.ol_lm={}),i}function ua(e,t){var i=ha(e,t);if(i){for(var r=0,n=i.length;r<n;++r)e.removeEventListener(t,i[r].boundListener),$r(i[r]);i.length=0;var a=ca(e);a&&(delete a[t],0===Object.keys(a).length&&function(e){delete e.ol_lm}(e))}}function da(e,t,i,r,n){var a=ca(e,!0),o=a[t];o||(o=a[t]=[]);var s=la(o,i,r,!1);return s?n||(s.callOnce=!1):(s={bindTo:r,callOnce:!!n,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&&ma(e),i.call(r,t)};return e.boundListener=t,t}(s)),o.push(s)),s}function pa(e,t,i,r){return da(e,t,i,r,!0)}function fa(e,t,i,r){var n=ha(e,t);if(n){var a=la(n,i,r,!0);a&&ma(a)}}function ma(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=ha(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&&ua(e.target,e.type)}$r(e)}}var ya=function(){this.disposed_=!1};ya.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},ya.prototype.disposeInternal=function(){};var ga=ya;function va(){}var ba=function(e){this.propagationStopped,this.type=e,this.target=null};ba.prototype.preventDefault=function(){this.propagationStopped=!0},ba.prototype.stopPropagation=function(){this.propagationStopped=!0};var _a=ba,wa=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 _a(e):e,i=t.type;t.target=this;var r,n=this.listeners_[i];if(n){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var a=0,o=n.length;a<o;++a)if(!1===n[a].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,va);delete this.dispatching_[i]}return r}},t.prototype.disposeInternal=function(){!function(e){var t=ca(e);if(t)for(var i in t)ua(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]=va,++this.pendingRemovals_[e]):(i.splice(r,1),0===i.length&&delete this.listeners_[e])}},t}(ga),xa="change",Ca="clear",Sa="error",Ma="load";var ka=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(xa)},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),n=0;n<i;++n)r[n]=da(this,e[n],t);return r}return da(this,e,t)},t.prototype.once=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=pa(this,e[n],t);return r}return pa(this,e,t)},t.prototype.un=function(e,t){if(Array.isArray(e))for(var i=0,r=e.length;i<r;++i)fa(this,e[i],t);else fa(this,e,t)},t}(wa),Ta=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}(_a),Ia=function(e){function t(t){e.call(this),qr(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 Jr({},this.values_)},t.prototype.notify=function(e,t){var i;i=function(e){return Oa.hasOwnProperty(e)?Oa[e]:Oa[e]="change:"+e}(e),this.dispatchEvent(new Ta(i,e,t)),i=sa,this.dispatchEvent(new Ta(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}(ka),Oa={};var Ea=Ia;function La(e,t,i,r,n,a){for(var o=a||[],s=0,l=t;l<i;l+=r){var h=e[l],c=e[l+1];o[s++]=n[0]*h+n[2]*c+n[4],o[s++]=n[1]*h+n[3]*c+n[5]}return a&&o.length!=s&&(o.length=s),o}new Array(6);function Pa(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 Ra(e,t,i,r,n,a,o,s){var l=Math.sin(a),h=Math.cos(a);return e[0]=r*h,e[1]=n*l,e[2]=-r*l,e[3]=n*h,e[4]=o*r*h-s*r*l+t,e[5]=o*n*l+s*n*h+i,e}var ja=[1,0,0,1,0,0];function Aa(e){var t;return e==ia.XY?t=2:e==ia.XYZ||e==ia.XYM?t=3:e==ia.XYZM&&(t=4),t}var za=function(e){function t(){e.call(this),this.layout=ia.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 pn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Fr()},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()&&($r(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=Aa(e),this.layout=e,this.flatCoordinates=t},t.prototype.setCoordinates=function(e,t){Fr()},t.prototype.setLayout=function(e,t,i){var r;if(e)r=Aa(e);else{for(var n=0;n<i;++n){if(0===t.length)return this.layout=ia.XY,void(this.stride=2);t=t[0]}e=function(e){var t;2==e?t=ia.XY:3==e?t=ia.XYZ:4==e&&(t=ia.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,n,a,o){for(var s=o||[],l=Math.cos(n),h=Math.sin(n),c=a[0],u=a[1],d=0,p=t;p<i;p+=r){var f=e[p]-c,m=e[p+1]-u;s[d++]=c+f*l-m*h,s[d++]=u+f*h+m*l;for(var y=p+2;y<p+r;++y)s[d++]=e[y]}o&&s.length!=d&&(s.length=d)}(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 n=i;n||(n=bn(this.getExtent()));var a=this.getFlatCoordinates();if(a){var o=this.getStride();!function(e,t,i,r,n,a,o,s){for(var l=s||[],h=o[0],c=o[1],u=0,d=t;d<i;d+=r){var p=e[d]-h,f=e[d+1]-c;l[u++]=h+n*p,l[u++]=c+a*f;for(var m=d+2;m<d+r;++m)l[u++]=e[m]}s&&l.length!=u&&(l.length=u)}(a,0,a.length,o,e,r,n,a),this.changed()}},t.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,n,a,o){for(var s=o||[],l=0,h=t;h<i;h+=r){s[l++]=e[h]+n,s[l++]=e[h+1]+a;for(var c=h+2;c<h+r;++c)s[l++]=e[c]}o&&s.length!=l&&(s.length=l)}(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 Fr()},t.prototype.closestPointXY=function(e,t,i,r){return Fr()},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 Fr()},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){Fr()},t.prototype.scale=function(e,t,i){Fr()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return Fr()},t.prototype.getType=function(){return Fr()},t.prototype.applyTransform=function(e){Fr()},t.prototype.intersectsExtent=function(e){return Fr()},t.prototype.translate=function(e,t){Fr()},t.prototype.transform=function(e,t){var i=Xn(e),r=i.getUnits()==Tn.TILE_PIXELS?function(e,r,n){var a=i.getExtent(),o=i.getWorldExtent(),s=_n(o)/_n(a);return Ra(ja,o[0],o[3],s,-s,0,0,0),La(e,0,e.length,n,ja,r),Kn(i,t)(e,r,n)}:Kn(i,t);return this.applyTransform(r),this},t}(Ea));function Da(e,t,i,r,n,a,o){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 d=((n-l)*c+(a-h)*u)/(c*c+u*u);if(d>1)s=i;else{if(d>0){for(var p=0;p<r;++p)o[p]=rn(e[t+p],e[i+p],d);return void(o.length=r)}s=t}}for(var f=0;f<r;++f)o[f]=e[s+f];o.length=r}function Va(e,t,i,r,n){var a=e[t],o=e[t+1];for(t+=r;t<i;t+=r){var s=e[t],l=e[t+1],h=tn(a,o,s,l);h>n&&(n=h),a=s,o=l}return n}function Na(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=Va(e,t,s,r,n),t=s}return n}function Ga(e,t,i,r,n,a,o,s,l,h,c){if(t==i)return h;var u,d;if(0===n){if((d=tn(o,s,e[t],e[t+1]))<h){for(u=0;u<r;++u)l[u]=e[t+u];return l.length=r,d}return h}for(var p=c||[NaN,NaN],f=t+r;f<i;)if(Da(e,f-r,f,r,o,s,p),(d=tn(o,s,p[0],p[1]))<h){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r,f+=r}else f+=r*Math.max((Math.sqrt(d)-Math.sqrt(h))/n|0,1);if(a&&(Da(e,i-r,t,r,o,s,p),(d=tn(o,s,p[0],p[1]))<h)){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r}return h}function Fa(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Ga(e,t,f,r,n,a,o,s,l,h,u),t=f}return h}function Ba(e,t,i,r){for(var n=0,a=i.length;n<a;++n)for(var o=i[n],s=0;s<r;++s)e[t++]=o[s];return t}function qa(e,t,i,r,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=Ba(e,t,i[s],r);a[o++]=h,t=h}return a.length=o,a}function Ua(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=t;s<i;s+=r)a[o++]=e.slice(s,s+r);return a.length=o,a}function Wa(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=Ua(e,t,h,r,a[o]),t=h}return a.length=o,a}function Ha(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=Wa(e,t,h,r,a[o]),t=h[h.length-1]}return a.length=o,a}function Ya(e,t,i,r,n,a){var o=NaN,s=NaN,l=(i-t)/r;if(1===l)o=e[t],s=e[t+1];else if(2==l)o=(1-n)*e[t]+n*e[t+r],s=(1-n)*e[t+1]+n*e[t+r+1];else if(0!==l){for(var h=e[t],c=e[t+1],u=0,d=[0],p=t+r;p<i;p+=r){var f=e[p],m=e[p+1];u+=Math.sqrt((f-h)*(f-h)+(m-c)*(m-c)),d.push(u),h=f,c=m}var y=n*u,g=function(e,t,i){for(var r,n,a=i||ra,o=0,s=e.length,l=!1;o<s;)(n=+a(e[r=o+(s-o>>1)],t))<0?o=r+1:(s=r,l=!n);return l?o:~o}(d,y);if(g<0){var v=(y-d[-g-2])/(d[-g-1]-d[-g-2]),b=t+(-g-2)*r;o=rn(e[b],e[b+r],v),s=rn(e[b+1],e[b+r+1],v)}else o=e[t+g*r],s=e[t+g*r+1]}return a?(a[0]=o,a[1]=s,a):[o,s]}function Xa(e,t,i,r,n,a){if(i==t)return null;var o;if(n<e[t+r-1])return a?((o=e.slice(t,t+r))[r-1]=n,o):null;if(e[i-1]<n)return a?((o=e.slice(i-r,i))[r-1]=n,o):null;if(n==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;n<e[(h+1)*r-1]?l=h:s=h+1}var c=e[s*r-1];if(n==c)return e.slice((s-1)*r,(s-1)*r+r);var u=(n-c)/(e[(s+1)*r-1]-c);o=[];for(var d=0;d<r-1;++d)o.push(rn(e[(s-1)*r+d],e[s*r+d],u));return o.push(n),o}function Ja(e,t,i,r,n){return!function(e,t,i){var r;return(r=t.call(i,gn(e)))?r:(r=t.call(i,vn(e)))?r:(r=t.call(i,xn(e)))?r:(r=t.call(i,wn(e)))||!1}(n,function(n){return!$a(e,t,i,r,n[0],n[1])})}function $a(e,t,i,r,n,a){for(var o=0,s=e[i-r],l=e[i-r+1];t<i;t+=r){var h=e[t],c=e[t+1];l<=a?c>a&&(h-s)*(a-l)-(n-s)*(c-l)>0&&o++:c<=a&&(h-s)*(a-l)-(n-s)*(c-l)<0&&o--,s=h,l=c}return 0!==o}function Ka(e,t,i,r,n,a){if(0===i.length)return!1;if(!$a(e,t,i[0],r,n,a))return!1;for(var o=1,s=i.length;o<s;++o)if($a(e,i[o-1],i[o],r,n,a))return!1;return!0}function Za(e,t,i,r,n,a){for(var o,s=[e[t],e[t+1]],l=[];t+r<i;t+=r){if(l[0]=e[t+r],l[1]=e[t+r+1],o=n.call(a,s,l))return o;s[0]=l[0],s[1]=l[1]}return!1}function Qa(e,t,i,r,n){var a=mn([1/0,1/0,-1/0,-1/0],e,t,i,r);return!!Cn(n,a)&&(!!function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}(n,a)||(a[0]>=n[0]&&a[2]<=n[2]||(a[1]>=n[1]&&a[3]<=n[3]||Za(e,t,i,r,function(e,t){return function(e,t,i){var r=!1,n=hn(e,t),a=hn(e,i);if(n===an.INTERSECTING||a===an.INTERSECTING)r=!0;else{var o,s,l=e[0],h=e[1],c=e[2],u=e[3],d=t[0],p=t[1],f=i[0],m=i[1],y=(m-p)/(f-d);a&an.ABOVE&&!(n&an.ABOVE)&&(r=(o=f-(m-u)/y)>=l&&o<=c),r||!(a&an.RIGHT)||n&an.RIGHT||(r=(s=m-(f-c)*y)>=h&&s<=u),r||!(a&an.BELOW)||n&an.BELOW||(r=(o=f-(m-h)/y)>=l&&o<=c),r||!(a&an.LEFT)||n&an.LEFT||(r=(s=m-(f-l)*y)>=h&&s<=u)}return r}(n,e,t)}))))}function eo(e,t,i,r,n){if(!function(e,t,i,r,n){return!!(Qa(e,t,i,r,n)||$a(e,t,i,r,n[0],n[1])||$a(e,t,i,r,n[0],n[3])||$a(e,t,i,r,n[2],n[1])||$a(e,t,i,r,n[2],n[3]))}(e,t,i[0],r,n))return!1;if(1===i.length)return!0;for(var a=1,o=i.length;a<o;++a)if(Ja(e,i[a-1],i[a],r,n)&&!Qa(e,i[a-1],i[a],r,n))return!1;return!0}function to(e,t,i,r){for(var n=e[t],a=e[t+1],o=0,s=t+r;s<i;s+=r){var l=e[s],h=e[s+1];o+=Math.sqrt((l-n)*(l-n)+(h-a)*(h-a)),n=l,a=h}return o}function io(e,t,i,r,n,a,o){var s=(i-t)/r;if(s<3){for(;t<i;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}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(),d=h.pop(),p=0,f=e[d],m=e[d+1],y=e[u],g=e[u+1],v=d+r;v<u;v+=r){var b=en(e[v],e[v+1],f,m,y,g);b>p&&(c=v,p=b)}p>n&&(l[(c-t)/r]=1,d+r<c&&h.push(d,c),c+r<u&&h.push(c,u))}for(var _=0;_<s;++_)l[_]&&(a[o++]=e[t+_*r],a[o++]=e[t+_*r+1]);return o}function ro(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=io(e,t,c,r,n,a,o),s.push(o),t=c}return o}function no(e,t){return t*Math.round(e/t)}function ao(e,t,i,r,n,a,o){if(t==i)return o;var s,l,h=no(e[t],n),c=no(e[t+1],n);t+=r,a[o++]=h,a[o++]=c;do{if(s=no(e[t],n),l=no(e[t+1],n),(t+=r)==i)return a[o++]=s,a[o++]=l,o}while(s==h&&l==c);for(;t<i;){var u=no(e[t],n),d=no(e[t+1],n);if(t+=r,u!=s||d!=l){var p=s-h,f=l-c,m=u-h,y=d-c;p*y==f*m&&(p<0&&m<p||p==m||p>0&&m>p)&&(f<0&&y<f||f==y||f>0&&y>f)?(s=u,l=d):(a[o++]=s,a[o++]=l,h=s,c=l,s=u,l=d)}}return a[o++]=s,a[o++]=l,o}function oo(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=ao(e,t,c,r,n,a,o),s.push(o),t=c}return o}var so=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?aa(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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ga(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.forEachSegment=function(e){return Za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinateAtM=function(e,t){if(this.layout!=ia.XYM&&this.layout!=ia.XYZM)return null;var i=void 0!==t&&t;return Xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)},t.prototype.getCoordinates=function(){return Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinateAt=function(e,t){return Ya(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t.prototype.getLength=function(){return to(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=io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,ia.XY)},t.prototype.getType=function(){return nn.LINE_STRING},t.prototype.intersectsExtent=function(e){return Qa(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=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za),lo=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 n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout()),aa(o,c.getFlatCoordinates()),s.push(o.length)}this.setFlatCoordinates(n,o),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?aa(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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.getCoordinateAtM=function(e,t,i){if(this.layout!=ia.XYM&&this.layout!=ia.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,n=void 0!==i&&i;return function(e,t,i,r,n,a,o){if(o)return Xa(e,t,i[i.length-1],r,n,a);var s;if(n<e[r-1])return a?((s=e.slice(0,r))[r-1]=n,s):null;if(e[e.length-1]<n)return a?((s=e.slice(e.length-r))[r-1]=n,s):null;for(var l=0,h=i.length;l<h;++l){var c=i[l];if(t!=c){if(n<e[t+r-1])return null;if(n<=e[c-1])return Xa(e,t,c,r,n,!1);t=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,e,r,n)},t.prototype.getCoordinates=function(){return Wa(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 so(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=[],n=0,a=0,o=t.length;a<o;++a){var s=t[a],l=new so(e.slice(n,s),i);r.push(l),n=s}return r},t.prototype.getFlatMidpoints=function(){for(var e=[],t=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,a=0,o=r.length;a<o;++a){var s=r[a];aa(e,Ya(t,i,s,n,.5)),i=s}return e},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=ro(this.flatCoordinates,0,this.ends_,this.stride,e,i,0,r),new t(i,ia.XY,r)},t.prototype.getType=function(){return nn.MULTI_LINE_STRING},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){if(Qa(e,t,i[a],r,n))return!0;t=i[a]}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=qa(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(za),ho=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 n=this.flatCoordinates,a=tn(e,t,n[0],n[1]);if(a<r){for(var o=this.stride,s=0;s<o;++s)i[s]=n[s];return i.length=o,a}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(e){return dn(this.flatCoordinates,e)},t.prototype.getType=function(){return nn.POINT},t.prototype.intersectsExtent=function(e){return ln(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 n=0,a=i.length;n<a;++n)e[t++]=i[n];return t}(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za),co=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?aa(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<sn(this.getExtent(),e,t))return r;for(var n=this.flatCoordinates,a=this.stride,o=0,s=n.length;o<s;o+=a){var l=tn(e,t,n[o],n[o+1]);if(l<r){r=l;for(var h=0;h<a;++h)i[h]=n[o+h];i.length=a}}return r},t.prototype.getCoordinates=function(){return Ua(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 ho(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=[],n=0,a=e.length;n<a;n+=i){var o=new ho(e.slice(n,n+i),t);r.push(o)}return r},t.prototype.getType=function(){return nn.MULTI_POINT},t.prototype.intersectsExtent=function(e){for(var t=this.flatCoordinates,i=this.stride,r=0,n=t.length;r<n;r+=i){if(ln(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=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za);function uo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=o*s-a*l,a=s,o=l}return n/2}function po(e,t,i,r){for(var n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=uo(e,t,s,r),t=s}return n}var fo=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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ga(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.getArea=function(){return uo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,ia.XY)},t.prototype.getType=function(){return nn.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=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za);function mo(e,t,i,r,n,a,o){for(var s,l,h,c,u,d,p,f=n[a+1],m=[],y=0,g=i.length;y<g;++y){var v=i[y];for(c=e[v-r],d=e[v-r+1],s=t;s<v;s+=r)u=e[s],p=e[s+1],(f<=d&&p<=f||d<=f&&f<=p)&&(h=(f-d)/(p-d)*(u-c)+c,m.push(h)),c=u,d=p}var b=NaN,_=-1/0;for(m.sort(ra),c=m[0],s=1,l=m.length;s<l;++s){u=m[s];var w=Math.abs(u-c);w>_&&Ka(e,t,i,r,h=(c+u)/2,f)&&(b=h,_=w),c=u}return isNaN(b)&&(b=n[a]),o?(o.push(b,f,_),o):[b,f,_]}function yo(e,t,i,r,n){for(var a=[],o=0,s=i.length;o<s;++o){var l=i[o];a=mo(e,t,l,r,n,2*o,a),t=l[l.length-1]}return a}function go(e,t,i,r){for(;t<i-r;){for(var n=0;n<r;++n){var a=e[t+n];e[t+n]=e[i-r+n],e[i-r+n]=a}t+=r,i-=r}}function vo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=(s-a)*(l+o),a=s,o=l}return n>0}function bo(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=vo(e,t,l,r);if(0===o){if(a&&h||!a&&!h)return!1}else if(a&&!h||!a&&h)return!1;t=l}return!0}function _o(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=vo(e,t,l,r);(0===o?a&&h||!a&&!h:a&&!h||!a&&h)&&go(e,t,l,r),t=l}return t}function wo(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)t=_o(e,t,i[a],r,n);return t}var xo=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?aa(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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return Ka(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)},t.prototype.getArea=function(){return po(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?_o(t=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,e):t=this.flatCoordinates,Wa(t,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=bn(this.getExtent());this.flatInteriorPoint_=mo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new ho(this.getFlatInteriorPoint(),ia.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(e){return e<0||this.ends_.length<=e?null:new fo(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=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a],l=new fo(t.slice(n,s),e);r.push(l),n=s}return r},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;bo(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=_o(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=oo(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,r),new t(i,ia.XY,r)},t.prototype.getType=function(){return nn.POLYGON},t.prototype.intersectsExtent=function(e){return eo(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=qa(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(za),Co=xo;function So(e,t,i,r){for(var n=[],a=[1/0,1/0,-1/0,-1/0],o=0,s=i.length;o<s;++o){var l=i[o];a=pn(e,t,l[0],r),n.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=l[l.length-1]}return n}var Mo=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 n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout());for(var u=o.length,d=c.getEnds(),p=0,f=d.length;p<f;++p)d[p]+=u;aa(o,c.getFlatCoordinates()),s.push(d)}i=n,t=o,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;aa(this.flatCoordinates,e.getFlatCoordinates());for(var r=0,n=(t=e.getEnds().slice()).length;r<n;++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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=Na(e,t,s,r,n),t=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Fa(e,t,f,r,n,a,o,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,n,a){if(0===i.length)return!1;for(var o=0,s=i.length;o<s;++o){var l=i[o];if(Ka(e,t,l,r,n,a))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 n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=po(e,t,s,r),t=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?wo(t=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,e):t=this.flatCoordinates,Ha(t,0,this.endss_,this.stride)},t.prototype.getEndss=function(){return this.endss_},t.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var e=So(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=yo(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t.prototype.getInteriorPoints=function(){return new co(this.getFlatInteriorPoints().slice(),ia.XYM)},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;!function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)if(!bo(e,t,i[a],r,n))return!1;return!0}(e,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=wo(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,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l],u=[];o=oo(e,t,c,r,n,a,o,u),s.push(u),t=c[c.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),i,0,r),new t(i,ia.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(),n=r[r.length-1];if(0!==t)for(var a=0,o=r.length;a<o;++a)r[a]-=t;return new Co(this.flatCoordinates.slice(t,n),this.layout,r)},t.prototype.getPolygons=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a].slice(),l=s[s.length-1];if(0!==n)for(var h=0,c=s.length;h<c;++h)s[h]-=n;var u=new Co(t.slice(n,l),e,s);r.push(u),n=l}return r},t.prototype.getType=function(){return nn.MULTI_POLYGON},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];if(eo(e,t,s,r,n))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,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=qa(e,t,i[s],r,a[o]);a[o++]=h,t=h[h.length-1]}return a.length=o,a}(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}(za),ko=[1,0,0,1,0,0],To=function(e,t,i,r,n){this.extent_,this.id_=n,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};To.prototype.get=function(e){return this.properties_[e]},To.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===nn.POINT?dn(this.flatCoordinates_):pn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},To.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=bn(this.getExtent());this.flatInteriorPoints_=mo(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},To.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=So(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=yo(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},To.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Ya(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},To.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,i=this.ends_,r=0,n=i.length;r<n;++r){var a=i[r],o=Ya(e,t,a,2,.5);aa(this.flatMidpoints_,o),t=a}}return this.flatMidpoints_},To.prototype.getId=function(){return this.id_},To.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},To.prototype.getGeometry=function(){return this},To.prototype.getSimplifiedGeometry=function(e){return this},To.prototype.getProperties=function(){return this.properties_},To.prototype.getStride=function(){return 2},To.prototype.getStyleFunction=function(){},To.prototype.getType=function(){return this.type_},To.prototype.transform=function(e,t){var i=(e=Xn(e)).getExtent(),r=e.getWorldExtent(),n=_n(r)/_n(i);Ra(ko,r[0],r[3],n,-n,0,0,0),La(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ko,this.flatCoordinates_)},To.prototype.getEnds=To.prototype.getEndss=function(){return this.ends_},To.prototype.getFlatCoordinates=To.prototype.getOrientedFlatCoordinates;var Io=To;function Oo(e,t,i){if(3===e){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Eo,r,n),r.length=r.features.length,r.length&&(t[r.name]=r)}}function Eo(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,n=i.readVarint()+i.pos;i.pos<n;)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 Lo(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 n=t.layer.keys[i.readVarint()],a=t.layer.values[i.readVarint()];t.properties[n]=a}else 3==e?t.type=i.readVarint():4==e&&(t.geometry=i.pos)}function Po(e,t,i){e.pos=t.features[i];var r=e.readVarint()+e.pos,n={layer:t,type:0,properties:{}};return e.readFields(Lo,n,r),n}var Ro=function(e){function t(t){e.call(this);var i=t||{};this.dataProjection=new On({code:"",units:Tn.TILE_PIXELS}),this.featureClass_=i.featureClass?i.featureClass:Io,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 n=e.readVarint()+e.pos,a=1,o=0,s=0,l=0,h=0,c=0;e.pos<n;){if(!o){var u=e.readVarint();a=7&u,o=u>>3}o--,1===a||2===a?(s+=e.readSVarint(),l+=e.readSVarint(),1===a&&h>c&&(r.push(h),c=h),i.push(s,l),h+=2):7===a?h>c&&(i.push(i[c],i[c+1]),h+=2):Hr(!1,59)}h>c&&(r.push(h),c=h)},t.prototype.createFeature_=function(e,t,i){var r,n=t.type;if(0===n)return null;var a=t.id,o=t.properties;o[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?nn.POINT:nn.MULTI_POINT:2===e?i=1===t?nn.LINE_STRING:nn.MULTI_LINE_STRING:3===e&&(i=nn.POLYGON);return i}(n,l.length);if(this.featureClass_===Io)r=new this.featureClass_(h,s,l,o,a);else{var c;if(h==nn.POLYGON){for(var u=[],d=0,p=0,f=0,m=l.length;f<m;++f){var y=l[f];vo(s,d,y,2)||(u.push(l.slice(p,f)),p=f),d=y}c=u.length>1?new Mo(s,ia.XY,u):new Co(s,ia.XY,l)}else c=h===nn.POINT?new ho(s,ia.XY):h===nn.LINE_STRING?new so(s,ia.XY):h===nn.POLYGON?new Co(s,ia.XY,l):h===nn.MULTI_POINT?new co(s,ia.XY):h===nn.MULTI_LINE_STRING?new lo(s,ia.XY,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var g=ea(c,!1,this.adaptOptions(i));r.setGeometry(g),r.setId(a),r.setProperties(o)}return r},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return ta},t.prototype.readFeatures=function(e,t){var i=this.layers_,r=new Xr.a(e),n=r.readFields(Oo,{}),a=[];for(var o in n)if(!i||-1!=i.indexOf(o)){for(var s=n[o],l=0,h=s.length;l<h;++l){var c=Po(r,s,l);a.push(this.createFeature_(r,c))}this.extent_=s?[0,0,s.extent,s.extent]:null}return a},t.prototype.readProjection=function(e){return this.dataProjection},t.prototype.setLayers=function(e){this.layers_=e},t}(Qn);function jo(e,t){var i=document.createElement("canvas");return e&&(i.width=e),t&&(i.height=t),i.getContext("2d")}var Ao=function(){};Ao.prototype.getReplay=function(e,t){return Fr()},Ao.prototype.isEmpty=function(){return Fr()},Ao.prototype.addDeclutter=function(e){return Fr()};var zo=Ao,Do={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},Vo=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,No=/^([a-z]*)$/i;function Go(e){return"string"==typeof e?e:qo(e)}var Fo=function(){var e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){var n=0;for(var a in e)0==(3&n++)&&(delete e[a],--t)}r=function(e){var t,i,r,n,a;No.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(Vo.exec(e)){var o,s=e.length-1;o=s<=4?1:2;var l=4===s||8===s;t=parseInt(e.substr(1+0*o,o),16),i=parseInt(e.substr(1+1*o,o),16),r=parseInt(e.substr(1+2*o,o),16),n=l?parseInt(e.substr(1+3*o,o),16):255,1==o&&(t=(t<<4)+t,i=(i<<4)+i,r=(r<<4)+r,l&&(n=(n<<4)+n)),a=[t,i,r,n/255]}else 0==e.indexOf("rgba(")?Bo(a=e.slice(5,-1).split(",").map(Number)):0==e.indexOf("rgb(")?((a=e.slice(4,-1).split(",").map(Number)).push(1),Bo(a)):Hr(!1,14);return a}(i),e[i]=r,++t}return r}}();function Bo(e){return e[0]=Zr(e[0]+.5|0,0,255),e[1]=Zr(e[1]+.5|0,0,255),e[2]=Zr(e[2]+.5|0,0,255),e[3]=Zr(e[3],0,1),e}function qo(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 Uo(e){return Array.isArray(e)?qo(e):e}function Wo(e,t,i,r,n,a,o,s){for(var l,h,c,u=[],d=e[t]>e[i-r],p=n.length,f=e[t],m=e[t+1],y=e[t+=r],g=e[t+1],v=0,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2)),_="",w=0,x=0;x<p;++x){h=d?p-x-1:x;var C=n.charAt(h),S=a(_=d?C+_:_+C)-w;w+=S;for(var M=o+S/2;t<i-r&&v+b<M;)f=y,m=g,y=e[t+=r],g=e[t+1],v+=b,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2));var k=M-v,T=Math.atan2(g-m,y-f);if(d&&(T+=T>0?-Math.PI:Math.PI),void 0!==c){var I=T-c;if(I+=I>Math.PI?-2*Math.PI:I<-Math.PI?2*Math.PI:0,Math.abs(I)>s)return null}var O=k/b,E=rn(f,y,O),L=rn(m,g,O);c==T?(d&&(l[0]=E,l[1]=L,l[2]=S/2),l[4]=_):(w=S,l=[E,L,S/2,T,_=C],d?u.unshift(l):u.push(l),c=T),o+=S}return u}var Ho="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Yo=(Ho.indexOf("firefox"),-1!==Ho.indexOf("safari")&&Ho.indexOf("chrom"),-1!==Ho.indexOf("webkit")&&Ho.indexOf("edge"),Ho.indexOf("macintosh"),window.devicePixelRatio,function(){var e=!1;try{e=!!document.createElement("canvas").getContext("2d").setLineDash}catch(e){}return e}()),Xo=(navigator,window,window,navigator.msPointerEnabled,function(){});Xo.prototype.drawCustom=function(e,t,i){},Xo.prototype.drawGeometry=function(e){},Xo.prototype.setStyle=function(e){},Xo.prototype.drawCircle=function(e,t){},Xo.prototype.drawFeature=function(e,t){},Xo.prototype.drawGeometryCollection=function(e,t){},Xo.prototype.drawLineString=function(e,t){},Xo.prototype.drawMultiLineString=function(e,t){},Xo.prototype.drawMultiPoint=function(e,t){},Xo.prototype.drawMultiPolygon=function(e,t){},Xo.prototype.drawPoint=function(e,t){},Xo.prototype.drawPolygon=function(e,t){},Xo.prototype.drawText=function(e,t){},Xo.prototype.setFillStrokeStyle=function(e,t){},Xo.prototype.setImageStyle=function(e,t){},Xo.prototype.setTextStyle=function(e,t){};var Jo=Xo,$o=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]}}(),Ko=[0,0,0,1],Zo=[],Qo=[0,0,0,1],es=[0,0,0,0],ts=new(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(Ca)},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 Hr(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 Hr(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){Hr(!(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}(wa)),is={},rs=null,ns={},as=function(){var e,t,i=60,r=is,n="32px ",a=["monospace","serif"],o=a.length,s="wmytzilWMYTZIL@#/&?$%10";function l(e){for(var i=os(),r=100;r<=700;r+=300){for(var l=r+" ",h=!0,c=0;c<o;++c){var u=a[c];if(i.font=l+n+u,t=i.measureText(s).width,e!=u){i.font=l+n+e+","+u;var d=i.measureText(s).width;h=h&&d!=t}}if(h)return!0}return!1}function h(){var t=!0;for(var n in r)r[n]<i&&(l(n)?(r[n]=i,$r(ns),rs=null,ts.clear()):(++r[n],t=!1));t&&(clearInterval(e),e=void 0)}return function(t){var n=$o(t);if(n)for(var a=0,o=n.length;a<o;++a){var s=n[a];s in r||(r[s]=i,l(s)||(r[s]=0,void 0===e&&(e=setInterval(h,32))))}}}();function os(){return rs||(rs=jo(1,1)),rs}var ss=function(){var e,t=ns;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 ls(e,t){var i=os();return e!=i.font&&(i.font=e),i.measureText(t).width}var hs=[1,0,0,1,0,0];function cs(e,t,i,r,n,a,o,s,l,h,c){var u;1!=i&&(u=e.globalAlpha,e.globalAlpha=u*i),t&&e.setTransform.apply(e,t),e.drawImage(r,n,a,o,s,l,h,o*c,s*c),u&&(e.globalAlpha=u),t&&e.setTransform.apply(e,hs)}var us={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},ds=[us.FILL],ps=[us.STROKE],fs=[us.BEGIN_PATH],ms=[us.CLOSE_PATH],ys=us,gs=[Do.POLYGON,Do.CIRCLE,Do.LINE_STRING,Do.IMAGE,Do.TEXT,Do.DEFAULT],vs={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},bs=[1/0,1/0,-1/0,-1/0],_s=[1,0,0,1,0,0],ws=function(e){function t(t,i,r,n,a,o){e.call(this),this.declutterTree=o,this.tolerance=t,this.maxExtent=i,this.overlaps=a,this.pixelRatio=n,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,n,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,n),e.lineTo.apply(e,t),a&&(this.alignFill_=a[2],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())},t.prototype.replayImage_=function(e,t,i,r,n,a,o,s,l,h,c,u,d,p,f,m,y,g){var v=y||g;t-=n*=d,i-=a*=d;var b,_,w,x,C=f+h>r.width?r.width-h:f,S=s+c>r.height?r.height-c:s,M=m[3]+C*d+m[1],k=m[0]+S*d+m[2],T=t-m[3],I=i-m[0];(v||0!==u)&&(b=[T,I],_=[T+M,I],w=[T+M,I+k],x=[T,I+k]);var O=null;if(0!==u){var E=t+n,L=i+a;O=Ra(_s,E,L,1,1,u,-E,-L),un(bs),fn(bs,Pa(_s,b)),fn(bs,Pa(_s,_)),fn(bs,Pa(_s,w)),fn(bs,Pa(_s,x))}else cn(T,I,T+M,I+k,bs);var P=e.canvas,R=g?g[2]*d/2:0,j=bs[0]-R<=P.width&&bs[2]+R>=0&&bs[1]-R<=P.height&&bs[3]+R>=0;if(p&&(t=Math.round(t),i=Math.round(i)),o){if(!j&&1==o[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])}(o,bs);var A=j?[e,O?O.slice(0):null,l,r,h,c,C,S,t,i,d]:null;A&&v&&A.push(y,g,b,_,w,x),o.push(A)}else j&&(v&&this.replayTextBackground_(e,b,_,w,x,y,g),cs(e,O,l,r,h,c,C,S,t,i,d))},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,n,a){var o=this.coordinates.length,s=this.getBufferedMaxExtent();a&&(t+=r);var l,h,c,u=[e[t],e[t+1]],d=[NaN,NaN],p=!0;for(l=t+r;l<i;l+=r)d[0]=e[l],d[1]=e[l+1],(c=hn(s,d))!==h?(p&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):c===an.INTERSECTING?(this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):p=!0,u[0]=d[0],u[1]=d[1],h=c;return(n&&p||l===t+r)&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),o},t.prototype.drawCustomCoordinates_=function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a],l=this.appendFlatCoordinates(e,t,s,r,!1,!1);n.push(l),t=s}return t},t.prototype.drawCustom=function(e,t,i){this.beginGeometry(e,t);var r,n,a,o,s,l=e.getType(),h=e.getStride(),c=this.coordinates.length;if(l==nn.MULTI_POLYGON){r=(e=e).getOrientedFlatCoordinates(),o=[];var u=e.getEndss();s=0;for(var d=0,p=u.length;d<p;++d){var f=[];s=this.drawCustomCoordinates_(r,s,u[d],h,f),o.push(f)}this.instructions.push([ys.CUSTOM,c,o,e,i,Ha])}else l==nn.POLYGON||l==nn.MULTI_LINE_STRING?(a=[],r=l==nn.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,e.getEnds(),h,a),this.instructions.push([ys.CUSTOM,c,a,e,i,Wa])):l==nn.LINE_STRING||l==nn.MULTI_POINT?(r=e.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([ys.CUSTOM,c,n,e,i,Ua])):l==nn.POINT&&(r=e.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([ys.CUSTOM,c,n,e,i]));this.endGeometry(e,t)},t.prototype.beginGeometry=function(e,t){this.beginGeometryInstruction1_=[ys.BEGIN_GEOMETRY,t,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ys.BEGIN_GEOMETRY,t,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){},t.prototype.fill_=function(e){if(this.alignFill_){var t=Pa(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,hs)},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],Yo&&(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 n=5,a=e.length;n<a;++n){var o=e[n];o&&(o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),cs.apply(void 0,o))}}e.length=5,un(e)}}},t.prototype.replay_=function(e,t,i,r,n,a,o){var s;this.pixelCoordinates_&&oa(t,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=La(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,d,p,f,m,y,g,v,b,_=!Kr(i),w=0,x=r.length,C=0,S=0,M=0,k=null,T=null,I=this.coordinateCache_,O=this.viewRotation_,E={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:O},L=this.instructions!=r||this.overlaps?0:200;w<x;){var P=r[w];switch(P[0]){case ys.BEGIN_GEOMETRY:g=P[1],_&&i[qr(g)]||!g.getGeometry()?w=P[2]:void 0===o||Cn(o,g.getGeometry().getExtent())?++w:w=P[2]+1;break;case ys.BEGIN_PATH:S>L&&(this.fill_(e),S=0),M>L&&(e.stroke(),M=0),S||M||(e.beginPath(),u=d=NaN),++w;break;case ys.CIRCLE:var R=s[C=P[1]],j=s[C+1],A=s[C+2]-R,z=s[C+3]-j,D=Math.sqrt(A*A+z*z);e.moveTo(R+D,j),e.arc(R,j,D,0,2*Math.PI,!0),++w;break;case ys.CLOSE_PATH:e.closePath(),++w;break;case ys.CUSTOM:C=P[1],l=P[2];var V=P[3],N=P[4],G=6==P.length?P[5]:void 0;E.geometry=V,E.feature=g,w in I||(I[w]=[]);var F=I[w];G?G(s,C,l,2,F):(F[0]=s[C],F[1]=s[C+1],F.length=2),N(F,E),++w;break;case ys.DRAW_IMAGE:C=P[1],l=P[2],y=P[3],h=P[4],c=P[5],m=a?null:P[6];var B=P[7],q=P[8],U=P[9],W=P[10],H=P[11],Y=P[12],X=P[13],J=P[14],$=void 0,K=void 0,Z=void 0;for(P.length>16?($=P[15],K=P[16],Z=P[17]):($=es,K=Z=!1),H&&(Y+=O);C<l;C+=2)this.replayImage_(e,s[C],s[C+1],y,h,c,m,B,q,U,W,Y,X,n,J,$,K?k:null,Z?T:null);this.renderDeclutter_(m,g),++w;break;case ys.DRAW_CHARS:var Q=P[1],ee=P[2],te=P[3];m=a?null:P[4];var ie=P[5],re=P[6],ne=P[7],ae=P[8],oe=P[9],se=P[10],le=P[11],he=P[12],ce=P[13],ue=P[14],de=to(s,Q,ee,2),pe=ae(he);if(ie||pe<=de){var fe=this.textStates[ce].textAlign,me=Wo(s,Q,ee,2,he,ae,(de-pe)*vs[fe],ne);if(me){var ye=void 0,ge=void 0,ve=void 0,be=void 0,_e=void 0;if(se)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,"",se),h=_e[2]+le,c=te*be.height+2*(.5-te)*le-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,es,null,null);if(re)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,re,""),h=_e[2],c=te*be.height-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,es,null,null)}}this.renderDeclutter_(m,g),++w;break;case ys.END_GEOMETRY:if(void 0!==a){var we=a(g=P[1]);if(we)return we}++w;break;case ys.FILL:L?S++:this.fill_(e),++w;break;case ys.MOVE_TO_LINE_TO:for(C=P[1],l=P[2],v=s[C],f=(b=s[C+1])+.5|0,(p=v+.5|0)===u&&f===d||(e.moveTo(v,b),u=p,d=f),C+=2;C<l;C+=2)p=(v=s[C])+.5|0,f=(b=s[C+1])+.5|0,C!=l-2&&p===u&&f===d||(e.lineTo(v,b),u=p,d=f);++w;break;case ys.SET_FILL_STYLE:k=P,this.alignFill_=P[2],S&&(this.fill_(e),S=0,M&&(e.stroke(),M=0)),e.fillStyle=P[1],++w;break;case ys.SET_STROKE_STYLE:T=P,M&&(e.stroke(),M=0),this.setStrokeStyle_(e,P),++w;break;case ys.STROKE:L?M++:e.stroke(),++w;break;default:++w}}S&&this.fill_(e),M&&e.stroke()},t.prototype.replay=function(e,t,i,r,n){this.viewRotation_=i,this.replay_(e,t,r,this.instructions,n,void 0,void 0)},t.prototype.replayHitDetection=function(e,t,i,r,n,a){return this.viewRotation_=i,this.replay_(e,t,r,this.hitDetectionInstructions,!0,n,a)},t.prototype.reverseHitDetectionInstructions=function(){var e,t=this.hitDetectionInstructions;t.reverse();var i,r,n=t.length,a=-1;for(e=0;e<n;++e)(r=(i=t[e])[0])==ys.END_GEOMETRY?a=e:r==ys.BEGIN_GEOMETRY&&(i[2]=e,na(this.hitDetectionInstructions,a,e),a=-1)},t.prototype.setFillStrokeStyle=function(e,t){var i=this.state;if(e){var r=e.getColor();i.fillStyle=Uo(r||Ko)}else i.fillStyle=void 0;if(t){var n=t.getColor();i.strokeStyle=Uo(n||Qo);var a=t.getLineCap();i.lineCap=void 0!==a?a:"round";var o=t.getLineDash();i.lineDash=o?o.slice():Zo;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=[ys.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[ys.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,n=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||n!=e.currentLineDash&&!oa(e.currentLineDash,n)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=l)&&(void 0!==i&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=n,e.currentLineDashOffset=a,e.currentLineJoin=o,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=[ys.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;on(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(Jo),xs=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),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(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ys.DRAW_IMAGE,n,a,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([ys.DRAW_IMAGE,n,a,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(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ys.DRAW_IMAGE,n,a,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([ys.DRAW_IMAGE,n,a,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(),n=e.getHitDetectionImage(1),a=e.getImage(1),o=e.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=t,this.hitDetectionImage_=n,this.image_=a,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScale(),this.width_=r[0]},t}(ws),Cs=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}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 n=this.coordinates.length,a=this.appendFlatCoordinates(e,t,i,r,!1,!1),o=[ys.MOVE_TO_LINE_TO,n,a];return this.instructions.push(o),this.hitDetectionInstructions.push(o),i},t.prototype.drawLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fs);var a=e.getFlatCoordinates(),o=e.getStride();this.drawFlatCoordinates_(a,0,a.length,o),this.hitDetectionInstructions.push(ps),this.endGeometry(e,t)}},t.prototype.drawMultiLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fs);for(var a=e.getEnds(),o=e.getFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinates_(o,l,a[h],s);this.hitDetectionInstructions.push(ps),this.endGeometry(e,t)}},t.prototype.finish=function(){var e=this.state;void 0!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ps),this.reverseHitDetectionInstructions(),this.state=null},t.prototype.applyStroke=function(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(ps),t.lastStroke=this.coordinates.length),t.lastStroke=0,e.prototype.applyStroke.call(this,t),this.instructions.push(fs)},t}(ws),Ss=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}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 n=this.state,a=void 0!==n.fillStyle,o=void 0!=n.strokeStyle,s=i.length;this.instructions.push(fs),this.hitDetectionInstructions.push(fs);for(var l=0;l<s;++l){var h=i[l],c=this.coordinates.length,u=this.appendFlatCoordinates(e,t,h,r,!0,!o),d=[ys.MOVE_TO_LINE_TO,c,u];this.instructions.push(d),this.hitDetectionInstructions.push(d),o&&(this.instructions.push(ms),this.hitDetectionInstructions.push(ms)),t=h}return a&&(this.instructions.push(ds),this.hitDetectionInstructions.push(ds)),o&&(this.instructions.push(ps),this.hitDetectionInstructions.push(ps)),t},t.prototype.drawCircle=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getFlatCoordinates(),o=e.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(a,0,a.length,o,!1,!1);var l=[ys.CIRCLE,s];this.instructions.push(fs,l),this.hitDetectionInstructions.push(fs,l),this.hitDetectionInstructions.push(ds),void 0!==i.fillStyle&&this.instructions.push(ds),void 0!==i.strokeStyle&&(this.instructions.push(ps),this.hitDetectionInstructions.push(ps)),this.endGeometry(e,t)}},t.prototype.drawPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getEnds(),o=e.getOrientedFlatCoordinates(),s=e.getStride();this.drawFlatCoordinatess_(o,0,a,s),this.endGeometry(e,t)}},t.prototype.drawMultiPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var a=e.getEndss(),o=e.getOrientedFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinatess_(o,l,a[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]=no(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}(ws);function Ms(e,t,i,r,n){var a,o,s,l,h,c,u,d,p,f=i,m=i,y=0,g=0,v=i;for(a=i;a<r;a+=n){var b=t[a],_=t[a+1];void 0!==l&&(d=b-l,p=_-h,s=Math.sqrt(d*d+p*p),void 0!==c&&(g+=o,Math.acos((c*d+u*p)/(o*s))>e&&(g>y&&(y=g,f=v,m=a),g=0,v=a-n)),o=s,c=d,u=p),l=b,h=_}return(g+=s)>y?[v,a]:[f,m]}var ks="point",Ts="line";var Is={Circle:Ss,Default:ws,Image:xs,LineString:Cs,Polygon:Ss,Text:function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),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_={},ts.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_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var a,o,s=this.coordinates.length,l=e.getType(),h=null,c=2,u=2;if(n.placement===Ts){if(!Cn(this.getBufferedMaxExtent(),e.getExtent()))return;var d;if(h=e.getFlatCoordinates(),u=e.getStride(),l==nn.LINE_STRING)d=[h.length];else if(l==nn.MULTI_LINE_STRING)d=e.getEnds();else if(l==nn.POLYGON)d=e.getEnds().slice(0,1);else if(l==nn.MULTI_POLYGON){var p=e.getEndss();for(d=[],a=0,o=p.length;a<o;++a)d.push(p[a][0])}this.beginGeometry(e,t);for(var f,m=n.textAlign,y=0,g=0,v=d.length;g<v;++g){if(void 0==m){var b=Ms(n.maxAngle,h,y,d[g],u);y=b[0],f=b[1]}else f=d[g];for(a=y;a<f;a+=u)this.coordinates.push(h[a],h[a+1]);c=this.coordinates.length,y=d[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 nn.POINT:case nn.MULTI_POINT:c=(h=e.getFlatCoordinates()).length;break;case nn.LINE_STRING:h=e.getFlatMidpoint();break;case nn.CIRCLE:h=e.getCenter();break;case nn.MULTI_LINE_STRING:c=(h=e.getFlatMidpoints()).length;break;case nn.POLYGON:if(h=e.getFlatInteriorPoint(),!n.overflow&&h[2]/this.resolution<w)return;u=3;break;case nn.MULTI_POLYGON:var x=e.getFlatInteriorPoints();for(h=[],a=0,o=x.length;a<o;a+=3)(n.overflow||x[a+2]/this.resolution>=w)&&h.push(x[a],x[a+1]);if(0==(c=h.length))return}c=this.appendFlatCoordinates(h,0,c,u,!1,!1),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,e),this.hitDetectionInstructions.push(this.createFill(this.state,e))),n.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 n,a=r+t+e+i+this.pixelRatio;if(!ts.containsKey(a)){var o=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=vs[l.textAlign||"center"],d=r&&o.lineWidth?o.lineWidth:0,p=e.split("\n"),f=p.length,m=[],y=function(e,t,i){for(var r=t.length,n=0,a=0;a<r;++a){var o=ls(e,t[a]);n=Math.max(n,o),i.push(o)}return n}(l.font,p,m),g=ss(l.font),v=g*f,b=y+d,_=jo(Math.ceil(b*c),Math.ceil((v+d)*c));n=_.canvas,ts.set(a,n),1!=c&&_.scale(c,c),_.font=l.font,r&&(_.strokeStyle=o.strokeStyle,_.lineWidth=d,_.lineCap=o.lineCap,_.lineJoin=o.lineJoin,_.miterLimit=o.miterLimit,Yo&&o.lineDash.length&&(_.setLineDash(o.lineDash),_.lineDashOffset=o.lineDashOffset)),i&&(_.fillStyle=s.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,x=.5-u,C=u*n.width/c+x*d;if(r)for(w=0;w<f;++w)_.strokeText(p[w],C+x*m[w],.5*(d+g)+w*g);if(i)for(w=0;w<f;++w)_.fillText(p[w],C+x*m[w],.5*(d+g)+w*g)}return ts.get(a)},t.prototype.drawTextImage_=function(e,t,i){var r=this.textState_,n=this.textStrokeState_,a=this.pixelRatio,o=vs[r.textAlign||"center"],s=vs[r.textBaseline],l=n&&n.lineWidth?n.lineWidth:0,h=o*e.width/a+2*(.5-o)*l,c=s*e.height/a+2*(.5-s)*l;this.instructions.push([ys.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,e.width,r.padding==es?es:r.padding.map(function(e){return e*a}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([ys.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/a,e.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(e,t,i){var r=this.textStrokeState_,n=this.textState_,a=this.textFillState_,o=this.strokeKey_;r&&(o in this.strokeStates||(this.strokeStates[o]={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:n.font,textAlign:n.textAlign||"center",scale:n.scale});var l=this.fillKey_;a&&(l in this.fillStates||(this.fillStates[l]={fillStyle:a.fillStyle}));var h=this.pixelRatio,c=vs[n.textBaseline],u=this.textOffsetY_*h,d=this.text_,p=n.font,f=n.scale,m=r?r.lineWidth*f/2:0,y=this.widths_[p];y||(this.widths_[p]=y={}),this.instructions.push([ys.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ls(p,e)),t*f*h},u,o,m*h,d,s,1]),this.hitDetectionInstructions.push([ys.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ls(p,e)),t*f},u,o,m,d,s,1/h])},t.prototype.setTextStyle=function(e,t){var i,r,n;if(e){this.declutterGroup_=t;var a=e.getFill();a?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=Uo(a.getColor()||Ko)):r=this.textFillState_=null;var o=e.getStroke();if(o){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var s=o.getLineDash(),l=o.getLineDashOffset(),h=o.getWidth(),c=o.getMiterLimit();n.lineCap=o.getLineCap()||"round",n.lineDash=s?s.slice():Zo,n.lineDashOffset=void 0===l?0:l,n.lineJoin=o.getLineJoin()||"round",n.lineWidth=void 0===h?1:h,n.miterLimit=void 0===c?10:c,n.strokeStyle=Uo(o.getColor()||Qo)}else n=this.textStrokeState_=null;i=this.textState_;var u=e.getFont()||"10px sans-serif";as(u);var d=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()||es,i.scale=void 0===d?1:d;var p=e.getOffsetX(),f=e.getOffsetY(),m=e.getRotateWithView(),y=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===p?0:p,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==m&&m,this.textRotation_=void 0===y?0:y,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:qr(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+qr(r.fillStyle):""}else this.text_=""},t}(ws)},Os=function(e){function t(t,i,r,n,a,o,s){e.call(this),this.declutterTree_=o,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=a,this.pixelRatio_=n,this.resolution_=r,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=jo(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,n=e.length;r<n;++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,n,a,o){var s,l=2*(r=Math.round(r))+1,h=Ra(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_&&(fn(s=[1/0,1/0,-1/0,-1/0],e),on(s,t*(this.renderBuffer_+r),s));var u,d,p=function(e){if(void 0!==Es[e])return Es[e];for(var t=2*e+1,i=new Array(t),r=0;r<t;r++)i[r]=new Array(t);var n=e,a=0,o=0;for(;n>=a;)Ls(i,e+n,e+a),Ls(i,e+a,e+n),Ls(i,e-a,e+n),Ls(i,e-n,e+a),Ls(i,e-n,e-a),Ls(i,e-a,e-n),Ls(i,e+a,e-n),Ls(i,e+n,e-a),2*((o+=1+2*++a)-n)+1>0&&(o+=1-2*(n-=1));return Es[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(p[i][r]&&t[4*(r*l+i)+3]>0){var n=void 0;return(!u||d!=Do.IMAGE&&d!=Do.TEXT||-1!==u.indexOf(e))&&(n=a(e)),n||void c.clearRect(0,0,l,l)}}this.declutterTree_&&(u=this.declutterTree_.all().map(function(e){return e.value}));var m,y,g,v,b,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort(ra),m=_.length-1;m>=0;--m){var w=_[m].toString();for(g=this.replaysByZIndex_[w],y=gs.length-1;y>=0;--y)if(void 0!==(v=g[d=gs[y]]))if(!o||d!=Do.IMAGE&&d!=Do.TEXT){if(b=v.replayHitDetection(c,h,i,n,f,s))return b}else{var x=o[w];x?x.push(v,h.slice(0)):o[w]=[v,h.slice(0)]}}},t.prototype.getClipCoords=function(e){var t=this.maxExtent_,i=t[0],r=t[1],n=t[2],a=t[3],o=[i,r,i,a,n,a,n,r];return La(o,0,8,2,e,o),o},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 n=r[t];void 0===n&&(n=new(0,Is[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[t]=n);return n},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return Kr(this.replaysByZIndex_)},t.prototype.replay=function(e,t,i,r,n,a,o){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(ra),e.save(),this.clip(e,t);var l,h,c,u,d,p,f=a||gs;for(l=0,h=s.length;l<h;++l){var m=s[l].toString();for(d=this.replaysByZIndex_[m],c=0,u=f.length;c<u;++c){var y=f[c];if(p=d[y],void 0!==p)if(!o||y!=Do.IMAGE&&y!=Do.TEXT)p.replay(e,t,i,r,n);else{var g=o[m];g?g.push(p,t.slice(0)):o[m]=[p,t.slice(0)]}}}e.restore()},t}(zo),Es={0:[[!0]]};function Ls(e,t,i){var r,n=Math.floor(e.length/2);if(t>=n)for(r=n;r<t;r++)e[r][i]=!0;else if(t<n)for(r=t+1;r<n;r++)e[r][i]=!0}var Ps=Os,Rs={IDLE:0,LOADING:1,LOADED:2,ERROR:3},js={Point:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Rs.LOADED)return;var a=e.getReplay(i.getZIndex(),Do.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},LineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Do.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},Polygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Do.POLYGON);o.setFillStrokeStyle(n,a),o.drawPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},MultiPoint:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Rs.LOADED)return;var a=e.getReplay(i.getZIndex(),Do.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawMultiPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},MultiLineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Do.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawMultiLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},MultiPolygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(a||n){var o=e.getReplay(i.getZIndex(),Do.POLYGON);o.setFillStrokeStyle(n,a),o.drawMultiPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},GeometryCollection:function(e,t,i,r){var n,a,o=t.getGeometriesArray();for(n=0,a=o.length;n<a;++n){var s=js[o[n].getType()];s(e,o[n],i,r)}},Circle:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Do.CIRCLE);o.setFillStrokeStyle(n,a),o.drawCircle(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}}};function As(e,t,i,r,n,a){var o=!1,s=i.getImage();if(s){var l=s.getImageState();l==Rs.LOADED||l==Rs.ERROR?s.unlistenImageChange(n,a):(l==Rs.IDLE&&s.load(),l=s.getImageState(),s.listenImageChange(n,a),o=!0)}return function(e,t,i,r){var n=i.getGeometryFunction()(t);if(!n)return;var a=n.getSimplifiedGeometry(r);if(i.getRenderer())!function e(t,i,r,n){if(i.getType()==nn.GEOMETRY_COLLECTION){for(var a=i.getGeometries(),o=0,s=a.length;o<s;++o)e(t,a[o],r,n);return}var l=t.getReplay(r.getZIndex(),Do.DEFAULT);l.drawCustom(i,n,r.getRenderer())}(e,a,i,t);else{var o=js[a.getType()];o(e,a,i,t)}}(e,t,i,r),o}var zs=class{constructor(){this.queue=[]}push(e){this.queue.push(e)}remove(e){for(let t=0;t<this.queue.length;t++){const i=this.queue[t];if(i.x===e.x&&i.y===e.y&&i.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++){const 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}},Ds=i(4),Vs=i(7);function Ns(e,t){let i;return e.some(function(e){if(e.id==t)return i=e.source,!0}),i}const Gs=/font-family: ?([^;]*);/,Fs=/("|')/g;let Bs;const qs={},Us=i.n(Vs).a.getNames();function Ws(e){if(e in qs)return qs[e];const t=e.map(function(e){return mb2css(e,1).split(" 1px ")[1].replace(/"/g,"")})[0];if(!function(e){if(!Bs){Bs={};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(Gs);Bs[e[1].replace(Fs,"")]=!0}}}catch(e){}}}return e in Bs}(t)&&-1!==Us.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}var Hs=function(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale};Hs.prototype.clone=function(){return new Hs({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Hs.prototype.getOpacity=function(){return this.opacity_},Hs.prototype.getRotateWithView=function(){return this.rotateWithView_},Hs.prototype.getRotation=function(){return this.rotation_},Hs.prototype.getScale=function(){return this.scale_},Hs.prototype.getSnapToPixel=function(){return!1},Hs.prototype.getAnchor=function(){return Fr()},Hs.prototype.getImage=function(e){return Fr()},Hs.prototype.getHitDetectionImage=function(e){return Fr()},Hs.prototype.getImageState=function(){return Fr()},Hs.prototype.getImageSize=function(){return Fr()},Hs.prototype.getHitDetectionImageSize=function(){return Fr()},Hs.prototype.getOrigin=function(){return Fr()},Hs.prototype.getSize=function(){return Fr()},Hs.prototype.setOpacity=function(e){this.opacity_=e},Hs.prototype.setRotateWithView=function(e){this.rotateWithView_=e},Hs.prototype.setRotation=function(e){this.rotation_=e},Hs.prototype.setScale=function(e){this.scale_=e},Hs.prototype.setSnapToPixel=function(e){},Hs.prototype.listenImageChange=function(e,t){return Fr()},Hs.prototype.load=function(){Fr()},Hs.prototype.unlistenImageChange=function(e,t){Fr()};var Ys=Hs,Xs=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 Rs.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="",n="",a=0,o=null,s=0,l=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=Qo),i=Uo(i),void 0===(l=this.stroke_.getWidth())&&(l=1),o=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),Yo||(o=null,s=0),void 0===(n=this.stroke_.getLineJoin())&&(n="round"),void 0===(r=this.stroke_.getLineCap())&&(r="round"),void 0===(a=this.stroke_.getMiterLimit())&&(a=10));var h=2*(this.radius_+l)+1,c={strokeStyle:i,strokeWidth:l,size:h,lineCap:r,lineDash:o,lineDashOffset:s,lineJoin:n,miterLimit:a};if(void 0===e){var u=jo(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 d,p=!this.fill_;p&&(d=this.drawHitDetectionCanvas_.bind(this,c));var f=this.getChecksum(),m=e.add(f,h,h,this.draw_.bind(this,c),d);this.canvas_=m.image,this.origin_=[m.offsetX,m.offsetY],t=m.image.width,p?(this.hitDetectionCanvas_=m.hitImage,this.hitDetectionImageSize_=[m.hitImage.width,m.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 n,a,o;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),n=0;n<=s;n++)a=2*n*Math.PI/s-Math.PI/2+this.angle_,o=n%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(a),e.size/2+o*Math.sin(a))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=Ko),t.fillStyle=Uo(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=jo(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 n=this.points_;if(n===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var a,o,s,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(n*=2),a=0;a<=n;a++)s=2*a*Math.PI/n-Math.PI/2+this.angle_,o=a%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(s),e.size/2+o*Math.sin(s))}t.fillStyle=Go(Ko),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}(Ys)),Js=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.checksum_=void 0};Js.prototype.clone=function(){var e=this.getColor();return new Js({color:Array.isArray(e)?e.slice():e||void 0})},Js.prototype.getColor=function(){return this.color_},Js.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},Js.prototype.getChecksum=function(){if(void 0===this.checksum_){var e=this.color_;e?Array.isArray(e)||"string"==typeof e?this.checksum_="f"+Go(e):this.checksum_=qr(this.color_):this.checksum_="f-"}return this.checksum_};var $s=Js,Ks=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};Ks.prototype.clone=function(){var e=this.getColor();return new Ks({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()})},Ks.prototype.getColor=function(){return this.color_},Ks.prototype.getLineCap=function(){return this.lineCap_},Ks.prototype.getLineDash=function(){return this.lineDash_},Ks.prototype.getLineDashOffset=function(){return this.lineDashOffset_},Ks.prototype.getLineJoin=function(){return this.lineJoin_},Ks.prototype.getMiterLimit=function(){return this.miterLimit_},Ks.prototype.getWidth=function(){return this.width_},Ks.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},Ks.prototype.setLineCap=function(e){this.lineCap_=e,this.checksum_=void 0},Ks.prototype.setLineDash=function(e){this.lineDash_=e,this.checksum_=void 0},Ks.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e,this.checksum_=void 0},Ks.prototype.setLineJoin=function(e){this.lineJoin_=e,this.checksum_=void 0},Ks.prototype.setMiterLimit=function(e){this.miterLimit_=e,this.checksum_=void 0},Ks.prototype.setWidth=function(e){this.width_=e,this.checksum_=void 0},Ks.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=qr(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 Zs=Ks,Qs=function(e){var t=e||{};this.geometry_=null,this.geometryFunction_=el,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};Qs.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new Qs({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()})},Qs.prototype.getRenderer=function(){return this.renderer_},Qs.prototype.setRenderer=function(e){this.renderer_=e},Qs.prototype.getGeometry=function(){return this.geometry_},Qs.prototype.getGeometryFunction=function(){return this.geometryFunction_},Qs.prototype.getFill=function(){return this.fill_},Qs.prototype.setFill=function(e){this.fill_=e},Qs.prototype.getImage=function(){return this.image_},Qs.prototype.setImage=function(e){this.image_=e},Qs.prototype.getStroke=function(){return this.stroke_},Qs.prototype.setStroke=function(e){this.stroke_=e},Qs.prototype.getText=function(){return this.text_},Qs.prototype.setText=function(e){this.text_=e},Qs.prototype.getZIndex=function(){return this.zIndex_},Qs.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_=el,this.geometry_=e},Qs.prototype.setZIndex=function(e){this.zIndex_=e};function el(e){return e.getGeometry()}var tl=Qs,il={FRACTION:"fraction",PIXELS:"pixels"},rl=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function nl(e,t,i){return t+":"+e+":"+(i?Go(i):"null")}rl.prototype.clear=function(){this.cache_={},this.cacheSize_=0},rl.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_)}}},rl.prototype.get=function(e,t,i){var r=nl(e,t,i);return r in this.cache_?this.cache_[r]:null},rl.prototype.set=function(e,t,i,r){var n=nl(e,t,i);this.cache_[n]=r,++this.cacheSize_},rl.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()};var al=new rl,ol=function(e){function t(t,i,r,n,a,o){e.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==n&&(this.image_.crossOrigin=n),this.canvas_=o?document.createElement("canvas"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=a,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_===Rs.LOADED){this.tainted_=!1;var e=jo(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(xa)},t.prototype.handleImageError_=function(){this.imageState_=Rs.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=Rs.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=jo(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_==Rs.IDLE){this.imageState_=Rs.LOADING,this.imageListenerKeys_=[pa(this.image_,Sa,this.handleImageError_,this),pa(this.image_,Ma,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,n=this.color_[1]/255,a=this.color_[2]/255,o=0,s=i.length;o<s;o+=4)i[o]*=r,i[o+1]*=n,i[o+2]*=a;e.putImageData(t,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(ma),this.imageListenerKeys_=null},t}(wa);var sl={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},ll=function(e){function t(t){var i=t||{},r=void 0!==i.opacity?i.opacity:1,n=void 0!==i.rotation?i.rotation:0,a=void 0!==i.scale?i.scale:1,o=void 0!==i.rotateWithView&&i.rotateWithView;e.call(this,{opacity:r,rotation:n,scale:a,rotateWithView:o}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:sl.TOP_LEFT,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:il.FRACTION,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:il.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;Hr(!(void 0!==h&&s),4),Hr(!s||s&&l,5),void 0!==h&&0!==h.length||!s||(h=s.src||qr(s)),Hr(void 0!==h&&h.length>0,6);var c=void 0!==i.src?Rs.IDLE:Rs.LOADED;this.color_=void 0!==i.color?function(e){return Array.isArray(e)?e:Fo(e)}(i.color):null,this.iconImage_=function(e,t,i,r,n,a){var o=al.get(t,r,a);return o||(o=new ol(e,t,i,r,n,a),al.set(t,r,a,o)),o}(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:sl.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_==il.FRACTION||this.anchorYUnits_==il.FRACTION){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==il.FRACTION&&(e[0]*=t[0]),this.anchorYUnits_==il.FRACTION&&(e[1]*=t[1])}if(this.anchorOrigin_!=sl.TOP_LEFT){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),this.anchorOrigin_!=sl.TOP_RIGHT&&this.anchorOrigin_!=sl.BOTTOM_RIGHT||(e[0]=-e[0]+t[0]),this.anchorOrigin_!=sl.BOTTOM_LEFT&&this.anchorOrigin_!=sl.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_!=sl.TOP_LEFT){var t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),this.offsetOrigin_!=sl.TOP_RIGHT&&this.offsetOrigin_!=sl.BOTTOM_RIGHT||(e[0]=i[0]-t[0]-e[0]),this.offsetOrigin_!=sl.BOTTOM_LEFT&&this.offsetOrigin_!=sl.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 da(this.iconImage_,xa,e,t)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(e,t){fa(this.iconImage_,xa,e,t)},t}(Ys),hl=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 $s({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:ks,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};hl.prototype.clone=function(){return new hl({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})},hl.prototype.getOverflow=function(){return this.overflow_},hl.prototype.getFont=function(){return this.font_},hl.prototype.getMaxAngle=function(){return this.maxAngle_},hl.prototype.getPlacement=function(){return this.placement_},hl.prototype.getOffsetX=function(){return this.offsetX_},hl.prototype.getOffsetY=function(){return this.offsetY_},hl.prototype.getFill=function(){return this.fill_},hl.prototype.getRotateWithView=function(){return this.rotateWithView_},hl.prototype.getRotation=function(){return this.rotation_},hl.prototype.getScale=function(){return this.scale_},hl.prototype.getStroke=function(){return this.stroke_},hl.prototype.getText=function(){return this.text_},hl.prototype.getTextAlign=function(){return this.textAlign_},hl.prototype.getTextBaseline=function(){return this.textBaseline_},hl.prototype.getBackgroundFill=function(){return this.backgroundFill_},hl.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},hl.prototype.getPadding=function(){return this.padding_},hl.prototype.setOverflow=function(e){this.overflow_=e},hl.prototype.setFont=function(e){this.font_=e},hl.prototype.setMaxAngle=function(e){this.maxAngle_=e},hl.prototype.setOffsetX=function(e){this.offsetX_=e},hl.prototype.setOffsetY=function(e){this.offsetY_=e},hl.prototype.setPlacement=function(e){this.placement_=e},hl.prototype.setFill=function(e){this.fill_=e},hl.prototype.setRotation=function(e){this.rotation_=e},hl.prototype.setScale=function(e){this.scale_=e},hl.prototype.setStroke=function(e){this.stroke_=e},hl.prototype.setText=function(e){this.text_=e},hl.prototype.setTextAlign=function(e){this.textAlign_=e},hl.prototype.setTextBaseline=function(e){this.textBaseline_=e},hl.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},hl.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},hl.prototype.setPadding=function(e){this.padding_=e};var cl=hl,ul=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dl(e,t){const i={};for(const t in e)"ref"!==t&&(i[t]=e[t]);return ul.forEach(e=>{e in t&&(i[e]=t[e])}),i}var pl=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]=dl(e[i],t[e[i].ref]));return e};var fl={$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."}}},ml=i(3),yl={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},gl=" ",vl=/(italic|oblique)$/i,bl={};function _l(e,t){var i=bl[e];if(!i){Array.isArray(e)||(e=[e]);for(var r="normal",n="normal",a=[],o=0,s=e.length;o<s;++o){var l=e[o].split(" "),h=l[l.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(n=h,l.pop(),h=l[l.length-1].toLowerCase()):vl.test(h)&&(h=h.replace(vl,""),n=l[l.length-1].replace(h,"")),yl)if(h==c||h==c.replace("-","")||h==c.replace("-",gl)){r=yl[c],l.pop();break}"number"==typeof h&&(r=h);var u=l.join(gl).replace("Klokantech Noto Sans","Noto Sans");-1!==u.indexOf(gl)&&(u='"'+u+'"'),a.push(u)}i=bl[e]=[n,r,a]}return i[0]+gl+i[1]+gl+t+"px"+gl+i[2]}function wl(e){return e*Math.PI/180}const xl=ml.d.isFunction,Cl=ml.d.convertFunction,Sl=ml.b.isExpression,Ml=ml.b.createPropertyExpression,kl={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Tl=function(e,t){const i=Ml(e,t);if("error"===i.result)throw new Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return i.value},Il={},Ol={zoom:0},El={};function Ll(e,t,i,r,n){const a=e.id;El[a]||(El[a]={});const o=El[a];if(!o[i]){let r=(e[t]||Il)[i];const n=fl[`${t}_${e.type}`][i];void 0===r&&(r=n.default);let a=Sl(r);if(!a&&xl(r)&&(r=Cl(r,n),a=!0),a){const e=Tl(r,n);o[i]=e.evaluate.bind(e)}else"color"==n.type&&(r=ml.a.parse(r)),o[i]=function(){return r}}return Ol.zoom=r,o[i](Ol,n)}const Pl={};function Rl(e,t,i,r){return e in Pl||(Pl[e]=Object(ml.c)(t).filter),Ol.zoom=r,Pl[e](Ol,i)}const jl={};function Al(e,t){if(e&&void 0!==t){let i=jl[e];i||(jl[e]=i={color:e.toArray(),opacity:e.a}),(e=i.color)[3]=i.opacity*t,0===e[3]&&(e=void 0)}return e}const zl=/^([^]*)\{(.*)\}([^]*)$/;function Dl(e,t){let i;do{if(i=e.match(zl)){const r=t[i[2]]||"";e=i[1]+r+i[3]}}while(i);return e}var Vl=function(e,t,i,r,n,a){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 o,s;if(n){const e=new Image;e.crossOrigin="anonymous",e.onload=function(){o=e,s=[e.width,e.height],e.onload=null},e.src=n}const l=document.createElement("CANVAS").getContext("2d"),h={};function c(e,t,i){const r=i+","+t+","+e;let n=h[r];if(!n){l.font=t;const a=l.measureText("M").width*i,o=e.split(" ");let s="";const c=[];for(let e=0,t=o.length;e<t;++e){const t=o[e];l.measureText(s+t).width<=a?s+=(s?" ":"")+t:(s&&c.push(s),s=t)}s&&c.push(s),h[r]=n=c.join("\n")}return n}const u=pl(e.layers),d={},p=[];let f;for(let i=0,r=u.length;i<r;++i){const r=u[i],n=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 a=d[t];a||(a=d[t]=[]),a.push({layer:r,index:i}),p.push(n)}delete El[n],delete Pl[n]}const m=new Zs,y=new $s,g={},v={},b=[];return function(e,t){const n=e.getProperties(),a=d[n.layer];if(!a)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=kl[e.getGeometry().getType()],u={properties:n,type:h};let p=-1;for(let i=0,d=a.length;i<d;++i){const d=a[i],f=d.layer,_=f.id,w=f.layout||Il,x=f.paint||Il;if(!("none"===w.visibility||"minzoom"in f&&l<f.minzoom||"maxzoom"in f&&l>=f.maxzoom)){const i=f.filter;if(!i||Rl(_,i,u,l)){let i,a,C,S,M,k;const T=d.index;if(3==h&&"fill"==f.type)if(a=Ll(f,"paint","fill-opacity",l,u),"fill-pattern"in x){const e=Ll(f,"paint","fill-pattern",l,u);if(e){const t=Dl(e,n);if(o&&r&&r[t]){(k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new tl({fill:new $s})),C=k.getFill(),k.setZIndex(T);const e=t+"."+a;let i=v[e];if(!i){const n=r[t],s=document.createElement("canvas");s.width=n.width,s.height=n.height;const l=s.getContext("2d");l.globalAlpha=a,l.drawImage(o,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i=l.createPattern(s,"repeat"),v[e]=i}C.setColor(i)}}}else(i=Al(Ll(f,"paint","fill-color",l,u),a))&&((k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new tl({fill:new $s})),(C=k.getFill()).setColor(i),k.setZIndex(T)),"fill-outline-color"in x&&(M=Al(Ll(f,"paint","fill-outline-color",l,u),a)),M&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new tl({stroke:new Zs})),(S=k.getStroke()).setLineCap(fl.layout_line["line-cap"]),S.setLineJoin(fl.layout_line["line-join"]),S.setMiterLimit(fl.layout_line["line-miter-limit"]),S.setColor(M),S.setWidth(1),S.setLineDash(null),k.setZIndex(T));if(1!=h&&"line"==f.type){i=!("line-pattern"in x)&&"line-color"in x?Al(Ll(f,"paint","line-color",l,u),Ll(f,"paint","line-opacity",l,u)):void 0;const e=Ll(f,"paint","line-width",l,u);i&&e>0&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new tl({stroke:new Zs})),(S=k.getStroke()).setLineCap(Ll(f,"layout","line-cap",l,u)),S.setLineJoin(Ll(f,"layout","line-join",l,u)),S.setMiterLimit(Ll(f,"layout","line-miter-limit",l,u)),S.setColor(i),S.setWidth(e),S.setLineDash(x["line-dasharray"]?Ll(f,"paint","line-dasharray",l,u).map(function(t){return t*e}):null),k.setZIndex(T))}let I,O,E,L,P=!1,R=null,j=0;if((1==h||2==h)&&"icon-image"in w){const a=Ll(f,"layout","icon-image",l,u);if(a){I=Dl(a,n);let c=void 0;if(o&&r&&r[I]){const n=Ll(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 ho(e),"line"===Ll(f,"layout","symbol-placement",l,u)&&"map"===n){const t=i.getStride(),r=i.getFlatCoordinates();for(let i=0,n=r.length-t;i<n;i+=t){const n=r[i],a=r[i+1],o=r[i+t],s=r[i+t+1],l=Math.min(n,o),h=Math.min(a,s),c=Math.max(n,o),u=Math.max(a,s);if(e[0]>=l&&e[0]<=c&&e[1]>=h&&e[1]<=u){j=Math.atan2(a-s,o-n);break}}}}}}if(2!==h||c){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl),k.setGeometry(c);const e=Ll(f,"layout","icon-size",l,u),t=void 0!==x["icon-color"]?Ll(f,"paint","icon-color",l,u):null;let a=I+"."+e;if(null!==t&&(a+="."+t),!(O=g[a])){const l=r[I];if(null!==t){i=Al(t,1);const r=document.createElement("canvas");r.width=l.width,r.height=l.height;const n=r.getContext("2d");n.drawImage(o,l.x,l.y,l.width,l.height,0,0,l.width,l.height);const s=n.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];n.putImageData(s,0,0),O=g[a]=new ll({img:r,imgSize:[r.width,r.height],scale:e/l.pixelRatio})}else O=g[a]=new ll({img:o,imgSize:s,size:[l.width,l.height],offset:[l.x,l.y],rotateWithView:"map"===n,scale:e/l.pixelRatio})}O.setRotation(j+wl(Ll(f,"layout","icon-rotate",l,u))),O.setOpacity(Ll(f,"paint","icon-opacity",l,u)),k.setImage(O),R=k.getText(),k.setText(void 0),k.setZIndex(99999-T),P=!0,E=!1}else E=!0}}}if(1==h&&"circle-radius"in x){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl);const e=Ll(f,"paint","circle-radius",l,u),t=Ll(f,"paint","circle-stroke-color",l,u),i=Ll(f,"paint","circle-color",l,u),r=Ll(f,"paint","circle-opacity",l,u),n=Ll(f,"paint","circle-stroke-opacity",l,u),a=Ll(f,"paint","circle-stroke-width",l,u);(O=g[e+"."+t+"."+i+"."+r+"."+a])||(O=new Xs({radius:e,stroke:0===a?void 0:new Zs({width:a,color:Al(t,n)}),fill:new $s({color:Al(i,r)})})),k.setImage(O),R=k.getText(),k.setText(void 0),k.setGeometry(void 0),k.setZIndex(99999-T),P=!0}if("text-field"in w&&(L=Dl(Ll(f,"layout","text-field",l,u).toString(),n)),L&&!E){P||((k=b[++p])&&k.getText()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl),k.setImage(void 0),k.setGeometry(void 0),k.layerId=_),k.getText()||k.setText(R||new cl),R=k.getText();const e=Ll(f,"layout","text-size",l,u),t=_l(Ll(f,"layout","text-font",l,u),e),i=w["text-transform"];"uppercase"==i?L=L.toUpperCase():"lowercase"==i&&(L=L.toLowerCase());const r=2==h?L:c(L,t,Ll(f,"layout","text-max-width",l,u));R.setText(r),R.setFont(t),R.setRotation(wl(Ll(f,"layout","text-rotate",l,u)));const n=Ll(f,"layout","text-anchor",l,u),o=P||1==h?"point":Ll(f,"layout","symbol-placement",l,u);if(R.setPlacement(o),"point"==o){let e="center";-1!==n.indexOf("left")?e="left":-1!==n.indexOf("right")&&(e="right"),R.setTextAlign(e)}else R.setTextAlign();let s="middle";0==n.indexOf("bottom")?s="bottom":0==n.indexOf("top")&&(s="top"),R.setTextBaseline(s);const d=Ll(f,"layout","text-offset",l,u);R.setOffsetX(d[0]*e),R.setOffsetY(d[1]*e),a=Ll(f,"paint","text-opacity",l,u),y.setColor(Al(Ll(f,"paint","text-color",l,u),a)),R.setFill(y);const g=Al(Ll(f,"paint","text-halo-color",l,u),a);g?(m.setColor(g),m.setWidth(Ll(f,"paint","text-halo-width",l,u)),R.setStroke(m)):R.setStroke(void 0),k.setZIndex(99999-T)}}}}return p>-1?(b.length=p+1,b):[]}};class Nl{constructor(e){this.options=Object(n.defaultValue)(e,{}),this.style=Object(n.defaultValue)(e.style,void 0),this.show=Object(n.defaultValue)(e.show,!0),this.defaultAlpha=Object(n.defaultValue)(e.defaultAlpha,1),this.tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.WebMercatorTilingScheme),this.tileWidth=Object(n.defaultValue)(e.tileWidth,512),this.tileHeight=Object(n.defaultValue)(e.tileHeight,512),this.tokenKey=Object(n.defaultValue)(e.tokenKey,"token"),this.tokenValue=Object(n.defaultValue)(e.tokenValue,void 0),this.readyPromise=Object(n.defaultValue)(e.readyPromise,new Promise((e,t)=>{e()})),this.scene=Object(n.defaultValue)(e.scene,void 0),this.rectangle=Object(n.defaultValue)(e.rectangle,this.tilingScheme.rectangle),this.mvtParser=new Ro,this.pixelRatio=Object(n.defaultValue)(e.pixelRatio,1),this.maximumLevel=Object(n.defaultValue)(e.maximumLevel,20),this.minimumLevel=Object(n.defaultValue)(e.minimumLevel,0),this.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),this.transform=Object(n.defaultValue)(e.transform,[.125,0,0,.125,0,0]),this.sublayerLabelingInfos=Object(n.defaultValue)(e.sublayerLabelingInfos,{}),this.labelsRenderMode=Object(n.defaultValue)(e.labelsRenderMode,"on-screen"),this._resolutions=[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],this._replays=["Default","Image","Polygon","LineString","Text"],this._tileQueue=new Cesium.TileReplacementQueue,this._tileSends=new zs,this._cacheSize=300,this._labelsNoteStyle=new n.LabelClass({renderMode:Nl.getRenderMode(this.sublayerLabelingInfos)}),this._dynamicLabelLayer=new pr({scene:this.scene,labelingInfo:[this._labelsNoteStyle]}),this._url=void 0,this._olVectorStyle=void 0,this._setOpenLayerVectorStyle(),this._initEvents()}}Object.defineProperties(Nl.prototype,{ready:{get:()=>!0},hasAlphaChannel:{get:()=>!0}}),Nl.fromUrl=async function(e,t){const i=new n.IGSVectorTileLayer({url:e}),r=await i.load(),a=Bl.initializeOptions(r);return new Nl({...a,...t})},Nl.getRenderMode=function(e){let t="canvas";if(e){const i=Object.keys(e);for(let r=0;r<i.length;r++){const n=e[i[r]];if(Array.isArray(n)&&n.length>0){t=n[0].renderMode||"canvas";break}}}return t},Nl.prototype.requestImage=function(e,t,i){if(!this._tileSends.has({x:e,y:t,z:i,id:this.options.threadId}))return this._tileSends.push({x:e,y:t,z:i,id:this.options.threadId}),this.drawTile(e,t,i);{const r=this._findTileInQueue(e,t,i,this._tileQueue);if(r)return this._tileQueue.markTileRendered(r),r.isaddedLabels||this._addDynamicLabel(r,this._dynamicLabelLayer),new Promise((e,t)=>{e(r)});this._tileSends.remove(e,t,i)}},Nl.prototype.drawTile=function(e,t,i){const r=this;let n=this._url;n=n.replace("{x}",e).replace("{y}",t).replace("{z}",i);let a={xMvt:e,yMvt:t,zMvt:i};if(this._maximumLevel&&i>this._maximumLevel)return this._tileQueue.markTileRendered(a),null;let o=i;Cesium.Resource.createIfNeeded(n);return new Promise((s,l)=>{fetch(n).then(e=>e.arrayBuffer()).then(function(n){try{(a=document.createElement("canvas")).width=512,a.height=512,a.xMvt=e,a.yMvt=t,a.zMvt=o;const h=a.getContext("2d"),c=r.mvtParser.readFeatures(n),u=r._olVectorStyle,d=[0,0,4096,4096];let p=new Ps(0,d,8,!0,512);const f=r.tilingScheme.tileXYToRectangle(e,t,i);if(!f)return null;const m=Cesium.Rectangle.northwest(f),y=Cesium.Rectangle.southeast(f);a.isaddedLabels=!0;for(let n=0;n<c.length;n++){const o=c[n],s=u(o,r._resolutions[i]);let l=[],h=[];"on-screen"===r.labelsRenderMode?(l=s.filter(e=>!e.text_),h=s.filter(e=>e.text_)):l=s,h.length>0&&requestAnimationFrame(()=>{const n=r._renderLabels(a,o,h,e,t,i,d,m,y),s=r._dynamicLabelLayer.addLabels(n);a.cacheLabels||(a.cacheLabels=[]),s.forEach(e=>{a.cacheLabels.push(e)}),a.isaddedLabels&&r._dynamicLabelLayer.addLabels(s)});for(let e=0;e<l.length;e++)As(p,o,l[e],16)}p.finish(),p.replay(h,r.transform,0,{},r._replays),r._tileQueue.count>r._cacheSize&&r._trimTiles(r._tileQueue,r._dynamicLabelLayer,r._cacheSize/2),p=null,s(a)}catch(e){console.log("err: ",e),l()}r._tileQueue.markTileRendered(a)})})},Nl.prototype._initEvents=function(){this.scene&&"on-screen"===this.labelsRenderMode&&(this._changeTileHandler=(()=>{let e=this._tileQueue.tail,t=this._tileQueue.count;for(;e&&t>60;)t--,e.cacheLabels&&this._removeDynamicLabel(e,this._dynamicLabelLayer),e=e.replacementPrevious}),this.scene.postRender.addEventListener(this._changeTileHandler))},Nl.prototype._removeEvents=function(){this.scene&&this._changeTileHandler&&this.scene.postRender.removeEventListener(this._changeTileHandler)},Nl.prototype._renderLabels=function(e,t,i,r,a,o,s,l,h){if(!i||!e||Array.isArray(i)&&0===i.length)return[];if(!t||!t.properties_)return[];const c=t.properties_;let u=[];return i.forEach(e=>{const i=e.getText(),r=this.sublayerLabelingInfos[e.layerId]||[];let a=Object(Ds.a)(this._labelsNoteStyle,i,r.length>0?r[0]:null,c);if(t.flatCoordinates_&&Array.isArray(t.flatCoordinates_)&&2===t.flatCoordinates_.length&&a.symbol.text){const e=t.flatCoordinates_,i=s[2],r=s[3],o=(Cesium.Math.toDegrees(h.longitude)-Cesium.Math.toDegrees(l.longitude))*e[0]/i+Cesium.Math.toDegrees(l.longitude),c=(Cesium.Math.toDegrees(h.latitude)-Cesium.Math.toDegrees(l.latitude))*e[1]/r+Cesium.Math.toDegrees(l.latitude);if(e[0]>i||e[1]>r)return;const d=new n.Point({coordinates:[o,c]}),p=new n.Feature({geometry:d});(this._dynamicLabelLayer.createLabels([p],a)||[]).forEach(e=>{u.push(e)})}}),u},Nl.prototype._findTileInQueue=function(e,t,i,r){let n=r.head;for(;n&&(n.xMvt!==e||n.yMvt!==t||n.zMvt!==i);)n=n.replacementNext;return n},Nl.prototype._trimTiles=function(e,t,i){let r=e.tail;const n=this;for(;e.count>i&&Cesium.defined(r);){const i=r.replacementPrevious;n._removeTile(e,r),n._removeDynamicLabel(r,t),r=null,r=i}},Nl.prototype._removeTile=function(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},Nl.prototype._removeDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(t.removeLabels(e.cacheLabels),e.isaddedLabels=!1)},Nl.prototype._addDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(e.cacheLabels=t.addLabels(e.cacheLabels),e.isaddedLabels=!0)},Nl.prototype._setOpenLayerVectorStyle=function(){if(this.style){const e=function(e){const t=e.layers;let i,r,n,a,o,s=[];for(let l=0,h=t.length;l<h;++l)"background"==(i=t[l]).type||((a=i.source||Ns(t,i.ref))!=n&&(s.length&&(s=[]),o=(r=e.sources[a]).url,"vector"==r.type||"raster"==r.type||r.type,n=a),s.push(i.id));return s}(this.style),t=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}(this.style),i=function(e){let t=e.sprite;return t.indexOf("png")>0?t:t+=".png"}(this.style),r={vectortilejson:this.style,layers:e,spritedata:this.style.spritedata,spritepng:i,fonts:Ws,sources:t};this._url=t[0].tiles[0],this.tokenKey&&this.tokenValue&&(this._url+=`&${this.tokenKey}=${this.tokenValue}`),this._olVectorStyle=Vl(r.vectortilejson,Object.keys(r.vectortilejson.sources),null,r.spritedata,r.spritepng,r.fonts)}},Nl.prototype.destroy=function(){this._removeEvents(),this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null)};var Gl=Nl;class Fl{}Fl.addVectorTileLayer=function(e){const{layer:t,innerView:i}=e,r=$l(t.spatialReference,t.extent,t.tileInfo),[a,o]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),s=Zl(t,r.rectangle);s.spatialReference=new n.SpatialReference("EPSG:4326");const l=new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),h=Fl._getSublayerLabelingInfos(t);return new Promise(n=>{const s=new Gl({style:t.style,opacity:t.opacity,show:e._getLayerViewVisible(t.visible),tilingScheme:r,maximumLevel:o,minimumLevel:a,scene:i.scene,labelsRenderMode:t.labelsRenderMode,sublayerLabelingInfos:h,rectangle:l,transform:[512/t.mvtExtent,0,0,512/t.mvtExtent,0,0],tokenKey:t.tokenKey,tokenValue:t.tokenValue});e.innerLayer=i.imageryLayers.addImageryProvider(s),e.innerLayer.id=t.id,t.clippingArea&&rh(t,e.innerLayer,i),n(e)})},Fl.initializeOptions=function(e,t){const{extent:i,tileInfo:r,spatialReference:a}=e,o=$l(a,i,r),s=Zl({spatialReference:a,extent:i},o.rectangle),[l,h]=n.TileInfoUtil.getLevelRangeByTileInfo(r);return{style:e.style,opacity:e.opacity,show:e.visible,tilingScheme:o,minimumLevel:l,maximumLevel:h,scene:t&&t.scene?t.scene:void 0,labelsRenderMode:e.labelsRenderMode,sublayerLabelingInfos:Fl._getSublayerLabelingInfos(e),rectangle:new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),transform:[512/e.mvtExtent,0,0,512/e.mvtExtent,0,0],tokenKey:e.tokenKey,tokenValue:e.tokenValue}},Fl.refresh=function(e){this.removeLayer(e),this.addVectorTileLayer(e)},Fl.setOpacity=function(e,t){e.innerLayer.alpha=t},Fl.setVisible=function(e,t){e.innerLayer.show=e._getLayerViewVisible(t)},Fl.setClipArea=function(e){const{layer:t,innerView:i,innerLayer:r}=e;t.clippingArea?rh(t,r,i):i._clipPreRenderFunction&&(r.swipeEnabled=!1,i.scene.preRender.removeEventListener(i._clipPreRenderFunction))},Fl.removeLayer=function(e){const{innerLayer:t,innerView:i}=e;t.imageryProvider.destroy(),i.imageryLayers.remove(t,!0)},Fl._getSublayerLabelingInfos=function(e){const t={};return e.style.layers.forEach(i=>{if(i&&i.id){const r=e.getExtendProperties(i.id,"labelingInfo");r&&r instanceof Array&&r.length>0&&(t[i.id]=r)}}),t};var Bl=Fl;class ql{}ql.addM3DLayer=function(e,t,i){const{layer:r,innerView:n,view:a}=e;let o=ql.initializeOptions(e);o.show=e._getLayerViewVisible(r.visible);const{extensionOptions:s={}}=r;th(o=Object.assign(o,s),n,a,function(e){o.autoReset&&ih(e.boundingSphere,o,n),e.translucency=o.translucency,t(e)},i)},ql.initializeOptions=function(e){const{layer:t,innerView:i}=e,r=eh(t);return r.url=t.url,t.url.includes("/igs/rest/services/")?r.igserver=!0:r.igserver=!1,r.headers&&(r.url=new Cesium.Resource({url:r.url,headers:r.headers})),i&&(r._scene=i.scene),r},ql.removeLayer=function(e,t,i){t.scene.primitives.removeAndDestroy(e)};var Ul=ql;class Wl{}Wl.addTerrainCacheLayer=function(e,t,i){const r=Wl.initializeOptions(e);t.terrainProvider=new Cesium.CesiumTerrainProvider(r),i(t.terrainProvider)},Wl.initializeOptions=function(e){let t={url:e.url};const{extensionOptions:i={}}=e;return t=Object.assign(t,i)},Wl.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)},Wl.removeLayer=function(e,t){t.terrainProvider=new Cesium.EllipsoidTerrainProvider};var Hl=Wl;var Yl=class{constructor(e){const t=Object.assign({},e);t.extensions=[];const i=Object(n.defaultValue)(e.extensions,[]),r=Object(n.defaultValue)(e.url,"");let a;a=r instanceof Cesium.Resource?r:new Cesium.Resource({url:r}),i&&i instanceof Array&&i.forEach(e=>{e&&e.value&&(a.queryParameters[e.key]=e.value)}),t.url=a;const o=new Cesium.UrlTemplateImageryProvider(t);return o.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),o}};class Xl{}Xl.addWebTileLayer=function(e,t){let i=e._buildRequestUrl?e._buildRequestUrl():e.url;i=i.replace("{col}","{x}");let r={x:1,y:-1};"tms"===e.tileSliceType?(i=i.replace("{row}","{y}"),r={x:1,y:1}):i=i.replace("{row}","{y}"),i=i.replace("{level}","{z}");const a=$l(e.spatialReference,e.extent,e.tileInfo,r),o=Zl(e,a.rectangle),s=new Cesium.Rectangle(o.xmin,o.ymin,o.xmax,o.ymax),{extensionOptions:l={}}=e,[h,c]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let u={url:i,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:a,minimumLevel:h,maximumLevel:c,rectangle:s,subdomains:e.subDomains,extensions:[{key:e.tokenKey,value:e.tokenValue}]};u=Object.assign(u,l);const d=Kl(e,t),p=new Yl(u),f=t.imageryLayers.addImageryProvider(p,d);return e.clippingArea&&rh(e,f,t),f.id=e.id,f._realIndex=e._realIndex+1,f},Xl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Jl=Xl;function $l(e,t,i,r){let a=e.wkid,o=e.wkt,s=void 0;if(e.isWebMercator&&a!=n.CustomWKID.bd09mc&&a!=n.CustomWKID.gcj02mc&&(a=3857),!Object(n.defined)(a)&&!Object(n.defined)(o))return new Cesium.WebMercatorTilingScheme;if(n.Projection.isCustomWKID(a)){return new gr({wkid:a,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})}if(Object(n.defined)(a)){const e=n.EPSG.find(e=>e.id===a);if(!Object(n.defined)(e))return n.Log.error("根据该空间参考系的wkid未匹配到wkt值"),new Cesium.WebMercatorTilingScheme;o=e.strProject}return 4326==a||4490==a||4610==a||4212==a?Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.GeographicTilingScheme:(Object(n.defined)(t)||(t={xmin:-180,ymin:-90,xmax:180,ymax:90}),s=new gr({wkt:o,wkid:a,proj4:Ci,tileInfo:i,numberOfLevelZeroTilesX:Object(n.defined)(i)?2:1,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})):Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.WebMercatorTilingScheme:(Object(n.defined)(t)||(t={xmin:-20037508.342787,ymin:-20037508.342787,xmax:20037508.342787,ymax:20037508.342787}),s=new gr({wkt:o,wkid:a,proj4:Ci,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})),s}function Kl(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 Zl(e,t){const i={...e.extent},r=e.spatialReference.wkid,a=e.spatialReference.wkt;let o=void 0;e.spatialReference.isGeographic?o=new Cesium.Rectangle(-180,-90,180,90):e.spatialReference.isWebMercator&&(o=new Cesium.Rectangle(-20037508.342787,-20037508.342787,20037508.342787,20037508.342787)),o&&(i.xmin=Cesium.Math.clamp(i.xmin,o.west,o.east),i.ymin=Cesium.Math.clamp(i.ymin,o.south,o.north),i.xmax=Cesium.Math.clamp(i.xmax,o.west,o.east),i.ymax=Cesium.Math.clamp(i.ymax,o.south,o.north));const s=n.Projection.projectPoints({originWKID:r,originDefs:a,targetWKID:4326,points:[[i.xmin,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin],[i.xmax,i.ymax]]}),[l,h,c,u]=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]),c[0]=Cesium.Math.toRadians(c[0]),c[1]=Cesium.Math.toRadians(c[1]),u[0]=Cesium.Math.toRadians(u[0]),u[1]=Cesium.Math.toRadians(u[1]),i.xmin=Math.min(l[0],c[0]),i.ymin=Math.min(h[1],c[1]),i.xmax=Math.max(h[0],u[0]),i.ymax=Math.max(l[1],u[1]);const d={xmin:t.west,xmax:t.east,ymin:t.south,ymax:t.north};return i.xmin=Cesium.Math.clamp(i.xmin,d.xmin,d.xmax),i.xmax=Cesium.Math.clamp(i.xmax,d.xmin,d.xmax),i.ymin=Cesium.Math.clamp(i.ymin,d.ymin,d.ymax),i.ymax=Cesium.Math.clamp(i.ymax,d.ymin,d.ymax),i}function Ql(e){if(!e)return;const t={type:e.type,field:e.field};switch(e.type){case n.RendererType.classBreak:t.classBreakInfos=[];for(let i=0;i<e.classBreakInfos.length;i++){const r=e.classBreakInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.classBreakInfos.push({minValue:r.minValue,maxValue:r.maxValue,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;case n.RendererType.uniqueValue:t.uniqueValueInfos=[];for(let i=0;i<e.uniqueValueInfos.length;i++){const r=e.uniqueValueInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.uniqueValueInfos.push({value:r.value,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;default:return}return t}function eh(e){let t={};return t.url=Object(n.defaultValue)(e.url,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.sceneIndex=t.layer&&void 0!==t.layer.sceneIndex?t.layer.sceneIndex:0,t.igserver=!0,t.renderer=Ql(e.renderer),t.translucency=e.opacity,t=Object.assign(t,e.extensionOptions)}function th(e,t,i,r,a){e=Object(n.defaultValue)(e,{}),t.scene.primitives.add(new Cesium.MapGISM3DSet(e)).readyPromise.then(function(t){t.id=e.id,t.type="m3d",r&&"function"==typeof r&&r(t)}).otherwise(function(e){a&&"function"==typeof a&&a(e)})}function ih(e,t,i){t=Object(n.defaultValue)(t,{});const r=Object(n.defaultValue)(t.duration,0),a=Object(n.defaultValue)(t.orientation,new Cesium.HeadingPitchRange(0,-.5,2.5*e.radius));i.scene.camera.flyToBoundingSphere(e,{duration:r,offset:a}),i.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}function rh(e,t,i){let r=e.clippingArea;if(r.type!==n.GeometryType.polygon&r.type!==n.GeometryType.extent&r.type!==n.GeometryType.circle)return;r.spatialReference.isGeographic||(r=n.Projection.project(r,new n.SpatialReference({wkid:4326})));let a={};switch(r.type){case n.GeometryType.polygon:a.outerRing=r.coordinates[0],a.holes=r.coordinates.splice(1,r.coordinates.length-1);break;case n.GeometryType.circle:a.outerRing=r.toPolygon().coordinates[0],a.holes=void 0;break;case n.GeometryType.extent:const{xmin:e,xmax:t,ymin:i,ymax:o}=r;a.outerRing=[[e,i],[t,i],[t,o],[e,o],[e,i]],a.holes=void 0;break;default:a=void 0}if(!a)return;t.swipeEnabled=!0;const o=[],s=a.outerRing;for(let e=0;e<s.length;e++)o.push(Cesium.Cartesian3.fromDegrees(s[e][0],s[e][1],0));let l=void 0;if(a.holes&&a.holes.length>0){l=[];for(let e=0;e<a.holes.length;e++){const t=[];for(let i=0;i<a.holes[e].length;i++)t.push(Cesium.Cartesian3.fromDegrees(a.holes[e][i][0],a.holes[e][i][1],0));l.push(new Cesium.PolygonHierarchy(t))}}const h=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o,l)}),c=Cesium.PolygonGeometry.createGeometry(h),u=Cesium.GeometryPipeline.createAttributeLocations(c),d=Cesium.VertexArray.fromGeometry({context:i.scene.context,geometry:c,attributeLocations:u}),p=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}}),m=new Cesium.DrawCommand({primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:d,shaderProgram:p,castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:f}),y=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:y,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),m.execute(i.scene.context,b)},i.scene.preRender.removeEventListener(i._clipPreRenderFunction),i.scene.preRender.addEventListener(i._clipPreRenderFunction)}function nh(e,t){switch(e.type){case n.LayerType.arcgisMapImage:return Er.initializeOptions(e);case n.LayerType.igsMapImage:return lh.initializeOptions(e);case n.LayerType.wms:return Pr.initializeOptions(e);case n.LayerType.arcgisTile:return jr.initializeOptions(e);case n.LayerType.igsTile:return Vr.initializeOptions(e);case n.LayerType.wmts:return Gr.initializeOptions(e);case n.LayerType.arcgisVectorTile:case n.LayerType.igsVectorTile:return Bl.initializeOptions(e,t);case n.LayerType.m3dCache:return Ul.initializeOptions({layer:e,innerView:t});case n.LayerType.terrain:return Hl.initializeOptions(e);default:n.Log.error(`暂不支持为${e.type}类型的图层构造实例化参数`)}}class ah{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),!Cesium.defined(e.url))throw new Cesium.DeveloperError("必须传入地图服务的URL");this._imageInfoUrl=e.url,this._resource=Cesium.Resource.createIfNeeded(e.url),this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this._gdbpsUrl=Cesium.defaultValue(e.gdbps,[]),this._filters=Cesium.defaultValue(e.filters,""),this._layers=e.layers,this._extensions=e.extensions,this._dynamicLayers=e.dynamicLayers,this._isAntialiasing=Cesium.defaultValue(e.isAntialiasing,void 0),this._build2DImageResource=e.build2DImageResource,this._proxy=e.proxy,this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS")),this._clientId=Cesium.defaultValue(e.clientId,Math.random().toString(36).substring(2)),this._httpMethod=Cesium.defaultValue(e.httpMethod,"GET"),this._headers=Cesium.defaultValue(e.headers,void 0)}static async fromUrl(e,t){const i=new n.IGSMapImageLayer({url:e}),r=await i.load(),a=lh.initializeOptions(r);return new ah({...a,...t})}buildImageResource(e,t,i,r){if(this._build2DImageResource&&this._build2DImageResource instanceof Function)return this._build2DImageResource(this,e,t,i,r);let n=this._resource.url;if(r.httpMethod=this._httpMethod,Cesium.defined(this._headers)?this._headers.hasOwnProperty("Content-Type")||(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers["Content-Type"]="text/plain":this._headers["Content-Type"]="application/x-www-form-urlencoded"):n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers={"Content-Type":"text/plain"}:this._headers={"Content-Type":"application/x-www-form-urlencoded"},this._resource.headers=this._headers,"GET"===this._httpMethod){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`?f=png&w=${this._tileWidth}&h=${this._tileHeight}&filters=${this._filters}&bbox=`:n.includes("/coverings")?n+=`?f=image&size=${this._tileWidth},${this._tileHeight}&bbox=`:n+=`/image?f=image&size=${this._tileWidth},${this._tileHeight}&layerFilters=${this._filters}&bbox=`;const r=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if((n+=`${r.west},${r.south},${r.east},${r.north}`).includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`&guid=${this._clientId}`:n+=`&clientId=${this._clientId}`,Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+="&gdbps=":n+="&urls=";for(let e=0;e<this._gdbpsUrl.length;e++)n+=this._gdbpsUrl[e],e<this._gdbpsUrl.length-1&&(n+=",")}if(Cesium.defined(this._layers)&&(n+=`&layers=${this._layers}`),Cesium.defined(this._dynamicLayers)&&(n+=`&dynamicLayers=${this._dynamicLayers}`),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];n+=`&${t.key}=${encodeURIComponent(t.value)}`}null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(n+=`&isAntialiasing=${this._isAntialiasing}`)}else if("POST"===this._httpMethod){let a={};n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?(a.f="png",a.w=this._tileWidth,a.h=this._tileHeight,a.filters=this._filters):(a.f="image",a.size=`${this._tileWidth},${this._tileHeight}`,a.layerFilters=this._filters);const o=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(a.bbox=`${o.west},${o.south},${o.east},${o.north}`,n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"),a.clientId=this._clientId,null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(a.isAntialiasing=this._isAntialiasing),Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){let e="";for(let t=0;t<this._gdbpsUrl.length;t++)e+=this._gdbpsUrl[t],t<this._gdbpsUrl.length-1&&(e+=",");n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?a.gdbps=e:a.urls=e}if(Cesium.defined(this._layers)&&(a.layers=this._layers),Cesium.defined(this._dynamicLayers)&&(a.dynamicLayers=this._dynamicLayers),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];a[t.key]=t.value}if(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"))a=JSON.stringify(a);else{n+="/image";let e="";Object.keys(a).forEach(t=>{a[t]&&(e+=`${t}=${encodeURIComponent(a[t])}&`)}),e=e.substring(0,e.length-1),a=e}r.data=a}return this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);t=3*Math.pow(2,i)-1-t,r=(r=(r=(r=r.replace("{s}",(e+t)%4)).replace("{row}",t)).replace("{col}",e)).replace("{level}",i);return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(function(e){const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(ah.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},gdbps:{get:function(){return this._gdbpsUrl},set:function(e){e instanceof Array&&(this._gdbpsUrl=e)}},layers:{get:function(){return this._layers},set:function(e){this._layers=e}}});var oh=ah;class sh{}sh.addIGSMapImageLayer=function(e,t){const i=sh.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new oh(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},sh.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax);let o=e._url;"1.0"===e._igsVersion&&(o=o.replace("/mrcs/","/mrms/"));let s=[];e.tokenKey&&s.push({key:e.tokenKey,value:e.tokenValue});let l={url:o,httpMethod:e.httpMethod,tileWidth:e.imageWidth,tileHeight:e.imageHeight,layers:e.layers,tilingScheme:i,clientId:e.clientId,projectionSrs:Object(n.getProjectionSrs)(e.spatialReference),rectangle:a,filters:e.getFilters?JSON.stringify(e.getFilters()):void 0,headers:e.headers,extensions:s,isAntialiasing:e.isAntialiasing};const{extensionOptions:h={}}=e;if(l=Object.assign(l,h),e.allSublayers){const t=Object(n.getIGSDynamicLayer)(e);t.length>0&&(l.dynamicLayers=JSON.stringify(t))}return l},sh.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var lh=sh;class hh{}hh.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 a=Cesium.Cartographic.fromCartesian(r),o=Cesium.Math.toDegrees(a.longitude),s=Cesium.Math.toDegrees(a.latitude),l={mapPoint:new n.Point({coordinates:[o,s,a.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},hh.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},hh.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},hh.getDragEvent=function(e,t,i,r,n){return e.originalEvent?{x:e.originalEvent.layerX,y:e.originalEvent.layerY,button:void 0!==n?n: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"}:{origin:i,action:r,type:"drag"}},hh.getResizeEvent=function(e,t,i,r){return e};var ch=hh;class uh{}uh.addCesium3DTilesLayer=function(e,t,i){const{layer:r,innerView:n}=e,{extensionOptions:a={},opacity:o,visible:s}=r,l={};r.tokenKey&&r.tokenValue&&(l[r.tokenKey]=r.tokenValue);let h={show:e._getLayerViewVisible(s),url:new Cesium.Resource({url:r._paramUrl,headers:r.headers,queryParameters:l})};h=Object.assign(h,a),n.scene.primitives.add(new Cesium.Cesium3DTileset(h)).readyPromise.then(function(e){e.id=r.id,e.style=new Cesium.Cesium3DTileStyle({color:`rgba(255, 255, 255, ${o})`}),a.autoReset&&ih(e.boundingSphere,h,n),t(e)}).otherwise(i)},uh.removeLayer=function(e,t){t.scene.primitives.removeAndDestroy(e)};var dh=uh;const ph=window.mapv||{},fh=ph.baiduMapLayer?ph.baiduMapLayer.__proto__:Function;class mh extends fh{constructor(e,t,i,r){if(super(e,t,i),!fh)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,n=i.getContext();if(i.isEnabledTime()){if(void 0===e)return void this.clear(n);"2d"===this.context&&(n.save(),n.globalCompositeOperation="destination-out",n.fillStyle="rgba(0, 0, 0, .1)",n.fillRect(0,0,n.canvas.width,n.canvas.height),n.restore())}else this.clear(n);if("2d"===this.context)for(const e in i.options)n[e]=i.options[e];else n.clear(n.COLOR_BUFFER_BIT);const a={transferCoordinate(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]);var r=i.map.camera.position;let n=i.map.scene.globe.ellipsoid.cartesianToCartographic(r).height;if(n+=1.2*i.map.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(r,t)>n)return;r=Cesium.Cartesian3.fromDegrees(e[0],e[1]);const a=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.map.scene,r);return a?[a.x,a.y]:[0,0]}};void 0!==e&&(a.filter=function(t){const i=r.trails||10;return!!(e&&t.time>e-i&&t.time<e)});const o=i.dataSet.get(a);this.processData(o),"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(n,new ph.DataSet(o),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 yh=0;class gh{constructor(e,t,i,r){this.map=e,this.scene=e.scene,this.mapvBaseLayer=new mh(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 n=i.cesium;if(n&&(this.postRender=n.postRender||!1,this.postRenderFrame=n.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${yh++}`,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${yh++}`,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(){if(void 0==this.mapvBaseLayer)return;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()}}class vh{}vh.addMapVLayer=function(e,t){const{extensionOptions:i={}}=e,r=Object.assign(e.mapVOptions,i),n=new gh(t,e.data,r);return n.id=e.id,n},vh.removeLayer=function(e){e.remove()};var bh=vh;var _h=class{constructor(e){e=Cesium.defaultValue(e,{}),this.commonLayerId=Cesium.defaultValue(e.layerId,null),this._feature=e.feature,this._feature||n.Log.error("feature不能为空!"),this._feature=n.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._feature&&(this.show=this._feature.visible),this._markRemovePrimitives(),this._createPrimitive(()=>{this._removeMarkPrimitives(!0)})}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=[],this._billboards=[],this._labels=[],this._primitives=[],this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0}checkSymbol(){return!0}setVisible(e){if(this._points&&this._points.length>0)for(let t=0;t<this._points.length;t++)this._points[t].show=e;if(this._labels&&this._labels.length>0)for(let t=0;t<this._labels.length;t++)this._labels[t].show=e;if(this._billboards&&this._billboards.length>0)for(let t=0;t<this._billboards.length;t++)this._billboards[t].show=e;if(this._primitives&&this._primitives.length>0)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,t=[];switch(e.type){case n.GeometryType.point:t.push(Cesium.Cartographic.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]||0));break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let i=0;i<e.coordinates.length;i++)t.push(Cesium.Cartographic.fromDegrees(e.coordinates[i][0],e.coordinates[i][1],e.coordinates[i][2]||0));break;case n.GeometryType.multiLineString:case n.GeometryType.polygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++)t[i].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][0],e.coordinates[i][r][1],e.coordinates[i][r][2]||0))}break;case n.GeometryType.multiPolygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++){t[i].push([]);for(let n=0;n<e.coordinates[i][r].length;n++)t[i][r].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][n][0],e.coordinates[i][r][n][1],e.coordinates[i][r][n][2]))}}break;case n.GeometryType.extent:t.push([]),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0));break;case n.GeometryType.circle:const i=e.toPolygon();for(let e=0;e<i.coordinates.length;e++){t.push([]);for(let r=0;r<i.coordinates[e].length;r++)t[e].push(Cesium.Cartographic.fromDegrees(i.coordinates[e][r][0],i.coordinates[e][r][1],i.coordinates[e][r][2]))}}return 0===t.length&&n.Log.error("顶点数组为空,无法正常创建图形!"),t}_addZCoordinate(){const e=this._feature.geometry;if(!e.hasZ)switch(e.type){case n.GeometryType.point:e.coordinates.push(0);break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let t=0;t<e.coordinates.length;t++)e.coordinates[t].push(0);break;case n.GeometryType.multiLineString:case n.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 n.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 n.GeometryType.extent:e.zmin=0,e.zmax=0;break;case n.GeometryType.circle:e.center.push(0)}}_removePrimitives(){for(let e=0;this._points&&e<this._points.length;e++)this._pointsCollection.remove(this._points[e]);this._points=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboardsCollection.remove(this._billboards[e]);this._billboards=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labelsCollection.remove(this._labels[e]);this._labels=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitivesCollection.remove(this._primitives[e]);this._primitives=[]}_removeMarkPrimitives(){const e=[];for(let t=0;this._points&&t<this._points.length;t++)this._points[t]._isRemove?this._pointsCollection.remove(this._points[t]):e.push(this._points[t]);this._points=e;const t=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboards[e]._isRemove?this._billboardsCollection.remove(this._billboards[e]):t.push(this._billboards[e]);this._billboards=t;const i=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labels[e]._isRemove?this._labelsCollection.remove(this._labels[e]):i.push(this._labels[e]);this._labels=i;const r=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitives[e]._isRemove?this._primitivesCollection.remove(this._primitives[e]):r.push(this._primitives[e]);this._primitives=r}_markRemovePrimitives(){this._points.forEach(e=>{e._isRemove=!0}),this._billboards.forEach(e=>{e._isRemove=!0}),this._labels.forEach(e=>{e._isRemove=!0}),this._primitives.forEach(e=>{e._isRemove=!0})}_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 wh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleMarkerSymbol||(n.Log.info("要素的符号类型不是SimpleMarkerSymbol!"),!1)}_createPrimitive(e){if(this._feature.symbol.style)switch(this._feature.symbol.style){case"circle":this._addPointPrimitive(e);break;default:this._addBillBoardPrimitive(e)}}_getPositions(){return Th(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}_addBillBoardPrimitive(e){const t=this._feature.symbol;this._canvas?this._symbolEquals(t,this._symbol)||(this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t),this._symbol=t):this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t);const{type:i}=this._feature.geometry,r=this._getPositions();switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,r[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<r.length;t++)Ah(this,r[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Ii.a.createBillboardOptions(e,t)}_addPointPrimitive(e){const t=this._getPositions(),{type:i}=this._feature.geometry;switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Rh(this,t[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let i=0;i<t.length;i++)Rh(this,t[i],e);break;default:n.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);r.alpha*=this._layerOpacity;const n=t.extensionOptions;let a={position:e,color:i,outlineColor:r,outlineWidth:t.outline.width,pixelSize:t.size};return a=Object.assign(a,n)}};var xh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureMarkerSymbol||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_getPositions(){return Th(this._feature,this._viewer)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Ah(this,i[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Ii.a.createBillboardOptions(e,t)}};function Ch(e,t){let i=0;return i=isNaN(e)?t:isNaN(t)?e:e>=t?e:t}function Sh(e,t,i,r){const a=[];for(let e=0;e<t.length;e++)a.push(Cesium.Cartographic.clone(t[0]));Cesium.sampleTerrain(e.terrainProvider,12,a).then(function(e){if(i.mode===n.ElevationMode.RelativeToGround)for(let t=0;t<e.length;t++)e[t].height+=i.offset;r(e)})}function Mh(e,t,i,r,a){const{mode:o,offset:s}=r,l=[];for(let e=0;e<t.length;e++)l.push(Cesium.Cartographic.clone(t[0]));Sh(e,t,r,function(t){e.scene.sampleHeightMostDetailed(l,i,1).then(e=>{const i=[];for(let r=0;r<e.length;r++){const n=e[r]?e[r]:t[r];n.height=Ch(e[r].height,t[r].height),i.push(n)}if(o===n.ElevationMode.RelativeToScene)for(let e=0;e<i.length;e++)i[e].height+=s;a(i)})})}function kh(e){let t=[];const i=e.scene.primitives._primitives;for(let e=0;e<i.length;e++)Cesium.MapGISM3DSet&&i[e]instanceof Cesium.MapGISM3DSet||i[e]instanceof Cesium.Cesium3DTileset||i[e]instanceof Cesium.Model||i[e]instanceof Cesium.ViewportQuad||(i[e]instanceof Cesium.PrimitiveCollection?t=t.concat(i[e]._primitives):i[e]instanceof Cesium.PointPrimitiveCollection?t=t.concat(i[e]._pointPrimitives):t.push(i[e]));return t}function Th(e){const t=e.geometry,i=[];switch(t.type){case n.GeometryType.point:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0));break;case n.GeometryType.multiPoint:for(let e=0;e<t.coordinates.length;e++)i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[e][0]),Cesium.Math.toRadians(t.coordinates[e][1]),t.coordinates[e][2]||0));break;case n.GeometryType.polygon:const e=n.Geometry.fromJSON(t).centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(e.coordinates[0]),Cesium.Math.toRadians(e.coordinates[1]),e.coordinates[2]||0));break;case n.GeometryType.multiPolygon:const r=n.Geometry.fromJSON(t).toPolygonArray();for(let e=0;e<r.length;e++){const t=r[e].centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0))}break;case n.GeometryType.extent:i.push(new Cesium.Cartographic(Cesium.Math.toRadians((t.xmin+t.xmax)/2),Cesium.Math.toRadians((t.ymin+t.ymax)/2),(t.zmin+t.zmax)/2||0));break;case n.GeometryType.circle:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.center[0]),Cesium.Math.toRadians(t.center[1]),t.center[2]||0))}return i}function Ih(e){let t=void 0;switch(e){case n.ElevationMode.OnTheGround:t=Cesium.ClassificationType.TERRAIN;break;case n.ElevationMode.OnTheScene:t=Cesium.ClassificationType.BOTH}return t}function Oh(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 Eh(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}function Lh(e,t){const i=e._viewer,r=e._feature;let a,o=Cesium.HeightReference.NONE;return r.elevationInfo.mode===n.ElevationMode.OnTheGround&&(o=Cesium.HeightReference.CLAMP_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.RelativeToGround&&(t[2]=e._feature.elevationInfo.offset,o=Cesium.HeightReference.RELATIVE_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.OnTheScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a),r.elevationInfo.mode===n.ElevationMode.RelativeToScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a+r.elevationInfo.offset),r.elevationInfo.mode===n.ElevationMode.AbsoluteHeight&&(t[2]+=e._feature.elevationInfo.offset),{heightReference:o,position:Ii.a.toCartesian3Position(t,"degrees")}}function Ph(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:Sh(r,t,a.elevationInfo,function(e){i(e)});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Mh(r,t,kh(r),a.elevationInfo,function(e){i(e)})}}function Rh(e,t,i){const r=e._feature,{mode:a}=r.elevationInfo;switch(a){case n.ElevationMode.AbsoluteHeight:default:const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height)));e._savePoint(r),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Ph(e,[t],function(t){const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t[0].longitude,t[0].latitude,t[0].height)));e._savePoint(r),i&&i instanceof Function&&i()})}}function jh(e,t,i){const r=e._feature.symbol;let n=e._createBillboardOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),i);n=Object.assign(n,r.extensionOptions);const a=e._billboardsCollection.add(n);e._saveBillboard(a)}function Ah(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.AbsoluteHeight:default:jh(e,t),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:r.scene.globe.depthTestAgainstTerrain?(jh(e,t,{heightReference:o===n.ElevationMode.OnTheGround?Cesium.HeightReference.CLAMP_TO_GROUND:Cesium.HeightReference.RELATIVE_TO_GROUND}),i&&i instanceof Function&&i()):Ph(e,[t],function(t){jh(e,t[0]),i&&i instanceof Function&&i()});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Ph(e,[t],function(t){jh(e,t[0]),i&&i instanceof Function&&i()})}}function zh(e){let t=!1;return e.elevationInfo.mode!==n.ElevationMode.OnTheGround&&e.elevationInfo.mode!==n.ElevationMode.OnTheScene&&e.elevationInfo.mode!==n.ElevationMode.RelativeToGround&&e.elevationInfo.mode!==n.ElevationMode.RelativeToScene||(t=!0),t}function Dh(e,t,i,r){let a,o;switch(t){case n.SymbolType.pictureMarker:return a=e.resource,o=new n.PictureMarkerSymbol({width:e.size,height:e.size,url:a.href}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.simpleMarker:default:return a=e.resource,o=new n.SimpleMarkerSymbol({style:a.primitive,size:e.size,color:e.material.color,outline:new n.SimpleLineSymbol({color:e.outline.color,width:e.outline.size})}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.mapgisText:const s=n.Font.fromJSON(e.font);return s.size=e.size,o=new n.MapGISTextSymbol({text:e.text,verticalAlignment:e.verticalAlignment,horizontalAlignment:e.horizontalAlignment,font:s,haloColor:e.halo.color,haloSize:e.halo.size,backgroundColor:e.background,lineHeight:e.lineHeight,color:e.material.color}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()})}}var Vh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleLineSymbol||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(e){const t=this._feature.geometry;switch(t.type){case n.GeometryType.lineString:this._addPrimitiveByElevationMode(this._getPositions(),new n.LineString({coordinates:t.coordinates}),e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let r=0;r<i.length;r++)this._addPrimitiveByElevationMode(i[r],new n.LineString({coordinates:t.coordinates[r]}),e)}}_addPrimitiveByElevationMode(e,t,i){const{mode:r}=this._elevationInfo;switch(r){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheScene:case n.ElevationMode.OnTheGround:default:this._addLinePrimitive(e),i&&i instanceof Function&&i();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const a=n.GeometryEngine.getCenterOID(t),o=[Cesium.Cartographic.fromDegrees(a.coordinates[0],a.coordinates[1],0)];if(r===n.ElevationMode.RelativeToGround)Sh(this._viewer,o,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()});else{const t=kh(this._viewer);Mh(this._viewer,o,t,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()})}}}_addLinePrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);r.alpha*=this._layerOpacity;const a=i.width;let o;const s=[],{mode:l}=this._elevationInfo;switch(l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++)s.push(Cesium.Cartesian3.fromRadians(e[t].longitude,e[t].latitude,e[t].height));break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:let i=0;for(let t=0;t<e.length;t++)e[t].height<i&&(i=e[t].height);for(let r=0;r<e.length;r++)s.push(Cesium.Cartesian3.fromRadians(e[r].longitude,e[r].latitude,e[r].height-i+t))}let h=Cesium.ArcType.NONE;switch(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(h=this._feature.geometry.extensionOptions.arcType),l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:s,width:a,arcType:h}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:h===Cesium.ArcType.NONE&&(h=Cesium.ArcType.GEODESIC);const e=Ih(l),t=new Cesium.GroundPolylineGeometry({positions:s,width:a,arcType:h});o=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:e})}const c=this._primitivesCollection.add(o);this._savePrimitive(c)}_createAppearance(){const e=this._feature.symbol;let t=void 0;switch(this._feature.geometry.type){case n.GeometryType.lineString:case n.GeometryType.multiLineString:switch(e.type){case n.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:n.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}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};function Nh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.anchorPosition,s=function(e){const t={horizontalOrigin:void 0,verticalOrigin:void 0};switch(e){case n.AnchorType.center:default:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.left:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.right:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.top:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottom:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.topLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.topRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottomLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.bottomRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM}return t}(e.anchor);return{show:i.show,position:r.position,image:i.image,color:Eh(a.color,i.layerOpacity),width:e.size,height:e.size,horizontalOrigin:s.horizontalOrigin,verticalOrigin:s.verticalOrigin,pixelOffset:new Cesium.Cartesian2(o.coordinates[0],-1*o.coordinates[1]),heightReference:r.heightReference}}function Gh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.font;let s,l;switch(e.horizontalAlignment){case n.HorizontalAlignment.center:default:s=Cesium.HorizontalOrigin.CENTER;break;case n.HorizontalAlignment.right:s=Cesium.HorizontalOrigin.RIGHT;break;case n.HorizontalAlignment.left:s=Cesium.HorizontalOrigin.LEFT}switch(e.verticalAlignment){case n.VerticalAlignment.baseline:default:l=Cesium.VerticalOrigin.BASELINE;break;case n.VerticalAlignment.top:l=Cesium.VerticalOrigin.TOP;break;case n.VerticalAlignment.bottom:l=Cesium.VerticalOrigin.BOTTOM;break;case n.VerticalAlignment.middle:l=Cesium.VerticalOrigin.CENTER}return{show:i.show,position:r.position,text:e.text,fillColor:Eh(a.color,i.layerOpacity),font:`${e.size} ${o.family}`,backgroundColor:Eh(e.background,i.layerOpacity),horizontalOrigin:s,verticalOrigin:l,heightReference:r.heightReference}}function Fh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(r.position[0],r.position[1],r.position[2])),s={show:i.show,url:e.resource.href,shadows:e.castShadows,scale:1,color:Eh(a.color,i.layerOpacity),modelMatrix:o,asynchronous:!1,heightReference:r.heightReference};return Cesium.Model.fromGltf(s)}function Bh(e,t){t=Object(n.defaultValue)(t,{layerOpacity:1});const i=e.material;switch(i.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Eh(i.color,t.layerOpacity)})})}}function qh(e,t,i){i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,a=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:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Eh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:o,appearance:Bh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function Uh(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128,layerOpacity:1,show:!0});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Eh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:a,appearance:Bh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function Wh(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}function Hh(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 Yh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleFillSymbol||(n.Log.info("要素的符号类型不是SimpleFillSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:default:this._addPrimitiveByElevationMode(i,e);break;case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)this._addPrimitiveByElevationMode(i[t],e)}}_addPrimitiveByElevationMode(e,t){const{mode:i}=this._elevationInfo;switch(i){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:this._addPolygonPrimitive(e),this._addPolygonOutlinePrimitive(e),t&&t instanceof Function&&t();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const r=n.GeometryEngine.getCenterOID(this._feature.geometry),a=[Cesium.Cartographic.fromDegrees(r.coordinates[0],r.coordinates[1],0)];if(i===n.ElevationMode.RelativeToGround)Sh(this._viewer,a,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()});else{const i=kh(this._viewer);Mh(this._viewer,a,i,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()})}}}_addPolygonPrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);let a;const o=[],{mode:s}=this._elevationInfo;switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++){o.push([]);for(let i=0;i<e[t].length;i++)o[t].push(Cesium.Cartesian3.fromRadians(e[t][i].longitude,e[t][i].latitude,e[t][i].height))}break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:for(let i=0;i<e.length;i++){o.push([]);for(let r=0;r<e[i].length;r++)o[i].push(Cesium.Cartesian3.fromRadians(e[i][r].longitude,e[i][r].latitude,t))}}const l=[];for(let e=1;e<o.length;e++)l.push(new Cesium.PolygonHierarchy(o[e]));let h=void 0;const c=this._feature.geometry;let u;c.type===n.GeometryType.extent&&(h=c.zmax);let d=!0;this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(u=this._feature.geometry.extensionOptions.arcType,d=!1);const p=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o[0],l),extrudedHeight:h,perPositionHeight:d,arcType:u}),f=new Cesium.MaterialAppearance({material:this._createPolygonMaterial(),translucent:!1,renderState:{depthTest:{enabled:!0}}});switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:const e=Ih(s);a=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1,classificationType:e})}const m=this._primitivesCollection.add(a);this._savePrimitive(m)}_addPolygonOutlinePrimitive(e,t){const i=this._feature.symbol.outline,{geometry:r}=this._feature,{type:a}=r;let o,s=[];switch(a){case n.GeometryType.polygon:default:for(let t=0;t<e.length;t++){s.push([]);for(let i=0;i<e[t].length;i++)s[t].push([Cesium.Math.toDegrees(e[t][i].longitude),Cesium.Math.toDegrees(e[t][i].latitude),e[t][i].height]);s[t].push([s[t][0][0]+(s[t][1][0]-s[t][0][0])/1e4,s[t][0][1]+(s[t][1][1]-s[t][0][1])/1e4,s[t][0][2]+(s[t][1][2]-s[t][0][2])/1e4])}break;case n.GeometryType.circle:s.push([]),s=r.toPolygon().coordinates;break;case n.GeometryType.extent:s.push([]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([s[0][0][0]+(s[0][1][0]-s[0][0][0])/1e4,s[0][0][1]+(s[0][1][1]-s[0][0][1])/1e4,s[0][0][2]+(s[0][1][2]-s[0][0][2])/1e4])}if(this._elevationInfo.mode===n.ElevationMode.RelativeToGround||this._elevationInfo.mode===n.ElevationMode.RelativeToScene){o=new n.ElevationInfo({mode:n.ElevationMode.AbsoluteHeight});for(let e=0;e<s.length;e++){let i=0;for(let t=0;t<s[e].length;t++)i<s[e][t][2]&&(i=s[e][t][2]);for(let r=0;r<s[e].length;r++)s[e][r][2]=s[e][r][2]-i+t}}else o=this._elevationInfo;const l=new n.MultiLineString({coordinates:s,extensionOptions:r.extensionOptions}),h=new n.Feature({geometry:l,symbol:i,elevationInfo:o,visible:this.show}),c=new Vh({feature:h,layerOpacity:this._layerOpacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});this._primitives=this._primitives.concat(c._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(n.createSimpleFillSymbolCanvas)(e),this._symbol=e)):this._canvas=Object(n.createSimpleFillSymbolCanvas)(e,{lineWidth:1}),t=Cesium.Material.fromType("Image",{image:this._canvas,repeat:new Cesium.Cartesian2(1,1),color:new Cesium.Color(1,1,1,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}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};var Xh=class extends Yh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureFillSymbol||(n.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}}}})}};var Jh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.MapGISTextSymbol||this._feature.symbol instanceof n.TextSymbol||(n.Log.info("要素的符号类型不是MapGISTextSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Ah(this,i[t],e)}}_getPositions(){return Th(this._feature,this._viewer)}_createBillboardOptions(e,t){(t=Object(n.defaultValue)(t,{})).heightReference=Object(n.defaultValue)(t.heightReference,Cesium.HeightReference.NONE);const i=this._feature.symbol;let r=(Cesium.DynamicLabelsUtil||Li.a).createNoteBillBoardOptions(this._feature.id,i.text,e,Ii.a.convertTextSymbolToLabelNoteStyle(i,{layerOpacity:this._layerOpacity}));return r.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,r.heightReference=t.heightReference,r=Object.assign(r,this._feature.symbol.extensionOptions)}};var $h=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.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,n=e._renderer.defaultSymbol,a=e._renderer.defaultLabelSymbol;if(r instanceof Array&&r.length>0){let o=!1;for(let n=0;n<r.length;n++)if(t.length>=r[n].minValue&&t.length<r[n].maxValue){e._setClusterEntity(i,r[n].symbol,r[n].labelSymbol),o=!0;break}o||e._setClusterEntity(i,n,a)}else e._setClusterEntity(i,n,a)})})}_setClusterEntity(e,t,i){switch(t.type){case n.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 n.SymbolType.pictureMarker:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{pictureMarkerSymbol:t})}}_setClusterLabel(e,t,i){i=Object(n.defaultValue)(i,{});const r=Object(n.defaultValue)(i.pictureMarkerSymbol,void 0);t&&t instanceof n.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)),r&&r instanceof n.PictureMarkerSymbol&&(e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset+-1*r.height))}_setClusterBillBoard(e,t){t&&(t instanceof n.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 n.SimpleMarkerSymbol&&(e.billboard.show=!0,e.billboard.image=Object(n.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=Hh(t);e.point.show=!0,e.point.color=i.color,e.point.color=e.point.color.withAlpha(.75),e.point.pixelSize=i.pixelSize,e.point.outlineColor=i.outlineColor,e.point.outlineWidth=i.outlineWidth}add(e){let t,i,r;switch((e=Object(n.defaultValue)(e,{})).geometry.type){case n.GeometryType.multiPolygon:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.Polygon({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiLineString:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.LineString({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiPoint:i=e.geometry.coordinates;for(let t=0;t<i.length;t++)r=new n.Point({coordinates:i[t],spatialReference:e.geometry.spatialReference}),this._addEntity(e,r);break;default:t=n.GeometryEngine.getCenterOID(e.geometry),this._addEntity(e,t)}}_addEntity(e,t){const i={position:Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],1e3)},r=e.symbol;switch(r.type){case n.SymbolType.simpleMarker:switch(r.style){case"circle":i.point=Hh(r),i.point.id=e.id;break;default:i.billboard=function(e){return{show:"none"!==e.style,image:Object(n.createSimpleMarkerSymbolCanvas)(e)}}(r),i.billboard.id=e.id}break;case n.SymbolType.pictureMarker:i.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)}}(r),i.billboard.id=e.id}this._dataSource.entities.add(i)}setVisible(e){this._dataSource.entities.show=e}destroy(){this._dataSource.entities.removeAll()}};var Kh=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._field=Object(n.defaultValue)(e.field,void 0),this._valueExpression=Object(n.defaultValue)(e.valueExpression,void 0),this._features=Object(n.defaultValue)(e.features,[]),this._radius=Object(n.defaultValue)(e.radius,void 0),this._radiusFactor=Object(n.defaultValue)(e.radiusFactor,60),this._minDataValue=Object(n.defaultValue)(e.minDataValue,0),this._maxDataValue=Object(n.defaultValue)(e.maxDataValue,0),this._minCanvasSize=Object(n.defaultValue)(e.minCanvasSize,700),this._maxCanvasSize=Object(n.defaultValue)(e.maxCanvasSize,2e3),this._spacingFactor=Object(n.defaultValue)(e.spacingFactor,1.5),this._opacity=Object(n.defaultValue)(e.opacity,1),this._blur=Object(n.defaultValue)(e.blur,.85),this._gradient=Object(n.defaultValue)(e.gradient,{}),this._canChange=Object(n.defaultValue)(e.canChange,!0),this._viewer=Object(n.defaultValue)(e.viewer,void 0),this._heatMap=void 0,this._initHeatMap()}_initHeatMap(){this._viewer||n.Log.error("Cesium视图对象不能为空!"),this._features&&this._features instanceof Array||n.Log.error("热力图数据不能为空或者不是数组!"),this._field||this._valueExpression||n.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 n.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 a;switch(this._valueExpression?(a=Ii.a.parseExpression(i,this._valueExpression),a=Number(a)):a=Number(i.attributes[this._field]),r.type){case n.GeometryType.point:e.push({x:r.coordinates[0],y:r.coordinates[1],value:a});break;case n.GeometryType.multiPoint:for(let t=0;t<r.coordinates.length;t++)e.push({x:r.coordinates[t][0],y:r.coordinates[t][1],value:a});break;case n.GeometryType.lineString:e.push({x:r.extent.center.coordinates[0],y:r.extent.center.coordinates[1],value:a});break;case n.GeometryType.multiLineString:for(let i=0;i<r.coordinates.length;i++){const i=new n.LineString({coordinates:r.coordinates[t]});e.push({x:i.extent.center.coordinates[0],y:i.extent.center.coordinates[1],value:a})}break;case n.GeometryType.polygon:e.push({x:r.centroid.coordinates[0],y:r.centroid.coordinates[1],value:a});break;case n.GeometryType.multiPolygon:for(let i=0;i<r.coordinates.length;i++){const i=new n.Polygon({coordinates:r.coordinates[t]});e.push({x:i.centroid.coordinates[0],y:i.centroid.coordinates[1],value:a})}break;case n.GeometryType.extent:e.push({x:r.center.coordinates[0],y:r.center.coordinates[1],value:a});break;case n.GeometryType.circle:e.push({x:r.center[0],y:r.center[1],value:a})}}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 Zh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.LineSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_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 n.Symbol3DLayerType.line:default:switch(t.type){case n.GeometryType.lineString: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 n.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 n.Symbol3DLayerType.path:switch(t.type){case n.GeometryType.lineString:case n.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 n.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=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=e.material;let a,o=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(o=this._feature.geometry.extensionOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:i,width:e.size,arcType:o}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const t=Ih(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:i,width:e.size,loop:!1});a=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:t})}return a}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.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 a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createPathSymbol3DLayerPrimitive(e,t){const i=[];switch(t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),e.profile){case n.ProfileType.circle:default:return this._createPolylineVolumePrimitive(e,i);case n.ProfileType.quad:return this._createCorridorPrimitive(e,i)}}_createPolylineVolumePrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),n=this._getCornerType(e),a=new Cesium.PolylineVolumeGeometry({polylinePositions:t,shapePositions:this._computeCircle(e.width>e.height?e.width:e.height),cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,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),n=this._getCornerType(e),a=new Cesium.CorridorGeometry({positions:t,width:e.width,height:e.height,extrudedHeight:0,cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,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 n.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 n.LineJoinType.round:default:t=Cesium.CornerType.ROUNDED;break;case n.LineJoinType.bevel:t=Cesium.CornerType.BEVELED;break;case n.LineJoinType.miter:t=Cesium.CornerType.MITERED}return t}_getShadows(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}};var Qh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PolygonSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(a.type){case n.Symbol3DLayerType.line:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLine(a,i[r]);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;e++)this._createLine(a,i[e][t])}break;case n.Symbol3DLayerType.fill:default:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions());break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e])}break;case n.Symbol3DLayerType.extrude:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions(),a.size);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e],a.size)}break;case n.Symbol3DLayerType.icon:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)this._createBillBoard(a,i[e][t]);break;case n.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(a,i[e][t][r])}break;case n.Symbol3DLayerType.object:switch(t.type){case n.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(a,i[e][t]);break;case n.GeometryType.multiPolygon:i=this._getPositions()}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r,a=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(a=this._feature.geometry.extensionOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:a}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const n=Ih(this._elevationInfo.mode),a=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1,classificationType:n})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.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 a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createLine(e,t){const i=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(e,i));r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createPolygon(e,t,i){const r=[];t.forEach(e=>{const t=[];e.forEach(e=>{t.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),r.push(t)});const n=this._primitivesCollection.add(this._createFillSymbol3DLayerPrimitive(e,r,i));n.id=this._feature.id,n.commonFeatureId=this._feature.id,n.commonLayerId=this.commonLayerId,this._primitives.push(n)}_createFillSymbol3DLayerPrimitive(e,t,i){const a=e.material,o=[];for(let e=1;e<t.length;e++)o.push(new Cesium.PolygonHierarchy(t[e]));let s;s=i?new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0,height:i,extrudedHeight:i}):new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0});const l=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(a.color,this._layerOpacity)}),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,shadows:r.getShadows(e)});else{const t=Ih(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.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 n;switch(i.primitive){case"sphere":r=this._primitivesCollection.add(this._createSpherePrimitive(e,t));break;case"cylinder":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:n}));break;case"cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n}));break;case"inverted-cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:0}));break;case"tetrahedron":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n,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)}),n=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:n,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createCylinderPrimitive(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,modelMatrix:a,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createModelPrimitive(e,t){const i=e.material,r=Cesium.Transforms.eastNorthUpToFixedFrame(t),n={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(n)}_createObject3DAppearance(e){const t=e.material;switch(t.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(t.color,this._layerOpacity)})})}}};var ec=class extends _h{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.PointSymbol3D||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[]),this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:i=this._getPositions(),this._createPointSymbol3D(a,i[0]);break;case n.GeometryType.multiPoint:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPointSymbol3D(a,i[e])}}}_createPointSymbol3D(e,t){switch(e.type){case n.Symbol3DLayerType.icon:default:this._createBillboard(e,t);break;case n.Symbol3DLayerType.text:this._createLabel(e,t);break;case n.Symbol3DLayerType.object:this._createObject(e,t)}}_createBillboard(e,t){let i;if(e.resource.href){const r=Dh(e,n.SymbolType.pictureMarker,t,this._feature);i=new xh({feature:r,billboardsCollection:this._billboardsCollection})}else{const r=Dh(e,n.SymbolType.simpleMarker,t,this._feature);i=new wh({feature:r,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection})}this._graphics.push(i)}_createLabel(e,t){const i=Dh(e,n.SymbolType.mapgisText,t,this._feature),r=new Jh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}_createObject(e,t){const i={show:this.show,layerOpacity:this._layerOpacity},n=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),a=e.resource;let o;if(a.href)o=this._primitivesCollection.add(r.createModelPrimitive(e,n,i));else{let t;switch(a.primitive){case"sphere":o=this._primitivesCollection.add(r.createSpherePrimitive(e,n,{show:this.show,layerOpacity:this._layerOpacity}));break;case"cylinder":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"cone":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"inverted-cone":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=0,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"tetrahedron":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,i.slices=3,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i))}}o.id=this._feature.id,o.commonFeatureId=this._feature.id,o.commonLayerId=this.commonLayerId,this._primitives.push(o)}};var tc=class extends _h{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.LabelSymbol3D||(n.Log.info("要素的符号类型不是LabelSymbol3D!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[])}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:i=this._getPositions(),this._createLabel(a,i[0]);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLabel(a,i[e])}}}_createLabel(e,t){const i=Dh(e,n.SymbolType.mapgisText,t,this._feature),r=new Jh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}};class ic{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this.opacity=Object(n.defaultValue)(e.opacity,1),this.elevationInfo=Object(n.defaultValue)(e.elevationInfo,new n.ElevationInfo),this.cameraHeightStep=Object(n.defaultValue)(e.cameraHeightStep,1e3),this._viewer=Object(n.defaultValue)(e.viewer,{}),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._graphicsCollection=[],this._primitivesCollection=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._pointsCollection=new Cesium.PointPrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._billboardsCollection=new Cesium.BillboardCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._labelsCollection=new Cesium.LabelCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._allPrimitives=new Cesium.PrimitiveCollection;const t=this;this._oldCameraHeight=0,this._viewer.camera&&this._viewer.camera.changed.addEventListener(()=>{for(let e=0;e<t._graphicsCollection.length;e++){const i=t._graphicsCollection[e];if(i){if(zh(i._feature)&&(i instanceof xh||i instanceof wh||i instanceof Jh||i instanceof ec)){const e=t._viewer.camera.positionCartographic.height;Math.abs(t._oldCameraHeight-e)>t.cameraHeightStep&&(t._oldCameraHeight=e,t.update(i._feature))}}}})}addPrimitives(){this._allPrimitives.add(this._primitivesCollection),this._allPrimitives.add(this._pointsCollection),this._allPrimitives.add(this._billboardsCollection),this._allPrimitives.add(this._labelsCollection),this._viewer.scene.primitives.add(this._allPrimitives)}add(e){let t=n.Feature.fromJSON(e);let i;switch(t.elevationInfo||(t.elevationInfo=this.elevationInfo),t.additional&&t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t)),t.symbol.type){case n.SymbolType.simpleMarker:i=new wh({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.pictureMarker:i=new xh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.text:case n.SymbolType.mapgisText:i=new Jh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.simpleLine:i=new Vh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.simpleFill:i=new Yh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.pictureFill:i=new Xh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.line3D:i=new Zh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.polygon3D:i=new Qh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.point3D:i=new ec({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case n.SymbolType.label3D:i=new tc({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;default:n.Log.error("要素的符号暂时不支持!")}i&&(this._graphicsCollection.push(i),i.setVisible&&i.setVisible(t.visible))}removeByID(e){const t=this._findGraphicById(e),i=this._graphicsCollection.indexOf(t);i>-1&&this._graphicsCollection.splice(i,1),t.destroy()}update(e){let t=n.Feature.fromJSON(e.toJSON());t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t));const i=this._findGraphicById(e.id);i&&i._feature&&(i._feature.symbol.type!==t.symbol.type?(this.removeByID(e.id),this.add(e)):(i.update(t),i.setVisible&&i.setVisible(t.visible)))}findByID(e){return this._findGraphicById(e)}getAll(){return this._graphicsCollection}remove(e){this.removeByID(e.id)}removeAll(){if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++)this._graphicsCollection[e].destroy();this._graphicsCollection=[]}destroy(){this.removeAll(),this.id=void 0,this.opacity=void 0,this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0,this._allPrimitives=void 0,this._viewer=void 0}setVisible(e){this._graphicsCollection&&this._graphicsCollection.length>0&&this._graphicsCollection.forEach(function(t){t.setVisible&&t.setVisible(e)})}setOpacity(e){let t=e;if(t<0&&(t=0),t>1&&(t=1),this.opacity=t,this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++){const i=this._graphicsCollection[e];i&&(i._layerOpacity=t,i.update(i._feature))}}_findGraphicById(e){let t=void 0;if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let i=0;i<this._graphicsCollection.length;i++){const r=this._graphicsCollection[i];r.id===e&&(t=r)}return t}}Object.defineProperties(ic.prototype,{swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._allPrimitives._primitives.forEach(t=>{t.swipeEnabled=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeEnabled=e})}))}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._allPrimitives._primitives.forEach(t=>{t.swipeInverse=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeInverse=e})}))}}});var rc=ic;var nc=class{static toPrimitive(e,t){const i=new rc({viewer:t&&t.viewer});if(Array.isArray(e))for(let t=0;t<e.length;t++)i.add(e[t]);else i.add(e);const r=[];return i._billboardsCollection.length>0&&r.push(i._billboardsCollection),i._labelsCollection.length>0&&r.push(i._labelsCollection),i._pointsCollection.length>0&&r.push(i._pointsCollection),i._primitivesCollection.length>0&&r.push(i._primitivesCollection),r}};var ac=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var oc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var sc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var lc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};function hc(e,t){this._CesiumMap=e,this._CesiumScene=e.scene,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}hc.prototype.dimensions=["lng","lat"],hc.prototype.setMapOffset=function(e){this._mapOffset=e},hc.prototype.getBMap=function(){return this._CesiumMap},hc.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 n=this._mapOffset,a=Cesium.Cartesian3.fromDegrees(e[0],e[1]);let o=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,a);return[(o=o||{x:0,y:0}).x-n[0],o.y-n[1]]},hc.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]},hc.prototype.getViewRect=function(){const e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},hc.prototype.getRoamTransform=function(){return echarts.matrix.create()},hc.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],n=t[e]/2,a=[],o=[];return a[e]=r-n,o[e]=r+n,a[1-e]=i[1-e],o[1-e]=i[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(o)[e])},this)},this)}}},hc.dimensions=hc.prototype.dimensions,hc.create=function(e,t){let i;e.eachComponent("cesium",function(e){const r=echarts.cesiumMap;(i=new hc(r,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"cesium"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})};var cc=hc;let uc=0;class dc{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${uc++}`,this.layerClass=t.layerClass||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.visible=Object(n.defaultValue)(t.visible,!0),this.opacity=Object(n.defaultValue)(t.opacity,1),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",cc),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.visibility=this.visible?"visible":"hidden",e.style.opacity=this.opacity,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`,n=`${parseInt(i.canvas.height)}px`;t.width=r,t.height=n,t.style.width=r,t.style.height=n,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 n=!0;echarts.cesiumMap;const a=r.getZr().painter.getViewportRoot(),o=e.coordinateSystem,s=function(i,s){if(n||!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];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})},l=function(i,s){if(n||!t.map)return;t._visible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})};function h(){n||(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");n=!1}}),this.chart.setOption(this.options),this}show(){this._visible()}hide(){this._unvisible()}setOpacity(e){this.opacity=e,this.canvas.style.opacity=this.opacity}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=dc;var pc=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,null),this.format=Object(n.defaultValue)(e.format,n.PictureFormat.png),this.filename=Object(n.defaultValue)(e.filename,"screenshotFile"),this.width=Object(n.defaultValue)(e.width,void 0),this.height=Object(n.defaultValue)(e.height,void 0),this.x=Object(n.defaultValue)(e.x,0),this.y=Object(n.defaultValue)(e.y,0),this.isDownload=Object(n.defaultValue)(e.isDownload,!0)}_addView(){const e=this;this.view._innerView.render();const t=this.view._innerView.canvas;let i=null;this.format===n.PictureFormat.png?i=t.toDataURL():this.format===n.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 a=r.getContext("2d"),o=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(){a.drawImage(s,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let i=null;e.format===n.PictureFormat.png?i=r.toDataURL():e.format===n.PictureFormat.jpeg?i=r.toDataURL("image/jpeg"):"svg"===e.format&&(i=r.toDataURL()),e.isDownload&&o(i,e.filename),t({dataUrl:i})}}else e.isDownload&&o(i,this.filename),t({dataUrl:i})})}_removeView(){}};var fc=class extends n.Evented{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,""),this.location=Object(n.defaultValue)(e.location,""),this.title=Object(n.defaultValue)(e.title,""),this.content=Object(n.defaultValue)(e.content,""),this.alignment=Object(n.defaultValue)(e.alignment,"bottom-center"),this.defaultButtons=Object(n.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.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),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 a=new Cesium.Graphic({type:"div",positions:[Cesium.Cartesian3.fromDegrees(t,i,0)],style:{html:r}});this._popup=this._popupLayer.addGraphic(a),this._popup.style.pixelOffset=this._getOffset()}_contentUI(e,t){const i=this;let r=void 0;const n=function(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes};(r=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const a=document.createElement("div");a.setAttribute("class","zondy-popup__header"),a.setAttribute("style","display: flex;");const o=n('<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=n('<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=n('<div style="flex: 1;"></div>')[0];if(a.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){a.appendChild(o);let e=!0;o.onclick=function(){e=!e,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=e?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(a.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=n('<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(a),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 n=this._contentUI(e,t);r.appendChild(n),i.appendChild(r);const a=document.createElement("div");return a.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),a.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(a),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,n=0;switch(e){case"top-left":n=-i;break;case"top-center":r=-t/2,n=-i;break;case"top-right":r=-t,n=-i;break;case"bottom-left":break;case"auto":case"bottom-center":r=-t/2;break;case"bottom-right":r=-t}return{x:r,y:n}}close(){this._popup.remove()}destroy(){this._popupLayer&&this.view._innerView.remove(this._popupLayer)}};var mc=class extends n.LayerView{onAdd(){return Bl.addVectorTileLayer(this)}onRemove(){return Bl.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r}=i;if(i)switch(i.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":default:Bl.refresh(this);break;case"opacity":Bl.setOpacity(this,r[0]);break;case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0;Bl.setVisible(this,e);break}case"clippingArea":Bl.setClipArea(this)}}return Promise.resolve(this)}};function yc(e,t,i){const r=Kl(e,i),n=i.imageryLayers.indexOf(t);if(n>=r){for(let e=0;e<n-r;e++)i.imageryLayers.lower(t);t._realIndex=e._realIndex+1}else{for(let e=0;e<r-n;e++)i.imageryLayers.raise(t);t._realIndex=e._realIndex+1}}var gc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Pr.addWMSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return Pr.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"spatialReference":Pr.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Pr.addWMSLayer(this.layer,this.innerView);break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"sublayerVisible":case"refresh":Pr.removeLayer(this.innerLayer,this.innerView),this.innerLayer=Pr.addWMSLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var vc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Gr.addWMTSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return Gr.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(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 bc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Vr.addIGSTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Vr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Vr.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Vr.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var _c=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=lh.addIGSMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this._getLayerViewVisible()||(this.innerLayer.alpha=0),e(this)})}onRemove(e){return lh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.alpha=t?this.layer.opacity:0;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":lh.removeLayer(this.innerLayer,this.innerView),this.innerLayer=lh.addIGSMapImageLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var wc=class{static applyUpdate(e,t,i,r,a){if(r.updateContent)for(let e=0;e<r.updateContent.length;e++){const o=r.updateContent[e];if(o)switch(o.name){case"visible":switch(t.type){case n.LayerType.wms:case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:case n.LayerType.m3dCache:const e=o.params&&o.params.length>0?o.params[0]:this.layer.visible,r=a._getLayerViewVisible(e);i.show=r}break;case"opacity":switch(t.type){case n.LayerType.wms:i.alpha=t.opacity;break;case n.LayerType.m3dCache:i.translucency=t.opacity;break;case n.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 o=!1;switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}if(r.extend&&r.extend.type){switch(r.extend.type){case n.LayerEventType.layerUpdateOpacity:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:i.alpha=t.opacity,o=!0;break;case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:(i=e._innerView.scene.layers.getLayer(t.layerIndex)).translucency=t.opacity}break;case n.LayerEventType.layerUpdateVisible:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:i.show=!i.show,o=!0}break;case n.LayerEventType.layerUpdateStyle:switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}break;case n.LayerEventType.layerSublayerVisible:switch(t.type){case n.LayerType.igsMapImage:i._imageryProvider._layers=t.layers,o=!0}}return o?new Promise(e=>{e()}):null}}};var xc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Ul.addM3DLayer(t,i,this.view,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Ul.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return wc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Cc=class extends n.LayerView{onAdd(e){return new Promise(e=>{dh.addCesium3DTilesLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return dh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return wc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Sc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Hl.addTerrainCacheLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Hl.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":Hl.setOpacity(this.layer,this.innerView)}}return Promise.resolve(this)}};class Mc{}Mc.addEchartsLayer=function(e){const{layer:t,innerView:i}=e,r=e._getLayerViewVisible(t.visible);let n=Object.assign({},t.echartsOptions);n.visible=r,n.opacity=t.opacity;const{extensionOptions:a={}}=t;n=Object.assign(n,a);const o=new dc(i,n).addTo(i);return o.id=t.id,o},Mc.removeLayer=function(e){e.remove()};var kc=Mc;var Tc=class extends n.LayerView{onAdd(e){return this.innerLayer=kc.addEchartsLayer(this),Promise.resolve(this)}onRemove(e){return kc.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":kc.removeLayer(this.innerLayer),this.innerLayer=kc.addEchartsLayer(this)}}return Promise.resolve(this)}};var Ic=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this._getLayerViewVisible();return this.innerLayer=bh.addMapVLayer(t,i),r||this.innerLayer.hide(),Promise.resolve(this)}onRemove(e){return bh.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};var Oc=class extends n.GroupLayerView{};var Ec=class extends n.BaseGraphicsLayerView{onAdd(e){const t=this.layer,i=this.innerView,r=t.graphics||[];return this._getLayerViewVisible(),this.innerLayer=new rc({id:t.id,viewer:i,opacity:t.opacity,elevationInfo:t.elevationInfo}),this.innerLayer.addPrimitives(),this.render.drawFeature(this.innerLayer,r),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&&t.setOpacity(i[0]);break}case"visible":{const i=e.params&&e.params.length>0?e.params[0]:void 0,r=this._getLayerViewVisible(i);t.setVisible&&t.setVisible(r);break}}if(e&&"method"===e.operationType)switch(e.name){case"add":this.render.drawFeature(t,[e.params[0]]);break;case"remove":{const i=e.params;t.remove(i[0]);break}case"addMany":this.render.drawFeature(t,e.params[0]);break;case"removeMany":e.params[0].forEach(e=>{t.remove(e)});break;case"removeAll":t.removeAll()}}),Promise.resolve(this)}};var Lc=class extends n.BaseFeatureLayerView{constructor(e){super(e),this._labelClass=null}_processData(){return new Promise(e=>{e()})}onAdd(e){const t=this,i=this.innerView,r=this.layer,a=this.layer.renderer;return this._processData().then(e=>new Promise(o=>{if(t.innerLayer&&t.innerLayer.destroy(),a instanceof n.ClusterRenderer){t.innerLayer=new $h({id:r.id,viewer:i,renderer:a});const o=Object(n.getFeaturesFromFeatureSet)(e);for(let e=0;e<o.length;e++)o[e].symbol=n.Symbol.fromJSON(a.defaultSymbol.toJSON());for(let e=0;e<o.length;e++)t.innerLayer.add(o[e])}else if(a instanceof n.HeatmapRenderer)t.innerLayer=new Kh({id:r.id,viewer:i,field:a.field,valueExpression:a.valueExpression,radius:a.radius,alpha:r.opacity,gradient:a.colorStops,minDataValue:a.minDataValue,maxDataValue:a.maxDataValue,features:Object(n.getFeaturesFromFeatureSet)(e)});else{const o=this._getLayerViewVisible()?t.layer.opacity:0;if(t.innerLayer=new rc({id:r.id,viewer:i,opacity:o,elevationInfo:t.layer.elevationInfo}),t.innerLayer.addPrimitives(),e.features.length>0&&!e.features[0].geometry.spatialReference.isGeographic)for(let t=0;t<e.features.length;t++)e.features[t].geometry=n.Projection.project(e.features[t].geometry,new n.SpatialReference({wkid:4326}));t._initFeatures(e,a)}t._initDynamicLabel(e||{}),o(t)}))}_initDynamicLabel(e){const{innerView:t}=this,{labelingInfo:i,labelsVisible:r}=this.layer;r&&Array.isArray(i)&&i.length>0&&(this._dynamicLabelLayer=new pr({labelingInfo:i,scene:t.scene,visible:this.layer.visible&&r,opacity:this.layer.opacity}),this._dynamicLabelLayer.add(e.features||[]))}onRemove(e){return this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null),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&&(t.setOpacity(e[0]),this._dynamicLabelLayer&&(this._dynamicLabelLayer.translucency=e[0]));break}case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0,r=this._getLayerViewVisible(e);this._dynamicLabelLayer&&(this._dynamicLabelLayer.show=r),t.setVisible&&t.setVisible(r);break}case"renderer":this.onAdd(e)}if(i&&"method"===i.operationType)switch(i.name){case"refresh":this.onAdd(e)}}),Promise.resolve(this)}};var Pc=class extends Lc{_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?$l(i.spatialReference,i.extent):new Cesium.GeographicTilingScheme({rectangle:Cesium.Rectangle.fromDegrees(-180,-90,180,90),ellipsoid:Cesium.Ellipsoid.WGS84,numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1});const a=i.url,o=Object(n.getBaseUrl)(a);let s;return s="1.0"===i._igsVersion?{url:`${o}/igs/rest/mrms/layers`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""}:{url:`${o}/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)),this.innerLayer.alpha=i.opacity,this.innerLayer.show=this._getLayerViewVisible(),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 Rc=class extends Lc{_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 jc=class extends Lc{_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 Ac=class extends n.LayerView{onAdd(e){return new Promise(e=>{Ul.addM3DLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return Ul.removeLayer(this.innerLayer,this.innerView,this.view),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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.translucency=this.layer.opacity;break;case"renderer":const r=i.params[0];this.innerLayer.renderer=Ql(r)}}return Promise.resolve(this)}};var zc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Er.addArcGISMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Er.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Dc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=jr.addArcGISTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return jr.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Vc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Jl.addWebTileLayer(t,i),r.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(r)})}onRemove(e){return Jl.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Jl.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Jl.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};function Nc(e){const t=n.Feature.fromJSON(e);return t.geometry.spatialReference.isGeographic||(t.geometry=n.Projection.project(t.geometry,new n.SpatialReference({wkid:4326}))),t}function Gc(e){const t=[];if(e instanceof n.FeatureSet)for(let i=0;i<e.features.length;i++)t.push(Nc(e.features[i]));else if(e instanceof n.FeatureCollection)e.forEach(e=>{t.push(Nc(e))});else for(let i=0;i<e.length;i++)t.push(Nc(e[i]));return t}var Fc=class extends n.FeatureRender{drawFeature(e,t){const i=Gc(t);if(e)for(let t=0;t<i.length;t++)e.add(i[t])}updateFeature(e,t,i){const r=Gc(t);if(e)for(let t=0;t<r.length;t++)e.update(r[t])}clearFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.remove(t[i])}clear(e){e&&e.removeAll()}};var Bc=function(e){Bc.instance={tokenKey:e.tokenKey,tokenValue:e.tokenValue,headers:e.headers,request:e.request}},qc=Bc;class Uc extends n.SceneView{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this._center=Object(n.defaultValue)(e.center,new n.Point({coordinates:[0,0]})),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new n.Point({coordinates:[this._center[0],this._center[1],this._center[2]]})),this._scale=Object(n.defaultValue)(e.scale,void 0),this._zoom=Object(n.defaultValue)(e.zoom,3),this.minZoom=Object(n.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(e.maxZoom,void 0),this._extent=Object(n.defaultValue)(e.extent,void 0),this.width=void 0,this.height=void 0,this._spatialReference=new n.SpatialReference("EPSG:4326"),this.popup=Object(n.defaultValue)(e.popup,void 0),this.stationary=!0,this.engineType="cesium",this._innerView=Object(n.defaultValue)(e.innerView,void 0),this._innerView||(this._innerView=new Cesium.Viewer(this._viewId,this.extensionOptions)),qc(n.Config),this._initSize(),this._extent?this._initExtent():(this._initScale(),this._initZoom()),this._initViewEvent(),this._initPopup(),this._map._initCesiumView=!0,this._showLayerByScale()}_initViewEvent(){const e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},this._screenSpaceEventHandler=new Cesium.ScreenSpaceEventHandler(this._innerView.scene.canvas),this.fire(n.ViewEventType.loaded,{}),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore&&(clearTimeout(e._clickStore),e._clickStore=null),e.fire(n.ViewEventType.doubleClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(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._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.LEFT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(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._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.RIGHT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(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._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action)),e._dragParams={isDrag:!1,origin:null,action:"",button:null})},Cesium.ScreenSpaceEventType.MIDDLE_UP),this._screenSpaceEventHandler.setInputAction(t=>{t.position=t.endPosition,e.fire(n.ViewEventType.pointerMove,ch.getMouseEvent(t,e)),e._dragParams.isDrag?(e.fire(n.ViewEventType.drag,ch.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.camera.moveEnd.addEventListener(t=>{e._cameraMoveEndHandler(),e.fire(n.ViewEventType.viewChange,ch.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(n.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(n.ViewEventType.keyDown,ch.getKeyEvent(t,e))}),t.addEventListener("keyup",t=>{e.fire(n.ViewEventType.keyUp,ch.getKeyEvent(t,e))})}_mapActionControl(e,t){"drag-pan"===e&&(this._innerView.scene.screenSpaceCameraController.enableRotate=t)}flyTo(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.duration,2),i=Object(n.defaultValue)(e.orientation,void 0),r=Object(n.defaultValue)(e.cancel,void 0),a=Object(n.defaultValue)(e.endTransform,void 0),o=Object(n.defaultValue)(e.maximumHeight,void 0),s=Object(n.defaultValue)(e.flyOverLongitude,void 0),l=Object(n.defaultValue)(e.flyOverLongitudeWeight,void 0),h=Object(n.defaultValue)(e.convert,void 0),c=Object(n.defaultValue)(e.easingFunction,void 0),u=this._getFlyToCenter(e),d=this._getFlyToExtent(e),p=function(t){e.complete instanceof Function&&e.complete(t)};Object(n.isNull)(u)?Object(n.isNull)(d)||this._innerView.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(d.xmin,d.ymin,d.xmax,d.ymax),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c}):this._innerView.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(u.coordinates[0],u.coordinates[1],u.coordinates[2]),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c})}goTo(e={},t={}){let i,r,a=new Promise(e=>{e()});if(this._innerView){let o;if(Object(n.isNull)(e.center)&&Object(n.isNull)(e.zoom)&&Object(n.isNull)(e.scale)||(i=Object(n.isNull)(e.center)?this._center:this._getFlyToCenter({center:e.center}),r=!Object(n.isNull)(e.scale)&&e.scale>0?this._getZoomByScale(e.scale):!Object(n.isNull)(e.zoom)&&e.zoom>0?e.zoom:this._zoom),!Object(n.isNull)(e.target)){const t=this._getTargetExtent(e.target);t.xmin!==t.xmax&&t.ymin!==t.ymax?o=t:i=this._getFlyToCenter({center:new n.Point({coordinates:[t.xmin,t.ymin]})})}const s={animate:!0,duration:.2};let l;if(Object(n.isNull)(t)||(Object(n.isNull)(t.animate)||(s.animate=t.animate),Object(n.isNull)(t.duration)||(s.duration=t.duration/1e3),Object(n.isNull)(t.orientation)||(s.orientation=t.orientation)),Object(n.isNull)(i))Object(n.isNull)(o)||(l=Cesium.Rectangle.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax));else{let e;e=r?this._getAltitudeByZoom(r):void 0!==i.coordinates[2]?i.coordinates[2]:this._getAltitudeByZoom(this._zoom),l=Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],e)}l&&(a=new Promise(e=>{const t={destination:l,complete:function(){e()}};Object.assign(t,s),this._innerView.camera.flyTo(t)}))}return a}_createLayerView(e){let t=null;return e&&e.autoAddTo3D&&(t=function(e,t){let i=null;switch(t.type){case n.LayerType.vectorTile:case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:i=new mc({view:e,layer:t});break;case n.LayerType.wmts:i=new vc({view:e,layer:t});break;case n.LayerType.igsMapImage:i=new _c({view:e,layer:t});break;case n.LayerType.igsTile:i=new bc({view:e,layer:t});break;case n.LayerType.wms:i=new gc({view:e,layer:t});break;case n.LayerType.m3d:i=new xc({view:e,layer:t});break;case n.LayerType.cesium3DTiles:i=new Cc({view:e,layer:t});break;case n.LayerType.scene:i=new vr({view:e,layer:t});break;case n.LayerType.terrain:i=new Sc({view:e,layer:t});break;case n.LayerType.echarts:i=new Tc({view:e,layer:t});break;case n.LayerType.mapv:i=new Ic({view:e,layer:t});break;case n.LayerType.group:i=new Oc({view:e,layer:t});break;case n.LayerType.graphics:i=new Ec({view:e,layer:t,render:new Fc});break;case n.LayerType.igsFeature:i=new Pc({view:e,layer:t,render:new Fc});break;case n.LayerType.geojson:i=new Rc({view:e,layer:t,render:new Fc});break;case n.LayerType.wfs:i=new jc({view:e,layer:t,render:new Fc});break;case n.LayerType.m3dCache:i=new Ac({view:e,layer:t});break;case n.LayerType.arcgisMapImage:i=new zc({view:e,layer:t});break;case n.LayerType.arcgisTile:i=new Dc({view:e,layer:t});break;case n.LayerType.webTileLayer:i=new Vc({view:e,layer:t})}return i}(this,e)),t}toJSON(){return super.toJSON()}toMap(e){let t=null;const i=new Cesium.Cartesian2(e.x,e.y);if(this._innerView.scene.globe.translucency.enabled||!this._innerView.scene.globe.depthTestAgainstTerrain){const e=this._innerView.camera.getPickRay(i);t=this._innerView.scene.globe.pick(e,this._innerView.scene)}else i.y=i.y+1,t=this._innerView.scene.pickPosition(i);let r=null;if(t&&!Object(n.isNull)(t)){const e=this._innerView.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.longitude),a=Cesium.Math.toDegrees(e.latitude),o=e.height;r=new n.Point({coordinates:[i,a,o]})}return r}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,a=new n.Point({coordinates:[t,i,r]});return this._center=a,a}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 n.Point({coordinates:[e[0],e[1],i]}),t=!0):e instanceof n.Point&&(this._center=new n.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();let t;return t=e?new n.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}):new n.Extent({xmin:-180,ymin:-90,xmax:180,ymax:90}),this._extent=t,t}setExtent(e){this._innerView&&(this._extent=e,this.flyTo({extent:e}))}getInnerLayer(e){if(e instanceof n.Layer)return super.getInnerLayer(e);if(e instanceof n.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 fc({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,a=this.getLayer(r.commonLayerId);if(Object(n.isNull)(r.commonLayerId))return;let o=null;if(a.type===n.LayerType.igsFeature||a.type===n.LayerType.geojson){o=this._getLayerView(a)._featureSetCache.filter(e=>{if(e.id===r.commonFeatureId)return e})}else a.type===n.LayerType.graphics&&(o=a.graphics.filter(e=>{if(e.id===r.commonFeatureId)return e}));const s={graphic:o&&o.items.length>0?o.items[0]:null,layer:a,mapPoint:this.toMap(e),type:"graphic"};t.push(s)}}),t}_cameraMoveEndHandler(){this.getCenter(),this.getExtent(),this.getZoom(),this.getScale(),this._showLayerByScale()}_initSize(){const e=this._innerView.canvas;this.width=e.width,this.height=e.height}_setCursor(e){this._innerView&&(e&&null!==e?(this._innerView._container.style.cursor=e,this._innerView.canvas.style.cursor=e):(this._innerView._container.style.removeProperty("cursor"),this._innerView.canvas.style.removeProperty("cursor")),this._cursor=e)}_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 n.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}}_initZoom(){if(!this.scale&&!Object(n.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 n.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(n.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],a=new n.Point({coordinates:[i,r,t]});this.flyTo({center:a})}}}_setZoomAndCenter(e){if(this._innerView&&!Object(n.isNull)(e.zoom)&&!Object(n.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 a=new n.Point({coordinates:[t,i,r]});this._center=a,this.flyTo({center:a})}}}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 n.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 pc(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)}_moveLayerView(e,t){let i=t;const r=e.innerView;let n,a;if(e instanceof Ec||e instanceof Rc||e instanceof Pc||e instanceof jc||t instanceof Ec||t instanceof Rc||t instanceof Pc||t instanceof jc){n=r.scene._primitives._primitives.indexOf(e.innerLayer._allPrimitives);let t=(a=r.scene._primitives._primitives.indexOf(i.innerLayer._allPrimitives))-n;if(t>1)for(let i=0;i<t-1;i++)r.scene._primitives.raise(e.innerLayer._allPrimitives);else if(t<0){t=Math.abs(t);for(let e=0;e<t;e++)r.scene._primitives.raise(i.innerLayer._allPrimitives)}}else if(!(e instanceof Ec||e instanceof Rc||e instanceof Pc||e instanceof jc||t instanceof Ec||t instanceof Rc||t instanceof Pc||t instanceof jc)&&this._isLayerViewSupportReorder(e)){if(!this._isLayerViewSupportReorder(t)){const e=this.allLayerViews.toArray();for(let r=this.allLayerViews.indexOf(t)+1;r<e.length;r++)if(this._isLayerViewSupportReorder(e[r])){i=e[r];break}}n=r.imageryLayers.indexOf(e.innerLayer);let o=(a=r.imageryLayers.indexOf(i.innerLayer))-n;if(o>1)for(let t=0;t<o-1;t++)r.imageryLayers.raise(e.innerLayer);else if(o<0){o=Math.abs(o);for(let e=0;e<o;e++)r.imageryLayers.raise(i.innerLayer)}}}}Uc.fromJSON=function(e){return e=Object(n.defaultValue)(e,{}),new Uc(e)},Object.defineProperties(Uc.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}}});var Wc=Uc;var Hc=class extends n.SketchEditor3D{constructor(e){super(e),this.arcType=Object(n.defaultValue)(e.arcType,n.ArcType.rhumb)}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,t=t=>{if(!t||!t.x||!t.y)return;if(e._drawTool&&e._drawTool._editMode===n.SketchEditMode.DRAWING)return;let i=void 0,r=!1;if(e._drawTool&&e._drawTool.sketchStage&&e._drawTool.sketchStage.selectBoxGraphics.length>0&&e.view._innerView.scene.drillPick({x:t.x,y:t.y}).forEach(n=>{if(n.primitive&&(e._layer&&e._layer.id===n.primitive.commonLayerId||e._sketchInnerLayer.id===n.primitive.commonLayerId)&&e._drawTool.sketchStage.entityGraphic.id===n.primitive.commonFeatureId){const a=e.view._innerView.camera.getPickRay({x:t.x,y:t.y}),o=e.view._innerView.scene.pickFromRay(a,[n.primitive]);o&&o.object&&o.object.primitive&&(r=!0,i=o.object)}}),r||(i=e.view._innerView.scene.pick({x:t.x,y:t.y})),i&&i.primitive&&(e._layer&&e._layer.id===i.primitive.commonLayerId||e._sketchInnerLayer.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=()=>{if(e._editable&&(void 0===e._drawTool||null===e._drawTool||3!==e._drawTool._editMode)){if(r.hitTestFeature(r.sketchStage.entityGraphic,t),void 0!==e._drawTool&&null!==e._drawTool&&(e.fire("selected",{isSelected:!0,selectedDrawTool:e._drawTool,selectedGeometry:e._drawTool.sketchStage.entityGraphic.geometry},e),!r._parent&&0===r._editMode)){const t=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:e,toolEventInfo:null,state:n.SketchEditorState.start,feature:e._drawTool.sketchStage.entityGraphic,geometry:e._drawTool.sketchStage.entityGraphic.geometry});e.fire(n.SketchEditorEventType.update,t)}e.view.off(n.ViewEventType.mouseUp,i)}};e.view.on(n.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)}}};this._hitTestSketchHandler||(this.view.on(n.ViewEventType.mouseDown,t),this._hitTestSketchHandler=t)}_getCenterCoordinate(e,t,i){let r;return 2===(i=void 0!==i?i:this.arcType)&&(r=Ii.a.calcRhumbArcCenter(e,t)),r=1===i?Ii.a.calcCartesianArcCenter(e,t):[(e[0]+t[0])/2,(e[1]+t[1])/2]}_getHight(){return 0}};var Yc=class{static async fromUrl(e,t){const i=new n.ArcGISTileLayer({url:e}),r=await i.load(),a=jr.initializeOptions(r);return new Cesium.UrlTemplateImageryProvider({...a,...t})}};var Xc=class{static async fromUrl(e,t){const i=new n.WMSLayer({url:e}),r=await i.load(),a=Pr.initializeOptions(r);return new Cesium.WebMapServiceImageryProvider({...a,...t})}};var Jc=class{static async fromUrl(e,t={}){t=Object(n.defaultValue)(t,{});const i=new n.WMTSLayer({url:e}),r=await i.load(),a=Gr.initializeOptions(r),o=new Cesium.WebMapTileServiceImageryProvider({...a,...t});return o.isStretchImage=Object(n.defaultValue)(t.isStretchImage,!1),o}};var $c=class extends Gl{static async fromUrl(e,t){const i=new n.ArcGISVectorTileLayer({url:e}),r=await i.load(),a=Bl.initializeOptions(r);return new Gl({...a,...t})}};var Kc=class{static fromUrl(e,t){const i=new n.M3DModelCacheLayer({url:e}),r=Ul.initializeOptions(i);return(t||t.viewer)&&(r._scene=t.viewer.scene),new Cesium.MapGISM3DSet({...r,...t})}};function Zc(){Cesium.ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){const r=e.data;if(Cesium.defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(Cesium.defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;const n=this._imageryProvider;if(Cesium.defined(i)||(i=r.imagery.length),!Cesium.defined(n))return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;const a=n.tilingScheme.projection instanceof Cesium.WebMercatorProjection&&e.rectangle.north<Cesium.WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-Cesium.WebMercatorProjection.MaximumLatitude,o=Cesium.Rectangle.intersection(n.rectangle,this._rectangle,this.imageryBoundsScratch);let s=Cesium.Rectangle.intersection(e.rectangle,o,this.tileImageryBoundsScratch);if(!Cesium.defined(s)){if(!this.isBaseLayer())return!1;const t=o,i=e.rectangle;s=this.tileImageryBoundsScratch,i.south>=t.north?(s.north=t.north,s.south=t.north):i.north<=t.south?(s.north=t.south,s.south=t.south):(s.south=Math.max(i.south,t.south),s.north=Math.min(i.north,t.north)),i.west>=t.east?(s.west=t.east,s.east=t.east):i.east<=t.west?(s.west=t.west,s.east=t.west):(s.west=Math.max(i.west,t.west),s.east=Math.min(i.east,t.east))}let l=0;s.south>0?l=s.south:s.north<0&&(l=s.north);let h=function(e,t,i){const r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,o=kr.isGeographic(e._imageryProvider.tilingScheme.projection)?1:Math.cos(i);let s=0,l=t;if(kr.isGeographic(e._imageryProvider.tilingScheme.projection)&&(l=t/(Math.PI*a.maximumRadius*o/180)),n._tileInfo&&n.getTileLevelByResolution)s=n.getTileLevelByResolution(l);else{const e=n.rectangle.width,i=a.maximumRadius*e*o/(r.tileWidth*n.getNumberOfXTilesAtLevel(0))/t;s=Math.log(i)/Math.log(2)}return Math.round(s)||0}(this,1*t.getLevelMaximumGeometricError(e.level),l);h=Math.max(0,h);const c=n.maximumLevel,u=!(void 0!==n.isStretchImage&&!n.isStretchImage);if(h>c){if(!u)return!1;h=c}if(Cesium.defined(n.minimumLevel)){const e=n.minimumLevel;if(h<e){if(!u)return!1;h=e}}const d=n.tilingScheme,p=d.positionToTileXY(Cesium.Rectangle.northwest(s),h),f=d.positionToTileXY(Cesium.Rectangle.southeast(s),h);let m=e.rectangle.width/512,y=e.rectangle.height/512;const g=d.tileXYToRectangle(p.x,p.y,h);Math.abs(g.south-e.rectangle.north)<y&&p.y<f.y&&++p.y,Math.abs(g.east-e.rectangle.west)<m&&p.x<f.x&&++p.x;const v=d.tileXYToRectangle(f.x,f.y,h);Math.abs(v.north-e.rectangle.south)<y&&f.y>p.y&&--f.y,Math.abs(v.west-e.rectangle.east)<m&&f.x>p.x&&--f.x;const b=Cesium.Rectangle.clone(e.rectangle,this.terrainRectangleScratch),_=d.tileXYToRectangle(p.x,p.y,h),w=d.tileXYToRectangle(f.x,f.y,h);let x,C,S=new Cesium.Rectangle(_.west,w.south,w.east,_.north),M=Cesium.Rectangle.intersection(S,o,this.clippedRectangleScratch);a?(d.rectangleToNativeRectangle(b,b),d.rectangleToNativeRectangle(S,S),d.rectangleToNativeRectangle(M,M),d.rectangleToNativeRectangle(o,o),x=d.tileXYToNativeRectangle.bind(d),m=b.width/512,y=b.height/512):x=d.tileXYToRectangle.bind(d);let k,T=0,I=1;!this.isBaseLayer()&&M&&Math.abs(M.west-b.west)>=m&&(T=Math.min(1,(M.west-b.west)/b.width)),!this.isBaseLayer()&&M&&Math.abs(M.north-b.north)>=y&&(I=Math.max(0,(M.north-b.south)/b.height));const O=I,E=[],L=[];let P,R=void 0,j=void 0;if(d._axisDirection&&d._axisDirection.y>0){for(P=p.y;P>=f.y;P--)E.push(P);j=f.y}else{for(P=p.y;P<=f.y;P++)E.push(P);j=p.y}if(d._axisDirection&&d._axisDirection.x<0){for(P=p.x;P>=f.x;P--)L.push(P);R=f.x}else{for(P=p.x;P<=f.x;P++)L.push(P);R=p.x}for(let e=0;e<L.length;e++){const t=L[e];C=T;const n=x(t,j,h),s=x(t,Math.max(...E),h);if(S=new Cesium.Rectangle(Math.min(n.west,s.west),Math.min(n.south,s.south),Math.max(n.east,s.east),Math.max(n.north,s.north)),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),Cesium.defined(M)){T=Math.min(1,(M.east-b.west)/b.width),t===f.x&&(this.isBaseLayer()||Math.abs(M.east-b.east)<m)&&(T=1),I=O;for(let e=0;e<E.length;e++){const n=E[e];if(k=I,S=x(t,n,h),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),!Cesium.defined(M))continue;I=Math.max(0,(M.south-b.south)/b.height),n===f.y&&(this.isBaseLayer()||Math.abs(M.south-b.south)<y)&&(I=0);const s=new Cesium.Cartesian4(C,I,T,k),l=this.getImageryFromCache(t,n,h);r.imagery.splice(i,0,new Cesium.TileImagery(l,s,a)),++i}}}return!0},Cesium.ImageryLayer.prototype._requestImagery=function(e){const t=this._imageryProvider,i=this;function r(t){if(!Cesium.defined(t))return n();e.image=t,e.state=Cesium.ImageryState.RECEIVED,e.request=void 0,Cesium.TileProviderError.handleSuccess?Cesium.TileProviderError.handleSuccess(i._requestImageError):Cesium.TileProviderError.reportSuccess(i._requestImageError)}function n(r){if(e.request.state===Cesium.RequestState.CANCELLED)return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);e.state=Cesium.ImageryState.FAILED,e.request=void 0;const n="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";Cesium.TileProviderError.handleError?i._requestImageError=Cesium.TileProviderError.handleError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,a,r):(i._requestImageError=Cesium.TileProviderError.reportError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,r),i._requestImageError.retry&&a())}function a(){const i=new Cesium.Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.IMAGERY});let a;e.request=i,e.state=Cesium.ImageryState.TRANSITIONING,a=t instanceof Cesium.WebMapTileServiceImageryProvider&&Cesium.defined(t._tileMatrixLabels)?e.level:function(e){let i=e.level;t.tilingScheme&&t.tilingScheme._tileInfo&&(i=t.tilingScheme._tileInfo.lods[e.level].level);return i}(e);const o=t.requestImage(e.x,e.y,a,i);if(!Cesium.defined(o))return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);Cesium.defined(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),"function"==typeof o.then?o.then(r,n):Promise.resolve(o).then(r,n)}a()}}let Qc;function eu(){if(window.Cesium){try{n.Log.info("Cesium原型链修改完毕"),Zc()}catch(e){console.error(e)}window.removeEventListener("load",eu),window.document.removeEventListener("readystatechange",eu),window.document.removeEventListener("DOMContentLoaded",eu),window.clearInterval(Qc)}}window.addEventListener("load",eu),window.document.addEventListener("readystatechange",eu),window.document.addEventListener("DOMContentLoaded",eu),Qc=setInterval(()=>{eu()},20),i.d(t,"SceneViewCesium",function(){return Wc}),i.d(t,"SceneView",function(){return Wc}),i.d(t,"SketchEditorCesium",function(){return Hc}),i.d(t,"SketchEditor",function(){return Hc}),i.d(t,"CesiumInnerGraphicsLayer",function(){return rc}),i.d(t,"getTilingScheme",function(){return $l}),i.d(t,"getProviderExtent",function(){return Zl}),i.d(t,"MapGISMapServerImageryProvider",function(){return oh}),i.d(t,"MapGISTileServerImageryProvider",function(){return zr}),i.d(t,"CustomTilingScheme",function(){return gr}),i.d(t,"MapGISVectorTileImageryProvider",function(){return Gl}),i.d(t,"ArcGISMapServerImageryProvider",function(){return Ir}),i.d(t,"ArcGISTileServerImageryProvider",function(){return Yc}),i.d(t,"WebMapServiceImageryProvider",function(){return Xc}),i.d(t,"WebMapTileServiceImageryProvider",function(){return Jc}),i.d(t,"UrlTemplateImageryProvider",function(){return Yl}),i.d(t,"ArcGISVectorTileImageryProvider",function(){return $c}),i.d(t,"MapGISTerrainProvider",function(){return Mr}),i.d(t,"MapGISM3DSet",function(){return Kc}),i.d(t,"initializeOptions",function(){return nh}),i.d(t,"EchartsLayer",function(){return dc}),i.d(t,"MapvLayer",function(){return gh}),i.d(t,"GeoJSONLayerUtil",function(){return ac}),i.d(t,"GraphicsLayerUtil",function(){return oc}),i.d(t,"IGSFeatureLayerUtil",function(){return sc}),i.d(t,"WFSLayerUtil",function(){return lc}),i.d(t,"Screenshot",function(){return pc}),i.d(t,"Popup",function(){return fc}),i.d(t,"MapGISTileAvailability",function(){return Cr}),n.zondy.cesium={},n.zondy.cesium.MapGISMapServerImageryProvider=oh,n.zondy.cesium.MapGISTileServerImageryProvider=zr,n.zondy.cesium.MapGISVectorTileImageryProvider=Gl,n.zondy.cesium.ArcGISMapServerImageryProvider=Ir,n.zondy.cesium.ArcGISTileServerImageryProvider=Yc,n.zondy.cesium.ArcGISVectorTileImageryProvider=$c,n.zondy.cesium.WebMapServiceImageryProvider=Xc,n.zondy.cesium.WebMapTileServiceImageryProvider=Jc,n.zondy.cesium.UrlTemplateImageryProvider=Yl,n.zondy.cesium.MapGISTerrainProvider=Mr,n.zondy.cesium.MapGISTileAvailability=Cr,n.zondy.cesium.layer={},n.zondy.cesium.layer.EchartsLayer=dc,n.zondy.cesium.layer.MapVLayer=gh,n.zondy.cesium.layer.GraphicsLayer=rc,n.zondy.cesium.tool={},n.zondy.cesium.tool.sketch={},n.zondy.cesium.tool.sketch.SketchEditor=Hc,n.zondy.cesium.tool.Screenshot=pc,n.zondy.cesium.widget={},n.zondy.cesium.widget.Popup=fc,n.zondy.cesium.util={},n.zondy.cesium.util.getTilingScheme=$l,n.zondy.cesium.util.getProviderExtent=Zl,n.zondy.cesium.util.initializeOptions=nh,n.zondy.cesium.util.GeoJSONLayerUtil=ac,n.zondy.cesium.util.GraphicsLayerUtil=oc,n.zondy.cesium.util.IGSFeatureLayerUtil=sc,n.zondy.cesium.WFSLayerUtil=lc,n.zondy.cesium.CustomTilingScheme=gr,n.zondy.cesium.MapGISM3DSet=Kc,n.zondy.cesium.SceneView=Wc,n.zondy.cesium.VERSION="17.2.4",n.Zondy.CesiumInnerGraphicsLayer=rc,n.Zondy.MapGISMapServerImageryProvider=oh,n.Zondy.MapGISTileServerImageryProvider=zr,n.Zondy.MapGISVectorTileImageryProvider=Gl,n.Zondy.ArcGISMapServerImageryProvider=Ir,n.Zondy.ArcGISTileServerImageryProvider=Yc,n.Zondy.ArcGISVectorTileImageryProvider=$c,n.Zondy.WebMapServiceImageryProvider=Xc,n.Zondy.WebMapTileServiceImageryProvider=Jc,n.Zondy.UrlTemplateImageryProvider=Yl,n.Zondy.MapGISTerrainProvider=Mr,n.Zondy.MapGISTileAvailability=Cr,n.Zondy.EchartsLayer=dc,n.Zondy.MapvLayer=gh,n.Zondy.SketchEditorCesium=Hc,n.Zondy.Screenshot=pc,n.Zondy.Popup=fc,n.Zondy.getTilingScheme=$l,n.Zondy.getProviderExtent=Zl,n.Zondy.initializeOptions=nh,n.Zondy.GeoJSONLayerUtil=ac,n.Zondy.GraphicsLayerUtil=oc,n.Zondy.IGSFeatureLayerUtil=sc,n.Zondy.WFSLayerUtil=lc,n.Zondy.CustomTilingScheme=gr,n.Zondy.MapGISM3DSet=Kc,n.Zondy.SceneViewCesium=Wc,n.Zondy.PluginVersion=n.zondy.cesium.VERSION}]);
18
+ */var an={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function on(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 sn(e,t,i){var r,n;return(r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*r+(n=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*n}function ln(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function hn(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=t[0],s=t[1],l=an.UNKNOWN;return o<i?l|=an.LEFT:o>n&&(l|=an.RIGHT),s<r?l|=an.BELOW:s>a&&(l|=an.ABOVE),l===an.UNKNOWN&&(l=an.INTERSECTING),l}function cn(e,t,i,r,n){return n?(n[0]=e,n[1]=t,n[2]=i,n[3]=r,n):[e,t,i,r]}function un(e){return cn(1/0,1/0,-1/0,-1/0,e)}function dn(e,t){var i=e[0],r=e[1];return cn(i,r,i,r,t)}function pn(e,t,i,r,n){return mn(un(n),e,t,i,r)}function fn(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 mn(e,t,i,r,n){for(;i<r;i+=n)yn(e,t[i],t[i+1]);return e}function yn(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 gn(e){return[e[0],e[1]]}function vn(e){return[e[2],e[1]]}function bn(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function _n(e){return e[3]-e[1]}function wn(e){return[e[0],e[3]]}function xn(e){return[e[2],e[3]]}function Cn(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Sn(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 cn(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 Mn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},kn={};kn[Mn.DEGREES]=2*Math.PI*6370997/360,kn[Mn.FEET]=.3048,kn[Mn.METERS]=1,kn[Mn.USFEET]=1200/3937;var Tn=Mn,In=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};In.prototype.canWrapX=function(){return this.canWrapX_},In.prototype.getCode=function(){return this.code_},In.prototype.getExtent=function(){return this.extent_},In.prototype.getUnits=function(){return this.units_},In.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||kn[this.units_]},In.prototype.getWorldExtent=function(){return this.worldExtent_},In.prototype.getAxisOrientation=function(){return this.axisOrientation_},In.prototype.isGlobal=function(){return this.global_},In.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},In.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},In.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},In.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},In.prototype.setWorldExtent=function(e){this.worldExtent_=e},In.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},In.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var On=In,En=6378137,Ln=Math.PI*En,Pn=[-Ln,-Ln,Ln,Ln],Rn=[-180,-85,180,85],jn=function(e){function t(t){e.call(this,{code:t,units:Tn.METERS,extent:Pn,global:!0,worldExtent:Rn,getPointResolution:function(e,t){return e/Qr(t[1]/En)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(On),An=[new jn("EPSG:3857"),new jn("EPSG:102100"),new jn("EPSG:102113"),new jn("EPSG:900913"),new jn("urn:ogc:def:crs:EPSG:6.18:3:3857"),new jn("urn:ogc:def:crs:EPSG::3857"),new jn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function zn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=Ln,s=0;s<r;s+=n){a[s]=o*e[s]/180;var l=En*Math.log(Math.tan(Math.PI*(e[s+1]+90)/360));l>o?l=o:l<-o&&(l=-o),a[s+1]=l}return a}function Dn(e,t,i){var r=e.length,n=i>1?i:2,a=t;void 0===a&&(a=n>2?e.slice():new Array(r));for(var o=0;o<r;o+=n)a[o]=180*e[o]/Ln,a[o+1]=360*Math.atan(Math.exp(e[o+1]/En))/Math.PI-90;return a}var Vn=[-180,-90,180,90],Nn=6378137*Math.PI/180,Gn=function(e){function t(t,i){e.call(this,{code:t,units:Tn.DEGREES,extent:Vn,axisOrientation:i,global:!0,metersPerUnit:Nn,worldExtent:Vn})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(On),Fn=[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 qn={};function Un(e,t,i){var r=e.getCode(),n=t.getCode();r in qn||(qn[r]={}),qn[r][n]=i}function Wn(e,t,i){var r;if(void 0!==t){for(var n=0,a=e.length;n<a;++n)t[n]=e[n];r=t}else r=e.slice();return r}function Hn(e,t,i){if(void 0!==t&&e!==t){for(var r=0,n=e.length;r<n;++r)t[r]=e[r];e=t}return e}function Yn(e){!function(e,t){Bn[e]=t}(e.getCode(),e),Un(e,e,Wn)}function Xn(e){return"string"==typeof e?function(e){return Bn[e]||null}(e):e||null}function Jn(e){!function(e){e.forEach(Yn)}(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Un(t,e,Wn)})})}function $n(e,t){var i=function(e,t){var i;return e in qn&&t in qn[e]&&(i=qn[e][t]),i}(e.getCode(),t.getCode());return i||(i=Hn),i}function Kn(e,t){return $n(Xn(e),Xn(t))}Jn(An),Jn(Fn),function(e,t,i,r){e.forEach(function(e){t.forEach(function(t){Un(e,t,i),Un(t,e,r)})})}(Fn,An,zn,Dn);var Zn=function(){this.dataProjection=null,this.defaultFeatureProjection=null};Zn.prototype.getReadOptions=function(e,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(e),featureProjection:t.featureProjection}),this.adaptOptions(i)},Zn.prototype.adaptOptions=function(e){return Jr({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},Zn.prototype.getLastExtent=function(){return null},Zn.prototype.getType=function(){return Fr()},Zn.prototype.readFeature=function(e,t){return Fr()},Zn.prototype.readFeatures=function(e,t){return Fr()},Zn.prototype.readGeometry=function(e,t){return Fr()},Zn.prototype.readProjection=function(e){return Fr()},Zn.prototype.writeFeature=function(e,t){return Fr()},Zn.prototype.writeFeatures=function(e,t){return Fr()},Zn.prototype.writeGeometry=function(e,t){return Fr()};var Qn=Zn;function ea(e,t,i){var r,n=i?Xn(i.featureProjection):null,a=i?Xn(i.dataProjection):null;if(r=n&&a&&!function(e,t){if(e===t)return!0;var i=e.getUnits()===t.getUnits();return e.getCode()===t.getCode()?i:$n(e,t)===Wn&&i}(n,a)?Array.isArray(e)?function(e,t,i){return Sn(e,Kn(t,i))}(e,a,n):(t?e.clone():e).transform(t?n:a,t?a:n):e,t&&i&&void 0!==i.decimals&&!Array.isArray(r)){var o=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]*o)/o;return e})}return r}var ta="arraybuffer",ia={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function ra(e,t){return e>t?1:e<t?-1:0}function na(e,t,i){for(;t<i;){var r=e[t];e[t]=e[i],e[i]=r,++t,--i}}function aa(e,t){for(var i=Array.isArray(t)?t:[t],r=i.length,n=0;n<r;n++)e[e.length]=i[n]}function oa(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}var sa="propertychange";function la(e,t,i,r){for(var n,a=0,o=e.length;a<o;++a)if((n=e[a]).listener===t&&n.bindTo===i)return r&&(n.deleteIndex=a),n}function ha(e,t){var i=ca(e);return i?i[t]:void 0}function ca(e,t){var i=e.ol_lm;return!i&&t&&(i=e.ol_lm={}),i}function ua(e,t){var i=ha(e,t);if(i){for(var r=0,n=i.length;r<n;++r)e.removeEventListener(t,i[r].boundListener),$r(i[r]);i.length=0;var a=ca(e);a&&(delete a[t],0===Object.keys(a).length&&function(e){delete e.ol_lm}(e))}}function da(e,t,i,r,n){var a=ca(e,!0),o=a[t];o||(o=a[t]=[]);var s=la(o,i,r,!1);return s?n||(s.callOnce=!1):(s={bindTo:r,callOnce:!!n,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&&ma(e),i.call(r,t)};return e.boundListener=t,t}(s)),o.push(s)),s}function pa(e,t,i,r){return da(e,t,i,r,!0)}function fa(e,t,i,r){var n=ha(e,t);if(n){var a=la(n,i,r,!0);a&&ma(a)}}function ma(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=ha(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&&ua(e.target,e.type)}$r(e)}}var ya=function(){this.disposed_=!1};ya.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},ya.prototype.disposeInternal=function(){};var ga=ya;function va(){}var ba=function(e){this.propagationStopped,this.type=e,this.target=null};ba.prototype.preventDefault=function(){this.propagationStopped=!0},ba.prototype.stopPropagation=function(){this.propagationStopped=!0};var _a=ba,wa=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 _a(e):e,i=t.type;t.target=this;var r,n=this.listeners_[i];if(n){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var a=0,o=n.length;a<o;++a)if(!1===n[a].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,va);delete this.dispatching_[i]}return r}},t.prototype.disposeInternal=function(){!function(e){var t=ca(e);if(t)for(var i in t)ua(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]=va,++this.pendingRemovals_[e]):(i.splice(r,1),0===i.length&&delete this.listeners_[e])}},t}(ga),xa="change",Ca="clear",Sa="error",Ma="load";var ka=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(xa)},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),n=0;n<i;++n)r[n]=da(this,e[n],t);return r}return da(this,e,t)},t.prototype.once=function(e,t){if(Array.isArray(e)){for(var i=e.length,r=new Array(i),n=0;n<i;++n)r[n]=pa(this,e[n],t);return r}return pa(this,e,t)},t.prototype.un=function(e,t){if(Array.isArray(e))for(var i=0,r=e.length;i<r;++i)fa(this,e[i],t);else fa(this,e,t)},t}(wa),Ta=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}(_a),Ia=function(e){function t(t){e.call(this),qr(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 Jr({},this.values_)},t.prototype.notify=function(e,t){var i;i=function(e){return Oa.hasOwnProperty(e)?Oa[e]:Oa[e]="change:"+e}(e),this.dispatchEvent(new Ta(i,e,t)),i=sa,this.dispatchEvent(new Ta(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}(ka),Oa={};var Ea=Ia;function La(e,t,i,r,n,a){for(var o=a||[],s=0,l=t;l<i;l+=r){var h=e[l],c=e[l+1];o[s++]=n[0]*h+n[2]*c+n[4],o[s++]=n[1]*h+n[3]*c+n[5]}return a&&o.length!=s&&(o.length=s),o}new Array(6);function Pa(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 Ra(e,t,i,r,n,a,o,s){var l=Math.sin(a),h=Math.cos(a);return e[0]=r*h,e[1]=n*l,e[2]=-r*l,e[3]=n*h,e[4]=o*r*h-s*r*l+t,e[5]=o*n*l+s*n*h+i,e}var ja=[1,0,0,1,0,0];function Aa(e){var t;return e==ia.XY?t=2:e==ia.XYZ||e==ia.XYM?t=3:e==ia.XYZM&&(t=4),t}var za=function(e){function t(){e.call(this),this.layout=ia.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 pn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Fr()},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()&&($r(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=Aa(e),this.layout=e,this.flatCoordinates=t},t.prototype.setCoordinates=function(e,t){Fr()},t.prototype.setLayout=function(e,t,i){var r;if(e)r=Aa(e);else{for(var n=0;n<i;++n){if(0===t.length)return this.layout=ia.XY,void(this.stride=2);t=t[0]}e=function(e){var t;2==e?t=ia.XY:3==e?t=ia.XYZ:4==e&&(t=ia.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,n,a,o){for(var s=o||[],l=Math.cos(n),h=Math.sin(n),c=a[0],u=a[1],d=0,p=t;p<i;p+=r){var f=e[p]-c,m=e[p+1]-u;s[d++]=c+f*l-m*h,s[d++]=u+f*h+m*l;for(var y=p+2;y<p+r;++y)s[d++]=e[y]}o&&s.length!=d&&(s.length=d)}(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 n=i;n||(n=bn(this.getExtent()));var a=this.getFlatCoordinates();if(a){var o=this.getStride();!function(e,t,i,r,n,a,o,s){for(var l=s||[],h=o[0],c=o[1],u=0,d=t;d<i;d+=r){var p=e[d]-h,f=e[d+1]-c;l[u++]=h+n*p,l[u++]=c+a*f;for(var m=d+2;m<d+r;++m)l[u++]=e[m]}s&&l.length!=u&&(l.length=u)}(a,0,a.length,o,e,r,n,a),this.changed()}},t.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();!function(e,t,i,r,n,a,o){for(var s=o||[],l=0,h=t;h<i;h+=r){s[l++]=e[h]+n,s[l++]=e[h+1]+a;for(var c=h+2;c<h+r;++c)s[l++]=e[c]}o&&s.length!=l&&(s.length=l)}(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 Fr()},t.prototype.closestPointXY=function(e,t,i,r){return Fr()},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 Fr()},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){Fr()},t.prototype.scale=function(e,t,i){Fr()},t.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t.prototype.getSimplifiedGeometry=function(e){return Fr()},t.prototype.getType=function(){return Fr()},t.prototype.applyTransform=function(e){Fr()},t.prototype.intersectsExtent=function(e){return Fr()},t.prototype.translate=function(e,t){Fr()},t.prototype.transform=function(e,t){var i=Xn(e),r=i.getUnits()==Tn.TILE_PIXELS?function(e,r,n){var a=i.getExtent(),o=i.getWorldExtent(),s=_n(o)/_n(a);return Ra(ja,o[0],o[3],s,-s,0,0,0),La(e,0,e.length,n,ja,r),Kn(i,t)(e,r,n)}:Kn(i,t);return this.applyTransform(r),this},t}(Ea));function Da(e,t,i,r,n,a,o){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 d=((n-l)*c+(a-h)*u)/(c*c+u*u);if(d>1)s=i;else{if(d>0){for(var p=0;p<r;++p)o[p]=rn(e[t+p],e[i+p],d);return void(o.length=r)}s=t}}for(var f=0;f<r;++f)o[f]=e[s+f];o.length=r}function Va(e,t,i,r,n){var a=e[t],o=e[t+1];for(t+=r;t<i;t+=r){var s=e[t],l=e[t+1],h=tn(a,o,s,l);h>n&&(n=h),a=s,o=l}return n}function Na(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=Va(e,t,s,r,n),t=s}return n}function Ga(e,t,i,r,n,a,o,s,l,h,c){if(t==i)return h;var u,d;if(0===n){if((d=tn(o,s,e[t],e[t+1]))<h){for(u=0;u<r;++u)l[u]=e[t+u];return l.length=r,d}return h}for(var p=c||[NaN,NaN],f=t+r;f<i;)if(Da(e,f-r,f,r,o,s,p),(d=tn(o,s,p[0],p[1]))<h){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r,f+=r}else f+=r*Math.max((Math.sqrt(d)-Math.sqrt(h))/n|0,1);if(a&&(Da(e,i-r,t,r,o,s,p),(d=tn(o,s,p[0],p[1]))<h)){for(h=d,u=0;u<r;++u)l[u]=p[u];l.length=r}return h}function Fa(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Ga(e,t,f,r,n,a,o,s,l,h,u),t=f}return h}function Ba(e,t,i,r){for(var n=0,a=i.length;n<a;++n)for(var o=i[n],s=0;s<r;++s)e[t++]=o[s];return t}function qa(e,t,i,r,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=Ba(e,t,i[s],r);a[o++]=h,t=h}return a.length=o,a}function Ua(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=t;s<i;s+=r)a[o++]=e.slice(s,s+r);return a.length=o,a}function Wa(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=Ua(e,t,h,r,a[o]),t=h}return a.length=o,a}function Ha(e,t,i,r,n){for(var a=void 0!==n?n:[],o=0,s=0,l=i.length;s<l;++s){var h=i[s];a[o++]=Wa(e,t,h,r,a[o]),t=h[h.length-1]}return a.length=o,a}function Ya(e,t,i,r,n,a){var o=NaN,s=NaN,l=(i-t)/r;if(1===l)o=e[t],s=e[t+1];else if(2==l)o=(1-n)*e[t]+n*e[t+r],s=(1-n)*e[t+1]+n*e[t+r+1];else if(0!==l){for(var h=e[t],c=e[t+1],u=0,d=[0],p=t+r;p<i;p+=r){var f=e[p],m=e[p+1];u+=Math.sqrt((f-h)*(f-h)+(m-c)*(m-c)),d.push(u),h=f,c=m}var y=n*u,g=function(e,t,i){for(var r,n,a=i||ra,o=0,s=e.length,l=!1;o<s;)(n=+a(e[r=o+(s-o>>1)],t))<0?o=r+1:(s=r,l=!n);return l?o:~o}(d,y);if(g<0){var v=(y-d[-g-2])/(d[-g-1]-d[-g-2]),b=t+(-g-2)*r;o=rn(e[b],e[b+r],v),s=rn(e[b+1],e[b+r+1],v)}else o=e[t+g*r],s=e[t+g*r+1]}return a?(a[0]=o,a[1]=s,a):[o,s]}function Xa(e,t,i,r,n,a){if(i==t)return null;var o;if(n<e[t+r-1])return a?((o=e.slice(t,t+r))[r-1]=n,o):null;if(e[i-1]<n)return a?((o=e.slice(i-r,i))[r-1]=n,o):null;if(n==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;n<e[(h+1)*r-1]?l=h:s=h+1}var c=e[s*r-1];if(n==c)return e.slice((s-1)*r,(s-1)*r+r);var u=(n-c)/(e[(s+1)*r-1]-c);o=[];for(var d=0;d<r-1;++d)o.push(rn(e[(s-1)*r+d],e[s*r+d],u));return o.push(n),o}function Ja(e,t,i,r,n){return!function(e,t,i){var r;return(r=t.call(i,gn(e)))?r:(r=t.call(i,vn(e)))?r:(r=t.call(i,xn(e)))?r:(r=t.call(i,wn(e)))||!1}(n,function(n){return!$a(e,t,i,r,n[0],n[1])})}function $a(e,t,i,r,n,a){for(var o=0,s=e[i-r],l=e[i-r+1];t<i;t+=r){var h=e[t],c=e[t+1];l<=a?c>a&&(h-s)*(a-l)-(n-s)*(c-l)>0&&o++:c<=a&&(h-s)*(a-l)-(n-s)*(c-l)<0&&o--,s=h,l=c}return 0!==o}function Ka(e,t,i,r,n,a){if(0===i.length)return!1;if(!$a(e,t,i[0],r,n,a))return!1;for(var o=1,s=i.length;o<s;++o)if($a(e,i[o-1],i[o],r,n,a))return!1;return!0}function Za(e,t,i,r,n,a){for(var o,s=[e[t],e[t+1]],l=[];t+r<i;t+=r){if(l[0]=e[t+r],l[1]=e[t+r+1],o=n.call(a,s,l))return o;s[0]=l[0],s[1]=l[1]}return!1}function Qa(e,t,i,r,n){var a=mn([1/0,1/0,-1/0,-1/0],e,t,i,r);return!!Cn(n,a)&&(!!function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}(n,a)||(a[0]>=n[0]&&a[2]<=n[2]||(a[1]>=n[1]&&a[3]<=n[3]||Za(e,t,i,r,function(e,t){return function(e,t,i){var r=!1,n=hn(e,t),a=hn(e,i);if(n===an.INTERSECTING||a===an.INTERSECTING)r=!0;else{var o,s,l=e[0],h=e[1],c=e[2],u=e[3],d=t[0],p=t[1],f=i[0],m=i[1],y=(m-p)/(f-d);a&an.ABOVE&&!(n&an.ABOVE)&&(r=(o=f-(m-u)/y)>=l&&o<=c),r||!(a&an.RIGHT)||n&an.RIGHT||(r=(s=m-(f-c)*y)>=h&&s<=u),r||!(a&an.BELOW)||n&an.BELOW||(r=(o=f-(m-h)/y)>=l&&o<=c),r||!(a&an.LEFT)||n&an.LEFT||(r=(s=m-(f-l)*y)>=h&&s<=u)}return r}(n,e,t)}))))}function eo(e,t,i,r,n){if(!function(e,t,i,r,n){return!!(Qa(e,t,i,r,n)||$a(e,t,i,r,n[0],n[1])||$a(e,t,i,r,n[0],n[3])||$a(e,t,i,r,n[2],n[1])||$a(e,t,i,r,n[2],n[3]))}(e,t,i[0],r,n))return!1;if(1===i.length)return!0;for(var a=1,o=i.length;a<o;++a)if(Ja(e,i[a-1],i[a],r,n)&&!Qa(e,i[a-1],i[a],r,n))return!1;return!0}function to(e,t,i,r){for(var n=e[t],a=e[t+1],o=0,s=t+r;s<i;s+=r){var l=e[s],h=e[s+1];o+=Math.sqrt((l-n)*(l-n)+(h-a)*(h-a)),n=l,a=h}return o}function io(e,t,i,r,n,a,o){var s=(i-t)/r;if(s<3){for(;t<i;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}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(),d=h.pop(),p=0,f=e[d],m=e[d+1],y=e[u],g=e[u+1],v=d+r;v<u;v+=r){var b=en(e[v],e[v+1],f,m,y,g);b>p&&(c=v,p=b)}p>n&&(l[(c-t)/r]=1,d+r<c&&h.push(d,c),c+r<u&&h.push(c,u))}for(var _=0;_<s;++_)l[_]&&(a[o++]=e[t+_*r],a[o++]=e[t+_*r+1]);return o}function ro(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=io(e,t,c,r,n,a,o),s.push(o),t=c}return o}function no(e,t){return t*Math.round(e/t)}function ao(e,t,i,r,n,a,o){if(t==i)return o;var s,l,h=no(e[t],n),c=no(e[t+1],n);t+=r,a[o++]=h,a[o++]=c;do{if(s=no(e[t],n),l=no(e[t+1],n),(t+=r)==i)return a[o++]=s,a[o++]=l,o}while(s==h&&l==c);for(;t<i;){var u=no(e[t],n),d=no(e[t+1],n);if(t+=r,u!=s||d!=l){var p=s-h,f=l-c,m=u-h,y=d-c;p*y==f*m&&(p<0&&m<p||p==m||p>0&&m>p)&&(f<0&&y<f||f==y||f>0&&y>f)?(s=u,l=d):(a[o++]=s,a[o++]=l,h=s,c=l,s=u,l=d)}}return a[o++]=s,a[o++]=l,o}function oo(e,t,i,r,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l];o=ao(e,t,c,r,n,a,o),s.push(o),t=c}return o}var so=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?aa(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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ga(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.forEachSegment=function(e){return Za(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinateAtM=function(e,t){if(this.layout!=ia.XYM&&this.layout!=ia.XYZM)return null;var i=void 0!==t&&t;return Xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)},t.prototype.getCoordinates=function(){return Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinateAt=function(e,t){return Ya(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t.prototype.getLength=function(){return to(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=io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,ia.XY)},t.prototype.getType=function(){return nn.LINE_STRING},t.prototype.intersectsExtent=function(e){return Qa(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=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za),lo=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 n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout()),aa(o,c.getFlatCoordinates()),s.push(o.length)}this.setFlatCoordinates(n,o),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?aa(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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))},t.prototype.getCoordinateAtM=function(e,t,i){if(this.layout!=ia.XYM&&this.layout!=ia.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,n=void 0!==i&&i;return function(e,t,i,r,n,a,o){if(o)return Xa(e,t,i[i.length-1],r,n,a);var s;if(n<e[r-1])return a?((s=e.slice(0,r))[r-1]=n,s):null;if(e[e.length-1]<n)return a?((s=e.slice(e.length-r))[r-1]=n,s):null;for(var l=0,h=i.length;l<h;++l){var c=i[l];if(t!=c){if(n<e[t+r-1])return null;if(n<=e[c-1])return Xa(e,t,c,r,n,!1);t=c}}return null}(this.flatCoordinates,0,this.ends_,this.stride,e,r,n)},t.prototype.getCoordinates=function(){return Wa(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 so(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=[],n=0,a=0,o=t.length;a<o;++a){var s=t[a],l=new so(e.slice(n,s),i);r.push(l),n=s}return r},t.prototype.getFlatMidpoints=function(){for(var e=[],t=this.flatCoordinates,i=0,r=this.ends_,n=this.stride,a=0,o=r.length;a<o;++a){var s=r[a];aa(e,Ya(t,i,s,n,.5)),i=s}return e},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=ro(this.flatCoordinates,0,this.ends_,this.stride,e,i,0,r),new t(i,ia.XY,r)},t.prototype.getType=function(){return nn.MULTI_LINE_STRING},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){if(Qa(e,t,i[a],r,n))return!0;t=i[a]}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=qa(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(za),ho=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 n=this.flatCoordinates,a=tn(e,t,n[0],n[1]);if(a<r){for(var o=this.stride,s=0;s<o;++s)i[s]=n[s];return i.length=o,a}return r},t.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t.prototype.computeExtent=function(e){return dn(this.flatCoordinates,e)},t.prototype.getType=function(){return nn.POINT},t.prototype.intersectsExtent=function(e){return ln(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 n=0,a=i.length;n<a;++n)e[t++]=i[n];return t}(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za),co=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?aa(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<sn(this.getExtent(),e,t))return r;for(var n=this.flatCoordinates,a=this.stride,o=0,s=n.length;o<s;o+=a){var l=tn(e,t,n[o],n[o+1]);if(l<r){r=l;for(var h=0;h<a;++h)i[h]=n[o+h];i.length=a}}return r},t.prototype.getCoordinates=function(){return Ua(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 ho(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=[],n=0,a=e.length;n<a;n+=i){var o=new ho(e.slice(n,n+i),t);r.push(o)}return r},t.prototype.getType=function(){return nn.MULTI_POINT},t.prototype.intersectsExtent=function(e){for(var t=this.flatCoordinates,i=this.stride,r=0,n=t.length;r<n;r+=i){if(ln(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=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za);function uo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=o*s-a*l,a=s,o=l}return n/2}function po(e,t,i,r){for(var n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=uo(e,t,s,r),t=s}return n}var fo=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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ga(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.getArea=function(){return uo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getCoordinates=function(){return Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new t(i,ia.XY)},t.prototype.getType=function(){return nn.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=Ba(this.flatCoordinates,0,e,this.stride),this.changed()},t}(za);function mo(e,t,i,r,n,a,o){for(var s,l,h,c,u,d,p,f=n[a+1],m=[],y=0,g=i.length;y<g;++y){var v=i[y];for(c=e[v-r],d=e[v-r+1],s=t;s<v;s+=r)u=e[s],p=e[s+1],(f<=d&&p<=f||d<=f&&f<=p)&&(h=(f-d)/(p-d)*(u-c)+c,m.push(h)),c=u,d=p}var b=NaN,_=-1/0;for(m.sort(ra),c=m[0],s=1,l=m.length;s<l;++s){u=m[s];var w=Math.abs(u-c);w>_&&Ka(e,t,i,r,h=(c+u)/2,f)&&(b=h,_=w),c=u}return isNaN(b)&&(b=n[a]),o?(o.push(b,f,_),o):[b,f,_]}function yo(e,t,i,r,n){for(var a=[],o=0,s=i.length;o<s;++o){var l=i[o];a=mo(e,t,l,r,n,2*o,a),t=l[l.length-1]}return a}function go(e,t,i,r){for(;t<i-r;){for(var n=0;n<r;++n){var a=e[t+n];e[t+n]=e[i-r+n],e[i-r+n]=a}t+=r,i-=r}}function vo(e,t,i,r){for(var n=0,a=e[i-r],o=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=(s-a)*(l+o),a=s,o=l}return n>0}function bo(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=vo(e,t,l,r);if(0===o){if(a&&h||!a&&!h)return!1}else if(a&&!h||!a&&h)return!1;t=l}return!0}function _o(e,t,i,r,n){for(var a=void 0!==n&&n,o=0,s=i.length;o<s;++o){var l=i[o],h=vo(e,t,l,r);(0===o?a&&h||!a&&!h:a&&!h||!a&&h)&&go(e,t,l,r),t=l}return t}function wo(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)t=_o(e,t,i[a],r,n);return t}var xo=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?aa(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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))},t.prototype.containsXY=function(e,t){return Ka(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)},t.prototype.getArea=function(){return po(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?_o(t=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,e):t=this.flatCoordinates,Wa(t,0,this.ends_,this.stride)},t.prototype.getEnds=function(){return this.ends_},t.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=bn(this.getExtent());this.flatInteriorPoint_=mo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t.prototype.getInteriorPoint=function(){return new ho(this.getFlatInteriorPoint(),ia.XYM)},t.prototype.getLinearRingCount=function(){return this.ends_.length},t.prototype.getLinearRing=function(e){return e<0||this.ends_.length<=e?null:new fo(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=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a],l=new fo(t.slice(n,s),e);r.push(l),n=s}return r},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;bo(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=_o(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=oo(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,r),new t(i,ia.XY,r)},t.prototype.getType=function(){return nn.POLYGON},t.prototype.intersectsExtent=function(e){return eo(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=qa(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},t}(za),Co=xo;function So(e,t,i,r){for(var n=[],a=[1/0,1/0,-1/0,-1/0],o=0,s=i.length;o<s;++o){var l=i[o];a=pn(e,t,l[0],r),n.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=l[l.length-1]}return n}var Mo=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 n=this.getLayout(),a=t,o=[],s=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(n=c.getLayout());for(var u=o.length,d=c.getEnds(),p=0,f=d.length;p<f;++p)d[p]+=u;aa(o,c.getFlatCoordinates()),s.push(d)}i=n,t=o,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;aa(this.flatCoordinates,e.getFlatCoordinates());for(var r=0,n=(t=e.getEnds().slice()).length;r<n;++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<sn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];n=Na(e,t,s,r,n),t=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(e,t,i,r,n,a,o,s,l,h,c){for(var u=c||[NaN,NaN],d=0,p=i.length;d<p;++d){var f=i[d];h=Fa(e,t,f,r,n,a,o,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,n,a){if(0===i.length)return!1;for(var o=0,s=i.length;o<s;++o){var l=i[o];if(Ka(e,t,l,r,n,a))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 n=0,a=0,o=i.length;a<o;++a){var s=i[a];n+=po(e,t,s,r),t=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t.prototype.getCoordinates=function(e){var t;return void 0!==e?wo(t=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,e):t=this.flatCoordinates,Ha(t,0,this.endss_,this.stride)},t.prototype.getEndss=function(){return this.endss_},t.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var e=So(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=yo(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t.prototype.getInteriorPoints=function(){return new co(this.getFlatInteriorPoints().slice(),ia.XYM)},t.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;!function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a)if(!bo(e,t,i[a],r,n))return!1;return!0}(e,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=wo(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,n,a,o,s){for(var l=0,h=i.length;l<h;++l){var c=i[l],u=[];o=oo(e,t,c,r,n,a,o,u),s.push(u),t=c[c.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),i,0,r),new t(i,ia.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(),n=r[r.length-1];if(0!==t)for(var a=0,o=r.length;a<o;++a)r[a]-=t;return new Co(this.flatCoordinates.slice(t,n),this.layout,r)},t.prototype.getPolygons=function(){for(var e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[],n=0,a=0,o=i.length;a<o;++a){var s=i[a].slice(),l=s[s.length-1];if(0!==n)for(var h=0,c=s.length;h<c;++h)s[h]-=n;var u=new Co(t.slice(n,l),e,s);r.push(u),n=l}return r},t.prototype.getType=function(){return nn.MULTI_POLYGON},t.prototype.intersectsExtent=function(e){return function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a];if(eo(e,t,s,r,n))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,n){for(var a=n||[],o=0,s=0,l=i.length;s<l;++s){var h=qa(e,t,i[s],r,a[o]);a[o++]=h,t=h[h.length-1]}return a.length=o,a}(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}(za),ko=[1,0,0,1,0,0],To=function(e,t,i,r,n){this.extent_,this.id_=n,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r};To.prototype.get=function(e){return this.properties_[e]},To.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===nn.POINT?dn(this.flatCoordinates_):pn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},To.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=bn(this.getExtent());this.flatInteriorPoints_=mo(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},To.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=So(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=yo(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},To.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Ya(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},To.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,i=this.ends_,r=0,n=i.length;r<n;++r){var a=i[r],o=Ya(e,t,a,2,.5);aa(this.flatMidpoints_,o),t=a}}return this.flatMidpoints_},To.prototype.getId=function(){return this.id_},To.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},To.prototype.getGeometry=function(){return this},To.prototype.getSimplifiedGeometry=function(e){return this},To.prototype.getProperties=function(){return this.properties_},To.prototype.getStride=function(){return 2},To.prototype.getStyleFunction=function(){},To.prototype.getType=function(){return this.type_},To.prototype.transform=function(e,t){var i=(e=Xn(e)).getExtent(),r=e.getWorldExtent(),n=_n(r)/_n(i);Ra(ko,r[0],r[3],n,-n,0,0,0),La(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ko,this.flatCoordinates_)},To.prototype.getEnds=To.prototype.getEndss=function(){return this.ends_},To.prototype.getFlatCoordinates=To.prototype.getOrientedFlatCoordinates;var Io=To;function Oo(e,t,i){if(3===e){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Eo,r,n),r.length=r.features.length,r.length&&(t[r.name]=r)}}function Eo(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,n=i.readVarint()+i.pos;i.pos<n;)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 Lo(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 n=t.layer.keys[i.readVarint()],a=t.layer.values[i.readVarint()];t.properties[n]=a}else 3==e?t.type=i.readVarint():4==e&&(t.geometry=i.pos)}function Po(e,t,i){e.pos=t.features[i];var r=e.readVarint()+e.pos,n={layer:t,type:0,properties:{}};return e.readFields(Lo,n,r),n}var Ro=function(e){function t(t){e.call(this);var i=t||{};this.dataProjection=new On({code:"",units:Tn.TILE_PIXELS}),this.featureClass_=i.featureClass?i.featureClass:Io,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 n=e.readVarint()+e.pos,a=1,o=0,s=0,l=0,h=0,c=0;e.pos<n;){if(!o){var u=e.readVarint();a=7&u,o=u>>3}o--,1===a||2===a?(s+=e.readSVarint(),l+=e.readSVarint(),1===a&&h>c&&(r.push(h),c=h),i.push(s,l),h+=2):7===a?h>c&&(i.push(i[c],i[c+1]),h+=2):Hr(!1,59)}h>c&&(r.push(h),c=h)},t.prototype.createFeature_=function(e,t,i){var r,n=t.type;if(0===n)return null;var a=t.id,o=t.properties;o[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?nn.POINT:nn.MULTI_POINT:2===e?i=1===t?nn.LINE_STRING:nn.MULTI_LINE_STRING:3===e&&(i=nn.POLYGON);return i}(n,l.length);if(this.featureClass_===Io)r=new this.featureClass_(h,s,l,o,a);else{var c;if(h==nn.POLYGON){for(var u=[],d=0,p=0,f=0,m=l.length;f<m;++f){var y=l[f];vo(s,d,y,2)||(u.push(l.slice(p,f)),p=f),d=y}c=u.length>1?new Mo(s,ia.XY,u):new Co(s,ia.XY,l)}else c=h===nn.POINT?new ho(s,ia.XY):h===nn.LINE_STRING?new so(s,ia.XY):h===nn.POLYGON?new Co(s,ia.XY,l):h===nn.MULTI_POINT?new co(s,ia.XY):h===nn.MULTI_LINE_STRING?new lo(s,ia.XY,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var g=ea(c,!1,this.adaptOptions(i));r.setGeometry(g),r.setId(a),r.setProperties(o)}return r},t.prototype.getLastExtent=function(){return this.extent_},t.prototype.getType=function(){return ta},t.prototype.readFeatures=function(e,t){var i=this.layers_,r=new Xr.a(e),n=r.readFields(Oo,{}),a=[];for(var o in n)if(!i||-1!=i.indexOf(o)){for(var s=n[o],l=0,h=s.length;l<h;++l){var c=Po(r,s,l);a.push(this.createFeature_(r,c))}this.extent_=s?[0,0,s.extent,s.extent]:null}return a},t.prototype.readProjection=function(e){return this.dataProjection},t.prototype.setLayers=function(e){this.layers_=e},t}(Qn);function jo(e,t){var i=document.createElement("canvas");return e&&(i.width=e),t&&(i.height=t),i.getContext("2d")}var Ao=function(){};Ao.prototype.getReplay=function(e,t){return Fr()},Ao.prototype.isEmpty=function(){return Fr()},Ao.prototype.addDeclutter=function(e){return Fr()};var zo=Ao,Do={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},Vo=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,No=/^([a-z]*)$/i;function Go(e){return"string"==typeof e?e:qo(e)}var Fo=function(){var e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){var n=0;for(var a in e)0==(3&n++)&&(delete e[a],--t)}r=function(e){var t,i,r,n,a;No.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(Vo.exec(e)){var o,s=e.length-1;o=s<=4?1:2;var l=4===s||8===s;t=parseInt(e.substr(1+0*o,o),16),i=parseInt(e.substr(1+1*o,o),16),r=parseInt(e.substr(1+2*o,o),16),n=l?parseInt(e.substr(1+3*o,o),16):255,1==o&&(t=(t<<4)+t,i=(i<<4)+i,r=(r<<4)+r,l&&(n=(n<<4)+n)),a=[t,i,r,n/255]}else 0==e.indexOf("rgba(")?Bo(a=e.slice(5,-1).split(",").map(Number)):0==e.indexOf("rgb(")?((a=e.slice(4,-1).split(",").map(Number)).push(1),Bo(a)):Hr(!1,14);return a}(i),e[i]=r,++t}return r}}();function Bo(e){return e[0]=Zr(e[0]+.5|0,0,255),e[1]=Zr(e[1]+.5|0,0,255),e[2]=Zr(e[2]+.5|0,0,255),e[3]=Zr(e[3],0,1),e}function qo(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 Uo(e){return Array.isArray(e)?qo(e):e}function Wo(e,t,i,r,n,a,o,s){for(var l,h,c,u=[],d=e[t]>e[i-r],p=n.length,f=e[t],m=e[t+1],y=e[t+=r],g=e[t+1],v=0,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2)),_="",w=0,x=0;x<p;++x){h=d?p-x-1:x;var C=n.charAt(h),S=a(_=d?C+_:_+C)-w;w+=S;for(var M=o+S/2;t<i-r&&v+b<M;)f=y,m=g,y=e[t+=r],g=e[t+1],v+=b,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2));var k=M-v,T=Math.atan2(g-m,y-f);if(d&&(T+=T>0?-Math.PI:Math.PI),void 0!==c){var I=T-c;if(I+=I>Math.PI?-2*Math.PI:I<-Math.PI?2*Math.PI:0,Math.abs(I)>s)return null}var O=k/b,E=rn(f,y,O),L=rn(m,g,O);c==T?(d&&(l[0]=E,l[1]=L,l[2]=S/2),l[4]=_):(w=S,l=[E,L,S/2,T,_=C],d?u.unshift(l):u.push(l),c=T),o+=S}return u}var Ho="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Yo=(Ho.indexOf("firefox"),-1!==Ho.indexOf("safari")&&Ho.indexOf("chrom"),-1!==Ho.indexOf("webkit")&&Ho.indexOf("edge"),Ho.indexOf("macintosh"),window.devicePixelRatio,function(){var e=!1;try{e=!!document.createElement("canvas").getContext("2d").setLineDash}catch(e){}return e}()),Xo=(navigator,window,window,navigator.msPointerEnabled,function(){});Xo.prototype.drawCustom=function(e,t,i){},Xo.prototype.drawGeometry=function(e){},Xo.prototype.setStyle=function(e){},Xo.prototype.drawCircle=function(e,t){},Xo.prototype.drawFeature=function(e,t){},Xo.prototype.drawGeometryCollection=function(e,t){},Xo.prototype.drawLineString=function(e,t){},Xo.prototype.drawMultiLineString=function(e,t){},Xo.prototype.drawMultiPoint=function(e,t){},Xo.prototype.drawMultiPolygon=function(e,t){},Xo.prototype.drawPoint=function(e,t){},Xo.prototype.drawPolygon=function(e,t){},Xo.prototype.drawText=function(e,t){},Xo.prototype.setFillStrokeStyle=function(e,t){},Xo.prototype.setImageStyle=function(e,t){},Xo.prototype.setTextStyle=function(e,t){};var Jo=Xo,$o=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]}}(),Ko=[0,0,0,1],Zo=[],Qo=[0,0,0,1],es=[0,0,0,0],ts=new(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(Ca)},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 Hr(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 Hr(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){Hr(!(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}(wa)),is={},rs=null,ns={},as=function(){var e,t,i=60,r=is,n="32px ",a=["monospace","serif"],o=a.length,s="wmytzilWMYTZIL@#/&?$%10";function l(e){for(var i=os(),r=100;r<=700;r+=300){for(var l=r+" ",h=!0,c=0;c<o;++c){var u=a[c];if(i.font=l+n+u,t=i.measureText(s).width,e!=u){i.font=l+n+e+","+u;var d=i.measureText(s).width;h=h&&d!=t}}if(h)return!0}return!1}function h(){var t=!0;for(var n in r)r[n]<i&&(l(n)?(r[n]=i,$r(ns),rs=null,ts.clear()):(++r[n],t=!1));t&&(clearInterval(e),e=void 0)}return function(t){var n=$o(t);if(n)for(var a=0,o=n.length;a<o;++a){var s=n[a];s in r||(r[s]=i,l(s)||(r[s]=0,void 0===e&&(e=setInterval(h,32))))}}}();function os(){return rs||(rs=jo(1,1)),rs}var ss=function(){var e,t=ns;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 ls(e,t){var i=os();return e!=i.font&&(i.font=e),i.measureText(t).width}var hs=[1,0,0,1,0,0];function cs(e,t,i,r,n,a,o,s,l,h,c){var u;1!=i&&(u=e.globalAlpha,e.globalAlpha=u*i),t&&e.setTransform.apply(e,t),e.drawImage(r,n,a,o,s,l,h,o*c,s*c),u&&(e.globalAlpha=u),t&&e.setTransform.apply(e,hs)}var us={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},ds=[us.FILL],ps=[us.STROKE],fs=[us.BEGIN_PATH],ms=[us.CLOSE_PATH],ys=us,gs=[Do.POLYGON,Do.CIRCLE,Do.LINE_STRING,Do.IMAGE,Do.TEXT,Do.DEFAULT],vs={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},bs=[1/0,1/0,-1/0,-1/0],_s=[1,0,0,1,0,0],ws=function(e){function t(t,i,r,n,a,o){e.call(this),this.declutterTree=o,this.tolerance=t,this.maxExtent=i,this.overlaps=a,this.pixelRatio=n,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,n,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,n),e.lineTo.apply(e,t),a&&(this.alignFill_=a[2],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())},t.prototype.replayImage_=function(e,t,i,r,n,a,o,s,l,h,c,u,d,p,f,m,y,g){var v=y||g;t-=n*=d,i-=a*=d;var b,_,w,x,C=f+h>r.width?r.width-h:f,S=s+c>r.height?r.height-c:s,M=m[3]+C*d+m[1],k=m[0]+S*d+m[2],T=t-m[3],I=i-m[0];(v||0!==u)&&(b=[T,I],_=[T+M,I],w=[T+M,I+k],x=[T,I+k]);var O=null;if(0!==u){var E=t+n,L=i+a;O=Ra(_s,E,L,1,1,u,-E,-L),un(bs),fn(bs,Pa(_s,b)),fn(bs,Pa(_s,_)),fn(bs,Pa(_s,w)),fn(bs,Pa(_s,x))}else cn(T,I,T+M,I+k,bs);var P=e.canvas,R=g?g[2]*d/2:0,j=bs[0]-R<=P.width&&bs[2]+R>=0&&bs[1]-R<=P.height&&bs[3]+R>=0;if(p&&(t=Math.round(t),i=Math.round(i)),o){if(!j&&1==o[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])}(o,bs);var A=j?[e,O?O.slice(0):null,l,r,h,c,C,S,t,i,d]:null;A&&v&&A.push(y,g,b,_,w,x),o.push(A)}else j&&(v&&this.replayTextBackground_(e,b,_,w,x,y,g),cs(e,O,l,r,h,c,C,S,t,i,d))},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,n,a){var o=this.coordinates.length,s=this.getBufferedMaxExtent();a&&(t+=r);var l,h,c,u=[e[t],e[t+1]],d=[NaN,NaN],p=!0;for(l=t+r;l<i;l+=r)d[0]=e[l],d[1]=e[l+1],(c=hn(s,d))!==h?(p&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):c===an.INTERSECTING?(this.coordinates[o++]=d[0],this.coordinates[o++]=d[1],p=!1):p=!0,u[0]=d[0],u[1]=d[1],h=c;return(n&&p||l===t+r)&&(this.coordinates[o++]=u[0],this.coordinates[o++]=u[1]),o},t.prototype.drawCustomCoordinates_=function(e,t,i,r,n){for(var a=0,o=i.length;a<o;++a){var s=i[a],l=this.appendFlatCoordinates(e,t,s,r,!1,!1);n.push(l),t=s}return t},t.prototype.drawCustom=function(e,t,i){this.beginGeometry(e,t);var r,n,a,o,s,l=e.getType(),h=e.getStride(),c=this.coordinates.length;if(l==nn.MULTI_POLYGON){r=(e=e).getOrientedFlatCoordinates(),o=[];var u=e.getEndss();s=0;for(var d=0,p=u.length;d<p;++d){var f=[];s=this.drawCustomCoordinates_(r,s,u[d],h,f),o.push(f)}this.instructions.push([ys.CUSTOM,c,o,e,i,Ha])}else l==nn.POLYGON||l==nn.MULTI_LINE_STRING?(a=[],r=l==nn.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,e.getEnds(),h,a),this.instructions.push([ys.CUSTOM,c,a,e,i,Wa])):l==nn.LINE_STRING||l==nn.MULTI_POINT?(r=e.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([ys.CUSTOM,c,n,e,i,Ua])):l==nn.POINT&&(r=e.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([ys.CUSTOM,c,n,e,i]));this.endGeometry(e,t)},t.prototype.beginGeometry=function(e,t){this.beginGeometryInstruction1_=[ys.BEGIN_GEOMETRY,t,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ys.BEGIN_GEOMETRY,t,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){},t.prototype.fill_=function(e){if(this.alignFill_){var t=Pa(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,hs)},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],Yo&&(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 n=5,a=e.length;n<a;++n){var o=e[n];o&&(o.length>11&&this.replayTextBackground_(o[0],o[13],o[14],o[15],o[16],o[11],o[12]),cs.apply(void 0,o))}}e.length=5,un(e)}}},t.prototype.replay_=function(e,t,i,r,n,a,o){var s;this.pixelCoordinates_&&oa(t,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=La(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,d,p,f,m,y,g,v,b,_=!Kr(i),w=0,x=r.length,C=0,S=0,M=0,k=null,T=null,I=this.coordinateCache_,O=this.viewRotation_,E={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:O},L=this.instructions!=r||this.overlaps?0:200;w<x;){var P=r[w];switch(P[0]){case ys.BEGIN_GEOMETRY:g=P[1],_&&i[qr(g)]||!g.getGeometry()?w=P[2]:void 0===o||Cn(o,g.getGeometry().getExtent())?++w:w=P[2]+1;break;case ys.BEGIN_PATH:S>L&&(this.fill_(e),S=0),M>L&&(e.stroke(),M=0),S||M||(e.beginPath(),u=d=NaN),++w;break;case ys.CIRCLE:var R=s[C=P[1]],j=s[C+1],A=s[C+2]-R,z=s[C+3]-j,D=Math.sqrt(A*A+z*z);e.moveTo(R+D,j),e.arc(R,j,D,0,2*Math.PI,!0),++w;break;case ys.CLOSE_PATH:e.closePath(),++w;break;case ys.CUSTOM:C=P[1],l=P[2];var V=P[3],N=P[4],G=6==P.length?P[5]:void 0;E.geometry=V,E.feature=g,w in I||(I[w]=[]);var F=I[w];G?G(s,C,l,2,F):(F[0]=s[C],F[1]=s[C+1],F.length=2),N(F,E),++w;break;case ys.DRAW_IMAGE:C=P[1],l=P[2],y=P[3],h=P[4],c=P[5],m=a?null:P[6];var B=P[7],q=P[8],U=P[9],W=P[10],H=P[11],Y=P[12],X=P[13],J=P[14],$=void 0,K=void 0,Z=void 0;for(P.length>16?($=P[15],K=P[16],Z=P[17]):($=es,K=Z=!1),H&&(Y+=O);C<l;C+=2)this.replayImage_(e,s[C],s[C+1],y,h,c,m,B,q,U,W,Y,X,n,J,$,K?k:null,Z?T:null);this.renderDeclutter_(m,g),++w;break;case ys.DRAW_CHARS:var Q=P[1],ee=P[2],te=P[3];m=a?null:P[4];var ie=P[5],re=P[6],ne=P[7],ae=P[8],oe=P[9],se=P[10],le=P[11],he=P[12],ce=P[13],ue=P[14],de=to(s,Q,ee,2),pe=ae(he);if(ie||pe<=de){var fe=this.textStates[ce].textAlign,me=Wo(s,Q,ee,2,he,ae,(de-pe)*vs[fe],ne);if(me){var ye=void 0,ge=void 0,ve=void 0,be=void 0,_e=void 0;if(se)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,"",se),h=_e[2]+le,c=te*be.height+2*(.5-te)*le-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,es,null,null);if(re)for(ye=0,ge=me.length;ye<ge;++ye)ve=(_e=me[ye])[4],be=this.getImage(ve,ce,re,""),h=_e[2],c=te*be.height-oe,this.replayImage_(e,_e[0],_e[1],be,h,c,m,be.height,1,0,0,_e[3],ue,!1,be.width,es,null,null)}}this.renderDeclutter_(m,g),++w;break;case ys.END_GEOMETRY:if(void 0!==a){var we=a(g=P[1]);if(we)return we}++w;break;case ys.FILL:L?S++:this.fill_(e),++w;break;case ys.MOVE_TO_LINE_TO:for(C=P[1],l=P[2],v=s[C],f=(b=s[C+1])+.5|0,(p=v+.5|0)===u&&f===d||(e.moveTo(v,b),u=p,d=f),C+=2;C<l;C+=2)p=(v=s[C])+.5|0,f=(b=s[C+1])+.5|0,C!=l-2&&p===u&&f===d||(e.lineTo(v,b),u=p,d=f);++w;break;case ys.SET_FILL_STYLE:k=P,this.alignFill_=P[2],S&&(this.fill_(e),S=0,M&&(e.stroke(),M=0)),e.fillStyle=P[1],++w;break;case ys.SET_STROKE_STYLE:T=P,M&&(e.stroke(),M=0),this.setStrokeStyle_(e,P),++w;break;case ys.STROKE:L?M++:e.stroke(),++w;break;default:++w}}S&&this.fill_(e),M&&e.stroke()},t.prototype.replay=function(e,t,i,r,n){this.viewRotation_=i,this.replay_(e,t,r,this.instructions,n,void 0,void 0)},t.prototype.replayHitDetection=function(e,t,i,r,n,a){return this.viewRotation_=i,this.replay_(e,t,r,this.hitDetectionInstructions,!0,n,a)},t.prototype.reverseHitDetectionInstructions=function(){var e,t=this.hitDetectionInstructions;t.reverse();var i,r,n=t.length,a=-1;for(e=0;e<n;++e)(r=(i=t[e])[0])==ys.END_GEOMETRY?a=e:r==ys.BEGIN_GEOMETRY&&(i[2]=e,na(this.hitDetectionInstructions,a,e),a=-1)},t.prototype.setFillStrokeStyle=function(e,t){var i=this.state;if(e){var r=e.getColor();i.fillStyle=Uo(r||Ko)}else i.fillStyle=void 0;if(t){var n=t.getColor();i.strokeStyle=Uo(n||Qo);var a=t.getLineCap();i.lineCap=void 0!==a?a:"round";var o=t.getLineDash();i.lineDash=o?o.slice():Zo;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=[ys.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[ys.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,n=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||n!=e.currentLineDash&&!oa(e.currentLineDash,n)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=l)&&(void 0!==i&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=n,e.currentLineDashOffset=a,e.currentLineJoin=o,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=[ys.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;on(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(Jo),xs=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),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(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ys.DRAW_IMAGE,n,a,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([ys.DRAW_IMAGE,n,a,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(),n=this.coordinates.length,a=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([ys.DRAW_IMAGE,n,a,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([ys.DRAW_IMAGE,n,a,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(),n=e.getHitDetectionImage(1),a=e.getImage(1),o=e.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=t,this.hitDetectionImage_=n,this.image_=a,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScale(),this.width_=r[0]},t}(ws),Cs=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}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 n=this.coordinates.length,a=this.appendFlatCoordinates(e,t,i,r,!1,!1),o=[ys.MOVE_TO_LINE_TO,n,a];return this.instructions.push(o),this.hitDetectionInstructions.push(o),i},t.prototype.drawLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fs);var a=e.getFlatCoordinates(),o=e.getStride();this.drawFlatCoordinates_(a,0,a.length,o),this.hitDetectionInstructions.push(ps),this.endGeometry(e,t)}},t.prototype.drawMultiLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fs);for(var a=e.getEnds(),o=e.getFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinates_(o,l,a[h],s);this.hitDetectionInstructions.push(ps),this.endGeometry(e,t)}},t.prototype.finish=function(){var e=this.state;void 0!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ps),this.reverseHitDetectionInstructions(),this.state=null},t.prototype.applyStroke=function(t){void 0!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(ps),t.lastStroke=this.coordinates.length),t.lastStroke=0,e.prototype.applyStroke.call(this,t),this.instructions.push(fs)},t}(ws),Ss=function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o)}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 n=this.state,a=void 0!==n.fillStyle,o=void 0!=n.strokeStyle,s=i.length;this.instructions.push(fs),this.hitDetectionInstructions.push(fs);for(var l=0;l<s;++l){var h=i[l],c=this.coordinates.length,u=this.appendFlatCoordinates(e,t,h,r,!0,!o),d=[ys.MOVE_TO_LINE_TO,c,u];this.instructions.push(d),this.hitDetectionInstructions.push(d),o&&(this.instructions.push(ms),this.hitDetectionInstructions.push(ms)),t=h}return a&&(this.instructions.push(ds),this.hitDetectionInstructions.push(ds)),o&&(this.instructions.push(ps),this.hitDetectionInstructions.push(ps)),t},t.prototype.drawCircle=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getFlatCoordinates(),o=e.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(a,0,a.length,o,!1,!1);var l=[ys.CIRCLE,s];this.instructions.push(fs,l),this.hitDetectionInstructions.push(fs,l),this.hitDetectionInstructions.push(ds),void 0!==i.fillStyle&&this.instructions.push(ds),void 0!==i.strokeStyle&&(this.instructions.push(ps),this.hitDetectionInstructions.push(ps)),this.endGeometry(e,t)}},t.prototype.drawPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var a=e.getEnds(),o=e.getOrientedFlatCoordinates(),s=e.getStride();this.drawFlatCoordinatess_(o,0,a,s),this.endGeometry(e,t)}},t.prototype.drawMultiPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ys.SET_FILL_STYLE,Go(Ko)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ys.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var a=e.getEndss(),o=e.getOrientedFlatCoordinates(),s=e.getStride(),l=0,h=0,c=a.length;h<c;++h)l=this.drawFlatCoordinatess_(o,l,a[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]=no(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}(ws);function Ms(e,t,i,r,n){var a,o,s,l,h,c,u,d,p,f=i,m=i,y=0,g=0,v=i;for(a=i;a<r;a+=n){var b=t[a],_=t[a+1];void 0!==l&&(d=b-l,p=_-h,s=Math.sqrt(d*d+p*p),void 0!==c&&(g+=o,Math.acos((c*d+u*p)/(o*s))>e&&(g>y&&(y=g,f=v,m=a),g=0,v=a-n)),o=s,c=d,u=p),l=b,h=_}return(g+=s)>y?[v,a]:[f,m]}var ks="point",Ts="line";var Is={Circle:Ss,Default:ws,Image:xs,LineString:Cs,Polygon:Ss,Text:function(e){function t(t,i,r,n,a,o){e.call(this,t,i,r,n,a,o),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_={},ts.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_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var a,o,s=this.coordinates.length,l=e.getType(),h=null,c=2,u=2;if(n.placement===Ts){if(!Cn(this.getBufferedMaxExtent(),e.getExtent()))return;var d;if(h=e.getFlatCoordinates(),u=e.getStride(),l==nn.LINE_STRING)d=[h.length];else if(l==nn.MULTI_LINE_STRING)d=e.getEnds();else if(l==nn.POLYGON)d=e.getEnds().slice(0,1);else if(l==nn.MULTI_POLYGON){var p=e.getEndss();for(d=[],a=0,o=p.length;a<o;++a)d.push(p[a][0])}this.beginGeometry(e,t);for(var f,m=n.textAlign,y=0,g=0,v=d.length;g<v;++g){if(void 0==m){var b=Ms(n.maxAngle,h,y,d[g],u);y=b[0],f=b[1]}else f=d[g];for(a=y;a<f;a+=u)this.coordinates.push(h[a],h[a+1]);c=this.coordinates.length,y=d[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 nn.POINT:case nn.MULTI_POINT:c=(h=e.getFlatCoordinates()).length;break;case nn.LINE_STRING:h=e.getFlatMidpoint();break;case nn.CIRCLE:h=e.getCenter();break;case nn.MULTI_LINE_STRING:c=(h=e.getFlatMidpoints()).length;break;case nn.POLYGON:if(h=e.getFlatInteriorPoint(),!n.overflow&&h[2]/this.resolution<w)return;u=3;break;case nn.MULTI_POLYGON:var x=e.getFlatInteriorPoints();for(h=[],a=0,o=x.length;a<o;a+=3)(n.overflow||x[a+2]/this.resolution>=w)&&h.push(x[a],x[a+1]);if(0==(c=h.length))return}c=this.appendFlatCoordinates(h,0,c,u,!1,!1),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,e),this.hitDetectionInstructions.push(this.createFill(this.state,e))),n.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 n,a=r+t+e+i+this.pixelRatio;if(!ts.containsKey(a)){var o=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=vs[l.textAlign||"center"],d=r&&o.lineWidth?o.lineWidth:0,p=e.split("\n"),f=p.length,m=[],y=function(e,t,i){for(var r=t.length,n=0,a=0;a<r;++a){var o=ls(e,t[a]);n=Math.max(n,o),i.push(o)}return n}(l.font,p,m),g=ss(l.font),v=g*f,b=y+d,_=jo(Math.ceil(b*c),Math.ceil((v+d)*c));n=_.canvas,ts.set(a,n),1!=c&&_.scale(c,c),_.font=l.font,r&&(_.strokeStyle=o.strokeStyle,_.lineWidth=d,_.lineCap=o.lineCap,_.lineJoin=o.lineJoin,_.miterLimit=o.miterLimit,Yo&&o.lineDash.length&&(_.setLineDash(o.lineDash),_.lineDashOffset=o.lineDashOffset)),i&&(_.fillStyle=s.fillStyle),_.textBaseline="middle",_.textAlign="center";var w,x=.5-u,C=u*n.width/c+x*d;if(r)for(w=0;w<f;++w)_.strokeText(p[w],C+x*m[w],.5*(d+g)+w*g);if(i)for(w=0;w<f;++w)_.fillText(p[w],C+x*m[w],.5*(d+g)+w*g)}return ts.get(a)},t.prototype.drawTextImage_=function(e,t,i){var r=this.textState_,n=this.textStrokeState_,a=this.pixelRatio,o=vs[r.textAlign||"center"],s=vs[r.textBaseline],l=n&&n.lineWidth?n.lineWidth:0,h=o*e.width/a+2*(.5-o)*l,c=s*e.height/a+2*(.5-s)*l;this.instructions.push([ys.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,e.width,r.padding==es?es:r.padding.map(function(e){return e*a}),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([ys.DRAW_IMAGE,t,i,e,(h-this.textOffsetX_)*a,(c-this.textOffsetY_)*a,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/a,e.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t.prototype.drawChars_=function(e,t,i){var r=this.textStrokeState_,n=this.textState_,a=this.textFillState_,o=this.strokeKey_;r&&(o in this.strokeStates||(this.strokeStates[o]={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:n.font,textAlign:n.textAlign||"center",scale:n.scale});var l=this.fillKey_;a&&(l in this.fillStates||(this.fillStates[l]={fillStyle:a.fillStyle}));var h=this.pixelRatio,c=vs[n.textBaseline],u=this.textOffsetY_*h,d=this.text_,p=n.font,f=n.scale,m=r?r.lineWidth*f/2:0,y=this.widths_[p];y||(this.widths_[p]=y={}),this.instructions.push([ys.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ls(p,e)),t*f*h},u,o,m*h,d,s,1]),this.hitDetectionInstructions.push([ys.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=y[e];return t||(t=y[e]=ls(p,e)),t*f},u,o,m,d,s,1/h])},t.prototype.setTextStyle=function(e,t){var i,r,n;if(e){this.declutterGroup_=t;var a=e.getFill();a?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=Uo(a.getColor()||Ko)):r=this.textFillState_=null;var o=e.getStroke();if(o){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var s=o.getLineDash(),l=o.getLineDashOffset(),h=o.getWidth(),c=o.getMiterLimit();n.lineCap=o.getLineCap()||"round",n.lineDash=s?s.slice():Zo,n.lineDashOffset=void 0===l?0:l,n.lineJoin=o.getLineJoin()||"round",n.lineWidth=void 0===h?1:h,n.miterLimit=void 0===c?10:c,n.strokeStyle=Uo(o.getColor()||Qo)}else n=this.textStrokeState_=null;i=this.textState_;var u=e.getFont()||"10px sans-serif";as(u);var d=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()||es,i.scale=void 0===d?1:d;var p=e.getOffsetX(),f=e.getOffsetY(),m=e.getRotateWithView(),y=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===p?0:p,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==m&&m,this.textRotation_=void 0===y?0:y,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:qr(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+qr(r.fillStyle):""}else this.text_=""},t}(ws)},Os=function(e){function t(t,i,r,n,a,o,s){e.call(this),this.declutterTree_=o,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=a,this.pixelRatio_=n,this.resolution_=r,this.renderBuffer_=s,this.replaysByZIndex_={},this.hitDetectionContext_=jo(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,n=e.length;r<n;++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,n,a,o){var s,l=2*(r=Math.round(r))+1,h=Ra(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_&&(fn(s=[1/0,1/0,-1/0,-1/0],e),on(s,t*(this.renderBuffer_+r),s));var u,d,p=function(e){if(void 0!==Es[e])return Es[e];for(var t=2*e+1,i=new Array(t),r=0;r<t;r++)i[r]=new Array(t);var n=e,a=0,o=0;for(;n>=a;)Ls(i,e+n,e+a),Ls(i,e+a,e+n),Ls(i,e-a,e+n),Ls(i,e-n,e+a),Ls(i,e-n,e-a),Ls(i,e-a,e-n),Ls(i,e+a,e-n),Ls(i,e+n,e-a),2*((o+=1+2*++a)-n)+1>0&&(o+=1-2*(n-=1));return Es[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(p[i][r]&&t[4*(r*l+i)+3]>0){var n=void 0;return(!u||d!=Do.IMAGE&&d!=Do.TEXT||-1!==u.indexOf(e))&&(n=a(e)),n||void c.clearRect(0,0,l,l)}}this.declutterTree_&&(u=this.declutterTree_.all().map(function(e){return e.value}));var m,y,g,v,b,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort(ra),m=_.length-1;m>=0;--m){var w=_[m].toString();for(g=this.replaysByZIndex_[w],y=gs.length-1;y>=0;--y)if(void 0!==(v=g[d=gs[y]]))if(!o||d!=Do.IMAGE&&d!=Do.TEXT){if(b=v.replayHitDetection(c,h,i,n,f,s))return b}else{var x=o[w];x?x.push(v,h.slice(0)):o[w]=[v,h.slice(0)]}}},t.prototype.getClipCoords=function(e){var t=this.maxExtent_,i=t[0],r=t[1],n=t[2],a=t[3],o=[i,r,i,a,n,a,n,r];return La(o,0,8,2,e,o),o},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 n=r[t];void 0===n&&(n=new(0,Is[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[t]=n);return n},t.prototype.getReplays=function(){return this.replaysByZIndex_},t.prototype.isEmpty=function(){return Kr(this.replaysByZIndex_)},t.prototype.replay=function(e,t,i,r,n,a,o){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(ra),e.save(),this.clip(e,t);var l,h,c,u,d,p,f=a||gs;for(l=0,h=s.length;l<h;++l){var m=s[l].toString();for(d=this.replaysByZIndex_[m],c=0,u=f.length;c<u;++c){var y=f[c];if(p=d[y],void 0!==p)if(!o||y!=Do.IMAGE&&y!=Do.TEXT)p.replay(e,t,i,r,n);else{var g=o[m];g?g.push(p,t.slice(0)):o[m]=[p,t.slice(0)]}}}e.restore()},t}(zo),Es={0:[[!0]]};function Ls(e,t,i){var r,n=Math.floor(e.length/2);if(t>=n)for(r=n;r<t;r++)e[r][i]=!0;else if(t<n)for(r=t+1;r<n;r++)e[r][i]=!0}var Ps=Os,Rs={IDLE:0,LOADING:1,LOADED:2,ERROR:3},js={Point:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Rs.LOADED)return;var a=e.getReplay(i.getZIndex(),Do.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},LineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Do.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},Polygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Do.POLYGON);o.setFillStrokeStyle(n,a),o.drawPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},MultiPoint:function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=Rs.LOADED)return;var a=e.getReplay(i.getZIndex(),Do.IMAGE);a.setImageStyle(n,e.addDeclutter(!1)),a.drawMultiPoint(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!!n)),s.drawText(t,r)}},MultiLineString:function(e,t,i,r){var n=i.getStroke();if(n){var a=e.getReplay(i.getZIndex(),Do.LINE_STRING);a.setFillStrokeStyle(null,n),a.drawMultiLineString(t,r)}var o=i.getText();if(o){var s=e.getReplay(i.getZIndex(),Do.TEXT);s.setTextStyle(o,e.addDeclutter(!1)),s.drawText(t,r)}},MultiPolygon:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(a||n){var o=e.getReplay(i.getZIndex(),Do.POLYGON);o.setFillStrokeStyle(n,a),o.drawMultiPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},GeometryCollection:function(e,t,i,r){var n,a,o=t.getGeometriesArray();for(n=0,a=o.length;n<a;++n){var s=js[o[n].getType()];s(e,o[n],i,r)}},Circle:function(e,t,i,r){var n=i.getFill(),a=i.getStroke();if(n||a){var o=e.getReplay(i.getZIndex(),Do.CIRCLE);o.setFillStrokeStyle(n,a),o.drawCircle(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),Do.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}}};function As(e,t,i,r,n,a){var o=!1,s=i.getImage();if(s){var l=s.getImageState();l==Rs.LOADED||l==Rs.ERROR?s.unlistenImageChange(n,a):(l==Rs.IDLE&&s.load(),l=s.getImageState(),s.listenImageChange(n,a),o=!0)}return function(e,t,i,r){var n=i.getGeometryFunction()(t);if(!n)return;var a=n.getSimplifiedGeometry(r);if(i.getRenderer())!function e(t,i,r,n){if(i.getType()==nn.GEOMETRY_COLLECTION){for(var a=i.getGeometries(),o=0,s=a.length;o<s;++o)e(t,a[o],r,n);return}var l=t.getReplay(r.getZIndex(),Do.DEFAULT);l.drawCustom(i,n,r.getRenderer())}(e,a,i,t);else{var o=js[a.getType()];o(e,a,i,t)}}(e,t,i,r),o}var zs=class{constructor(){this.queue=[]}push(e){this.queue.push(e)}remove(e){for(let t=0;t<this.queue.length;t++){const i=this.queue[t];if(i.x===e.x&&i.y===e.y&&i.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++){const 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}},Ds=i(4),Vs=i(7);function Ns(e,t){let i;return e.some(function(e){if(e.id==t)return i=e.source,!0}),i}const Gs=/font-family: ?([^;]*);/,Fs=/("|')/g;let Bs;const qs={},Us=i.n(Vs).a.getNames();function Ws(e){if(e in qs)return qs[e];const t=e.map(function(e){return mb2css(e,1).split(" 1px ")[1].replace(/"/g,"")})[0];if(!function(e){if(!Bs){Bs={};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(Gs);Bs[e[1].replace(Fs,"")]=!0}}}catch(e){}}}return e in Bs}(t)&&-1!==Us.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}var Hs=function(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale};Hs.prototype.clone=function(){return new Hs({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Hs.prototype.getOpacity=function(){return this.opacity_},Hs.prototype.getRotateWithView=function(){return this.rotateWithView_},Hs.prototype.getRotation=function(){return this.rotation_},Hs.prototype.getScale=function(){return this.scale_},Hs.prototype.getSnapToPixel=function(){return!1},Hs.prototype.getAnchor=function(){return Fr()},Hs.prototype.getImage=function(e){return Fr()},Hs.prototype.getHitDetectionImage=function(e){return Fr()},Hs.prototype.getImageState=function(){return Fr()},Hs.prototype.getImageSize=function(){return Fr()},Hs.prototype.getHitDetectionImageSize=function(){return Fr()},Hs.prototype.getOrigin=function(){return Fr()},Hs.prototype.getSize=function(){return Fr()},Hs.prototype.setOpacity=function(e){this.opacity_=e},Hs.prototype.setRotateWithView=function(e){this.rotateWithView_=e},Hs.prototype.setRotation=function(e){this.rotation_=e},Hs.prototype.setScale=function(e){this.scale_=e},Hs.prototype.setSnapToPixel=function(e){},Hs.prototype.listenImageChange=function(e,t){return Fr()},Hs.prototype.load=function(){Fr()},Hs.prototype.unlistenImageChange=function(e,t){Fr()};var Ys=Hs,Xs=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 Rs.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="",n="",a=0,o=null,s=0,l=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=Qo),i=Uo(i),void 0===(l=this.stroke_.getWidth())&&(l=1),o=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),Yo||(o=null,s=0),void 0===(n=this.stroke_.getLineJoin())&&(n="round"),void 0===(r=this.stroke_.getLineCap())&&(r="round"),void 0===(a=this.stroke_.getMiterLimit())&&(a=10));var h=2*(this.radius_+l)+1,c={strokeStyle:i,strokeWidth:l,size:h,lineCap:r,lineDash:o,lineDashOffset:s,lineJoin:n,miterLimit:a};if(void 0===e){var u=jo(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 d,p=!this.fill_;p&&(d=this.drawHitDetectionCanvas_.bind(this,c));var f=this.getChecksum(),m=e.add(f,h,h,this.draw_.bind(this,c),d);this.canvas_=m.image,this.origin_=[m.offsetX,m.offsetY],t=m.image.width,p?(this.hitDetectionCanvas_=m.hitImage,this.hitDetectionImageSize_=[m.hitImage.width,m.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 n,a,o;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),n=0;n<=s;n++)a=2*n*Math.PI/s-Math.PI/2+this.angle_,o=n%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(a),e.size/2+o*Math.sin(a))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=Ko),t.fillStyle=Uo(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=jo(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 n=this.points_;if(n===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var a,o,s,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(n*=2),a=0;a<=n;a++)s=2*a*Math.PI/n-Math.PI/2+this.angle_,o=a%2==0?this.radius_:l,t.lineTo(e.size/2+o*Math.cos(s),e.size/2+o*Math.sin(s))}t.fillStyle=Go(Ko),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}(Ys)),Js=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.checksum_=void 0};Js.prototype.clone=function(){var e=this.getColor();return new Js({color:Array.isArray(e)?e.slice():e||void 0})},Js.prototype.getColor=function(){return this.color_},Js.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},Js.prototype.getChecksum=function(){if(void 0===this.checksum_){var e=this.color_;e?Array.isArray(e)||"string"==typeof e?this.checksum_="f"+Go(e):this.checksum_=qr(this.color_):this.checksum_="f-"}return this.checksum_};var $s=Js,Ks=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};Ks.prototype.clone=function(){var e=this.getColor();return new Ks({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()})},Ks.prototype.getColor=function(){return this.color_},Ks.prototype.getLineCap=function(){return this.lineCap_},Ks.prototype.getLineDash=function(){return this.lineDash_},Ks.prototype.getLineDashOffset=function(){return this.lineDashOffset_},Ks.prototype.getLineJoin=function(){return this.lineJoin_},Ks.prototype.getMiterLimit=function(){return this.miterLimit_},Ks.prototype.getWidth=function(){return this.width_},Ks.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},Ks.prototype.setLineCap=function(e){this.lineCap_=e,this.checksum_=void 0},Ks.prototype.setLineDash=function(e){this.lineDash_=e,this.checksum_=void 0},Ks.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e,this.checksum_=void 0},Ks.prototype.setLineJoin=function(e){this.lineJoin_=e,this.checksum_=void 0},Ks.prototype.setMiterLimit=function(e){this.miterLimit_=e,this.checksum_=void 0},Ks.prototype.setWidth=function(e){this.width_=e,this.checksum_=void 0},Ks.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=qr(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 Zs=Ks,Qs=function(e){var t=e||{};this.geometry_=null,this.geometryFunction_=el,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};Qs.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new Qs({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()})},Qs.prototype.getRenderer=function(){return this.renderer_},Qs.prototype.setRenderer=function(e){this.renderer_=e},Qs.prototype.getGeometry=function(){return this.geometry_},Qs.prototype.getGeometryFunction=function(){return this.geometryFunction_},Qs.prototype.getFill=function(){return this.fill_},Qs.prototype.setFill=function(e){this.fill_=e},Qs.prototype.getImage=function(){return this.image_},Qs.prototype.setImage=function(e){this.image_=e},Qs.prototype.getStroke=function(){return this.stroke_},Qs.prototype.setStroke=function(e){this.stroke_=e},Qs.prototype.getText=function(){return this.text_},Qs.prototype.setText=function(e){this.text_=e},Qs.prototype.getZIndex=function(){return this.zIndex_},Qs.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_=el,this.geometry_=e},Qs.prototype.setZIndex=function(e){this.zIndex_=e};function el(e){return e.getGeometry()}var tl=Qs,il={FRACTION:"fraction",PIXELS:"pixels"},rl=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function nl(e,t,i){return t+":"+e+":"+(i?Go(i):"null")}rl.prototype.clear=function(){this.cache_={},this.cacheSize_=0},rl.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_)}}},rl.prototype.get=function(e,t,i){var r=nl(e,t,i);return r in this.cache_?this.cache_[r]:null},rl.prototype.set=function(e,t,i,r){var n=nl(e,t,i);this.cache_[n]=r,++this.cacheSize_},rl.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()};var al=new rl,ol=function(e){function t(t,i,r,n,a,o){e.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==n&&(this.image_.crossOrigin=n),this.canvas_=o?document.createElement("canvas"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=a,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_===Rs.LOADED){this.tainted_=!1;var e=jo(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(xa)},t.prototype.handleImageError_=function(){this.imageState_=Rs.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=Rs.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=jo(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_==Rs.IDLE){this.imageState_=Rs.LOADING,this.imageListenerKeys_=[pa(this.image_,Sa,this.handleImageError_,this),pa(this.image_,Ma,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,n=this.color_[1]/255,a=this.color_[2]/255,o=0,s=i.length;o<s;o+=4)i[o]*=r,i[o+1]*=n,i[o+2]*=a;e.putImageData(t,0,0)}},t.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(ma),this.imageListenerKeys_=null},t}(wa);var sl={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},ll=function(e){function t(t){var i=t||{},r=void 0!==i.opacity?i.opacity:1,n=void 0!==i.rotation?i.rotation:0,a=void 0!==i.scale?i.scale:1,o=void 0!==i.rotateWithView&&i.rotateWithView;e.call(this,{opacity:r,rotation:n,scale:a,rotateWithView:o}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:sl.TOP_LEFT,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:il.FRACTION,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:il.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;Hr(!(void 0!==h&&s),4),Hr(!s||s&&l,5),void 0!==h&&0!==h.length||!s||(h=s.src||qr(s)),Hr(void 0!==h&&h.length>0,6);var c=void 0!==i.src?Rs.IDLE:Rs.LOADED;this.color_=void 0!==i.color?function(e){return Array.isArray(e)?e:Fo(e)}(i.color):null,this.iconImage_=function(e,t,i,r,n,a){var o=al.get(t,r,a);return o||(o=new ol(e,t,i,r,n,a),al.set(t,r,a,o)),o}(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:sl.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_==il.FRACTION||this.anchorYUnits_==il.FRACTION){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==il.FRACTION&&(e[0]*=t[0]),this.anchorYUnits_==il.FRACTION&&(e[1]*=t[1])}if(this.anchorOrigin_!=sl.TOP_LEFT){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),this.anchorOrigin_!=sl.TOP_RIGHT&&this.anchorOrigin_!=sl.BOTTOM_RIGHT||(e[0]=-e[0]+t[0]),this.anchorOrigin_!=sl.BOTTOM_LEFT&&this.anchorOrigin_!=sl.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_!=sl.TOP_LEFT){var t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),this.offsetOrigin_!=sl.TOP_RIGHT&&this.offsetOrigin_!=sl.BOTTOM_RIGHT||(e[0]=i[0]-t[0]-e[0]),this.offsetOrigin_!=sl.BOTTOM_LEFT&&this.offsetOrigin_!=sl.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 da(this.iconImage_,xa,e,t)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(e,t){fa(this.iconImage_,xa,e,t)},t}(Ys),hl=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 $s({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:ks,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};hl.prototype.clone=function(){return new hl({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})},hl.prototype.getOverflow=function(){return this.overflow_},hl.prototype.getFont=function(){return this.font_},hl.prototype.getMaxAngle=function(){return this.maxAngle_},hl.prototype.getPlacement=function(){return this.placement_},hl.prototype.getOffsetX=function(){return this.offsetX_},hl.prototype.getOffsetY=function(){return this.offsetY_},hl.prototype.getFill=function(){return this.fill_},hl.prototype.getRotateWithView=function(){return this.rotateWithView_},hl.prototype.getRotation=function(){return this.rotation_},hl.prototype.getScale=function(){return this.scale_},hl.prototype.getStroke=function(){return this.stroke_},hl.prototype.getText=function(){return this.text_},hl.prototype.getTextAlign=function(){return this.textAlign_},hl.prototype.getTextBaseline=function(){return this.textBaseline_},hl.prototype.getBackgroundFill=function(){return this.backgroundFill_},hl.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},hl.prototype.getPadding=function(){return this.padding_},hl.prototype.setOverflow=function(e){this.overflow_=e},hl.prototype.setFont=function(e){this.font_=e},hl.prototype.setMaxAngle=function(e){this.maxAngle_=e},hl.prototype.setOffsetX=function(e){this.offsetX_=e},hl.prototype.setOffsetY=function(e){this.offsetY_=e},hl.prototype.setPlacement=function(e){this.placement_=e},hl.prototype.setFill=function(e){this.fill_=e},hl.prototype.setRotation=function(e){this.rotation_=e},hl.prototype.setScale=function(e){this.scale_=e},hl.prototype.setStroke=function(e){this.stroke_=e},hl.prototype.setText=function(e){this.text_=e},hl.prototype.setTextAlign=function(e){this.textAlign_=e},hl.prototype.setTextBaseline=function(e){this.textBaseline_=e},hl.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},hl.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},hl.prototype.setPadding=function(e){this.padding_=e};var cl=hl,ul=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function dl(e,t){const i={};for(const t in e)"ref"!==t&&(i[t]=e[t]);return ul.forEach(e=>{e in t&&(i[e]=t[e])}),i}var pl=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]=dl(e[i],t[e[i].ref]));return e};var fl={$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."}}},ml=i(3),yl={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},gl=" ",vl=/(italic|oblique)$/i,bl={};function _l(e,t){var i=bl[e];if(!i){Array.isArray(e)||(e=[e]);for(var r="normal",n="normal",a=[],o=0,s=e.length;o<s;++o){var l=e[o].split(" "),h=l[l.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(n=h,l.pop(),h=l[l.length-1].toLowerCase()):vl.test(h)&&(h=h.replace(vl,""),n=l[l.length-1].replace(h,"")),yl)if(h==c||h==c.replace("-","")||h==c.replace("-",gl)){r=yl[c],l.pop();break}"number"==typeof h&&(r=h);var u=l.join(gl).replace("Klokantech Noto Sans","Noto Sans");-1!==u.indexOf(gl)&&(u='"'+u+'"'),a.push(u)}i=bl[e]=[n,r,a]}return i[0]+gl+i[1]+gl+t+"px"+gl+i[2]}function wl(e){return e*Math.PI/180}const xl=ml.d.isFunction,Cl=ml.d.convertFunction,Sl=ml.b.isExpression,Ml=ml.b.createPropertyExpression,kl={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Tl=function(e,t){const i=Ml(e,t);if("error"===i.result)throw new Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return i.value},Il={},Ol={zoom:0},El={};function Ll(e,t,i,r,n){const a=e.id;El[a]||(El[a]={});const o=El[a];if(!o[i]){let r=(e[t]||Il)[i];const n=fl[`${t}_${e.type}`][i];void 0===r&&(r=n.default);let a=Sl(r);if(!a&&xl(r)&&(r=Cl(r,n),a=!0),a){const e=Tl(r,n);o[i]=e.evaluate.bind(e)}else"color"==n.type&&(r=ml.a.parse(r)),o[i]=function(){return r}}return Ol.zoom=r,o[i](Ol,n)}const Pl={};function Rl(e,t,i,r){return e in Pl||(Pl[e]=Object(ml.c)(t).filter),Ol.zoom=r,Pl[e](Ol,i)}const jl={};function Al(e,t){if(e&&void 0!==t){let i=jl[e];i||(jl[e]=i={color:e.toArray(),opacity:e.a}),(e=i.color)[3]=i.opacity*t,0===e[3]&&(e=void 0)}return e}const zl=/^([^]*)\{(.*)\}([^]*)$/;function Dl(e,t){let i;do{if(i=e.match(zl)){const r=t[i[2]]||"";e=i[1]+r+i[3]}}while(i);return e}var Vl=function(e,t,i,r,n,a){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 o,s;if(n){const e=new Image;e.crossOrigin="anonymous",e.onload=function(){o=e,s=[e.width,e.height],e.onload=null},e.src=n}const l=document.createElement("CANVAS").getContext("2d"),h={};function c(e,t,i){const r=i+","+t+","+e;let n=h[r];if(!n){l.font=t;const a=l.measureText("M").width*i,o=e.split(" ");let s="";const c=[];for(let e=0,t=o.length;e<t;++e){const t=o[e];l.measureText(s+t).width<=a?s+=(s?" ":"")+t:(s&&c.push(s),s=t)}s&&c.push(s),h[r]=n=c.join("\n")}return n}const u=pl(e.layers),d={},p=[];let f;for(let i=0,r=u.length;i<r;++i){const r=u[i],n=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 a=d[t];a||(a=d[t]=[]),a.push({layer:r,index:i}),p.push(n)}delete El[n],delete Pl[n]}const m=new Zs,y=new $s,g={},v={},b=[];return function(e,t){const n=e.getProperties(),a=d[n.layer];if(!a)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=kl[e.getGeometry().getType()],u={properties:n,type:h};let p=-1;for(let i=0,d=a.length;i<d;++i){const d=a[i],f=d.layer,_=f.id,w=f.layout||Il,x=f.paint||Il;if(!("none"===w.visibility||"minzoom"in f&&l<f.minzoom||"maxzoom"in f&&l>=f.maxzoom)){const i=f.filter;if(!i||Rl(_,i,u,l)){let i,a,C,S,M,k;const T=d.index;if(3==h&&"fill"==f.type)if(a=Ll(f,"paint","fill-opacity",l,u),"fill-pattern"in x){const e=Ll(f,"paint","fill-pattern",l,u);if(e){const t=Dl(e,n);if(o&&r&&r[t]){(k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new tl({fill:new $s})),C=k.getFill(),k.setZIndex(T);const e=t+"."+a;let i=v[e];if(!i){const n=r[t],s=document.createElement("canvas");s.width=n.width,s.height=n.height;const l=s.getContext("2d");l.globalAlpha=a,l.drawImage(o,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i=l.createPattern(s,"repeat"),v[e]=i}C.setColor(i)}}}else(i=Al(Ll(f,"paint","fill-color",l,u),a))&&((k=b[++p])&&k.getFill()&&!k.getStroke()&&!k.getText()||(k=b[p]=new tl({fill:new $s})),(C=k.getFill()).setColor(i),k.setZIndex(T)),"fill-outline-color"in x&&(M=Al(Ll(f,"paint","fill-outline-color",l,u),a)),M&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new tl({stroke:new Zs})),(S=k.getStroke()).setLineCap(fl.layout_line["line-cap"]),S.setLineJoin(fl.layout_line["line-join"]),S.setMiterLimit(fl.layout_line["line-miter-limit"]),S.setColor(M),S.setWidth(1),S.setLineDash(null),k.setZIndex(T));if(1!=h&&"line"==f.type){i=!("line-pattern"in x)&&"line-color"in x?Al(Ll(f,"paint","line-color",l,u),Ll(f,"paint","line-opacity",l,u)):void 0;const e=Ll(f,"paint","line-width",l,u);i&&e>0&&((k=b[++p])&&k.getStroke()&&!k.getFill()&&!k.getText()||(k=b[p]=new tl({stroke:new Zs})),(S=k.getStroke()).setLineCap(Ll(f,"layout","line-cap",l,u)),S.setLineJoin(Ll(f,"layout","line-join",l,u)),S.setMiterLimit(Ll(f,"layout","line-miter-limit",l,u)),S.setColor(i),S.setWidth(e),S.setLineDash(x["line-dasharray"]?Ll(f,"paint","line-dasharray",l,u).map(function(t){return t*e}):null),k.setZIndex(T))}let I,O,E,L,P=!1,R=null,j=0;if((1==h||2==h)&&"icon-image"in w){const a=Ll(f,"layout","icon-image",l,u);if(a){I=Dl(a,n);let c=void 0;if(o&&r&&r[I]){const n=Ll(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 ho(e),"line"===Ll(f,"layout","symbol-placement",l,u)&&"map"===n){const t=i.getStride(),r=i.getFlatCoordinates();for(let i=0,n=r.length-t;i<n;i+=t){const n=r[i],a=r[i+1],o=r[i+t],s=r[i+t+1],l=Math.min(n,o),h=Math.min(a,s),c=Math.max(n,o),u=Math.max(a,s);if(e[0]>=l&&e[0]<=c&&e[1]>=h&&e[1]<=u){j=Math.atan2(a-s,o-n);break}}}}}}if(2!==h||c){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl),k.setGeometry(c);const e=Ll(f,"layout","icon-size",l,u),t=void 0!==x["icon-color"]?Ll(f,"paint","icon-color",l,u):null;let a=I+"."+e;if(null!==t&&(a+="."+t),!(O=g[a])){const l=r[I];if(null!==t){i=Al(t,1);const r=document.createElement("canvas");r.width=l.width,r.height=l.height;const n=r.getContext("2d");n.drawImage(o,l.x,l.y,l.width,l.height,0,0,l.width,l.height);const s=n.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];n.putImageData(s,0,0),O=g[a]=new ll({img:r,imgSize:[r.width,r.height],scale:e/l.pixelRatio})}else O=g[a]=new ll({img:o,imgSize:s,size:[l.width,l.height],offset:[l.x,l.y],rotateWithView:"map"===n,scale:e/l.pixelRatio})}O.setRotation(j+wl(Ll(f,"layout","icon-rotate",l,u))),O.setOpacity(Ll(f,"paint","icon-opacity",l,u)),k.setImage(O),R=k.getText(),k.setText(void 0),k.setZIndex(99999-T),P=!0,E=!1}else E=!0}}}if(1==h&&"circle-radius"in x){(k=b[++p])&&k.getImage()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl);const e=Ll(f,"paint","circle-radius",l,u),t=Ll(f,"paint","circle-stroke-color",l,u),i=Ll(f,"paint","circle-color",l,u),r=Ll(f,"paint","circle-opacity",l,u),n=Ll(f,"paint","circle-stroke-opacity",l,u),a=Ll(f,"paint","circle-stroke-width",l,u);(O=g[e+"."+t+"."+i+"."+r+"."+a])||(O=new Xs({radius:e,stroke:0===a?void 0:new Zs({width:a,color:Al(t,n)}),fill:new $s({color:Al(i,r)})})),k.setImage(O),R=k.getText(),k.setText(void 0),k.setGeometry(void 0),k.setZIndex(99999-T),P=!0}if("text-field"in w&&(L=Dl(Ll(f,"layout","text-field",l,u).toString(),n)),L&&!E){P||((k=b[++p])&&k.getText()&&!k.getFill()&&!k.getStroke()||(k=b[p]=new tl),k.setImage(void 0),k.setGeometry(void 0),k.layerId=_),k.getText()||k.setText(R||new cl),R=k.getText();const e=Ll(f,"layout","text-size",l,u),t=_l(Ll(f,"layout","text-font",l,u),e),i=w["text-transform"];"uppercase"==i?L=L.toUpperCase():"lowercase"==i&&(L=L.toLowerCase());const r=2==h?L:c(L,t,Ll(f,"layout","text-max-width",l,u));R.setText(r),R.setFont(t),R.setRotation(wl(Ll(f,"layout","text-rotate",l,u)));const n=Ll(f,"layout","text-anchor",l,u),o=P||1==h?"point":Ll(f,"layout","symbol-placement",l,u);if(R.setPlacement(o),"point"==o){let e="center";-1!==n.indexOf("left")?e="left":-1!==n.indexOf("right")&&(e="right"),R.setTextAlign(e)}else R.setTextAlign();let s="middle";0==n.indexOf("bottom")?s="bottom":0==n.indexOf("top")&&(s="top"),R.setTextBaseline(s);const d=Ll(f,"layout","text-offset",l,u);R.setOffsetX(d[0]*e),R.setOffsetY(d[1]*e),a=Ll(f,"paint","text-opacity",l,u),y.setColor(Al(Ll(f,"paint","text-color",l,u),a)),R.setFill(y);const g=Al(Ll(f,"paint","text-halo-color",l,u),a);g?(m.setColor(g),m.setWidth(Ll(f,"paint","text-halo-width",l,u)),R.setStroke(m)):R.setStroke(void 0),k.setZIndex(99999-T)}}}}return p>-1?(b.length=p+1,b):[]}};class Nl{constructor(e){this.options=Object(n.defaultValue)(e,{}),this.style=Object(n.defaultValue)(e.style,void 0),this.show=Object(n.defaultValue)(e.show,!0),this.defaultAlpha=Object(n.defaultValue)(e.defaultAlpha,1),this.tilingScheme=Object(n.defaultValue)(e.tilingScheme,new Cesium.WebMercatorTilingScheme),this.tileWidth=Object(n.defaultValue)(e.tileWidth,512),this.tileHeight=Object(n.defaultValue)(e.tileHeight,512),this.tokenKey=Object(n.defaultValue)(e.tokenKey,"token"),this.tokenValue=Object(n.defaultValue)(e.tokenValue,void 0),this.readyPromise=Object(n.defaultValue)(e.readyPromise,new Promise((e,t)=>{e()})),this.scene=Object(n.defaultValue)(e.scene,void 0),this.rectangle=Object(n.defaultValue)(e.rectangle,this.tilingScheme.rectangle),this.mvtParser=new Ro,this.pixelRatio=Object(n.defaultValue)(e.pixelRatio,1),this.maximumLevel=Object(n.defaultValue)(e.maximumLevel,20),this.minimumLevel=Object(n.defaultValue)(e.minimumLevel,0),this.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),this.transform=Object(n.defaultValue)(e.transform,[.125,0,0,.125,0,0]),this.sublayerLabelingInfos=Object(n.defaultValue)(e.sublayerLabelingInfos,{}),this.labelsRenderMode=Object(n.defaultValue)(e.labelsRenderMode,"on-screen"),this._resolutions=[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],this._replays=["Default","Image","Polygon","LineString","Text"],this._tileQueue=new Cesium.TileReplacementQueue,this._tileSends=new zs,this._cacheSize=300,this._labelsNoteStyle=new n.LabelClass({renderMode:Nl.getRenderMode(this.sublayerLabelingInfos)}),this._dynamicLabelLayer=new pr({scene:this.scene,labelingInfo:[this._labelsNoteStyle]}),this._url=void 0,this._olVectorStyle=void 0,this._setOpenLayerVectorStyle(),this._initEvents()}}Object.defineProperties(Nl.prototype,{ready:{get:()=>!0},hasAlphaChannel:{get:()=>!0}}),Nl.fromUrl=async function(e,t){const i=new n.IGSVectorTileLayer({url:e}),r=await i.load(),a=Bl.initializeOptions(r);return new Nl({...a,...t})},Nl.getRenderMode=function(e){let t="canvas";if(e){const i=Object.keys(e);for(let r=0;r<i.length;r++){const n=e[i[r]];if(Array.isArray(n)&&n.length>0){t=n[0].renderMode||"canvas";break}}}return t},Nl.prototype.requestImage=function(e,t,i){if(!this._tileSends.has({x:e,y:t,z:i,id:this.options.threadId}))return this._tileSends.push({x:e,y:t,z:i,id:this.options.threadId}),this.drawTile(e,t,i);{const r=this._findTileInQueue(e,t,i,this._tileQueue);if(r)return this._tileQueue.markTileRendered(r),r.isaddedLabels||this._addDynamicLabel(r,this._dynamicLabelLayer),new Promise((e,t)=>{e(r)});this._tileSends.remove(e,t,i)}},Nl.prototype.drawTile=function(e,t,i){const r=this;let n=this._url;n=n.replace("{x}",e).replace("{y}",t).replace("{z}",i);let a={xMvt:e,yMvt:t,zMvt:i};if(this._maximumLevel&&i>this._maximumLevel)return this._tileQueue.markTileRendered(a),null;let o=i;Cesium.Resource.createIfNeeded(n);return new Promise((s,l)=>{fetch(n).then(e=>e.arrayBuffer()).then(function(n){try{(a=document.createElement("canvas")).width=512,a.height=512,a.xMvt=e,a.yMvt=t,a.zMvt=o;const h=a.getContext("2d"),c=r.mvtParser.readFeatures(n),u=r._olVectorStyle,d=[0,0,4096,4096];let p=new Ps(0,d,8,!0,512);const f=r.tilingScheme.tileXYToRectangle(e,t,i);if(!f)return null;const m=Cesium.Rectangle.northwest(f),y=Cesium.Rectangle.southeast(f);a.isaddedLabels=!0;for(let n=0;n<c.length;n++){const o=c[n],s=u(o,r._resolutions[i]);let l=[],h=[];"on-screen"===r.labelsRenderMode?(l=s.filter(e=>!e.text_),h=s.filter(e=>e.text_)):l=s,h.length>0&&requestAnimationFrame(()=>{const n=r._renderLabels(a,o,h,e,t,i,d,m,y),s=r._dynamicLabelLayer.addLabels(n);a.cacheLabels||(a.cacheLabels=[]),s.forEach(e=>{a.cacheLabels.push(e)}),a.isaddedLabels&&r._dynamicLabelLayer.addLabels(s)});for(let e=0;e<l.length;e++)As(p,o,l[e],16)}p.finish(),p.replay(h,r.transform,0,{},r._replays),r._tileQueue.count>r._cacheSize&&r._trimTiles(r._tileQueue,r._dynamicLabelLayer,r._cacheSize/2),p=null,s(a)}catch(e){console.log("err: ",e),l()}r._tileQueue.markTileRendered(a)})})},Nl.prototype._initEvents=function(){this.scene&&"on-screen"===this.labelsRenderMode&&(this._changeTileHandler=(()=>{let e=this._tileQueue.tail,t=this._tileQueue.count;for(;e&&t>60;)t--,e.cacheLabels&&this._removeDynamicLabel(e,this._dynamicLabelLayer),e=e.replacementPrevious}),this.scene.postRender.addEventListener(this._changeTileHandler))},Nl.prototype._removeEvents=function(){this.scene&&this._changeTileHandler&&this.scene.postRender.removeEventListener(this._changeTileHandler)},Nl.prototype._renderLabels=function(e,t,i,r,a,o,s,l,h){if(!i||!e||Array.isArray(i)&&0===i.length)return[];if(!t||!t.properties_)return[];const c=t.properties_;let u=[];return i.forEach(e=>{const i=e.getText(),r=this.sublayerLabelingInfos[e.layerId]||[];let a=Object(Ds.a)(this._labelsNoteStyle,i,r.length>0?r[0]:null,c);if(t.flatCoordinates_&&Array.isArray(t.flatCoordinates_)&&2===t.flatCoordinates_.length&&a.symbol.text){const e=t.flatCoordinates_,i=s[2],r=s[3],o=(Cesium.Math.toDegrees(h.longitude)-Cesium.Math.toDegrees(l.longitude))*e[0]/i+Cesium.Math.toDegrees(l.longitude),c=(Cesium.Math.toDegrees(h.latitude)-Cesium.Math.toDegrees(l.latitude))*e[1]/r+Cesium.Math.toDegrees(l.latitude);if(e[0]>i||e[1]>r)return;const d=new n.Point({coordinates:[o,c]}),p=new n.Feature({geometry:d});(this._dynamicLabelLayer.createLabels([p],a)||[]).forEach(e=>{u.push(e)})}}),u},Nl.prototype._findTileInQueue=function(e,t,i,r){let n=r.head;for(;n&&(n.xMvt!==e||n.yMvt!==t||n.zMvt!==i);)n=n.replacementNext;return n},Nl.prototype._trimTiles=function(e,t,i){let r=e.tail;const n=this;for(;e.count>i&&Cesium.defined(r);){const i=r.replacementPrevious;n._removeTile(e,r),n._removeDynamicLabel(r,t),r=null,r=i}},Nl.prototype._removeTile=function(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},Nl.prototype._removeDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(t.removeLabels(e.cacheLabels),e.isaddedLabels=!1)},Nl.prototype._addDynamicLabel=function(e,t){e&&t&&e.cacheLabels&&Array.isArray(e.cacheLabels)&&0!==e.cacheLabels.length&&(e.cacheLabels=t.addLabels(e.cacheLabels),e.isaddedLabels=!0)},Nl.prototype._setOpenLayerVectorStyle=function(){if(this.style){const e=function(e){const t=e.layers;let i,r,n,a,o,s=[];for(let l=0,h=t.length;l<h;++l)"background"==(i=t[l]).type||((a=i.source||Ns(t,i.ref))!=n&&(s.length&&(s=[]),o=(r=e.sources[a]).url,"vector"==r.type||"raster"==r.type||r.type,n=a),s.push(i.id));return s}(this.style),t=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}(this.style),i=function(e){let t=e.sprite;return t.indexOf("png")>0?t:t+=".png"}(this.style),r={vectortilejson:this.style,layers:e,spritedata:this.style.spritedata,spritepng:i,fonts:Ws,sources:t};this._url=t[0].tiles[0],this.tokenKey&&this.tokenValue&&(this._url+=`&${this.tokenKey}=${this.tokenValue}`),this._olVectorStyle=Vl(r.vectortilejson,Object.keys(r.vectortilejson.sources),null,r.spritedata,r.spritepng,r.fonts)}},Nl.prototype.destroy=function(){this._removeEvents(),this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null)};var Gl=Nl;class Fl{}Fl.addVectorTileLayer=function(e){const{layer:t,innerView:i}=e,r=$l(t.spatialReference,t.extent,t.tileInfo),[a,o]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo),s=Zl(t,r.rectangle);s.spatialReference=new n.SpatialReference("EPSG:4326");const l=new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),h=Fl._getSublayerLabelingInfos(t);return new Promise(n=>{const s=new Gl({style:t.style,opacity:t.opacity,show:e._getLayerViewVisible(t.visible),tilingScheme:r,maximumLevel:o,minimumLevel:a,scene:i.scene,labelsRenderMode:t.labelsRenderMode,sublayerLabelingInfos:h,rectangle:l,transform:[512/t.mvtExtent,0,0,512/t.mvtExtent,0,0],tokenKey:t.tokenKey,tokenValue:t.tokenValue});e.innerLayer=i.imageryLayers.addImageryProvider(s),e.innerLayer.id=t.id,t.clippingArea&&rh(t,e.innerLayer,i),n(e)})},Fl.initializeOptions=function(e,t){const{extent:i,tileInfo:r,spatialReference:a}=e,o=$l(a,i,r),s=Zl({spatialReference:a,extent:i},o.rectangle),[l,h]=n.TileInfoUtil.getLevelRangeByTileInfo(r);return{style:e.style,opacity:e.opacity,show:e.visible,tilingScheme:o,minimumLevel:l,maximumLevel:h,scene:t&&t.scene?t.scene:void 0,labelsRenderMode:e.labelsRenderMode,sublayerLabelingInfos:Fl._getSublayerLabelingInfos(e),rectangle:new Cesium.Rectangle(s.xmin,s.ymin,s.xmax,s.ymax),transform:[512/e.mvtExtent,0,0,512/e.mvtExtent,0,0],tokenKey:e.tokenKey,tokenValue:e.tokenValue}},Fl.refresh=function(e){this.removeLayer(e),this.addVectorTileLayer(e)},Fl.setOpacity=function(e,t){e.innerLayer.alpha=t},Fl.setVisible=function(e,t){e.innerLayer.show=e._getLayerViewVisible(t)},Fl.setClipArea=function(e){const{layer:t,innerView:i,innerLayer:r}=e;t.clippingArea?rh(t,r,i):i._clipPreRenderFunction&&(r.swipeEnabled=!1,i.scene.preRender.removeEventListener(i._clipPreRenderFunction))},Fl.removeLayer=function(e){const{innerLayer:t,innerView:i}=e;t.imageryProvider.destroy(),i.imageryLayers.remove(t,!0)},Fl._getSublayerLabelingInfos=function(e){const t={};return e.style.layers.forEach(i=>{if(i&&i.id){const r=e.getExtendProperties(i.id,"labelingInfo");r&&r instanceof Array&&r.length>0&&(t[i.id]=r)}}),t};var Bl=Fl;class ql{}ql.addM3DLayer=function(e,t,i){const{layer:r,innerView:n,view:a}=e;let o=ql.initializeOptions(e);o.show=e._getLayerViewVisible(r.visible);const{extensionOptions:s={}}=r;th(o=Object.assign(o,s),n,a,function(e){o.autoReset&&ih(e.boundingSphere,o,n),e.translucency=o.translucency,t(e)},i)},ql.initializeOptions=function(e){const{layer:t,innerView:i}=e,r=eh(t);return r.url=t.url,t.url.includes("/igs/rest/services/")?r.igserver=!0:r.igserver=!1,r.headers&&(r.url=new Cesium.Resource({url:r.url,headers:r.headers})),i&&(r._scene=i.scene),r},ql.removeLayer=function(e,t,i){t.scene.primitives.removeAndDestroy(e)};var Ul=ql;class Wl{}Wl.addTerrainCacheLayer=function(e,t,i){const r=Wl.initializeOptions(e);t.terrainProvider=new Cesium.CesiumTerrainProvider(r),i(t.terrainProvider)},Wl.initializeOptions=function(e){let t={url:e.url};const{extensionOptions:i={}}=e;return t=Object.assign(t,i)},Wl.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)},Wl.removeLayer=function(e,t){t.terrainProvider=new Cesium.EllipsoidTerrainProvider};var Hl=Wl;var Yl=class{constructor(e){const t=Object.assign({},e);t.extensions=[];const i=Object(n.defaultValue)(e.extensions,[]),r=Object(n.defaultValue)(e.url,"");let a;a=r instanceof Cesium.Resource?r:new Cesium.Resource({url:r}),i&&i instanceof Array&&i.forEach(e=>{e&&e.value&&(a.queryParameters[e.key]=e.value)}),t.url=a;const o=new Cesium.UrlTemplateImageryProvider(t);return o.isStretchImage=Object(n.defaultValue)(e.isStretchImage,!1),o}};class Xl{}Xl.addWebTileLayer=function(e,t){let i=e._buildRequestUrl?e._buildRequestUrl():e.url;i=i.replace("{col}","{x}");let r={x:1,y:-1};"tms"===e.tileSliceType?(i=i.replace("{row}","{y}"),r={x:1,y:1}):i=i.replace("{row}","{y}"),i=i.replace("{level}","{z}");const a=$l(e.spatialReference,e.extent,e.tileInfo,r),o=Zl(e,a.rectangle),s=new Cesium.Rectangle(o.xmin,o.ymin,o.xmax,o.ymax),{extensionOptions:l={}}=e,[h,c]=n.TileInfoUtil.getLevelRangeByTileInfo(e.tileInfo);let u={url:i,tileWidth:e.tileInfo.cols,tileHeight:e.tileInfo.cols,tilingScheme:a,minimumLevel:h,maximumLevel:c,rectangle:s,subdomains:e.subDomains,extensions:[{key:e.tokenKey,value:e.tokenValue}]};u=Object.assign(u,l);const d=Kl(e,t),p=new Yl(u),f=t.imageryLayers.addImageryProvider(p,d);return e.clippingArea&&rh(e,f,t),f.id=e.id,f._realIndex=e._realIndex+1,f},Xl.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var Jl=Xl;function $l(e,t,i,r){let a=e.wkid,o=e.wkt,s=void 0;if(e.isWebMercator&&a!=n.CustomWKID.bd09mc&&a!=n.CustomWKID.gcj02mc&&(a=3857),!Object(n.defined)(a)&&!Object(n.defined)(o))return new Cesium.WebMercatorTilingScheme;if(n.Projection.isCustomWKID(a)){return new gr({wkid:a,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})}if(Object(n.defined)(a)){const e=n.EPSG.find(e=>e.id===a);if(!Object(n.defined)(e))return n.Log.error("根据该空间参考系的wkid未匹配到wkt值"),new Cesium.WebMercatorTilingScheme;o=e.strProject}return 4326==a||4490==a||4610==a||4212==a?Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.GeographicTilingScheme:(Object(n.defined)(t)||(t={xmin:-180,ymin:-90,xmax:180,ymax:90}),s=new gr({wkt:o,wkid:a,proj4:Ci,tileInfo:i,numberOfLevelZeroTilesX:Object(n.defined)(i)?2:1,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})):Object(n.defined)(i)&&!Object(n.defined)(i.lods)?s=new Cesium.WebMercatorTilingScheme:(Object(n.defined)(t)||(t={xmin:-20037508.342787,ymin:-20037508.342787,xmax:20037508.342787,ymax:20037508.342787}),s=new gr({wkt:o,wkid:a,proj4:Ci,tileInfo:i,rectangleSouthwest:new Cesium.Cartesian2(t.xmin,t.ymin),rectangleNortheast:new Cesium.Cartesian2(t.xmax,t.ymax),axisDirection:r})),s}function Kl(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 Zl(e,t){const i={...e.extent},r=e.spatialReference.wkid,a=e.spatialReference.wkt;let o=void 0;e.spatialReference.isGeographic?o=new Cesium.Rectangle(-180,-90,180,90):e.spatialReference.isWebMercator&&(o=new Cesium.Rectangle(-20037508.342787,-20037508.342787,20037508.342787,20037508.342787)),o&&(i.xmin=Cesium.Math.clamp(i.xmin,o.west,o.east),i.ymin=Cesium.Math.clamp(i.ymin,o.south,o.north),i.xmax=Cesium.Math.clamp(i.xmax,o.west,o.east),i.ymax=Cesium.Math.clamp(i.ymax,o.south,o.north));const s=n.Projection.projectPoints({originWKID:r,originDefs:a,targetWKID:4326,points:[[i.xmin,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin],[i.xmax,i.ymax]]}),[l,h,c,u]=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]),c[0]=Cesium.Math.toRadians(c[0]),c[1]=Cesium.Math.toRadians(c[1]),u[0]=Cesium.Math.toRadians(u[0]),u[1]=Cesium.Math.toRadians(u[1]),i.xmin=Math.min(l[0],c[0]),i.ymin=Math.min(h[1],c[1]),i.xmax=Math.max(h[0],u[0]),i.ymax=Math.max(l[1],u[1]);const d={xmin:t.west,xmax:t.east,ymin:t.south,ymax:t.north};return i.xmin=Cesium.Math.clamp(i.xmin,d.xmin,d.xmax),i.xmax=Cesium.Math.clamp(i.xmax,d.xmin,d.xmax),i.ymin=Cesium.Math.clamp(i.ymin,d.ymin,d.ymax),i.ymax=Cesium.Math.clamp(i.ymax,d.ymin,d.ymax),i}function Ql(e){if(!e)return;const t={type:e.type,field:e.field};switch(e.type){case n.RendererType.classBreak:t.classBreakInfos=[];for(let i=0;i<e.classBreakInfos.length;i++){const r=e.classBreakInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.classBreakInfos.push({minValue:r.minValue,maxValue:r.maxValue,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;case n.RendererType.uniqueValue:t.uniqueValueInfos=[];for(let i=0;i<e.uniqueValueInfos.length;i++){const r=e.uniqueValueInfos[i],a=r.symbol;let o=n.Color.fromColor(a.color);o=o.toCesiumRGB(),t.uniqueValueInfos.push({value:r.value,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:new Cesium.Color(o.red,o.green,o.blue,o.alpha)}}]}})}break;default:return}return t}function eh(e){let t={};return t.url=Object(n.defaultValue)(e.url,void 0),t.id=Object(n.defaultValue)(e.id,void 0),t.show=Object(n.defaultValue)(e.visible,!0),t.layerIndex=Object(n.defaultValue)(e.layerIndex,0),t.layerRenderIndex=Object(n.defaultValue)(e.layerRenderIndex,0),t.sceneIndex=t.layer&&void 0!==t.layer.sceneIndex?t.layer.sceneIndex:0,t.igserver=!0,t.renderer=Ql(e.renderer),t.translucency=e.opacity,t=Object.assign(t,e.extensionOptions)}function th(e,t,i,r,a){e=Object(n.defaultValue)(e,{}),t.scene.primitives.add(new Cesium.MapGISM3DSet(e)).readyPromise.then(function(t){t.id=e.id,t.type="m3d",r&&"function"==typeof r&&r(t)}).otherwise(function(e){a&&"function"==typeof a&&a(e)})}function ih(e,t,i){t=Object(n.defaultValue)(t,{});const r=Object(n.defaultValue)(t.duration,0),a=Object(n.defaultValue)(t.orientation,new Cesium.HeadingPitchRange(0,-.5,2.5*e.radius));i.scene.camera.flyToBoundingSphere(e,{duration:r,offset:a}),i.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}function rh(e,t,i){let r=e.clippingArea;if(r.type!==n.GeometryType.polygon&r.type!==n.GeometryType.extent&r.type!==n.GeometryType.circle)return;r.spatialReference.isGeographic||(r=n.Projection.project(r,new n.SpatialReference({wkid:4326})));let a={};switch(r.type){case n.GeometryType.polygon:a.outerRing=r.coordinates[0],a.holes=r.coordinates.splice(1,r.coordinates.length-1);break;case n.GeometryType.circle:a.outerRing=r.toPolygon().coordinates[0],a.holes=void 0;break;case n.GeometryType.extent:const{xmin:e,xmax:t,ymin:i,ymax:o}=r;a.outerRing=[[e,i],[t,i],[t,o],[e,o],[e,i]],a.holes=void 0;break;default:a=void 0}if(!a)return;t.swipeEnabled=!0;const o=[],s=a.outerRing;for(let e=0;e<s.length;e++)o.push(Cesium.Cartesian3.fromDegrees(s[e][0],s[e][1],0));let l=void 0;if(a.holes&&a.holes.length>0){l=[];for(let e=0;e<a.holes.length;e++){const t=[];for(let i=0;i<a.holes[e].length;i++)t.push(Cesium.Cartesian3.fromDegrees(a.holes[e][i][0],a.holes[e][i][1],0));l.push(new Cesium.PolygonHierarchy(t))}}const h=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o,l)}),c=Cesium.PolygonGeometry.createGeometry(h),u=Cesium.GeometryPipeline.createAttributeLocations(c),d=Cesium.VertexArray.fromGeometry({context:i.scene.context,geometry:c,attributeLocations:u}),p=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}}),m=new Cesium.DrawCommand({primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:d,shaderProgram:p,castShadows:!1,receiveShadows:!1,uniformMap:{},renderState:f}),y=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:y,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),m.execute(i.scene.context,b)},i.scene.preRender.removeEventListener(i._clipPreRenderFunction),i.scene.preRender.addEventListener(i._clipPreRenderFunction)}function nh(e,t){switch(e.type){case n.LayerType.arcgisMapImage:return Er.initializeOptions(e);case n.LayerType.igsMapImage:return lh.initializeOptions(e);case n.LayerType.wms:return Pr.initializeOptions(e);case n.LayerType.arcgisTile:return jr.initializeOptions(e);case n.LayerType.igsTile:return Vr.initializeOptions(e);case n.LayerType.wmts:return Gr.initializeOptions(e);case n.LayerType.arcgisVectorTile:case n.LayerType.igsVectorTile:return Bl.initializeOptions(e,t);case n.LayerType.m3dCache:return Ul.initializeOptions({layer:e,innerView:t});case n.LayerType.terrain:return Hl.initializeOptions(e);default:n.Log.error(`暂不支持为${e.type}类型的图层构造实例化参数`)}}class ah{constructor(e){if(e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),!Cesium.defined(e.url))throw new Cesium.DeveloperError("必须传入地图服务的URL");this._imageInfoUrl=e.url,this._resource=Cesium.Resource.createIfNeeded(e.url),this._tilingScheme=Cesium.defaultValue(e.tilingScheme,new Cesium.GeographicTilingScheme),this._rectangle=Cesium.defaultValue(e.rectangle,this._tilingScheme.rectangle),this._tileWidth=Cesium.defaultValue(e.tileWidth,256),this._tileHeight=Cesium.defaultValue(e.tileHeight,256),this._enablePickFeatures=Cesium.defaultValue(e.enablePickFeatures,!1),this._minimumLevel=Cesium.defaultValue(e.minimumLevel,0),this._maximumLevel=Cesium.defaultValue(e.maximumLevel,20),this._gdbpsUrl=Cesium.defaultValue(e.gdbps,[]),this._filters=Cesium.defaultValue(e.filters,""),this._layers=e.layers,this._extensions=e.extensions,this._dynamicLayers=e.dynamicLayers,this._isAntialiasing=Cesium.defaultValue(e.isAntialiasing,void 0),this._build2DImageResource=e.build2DImageResource,this._proxy=e.proxy,this._ready=!0,this._credit=Cesium.defaultValue(e.credit,new Cesium.Credit("MapGIS")),this._clientId=Cesium.defaultValue(e.clientId,Math.random().toString(36).substring(2)),this._httpMethod=Cesium.defaultValue(e.httpMethod,"GET"),this._headers=Cesium.defaultValue(e.headers,void 0)}static async fromUrl(e,t){const i=new n.IGSMapImageLayer({url:e}),r=await i.load(),a=lh.initializeOptions(r);return new ah({...a,...t})}buildImageResource(e,t,i,r){if(this._build2DImageResource&&this._build2DImageResource instanceof Function)return this._build2DImageResource(this,e,t,i,r);let n=this._resource.url;if(r.httpMethod=this._httpMethod,Cesium.defined(this._headers)?this._headers.hasOwnProperty("Content-Type")||(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers["Content-Type"]="text/plain":this._headers["Content-Type"]="application/x-www-form-urlencoded"):n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?this._headers={"Content-Type":"text/plain"}:this._headers={"Content-Type":"application/x-www-form-urlencoded"},this._resource.headers=this._headers,"GET"===this._httpMethod){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`?f=png&w=${this._tileWidth}&h=${this._tileHeight}&filters=${this._filters}&bbox=`:n.includes("/coverings")?n+=`?f=image&size=${this._tileWidth},${this._tileHeight}&bbox=`:n+=`/image?f=image&size=${this._tileWidth},${this._tileHeight}&layerFilters=${this._filters}&bbox=`;const r=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if((n+=`${r.west},${r.south},${r.east},${r.north}`).includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+=`&guid=${this._clientId}`:n+=`&clientId=${this._clientId}`,Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?n+="&gdbps=":n+="&urls=";for(let e=0;e<this._gdbpsUrl.length;e++)n+=this._gdbpsUrl[e],e<this._gdbpsUrl.length-1&&(n+=",")}if(Cesium.defined(this._layers)&&(n+=`&layers=${this._layers}`),Cesium.defined(this._dynamicLayers)&&(n+=`&dynamicLayers=${this._dynamicLayers}`),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];n+=`&${t.key}=${encodeURIComponent(t.value)}`}null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(n+=`&isAntialiasing=${this._isAntialiasing}`)}else if("POST"===this._httpMethod){let a={};n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?(a.f="png",a.w=this._tileWidth,a.h=this._tileHeight,a.filters=this._filters):(a.f="image",a.size=`${this._tileWidth},${this._tileHeight}`,a.layerFilters=this._filters);const o=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(a.bbox=`${o.west},${o.south},${o.east},${o.north}`,n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"),a.clientId=this._clientId,null!==this._isAntialiasing&&void 0!==this._isAntialiasing&&(a.isAntialiasing=this._isAntialiasing),Cesium.defined(this._gdbpsUrl)&&this._gdbpsUrl.length>0){let e="";for(let t=0;t<this._gdbpsUrl.length;t++)e+=this._gdbpsUrl[t],t<this._gdbpsUrl.length-1&&(e+=",");n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers")?a.gdbps=e:a.urls=e}if(Cesium.defined(this._layers)&&(a.layers=this._layers),Cesium.defined(this._dynamicLayers)&&(a.dynamicLayers=this._dynamicLayers),Cesium.defined(this._extensions)&&this._extensions.length>0)for(let e=0;e<this._extensions.length;e++){const t=this._extensions[e];a[t.key]=t.value}if(n.includes("igs/rest/mrms/docs")||n.includes("/igs/rest/mrms/layers"))a=JSON.stringify(a);else{n+="/image";let e="";Object.keys(a).forEach(t=>{a[t]&&(e+=`${t}=${encodeURIComponent(a[t])}&`)}),e=e.substring(0,e.length-1),a=e}r.data=a}return this._resource.getDerivedResource({url:n,request:r,proxy:this._proxy})}requestImage(e,t,i,r){return Cesium.ImageryProvider.loadImage(this,this.buildImageResource(e,t,i,r))}pickFeatures(e,t,i){if(!this._enablePickFeatures)return;let r=this._imageInfoUrl.replace("{s}",(e+t)%4);t=3*Math.pow(2,i)-1-t,r=(r=(r=(r=r.replace("{s}",(e+t)%4)).replace("{row}",t)).replace("{col}",e)).replace("{level}",i);return this._resource.getDerivedResource({url:r,queryParameters:{f:"json"}}).fetchJson().then(function(e){const t=[],i=e.results;if(!Cesium.defined(i))return t;for(let e=0;e<i.length;++e){const r=i[e],n=new Cesium.ImageryLayerFeatureInfo;n.data=r,n.name=r.value,n.properties=r.attributes,n.configureDescriptionFromProperties(r.attributes),t.push(n)}return t})}}Object.defineProperties(ah.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},gdbps:{get:function(){return this._gdbpsUrl},set:function(e){e instanceof Array&&(this._gdbpsUrl=e)}},layers:{get:function(){return this._layers},set:function(e){this._layers=e}}});var oh=ah;class sh{}sh.addIGSMapImageLayer=function(e,t){const i=sh.initializeOptions(e),r=Kl(e,t),n=t.imageryLayers.addImageryProvider(new oh(i),r);return e.clippingArea&&rh(e,n,t),n.id=e.id,n._realIndex=e._realIndex+1,n},sh.initializeOptions=function(e){const t=n.TileInfoUtil.createCommonTileInfo({extent:e.extent,tileSize:e.imageWidth}),i=$l(e.spatialReference,e.extent,t),r=Zl(e,i.rectangle),a=new Cesium.Rectangle(r.xmin,r.ymin,r.xmax,r.ymax);let o=e._url;"1.0"===e._igsVersion&&(o=o.replace("/mrcs/","/mrms/"));let s=[];e.tokenKey&&s.push({key:e.tokenKey,value:e.tokenValue});let l={url:o,httpMethod:e.httpMethod,tileWidth:e.imageWidth,tileHeight:e.imageHeight,layers:e.layers,tilingScheme:i,clientId:e.clientId,projectionSrs:Object(n.getProjectionSrs)(e.spatialReference),rectangle:a,filters:e.getFilters?JSON.stringify(e.getFilters()):void 0,headers:e.headers,extensions:s,isAntialiasing:e.isAntialiasing};const{extensionOptions:h={}}=e;if(l=Object.assign(l,h),e.allSublayers){const t=Object(n.getIGSDynamicLayer)(e);t.length>0&&(l.dynamicLayers=JSON.stringify(t))}return l},sh.removeLayer=function(e,t){t._clipPreRenderFunction&&(e.swipeEnabled=!1,t.scene.preRender.removeEventListener(t._clipPreRenderFunction)),t.imageryLayers.remove(e,!0)};var lh=sh;class hh{}hh.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 a=Cesium.Cartographic.fromCartesian(r),o=Cesium.Math.toDegrees(a.longitude),s=Cesium.Math.toDegrees(a.latitude),l={mapPoint:new n.Point({coordinates:[o,s,a.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},hh.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},hh.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},hh.getDragEvent=function(e,t,i,r,n){return e.originalEvent?{x:e.originalEvent.layerX,y:e.originalEvent.layerY,button:void 0!==n?n: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"}:{origin:i,action:r,type:"drag"}},hh.getResizeEvent=function(e,t,i,r){return e};var ch=hh;class uh{}uh.addCesium3DTilesLayer=function(e,t,i){const{layer:r,innerView:n}=e,{extensionOptions:a={},opacity:o,visible:s}=r,l={};r.tokenKey&&r.tokenValue&&(l[r.tokenKey]=r.tokenValue);let h={show:e._getLayerViewVisible(s),url:new Cesium.Resource({url:r._paramUrl,headers:r.headers,queryParameters:l})};h=Object.assign(h,a),n.scene.primitives.add(new Cesium.Cesium3DTileset(h)).readyPromise.then(function(e){e.id=r.id,e.style=new Cesium.Cesium3DTileStyle({color:`rgba(255, 255, 255, ${o})`}),a.autoReset&&ih(e.boundingSphere,h,n),t(e)}).otherwise(i)},uh.removeLayer=function(e,t){t.scene.primitives.removeAndDestroy(e)};var dh=uh;const ph=window.mapv||{},fh=ph.baiduMapLayer?ph.baiduMapLayer.__proto__:Function;class mh extends fh{constructor(e,t,i,r){if(super(e,t,i),!fh)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,n=i.getContext();if(i.isEnabledTime()){if(void 0===e)return void this.clear(n);"2d"===this.context&&(n.save(),n.globalCompositeOperation="destination-out",n.fillStyle="rgba(0, 0, 0, .1)",n.fillRect(0,0,n.canvas.width,n.canvas.height),n.restore())}else this.clear(n);if("2d"===this.context)for(const e in i.options)n[e]=i.options[e];else n.clear(n.COLOR_BUFFER_BIT);const a={transferCoordinate(e){const t=Cesium.Cartesian3.fromDegrees(e[0],e[1]);var r=i.map.camera.position;let n=i.map.scene.globe.ellipsoid.cartesianToCartographic(r).height;if(n+=1.2*i.map.scene.globe.ellipsoid.maximumRadius,Cesium.Cartesian3.distance(r,t)>n)return;r=Cesium.Cartesian3.fromDegrees(e[0],e[1]);const a=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.map.scene,r);return a?[a.x,a.y]:[0,0]}};void 0!==e&&(a.filter=function(t){const i=r.trails||10;return!!(e&&t.time>e-i&&t.time<e)});const o=i.dataSet.get(a);this.processData(o),"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(n,new ph.DataSet(o),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 yh=0;class gh{constructor(e,t,i,r){this.map=e,this.scene=e.scene,this.mapvBaseLayer=new mh(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 n=i.cesium;if(n&&(this.postRender=n.postRender||!1,this.postRenderFrame=n.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${yh++}`,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${yh++}`,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(){if(void 0==this.mapvBaseLayer)return;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()}}class vh{}vh.addMapVLayer=function(e,t){const{extensionOptions:i={}}=e,r=Object.assign(e.mapVOptions,i),n=new gh(t,e.data,r);return n.id=e.id,n},vh.removeLayer=function(e){e.remove()};var bh=vh;var _h=class{constructor(e){e=Cesium.defaultValue(e,{}),this.commonLayerId=Cesium.defaultValue(e.layerId,null),this._feature=e.feature,this._feature||n.Log.error("feature不能为空!"),this._feature=n.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._feature&&(this.show=this._feature.visible),this._markRemovePrimitives(),this._createPrimitive(()=>{this._removeMarkPrimitives(!0)})}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=[],this._billboards=[],this._labels=[],this._primitives=[],this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0}checkSymbol(){return!0}setVisible(e){if(this._points&&this._points.length>0)for(let t=0;t<this._points.length;t++)this._points[t].show=e;if(this._labels&&this._labels.length>0)for(let t=0;t<this._labels.length;t++)this._labels[t].show=e;if(this._billboards&&this._billboards.length>0)for(let t=0;t<this._billboards.length;t++)this._billboards[t].show=e;if(this._primitives&&this._primitives.length>0)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,t=[];switch(e.type){case n.GeometryType.point:t.push(Cesium.Cartographic.fromDegrees(e.coordinates[0],e.coordinates[1],e.coordinates[2]||0));break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let i=0;i<e.coordinates.length;i++)t.push(Cesium.Cartographic.fromDegrees(e.coordinates[i][0],e.coordinates[i][1],e.coordinates[i][2]||0));break;case n.GeometryType.multiLineString:case n.GeometryType.polygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++)t[i].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][0],e.coordinates[i][r][1],e.coordinates[i][r][2]||0))}break;case n.GeometryType.multiPolygon:for(let i=0;i<e.coordinates.length;i++){t.push([]);for(let r=0;r<e.coordinates[i].length;r++){t[i].push([]);for(let n=0;n<e.coordinates[i][r].length;n++)t[i][r].push(Cesium.Cartographic.fromDegrees(e.coordinates[i][r][n][0],e.coordinates[i][r][n][1],e.coordinates[i][r][n][2]))}}break;case n.GeometryType.extent:t.push([]),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymin,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmax,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymax,e.zmin||0)),t[0].push(Cesium.Cartographic.fromDegrees(e.xmin,e.ymin,e.zmin||0));break;case n.GeometryType.circle:const i=e.toPolygon();for(let e=0;e<i.coordinates.length;e++){t.push([]);for(let r=0;r<i.coordinates[e].length;r++)t[e].push(Cesium.Cartographic.fromDegrees(i.coordinates[e][r][0],i.coordinates[e][r][1],i.coordinates[e][r][2]))}}return 0===t.length&&n.Log.error("顶点数组为空,无法正常创建图形!"),t}_addZCoordinate(){const e=this._feature.geometry;if(!e.hasZ)switch(e.type){case n.GeometryType.point:e.coordinates.push(0);break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:for(let t=0;t<e.coordinates.length;t++)e.coordinates[t].push(0);break;case n.GeometryType.multiLineString:case n.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 n.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 n.GeometryType.extent:e.zmin=0,e.zmax=0;break;case n.GeometryType.circle:e.center.push(0)}}_removePrimitives(){for(let e=0;this._points&&e<this._points.length;e++)this._pointsCollection.remove(this._points[e]);this._points=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboardsCollection.remove(this._billboards[e]);this._billboards=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labelsCollection.remove(this._labels[e]);this._labels=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitivesCollection.remove(this._primitives[e]);this._primitives=[]}_removeMarkPrimitives(){const e=[];for(let t=0;this._points&&t<this._points.length;t++)this._points[t]._isRemove?this._pointsCollection.remove(this._points[t]):e.push(this._points[t]);this._points=e;const t=[];for(let e=0;this._billboards&&e<this._billboards.length;e++)this._billboards[e]._isRemove?this._billboardsCollection.remove(this._billboards[e]):t.push(this._billboards[e]);this._billboards=t;const i=[];for(let e=0;this._labels&&e<this._labels.length;e++)this._labels[e]._isRemove?this._labelsCollection.remove(this._labels[e]):i.push(this._labels[e]);this._labels=i;const r=[];for(let e=0;this._primitives&&e<this._primitives.length;e++)this._primitives[e]._isRemove?this._primitivesCollection.remove(this._primitives[e]):r.push(this._primitives[e]);this._primitives=r}_markRemovePrimitives(){this._points.forEach(e=>{e._isRemove=!0}),this._billboards.forEach(e=>{e._isRemove=!0}),this._labels.forEach(e=>{e._isRemove=!0}),this._primitives.forEach(e=>{e._isRemove=!0})}_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 wh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleMarkerSymbol||(n.Log.info("要素的符号类型不是SimpleMarkerSymbol!"),!1)}_createPrimitive(e){if(this._feature.symbol.style)switch(this._feature.symbol.style){case"circle":this._addPointPrimitive(e);break;default:this._addBillBoardPrimitive(e)}}_getPositions(){return Th(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}_addBillBoardPrimitive(e){const t=this._feature.symbol;this._canvas?this._symbolEquals(t,this._symbol)||(this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t),this._symbol=t):this._canvas=Object(n.createSimpleMarkerSymbolCanvas)(t);const{type:i}=this._feature.geometry,r=this._getPositions();switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,r[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<r.length;t++)Ah(this,r[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Ii.a.createBillboardOptions(e,t)}_addPointPrimitive(e){const t=this._getPositions(),{type:i}=this._feature.geometry;switch(i){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Rh(this,t[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let i=0;i<t.length;i++)Rh(this,t[i],e);break;default:n.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);r.alpha*=this._layerOpacity;const n=t.extensionOptions;let a={position:e,color:i,outlineColor:r,outlineWidth:t.outline.width,pixelSize:t.size};return a=Object.assign(a,n)}};var xh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureMarkerSymbol||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}_getPositions(){return Th(this._feature,this._viewer)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Ah(this,i[t],e)}}_createBillboardOptions(e,t){return(t=Object(n.defaultValue)(t,{})).graphic=this,Ii.a.createBillboardOptions(e,t)}};function Ch(e,t){let i=0;return i=isNaN(e)?t:isNaN(t)?e:e>=t?e:t}function Sh(e,t,i,r){const a=[];for(let e=0;e<t.length;e++)a.push(Cesium.Cartographic.clone(t[0]));Cesium.sampleTerrain(e.terrainProvider,12,a).then(function(e){if(i.mode===n.ElevationMode.RelativeToGround)for(let t=0;t<e.length;t++)e[t].height+=i.offset;r(e)})}function Mh(e,t,i,r,a){const{mode:o,offset:s}=r,l=[];for(let e=0;e<t.length;e++)l.push(Cesium.Cartographic.clone(t[0]));Sh(e,t,r,function(t){e.scene.sampleHeightMostDetailed(l,i,1).then(e=>{const i=[];for(let r=0;r<e.length;r++){const n=e[r]?e[r]:t[r];n.height=Ch(e[r].height,t[r].height),i.push(n)}if(o===n.ElevationMode.RelativeToScene)for(let e=0;e<i.length;e++)i[e].height+=s;a(i)})})}function kh(e){let t=[];const i=e.scene.primitives._primitives;for(let e=0;e<i.length;e++)Cesium.MapGISM3DSet&&i[e]instanceof Cesium.MapGISM3DSet||i[e]instanceof Cesium.Cesium3DTileset||i[e]instanceof Cesium.Model||i[e]instanceof Cesium.ViewportQuad||(i[e]instanceof Cesium.PrimitiveCollection?t=t.concat(i[e]._primitives):i[e]instanceof Cesium.PointPrimitiveCollection?t=t.concat(i[e]._pointPrimitives):t.push(i[e]));return t}function Th(e){const t=e.geometry,i=[];switch(t.type){case n.GeometryType.point:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0));break;case n.GeometryType.multiPoint:for(let e=0;e<t.coordinates.length;e++)i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[e][0]),Cesium.Math.toRadians(t.coordinates[e][1]),t.coordinates[e][2]||0));break;case n.GeometryType.polygon:const e=n.Geometry.fromJSON(t).centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(e.coordinates[0]),Cesium.Math.toRadians(e.coordinates[1]),e.coordinates[2]||0));break;case n.GeometryType.multiPolygon:const r=n.Geometry.fromJSON(t).toPolygonArray();for(let e=0;e<r.length;e++){const t=r[e].centroid;i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.coordinates[0]),Cesium.Math.toRadians(t.coordinates[1]),t.coordinates[2]||0))}break;case n.GeometryType.extent:i.push(new Cesium.Cartographic(Cesium.Math.toRadians((t.xmin+t.xmax)/2),Cesium.Math.toRadians((t.ymin+t.ymax)/2),(t.zmin+t.zmax)/2||0));break;case n.GeometryType.circle:i.push(new Cesium.Cartographic(Cesium.Math.toRadians(t.center[0]),Cesium.Math.toRadians(t.center[1]),t.center[2]||0))}return i}function Ih(e){let t=void 0;switch(e){case n.ElevationMode.OnTheGround:t=Cesium.ClassificationType.TERRAIN;break;case n.ElevationMode.OnTheScene:t=Cesium.ClassificationType.BOTH}return t}function Oh(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 Eh(e,t){return"number"!=typeof t&&(t=1),new Cesium.Color(e.red/255,e.green/255,e.blue/255,e.alpha*t)}function Lh(e,t){const i=e._viewer,r=e._feature;let a,o=Cesium.HeightReference.NONE;return r.elevationInfo.mode===n.ElevationMode.OnTheGround&&(o=Cesium.HeightReference.CLAMP_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.RelativeToGround&&(t[2]=e._feature.elevationInfo.offset,o=Cesium.HeightReference.RELATIVE_TO_GROUND),r.elevationInfo.mode===n.ElevationMode.OnTheScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a),r.elevationInfo.mode===n.ElevationMode.RelativeToScene&&(a=i.scene.sampleHeight(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]),0)),t[2]=a+r.elevationInfo.offset),r.elevationInfo.mode===n.ElevationMode.AbsoluteHeight&&(t[2]+=e._feature.elevationInfo.offset),{heightReference:o,position:Ii.a.toCartesian3Position(t,"degrees")}}function Ph(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:Sh(r,t,a.elevationInfo,function(e){i(e)});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Mh(r,t,kh(r),a.elevationInfo,function(e){i(e)})}}function Rh(e,t,i){const r=e._feature,{mode:a}=r.elevationInfo;switch(a){case n.ElevationMode.AbsoluteHeight:default:const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height)));e._savePoint(r),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Ph(e,[t],function(t){const r=e._pointsCollection.add(e._createPointOptions(Cesium.Cartesian3.fromRadians(t[0].longitude,t[0].latitude,t[0].height)));e._savePoint(r),i&&i instanceof Function&&i()})}}function jh(e,t,i){const r=e._feature.symbol;let n=e._createBillboardOptions(Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),i);n=Object.assign(n,r.extensionOptions);const a=e._billboardsCollection.add(n);e._saveBillboard(a)}function Ah(e,t,i){const r=e._viewer,a=e._feature,{mode:o}=a.elevationInfo;switch(o){case n.ElevationMode.AbsoluteHeight:default:jh(e,t),i&&i instanceof Function&&i();break;case n.ElevationMode.OnTheGround:case n.ElevationMode.RelativeToGround:r.scene.globe.depthTestAgainstTerrain?(jh(e,t,{heightReference:o===n.ElevationMode.OnTheGround?Cesium.HeightReference.CLAMP_TO_GROUND:Cesium.HeightReference.RELATIVE_TO_GROUND}),i&&i instanceof Function&&i()):Ph(e,[t],function(t){jh(e,t[0]),i&&i instanceof Function&&i()});break;case n.ElevationMode.OnTheScene:case n.ElevationMode.RelativeToScene:Ph(e,[t],function(t){jh(e,t[0]),i&&i instanceof Function&&i()})}}function zh(e){let t=!1;return e.elevationInfo.mode!==n.ElevationMode.OnTheGround&&e.elevationInfo.mode!==n.ElevationMode.OnTheScene&&e.elevationInfo.mode!==n.ElevationMode.RelativeToGround&&e.elevationInfo.mode!==n.ElevationMode.RelativeToScene||(t=!0),t}function Dh(e,t,i,r){let a,o;switch(t){case n.SymbolType.pictureMarker:return a=e.resource,o=new n.PictureMarkerSymbol({width:e.size,height:e.size,url:a.href}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.simpleMarker:default:return a=e.resource,o=new n.SimpleMarkerSymbol({style:a.primitive,size:e.size,color:e.material.color,outline:new n.SimpleLineSymbol({color:e.outline.color,width:e.outline.size})}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()});case n.SymbolType.mapgisText:const s=n.Font.fromJSON(e.font);return s.size=e.size,o=new n.MapGISTextSymbol({text:e.text,verticalAlignment:e.verticalAlignment,horizontalAlignment:e.horizontalAlignment,font:s,haloColor:e.halo.color,haloSize:e.halo.size,backgroundColor:e.background,lineHeight:e.lineHeight,color:e.material.color}),new n.Feature({geometry:new n.Point({coordinates:[Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude),i.height]}),symbol:o,elevationInfo:r.elevationInfo.clone()})}}var Vh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleLineSymbol||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}_createPrimitive(e){const t=this._feature.geometry;switch(t.type){case n.GeometryType.lineString:this._addPrimitiveByElevationMode(this._getPositions(),new n.LineString({coordinates:t.coordinates}),e);break;case n.GeometryType.multiLineString:const i=this._getPositions();for(let r=0;r<i.length;r++)this._addPrimitiveByElevationMode(i[r],new n.LineString({coordinates:t.coordinates[r]}),e)}}_addPrimitiveByElevationMode(e,t,i){const{mode:r}=this._elevationInfo;switch(r){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheScene:case n.ElevationMode.OnTheGround:default:this._addLinePrimitive(e),i&&i instanceof Function&&i();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const a=n.GeometryEngine.getCenterOID(t),o=[Cesium.Cartographic.fromDegrees(a.coordinates[0],a.coordinates[1],0)];if(r===n.ElevationMode.RelativeToGround)Sh(this._viewer,o,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()});else{const t=kh(this._viewer);Mh(this._viewer,o,t,this._elevationInfo,t=>{this._addLinePrimitive(e,t[0].height),i&&i instanceof Function&&i()})}}}_addLinePrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);r.alpha*=this._layerOpacity;const a=i.width;let o;const s=[],{mode:l}=this._elevationInfo;switch(l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++)s.push(Cesium.Cartesian3.fromRadians(e[t].longitude,e[t].latitude,e[t].height));break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:let i=0;for(let t=0;t<e.length;t++)e[t].height<i&&(i=e[t].height);for(let r=0;r<e.length;r++)s.push(Cesium.Cartesian3.fromRadians(e[r].longitude,e[r].latitude,e[r].height-i+t))}let h=Cesium.ArcType.NONE;switch(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(h=this._feature.geometry.extensionOptions.arcType),l){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:s,width:a,arcType:h}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:h===Cesium.ArcType.NONE&&(h=Cesium.ArcType.GEODESIC);const e=Ih(l),t=new Cesium.GroundPolylineGeometry({positions:s,width:a,arcType:h});o=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:e})}const c=this._primitivesCollection.add(o);this._savePrimitive(c)}_createAppearance(){const e=this._feature.symbol;let t=void 0;switch(this._feature.geometry.type){case n.GeometryType.lineString:case n.GeometryType.multiLineString:switch(e.type){case n.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:n.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}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};function Nh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.anchorPosition,s=function(e){const t={horizontalOrigin:void 0,verticalOrigin:void 0};switch(e){case n.AnchorType.center:default:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.left:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.right:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.CENTER;break;case n.AnchorType.top:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottom:t.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.topLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.topRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case n.AnchorType.bottomLeft:t.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break;case n.AnchorType.bottomRight:t.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,t.verticalOrigin=Cesium.VerticalOrigin.BOTTOM}return t}(e.anchor);return{show:i.show,position:r.position,image:i.image,color:Eh(a.color,i.layerOpacity),width:e.size,height:e.size,horizontalOrigin:s.horizontalOrigin,verticalOrigin:s.verticalOrigin,pixelOffset:new Cesium.Cartesian2(o.coordinates[0],-1*o.coordinates[1]),heightReference:r.heightReference}}function Gh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=e.font;let s,l;switch(e.horizontalAlignment){case n.HorizontalAlignment.center:default:s=Cesium.HorizontalOrigin.CENTER;break;case n.HorizontalAlignment.right:s=Cesium.HorizontalOrigin.RIGHT;break;case n.HorizontalAlignment.left:s=Cesium.HorizontalOrigin.LEFT}switch(e.verticalAlignment){case n.VerticalAlignment.baseline:default:l=Cesium.VerticalOrigin.BASELINE;break;case n.VerticalAlignment.top:l=Cesium.VerticalOrigin.TOP;break;case n.VerticalAlignment.bottom:l=Cesium.VerticalOrigin.BOTTOM;break;case n.VerticalAlignment.middle:l=Cesium.VerticalOrigin.CENTER}return{show:i.show,position:r.position,text:e.text,fillColor:Eh(a.color,i.layerOpacity),font:`${e.size} ${o.family}`,backgroundColor:Eh(e.background,i.layerOpacity),horizontalOrigin:s,verticalOrigin:l,heightReference:r.heightReference}}function Fh(e,t,i){const r=Lh((i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1})).graphic,t),a=e.material,o=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(r.position[0],r.position[1],r.position[2])),s={show:i.show,url:e.resource.href,shadows:e.castShadows,scale:1,color:Eh(a.color,i.layerOpacity),modelMatrix:o,asynchronous:!1,heightReference:r.heightReference};return Cesium.Model.fromGltf(s)}function Bh(e,t){t=Object(n.defaultValue)(t,{layerOpacity:1});const i=e.material;switch(i.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Eh(i.color,t.layerOpacity)})})}}function qh(e,t,i){i=Object(n.defaultValue)(i,{show:!0,layerOpacity:1});const r=e.material,a=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:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Eh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:o,appearance:Bh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function Uh(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128,layerOpacity:1,show:!0});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Eh(r.color,i.layerOpacity))}}),show:i.show,modelMatrix:a,appearance:Bh(e,{layerOpacity:i.layerOpacity}),asynchronous:!1})}function Wh(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}function Hh(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 Yh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.SimpleFillSymbol||(n.Log.info("要素的符号类型不是SimpleFillSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:default:this._addPrimitiveByElevationMode(i,e);break;case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)this._addPrimitiveByElevationMode(i[t],e)}}_addPrimitiveByElevationMode(e,t){const{mode:i}=this._elevationInfo;switch(i){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:this._addPolygonPrimitive(e),this._addPolygonOutlinePrimitive(e),t&&t instanceof Function&&t();break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:const r=n.GeometryEngine.getCenterOID(this._feature.geometry),a=[Cesium.Cartographic.fromDegrees(r.coordinates[0],r.coordinates[1],0)];if(i===n.ElevationMode.RelativeToGround)Sh(this._viewer,a,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()});else{const i=kh(this._viewer);Mh(this._viewer,a,i,this._elevationInfo,i=>{this._addPolygonPrimitive(e,i[0].height),this._addPolygonOutlinePrimitive(e,i[0].height),t&&t instanceof Function&&t()})}}}_addPolygonPrimitive(e,t){const i=this._feature.symbol,r=this._getCesiumColor(i.color);let a;const o=[],{mode:s}=this._elevationInfo;switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:default:for(let t=0;t<e.length;t++){o.push([]);for(let i=0;i<e[t].length;i++)o[t].push(Cesium.Cartesian3.fromRadians(e[t][i].longitude,e[t][i].latitude,e[t][i].height))}break;case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:for(let i=0;i<e.length;i++){o.push([]);for(let r=0;r<e[i].length;r++)o[i].push(Cesium.Cartesian3.fromRadians(e[i][r].longitude,e[i][r].latitude,t))}}const l=[];for(let e=1;e<o.length;e++)l.push(new Cesium.PolygonHierarchy(o[e]));let h=void 0;const c=this._feature.geometry;let u;c.type===n.GeometryType.extent&&(h=c.zmax);let d=!0;this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(u=this._feature.geometry.extensionOptions.arcType,d=!1);const p=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(o[0],l),extrudedHeight:h,perPositionHeight:d,arcType:u}),f=new Cesium.MaterialAppearance({material:this._createPolygonMaterial(),translucent:!1,renderState:{depthTest:{enabled:!0}}});switch(s){case n.ElevationMode.AbsoluteHeight:case n.ElevationMode.RelativeToGround:case n.ElevationMode.RelativeToScene:default:a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1});break;case n.ElevationMode.OnTheGround:case n.ElevationMode.OnTheScene:const e=Ih(s);a=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:p,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),appearance:f,asynchronous:!1,classificationType:e})}const m=this._primitivesCollection.add(a);this._savePrimitive(m)}_addPolygonOutlinePrimitive(e,t){const i=this._feature.symbol.outline,{geometry:r}=this._feature,{type:a}=r;let o,s=[];switch(a){case n.GeometryType.polygon:default:for(let t=0;t<e.length;t++){s.push([]);for(let i=0;i<e[t].length;i++)s[t].push([Cesium.Math.toDegrees(e[t][i].longitude),Cesium.Math.toDegrees(e[t][i].latitude),e[t][i].height]);s[t].push([s[t][0][0]+(s[t][1][0]-s[t][0][0])/1e4,s[t][0][1]+(s[t][1][1]-s[t][0][1])/1e4,s[t][0][2]+(s[t][1][2]-s[t][0][2])/1e4])}break;case n.GeometryType.circle:s.push([]),s=r.toPolygon().coordinates;break;case n.GeometryType.extent:s.push([]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymin,r.zmin||0]),s[0].push([r.xmax,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymax,r.zmin||0]),s[0].push([r.xmin,r.ymin,r.zmin||0]),s[0].push([s[0][0][0]+(s[0][1][0]-s[0][0][0])/1e4,s[0][0][1]+(s[0][1][1]-s[0][0][1])/1e4,s[0][0][2]+(s[0][1][2]-s[0][0][2])/1e4])}if(this._elevationInfo.mode===n.ElevationMode.RelativeToGround||this._elevationInfo.mode===n.ElevationMode.RelativeToScene){o=new n.ElevationInfo({mode:n.ElevationMode.AbsoluteHeight});for(let e=0;e<s.length;e++){let i=0;for(let t=0;t<s[e].length;t++)i<s[e][t][2]&&(i=s[e][t][2]);for(let r=0;r<s[e].length;r++)s[e][r][2]=s[e][r][2]-i+t}}else o=this._elevationInfo;const l=new n.MultiLineString({coordinates:s,extensionOptions:r.extensionOptions}),h=new n.Feature({geometry:l,symbol:i,elevationInfo:o,visible:this.show}),c=new Vh({feature:h,layerOpacity:this._layerOpacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});this._primitives=this._primitives.concat(c._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(n.createSimpleFillSymbolCanvas)(e),this._symbol=e)):this._canvas=Object(n.createSimpleFillSymbolCanvas)(e,{lineWidth:1}),t=Cesium.Material.fromType("Image",{image:this._canvas,repeat:new Cesium.Cartesian2(1,1),color:new Cesium.Color(1,1,1,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}_savePrimitive(e){e.id=this._feature.id,e.commonFeatureId=this._feature.id,e.commonLayerId=this.commonLayerId,this._primitives.push(e)}};var Xh=class extends Yh{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PictureFillSymbol||(n.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}}}})}};var Jh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.MapGISTextSymbol||this._feature.symbol instanceof n.TextSymbol||(n.Log.info("要素的符号类型不是MapGISTextSymbol!"),!1)}_createPrimitive(e){const{type:t}=this._feature.geometry,i=this._getPositions();switch(t){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:Ah(this,i[0],e);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:for(let t=0;t<i.length;t++)Ah(this,i[t],e)}}_getPositions(){return Th(this._feature,this._viewer)}_createBillboardOptions(e,t){(t=Object(n.defaultValue)(t,{})).heightReference=Object(n.defaultValue)(t.heightReference,Cesium.HeightReference.NONE);const i=this._feature.symbol;let r=(Cesium.DynamicLabelsUtil||Li.a).createNoteBillBoardOptions(this._feature.id,i.text,e,Ii.a.convertTextSymbolToLabelNoteStyle(i,{layerOpacity:this._layerOpacity}));return r.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,r.heightReference=t.heightReference,r=Object.assign(r,this._feature.symbol.extensionOptions)}};var $h=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.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,n=e._renderer.defaultSymbol,a=e._renderer.defaultLabelSymbol;if(r instanceof Array&&r.length>0){let o=!1;for(let n=0;n<r.length;n++)if(t.length>=r[n].minValue&&t.length<r[n].maxValue){e._setClusterEntity(i,r[n].symbol,r[n].labelSymbol),o=!0;break}o||e._setClusterEntity(i,n,a)}else e._setClusterEntity(i,n,a)})})}_setClusterEntity(e,t,i){switch(t.type){case n.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 n.SymbolType.pictureMarker:this._setClusterBillBoard(e,t),i&&this._setClusterLabel(e,i,{pictureMarkerSymbol:t})}}_setClusterLabel(e,t,i){i=Object(n.defaultValue)(i,{});const r=Object(n.defaultValue)(i.pictureMarkerSymbol,void 0);t&&t instanceof n.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)),r&&r instanceof n.PictureMarkerSymbol&&(e.label.pixelOffset=new Cesium.Cartesian2(t.xoffset,-1*t.yoffset+-1*r.height))}_setClusterBillBoard(e,t){t&&(t instanceof n.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 n.SimpleMarkerSymbol&&(e.billboard.show=!0,e.billboard.image=Object(n.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=Hh(t);e.point.show=!0,e.point.color=i.color,e.point.color=e.point.color.withAlpha(.75),e.point.pixelSize=i.pixelSize,e.point.outlineColor=i.outlineColor,e.point.outlineWidth=i.outlineWidth}add(e){let t,i,r;switch((e=Object(n.defaultValue)(e,{})).geometry.type){case n.GeometryType.multiPolygon:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.Polygon({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiLineString:i=e.geometry.coordinates;for(let a=0;a<i.length;a++)r=new n.LineString({coordinates:i[a],spatialReference:e.geometry.spatialReference}),t=n.GeometryEngine.getCenterOID(r),this._addEntity(e,t);break;case n.GeometryType.multiPoint:i=e.geometry.coordinates;for(let t=0;t<i.length;t++)r=new n.Point({coordinates:i[t],spatialReference:e.geometry.spatialReference}),this._addEntity(e,r);break;default:t=n.GeometryEngine.getCenterOID(e.geometry),this._addEntity(e,t)}}_addEntity(e,t){const i={position:Cesium.Cartesian3.fromDegrees(t.coordinates[0],t.coordinates[1],1e3)},r=e.symbol;switch(r.type){case n.SymbolType.simpleMarker:switch(r.style){case"circle":i.point=Hh(r),i.point.id=e.id;break;default:i.billboard=function(e){return{show:"none"!==e.style,image:Object(n.createSimpleMarkerSymbolCanvas)(e)}}(r),i.billboard.id=e.id}break;case n.SymbolType.pictureMarker:i.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)}}(r),i.billboard.id=e.id}this._dataSource.entities.add(i)}setVisible(e){this._dataSource.entities.show=e}destroy(){this._dataSource.entities.removeAll()}};var Kh=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._field=Object(n.defaultValue)(e.field,void 0),this._valueExpression=Object(n.defaultValue)(e.valueExpression,void 0),this._features=Object(n.defaultValue)(e.features,[]),this._radius=Object(n.defaultValue)(e.radius,void 0),this._radiusFactor=Object(n.defaultValue)(e.radiusFactor,60),this._minDataValue=Object(n.defaultValue)(e.minDataValue,0),this._maxDataValue=Object(n.defaultValue)(e.maxDataValue,0),this._minCanvasSize=Object(n.defaultValue)(e.minCanvasSize,700),this._maxCanvasSize=Object(n.defaultValue)(e.maxCanvasSize,2e3),this._spacingFactor=Object(n.defaultValue)(e.spacingFactor,1.5),this._opacity=Object(n.defaultValue)(e.opacity,1),this._blur=Object(n.defaultValue)(e.blur,.85),this._gradient=Object(n.defaultValue)(e.gradient,{}),this._canChange=Object(n.defaultValue)(e.canChange,!0),this._viewer=Object(n.defaultValue)(e.viewer,void 0),this._heatMap=void 0,this._initHeatMap()}_initHeatMap(){this._viewer||n.Log.error("Cesium视图对象不能为空!"),this._features&&this._features instanceof Array||n.Log.error("热力图数据不能为空或者不是数组!"),this._field||this._valueExpression||n.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 n.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 a;switch(this._valueExpression?(a=Ii.a.parseExpression(i,this._valueExpression),a=Number(a)):a=Number(i.attributes[this._field]),r.type){case n.GeometryType.point:e.push({x:r.coordinates[0],y:r.coordinates[1],value:a});break;case n.GeometryType.multiPoint:for(let t=0;t<r.coordinates.length;t++)e.push({x:r.coordinates[t][0],y:r.coordinates[t][1],value:a});break;case n.GeometryType.lineString:e.push({x:r.extent.center.coordinates[0],y:r.extent.center.coordinates[1],value:a});break;case n.GeometryType.multiLineString:for(let i=0;i<r.coordinates.length;i++){const i=new n.LineString({coordinates:r.coordinates[t]});e.push({x:i.extent.center.coordinates[0],y:i.extent.center.coordinates[1],value:a})}break;case n.GeometryType.polygon:e.push({x:r.centroid.coordinates[0],y:r.centroid.coordinates[1],value:a});break;case n.GeometryType.multiPolygon:for(let i=0;i<r.coordinates.length;i++){const i=new n.Polygon({coordinates:r.coordinates[t]});e.push({x:i.centroid.coordinates[0],y:i.centroid.coordinates[1],value:a})}break;case n.GeometryType.extent:e.push({x:r.center.coordinates[0],y:r.center.coordinates[1],value:a});break;case n.GeometryType.circle:e.push({x:r.center[0],y:r.center[1],value:a})}}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 Zh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.LineSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_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 n.Symbol3DLayerType.line:default:switch(t.type){case n.GeometryType.lineString: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 n.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 n.Symbol3DLayerType.path:switch(t.type){case n.GeometryType.lineString:case n.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 n.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=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=e.material;let a,o=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(o=this._feature.geometry.extensionOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)a=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:i,width:e.size,arcType:o}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const t=Ih(this._elevationInfo.mode),n=new Cesium.GroundPolylineGeometry({positions:i,width:e.size,loop:!1});a=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:n,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,appearance:this._createAppearance(),asynchronous:!1,classificationType:t})}return a}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.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 a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createPathSymbol3DLayerPrimitive(e,t){const i=[];switch(t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),e.profile){case n.ProfileType.circle:default:return this._createPolylineVolumePrimitive(e,i);case n.ProfileType.quad:return this._createCorridorPrimitive(e,i)}}_createPolylineVolumePrimitive(e,t){const i=e.material,r=this._getCesiumColorByOpacity(i.color,this._layerOpacity),n=this._getCornerType(e),a=new Cesium.PolylineVolumeGeometry({polylinePositions:t,shapePositions:this._computeCircle(e.width>e.height?e.width:e.height),cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,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),n=this._getCornerType(e),a=new Cesium.CorridorGeometry({positions:t,width:e.width,height:e.height,extrudedHeight:0,cornerType:n});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,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 n.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 n.LineJoinType.round:default:t=Cesium.CornerType.ROUNDED;break;case n.LineJoinType.bevel:t=Cesium.CornerType.BEVELED;break;case n.LineJoinType.miter:t=Cesium.CornerType.MITERED}return t}_getShadows(e){let t=Cesium.ShadowMode.DISABLED;return e.castShadows&&(t=Cesium.ShadowMode.ENABLED),t}};var Qh=class extends _h{constructor(e){super(e)}checkSymbol(){return this._feature.symbol instanceof n.PolygonSymbol3D||(n.Log.info("要素的符号类型不是SimpleLineSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(a.type){case n.Symbol3DLayerType.line:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLine(a,i[r]);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;e++)this._createLine(a,i[e][t])}break;case n.Symbol3DLayerType.fill:default:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions());break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e])}break;case n.Symbol3DLayerType.extrude:switch(t.type){case n.GeometryType.polygon:this._createPolygon(a,this._getPositions(),a.size);break;case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPolygon(a,i[e],a.size)}break;case n.Symbol3DLayerType.icon:switch(t.type){case n.GeometryType.polygon:i=this._getPositions();for(let e=0;e<i.length;e++)for(let t=0;t<i[e].length;t++)this._createBillBoard(a,i[e][t]);break;case n.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(a,i[e][t][r])}break;case n.Symbol3DLayerType.object:switch(t.type){case n.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(a,i[e][t]);break;case n.GeometryType.multiPolygon:i=this._getPositions()}}}}_createLineSymbol3DLayerPrimitive(e,t){const i=e.material;let r,a=Cesium.ArcType.NONE;if(this._feature.geometry&&this._feature.geometry.extensionOptions&&this._feature.geometry.extensionOptions.arcType&&(a=this._feature.geometry.extensionOptions.arcType),this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)r=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:t,width:e.size,arcType:a}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1});else{const n=Ih(this._elevationInfo.mode),a=new Cesium.GroundPolylineGeometry({positions:t,width:e.size,loop:!1});r=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(i.color,this._layerOpacity))}}),show:this.show,appearance:this._createLineAppearance(e),asynchronous:!1,classificationType:n})}return r}_createLineAppearance(e){const t=e.pattern,i=e.material,r=e.marker;let a=void 0;switch(i.type){case n.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 a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style),new Cesium.PolylineMaterialAppearance({material:a,translucent:!1,renderState:{depthTest:{enabled:!0}}});case"solid":default:if(r){let e=r.color;switch(e||(e=i.color),r.style){case n.LineMarkerStyle.arrow:a=Cesium.Material.fromType("PolylineArrow",{color:this._getCesiumColorByOpacity(e,this._layerOpacity)});break;default:a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style)}}else a=Oh(this._getCesiumColorByOpacity(i.color,this._layerOpacity),t.style);return new Cesium.PolylineColorAppearance({material:a,renderState:{depthTest:{enabled:!0}}})}}}_createLine(e,t){const i=[];t.forEach(e=>{i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))});const r=this._primitivesCollection.add(this._createLineSymbol3DLayerPrimitive(e,i));r.id=this._feature.id,r.commonFeatureId=this._feature.id,r.commonLayerId=this.commonLayerId,this._primitives.push(r)}_createPolygon(e,t,i){const r=[];t.forEach(e=>{const t=[];e.forEach(e=>{t.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))}),r.push(t)});const n=this._primitivesCollection.add(this._createFillSymbol3DLayerPrimitive(e,r,i));n.id=this._feature.id,n.commonFeatureId=this._feature.id,n.commonLayerId=this.commonLayerId,this._primitives.push(n)}_createFillSymbol3DLayerPrimitive(e,t,i){const a=e.material,o=[];for(let e=1;e<t.length;e++)o.push(new Cesium.PolygonHierarchy(t[e]));let s;s=i?new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0,height:i,extrudedHeight:i}):new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t[0],o),perPositionHeight:!0});const l=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(a.color,this._layerOpacity)}),translucent:!1,renderState:{depthTest:{enabled:!0}}});let h;if(this._elevationInfo.mode===n.ElevationMode.AbsoluteHeight)h=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.color,this._layerOpacity))}}),appearance:l,asynchronous:!1,shadows:r.getShadows(e)});else{const t=Ih(this._elevationInfo.mode);h=new Cesium.GroundPrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:s,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(a.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 n;switch(i.primitive){case"sphere":r=this._primitivesCollection.add(this._createSpherePrimitive(e,t));break;case"cylinder":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:n}));break;case"cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n}));break;case"inverted-cone":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:n,bottomRadius:0}));break;case"tetrahedron":n=e.width>e.height?e.width:e.height,r=this._primitivesCollection.add(this._createCylinderPrimitive(e,t,{topRadius:0,bottomRadius:n,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)}),n=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:n,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createCylinderPrimitive(e,t,i){i=Object(n.defaultValue)(i,{topRadius:0,bottomRadius:0,slices:128});const r=e.material,a=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=new Cesium.CylinderGeometry({topRadius:i.topRadius,bottomRadius:i.bottomRadius,length:e.depth,slices:i.slices});return new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._getCesiumColorByOpacity(r.color,this._layerOpacity))}}),show:this.show,modelMatrix:a,appearance:this._createObject3DAppearance(e),asynchronous:!1})}_createModelPrimitive(e,t){const i=e.material,r=Cesium.Transforms.eastNorthUpToFixedFrame(t),n={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(n)}_createObject3DAppearance(e){const t=e.material;switch(t.type){case n.MaterialType.color:default:return new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:this._getCesiumColorByOpacity(t.color,this._layerOpacity)})})}}};var ec=class extends _h{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.PointSymbol3D||(n.Log.info("要素的符号类型不是PictureMarkerSymbol!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[]),this._primitivesCollection&&this._primitivesCollection.removeAll()}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:i=this._getPositions(),this._createPointSymbol3D(a,i[0]);break;case n.GeometryType.multiPoint:i=this._getPositions();for(let e=0;e<i.length;e++)this._createPointSymbol3D(a,i[e])}}}_createPointSymbol3D(e,t){switch(e.type){case n.Symbol3DLayerType.icon:default:this._createBillboard(e,t);break;case n.Symbol3DLayerType.text:this._createLabel(e,t);break;case n.Symbol3DLayerType.object:this._createObject(e,t)}}_createBillboard(e,t){let i;if(e.resource.href){const r=Dh(e,n.SymbolType.pictureMarker,t,this._feature);i=new xh({feature:r,billboardsCollection:this._billboardsCollection})}else{const r=Dh(e,n.SymbolType.simpleMarker,t,this._feature);i=new wh({feature:r,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection})}this._graphics.push(i)}_createLabel(e,t){const i=Dh(e,n.SymbolType.mapgisText,t,this._feature),r=new Jh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}_createObject(e,t){const i={show:this.show,layerOpacity:this._layerOpacity},n=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,t.height),a=e.resource;let o;if(a.href)o=this._primitivesCollection.add(r.createModelPrimitive(e,n,i));else{let t;switch(a.primitive){case"sphere":o=this._primitivesCollection.add(r.createSpherePrimitive(e,n,{show:this.show,layerOpacity:this._layerOpacity}));break;case"cylinder":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"cone":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"inverted-cone":t=e.width>e.height?e.width:e.height,i.topRadius=t,i.bottomRadius=0,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i));break;case"tetrahedron":t=e.width>e.height?e.width:e.height,i.topRadius=0,i.bottomRadius=t,i.slices=3,o=this._primitivesCollection.add(r.createCylinderPrimitive(e,n,i))}}o.id=this._feature.id,o.commonFeatureId=this._feature.id,o.commonLayerId=this.commonLayerId,this._primitives.push(o)}};var tc=class extends _h{constructor(e){super(e),this._graphics=Object(n.defaultValue)(this._graphics,[])}checkSymbol(){return this._feature.symbol instanceof n.LabelSymbol3D||(n.Log.info("要素的符号类型不是LabelSymbol3D!"),!1)}update(e){this._feature=e,this.destroy(),this._createPrimitive()}destroy(){this._graphics&&(this._graphics.forEach(e=>{e&&e.destroy()}),this._graphics=[])}_createPrimitive(){this._graphics=[];const e=this._feature.symbol.symbolLayers,t=this._feature.geometry;let i;for(let r=0;r<e.items.length;r++){const a=e.items[r];switch(t.type){case n.GeometryType.point:case n.GeometryType.polygon:case n.GeometryType.extent:case n.GeometryType.circle:i=this._getPositions(),this._createLabel(a,i[0]);break;case n.GeometryType.multiPoint:case n.GeometryType.multiPolygon:i=this._getPositions();for(let e=0;e<i.length;e++)this._createLabel(a,i[e])}}}_createLabel(e,t){const i=Dh(e,n.SymbolType.mapgisText,t,this._feature),r=new Jh({feature:i,billboardsCollection:this._billboardsCollection});this._graphics.push(r)}};class ic{constructor(e){e=Object(n.defaultValue)(e,{}),this.id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this.opacity=Object(n.defaultValue)(e.opacity,1),this.elevationInfo=Object(n.defaultValue)(e.elevationInfo,new n.ElevationInfo),this.cameraHeightStep=Object(n.defaultValue)(e.cameraHeightStep,1e3),this._viewer=Object(n.defaultValue)(e.viewer,{}),this._swipeEnabled=Object(n.defaultValue)(e.swipeEnabled,!1),this._swipeInverse=Object(n.defaultValue)(e.swipeInverse,0),this._graphicsCollection=[],this._primitivesCollection=new Cesium.PrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._pointsCollection=new Cesium.PointPrimitiveCollection({swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._billboardsCollection=new Cesium.BillboardCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._labelsCollection=new Cesium.LabelCollection({scene:this._viewer.scene,swipeEnabled:this._swipeEnabled,swipeInverse:this._swipeInverse}),this._allPrimitives=new Cesium.PrimitiveCollection;const t=this;this._oldCameraHeight=0,this._viewer.camera&&this._viewer.camera.changed.addEventListener(()=>{for(let e=0;e<t._graphicsCollection.length;e++){const i=t._graphicsCollection[e];if(i){if(zh(i._feature)&&(i instanceof xh||i instanceof wh||i instanceof Jh||i instanceof ec)){const e=t._viewer.camera.positionCartographic.height;Math.abs(t._oldCameraHeight-e)>t.cameraHeightStep&&(t._oldCameraHeight=e,t.update(i._feature))}}}})}addPrimitives(){this._allPrimitives.add(this._primitivesCollection),this._allPrimitives.add(this._pointsCollection),this._allPrimitives.add(this._billboardsCollection),this._allPrimitives.add(this._labelsCollection),this._viewer.scene.primitives.add(this._allPrimitives)}add(e){let t=n.Feature.fromJSON(e);let i;switch(t.elevationInfo||(t.elevationInfo=this.elevationInfo),t.additional&&t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t)),t.symbol.type){case n.SymbolType.simpleMarker:i=new wh({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.pictureMarker:i=new xh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.text:case n.SymbolType.mapgisText:i=new Jh({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.simpleLine:i=new Vh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.simpleFill:i=new Yh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.pictureFill:i=new Xh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.line3D:i=new Zh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,viewer:this._viewer});break;case n.SymbolType.polygon3D:i=new Qh({layerId:this.id,feature:t,layerOpacity:this.opacity,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;case n.SymbolType.point3D:i=new ec({layerId:this.id,feature:t,layerOpacity:this.opacity,pointsCollection:this._pointsCollection,primitivesCollection:this._primitivesCollection,billboardsCollection:this._billboardsCollection,labelsCollection:this._labelsCollection,viewer:this._viewer});break;case n.SymbolType.label3D:i=new tc({layerId:this.id,feature:t,layerOpacity:this.opacity,billboardsCollection:this._billboardsCollection,viewer:this._viewer});break;default:n.Log.error("要素的符号暂时不支持!")}i&&(this._graphicsCollection.push(i),i.setVisible&&i.setVisible(t.visible))}removeByID(e){const t=this._findGraphicById(e),i=this._graphicsCollection.indexOf(t);i>-1&&this._graphicsCollection.splice(i,1),t.destroy()}update(e){let t=n.Feature.fromJSON(e.toJSON());t.additional.hasOwnProperty("arc3")&&(t=Object(n.editFeatureByArc3)(t));const i=this._findGraphicById(e.id);i&&i._feature&&(i._feature.symbol.type!==t.symbol.type?(this.removeByID(e.id),this.add(e)):(i.update(t),i.setVisible&&i.setVisible(t.visible)))}findByID(e){return this._findGraphicById(e)}getAll(){return this._graphicsCollection}remove(e){this.removeByID(e.id)}removeAll(){if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++)this._graphicsCollection[e].destroy();this._graphicsCollection=[]}destroy(){this.removeAll(),this.id=void 0,this.opacity=void 0,this._primitivesCollection=void 0,this._pointsCollection=void 0,this._billboardsCollection=void 0,this._labelsCollection=void 0,this._allPrimitives=void 0,this._viewer=void 0}setVisible(e){this._graphicsCollection&&this._graphicsCollection.length>0&&this._graphicsCollection.forEach(function(t){t.setVisible&&t.setVisible(e)})}setOpacity(e){let t=e;if(t<0&&(t=0),t>1&&(t=1),this.opacity=t,this._graphicsCollection&&this._graphicsCollection.length>0)for(let e=0;e<this._graphicsCollection.length;e++){const i=this._graphicsCollection[e];i&&(i._layerOpacity=t,i.update(i._feature))}}_findGraphicById(e){let t=void 0;if(this._graphicsCollection&&this._graphicsCollection.length>0)for(let i=0;i<this._graphicsCollection.length;i++){const r=this._graphicsCollection[i];r.id===e&&(t=r)}return t}}Object.defineProperties(ic.prototype,{swipeEnabled:{get(){return this._swipeEnabled},set(e){"boolean"==typeof e&&(this._swipeEnabled=e,this._allPrimitives._primitives.forEach(t=>{t.swipeEnabled=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeEnabled=e})}))}},swipeInverse:{get(){return this._swipeInverse},set(e){"number"==typeof e&&(this._swipeInverse=e,this._allPrimitives._primitives.forEach(t=>{t.swipeInverse=e,t instanceof Cesium.PrimitiveCollection&&t._primitives.forEach(t=>{t.swipeInverse=e})}))}}});var rc=ic;var nc=class{static toPrimitive(e,t){const i=new rc({viewer:t&&t.viewer});if(Array.isArray(e))for(let t=0;t<e.length;t++)i.add(e[t]);else i.add(e);const r=[];return i._billboardsCollection.length>0&&r.push(i._billboardsCollection),i._labelsCollection.length>0&&r.push(i._labelsCollection),i._pointsCollection.length>0&&r.push(i._pointsCollection),i._primitivesCollection.length>0&&r.push(i._primitivesCollection),r}};var ac=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var oc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var sc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};var lc=class extends nc{static toPrimitive(e,t){return super.toPrimitive(e,t)}};function hc(e,t){this._CesiumMap=e,this._CesiumScene=e.scene,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}hc.prototype.dimensions=["lng","lat"],hc.prototype.setMapOffset=function(e){this._mapOffset=e},hc.prototype.getBMap=function(){return this._CesiumMap},hc.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 n=this._mapOffset,a=Cesium.Cartesian3.fromDegrees(e[0],e[1]);let o=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._CesiumScene,a);return[(o=o||{x:0,y:0}).x-n[0],o.y-n[1]]},hc.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]},hc.prototype.getViewRect=function(){const e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},hc.prototype.getRoamTransform=function(){return echarts.matrix.create()},hc.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],n=t[e]/2,a=[],o=[];return a[e]=r-n,o[e]=r+n,a[1-e]=i[1-e],o[1-e]=i[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(o)[e])},this)},this)}}},hc.dimensions=hc.prototype.dimensions,hc.create=function(e,t){let i;e.eachComponent("cesium",function(e){const r=echarts.cesiumMap;(i=new hc(r,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"cesium"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})};var cc=hc;let uc=0;class dc{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${uc++}`,this.layerClass=t.layerClass||"echartlayerdefaultclass",this.initDevicePixelRatio(),this.visible=Object(n.defaultValue)(t.visible,!0),this.opacity=Object(n.defaultValue)(t.opacity,1),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",cc),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.visibility=this.visible?"visible":"hidden",e.style.opacity=this.opacity,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`,n=`${parseInt(i.canvas.height)}px`;t.width=r,t.height=n,t.style.width=r,t.style.height=n,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 n=!0;echarts.cesiumMap;const a=r.getZr().painter.getViewportRoot(),o=e.coordinateSystem,s=function(i,s){if(n||!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];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})},l=function(i,s){if(n||!t.map)return;t._visible();const l=t.map.canvas,h=[-parseInt(l.style.left,10)||0,-parseInt(l.style.top,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,o.setMapOffset(h),e.__mapOffset=h,r.dispatchAction({type:"CesiumRoma"})};function h(){n||(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");n=!1}}),this.chart.setOption(this.options),this}show(){this._visible()}hide(){this._unvisible()}setOpacity(e){this.opacity=e,this.canvas.style.opacity=this.opacity}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=dc;var pc=class{constructor(e){e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,null),this.format=Object(n.defaultValue)(e.format,n.PictureFormat.png),this.filename=Object(n.defaultValue)(e.filename,"screenshotFile"),this.width=Object(n.defaultValue)(e.width,void 0),this.height=Object(n.defaultValue)(e.height,void 0),this.x=Object(n.defaultValue)(e.x,0),this.y=Object(n.defaultValue)(e.y,0),this.isDownload=Object(n.defaultValue)(e.isDownload,!0)}_addView(){const e=this;this.view._innerView.render();const t=this.view._innerView.canvas;let i=null;this.format===n.PictureFormat.png?i=t.toDataURL():this.format===n.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 a=r.getContext("2d"),o=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(){a.drawImage(s,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let i=null;e.format===n.PictureFormat.png?i=r.toDataURL():e.format===n.PictureFormat.jpeg?i=r.toDataURL("image/jpeg"):"svg"===e.format&&(i=r.toDataURL()),e.isDownload&&o(i,e.filename),t({dataUrl:i})}}else e.isDownload&&o(i,this.filename),t({dataUrl:i})})}_removeView(){}};var fc=class extends n.Evented{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this.view=Object(n.defaultValue)(e.view,""),this.location=Object(n.defaultValue)(e.location,""),this.title=Object(n.defaultValue)(e.title,""),this.content=Object(n.defaultValue)(e.content,""),this.alignment=Object(n.defaultValue)(e.alignment,"bottom-center"),this.defaultButtons=Object(n.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.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),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 a=new Cesium.Graphic({type:"div",positions:[Cesium.Cartesian3.fromDegrees(t,i,0)],style:{html:r}});this._popup=this._popupLayer.addGraphic(a),this._popup.style.pixelOffset=this._getOffset()}_contentUI(e,t){const i=this;let r=void 0;const n=function(e){const t=document.createElement("div");return t.innerHTML=e,t.childNodes};(r=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const a=document.createElement("div");a.setAttribute("class","zondy-popup__header"),a.setAttribute("style","display: flex;");const o=n('<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=n('<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=n('<div style="flex: 1;"></div>')[0];if(a.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){a.appendChild(o);let e=!0;o.onclick=function(){e=!e,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content").style.display=e?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(a.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=n('<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(a),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 n=this._contentUI(e,t);r.appendChild(n),i.appendChild(r);const a=document.createElement("div");return a.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),a.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(a),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,n=0;switch(e){case"top-left":n=-i;break;case"top-center":r=-t/2,n=-i;break;case"top-right":r=-t,n=-i;break;case"bottom-left":break;case"auto":case"bottom-center":r=-t/2;break;case"bottom-right":r=-t}return{x:r,y:n}}close(){this._popup.remove()}destroy(){this._popupLayer&&this.view._innerView.remove(this._popupLayer)}};var mc=class extends n.LayerView{onAdd(){return Bl.addVectorTileLayer(this)}onRemove(){return Bl.removeLayer(this),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t],{params:r}=i;if(i)switch(i.name){case"setPaintProperties":case"setLayoutProperties":case"setStyleLayer":case"deleteStyleLayer":default:Bl.refresh(this);break;case"opacity":Bl.setOpacity(this,r[0]);break;case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0;Bl.setVisible(this,e);break}case"clippingArea":Bl.setClipArea(this)}}return Promise.resolve(this)}};function yc(e,t,i){const r=Kl(e,i),n=i.imageryLayers.indexOf(t);if(n>=r){for(let e=0;e<n-r;e++)i.imageryLayers.lower(t);t._realIndex=e._realIndex+1}else{for(let e=0;e<r-n;e++)i.imageryLayers.raise(t);t._realIndex=e._realIndex+1}}var gc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Pr.addWMSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return Pr.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"spatialReference":Pr.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Pr.addWMSLayer(this.layer,this.innerView);break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"sublayerVisible":case"refresh":Pr.removeLayer(this.innerLayer,this.innerView),this.innerLayer=Pr.addWMSLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var vc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Gr.addWMTSLayer(t,i),r.innerLayer.alpha=t.opacity,r.innerLayer.show=r._getLayerViewVisible(),e(r)})}onRemove(e){return Gr.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(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 bc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Vr.addIGSTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Vr.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Vr.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Vr.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var _c=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=lh.addIGSMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this._getLayerViewVisible()||(this.innerLayer.alpha=0),e(this)})}onRemove(e){return lh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){if(!this.innerLayer)return Promise.resolve(this);if(e.updateContent)for(let t=0;t<e.updateContent.length;t++){const i=e.updateContent[t];if(i)switch(i.name){case"visible":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.alpha=t?this.layer.opacity:0;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":lh.removeLayer(this.innerLayer,this.innerView),this.innerLayer=lh.addIGSMapImageLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};var wc=class{static applyUpdate(e,t,i,r,a){if(r.updateContent)for(let e=0;e<r.updateContent.length;e++){const o=r.updateContent[e];if(o)switch(o.name){case"visible":switch(t.type){case n.LayerType.wms:case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:case n.LayerType.m3dCache:const e=o.params&&o.params.length>0?o.params[0]:this.layer.visible,r=a._getLayerViewVisible(e);i.show=r}break;case"opacity":switch(t.type){case n.LayerType.wms:i.alpha=t.opacity;break;case n.LayerType.m3dCache:i.translucency=t.opacity;break;case n.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 o=!1;switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}if(r.extend&&r.extend.type){switch(r.extend.type){case n.LayerEventType.layerUpdateOpacity:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:i.alpha=t.opacity,o=!0;break;case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:(i=e._innerView.scene.layers.getLayer(t.layerIndex)).translucency=t.opacity}break;case n.LayerEventType.layerUpdateVisible:switch(t.type){case n.LayerType.igsMapImage:case n.LayerType.igsTile:case n.LayerType.m3d:case n.LayerType.scene:case n.LayerType.cesium3DTiles:i.show=!i.show,o=!0}break;case n.LayerEventType.layerUpdateStyle:switch(t.type){case n.LayerType.igsVectorTile:i.updateStyle(t.style),o=!0}break;case n.LayerEventType.layerSublayerVisible:switch(t.type){case n.LayerType.igsMapImage:i._imageryProvider._layers=t.layers,o=!0}}return o?new Promise(e=>{e()}):null}}};var xc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Ul.addM3DLayer(t,i,this.view,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Ul.removeLayer(this.innerLayer,this.innerView,this.view),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return wc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Cc=class extends n.LayerView{onAdd(e){return new Promise(e=>{dh.addCesium3DTilesLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return dh.removeLayer(this.innerLayer,this.innerView),Promise.resolve(this)}onUpdate(e){const t=this.innerLayer;return wc.applyUpdate(this.view,this.layer,t,e,this),Promise.resolve(this)}};var Sc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return this._getLayerViewVisible(),new Promise(e=>{Hl.addTerrainCacheLayer(t,i,t=>{this.innerLayer=t,e(r)})})}onRemove(e){return Hl.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":Hl.setOpacity(this.layer,this.innerView)}}return Promise.resolve(this)}};class Mc{}Mc.addEchartsLayer=function(e){const{layer:t,innerView:i}=e,r=e._getLayerViewVisible(t.visible);let n=Object.assign({},t.echartsOptions);n.visible=r,n.opacity=t.opacity;const{extensionOptions:a={}}=t;n=Object.assign(n,a);const o=new dc(i,n).addTo(i);return o.id=t.id,o},Mc.removeLayer=function(e){e.remove()};var kc=Mc;var Tc=class extends n.LayerView{onAdd(e){return this.innerLayer=kc.addEchartsLayer(this),Promise.resolve(this)}onRemove(e){return kc.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity);break;case"refresh":kc.removeLayer(this.innerLayer),this.innerLayer=kc.addEchartsLayer(this)}}return Promise.resolve(this)}};var Ic=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this._getLayerViewVisible();return this.innerLayer=bh.addMapVLayer(t,i),r||this.innerLayer.hide(),Promise.resolve(this)}onRemove(e){return bh.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible;this._getLayerViewVisible(e)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this.layer.opacity)}}return Promise.resolve(this)}};var Oc=class extends n.GroupLayerView{};var Ec=class extends n.BaseGraphicsLayerView{onAdd(e){const t=this.layer,i=this.innerView,r=t.graphics||[];return this._getLayerViewVisible(),this.innerLayer=new rc({id:t.id,viewer:i,opacity:t.opacity,elevationInfo:t.elevationInfo}),this.innerLayer.addPrimitives(),this.render.drawFeature(this.innerLayer,r),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&&t.setOpacity(i[0]);break}case"visible":{const i=e.params&&e.params.length>0?e.params[0]:void 0,r=this._getLayerViewVisible(i);t.setVisible&&t.setVisible(r);break}}if(e&&"method"===e.operationType)switch(e.name){case"add":this.render.drawFeature(t,[e.params[0]]);break;case"remove":{const i=e.params;t.remove(i[0]);break}case"addMany":this.render.drawFeature(t,e.params[0]);break;case"removeMany":e.params[0].forEach(e=>{t.remove(e)});break;case"removeAll":t.removeAll()}}),Promise.resolve(this)}};var Lc=class extends n.BaseFeatureLayerView{constructor(e){super(e),this._labelClass=null}_processData(){return new Promise(e=>{e()})}onAdd(e){const t=this,i=this.innerView,r=this.layer,a=this.layer.renderer;return this._processData().then(e=>new Promise(o=>{if(t.innerLayer&&t.innerLayer.destroy(),a instanceof n.ClusterRenderer){t.innerLayer=new $h({id:r.id,viewer:i,renderer:a});const o=Object(n.getFeaturesFromFeatureSet)(e);for(let e=0;e<o.length;e++)o[e].symbol=n.Symbol.fromJSON(a.defaultSymbol.toJSON());for(let e=0;e<o.length;e++)t.innerLayer.add(o[e])}else if(a instanceof n.HeatmapRenderer)t.innerLayer=new Kh({id:r.id,viewer:i,field:a.field,valueExpression:a.valueExpression,radius:a.radius,alpha:r.opacity,gradient:a.colorStops,minDataValue:a.minDataValue,maxDataValue:a.maxDataValue,features:Object(n.getFeaturesFromFeatureSet)(e)});else{const o=this._getLayerViewVisible()?t.layer.opacity:0;if(t.innerLayer=new rc({id:r.id,viewer:i,opacity:o,elevationInfo:t.layer.elevationInfo}),t.innerLayer.addPrimitives(),e.features.length>0&&!e.features[0].geometry.spatialReference.isGeographic)for(let t=0;t<e.features.length;t++)e.features[t].geometry=n.Projection.project(e.features[t].geometry,new n.SpatialReference({wkid:4326}));t._initFeatures(e,a)}t._initDynamicLabel(e||{}),o(t)}))}_initDynamicLabel(e){const{innerView:t}=this,{labelingInfo:i,labelsVisible:r}=this.layer;r&&Array.isArray(i)&&i.length>0&&(this._dynamicLabelLayer=new pr({labelingInfo:i,scene:t.scene,visible:this.layer.visible&&r,opacity:this.layer.opacity}),this._dynamicLabelLayer.add(e.features||[]))}onRemove(e){return this._dynamicLabelLayer&&(this._dynamicLabelLayer.destroyed(),this._dynamicLabelLayer=null),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&&(t.setOpacity(e[0]),this._dynamicLabelLayer&&(this._dynamicLabelLayer.translucency=e[0]));break}case"visible":{const e=i.params&&i.params.length>0?i.params[0]:void 0,r=this._getLayerViewVisible(e);this._dynamicLabelLayer&&(this._dynamicLabelLayer.show=r),t.setVisible&&t.setVisible(r);break}case"renderer":this.onAdd(e)}if(i&&"method"===i.operationType)switch(i.name){case"refresh":this.onAdd(e)}}),Promise.resolve(this)}};var Pc=class extends Lc{_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?$l(i.spatialReference,i.extent):new Cesium.GeographicTilingScheme({rectangle:Cesium.Rectangle.fromDegrees(-180,-90,180,90),ellipsoid:Cesium.Ellipsoid.WGS84,numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1});const a=i.url,o=Object(n.getBaseUrl)(a);let s;return s="1.0"===i._igsVersion?{url:`${o}/igs/rest/mrms/layers`,gdbps:[i.gdbp],tilingScheme:e,filters:i.definitionExpression?`0:${i.definitionExpression}`:""}:{url:`${o}/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)),this.innerLayer.alpha=i.opacity,this.innerLayer.show=this._getLayerViewVisible(),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 Rc=class extends Lc{_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 jc=class extends Lc{_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 Ac=class extends n.LayerView{onAdd(e){return new Promise(e=>{Ul.addM3DLayer(this,t=>{this.innerLayer=t,e(this)})})}onRemove(e){return Ul.removeLayer(this.innerLayer,this.innerView,this.view),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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.translucency=this.layer.opacity;break;case"renderer":const r=i.params[0];this.innerLayer.renderer=Ql(r)}}return Promise.resolve(this)}};var zc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=Er.addArcGISMapImageLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return Er.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Dc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView;return new Promise(e=>{this.innerLayer=jr.addArcGISTileLayer(t,i),this.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(this)})}onRemove(e){return jr.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView)}}return Promise.resolve(this)}};var Vc=class extends n.LayerView{onAdd(e){const t=this.layer,i=this.innerView,r=this;return new Promise(e=>{r.innerLayer=Jl.addWebTileLayer(t,i),r.innerLayer.alpha=t.opacity,this.innerLayer.show=this._getLayerViewVisible(),e(r)})}onRemove(e){return Jl.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":const e=i.params&&i.params.length>0?i.params[0]:this.layer.visible,t=this._getLayerViewVisible(e);this.innerLayer.show=t;break;case"opacity":this.innerLayer.alpha=this.layer.opacity;break;case"index":yc(this.layer,this.innerLayer,this.innerView);break;case"clippingArea":this.layer.clippingArea?rh(this.layer,this.innerLayer,this.innerView):this.innerView._clipPreRenderFunction&&(this.innerLayer.swipeEnabled=!1,this.innerView.scene.preRender.removeEventListener(this.innerView._clipPreRenderFunction));break;case"refresh":Jl.removeLayer(this.innerLayer,this.innerView),self.innerLayer=Jl.addIGSTileLayer(this.layer,this.innerView)}}return Promise.resolve(this)}};function Nc(e){const t=n.Feature.fromJSON(e);return t.geometry.spatialReference.isGeographic||(t.geometry=n.Projection.project(t.geometry,new n.SpatialReference({wkid:4326}))),t}function Gc(e){const t=[];if(e instanceof n.FeatureSet)for(let i=0;i<e.features.length;i++)t.push(Nc(e.features[i]));else if(e instanceof n.FeatureCollection)e.forEach(e=>{t.push(Nc(e))});else for(let i=0;i<e.length;i++)t.push(Nc(e[i]));return t}var Fc=class extends n.FeatureRender{drawFeature(e,t){const i=Gc(t);if(e)for(let t=0;t<i.length;t++)e.add(i[t])}updateFeature(e,t,i){const r=Gc(t);if(e)for(let t=0;t<r.length;t++)e.update(r[t])}clearFeature(e,t){if(e)for(let i=0;i<t.length;i++)e.remove(t[i])}clear(e){e&&e.removeAll()}};var Bc=function(e){Bc.instance={tokenKey:e.tokenKey,tokenValue:e.tokenValue,headers:e.headers,request:e.request}},qc=Bc;class Uc extends n.SceneView{constructor(e){super(e),e=Object(n.defaultValue)(e,{}),this._center=Object(n.defaultValue)(e.center,new n.Point({coordinates:[0,0]})),this._center&&Array.isArray(this._center)&&this._center.length>1&&(this._center=new n.Point({coordinates:[this._center[0],this._center[1],this._center[2]]})),this._scale=Object(n.defaultValue)(e.scale,void 0),this._zoom=Object(n.defaultValue)(e.zoom,3),this.minZoom=Object(n.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(e.maxZoom,void 0),this._extent=Object(n.defaultValue)(e.extent,void 0),this.width=void 0,this.height=void 0,this._spatialReference=new n.SpatialReference("EPSG:4326"),this.popup=Object(n.defaultValue)(e.popup,void 0),this.stationary=!0,this.engineType="cesium",this._innerView=Object(n.defaultValue)(e.innerView,void 0),this._innerView||(this._innerView=new Cesium.Viewer(this._viewId,this.extensionOptions)),qc(n.Config),this._initSize(),this._extent?this._initExtent():(this._initScale(),this._initZoom()),this._initViewEvent(),this._initPopup(),this._map._initCesiumView=!0,this._showLayerByScale()}_initViewEvent(){const e=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null},this._screenSpaceEventHandler=new Cesium.ScreenSpaceEventHandler(this._innerView.scene.canvas),this.fire(n.ViewEventType.loaded,{}),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore=setTimeout(function(){e._clickStore&&e.fire(n.ViewEventType.click,ch.getMouseEvent(t,e))},300),e.fire(n.ViewEventType.immediateClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.MIDDLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e._clickStore&&(clearTimeout(e._clickStore),e._clickStore=null),e.fire(n.ViewEventType.doubleClick,ch.getMouseEvent(t,e))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(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._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.LEFT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(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._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action))),e._dragParams={isDrag:!1,origin:null,action:"",button:null}},Cesium.ScreenSpaceEventType.RIGHT_UP),this._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerDown,ch.getMouseEvent(t,e)),this._dragParams.isDrag||(t.originalEvent&&(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._screenSpaceEventHandler.setInputAction(t=>{e.fire(n.ViewEventType.pointerUp,ch.getMouseEvent(t,e)),e._dragParams.isDrag&&(this._dragParams.action="end",e.fire(n.ViewEventType.drag,ch.getDragEvent(t,e,e._dragParams.origin,this._dragParams.action)),e._dragParams={isDrag:!1,origin:null,action:"",button:null})},Cesium.ScreenSpaceEventType.MIDDLE_UP),this._screenSpaceEventHandler.setInputAction(t=>{t.position=t.endPosition,e.fire(n.ViewEventType.pointerMove,ch.getMouseEvent(t,e)),e._dragParams.isDrag?(e.fire(n.ViewEventType.drag,ch.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.camera.moveEnd.addEventListener(t=>{e._cameraMoveEndHandler(),e.fire(n.ViewEventType.viewChange,ch.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(n.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(n.ViewEventType.keyDown,ch.getKeyEvent(t,e))}),t.addEventListener("keyup",t=>{e.fire(n.ViewEventType.keyUp,ch.getKeyEvent(t,e))})}_mapActionControl(e,t){"drag-pan"===e&&(this._innerView.scene.screenSpaceCameraController.enableRotate=t)}flyTo(e){e=Object(n.defaultValue)(e,{});const t=Object(n.defaultValue)(e.duration,2),i=Object(n.defaultValue)(e.orientation,void 0),r=Object(n.defaultValue)(e.cancel,void 0),a=Object(n.defaultValue)(e.endTransform,void 0),o=Object(n.defaultValue)(e.maximumHeight,void 0),s=Object(n.defaultValue)(e.flyOverLongitude,void 0),l=Object(n.defaultValue)(e.flyOverLongitudeWeight,void 0),h=Object(n.defaultValue)(e.convert,void 0),c=Object(n.defaultValue)(e.easingFunction,void 0),u=this._getFlyToCenter(e),d=this._getFlyToExtent(e),p=function(t){e.complete instanceof Function&&e.complete(t)};Object(n.isNull)(u)?Object(n.isNull)(d)||this._innerView.camera.flyTo({destination:Cesium.Rectangle.fromDegrees(d.xmin,d.ymin,d.xmax,d.ymax),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c}):this._innerView.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(u.coordinates[0],u.coordinates[1],u.coordinates[2]),duration:t,orientation:i,complete:p,cancel:r,endTransform:a,maximumHeight:o,flyOverLongitude:s,flyOverLongitudeWeight:l,convert:h,easingFunction:c})}goTo(e={},t={}){let i,r,a=new Promise(e=>{e()});if(this._innerView){let o;if(Object(n.isNull)(e.center)&&Object(n.isNull)(e.zoom)&&Object(n.isNull)(e.scale)||(i=Object(n.isNull)(e.center)?this._center:this._getFlyToCenter({center:e.center}),r=!Object(n.isNull)(e.scale)&&e.scale>0?this._getZoomByScale(e.scale):!Object(n.isNull)(e.zoom)&&e.zoom>0?e.zoom:this._zoom),!Object(n.isNull)(e.target)){const t=this._getTargetExtent(e.target);t.xmin!==t.xmax&&t.ymin!==t.ymax?o=t:i=this._getFlyToCenter({center:new n.Point({coordinates:[t.xmin,t.ymin]})})}const s={animate:!0,duration:.2};let l;if(Object(n.isNull)(t)||(Object(n.isNull)(t.animate)||(s.animate=t.animate),Object(n.isNull)(t.duration)||(s.duration=t.duration/1e3),Object(n.isNull)(t.orientation)||(s.orientation=t.orientation)),Object(n.isNull)(i))Object(n.isNull)(o)||(l=Cesium.Rectangle.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax));else{let e;e=r?this._getAltitudeByZoom(r):void 0!==i.coordinates[2]?i.coordinates[2]:this._getAltitudeByZoom(this._zoom),l=Cesium.Cartesian3.fromDegrees(i.coordinates[0],i.coordinates[1],e)}l&&(a=new Promise(e=>{const t={destination:l,complete:function(){e()}};Object.assign(t,s),this._innerView.camera.flyTo(t)}))}return a}_createLayerView(e){let t=null;return e&&e.autoAddTo3D&&(t=function(e,t){let i=null;switch(t.type){case n.LayerType.vectorTile:case n.LayerType.igsVectorTile:case n.LayerType.arcgisVectorTile:i=new mc({view:e,layer:t});break;case n.LayerType.wmts:i=new vc({view:e,layer:t});break;case n.LayerType.igsMapImage:i=new _c({view:e,layer:t});break;case n.LayerType.igsTile:i=new bc({view:e,layer:t});break;case n.LayerType.wms:i=new gc({view:e,layer:t});break;case n.LayerType.m3d:i=new xc({view:e,layer:t});break;case n.LayerType.cesium3DTiles:i=new Cc({view:e,layer:t});break;case n.LayerType.scene:i=new vr({view:e,layer:t});break;case n.LayerType.terrain:i=new Sc({view:e,layer:t});break;case n.LayerType.echarts:i=new Tc({view:e,layer:t});break;case n.LayerType.mapv:i=new Ic({view:e,layer:t});break;case n.LayerType.group:i=new Oc({view:e,layer:t});break;case n.LayerType.graphics:i=new Ec({view:e,layer:t,render:new Fc});break;case n.LayerType.igsFeature:i=new Pc({view:e,layer:t,render:new Fc});break;case n.LayerType.geojson:i=new Rc({view:e,layer:t,render:new Fc});break;case n.LayerType.wfs:i=new jc({view:e,layer:t,render:new Fc});break;case n.LayerType.m3dCache:i=new Ac({view:e,layer:t});break;case n.LayerType.arcgisMapImage:i=new zc({view:e,layer:t});break;case n.LayerType.arcgisTile:i=new Dc({view:e,layer:t});break;case n.LayerType.webTileLayer:i=new Vc({view:e,layer:t})}return i}(this,e)),t}toJSON(){return super.toJSON()}toMap(e){let t=null;const i=new Cesium.Cartesian2(e.x,e.y);if(this._innerView.scene.globe.translucency.enabled||!this._innerView.scene.globe.depthTestAgainstTerrain){const e=this._innerView.camera.getPickRay(i);t=this._innerView.scene.globe.pick(e,this._innerView.scene)}else i.y=i.y+1,t=this._innerView.scene.pickPosition(i);let r=null;if(t&&!Object(n.isNull)(t)){const e=this._innerView.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.longitude),a=Cesium.Math.toDegrees(e.latitude),o=e.height;r=new n.Point({coordinates:[i,a,o]})}return r}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,a=new n.Point({coordinates:[t,i,r]});return this._center=a,a}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 n.Point({coordinates:[e[0],e[1],i]}),t=!0):e instanceof n.Point&&(this._center=new n.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();let t;return t=e?new n.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}):new n.Extent({xmin:-180,ymin:-90,xmax:180,ymax:90}),this._extent=t,t}setExtent(e){this._innerView&&(this._extent=e,this.flyTo({extent:e}))}getInnerLayer(e){if(e instanceof n.Layer)return super.getInnerLayer(e);if(e instanceof n.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 fc({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,a=this.getLayer(r.commonLayerId);if(Object(n.isNull)(r.commonLayerId))return;let o=null;if(a.type===n.LayerType.igsFeature||a.type===n.LayerType.geojson){o=this._getLayerView(a)._featureSetCache.filter(e=>{if(e.id===r.commonFeatureId)return e})}else a.type===n.LayerType.graphics&&(o=a.graphics.filter(e=>{if(e.id===r.commonFeatureId)return e}));const s={graphic:o&&o.items.length>0?o.items[0]:null,layer:a,mapPoint:this.toMap(e),type:"graphic"};t.push(s)}}),t}_cameraMoveEndHandler(){this.getCenter(),this.getExtent(),this.getZoom(),this.getScale(),this._showLayerByScale()}_initSize(){const e=this._innerView.canvas;this.width=e.width,this.height=e.height}_setCursor(e){this._innerView&&(e&&null!==e?(this._innerView._container.style.cursor=e,this._innerView.canvas.style.cursor=e):(this._innerView._container.style.removeProperty("cursor"),this._innerView.canvas.style.removeProperty("cursor")),this._cursor=e)}_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 n.Point({coordinates:[i,r,t]}),this.flyTo({center:this._center})}}}_initZoom(){if(!this.scale&&!Object(n.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 n.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(n.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],a=new n.Point({coordinates:[i,r,t]});this.flyTo({center:a})}}}_setZoomAndCenter(e){if(this._innerView&&!Object(n.isNull)(e.zoom)&&!Object(n.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 a=new n.Point({coordinates:[t,i,r]});this._center=a,this.flyTo({center:a})}}}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 n.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 pc(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)}_moveLayerView(e,t){let i=t;const r=e.innerView;let n,a;if(e instanceof Ec||e instanceof Rc||e instanceof Pc||e instanceof jc||t instanceof Ec||t instanceof Rc||t instanceof Pc||t instanceof jc){n=r.scene._primitives._primitives.indexOf(e.innerLayer._allPrimitives);let t=(a=r.scene._primitives._primitives.indexOf(i.innerLayer._allPrimitives))-n;if(t>1)for(let i=0;i<t-1;i++)r.scene._primitives.raise(e.innerLayer._allPrimitives);else if(t<0){t=Math.abs(t);for(let e=0;e<t;e++)r.scene._primitives.raise(i.innerLayer._allPrimitives)}}else if(!(e instanceof Ec||e instanceof Rc||e instanceof Pc||e instanceof jc||t instanceof Ec||t instanceof Rc||t instanceof Pc||t instanceof jc)&&this._isLayerViewSupportReorder(e)){if(!this._isLayerViewSupportReorder(t)){const e=this.allLayerViews.toArray();for(let r=this.allLayerViews.indexOf(t)+1;r<e.length;r++)if(this._isLayerViewSupportReorder(e[r])){i=e[r];break}}n=r.imageryLayers.indexOf(e.innerLayer);let o=(a=r.imageryLayers.indexOf(i.innerLayer))-n;if(o>1)for(let t=0;t<o-1;t++)r.imageryLayers.raise(e.innerLayer);else if(o<0){o=Math.abs(o);for(let e=0;e<o;e++)r.imageryLayers.raise(i.innerLayer)}}}}Uc.fromJSON=function(e){return e=Object(n.defaultValue)(e,{}),new Uc(e)},Object.defineProperties(Uc.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}}});var Wc=Uc;var Hc=class extends n.SketchEditor3D{constructor(e){super(e),this.arcType=Object(n.defaultValue)(e.arcType,n.ArcType.rhumb)}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,t=t=>{if(!t||!t.x||!t.y)return;if(e._drawTool&&e._drawTool._editMode===n.SketchEditMode.DRAWING)return;let i=void 0,r=!1;if(e._drawTool&&e._drawTool.sketchStage&&e._drawTool.sketchStage.selectBoxGraphics.length>0&&e.view._innerView.scene.drillPick({x:t.x,y:t.y}).forEach(n=>{if(n.primitive&&(e._layer&&e._layer.id===n.primitive.commonLayerId||e._sketchInnerLayer.id===n.primitive.commonLayerId)&&e._drawTool.sketchStage.entityGraphic.id===n.primitive.commonFeatureId){const a=e.view._innerView.camera.getPickRay({x:t.x,y:t.y}),o=e.view._innerView.scene.pickFromRay(a,[n.primitive]);o&&o.object&&o.object.primitive&&(r=!0,i=o.object)}}),r||(i=e.view._innerView.scene.pick({x:t.x,y:t.y})),i&&i.primitive&&(e._layer&&e._layer.id===i.primitive.commonLayerId||e._sketchInnerLayer.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=()=>{if(e._editable&&(void 0===e._drawTool||null===e._drawTool||3!==e._drawTool._editMode)){if(r.hitTestFeature(r.sketchStage.entityGraphic,t),void 0!==e._drawTool&&null!==e._drawTool&&(e.fire("selected",{isSelected:!0,selectedDrawTool:e._drawTool,selectedGeometry:e._drawTool.sketchStage.entityGraphic.geometry},e),!r._parent&&0===r._editMode)){const t=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:e,toolEventInfo:null,state:n.SketchEditorState.start,feature:e._drawTool.sketchStage.entityGraphic,geometry:e._drawTool.sketchStage.entityGraphic.geometry});e.fire(n.SketchEditorEventType.update,t)}e.view.off(n.ViewEventType.mouseUp,i)}};e.view.on(n.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)}}};this._hitTestSketchHandler||(this.view.on(n.ViewEventType.mouseDown,t),this._hitTestSketchHandler=t)}_getCenterCoordinate(e,t,i){let r;return 2===(i=void 0!==i?i:this.arcType)&&(r=Ii.a.calcRhumbArcCenter(e,t)),r=1===i?Ii.a.calcCartesianArcCenter(e,t):[(e[0]+t[0])/2,(e[1]+t[1])/2]}_getHight(){return 0}};var Yc=class{static async fromUrl(e,t){const i=new n.ArcGISTileLayer({url:e}),r=await i.load(),a=jr.initializeOptions(r);return new Cesium.UrlTemplateImageryProvider({...a,...t})}};var Xc=class{static async fromUrl(e,t){const i=new n.WMSLayer({url:e}),r=await i.load(),a=Pr.initializeOptions(r);return new Cesium.WebMapServiceImageryProvider({...a,...t})}};var Jc=class{static async fromUrl(e,t={}){t=Object(n.defaultValue)(t,{});const i=new n.WMTSLayer({url:e}),r=await i.load(),a=Gr.initializeOptions(r),o=new Cesium.WebMapTileServiceImageryProvider({...a,...t});return o.isStretchImage=Object(n.defaultValue)(t.isStretchImage,!1),o}};var $c=class extends Gl{static async fromUrl(e,t){const i=new n.ArcGISVectorTileLayer({url:e}),r=await i.load(),a=Bl.initializeOptions(r);return new Gl({...a,...t})}};var Kc=class{static fromUrl(e,t){const i=new n.M3DModelCacheLayer({url:e}),r=Ul.initializeOptions(i);return(t||t.viewer)&&(r._scene=t.viewer.scene),new Cesium.MapGISM3DSet({...r,...t})}};function Zc(){Cesium.ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){const r=e.data;if(Cesium.defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(Cesium.defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;const n=this._imageryProvider;if(Cesium.defined(i)||(i=r.imagery.length),!Cesium.defined(n))return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;const a=n.tilingScheme.projection instanceof Cesium.WebMercatorProjection&&e.rectangle.north<Cesium.WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-Cesium.WebMercatorProjection.MaximumLatitude,o=Cesium.Rectangle.intersection(n.rectangle,this._rectangle,this.imageryBoundsScratch);let s=Cesium.Rectangle.intersection(e.rectangle,o,this.tileImageryBoundsScratch);if(!Cesium.defined(s)){if(!this.isBaseLayer())return!1;const t=o,i=e.rectangle;s=this.tileImageryBoundsScratch,i.south>=t.north?(s.north=t.north,s.south=t.north):i.north<=t.south?(s.north=t.south,s.south=t.south):(s.south=Math.max(i.south,t.south),s.north=Math.min(i.north,t.north)),i.west>=t.east?(s.west=t.east,s.east=t.east):i.east<=t.west?(s.west=t.west,s.east=t.west):(s.west=Math.max(i.west,t.west),s.east=Math.min(i.east,t.east))}let l=0;s.south>0?l=s.south:s.north<0&&(l=s.north);let h=function(e,t,i){const r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,o=kr.isGeographic(e._imageryProvider.tilingScheme.projection)?1:Math.cos(i);let s=0,l=t;if(kr.isGeographic(e._imageryProvider.tilingScheme.projection)&&(l=t/(Math.PI*a.maximumRadius*o/180)),n._tileInfo&&n.getTileLevelByResolution)s=n.getTileLevelByResolution(l);else{const e=n.rectangle.width,i=a.maximumRadius*e*o/(r.tileWidth*n.getNumberOfXTilesAtLevel(0))/t;s=Math.log(i)/Math.log(2)}return Math.round(s)||0}(this,1*t.getLevelMaximumGeometricError(e.level),l);h=Math.max(0,h);const c=n.maximumLevel,u=!(void 0!==n.isStretchImage&&!n.isStretchImage);if(h>c){if(!u)return!1;h=c}if(Cesium.defined(n.minimumLevel)){const e=n.minimumLevel;if(h<e){if(!u)return!1;h=e}}const d=n.tilingScheme,p=d.positionToTileXY(Cesium.Rectangle.northwest(s),h),f=d.positionToTileXY(Cesium.Rectangle.southeast(s),h);let m=e.rectangle.width/512,y=e.rectangle.height/512;const g=d.tileXYToRectangle(p.x,p.y,h);Math.abs(g.south-e.rectangle.north)<y&&p.y<f.y&&++p.y,Math.abs(g.east-e.rectangle.west)<m&&p.x<f.x&&++p.x;const v=d.tileXYToRectangle(f.x,f.y,h);Math.abs(v.north-e.rectangle.south)<y&&f.y>p.y&&--f.y,Math.abs(v.west-e.rectangle.east)<m&&f.x>p.x&&--f.x;const b=Cesium.Rectangle.clone(e.rectangle,this.terrainRectangleScratch),_=d.tileXYToRectangle(p.x,p.y,h),w=d.tileXYToRectangle(f.x,f.y,h);let x,C,S=new Cesium.Rectangle(_.west,w.south,w.east,_.north),M=Cesium.Rectangle.intersection(S,o,this.clippedRectangleScratch);a?(d.rectangleToNativeRectangle(b,b),d.rectangleToNativeRectangle(S,S),d.rectangleToNativeRectangle(M,M),d.rectangleToNativeRectangle(o,o),x=d.tileXYToNativeRectangle.bind(d),m=b.width/512,y=b.height/512):x=d.tileXYToRectangle.bind(d);let k,T=0,I=1;!this.isBaseLayer()&&M&&Math.abs(M.west-b.west)>=m&&(T=Math.min(1,(M.west-b.west)/b.width)),!this.isBaseLayer()&&M&&Math.abs(M.north-b.north)>=y&&(I=Math.max(0,(M.north-b.south)/b.height));const O=I,E=[],L=[];let P,R=void 0,j=void 0;if(d._axisDirection&&d._axisDirection.y>0){for(P=p.y;P>=f.y;P--)E.push(P);j=f.y}else{for(P=p.y;P<=f.y;P++)E.push(P);j=p.y}if(d._axisDirection&&d._axisDirection.x<0){for(P=p.x;P>=f.x;P--)L.push(P);R=f.x}else{for(P=p.x;P<=f.x;P++)L.push(P);R=p.x}for(let e=0;e<L.length;e++){const t=L[e];C=T;const n=x(t,j,h),s=x(t,Math.max(...E),h);if(S=new Cesium.Rectangle(Math.min(n.west,s.west),Math.min(n.south,s.south),Math.max(n.east,s.east),Math.max(n.north,s.north)),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),Cesium.defined(M)){T=Math.min(1,(M.east-b.west)/b.width),t===f.x&&(this.isBaseLayer()||Math.abs(M.east-b.east)<m)&&(T=1),I=O;for(let e=0;e<E.length;e++){const n=E[e];if(k=I,S=x(t,n,h),M=Cesium.Rectangle.simpleIntersection(S,o,this.clippedRectangleScratch),!Cesium.defined(M))continue;I=Math.max(0,(M.south-b.south)/b.height),n===f.y&&(this.isBaseLayer()||Math.abs(M.south-b.south)<y)&&(I=0);const s=new Cesium.Cartesian4(C,I,T,k),l=this.getImageryFromCache(t,n,h);r.imagery.splice(i,0,new Cesium.TileImagery(l,s,a)),++i}}}return!0},Cesium.ImageryLayer.prototype._requestImagery=function(e){const t=this._imageryProvider,i=this;function r(t){if(!Cesium.defined(t))return n();e.image=t,e.state=Cesium.ImageryState.RECEIVED,e.request=void 0,Cesium.TileProviderError.handleSuccess?Cesium.TileProviderError.handleSuccess(i._requestImageError):Cesium.TileProviderError.reportSuccess(i._requestImageError)}function n(r){if(e.request.state===Cesium.RequestState.CANCELLED)return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);e.state=Cesium.ImageryState.FAILED,e.request=void 0;const n="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";Cesium.TileProviderError.handleError?i._requestImageError=Cesium.TileProviderError.handleError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,a,r):(i._requestImageError=Cesium.TileProviderError.reportError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,r),i._requestImageError.retry&&a())}function a(){const i=new Cesium.Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.IMAGERY});let a;e.request=i,e.state=Cesium.ImageryState.TRANSITIONING,a=t instanceof Cesium.WebMapTileServiceImageryProvider&&Cesium.defined(t._tileMatrixLabels)?e.level:function(e){let i=e.level;t.tilingScheme&&t.tilingScheme._tileInfo&&(i=t.tilingScheme._tileInfo.lods[e.level].level);return i}(e);const o=t.requestImage(e.x,e.y,a,i);if(!Cesium.defined(o))return e.state=Cesium.ImageryState.UNLOADED,void(e.request=void 0);Cesium.defined(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),"function"==typeof o.then?o.then(r,n):Promise.resolve(o).then(r,n)}a()}}let Qc;function eu(){if(window.Cesium){try{n.Log.info("Cesium原型链修改完毕"),Zc()}catch(e){console.error(e)}window.removeEventListener("load",eu),window.document.removeEventListener("readystatechange",eu),window.document.removeEventListener("DOMContentLoaded",eu),window.clearInterval(Qc)}}window.addEventListener("load",eu),window.document.addEventListener("readystatechange",eu),window.document.addEventListener("DOMContentLoaded",eu),Qc=setInterval(()=>{eu()},20),i.d(t,"SceneViewCesium",function(){return Wc}),i.d(t,"SceneView",function(){return Wc}),i.d(t,"SketchEditorCesium",function(){return Hc}),i.d(t,"SketchEditor",function(){return Hc}),i.d(t,"CesiumInnerGraphicsLayer",function(){return rc}),i.d(t,"getTilingScheme",function(){return $l}),i.d(t,"getProviderExtent",function(){return Zl}),i.d(t,"MapGISMapServerImageryProvider",function(){return oh}),i.d(t,"MapGISTileServerImageryProvider",function(){return zr}),i.d(t,"CustomTilingScheme",function(){return gr}),i.d(t,"MapGISVectorTileImageryProvider",function(){return Gl}),i.d(t,"ArcGISMapServerImageryProvider",function(){return Ir}),i.d(t,"ArcGISTileServerImageryProvider",function(){return Yc}),i.d(t,"WebMapServiceImageryProvider",function(){return Xc}),i.d(t,"WebMapTileServiceImageryProvider",function(){return Jc}),i.d(t,"UrlTemplateImageryProvider",function(){return Yl}),i.d(t,"ArcGISVectorTileImageryProvider",function(){return $c}),i.d(t,"MapGISTerrainProvider",function(){return Mr}),i.d(t,"MapGISM3DSet",function(){return Kc}),i.d(t,"initializeOptions",function(){return nh}),i.d(t,"EchartsLayer",function(){return dc}),i.d(t,"MapvLayer",function(){return gh}),i.d(t,"GeoJSONLayerUtil",function(){return ac}),i.d(t,"GraphicsLayerUtil",function(){return oc}),i.d(t,"IGSFeatureLayerUtil",function(){return sc}),i.d(t,"WFSLayerUtil",function(){return lc}),i.d(t,"Screenshot",function(){return pc}),i.d(t,"Popup",function(){return fc}),i.d(t,"MapGISTileAvailability",function(){return Cr}),n.zondy.cesium={},n.zondy.cesium.MapGISMapServerImageryProvider=oh,n.zondy.cesium.MapGISTileServerImageryProvider=zr,n.zondy.cesium.MapGISVectorTileImageryProvider=Gl,n.zondy.cesium.ArcGISMapServerImageryProvider=Ir,n.zondy.cesium.ArcGISTileServerImageryProvider=Yc,n.zondy.cesium.ArcGISVectorTileImageryProvider=$c,n.zondy.cesium.WebMapServiceImageryProvider=Xc,n.zondy.cesium.WebMapTileServiceImageryProvider=Jc,n.zondy.cesium.UrlTemplateImageryProvider=Yl,n.zondy.cesium.MapGISTerrainProvider=Mr,n.zondy.cesium.MapGISTileAvailability=Cr,n.zondy.cesium.layer={},n.zondy.cesium.layer.EchartsLayer=dc,n.zondy.cesium.layer.MapVLayer=gh,n.zondy.cesium.layer.GraphicsLayer=rc,n.zondy.cesium.tool={},n.zondy.cesium.tool.sketch={},n.zondy.cesium.tool.sketch.SketchEditor=Hc,n.zondy.cesium.tool.Screenshot=pc,n.zondy.cesium.widget={},n.zondy.cesium.widget.Popup=fc,n.zondy.cesium.util={},n.zondy.cesium.util.getTilingScheme=$l,n.zondy.cesium.util.getProviderExtent=Zl,n.zondy.cesium.util.initializeOptions=nh,n.zondy.cesium.util.GeoJSONLayerUtil=ac,n.zondy.cesium.util.GraphicsLayerUtil=oc,n.zondy.cesium.util.IGSFeatureLayerUtil=sc,n.zondy.cesium.WFSLayerUtil=lc,n.zondy.cesium.CustomTilingScheme=gr,n.zondy.cesium.MapGISM3DSet=Kc,n.zondy.cesium.SceneView=Wc,n.zondy.cesium.VERSION="17.2.6",n.Zondy.CesiumInnerGraphicsLayer=rc,n.Zondy.MapGISMapServerImageryProvider=oh,n.Zondy.MapGISTileServerImageryProvider=zr,n.Zondy.MapGISVectorTileImageryProvider=Gl,n.Zondy.ArcGISMapServerImageryProvider=Ir,n.Zondy.ArcGISTileServerImageryProvider=Yc,n.Zondy.ArcGISVectorTileImageryProvider=$c,n.Zondy.WebMapServiceImageryProvider=Xc,n.Zondy.WebMapTileServiceImageryProvider=Jc,n.Zondy.UrlTemplateImageryProvider=Yl,n.Zondy.MapGISTerrainProvider=Mr,n.Zondy.MapGISTileAvailability=Cr,n.Zondy.EchartsLayer=dc,n.Zondy.MapvLayer=gh,n.Zondy.SketchEditorCesium=Hc,n.Zondy.Screenshot=pc,n.Zondy.Popup=fc,n.Zondy.getTilingScheme=$l,n.Zondy.getProviderExtent=Zl,n.Zondy.initializeOptions=nh,n.Zondy.GeoJSONLayerUtil=ac,n.Zondy.GraphicsLayerUtil=oc,n.Zondy.IGSFeatureLayerUtil=sc,n.Zondy.WFSLayerUtil=lc,n.Zondy.CustomTilingScheme=gr,n.Zondy.MapGISM3DSet=Kc,n.Zondy.SceneViewCesium=Wc,n.Zondy.PluginVersion=n.zondy.cesium.VERSION}]);