gis-leaflet-helper 2.1.22 → 2.1.23

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.
@@ -10031,11 +10031,11 @@ const Wa = new M.Proj.CRS(
10031
10031
  SATELITE_NO_ANNO: "img_no_anno"
10032
10032
  },
10033
10033
  style: {
10034
- NORMAL: "1",
10035
- GRAY: "2",
10036
- DARK: "3",
10037
- BROWN: "4",
10038
- BLUR: "5"
10034
+ NORMAL: "normal",
10035
+ GRAY: "gray",
10036
+ DARK: "dark",
10037
+ BROWN: "brown",
10038
+ BLUR: "blur"
10039
10039
  },
10040
10040
  options: {
10041
10041
  provide: "tdt",
@@ -10406,7 +10406,7 @@ function Tf(i) {
10406
10406
  },
10407
10407
  initialize(n, r = {}, o) {
10408
10408
  var l;
10409
- if (typeof n == "string" && (n = document.querySelector("#" + n)), !n instanceof HTMLElement || !n.clientWidth || !n.clientHeight)
10409
+ if (typeof n == "string" && (n = document.getElementById(n)), !n instanceof HTMLElement || !n.clientWidth || !n.clientHeight)
10410
10410
  throw new Error("地图容器不存在或元素尺寸为0");
10411
10411
  this.lang = typeof r.lang == "string" ? r.lang : "zh_CN", this.clsPrefix = typeof r.clsPrefix == "string" ? r.clsPrefix : "gis2d", Tf(this.clsPrefix), M.Util.setOptions(this, r), M.Control.Zoom.mergeOptions({
10412
10412
  position: ((l = this.options.zoomControl) == null ? void 0 : l.position) || "topleft",
@@ -10425,7 +10425,7 @@ function Tf(i) {
10425
10425
  this
10426
10426
  ), r.debug ? (document.onselectstart = () => r.debug.allowSelect, n.oncontextmenu = () => r.debug.allowContextmenu, document.onkeydown = function(f) {
10427
10427
  if (f && f.keyCode === 123) return r.debug.allowDevtool;
10428
- }) : (document.onkeydown = function(f) {
10428
+ }) : process.env.NODE_ENV !== "development" && (document.onkeydown = function(f) {
10429
10429
  if (f && f.keyCode === 123) return !1;
10430
10430
  }, n.oncontextmenu = () => !1), i[o || "$m"] = this;
10431
10431
  },
@@ -10434,7 +10434,7 @@ function Tf(i) {
10434
10434
  },
10435
10435
  setCursor(n = "default") {
10436
10436
  const r = this.getContainer();
10437
- ["auto", "pointer", "crosshair", "move", "text", "wait", "help", "grab", "default"].includes(n) ? r.style.cursor = n : r.style.cursor = typeof n == "string" ? `url(${"./images/cursor/" + n + ".cur"}), auto` : `url(${n}), auto`;
10437
+ ["auto", "pointer", "crosshair", "move", "text", "wait", "help", "grab", "default"].includes(n) ? r.style.cursor = `${n}` : r.style.cursor = typeof n == "string" ? `url(${"./images/cursor/" + n + ".cur"}), auto` : `url(${n}), auto`;
10438
10438
  },
10439
10439
  flyTo(n, r = 0, o = { animate: !1 }) {
10440
10440
  n instanceof M.Marker ? (n = n._latlng, M.Map.prototype.flyTo.call(this, n, r || this.getZoom(), o)) : n instanceof M.Path || n instanceof M.FeatureGroup ? (n = n.getBounds(), M.Map.prototype.flyToBounds.call(this, n, o)) : M.Map.prototype.flyTo.call(this, n, r || this.getZoom(), o);
@@ -6,7 +6,7 @@
6
6
  (约:`+Number(b*.0015).toFixed(3)+"亩)",A},updateMeasurements(){if(!this._measurementLayer)return this;const i=this.getLatLngs();new Array().push(i);let n=this.getLatLngs();const r=this instanceof M.Polygon,o=this._measurementOptions;let l,f,c,d,m;if(n&&n.length&&M.Util.isArray(n[0])&&(n=n[0]),this._measurementLayer.clearLayers(),this._measurementOptions.showDistances&&n.length>1){i.length-1;for(let v=1,p=n.length;r&&v<=p||v<p;v++)if(l=n[v-1],f=n[v%p],l.distanceTo(f),c=this._map.latLngToLayerPoint(l),d=this._map.latLngToLayerPoint(f),m=c.distanceTo(d),m>=o.minPixelDistance){const y=this.tempMoveFormatDistance(l,f);new Ni(this._map.layerPointToLatLng([(c.x+d.x)/2,(c.y+d.y)/2]),y,o.lang.segmentLength,this._getRotation(l,f),o).addTo(this._measurementLayer)}!r&&this._measurementOptions.showAggregate&&(new Ni(f,this.tempFormatDistance(i),o.lang.totalLength,0,o).addTo(this._measurementLayer),this.MEASUREDDATA=this.tempFormatDistance(i))}return r&&o.showArea&&n.length>2&&(new Ni(this.getBounds().getCenter(),this.tempFormatArea(i[0]),o.lang.totalArea,0,o).addTo(this._measurementLayer),this.MEASUREDDATA=this.tempFormatArea(i[0])),this},_getRotation(i,s){const n=this._map.project(i),r=this._map.project(s);return Math.atan((r.y-n.y)/(r.x-n.x))}}),M.LatLng.prototype.toArray=function(){return[this.lat,this.lng]},M.Path.include({getArea(i){var s,n=this._latlngs[0],r=(i||this._map).options.crs,o=n.length;let l=0,f,c;if(n!=null)for(let d=0;d<o;d++)s=(d+1)%o,f=180<n[d].lng&&90<n[d].lat?{x:n[d].lat,y:n[d].lng}:r.project(n[d]),c=180<n[s].lng&&90<n[s].lat?{x:n[s].lat,y:n[s].lng}:r.project(n[s]),l=(l+=f.x*c.y)-f.y*c.x;return Math.abs(l/2)},getLength(i){for(var s=[],n=(i||this._map).options.crs,r=this._latlngs,o=0;o<r.length;o++)this instanceof M.Polygon?s.push(...r[o]):this instanceof M.Polyline&&s.push(r[o]);let l=0,f,c;for(let y=0,b=s.length-1;y<b;y++){f=180<s[y][0]&&90<s[y][1]?{x:s[y].lat,y:s[y].lng}:n.project(s[y]),c=180<s[y+1][0]&&90<s[y+1][1]?{x:s[y+1].lat,y:s[y+1].lng}:n.project(s[y+1]);var d=f.x,m=f.y,v=c.x,p=c.y;l+=Math.sqrt((d-v)*(d-v)+(m-p)*(m-p))}return l}});var ao={exports:{}};function oo(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var ri=1,hi=2,_i=3,ro=4,Qe=5,Ks=6378137,ho=6356752314e-3,Ys=.0066943799901413165,ki=484813681109536e-20,C=Math.PI/2,lo=.16666666666666666,uo=.04722222222222222,co=.022156084656084655,S=1e-10,mt=.017453292519943295,Dt=57.29577951308232,X=Math.PI/4,Bi=Math.PI*2,at=3.14159265359,wt={};wt.greenwich=0,wt.lisbon=-9.131906111111,wt.paris=2.337229166667,wt.bogota=-74.080916666667,wt.madrid=-3.687938888889,wt.rome=12.452333333333,wt.bern=7.439583333333,wt.jakarta=106.807719444444,wt.ferro=-17.666666666667,wt.brussels=4.367975,wt.stockholm=18.058277777778,wt.athens=23.7163375,wt.oslo=10.722916666667;const fo={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var Js=/[\s_\-\/\(\)]/g;function ti(i,s){if(i[s])return i[s];for(var n=Object.keys(i),r=s.toLowerCase().replace(Js,""),o=-1,l,f;++o<n.length;)if(l=n[o],f=l.toLowerCase().replace(Js,""),f===r)return i[l]}function Xe(i){var s={},n=i.split("+").map(function(c){return c.trim()}).filter(function(c){return c}).reduce(function(c,d){var m=d.split("=");return m.push(!0),c[m[0].toLowerCase()]=m[1],c},{}),r,o,l,f={proj:"projName",datum:"datumCode",rf:function(c){s.rf=parseFloat(c)},lat_0:function(c){s.lat0=c*mt},lat_1:function(c){s.lat1=c*mt},lat_2:function(c){s.lat2=c*mt},lat_ts:function(c){s.lat_ts=c*mt},lon_0:function(c){s.long0=c*mt},lon_1:function(c){s.long1=c*mt},lon_2:function(c){s.long2=c*mt},alpha:function(c){s.alpha=parseFloat(c)*mt},gamma:function(c){s.rectified_grid_angle=parseFloat(c)},lonc:function(c){s.longc=c*mt},x_0:function(c){s.x0=parseFloat(c)},y_0:function(c){s.y0=parseFloat(c)},k_0:function(c){s.k0=parseFloat(c)},k:function(c){s.k0=parseFloat(c)},a:function(c){s.a=parseFloat(c)},b:function(c){s.b=parseFloat(c)},r:function(c){s.a=s.b=parseFloat(c)},r_a:function(){s.R_A=!0},zone:function(c){s.zone=parseInt(c,10)},south:function(){s.utmSouth=!0},towgs84:function(c){s.datum_params=c.split(",").map(function(d){return parseFloat(d)})},to_meter:function(c){s.to_meter=parseFloat(c)},units:function(c){s.units=c;var d=ti(fo,c);d&&(s.to_meter=d.to_meter)},from_greenwich:function(c){s.from_greenwich=c*mt},pm:function(c){var d=ti(wt,c);s.from_greenwich=(d||parseFloat(c))*mt},nadgrids:function(c){c==="@null"?s.datumCode="none":s.nadgrids=c},axis:function(c){var d="ewnsud";c.length===3&&d.indexOf(c.substr(0,1))!==-1&&d.indexOf(c.substr(1,1))!==-1&&d.indexOf(c.substr(2,1))!==-1&&(s.axis=c)},approx:function(){s.approx=!0}};for(r in n)o=n[r],r in f?(l=f[r],typeof l=="function"?l(o):s[l]=o):s[r]=o;return typeof s.datumCode=="string"&&s.datumCode!=="WGS84"&&(s.datumCode=s.datumCode.toLowerCase()),s}var Ri=1,tn=2,en=3,ge=4,sn=5,Ke=-1,_o=/\s/,mo=/[A-Za-z]/,po=/[A-Za-z84_]/,ve=/[,\]]/,nn=/[\d\.E\-\+]/;function $t(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Ri}$t.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==ge)for(;_o.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Ri:return this.neutral(i);case tn:return this.keyword(i);case ge:return this.quoted(i);case sn:return this.afterquote(i);case en:return this.number(i);case Ke:return}},$t.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=ge;return}if(ve.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},$t.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ri;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Ri,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Ke);return}},$t.prototype.number=function(i){if(nn.test(i)){this.word+=i;return}if(ve.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},$t.prototype.quoted=function(i){if(i==='"'){this.state=sn;return}this.word+=i},$t.prototype.keyword=function(i){if(po.test(i)){this.word+=i;return}if(i==="["){var s=[];s.push(this.word),this.level++,this.root===null?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,this.state=Ri;return}if(ve.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},$t.prototype.neutral=function(i){if(mo.test(i)){this.word=i,this.state=tn;return}if(i==='"'){this.word="",this.state=ge;return}if(nn.test(i)){this.word=i,this.state=en;return}if(ve.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},$t.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Ke)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function go(i){var s=new $t(i);return s.output()}function an(i,s,n){Array.isArray(s)&&(n.unshift(s),s=null);var r=s?{}:i,o=n.reduce(function(l,f){return mi(f,l),l},r);s&&(i[s]=o)}function mi(i,s){if(!Array.isArray(i)){s[i]=!0;return}var n=i.shift();if(n==="PARAMETER"&&(n=i.shift()),i.length===1){if(Array.isArray(i[0])){s[n]={},mi(i[0],s[n]);return}s[n]=i[0];return}if(!i.length){s[n]=!0;return}if(n==="TOWGS84"){s[n]=i;return}if(n==="AXIS"){n in s||(s[n]=[]),s[n].push(i);return}Array.isArray(n)||(s[n]={});var r;switch(n){case"UNIT":case"PRIMEM":case"VERT_DATUM":s[n]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&mi(i[2],s[n]);return;case"SPHEROID":case"ELLIPSOID":s[n]={name:i[0],a:i[1],rf:i[2]},i.length===4&&mi(i[3],s[n]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":i[0]=["name",i[0]],an(s,n,i);return;default:for(r=-1;++r<i.length;)if(!Array.isArray(i[r]))return mi(i,s[n]);return an(s,n,i)}}var vo=.017453292519943295;function yo(i,s){var n=s[0],r=s[1];!(n in i)&&r in i&&(i[n]=i[r],s.length===3&&(i[n]=s[2](i[n])))}function Zt(i){return i*vo}function Mo(i){if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var s="",n=0,r=i.AXIS.length;n<r;++n){var o=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][1].toLowerCase()];o[0].indexOf("north")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="north"?s+="n":o[0].indexOf("south")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="south"?s+="s":o[0].indexOf("east")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="east"?s+="e":(o[0].indexOf("west")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="west")&&(s+="w")}s.length===2&&(s+="u"),s.length===3&&(i.axis=s)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var l=i.GEOGCS;i.type==="GEOGCS"&&(l=i),l&&(l.DATUM?i.datumCode=l.DATUM.name.toLowerCase():i.datumCode=l.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),(i.datumCode==="new_zealand_geodetic_datum_1949"||i.datumCode==="new_zealand_1949")&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode.slice(-6)==="_ferro"&&(i.datumCode=i.datumCode.slice(0,-6)),i.datumCode.slice(-8)==="_jakarta"&&(i.datumCode=i.datumCode.slice(0,-8)),~i.datumCode.indexOf("belge")&&(i.datumCode="rnb72"),l.DATUM&&l.DATUM.SPHEROID&&(i.ellps=l.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=l.DATUM.SPHEROID.a,i.rf=parseFloat(l.DATUM.SPHEROID.rf,10)),l.DATUM&&l.DATUM.TOWGS84&&(i.datum_params=l.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a);function f(m){var v=i.to_meter||1;return m*v}var c=function(m){return yo(i,m)},d=[["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",Zt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Zt],["x0","false_easting",f],["y0","false_northing",f],["long0","central_meridian",Zt],["lat0","latitude_of_origin",Zt],["lat0","standard_parallel_1",Zt],["lat1","standard_parallel_1",Zt],["lat2","standard_parallel_2",Zt],["azimuth","Azimuth"],["alpha","azimuth",Zt],["srsCode","name"]];d.forEach(c),!i.long0&&i.longc&&(i.projName==="Albers_Conic_Equal_Area"||i.projName==="Lambert_Azimuthal_Equal_Area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(i.projName==="Stereographic_South_Pole"||i.projName==="Polar Stereographic (variant B)")?(i.lat0=Zt(i.lat1>0?90:-90),i.lat_ts=i.lat1):!i.lat_ts&&i.lat0&&i.projName==="Polar_Stereographic"&&(i.lat_ts=i.lat0,i.lat0=Zt(i.lat0>0?90:-90))}function on(i){var s=go(i),n=s.shift(),r=s.shift();s.unshift(["name",r]),s.unshift(["type",n]);var o={};return mi(s,o),Mo(o),o}function yt(i){var s=this;if(arguments.length===2){var n=arguments[1];typeof n=="string"?n.charAt(0)==="+"?yt[i]=Xe(arguments[1]):yt[i]=on(arguments[1]):yt[i]=n}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(r){Array.isArray(r)?yt.apply(s,r):yt(r)});if(typeof i=="string"){if(i in yt)return yt[i]}else"EPSG"in i?yt["EPSG:"+i.EPSG]=i:"ESRI"in i?yt["ESRI:"+i.ESRI]=i:"IAU2000"in i?yt["IAU2000:"+i.IAU2000]=i:console.log(i);return}}oo(yt);function xo(i){return typeof i=="string"}function wo(i){return i in yt}var bo=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Lo(i){return bo.some(function(s){return i.indexOf(s)>-1})}var Po=["3857","900913","3785","102113"];function Ao(i){var s=ti(i,"authority");if(s){var n=ti(s,"epsg");return n&&Po.indexOf(n)>-1}}function To(i){var s=ti(i,"extension");if(s)return ti(s,"proj4")}function Co(i){return i[0]==="+"}function Eo(i){if(xo(i)){if(wo(i))return yt[i];if(Lo(i)){var s=on(i);if(Ao(s))return yt["EPSG:3857"];var n=To(s);return n?Xe(n):s}if(Co(i))return Xe(i)}else return i}function rn(i,s){i=i||{};var n,r;if(!s)return i;for(r in s)n=s[r],n!==void 0&&(i[r]=n);return i}function Ft(i,s,n){var r=i*s;return n/Math.sqrt(1-r*r)}function Di(i){return i<0?-1:1}function O(i){return Math.abs(i)<=at?i:i-Di(i)*Bi}function kt(i,s,n){var r=i*n,o=.5*i;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(C-s))/r}function Zi(i,s){for(var n=.5*i,r,o,l=C-2*Math.atan(s),f=0;f<=15;f++)if(r=i*Math.sin(l),o=C-2*Math.atan(s*Math.pow((1-r)/(1+r),n))-l,l+=o,Math.abs(o)<=1e-10)return l;return-9999}function So(){var i=this.b/this.a;this.es=1-i*i,"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=Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Oo(i){var s=i.x,n=i.y;if(n*Dt>90&&n*Dt<-90&&s*Dt>180&&s*Dt<-180)return null;var r,o;if(Math.abs(Math.abs(n)-C)<=S)return null;if(this.sphere)r=this.x0+this.a*this.k0*O(s-this.long0),o=this.y0+this.a*this.k0*Math.log(Math.tan(X+.5*n));else{var l=Math.sin(n),f=kt(this.e,n,l);r=this.x0+this.a*this.k0*O(s-this.long0),o=this.y0-this.a*this.k0*Math.log(f)}return i.x=r,i.y=o,i}function Io(i){var s=i.x-this.x0,n=i.y-this.y0,r,o;if(this.sphere)o=C-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var l=Math.exp(-n/(this.a*this.k0));if(o=Zi(this.e,l),o===-9999)return null}return r=O(this.long0+s/(this.a*this.k0)),i.x=r,i.y=o,i}var zo=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const No={init:So,forward:Oo,inverse:Io,names:zo};function ko(){}function hn(i){return i}var Bo=["longlat","identity"],Ro=[No,{init:ko,forward:hn,inverse:hn,names:Bo}],ye={},Me=[];function ln(i,s){var n=Me.length;return i.names?(Me[n]=i,i.names.forEach(function(r){ye[r.toLowerCase()]=n}),this):(console.log(s),!0)}function Do(i){if(!i)return!1;var s=i.toLowerCase();if(typeof ye[s]<"u"&&Me[ye[s]])return Me[ye[s]]}function Zo(){Ro.forEach(ln)}const Fo={start:Zo,add:ln,get:Do};var D={};D.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},D.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},D.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},D.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},D.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},D.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},D.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},D.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},D.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},D.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},D.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},D.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},D.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},D.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},D.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},D.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},D.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},D.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},D.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},D.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},D.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},D.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},D.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},D.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},D.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},D.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},D.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},D.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},D.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},D.hough={a:6378270,rf:297,ellipseName:"Hough"},D.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},D.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},D.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},D.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},D.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},D.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},D.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},D.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},D.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},D.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},D.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},D.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var qo=D.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};D.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Go(i,s,n,r){var o=i*i,l=s*s,f=(o-l)/o,c=0;r?(i*=1-f*(lo+f*(uo+f*co)),o=i*i,f=0):c=Math.sqrt(f);var d=(o-l)/l;return{es:f,e:c,ep2:d}}function Uo(i,s,n,r,o){if(!i){var l=ti(D,r);l||(l=qo),i=l.a,s=l.b,n=l.rf}return n&&!s&&(s=(1-1/n)*i),(n===0||Math.abs(i-s)<S)&&(o=!0,s=i),{a:i,b:s,rf:n,sphere:o}}var ut={};ut.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ut.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ut.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ut.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ut.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ut.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ut.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ut.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ut.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},ut.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ut.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ut.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ut.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ut.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ut.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ut.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ut.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ut.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function jo(i,s,n,r,o,l,f){var c={};return i===void 0||i==="none"?c.datum_type=Qe:c.datum_type=ro,s&&(c.datum_params=s.map(parseFloat),(c.datum_params[0]!==0||c.datum_params[1]!==0||c.datum_params[2]!==0)&&(c.datum_type=ri),c.datum_params.length>3&&(c.datum_params[3]!==0||c.datum_params[4]!==0||c.datum_params[5]!==0||c.datum_params[6]!==0)&&(c.datum_type=hi,c.datum_params[3]*=ki,c.datum_params[4]*=ki,c.datum_params[5]*=ki,c.datum_params[6]=c.datum_params[6]/1e6+1)),f&&(c.datum_type=_i,c.grids=f),c.a=n,c.b=r,c.es=o,c.ep2=l,c}var un={};function Ho(i,s){var n=new DataView(s),r=Vo(n),o=Qo(n,r),l=Xo(n,o,r),f={header:o,subgrids:l};return un[i]=f,f}function Wo(i){if(i===void 0)return null;var s=i.split(",");return s.map($o)}function $o(i){if(i.length===0)return null;var s=i[0]==="@";return s&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!s,grid:null,isNull:!0}:{name:i,mandatory:!s,grid:un[i]||null,isNull:!1}}function pi(i){return i/3600*Math.PI/180}function Vo(i){var s=i.getInt32(8,!1);return s===11?!1:(s=i.getInt32(8,!0),s!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function Qo(i,s){return{nFields:i.getInt32(8,s),nSubgridFields:i.getInt32(24,s),nSubgrids:i.getInt32(40,s),shiftType:Ye(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,s),fromSemiMinorAxis:i.getFloat64(136,s),toSemiMajorAxis:i.getFloat64(152,s),toSemiMinorAxis:i.getFloat64(168,s)}}function Ye(i,s,n){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(s,n)))}function Xo(i,s,n){for(var r=176,o=[],l=0;l<s.nSubgrids;l++){var f=Yo(i,r,n),c=Jo(i,r,f,n),d=Math.round(1+(f.upperLongitude-f.lowerLongitude)/f.longitudeInterval),m=Math.round(1+(f.upperLatitude-f.lowerLatitude)/f.latitudeInterval);o.push({ll:[pi(f.lowerLongitude),pi(f.lowerLatitude)],del:[pi(f.longitudeInterval),pi(f.latitudeInterval)],lim:[d,m],count:f.gridNodeCount,cvs:Ko(c)}),r+=176+f.gridNodeCount*16}return o}function Ko(i){return i.map(function(s){return[pi(s.longitudeShift),pi(s.latitudeShift)]})}function Yo(i,s,n){return{name:Ye(i,s+8,s+16).trim(),parent:Ye(i,s+24,s+24+8).trim(),lowerLatitude:i.getFloat64(s+72,n),upperLatitude:i.getFloat64(s+88,n),lowerLongitude:i.getFloat64(s+104,n),upperLongitude:i.getFloat64(s+120,n),latitudeInterval:i.getFloat64(s+136,n),longitudeInterval:i.getFloat64(s+152,n),gridNodeCount:i.getInt32(s+168,n)}}function Jo(i,s,n,r){for(var o=s+176,l=16,f=[],c=0;c<n.gridNodeCount;c++){var d={latitudeShift:i.getFloat32(o+c*l,r),longitudeShift:i.getFloat32(o+c*l+4,r),latitudeAccuracy:i.getFloat32(o+c*l+8,r),longitudeAccuracy:i.getFloat32(o+c*l+12,r)};f.push(d)}return f}function qt(i,s){if(!(this instanceof qt))return new qt(i);s=s||function(m){if(m)throw m};var n=Eo(i);if(typeof n!="object"){s("Could not parse to valid json: "+i);return}var r=qt.projections.get(n.projName);if(!r){s("Could not get projection name from: "+i);return}if(n.datumCode&&n.datumCode!=="none"){var o=ti(ut,n.datumCode);o&&(n.datum_params=n.datum_params||(o.towgs84?o.towgs84.split(","):null),n.ellps=o.ellipse,n.datumName=o.datumName?o.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var l=Uo(n.a,n.b,n.rf,n.ellps,n.sphere),f=Go(l.a,l.b,l.rf,n.R_A),c=Wo(n.nadgrids),d=n.datum||jo(n.datumCode,n.datum_params,l.a,l.b,f.es,f.ep2,c);rn(this,n),rn(this,r),this.a=l.a,this.b=l.b,this.rf=l.rf,this.sphere=l.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=d,this.init(),s(null,this)}qt.projections=Fo,qt.projections.start();function tr(i,s){return i.datum_type!==s.datum_type||i.a!==s.a||Math.abs(i.es-s.es)>5e-11?!1:i.datum_type===ri?i.datum_params[0]===s.datum_params[0]&&i.datum_params[1]===s.datum_params[1]&&i.datum_params[2]===s.datum_params[2]:i.datum_type===hi?i.datum_params[0]===s.datum_params[0]&&i.datum_params[1]===s.datum_params[1]&&i.datum_params[2]===s.datum_params[2]&&i.datum_params[3]===s.datum_params[3]&&i.datum_params[4]===s.datum_params[4]&&i.datum_params[5]===s.datum_params[5]&&i.datum_params[6]===s.datum_params[6]:!0}function cn(i,s,n){var r=i.x,o=i.y,l=i.z?i.z:0,f,c,d,m;if(o<-C&&o>-1.001*C)o=-C;else if(o>C&&o<1.001*C)o=C;else{if(o<-C)return{x:-1/0,y:-1/0,z:i.z};if(o>C)return{x:1/0,y:1/0,z:i.z}}return r>Math.PI&&(r-=2*Math.PI),c=Math.sin(o),m=Math.cos(o),d=c*c,f=n/Math.sqrt(1-s*d),{x:(f+l)*m*Math.cos(r),y:(f+l)*m*Math.sin(r),z:(f*(1-s)+l)*c}}function fn(i,s,n,r){var o=1e-12,l=o*o,f=30,c,d,m,v,p,y,b,A,P,E,z,B,k,j=i.x,H=i.y,W=i.z?i.z:0,ct,tt,Pt;if(c=Math.sqrt(j*j+H*H),d=Math.sqrt(j*j+H*H+W*W),c/n<o){if(ct=0,d/n<o)return tt=C,Pt=-r,{x:i.x,y:i.y,z:i.z}}else ct=Math.atan2(H,j);m=W/d,v=c/d,p=1/Math.sqrt(1-s*(2-s)*v*v),A=v*(1-s)*p,P=m*p,k=0;do k++,b=n/Math.sqrt(1-s*P*P),Pt=c*A+W*P-b*(1-s*P*P),y=s*b/(b+Pt),p=1/Math.sqrt(1-y*(2-y)*v*v),E=v*(1-y)*p,z=m*p,B=z*A-E*P,A=E,P=z;while(B*B>l&&k<f);return tt=Math.atan(z/Math.abs(E)),{x:ct,y:tt,z:Pt}}function ir(i,s,n){if(s===ri)return{x:i.x+n[0],y:i.y+n[1],z:i.z+n[2]};if(s===hi){var r=n[0],o=n[1],l=n[2],f=n[3],c=n[4],d=n[5],m=n[6];return{x:m*(i.x-d*i.y+c*i.z)+r,y:m*(d*i.x+i.y-f*i.z)+o,z:m*(-c*i.x+f*i.y+i.z)+l}}}function er(i,s,n){if(s===ri)return{x:i.x-n[0],y:i.y-n[1],z:i.z-n[2]};if(s===hi){var r=n[0],o=n[1],l=n[2],f=n[3],c=n[4],d=n[5],m=n[6],v=(i.x-r)/m,p=(i.y-o)/m,y=(i.z-l)/m;return{x:v+d*p-c*y,y:-d*v+p+f*y,z:c*v-f*p+y}}}function xe(i){return i===ri||i===hi}function sr(i,s,n){if(tr(i,s)||i.datum_type===Qe||s.datum_type===Qe)return n;var r=i.a,o=i.es;if(i.datum_type===_i){var l=dn(i,!1,n);if(l!==0)return;r=Ks,o=Ys}var f=s.a,c=s.b,d=s.es;if(s.datum_type===_i&&(f=Ks,c=ho,d=Ys),o===d&&r===f&&!xe(i.datum_type)&&!xe(s.datum_type))return n;if(n=cn(n,o,r),xe(i.datum_type)&&(n=ir(n,i.datum_type,i.datum_params)),xe(s.datum_type)&&(n=er(n,s.datum_type,s.datum_params)),n=fn(n,d,f,c),s.datum_type===_i){var m=dn(s,!0,n);if(m!==0)return}return n}function dn(i,s,n){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var r={x:-n.x,y:n.y},o={x:Number.NaN,y:Number.NaN},l=[];t:for(var f=0;f<i.grids.length;f++){var c=i.grids[f];if(l.push(c.name),c.isNull){o=r;break}if(c.mandatory,c.grid===null){if(c.mandatory)return console.log("Unable to find mandatory grid '"+c.name+"'"),-1;continue}for(var d=c.grid.subgrids,m=0,v=d.length;m<v;m++){var p=d[m],y=(Math.abs(p.del[1])+Math.abs(p.del[0]))/1e4,b=p.ll[0]-y,A=p.ll[1]-y,P=p.ll[0]+(p.lim[0]-1)*p.del[0]+y,E=p.ll[1]+(p.lim[1]-1)*p.del[1]+y;if(!(A>r.y||b>r.x||E<r.y||P<r.x)&&(o=nr(r,s,p),!isNaN(o.x)))break t}}return isNaN(o.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*Dt+" "+r.y*Dt+" tried: '"+l+"'"),-1):(n.x=-o.x,n.y=o.y,0)}function nr(i,s,n){var r={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return r;var o={x:i.x,y:i.y};o.x-=n.ll[0],o.y-=n.ll[1],o.x=O(o.x-Math.PI)+Math.PI;var l=_n(o,n);if(s){if(isNaN(l.x))return r;l.x=o.x-l.x,l.y=o.y-l.y;var f=9,c=1e-12,d,m;do{if(m=_n(l,n),isNaN(m.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}d={x:o.x-(m.x+l.x),y:o.y-(m.y+l.y)},l.x+=d.x,l.y+=d.y}while(f--&&Math.abs(d.x)>c&&Math.abs(d.y)>c);if(f<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=O(l.x+n.ll[0]),r.y=l.y+n.ll[1]}else isNaN(l.x)||(r.x=i.x+l.x,r.y=i.y+l.y);return r}function _n(i,s){var n={x:i.x/s.del[0],y:i.y/s.del[1]},r={x:Math.floor(n.x),y:Math.floor(n.y)},o={x:n.x-1*r.x,y:n.y-1*r.y},l={x:Number.NaN,y:Number.NaN},f;if(r.x<0||r.x>=s.lim[0]||r.y<0||r.y>=s.lim[1])return l;f=r.y*s.lim[0]+r.x;var c={x:s.cvs[f][0],y:s.cvs[f][1]};f++;var d={x:s.cvs[f][0],y:s.cvs[f][1]};f+=s.lim[0];var m={x:s.cvs[f][0],y:s.cvs[f][1]};f--;var v={x:s.cvs[f][0],y:s.cvs[f][1]},p=o.x*o.y,y=o.x*(1-o.y),b=(1-o.x)*(1-o.y),A=(1-o.x)*o.y;return l.x=b*c.x+y*d.x+A*v.x+p*m.x,l.y=b*c.y+y*d.y+A*v.y+p*m.y,l}function mn(i,s,n){var r=n.x,o=n.y,l=n.z||0,f,c,d,m={};for(d=0;d<3;d++)if(!(s&&d===2&&n.z===void 0))switch(d===0?(f=r,"ew".indexOf(i.axis[d])!==-1?c="x":c="y"):d===1?(f=o,"ns".indexOf(i.axis[d])!==-1?c="y":c="x"):(f=l,c="z"),i.axis[d]){case"e":m[c]=f;break;case"w":m[c]=-f;break;case"n":m[c]=f;break;case"s":m[c]=-f;break;case"u":n[c]!==void 0&&(m.z=f);break;case"d":n[c]!==void 0&&(m.z=-f);break;default:return null}return m}function pn(i){var s={x:i[0],y:i[1]};return i.length>2&&(s.z=i[2]),i.length>3&&(s.m=i[3]),s}function ar(i){gn(i.x),gn(i.y)}function gn(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function or(i,s){return(i.datum.datum_type===ri||i.datum.datum_type===hi||i.datum.datum_type===_i)&&s.datumCode!=="WGS84"||(s.datum.datum_type===ri||s.datum.datum_type===hi||s.datum.datum_type===_i)&&i.datumCode!=="WGS84"}function we(i,s,n,r){var o;Array.isArray(n)?n=pn(n):n={x:n.x,y:n.y,z:n.z,m:n.m};var l=n.z!==void 0;if(ar(n),i.datum&&s.datum&&or(i,s)&&(o=new qt("WGS84"),n=we(i,o,n,r),i=o),r&&i.axis!=="enu"&&(n=mn(i,!1,n)),i.projName==="longlat")n={x:n.x*mt,y:n.y*mt,z:n.z||0};else if(i.to_meter&&(n={x:n.x*i.to_meter,y:n.y*i.to_meter,z:n.z||0}),n=i.inverse(n),!n)return;if(i.from_greenwich&&(n.x+=i.from_greenwich),n=sr(i.datum,s.datum,n),!!n)return s.from_greenwich&&(n={x:n.x-s.from_greenwich,y:n.y,z:n.z||0}),s.projName==="longlat"?n={x:n.x*Dt,y:n.y*Dt,z:n.z||0}:(n=s.forward(n),s.to_meter&&(n={x:n.x/s.to_meter,y:n.y/s.to_meter,z:n.z||0})),r&&s.axis!=="enu"?mn(s,!0,n):(n&&!l&&delete n.z,n)}var vn=qt("WGS84");function Je(i,s,n,r){var o,l,f;return Array.isArray(n)?(o=we(i,s,n,r)||{x:NaN,y:NaN},n.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof s.name<"u"&&s.name==="geocent"?typeof o.z=="number"?[o.x,o.y,o.z].concat(n.slice(3)):[o.x,o.y,n[2]].concat(n.slice(3)):[o.x,o.y].concat(n.slice(2)):[o.x,o.y]):(l=we(i,s,n,r),f=Object.keys(n),f.length===2||f.forEach(function(c){if(typeof i.name<"u"&&i.name==="geocent"||typeof s.name<"u"&&s.name==="geocent"){if(c==="x"||c==="y"||c==="z")return}else if(c==="x"||c==="y")return;l[c]=n[c]}),l)}function yn(i){return i instanceof qt?i:i.oProj?i.oProj:qt(i)}function Et(i,s,n){i=yn(i);var r=!1,o;return typeof s>"u"?(s=i,i=vn,r=!0):(typeof s.x<"u"||Array.isArray(s))&&(n=s,s=i,i=vn,r=!0),s=yn(s),n?Je(i,s,n):(o={forward:function(l,f){return Je(i,s,l,f)},inverse:function(l,f){return Je(s,i,l,f)}},r&&(o.oProj=s),o)}var Mn=6,xn="AJSAJS",wn="AFAFAF",gi=65,bt=73,Ot=79,Fi=86,qi=90;const rr={forward:bn,inverse:hr,toPoint:Ln};function bn(i,s){return s=s||5,cr(lr({lat:i[1],lon:i[0]}),s)}function hr(i){var s=is(Tn(i.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]}function Ln(i){var s=is(Tn(i.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function ts(i){return i*(Math.PI/180)}function Pn(i){return 180*(i/Math.PI)}function lr(i){var s=i.lat,n=i.lon,r=6378137,o=.00669438,l=.9996,f,c,d,m,v,p,y,b=ts(s),A=ts(n),P,E;E=Math.floor((n+180)/6)+1,n===180&&(E=60),s>=56&&s<64&&n>=3&&n<12&&(E=32),s>=72&&s<84&&(n>=0&&n<9?E=31:n>=9&&n<21?E=33:n>=21&&n<33?E=35:n>=33&&n<42&&(E=37)),f=(E-1)*6-180+3,P=ts(f),c=o/(1-o),d=r/Math.sqrt(1-o*Math.sin(b)*Math.sin(b)),m=Math.tan(b)*Math.tan(b),v=c*Math.cos(b)*Math.cos(b),p=Math.cos(b)*(A-P),y=r*((1-o/4-3*o*o/64-5*o*o*o/256)*b-(3*o/8+3*o*o/32+45*o*o*o/1024)*Math.sin(2*b)+(15*o*o/256+45*o*o*o/1024)*Math.sin(4*b)-35*o*o*o/3072*Math.sin(6*b));var z=l*d*(p+(1-m+v)*p*p*p/6+(5-18*m+m*m+72*v-58*c)*p*p*p*p*p/120)+5e5,B=l*(y+d*Math.tan(b)*(p*p/2+(5-m+9*v+4*v*v)*p*p*p*p/24+(61-58*m+m*m+600*v-330*c)*p*p*p*p*p*p/720));return s<0&&(B+=1e7),{northing:Math.round(B),easting:Math.round(z),zoneNumber:E,zoneLetter:ur(s)}}function is(i){var s=i.northing,n=i.easting,r=i.zoneLetter,o=i.zoneNumber;if(o<0||o>60)return null;var l=.9996,f=6378137,c=.00669438,d,m=(1-Math.sqrt(1-c))/(1+Math.sqrt(1-c)),v,p,y,b,A,P,E,z,B,k=n-5e5,j=s;r<"N"&&(j-=1e7),E=(o-1)*6-180+3,d=c/(1-c),P=j/l,z=P/(f*(1-c/4-3*c*c/64-5*c*c*c/256)),B=z+(3*m/2-27*m*m*m/32)*Math.sin(2*z)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*z)+151*m*m*m/96*Math.sin(6*z),v=f/Math.sqrt(1-c*Math.sin(B)*Math.sin(B)),p=Math.tan(B)*Math.tan(B),y=d*Math.cos(B)*Math.cos(B),b=f*(1-c)/Math.pow(1-c*Math.sin(B)*Math.sin(B),1.5),A=k/(v*l);var H=B-v*Math.tan(B)/b*(A*A/2-(5+3*p+10*y-4*y*y-9*d)*A*A*A*A/24+(61+90*p+298*y+45*p*p-252*d-3*y*y)*A*A*A*A*A*A/720);H=Pn(H);var W=(A-(1+2*p+y)*A*A*A/6+(5-2*y+28*p-3*y*y+8*d+24*p*p)*A*A*A*A*A/120)/Math.cos(B);W=E+Pn(W);var ct;if(i.accuracy){var tt=is({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});ct={top:tt.lat,right:tt.lon,bottom:H,left:W}}else ct={lat:H,lon:W};return ct}function ur(i){var s="Z";return 84>=i&&i>=72?s="X":72>i&&i>=64?s="W":64>i&&i>=56?s="V":56>i&&i>=48?s="U":48>i&&i>=40?s="T":40>i&&i>=32?s="S":32>i&&i>=24?s="R":24>i&&i>=16?s="Q":16>i&&i>=8?s="P":8>i&&i>=0?s="N":0>i&&i>=-8?s="M":-8>i&&i>=-16?s="L":-16>i&&i>=-24?s="K":-24>i&&i>=-32?s="J":-32>i&&i>=-40?s="H":-40>i&&i>=-48?s="G":-48>i&&i>=-56?s="F":-56>i&&i>=-64?s="E":-64>i&&i>=-72?s="D":-72>i&&i>=-80&&(s="C"),s}function cr(i,s){var n="00000"+i.easting,r="00000"+i.northing;return i.zoneNumber+i.zoneLetter+fr(i.easting,i.northing,i.zoneNumber)+n.substr(n.length-5,s)+r.substr(r.length-5,s)}function fr(i,s,n){var r=An(n),o=Math.floor(i/1e5),l=Math.floor(s/1e5)%20;return dr(o,l,r)}function An(i){var s=i%Mn;return s===0&&(s=Mn),s}function dr(i,s,n){var r=n-1,o=xn.charCodeAt(r),l=wn.charCodeAt(r),f=o+i-1,c=l+s,d=!1;f>qi&&(f=f-qi+gi-1,d=!0),(f===bt||o<bt&&f>bt||(f>bt||o<bt)&&d)&&f++,(f===Ot||o<Ot&&f>Ot||(f>Ot||o<Ot)&&d)&&(f++,f===bt&&f++),f>qi&&(f=f-qi+gi-1),c>Fi?(c=c-Fi+gi-1,d=!0):d=!1,(c===bt||l<bt&&c>bt||(c>bt||l<bt)&&d)&&c++,(c===Ot||l<Ot&&c>Ot||(c>Ot||l<Ot)&&d)&&(c++,c===bt&&c++),c>Fi&&(c=c-Fi+gi-1);var m=String.fromCharCode(f)+String.fromCharCode(c);return m}function Tn(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var s=i.length,n=null,r="",o,l=0;!/[A-Z]/.test(o=i.charAt(l));){if(l>=2)throw"MGRSPoint bad conversion from: "+i;r+=o,l++}var f=parseInt(r,10);if(l===0||l+3>s)throw"MGRSPoint bad conversion from: "+i;var c=i.charAt(l++);if(c<="A"||c==="B"||c==="Y"||c>="Z"||c==="I"||c==="O")throw"MGRSPoint zone letter "+c+" not handled: "+i;n=i.substring(l,l+=2);for(var d=An(f),m=_r(n.charAt(0),d),v=mr(n.charAt(1),d);v<pr(c);)v+=2e6;var p=s-l;if(p%2!==0)throw`MGRSPoint has to have an even number
7
7
  of digits after the zone letter and two 100km letters - front
8
8
  half for easting meters, second half for
9
- northing meters`+i;var y=p/2,b=0,A=0,P,E,z,B,k;return y>0&&(P=1e5/Math.pow(10,y),E=i.substring(l,l+y),b=parseFloat(E)*P,z=i.substring(l+y),A=parseFloat(z)*P),B=b+m,k=A+v,{easting:B,northing:k,zoneLetter:c,zoneNumber:f,accuracy:P}}function _r(i,s){for(var n=xn.charCodeAt(s-1),r=1e5,o=!1;n!==i.charCodeAt(0);){if(n++,n===bt&&n++,n===Ot&&n++,n>qi){if(o)throw"Bad character: "+i;n=gi,o=!0}r+=1e5}return r}function mr(i,s){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var n=wn.charCodeAt(s-1),r=0,o=!1;n!==i.charCodeAt(0);){if(n++,n===bt&&n++,n===Ot&&n++,n>Fi){if(o)throw"Bad character: "+i;n=gi,o=!0}r+=1e5}return r}function pr(i){var s;switch(i){case"C":s=11e5;break;case"D":s=2e6;break;case"E":s=28e5;break;case"F":s=37e5;break;case"G":s=46e5;break;case"H":s=55e5;break;case"J":s=64e5;break;case"K":s=73e5;break;case"L":s=82e5;break;case"M":s=91e5;break;case"N":s=0;break;case"P":s=8e5;break;case"Q":s=17e5;break;case"R":s=26e5;break;case"S":s=35e5;break;case"T":s=44e5;break;case"U":s=53e5;break;case"V":s=62e5;break;case"W":s=7e6;break;case"X":s=79e5;break;default:s=-1}if(s>=0)return s;throw"Invalid zone letter: "+i}function vi(i,s,n){if(!(this instanceof vi))return new vi(i,s,n);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof s>"u"){var r=i.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=i,this.y=s,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}vi.fromMGRS=function(i){return new vi(Ln(i))},vi.prototype.toMGRS=function(i){return bn([this.x,this.y],i)};var gr=1,vr=.25,Cn=.046875,En=.01953125,Sn=.01068115234375,yr=.75,Mr=.46875,xr=.013020833333333334,wr=.007120768229166667,br=.3645833333333333,Lr=.005696614583333333,Pr=.3076171875;function es(i){var s=[];s[0]=gr-i*(vr+i*(Cn+i*(En+i*Sn))),s[1]=i*(yr-i*(Cn+i*(En+i*Sn)));var n=i*i;return s[2]=n*(Mr-i*(xr+i*wr)),n*=i,s[3]=n*(br-i*Lr),s[4]=n*i*Pr,s}function yi(i,s,n,r){return n*=s,s*=s,r[0]*i-n*(r[1]+s*(r[2]+s*(r[3]+s*r[4])))}var Ar=20;function ss(i,s,n){for(var r=1/(1-s),o=i,l=Ar;l;--l){var f=Math.sin(o),c=1-s*f*f;if(c=(yi(o,f,Math.cos(o),n)-i)*(c*Math.sqrt(c))*r,o-=c,Math.abs(c)<S)return o}return o}function Tr(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=es(this.es),this.ml0=yi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Cr(i){var s=i.x,n=i.y,r=O(s-this.long0),o,l,f,c=Math.sin(n),d=Math.cos(n);if(this.es){var v=d*r,p=Math.pow(v,2),y=this.ep2*Math.pow(d,2),b=Math.pow(y,2),A=Math.abs(d)>S?Math.tan(n):0,P=Math.pow(A,2),E=Math.pow(P,2);o=1-this.es*Math.pow(c,2),v=v/Math.sqrt(o);var z=yi(n,c,d,this.en);l=this.a*(this.k0*v*(1+p/6*(1-P+y+p/20*(5-18*P+E+14*y-58*P*y+p/42*(61+179*E-E*P-479*P)))))+this.x0,f=this.a*(this.k0*(z-this.ml0+c*r*v/2*(1+p/12*(5-P+9*y+4*b+p/30*(61+E-58*P+270*y-330*P*y+p/56*(1385+543*E-E*P-3111*P))))))+this.y0}else{var m=d*Math.sin(r);if(Math.abs(Math.abs(m)-1)<S)return 93;if(l=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,f=d*Math.cos(r)/Math.sqrt(1-Math.pow(m,2)),m=Math.abs(f),m>=1){if(m-1>S)return 93;f=0}else f=Math.acos(f);n<0&&(f=-f),f=this.a*this.k0*(f-this.lat0)+this.y0}return i.x=l,i.y=f,i}function Er(i){var s,n,r,o,l=(i.x-this.x0)*(1/this.a),f=(i.y-this.y0)*(1/this.a);if(this.es)if(s=this.ml0+f/this.k0,n=ss(s,this.es,this.en),Math.abs(n)<C){var p=Math.sin(n),y=Math.cos(n),b=Math.abs(y)>S?Math.tan(n):0,A=this.ep2*Math.pow(y,2),P=Math.pow(A,2),E=Math.pow(b,2),z=Math.pow(E,2);s=1-this.es*Math.pow(p,2);var B=l*Math.sqrt(s)/this.k0,k=Math.pow(B,2);s=s*b,r=n-s*k/(1-this.es)*.5*(1-k/12*(5+3*E-9*A*E+A-4*P-k/30*(61+90*E-252*A*E+45*z+46*A-k/56*(1385+3633*E+4095*z+1574*z*E)))),o=O(this.long0+B*(1-k/6*(1+2*E+A-k/20*(5+28*E+24*z+8*A*E+6*A-k/42*(61+662*E+1320*z+720*z*E))))/y)}else r=C*Di(f),o=0;else{var c=Math.exp(l/this.k0),d=.5*(c-1/c),m=this.lat0+f/this.k0,v=Math.cos(m);s=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(d,2))),r=Math.asin(s),f<0&&(r=-r),d===0&&v===0?o=0:o=O(Math.atan2(d,v)+this.long0)}return i.x=o,i.y=r,i}var Sr=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const be={init:Tr,forward:Cr,inverse:Er,names:Sr};function On(i){var s=Math.exp(i);return s=(s-1/s)/2,s}function Lt(i,s){i=Math.abs(i),s=Math.abs(s);var n=Math.max(i,s),r=Math.min(i,s)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))}function Or(i){var s=1+i,n=s-1;return n===0?i:i*Math.log(s)/n}function Ir(i){var s=Math.abs(i);return s=Or(s*(1+s/(Lt(1,s)+1))),i<0?-s:s}function ns(i,s){for(var n=2*Math.cos(2*s),r=i.length-1,o=i[r],l=0,f;--r>=0;)f=-l+n*o+i[r],l=o,o=f;return s+f*Math.sin(2*s)}function zr(i,s){for(var n=2*Math.cos(s),r=i.length-1,o=i[r],l=0,f;--r>=0;)f=-l+n*o+i[r],l=o,o=f;return Math.sin(s)*f}function Nr(i){var s=Math.exp(i);return s=(s+1/s)/2,s}function In(i,s,n){for(var r=Math.sin(s),o=Math.cos(s),l=On(n),f=Nr(n),c=2*o*f,d=-2*r*l,m=i.length-1,v=i[m],p=0,y=0,b=0,A,P;--m>=0;)A=y,P=p,y=v,p=b,v=-A+c*y-d*p+i[m],b=-P+d*y+c*p;return c=r*f,d=o*l,[c*v-d*b,c*b+d*v]}function kr(){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&&(be.init.apply(this),this.forward=be.forward,this.inverse=be.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),s=i/(2-i),n=s;this.cgb[0]=s*(2+s*(-2/3+s*(-2+s*(116/45+s*(26/45+s*(-2854/675)))))),this.cbg[0]=s*(-2+s*(2/3+s*(4/3+s*(-82/45+s*(32/45+s*(4642/4725)))))),n=n*s,this.cgb[1]=n*(7/3+s*(-8/5+s*(-227/45+s*(2704/315+s*(2323/945))))),this.cbg[1]=n*(5/3+s*(-16/15+s*(-13/9+s*(904/315+s*(-1522/945))))),n=n*s,this.cgb[2]=n*(56/15+s*(-136/35+s*(-1262/105+s*(73814/2835)))),this.cbg[2]=n*(-26/15+s*(34/21+s*(8/5+s*(-12686/2835)))),n=n*s,this.cgb[3]=n*(4279/630+s*(-332/35+s*(-399572/14175))),this.cbg[3]=n*(1237/630+s*(-12/5+s*(-24832/14175))),n=n*s,this.cgb[4]=n*(4174/315+s*(-144838/6237)),this.cbg[4]=n*(-734/315+s*(109598/31185)),n=n*s,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=s*(-.5+s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=n*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=n*(13/48+s*(-3/5+s*(557/1440+s*(281/630+s*(-1983433/1935360))))),n=n*s,this.utg[2]=n*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=n*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),n=n*s,this.utg[3]=n*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=n*(49561/161280+s*(-179/168+s*(6601661/7257600))),n=n*s,this.utg[4]=n*(-4583/161280+s*(108847/3991680)),this.gtu[4]=n*(34729/80640+s*(-3418889/1995840)),n=n*s,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=n*(212378941/319334400);var r=ns(this.cbg,this.lat0);this.Zb=-this.Qn*(r+zr(this.gtu,2*r))}function Br(i){var s=O(i.x-this.long0),n=i.y;n=ns(this.cbg,n);var r=Math.sin(n),o=Math.cos(n),l=Math.sin(s),f=Math.cos(s);n=Math.atan2(r,f*o),s=Math.atan2(l*o,Lt(r,o*f)),s=Ir(Math.tan(s));var c=In(this.gtu,2*n,2*s);n=n+c[0],s=s+c[1];var d,m;return Math.abs(s)<=2.623395162778?(d=this.a*(this.Qn*s)+this.x0,m=this.a*(this.Qn*n+this.Zb)+this.y0):(d=1/0,m=1/0),i.x=d,i.y=m,i}function Rr(i){var s=(i.x-this.x0)*(1/this.a),n=(i.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,s=s/this.Qn;var r,o;if(Math.abs(s)<=2.623395162778){var l=In(this.utg,2*n,2*s);n=n+l[0],s=s+l[1],s=Math.atan(On(s));var f=Math.sin(n),c=Math.cos(n),d=Math.sin(s),m=Math.cos(s);n=Math.atan2(f*m,Lt(d,m*c)),s=Math.atan2(d,m*c),r=O(s+this.long0),o=ns(this.cgb,n)}else r=1/0,o=1/0;return i.x=r,i.y=o,i}var Dr=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Le={init:kr,forward:Br,inverse:Rr,names:Dr};function Zr(i,s){if(i===void 0){if(i=Math.floor((O(s)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var Fr="etmerc";function qr(){var i=Zr(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*mt,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Le.init.apply(this),this.forward=Le.forward,this.inverse=Le.inverse}var Gr=["Universal Transverse Mercator System","utm"];const Ur={init:qr,names:Gr,dependsOn:Fr};function as(i,s){return Math.pow((1-i)/(1+i),s)}var jr=20;function Hr(){var i=Math.sin(this.lat0),s=Math.cos(this.lat0);s*=s,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*s*s/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+X)/(Math.pow(Math.tan(.5*this.lat0+X),this.C)*as(this.e*i,this.ratexp))}function Wr(i){var s=i.x,n=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+X),this.C)*as(this.e*Math.sin(n),this.ratexp))-C,i.x=this.C*s,i}function $r(i){for(var s=1e-14,n=i.x/this.C,r=i.y,o=Math.pow(Math.tan(.5*r+X)/this.K,1/this.C),l=jr;l>0&&(r=2*Math.atan(o*as(this.e*Math.sin(i.y),-.5*this.e))-C,!(Math.abs(r-i.y)<s));--l)i.y=r;return l?(i.x=n,i.y=r,i):null}var Vr=["gauss"];const os={init:Hr,forward:Wr,inverse:$r,names:Vr};function Qr(){os.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"))}function Xr(i){var s,n,r,o;return i.x=O(i.x-this.long0),os.forward.apply(this,[i]),s=Math.sin(i.y),n=Math.cos(i.y),r=Math.cos(i.x),o=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*n*r),i.x=o*n*Math.sin(i.x),i.y=o*(this.cosc0*s-this.sinc0*n*r),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function Kr(i){var s,n,r,o,l;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,l=Lt(i.x,i.y)){var f=2*Math.atan2(l,this.R2);s=Math.sin(f),n=Math.cos(f),o=Math.asin(n*this.sinc0+i.y*s*this.cosc0/l),r=Math.atan2(i.x*s,l*this.cosc0*n-i.y*this.sinc0*s)}else o=this.phic0,r=0;return i.x=r,i.y=o,os.inverse.apply(this,[i]),i.x=O(i.x+this.long0),i}var Yr=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Jr={init:Qr,forward:Xr,inverse:Kr,names:Yr};function th(i,s,n){return s*=n,Math.tan(.5*(C+i))*Math.pow((1-s)/(1+s),.5*n)}function ih(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=S&&(this.k0=.5*(1+Di(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=S&&(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)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=S&&Math.abs(Math.cos(this.lat_ts))>S&&(this.k0=.5*this.cons*Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/kt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ft(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-C,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function eh(i){var s=i.x,n=i.y,r=Math.sin(n),o=Math.cos(n),l,f,c,d,m,v,p=O(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=S&&Math.abs(n+this.lat0)<=S?(i.x=NaN,i.y=NaN,i):this.sphere?(l=2*this.k0/(1+this.sinlat0*r+this.coslat0*o*Math.cos(p)),i.x=this.a*l*o*Math.sin(p)+this.x0,i.y=this.a*l*(this.coslat0*r-this.sinlat0*o*Math.cos(p))+this.y0,i):(f=2*Math.atan(this.ssfn_(n,r,this.e))-C,d=Math.cos(f),c=Math.sin(f),Math.abs(this.coslat0)<=S?(m=kt(this.e,n*this.con,this.con*r),v=2*this.a*this.k0*m/this.cons,i.x=this.x0+v*Math.sin(s-this.long0),i.y=this.y0-this.con*v*Math.cos(s-this.long0),i):(Math.abs(this.sinlat0)<S?(l=2*this.a*this.k0/(1+d*Math.cos(p)),i.y=l*c):(l=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*c+this.cosX0*d*Math.cos(p))),i.y=l*(this.cosX0*c-this.sinX0*d*Math.cos(p))+this.y0),i.x=l*d*Math.sin(p)+this.x0,i))}function sh(i){i.x-=this.x0,i.y-=this.y0;var s,n,r,o,l,f=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var c=2*Math.atan(f/(2*this.a*this.k0));return s=this.long0,n=this.lat0,f<=S?(i.x=s,i.y=n,i):(n=Math.asin(Math.cos(c)*this.sinlat0+i.y*Math.sin(c)*this.coslat0/f),Math.abs(this.coslat0)<S?this.lat0>0?s=O(this.long0+Math.atan2(i.x,-1*i.y)):s=O(this.long0+Math.atan2(i.x,i.y)):s=O(this.long0+Math.atan2(i.x*Math.sin(c),f*this.coslat0*Math.cos(c)-i.y*this.sinlat0*Math.sin(c))),i.x=s,i.y=n,i)}else if(Math.abs(this.coslat0)<=S){if(f<=S)return n=this.lat0,s=this.long0,i.x=s,i.y=n,i;i.x*=this.con,i.y*=this.con,r=f*this.cons/(2*this.a*this.k0),n=this.con*Zi(this.e,r),s=this.con*O(this.con*this.long0+Math.atan2(i.x,-1*i.y))}else o=2*Math.atan(f*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,f<=S?l=this.X0:(l=Math.asin(Math.cos(o)*this.sinX0+i.y*Math.sin(o)*this.cosX0/f),s=O(this.long0+Math.atan2(i.x*Math.sin(o),f*this.cosX0*Math.cos(o)-i.y*this.sinX0*Math.sin(o)))),n=-1*Zi(this.e,Math.tan(.5*(C+l)));return i.x=s,i.y=n,i}var nh=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const ah={init:ih,forward:eh,inverse:sh,names:nh,ssfn_:th};function oh(){var i=this.lat0;this.lambda0=this.long0;var s=Math.sin(i),n=this.a,r=this.rf,o=1/r,l=2*o-Math.pow(o,2),f=this.e=Math.sqrt(l);this.R=this.k0*n*Math.sqrt(1-l)/(1-l*Math.pow(s,2)),this.alpha=Math.sqrt(1+l/(1-l)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(s/this.alpha);var c=Math.log(Math.tan(Math.PI/4+this.b0/2)),d=Math.log(Math.tan(Math.PI/4+i/2)),m=Math.log((1+f*s)/(1-f*s));this.K=c-this.alpha*d+this.alpha*f/2*m}function rh(i){var s=Math.log(Math.tan(Math.PI/4-i.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),r=-this.alpha*(s+n)+this.K,o=2*(Math.atan(Math.exp(r))-Math.PI/4),l=this.alpha*(i.x-this.lambda0),f=Math.atan(Math.sin(l)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(l))),c=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(l));return i.y=this.R/2*Math.log((1+Math.sin(c))/(1-Math.sin(c)))+this.y0,i.x=this.R*f+this.x0,i}function hh(i){for(var s=i.x-this.x0,n=i.y-this.y0,r=s/this.R,o=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),l=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(r)),f=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(o))),c=this.lambda0+f/this.alpha,d=0,m=l,v=-1e3,p=0;Math.abs(m-v)>1e-7;){if(++p>20)return;d=1/this.alpha*(Math.log(Math.tan(Math.PI/4+l/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(m))/2)),v=m,m=2*Math.atan(Math.exp(d))-Math.PI/2}return i.x=c,i.y=m,i}var lh=["somerc"];const uh={init:oh,forward:rh,inverse:hh,names:lh};var Mi=1e-7;function ch(i){var s=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],n=typeof i.PROJECTION=="object"?Object.keys(i.PROJECTION)[0]:i.PROJECTION;return"no_uoff"in i||"no_off"in i||s.indexOf(n)!==-1}function fh(){var i,s,n,r,o,l,f,c,d,m,v=0,p,y=0,b=0,A=0,P=0,E=0,z=0;this.no_off=ch(this),this.no_rot="no_rot"in this;var B=!1;"alpha"in this&&(B=!0);var k=!1;if("rectified_grid_angle"in this&&(k=!0),B&&(z=this.alpha),k&&(v=this.rectified_grid_angle*mt),B||k)y=this.longc;else if(b=this.long1,P=this.lat1,A=this.long2,E=this.lat2,Math.abs(P-E)<=Mi||(i=Math.abs(P))<=Mi||Math.abs(i-C)<=Mi||Math.abs(Math.abs(this.lat0)-C)<=Mi||Math.abs(Math.abs(E)-C)<=Mi)throw new Error;var j=1-this.es;s=Math.sqrt(j),Math.abs(this.lat0)>S?(c=Math.sin(this.lat0),n=Math.cos(this.lat0),i=1-this.es*c*c,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/j),this.A=this.B*this.k0*s/i,r=this.B*s/(n*Math.sqrt(i)),o=r*r-1,o<=0?o=0:(o=Math.sqrt(o),this.lat0<0&&(o=-o)),this.E=o+=r,this.E*=Math.pow(kt(this.e,this.lat0,c),this.B)):(this.B=1/s,this.A=this.k0,this.E=r=o=1),B||k?(B?(p=Math.asin(Math.sin(z)/r),k||(v=z)):(p=v,z=Math.asin(r*Math.sin(p))),this.lam0=y-Math.asin(.5*(o-1/o)*Math.tan(p))/this.B):(l=Math.pow(kt(this.e,P,Math.sin(P)),this.B),f=Math.pow(kt(this.e,E,Math.sin(E)),this.B),o=this.E/l,d=(f-l)/(f+l),m=this.E*this.E,m=(m-f*l)/(m+f*l),i=b-A,i<-Math.pi?A-=Bi:i>Math.pi&&(A+=Bi),this.lam0=O(.5*(b+A)-Math.atan(m*Math.tan(.5*this.B*(b-A))/d)/this.B),p=Math.atan(2*Math.sin(this.B*O(b-this.lam0))/(o-1/o)),v=z=Math.asin(r*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),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(z))),this.lat0<0&&(this.u_0=-this.u_0)),o=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(X-o)),this.v_pole_s=this.ArB*Math.log(Math.tan(X+o))}function dh(i){var s={},n,r,o,l,f,c,d,m;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-C)>S){if(f=this.E/Math.pow(kt(this.e,i.y,Math.sin(i.y)),this.B),c=1/f,n=.5*(f-c),r=.5*(f+c),l=Math.sin(this.B*i.x),o=(n*this.singam-l*this.cosgam)/r,Math.abs(Math.abs(o)-1)<S)throw new Error;m=.5*this.ArB*Math.log((1-o)/(1+o)),c=Math.cos(this.B*i.x),Math.abs(c)<Mi?d=this.A*i.x:d=this.ArB*Math.atan2(n*this.cosgam+l*this.singam,c)}else m=i.y>0?this.v_pole_n:this.v_pole_s,d=this.ArB*i.y;return this.no_rot?(s.x=d,s.y=m):(d-=this.u_0,s.x=m*this.cosrot+d*this.sinrot,s.y=d*this.cosrot-m*this.sinrot),s.x=this.a*s.x+this.x0,s.y=this.a*s.y+this.y0,s}function _h(i){var s,n,r,o,l,f,c,d={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(n=i.y,s=i.x):(n=i.x*this.cosrot-i.y*this.sinrot,s=i.y*this.cosrot+i.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),o=.5*(r-1/r),l=.5*(r+1/r),f=Math.sin(this.BrA*s),c=(f*this.cosgam+o*this.singam)/l,Math.abs(Math.abs(c)-1)<S)d.x=0,d.y=c<0?-C:C;else{if(d.y=this.E/Math.sqrt((1+c)/(1-c)),d.y=Zi(this.e,Math.pow(d.y,1/this.B)),d.y===1/0)throw new Error;d.x=-this.rB*Math.atan2(o*this.cosgam-f*this.singam,Math.cos(this.BrA*s))}return d.x+=this.lam0,d}var mh=["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"];const ph={init:fh,forward:dh,inverse:_h,names:mh};function gh(){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)<S)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var s=Math.sin(this.lat1),n=Math.cos(this.lat1),r=Ft(this.e,s,n),o=kt(this.e,this.lat1,s),l=Math.sin(this.lat2),f=Math.cos(this.lat2),c=Ft(this.e,l,f),d=kt(this.e,this.lat2,l),m=kt(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>S?this.ns=Math.log(r/c)/Math.log(o/d):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=r/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(m,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function vh(i){var s=i.x,n=i.y;Math.abs(2*Math.abs(n)-Math.PI)<=S&&(n=Di(n)*(C-2*S));var r=Math.abs(Math.abs(n)-C),o,l;if(r>S)o=kt(this.e,n,Math.sin(n)),l=this.a*this.f0*Math.pow(o,this.ns);else{if(r=n*this.ns,r<=0)return null;l=0}var f=this.ns*O(s-this.long0);return i.x=this.k0*(l*Math.sin(f))+this.x0,i.y=this.k0*(this.rh-l*Math.cos(f))+this.y0,i}function yh(i){var s,n,r,o,l,f=(i.x-this.x0)/this.k0,c=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(f*f+c*c),n=1):(s=-Math.sqrt(f*f+c*c),n=-1);var d=0;if(s!==0&&(d=Math.atan2(n*f,n*c)),s!==0||this.ns>0){if(n=1/this.ns,r=Math.pow(s/(this.a*this.f0),n),o=Zi(this.e,r),o===-9999)return null}else o=-C;return l=O(d/this.ns+this.long0),i.x=l,i.y=o,i}var Mh=["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)"];const xh={init:gh,forward:vh,inverse:yh,names:Mh};function wh(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),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}function bh(i){var s,n,r,o,l,f,c,d=i.x,m=i.y,v=O(d-this.long0);return s=Math.pow((1+this.e*Math.sin(m))/(1-this.e*Math.sin(m)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(m/2+this.s45),this.alfa)/s)-this.s45),r=-v*this.alfa,o=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),l=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(o)),f=this.n*l,c=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(o/2+this.s45),this.n),i.y=c*Math.cos(f)/1,i.x=c*Math.sin(f)/1,this.czech||(i.y*=-1,i.x*=-1),i}function Lh(i){var s,n,r,o,l,f,c,d,m=i.x;i.x=i.y,i.y=m,this.czech||(i.y*=-1,i.x*=-1),f=Math.sqrt(i.x*i.x+i.y*i.y),l=Math.atan2(i.y,i.x),o=l/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/f,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),s=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(o)),n=Math.asin(Math.cos(r)*Math.sin(o)/Math.cos(s)),i.x=this.long0-n/this.alfa,c=s,d=0;var v=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(s/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.e/2))-this.s45),Math.abs(c-i.y)<1e-10&&(d=1),c=i.y,v+=1;while(d===0&&v<15);return v>=15?null:i}var Ph=["Krovak","krovak"];const Ah={init:wh,forward:bh,inverse:Lh,names:Ph};function Mt(i,s,n,r,o){return i*o-s*Math.sin(2*o)+n*Math.sin(4*o)-r*Math.sin(6*o)}function Gi(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Ui(i){return .375*i*(1+.25*i*(1+.46875*i))}function ji(i){return .05859375*i*i*(1+.75*i)}function Hi(i){return i*i*i*(35/3072)}function xi(i,s,n){var r=s*n;return i/Math.sqrt(1-r*r)}function ii(i){return Math.abs(i)<C?i:i-Di(i)*Math.PI}function Pe(i,s,n,r,o){var l,f;l=i/s;for(var c=0;c<15;c++)if(f=(i-(s*l-n*Math.sin(2*l)+r*Math.sin(4*l)-o*Math.sin(6*l)))/(s-2*n*Math.cos(2*l)+4*r*Math.cos(4*l)-6*o*Math.cos(6*l)),l+=f,Math.abs(f)<=1e-10)return l;return NaN}function Th(){this.sphere||(this.e0=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.ml0=this.a*Mt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Ch(i){var s,n,r=i.x,o=i.y;if(r=O(r-this.long0),this.sphere)s=this.a*Math.asin(Math.cos(o)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(o),Math.cos(r))-this.lat0);else{var l=Math.sin(o),f=Math.cos(o),c=xi(this.a,this.e,l),d=Math.tan(o)*Math.tan(o),m=r*Math.cos(o),v=m*m,p=this.es*f*f/(1-this.es),y=this.a*Mt(this.e0,this.e1,this.e2,this.e3,o);s=c*m*(1-v*d*(1/6-(8-d+8*p)*v/120)),n=y-this.ml0+c*l/f*v*(.5+(5-d+6*p)*v/24)}return i.x=s+this.x0,i.y=n+this.y0,i}function Eh(i){i.x-=this.x0,i.y-=this.y0;var s=i.x/this.a,n=i.y/this.a,r,o;if(this.sphere){var l=n+this.lat0;r=Math.asin(Math.sin(l)*Math.cos(s)),o=Math.atan2(Math.tan(s),Math.cos(l))}else{var f=this.ml0/this.a+n,c=Pe(f,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(c)-C)<=S)return i.x=this.long0,i.y=C,n<0&&(i.y*=-1),i;var d=xi(this.a,this.e,Math.sin(c)),m=d*d*d/this.a/this.a*(1-this.es),v=Math.pow(Math.tan(c),2),p=s*this.a/d,y=p*p;r=c-d*Math.tan(c)/m*p*p*(.5-(1+3*v)*p*p/24),o=p*(1-y*(v/3+(1+3*v)*v*y/15))/Math.cos(c)}return i.x=O(o+this.long0),i.y=ii(r),i}var Sh=["Cassini","Cassini_Soldner","cass"];const Oh={init:Th,forward:Ch,inverse:Eh,names:Sh};function ei(i,s){var n;return i>1e-7?(n=i*s,(1-i*i)*(s/(1-n*n)-.5/i*Math.log((1-n)/(1+n)))):2*s}var Ih=1,zh=2,Nh=3,kh=4;function Bh(){var i=Math.abs(this.lat0);if(Math.abs(i-C)<S?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<S?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var s;switch(this.qp=ei(this.e,1),this.mmf=.5/(1-this.es),this.apa=Hh(this.es),this.mode){case this.N_POLE:this.dd=1;break;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),s=Math.sin(this.lat0),this.sinb1=ei(this.e,s)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*s*s)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Rh(i){var s,n,r,o,l,f,c,d,m,v,p=i.x,y=i.y;if(p=O(p-this.long0),this.sphere){if(l=Math.sin(y),v=Math.cos(y),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+v*r:1+this.sinph0*l+this.cosph0*v*r,n<=S)return null;n=Math.sqrt(2/n),s=n*v*Math.sin(p),n*=this.mode===this.EQUIT?l:this.cosph0*l-this.sinph0*v*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(y+this.lat0)<S)return null;n=X-y*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),s=n*Math.sin(p),n*=r}}else{switch(c=0,d=0,m=0,r=Math.cos(p),o=Math.sin(p),l=Math.sin(y),f=ei(this.e,l),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(c=f/this.qp,d=Math.sqrt(1-c*c)),this.mode){case this.OBLIQ:m=1+this.sinb1*c+this.cosb1*d*r;break;case this.EQUIT:m=1+d*r;break;case this.N_POLE:m=C+y,f=this.qp-f;break;case this.S_POLE:m=y-C,f=this.qp+f;break}if(Math.abs(m)<S)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:m=Math.sqrt(2/m),this.mode===this.OBLIQ?n=this.ymf*m*(this.cosb1*c-this.sinb1*d*r):n=(m=Math.sqrt(2/(1+d*r)))*c*this.ymf,s=this.xmf*m*d*o;break;case this.N_POLE:case this.S_POLE:f>=0?(s=(m=Math.sqrt(f))*o,n=r*(this.mode===this.S_POLE?m:-m)):s=n=0;break}}return i.x=this.a*s+this.x0,i.y=this.a*n+this.y0,i}function Dh(i){i.x-=this.x0,i.y-=this.y0;var s=i.x/this.a,n=i.y/this.a,r,o,l,f,c,d,m;if(this.sphere){var v=0,p,y=0;if(p=Math.sqrt(s*s+n*n),o=p*.5,o>1)return null;switch(o=2*Math.asin(o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(y=Math.sin(o),v=Math.cos(o)),this.mode){case this.EQUIT:o=Math.abs(p)<=S?0:Math.asin(n*y/p),s*=y,n=v*p;break;case this.OBLIQ:o=Math.abs(p)<=S?this.lat0:Math.asin(v*this.sinph0+n*y*this.cosph0/p),s*=y*this.cosph0,n=(v-Math.sin(o)*this.sinph0)*p;break;case this.N_POLE:n=-n,o=C-o;break;case this.S_POLE:o-=C;break}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(s,n)}else{if(m=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s/=this.dd,n*=this.dd,d=Math.sqrt(s*s+n*n),d<S)return i.x=this.long0,i.y=this.lat0,i;f=2*Math.asin(.5*d/this.rq),l=Math.cos(f),s*=f=Math.sin(f),this.mode===this.OBLIQ?(m=l*this.sinb1+n*f*this.cosb1/d,c=this.qp*m,n=d*this.cosb1*l-n*this.sinb1*f):(m=n*f/d,c=this.qp*m,n=d*l)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),c=s*s+n*n,!c)return i.x=this.long0,i.y=this.lat0,i;m=1-c/this.qp,this.mode===this.S_POLE&&(m=-m)}r=Math.atan2(s,n),o=Wh(Math.asin(m),this.apa)}return i.x=O(this.long0+r),i.y=o,i}var Zh=.3333333333333333,Fh=.17222222222222222,qh=.10257936507936508,Gh=.06388888888888888,Uh=.0664021164021164,jh=.016415012942191543;function Hh(i){var s,n=[];return n[0]=i*Zh,s=i*i,n[0]+=s*Fh,n[1]=s*Gh,s*=i,n[0]+=s*qh,n[1]+=s*Uh,n[2]=s*jh,n}function Wh(i,s){var n=i+i;return i+s[0]*Math.sin(n)+s[1]*Math.sin(n+n)+s[2]*Math.sin(n+n+n)}var $h=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Vh={init:Bh,forward:Rh,inverse:Dh,names:$h,S_POLE:Ih,N_POLE:zh,EQUIT:Nh,OBLIQ:kh};function si(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function Qh(){Math.abs(this.lat1+this.lat2)<S||(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=Ft(this.e3,this.sin_po,this.cos_po),this.qs1=ei(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=Ft(this.e3,this.sin_po,this.cos_po),this.qs2=ei(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=ei(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>S?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)}function Xh(i){var s=i.x,n=i.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=ei(this.e3,this.sin_phi),o=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,l=this.ns0*O(s-this.long0),f=o*Math.sin(l)+this.x0,c=this.rh-o*Math.cos(l)+this.y0;return i.x=f,i.y=c,i}function Kh(i){var s,n,r,o,l,f;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(s=Math.sqrt(i.x*i.x+i.y*i.y),r=1):(s=-Math.sqrt(i.x*i.x+i.y*i.y),r=-1),o=0,s!==0&&(o=Math.atan2(r*i.x,r*i.y)),r=s*this.ns0/this.a,this.sphere?f=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,f=this.phi1z(this.e3,n)),l=O(o/this.ns0+this.long0),i.x=l,i.y=f,i}function Yh(i,s){var n,r,o,l,f,c=si(.5*s);if(i<S)return c;for(var d=i*i,m=1;m<=25;m++)if(n=Math.sin(c),r=Math.cos(c),o=i*n,l=1-o*o,f=.5*l*l/r*(s/(1-d)-n/l+.5/i*Math.log((1-o)/(1+o))),c=c+f,Math.abs(f)<=1e-7)return c;return null}var Jh=["Albers_Conic_Equal_Area","Albers","aea"];const tl={init:Qh,forward:Xh,inverse:Kh,names:Jh,phi1z:Yh};function il(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function el(i){var s,n,r,o,l,f,c,d,m=i.x,v=i.y;return r=O(m-this.long0),s=Math.sin(v),n=Math.cos(v),o=Math.cos(r),f=this.sin_p14*s+this.cos_p14*n*o,l=1,f>0||Math.abs(f)<=S?(c=this.x0+this.a*l*n*Math.sin(r)/f,d=this.y0+this.a*l*(this.cos_p14*s-this.sin_p14*n*o)/f):(c=this.x0+this.infinity_dist*n*Math.sin(r),d=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*n*o)),i.x=c,i.y=d,i}function sl(i){var s,n,r,o,l,f;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(s=Math.sqrt(i.x*i.x+i.y*i.y))?(o=Math.atan2(s,this.rc),n=Math.sin(o),r=Math.cos(o),f=si(r*this.sin_p14+i.y*n*this.cos_p14/s),l=Math.atan2(i.x*n,s*this.cos_p14*r-i.y*this.sin_p14*n),l=O(this.long0+l)):(f=this.phic0,l=0),i.x=l,i.y=f,i}var nl=["gnom"];const al={init:il,forward:el,inverse:sl,names:nl};function ol(i,s){var n=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(s)-n)<1e-6)return s<0?-1*C:C;for(var r=Math.asin(.5*s),o,l,f,c,d=0;d<30;d++)if(l=Math.sin(r),f=Math.cos(r),c=i*l,o=Math.pow(1-c*c,2)/(2*f)*(s/(1-i*i)-l/(1-c*c)+.5/i*Math.log((1-c)/(1+c))),r+=o,Math.abs(o)<=1e-10)return r;return NaN}function rl(){this.sphere||(this.k0=Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function hl(i){var s=i.x,n=i.y,r,o,l=O(s-this.long0);if(this.sphere)r=this.x0+this.a*l*Math.cos(this.lat_ts),o=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var f=ei(this.e,Math.sin(n));r=this.x0+this.a*this.k0*l,o=this.y0+this.a*f*.5/this.k0}return i.x=r,i.y=o,i}function ll(i){i.x-=this.x0,i.y-=this.y0;var s,n;return this.sphere?(s=O(this.long0+i.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(n=ol(this.e,2*i.y*this.k0/this.a),s=O(this.long0+i.x/(this.a*this.k0))),i.x=s,i.y=n,i}var ul=["cea"];const cl={init:rl,forward:hl,inverse:ll,names:ul};function fl(){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)}function dl(i){var s=i.x,n=i.y,r=O(s-this.long0),o=ii(n-this.lat0);return i.x=this.x0+this.a*r*this.rc,i.y=this.y0+this.a*o,i}function _l(i){var s=i.x,n=i.y;return i.x=O(this.long0+(s-this.x0)/(this.a*this.rc)),i.y=ii(this.lat0+(n-this.y0)/this.a),i}var ml=["Equirectangular","Equidistant_Cylindrical","eqc"];const pl={init:fl,forward:dl,inverse:_l,names:ml};var zn=20;function gl(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.ml0=this.a*Mt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function vl(i){var s=i.x,n=i.y,r,o,l,f=O(s-this.long0);if(l=f*Math.sin(n),this.sphere)Math.abs(n)<=S?(r=this.a*f,o=-1*this.a*this.lat0):(r=this.a*Math.sin(l)/Math.tan(n),o=this.a*(ii(n-this.lat0)+(1-Math.cos(l))/Math.tan(n)));else if(Math.abs(n)<=S)r=this.a*f,o=-1*this.ml0;else{var c=xi(this.a,this.e,Math.sin(n))/Math.tan(n);r=c*Math.sin(l),o=this.a*Mt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+c*(1-Math.cos(l))}return i.x=r+this.x0,i.y=o+this.y0,i}function yl(i){var s,n,r,o,l,f,c,d,m;if(r=i.x-this.x0,o=i.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=S)s=O(r/this.a+this.long0),n=0;else{f=this.lat0+o/this.a,c=r*r/this.a/this.a+f*f,d=f;var v;for(l=zn;l;--l)if(v=Math.tan(d),m=-1*(f*(d*v+1)-d-.5*(d*d+c)*v)/((d-f)/v-1),d+=m,Math.abs(m)<=S){n=d;break}s=O(this.long0+Math.asin(r*Math.tan(d)/this.a)/Math.sin(n))}else if(Math.abs(o+this.ml0)<=S)n=0,s=O(this.long0+r/this.a);else{f=(this.ml0+o)/this.a,c=r*r/this.a/this.a+f*f,d=f;var p,y,b,A,P;for(l=zn;l;--l)if(P=this.e*Math.sin(d),p=Math.sqrt(1-P*P)*Math.tan(d),y=this.a*Mt(this.e0,this.e1,this.e2,this.e3,d),b=this.e0-2*this.e1*Math.cos(2*d)+4*this.e2*Math.cos(4*d)-6*this.e3*Math.cos(6*d),A=y/this.a,m=(f*(p*A+1)-A-.5*p*(A*A+c))/(this.es*Math.sin(2*d)*(A*A+c-2*f*A)/(4*p)+(f-A)*(p*b-2/Math.sin(2*d))-b),d-=m,Math.abs(m)<=S){n=d;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),s=O(this.long0+Math.asin(r*p/this.a)/Math.sin(n))}return i.x=s,i.y=n,i}var Ml=["Polyconic","poly"];const xl={init:gl,forward:vl,inverse:yl,names:Ml};function wl(){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}function bl(i){var s,n=i.x,r=i.y,o=r-this.lat0,l=n-this.long0,f=o/ki*1e-5,c=l,d=1,m=0;for(s=1;s<=10;s++)d=d*f,m=m+this.A[s]*d;var v=m,p=c,y=1,b=0,A,P,E=0,z=0;for(s=1;s<=6;s++)A=y*v-b*p,P=b*v+y*p,y=A,b=P,E=E+this.B_re[s]*y-this.B_im[s]*b,z=z+this.B_im[s]*y+this.B_re[s]*b;return i.x=z*this.a+this.x0,i.y=E*this.a+this.y0,i}function Ll(i){var s,n=i.x,r=i.y,o=n-this.x0,l=r-this.y0,f=l/this.a,c=o/this.a,d=1,m=0,v,p,y=0,b=0;for(s=1;s<=6;s++)v=d*f-m*c,p=m*f+d*c,d=v,m=p,y=y+this.C_re[s]*d-this.C_im[s]*m,b=b+this.C_im[s]*d+this.C_re[s]*m;for(var A=0;A<this.iterations;A++){var P=y,E=b,z,B,k=f,j=c;for(s=2;s<=6;s++)z=P*y-E*b,B=E*y+P*b,P=z,E=B,k=k+(s-1)*(this.B_re[s]*P-this.B_im[s]*E),j=j+(s-1)*(this.B_im[s]*P+this.B_re[s]*E);P=1,E=0;var H=this.B_re[1],W=this.B_im[1];for(s=2;s<=6;s++)z=P*y-E*b,B=E*y+P*b,P=z,E=B,H=H+s*(this.B_re[s]*P-this.B_im[s]*E),W=W+s*(this.B_im[s]*P+this.B_re[s]*E);var ct=H*H+W*W;y=(k*H+j*W)/ct,b=(j*H-k*W)/ct}var tt=y,Pt=b,Gt=1,nt=0;for(s=1;s<=9;s++)Gt=Gt*tt,nt=nt+this.D[s]*Gt;var pt=this.lat0+nt*ki*1e5,cs=this.long0+Pt;return i.x=cs,i.y=pt,i}var Pl=["New_Zealand_Map_Grid","nzmg"];const Al={init:wl,forward:bl,inverse:Ll,names:Pl};function Tl(){}function Cl(i){var s=i.x,n=i.y,r=O(s-this.long0),o=this.x0+this.a*r,l=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return i.x=o,i.y=l,i}function El(i){i.x-=this.x0,i.y-=this.y0;var s=O(this.long0+i.x/this.a),n=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=s,i.y=n,i}var Sl=["Miller_Cylindrical","mill"];const Ol={init:Tl,forward:Cl,inverse:El,names:Sl};var Il=20;function zl(){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=es(this.es)}function Nl(i){var s,n,r=i.x,o=i.y;if(r=O(r-this.long0),this.sphere){if(!this.m)o=this.n!==1?Math.asin(this.n*Math.sin(o)):o;else for(var l=this.n*Math.sin(o),f=Il;f;--f){var c=(this.m*o+Math.sin(o)-l)/(this.m+Math.cos(o));if(o-=c,Math.abs(c)<S)break}s=this.a*this.C_x*r*(this.m+Math.cos(o)),n=this.a*this.C_y*o}else{var d=Math.sin(o),m=Math.cos(o);n=this.a*yi(o,d,m,this.en),s=this.a*r*m/Math.sqrt(1-this.es*d*d)}return i.x=s,i.y=n,i}function kl(i){var s,n,r,o;return i.x-=this.x0,r=i.x/this.a,i.y-=this.y0,s=i.y/this.a,this.sphere?(s/=this.C_y,r=r/(this.C_x*(this.m+Math.cos(s))),this.m?s=si((this.m*s+Math.sin(s))/this.n):this.n!==1&&(s=si(Math.sin(s)/this.n)),r=O(r+this.long0),s=ii(s)):(s=ss(i.y/this.a,this.es,this.en),o=Math.abs(s),o<C?(o=Math.sin(s),n=this.long0+i.x*Math.sqrt(1-this.es*o*o)/(this.a*Math.cos(s)),r=O(n)):o-S<C&&(r=this.long0)),i.x=r,i.y=s,i}var Bl=["Sinusoidal","sinu"];const Rl={init:zl,forward:Nl,inverse:kl,names:Bl};function Dl(){}function Zl(i){for(var s=i.x,n=i.y,r=O(s-this.long0),o=n,l=Math.PI*Math.sin(n);;){var f=-(o+Math.sin(o)-l)/(1+Math.cos(o));if(o+=f,Math.abs(f)<S)break}o/=2,Math.PI/2-Math.abs(n)<S&&(r=0);var c=.900316316158*this.a*r*Math.cos(o)+this.x0,d=1.4142135623731*this.a*Math.sin(o)+this.y0;return i.x=c,i.y=d,i}function Fl(i){var s,n;i.x-=this.x0,i.y-=this.y0,n=i.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),s=Math.asin(n);var r=O(this.long0+i.x/(.900316316158*this.a*Math.cos(s)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*s+Math.sin(2*s))/Math.PI,Math.abs(n)>1&&(n=1);var o=Math.asin(n);return i.x=r,i.y=o,i}var ql=["Mollweide","moll"];const Gl={init:Dl,forward:Zl,inverse:Fl,names:ql};function Ul(){Math.abs(this.lat1+this.lat2)<S||(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=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Ft(this.e,this.sinphi,this.cosphi),this.ml1=Mt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<S?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Ft(this.e,this.sinphi,this.cosphi),this.ml2=Mt(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=Mt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function jl(i){var s=i.x,n=i.y,r;if(this.sphere)r=this.a*(this.g-n);else{var o=Mt(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-o)}var l=this.ns*O(s-this.long0),f=this.x0+r*Math.sin(l),c=this.y0+this.rh-r*Math.cos(l);return i.x=f,i.y=c,i}function Hl(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var s,n,r,o;this.ns>=0?(n=Math.sqrt(i.x*i.x+i.y*i.y),s=1):(n=-Math.sqrt(i.x*i.x+i.y*i.y),s=-1);var l=0;if(n!==0&&(l=Math.atan2(s*i.x,s*i.y)),this.sphere)return o=O(this.long0+l/this.ns),r=ii(this.g-n/this.a),i.x=o,i.y=r,i;var f=this.g-n/this.a;return r=Pe(f,this.e0,this.e1,this.e2,this.e3),o=O(this.long0+l/this.ns),i.x=o,i.y=r,i}var Wl=["Equidistant_Conic","eqdc"];const $l={init:Ul,forward:jl,inverse:Hl,names:Wl};function Vl(){this.R=this.a}function Ql(i){var s=i.x,n=i.y,r=O(s-this.long0),o,l;Math.abs(n)<=S&&(o=this.x0+this.R*r,l=this.y0);var f=si(2*Math.abs(n/Math.PI));(Math.abs(r)<=S||Math.abs(Math.abs(n)-C)<=S)&&(o=this.x0,n>=0?l=this.y0+Math.PI*this.R*Math.tan(.5*f):l=this.y0+Math.PI*this.R*-Math.tan(.5*f));var c=.5*Math.abs(Math.PI/r-r/Math.PI),d=c*c,m=Math.sin(f),v=Math.cos(f),p=v/(m+v-1),y=p*p,b=p*(2/m-1),A=b*b,P=Math.PI*this.R*(c*(p-A)+Math.sqrt(d*(p-A)*(p-A)-(A+d)*(y-A)))/(A+d);r<0&&(P=-P),o=this.x0+P;var E=d+p;return P=Math.PI*this.R*(b*E-c*Math.sqrt((A+d)*(d+1)-E*E))/(A+d),n>=0?l=this.y0+P:l=this.y0-P,i.x=o,i.y=l,i}function Xl(i){var s,n,r,o,l,f,c,d,m,v,p,y,b;return i.x-=this.x0,i.y-=this.y0,p=Math.PI*this.R,r=i.x/p,o=i.y/p,l=r*r+o*o,f=-Math.abs(o)*(1+l),c=f-2*o*o+r*r,d=-2*f+1+2*o*o+l*l,b=o*o/d+(2*c*c*c/d/d/d-9*f*c/d/d)/27,m=(f-c*c/3/d)/d,v=2*Math.sqrt(-m/3),p=3*b/m/v,Math.abs(p)>1&&(p>=0?p=1:p=-1),y=Math.acos(p)/3,i.y>=0?n=(-v*Math.cos(y+Math.PI/3)-c/3/d)*Math.PI:n=-(-v*Math.cos(y+Math.PI/3)-c/3/d)*Math.PI,Math.abs(r)<S?s=this.long0:s=O(this.long0+Math.PI*(l-1+Math.sqrt(1+2*(r*r-o*o)+l*l))/2/r),i.x=s,i.y=n,i}var Kl=["Van_der_Grinten_I","VanDerGrinten","vandg"];const Yl={init:Vl,forward:Ql,inverse:Xl,names:Kl};function Jl(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function tu(i){var s=i.x,n=i.y,r=Math.sin(i.y),o=Math.cos(i.y),l=O(s-this.long0),f,c,d,m,v,p,y,b,A,P,E,z,B,k,j,H,W,ct,tt,Pt,Gt,nt,pt;return this.sphere?Math.abs(this.sin_p12-1)<=S?(i.x=this.x0+this.a*(C-n)*Math.sin(l),i.y=this.y0-this.a*(C-n)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=S?(i.x=this.x0+this.a*(C+n)*Math.sin(l),i.y=this.y0+this.a*(C+n)*Math.cos(l),i):(ct=this.sin_p12*r+this.cos_p12*o*Math.cos(l),H=Math.acos(ct),W=H?H/Math.sin(H):1,i.x=this.x0+this.a*W*o*Math.sin(l),i.y=this.y0+this.a*W*(this.cos_p12*r-this.sin_p12*o*Math.cos(l)),i):(f=Gi(this.es),c=Ui(this.es),d=ji(this.es),m=Hi(this.es),Math.abs(this.sin_p12-1)<=S?(v=this.a*Mt(f,c,d,m,C),p=this.a*Mt(f,c,d,m,n),i.x=this.x0+(v-p)*Math.sin(l),i.y=this.y0-(v-p)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=S?(v=this.a*Mt(f,c,d,m,C),p=this.a*Mt(f,c,d,m,n),i.x=this.x0+(v+p)*Math.sin(l),i.y=this.y0+(v+p)*Math.cos(l),i):(y=r/o,b=xi(this.a,this.e,this.sin_p12),A=xi(this.a,this.e,r),P=Math.atan((1-this.es)*y+this.es*b*this.sin_p12/(A*o)),E=Math.atan2(Math.sin(l),this.cos_p12*Math.tan(P)-this.sin_p12*Math.cos(l)),E===0?tt=Math.asin(this.cos_p12*Math.sin(P)-this.sin_p12*Math.cos(P)):Math.abs(Math.abs(E)-Math.PI)<=S?tt=-Math.asin(this.cos_p12*Math.sin(P)-this.sin_p12*Math.cos(P)):tt=Math.asin(Math.sin(l)*Math.cos(P)/Math.sin(E)),z=this.e*this.sin_p12/Math.sqrt(1-this.es),B=this.e*this.cos_p12*Math.cos(E)/Math.sqrt(1-this.es),k=z*B,j=B*B,Pt=tt*tt,Gt=Pt*tt,nt=Gt*tt,pt=nt*tt,H=b*tt*(1-Pt*j*(1-j)/6+Gt/8*k*(1-2*j)+nt/120*(j*(4-7*j)-3*z*z*(1-7*j))-pt/48*k),i.x=this.x0+H*Math.sin(E),i.y=this.y0+H*Math.cos(E),i))}function iu(i){i.x-=this.x0,i.y-=this.y0;var s,n,r,o,l,f,c,d,m,v,p,y,b,A,P,E,z,B,k,j,H,W,ct,tt;return this.sphere?(s=Math.sqrt(i.x*i.x+i.y*i.y),s>2*C*this.a?void 0:(n=s/this.a,r=Math.sin(n),o=Math.cos(n),l=this.long0,Math.abs(s)<=S?f=this.lat0:(f=si(o*this.sin_p12+i.y*r*this.cos_p12/s),c=Math.abs(this.lat0)-C,Math.abs(c)<=S?this.lat0>=0?l=O(this.long0+Math.atan2(i.x,-i.y)):l=O(this.long0-Math.atan2(-i.x,i.y)):l=O(this.long0+Math.atan2(i.x*r,s*this.cos_p12*o-i.y*this.sin_p12*r))),i.x=l,i.y=f,i)):(d=Gi(this.es),m=Ui(this.es),v=ji(this.es),p=Hi(this.es),Math.abs(this.sin_p12-1)<=S?(y=this.a*Mt(d,m,v,p,C),s=Math.sqrt(i.x*i.x+i.y*i.y),b=y-s,f=Pe(b/this.a,d,m,v,p),l=O(this.long0+Math.atan2(i.x,-1*i.y)),i.x=l,i.y=f,i):Math.abs(this.sin_p12+1)<=S?(y=this.a*Mt(d,m,v,p,C),s=Math.sqrt(i.x*i.x+i.y*i.y),b=s-y,f=Pe(b/this.a,d,m,v,p),l=O(this.long0+Math.atan2(i.x,i.y)),i.x=l,i.y=f,i):(s=Math.sqrt(i.x*i.x+i.y*i.y),E=Math.atan2(i.x,i.y),A=xi(this.a,this.e,this.sin_p12),z=Math.cos(E),B=this.e*this.cos_p12*z,k=-B*B/(1-this.es),j=3*this.es*(1-k)*this.sin_p12*this.cos_p12*z/(1-this.es),H=s/A,W=H-k*(1+k)*Math.pow(H,3)/6-j*(1+3*k)*Math.pow(H,4)/24,ct=1-k*W*W/2-H*W*W*W/6,P=Math.asin(this.sin_p12*Math.cos(W)+this.cos_p12*Math.sin(W)*z),l=O(this.long0+Math.asin(Math.sin(E)*Math.sin(W)/Math.cos(P))),tt=Math.sin(P),f=Math.atan2((tt-this.es*ct*this.sin_p12)*Math.tan(P),tt*(1-this.es)),i.x=l,i.y=f,i))}var eu=["Azimuthal_Equidistant","aeqd"];const su={init:Jl,forward:tu,inverse:iu,names:eu};function nu(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function au(i){var s,n,r,o,l,f,c,d,m=i.x,v=i.y;return r=O(m-this.long0),s=Math.sin(v),n=Math.cos(v),o=Math.cos(r),f=this.sin_p14*s+this.cos_p14*n*o,l=1,(f>0||Math.abs(f)<=S)&&(c=this.a*l*n*Math.sin(r),d=this.y0+this.a*l*(this.cos_p14*s-this.sin_p14*n*o)),i.x=c,i.y=d,i}function ou(i){var s,n,r,o,l,f,c;return i.x-=this.x0,i.y-=this.y0,s=Math.sqrt(i.x*i.x+i.y*i.y),n=si(s/this.a),r=Math.sin(n),o=Math.cos(n),f=this.long0,Math.abs(s)<=S?(c=this.lat0,i.x=f,i.y=c,i):(c=si(o*this.sin_p14+i.y*r*this.cos_p14/s),l=Math.abs(this.lat0)-C,Math.abs(l)<=S?(this.lat0>=0?f=O(this.long0+Math.atan2(i.x,-i.y)):f=O(this.long0-Math.atan2(-i.x,i.y)),i.x=f,i.y=c,i):(f=O(this.long0+Math.atan2(i.x*r,s*this.cos_p14*o-i.y*this.sin_p14*r)),i.x=f,i.y=c,i))}var ru=["ortho"];const hu={init:nu,forward:au,inverse:ou,names:ru};var it={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},K={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function lu(){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>=C-X/2?this.face=it.TOP:this.lat0<=-(C-X/2)?this.face=it.BOTTOM:Math.abs(this.long0)<=X?this.face=it.FRONT:Math.abs(this.long0)<=C+X?this.face=this.long0>0?it.RIGHT:it.LEFT:this.face=it.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function uu(i){var s={x:0,y:0},n,r,o,l,f,c,d={value:0};if(i.x-=this.long0,this.es!==0?n=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):n=i.y,r=i.x,this.face===it.TOP)l=C-n,r>=X&&r<=C+X?(d.value=K.AREA_0,o=r-C):r>C+X||r<=-(C+X)?(d.value=K.AREA_1,o=r>0?r-at:r+at):r>-(C+X)&&r<=-X?(d.value=K.AREA_2,o=r+C):(d.value=K.AREA_3,o=r);else if(this.face===it.BOTTOM)l=C+n,r>=X&&r<=C+X?(d.value=K.AREA_0,o=-r+C):r<X&&r>=-X?(d.value=K.AREA_1,o=-r):r<-X&&r>=-(C+X)?(d.value=K.AREA_2,o=-r-C):(d.value=K.AREA_3,o=r>0?-r+at:-r-at);else{var m,v,p,y,b,A,P;this.face===it.RIGHT?r=wi(r,+C):this.face===it.BACK?r=wi(r,+at):this.face===it.LEFT&&(r=wi(r,-C)),y=Math.sin(n),b=Math.cos(n),A=Math.sin(r),P=Math.cos(r),m=b*P,v=b*A,p=y,this.face===it.FRONT?(l=Math.acos(m),o=Ae(l,p,v,d)):this.face===it.RIGHT?(l=Math.acos(v),o=Ae(l,p,-m,d)):this.face===it.BACK?(l=Math.acos(-m),o=Ae(l,p,-v,d)):this.face===it.LEFT?(l=Math.acos(-v),o=Ae(l,p,m,d)):(l=o=0,d.value=K.AREA_0)}return c=Math.atan(12/at*(o+Math.acos(Math.sin(o)*Math.cos(X))-C)),f=Math.sqrt((1-Math.cos(l))/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(o))))),d.value===K.AREA_1?c+=C:d.value===K.AREA_2?c+=at:d.value===K.AREA_3&&(c+=1.5*at),s.x=f*Math.cos(c),s.y=f*Math.sin(c),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,i.x=s.x,i.y=s.y,i}function cu(i){var s={lam:0,phi:0},n,r,o,l,f,c,d,m,v,p={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,r=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),n=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?p.value=K.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(p.value=K.AREA_1,n-=C):i.x<0&&-i.x>=Math.abs(i.y)?(p.value=K.AREA_2,n=n<0?n+at:n-at):(p.value=K.AREA_3,n+=C),v=at/12*Math.tan(n),f=Math.sin(v)/(Math.cos(v)-1/Math.sqrt(2)),c=Math.atan(f),o=Math.cos(n),l=Math.tan(r),d=1-o*o*l*l*(1-Math.cos(Math.atan(1/Math.cos(c)))),d<-1?d=-1:d>1&&(d=1),this.face===it.TOP)m=Math.acos(d),s.phi=C-m,p.value===K.AREA_0?s.lam=c+C:p.value===K.AREA_1?s.lam=c<0?c+at:c-at:p.value===K.AREA_2?s.lam=c-C:s.lam=c;else if(this.face===it.BOTTOM)m=Math.acos(d),s.phi=m-C,p.value===K.AREA_0?s.lam=-c+C:p.value===K.AREA_1?s.lam=-c:p.value===K.AREA_2?s.lam=-c-C:s.lam=c<0?-c-at:-c+at;else{var y,b,A;y=d,v=y*y,v>=1?A=0:A=Math.sqrt(1-v)*Math.sin(c),v+=A*A,v>=1?b=0:b=Math.sqrt(1-v),p.value===K.AREA_1?(v=b,b=-A,A=v):p.value===K.AREA_2?(b=-b,A=-A):p.value===K.AREA_3&&(v=b,b=A,A=-v),this.face===it.RIGHT?(v=y,y=-b,b=v):this.face===it.BACK?(y=-y,b=-b):this.face===it.LEFT&&(v=y,y=b,b=-v),s.phi=Math.acos(-A)-C,s.lam=Math.atan2(b,y),this.face===it.RIGHT?s.lam=wi(s.lam,-C):this.face===it.BACK?s.lam=wi(s.lam,-at):this.face===it.LEFT&&(s.lam=wi(s.lam,+C))}if(this.es!==0){var P,E,z;P=s.phi<0?1:0,E=Math.tan(s.phi),z=this.b/Math.sqrt(E*E+this.one_minus_f_squared),s.phi=Math.atan(Math.sqrt(this.a*this.a-z*z)/(this.one_minus_f*z)),P&&(s.phi=-s.phi)}return s.lam+=this.long0,i.x=s.lam,i.y=s.phi,i}function Ae(i,s,n,r){var o;return i<S?(r.value=K.AREA_0,o=0):(o=Math.atan2(s,n),Math.abs(o)<=X?r.value=K.AREA_0:o>X&&o<=C+X?(r.value=K.AREA_1,o-=C):o>C+X||o<=-(C+X)?(r.value=K.AREA_2,o=o>=0?o-at:o+at):(r.value=K.AREA_3,o+=C)),o}function wi(i,s){var n=i+s;return n<-at?n+=Bi:n>+at&&(n-=Bi),n}var fu=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const du={init:lu,forward:uu,inverse:cu,names:fu};var rs=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.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,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.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]],Wi=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Nn=.8487,kn=1.3523,Bn=Dt/5,_u=1/Bn,bi=18,Te=function(i,s){return i[0]+s*(i[1]+s*(i[2]+s*i[3]))},mu=function(i,s){return i[1]+s*(2*i[2]+s*3*i[3])};function pu(i,s,n,r){for(var o=s;r;--r){var l=i(o);if(o-=l,Math.abs(l)<n)break}return o}function gu(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function vu(i){var s=O(i.x-this.long0),n=Math.abs(i.y),r=Math.floor(n*Bn);r<0?r=0:r>=bi&&(r=bi-1),n=Dt*(n-_u*r);var o={x:Te(rs[r],n)*s,y:Te(Wi[r],n)};return i.y<0&&(o.y=-o.y),o.x=o.x*this.a*Nn+this.x0,o.y=o.y*this.a*kn+this.y0,o}function yu(i){var s={x:(i.x-this.x0)/(this.a*Nn),y:Math.abs(i.y-this.y0)/(this.a*kn)};if(s.y>=1)s.x/=rs[bi][0],s.y=i.y<0?-C:C;else{var n=Math.floor(s.y*bi);for(n<0?n=0:n>=bi&&(n=bi-1);;)if(Wi[n][0]>s.y)--n;else if(Wi[n+1][0]<=s.y)++n;else break;var r=Wi[n],o=5*(s.y-r[0])/(Wi[n+1][0]-r[0]);o=pu(function(l){return(Te(r,l)-s.y)/mu(r,l)},o,S,100),s.x/=Te(rs[n],o),s.y=(5*n+o)*mt,i.y<0&&(s.y=-s.y)}return s.x=O(s.x+this.long0),s}var Mu=["Robinson","robin"];const xu={init:gu,forward:vu,inverse:yu,names:Mu};function wu(){this.name="geocent"}function bu(i){var s=cn(i,this.es,this.a);return s}function Lu(i){var s=fn(i,this.es,this.a,this.b);return s}var Pu=["Geocentric","geocentric","geocent","Geocent"];const Au={init:wu,forward:bu,inverse:Lu,names:Pu};var vt={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}};function Tu(){if(Object.keys($i).forEach((function(n){if(typeof this[n]>"u")this[n]=$i[n].def;else{if($i[n].num&&isNaN(this[n]))throw new Error("Invalid parameter value, must be numeric "+n+" = "+this[n]);$i[n].num&&(this[n]=parseFloat(this[n]))}$i[n].degrees&&(this[n]=this[n]*mt)}).bind(this)),Math.abs(Math.abs(this.lat0)-C)<S?this.mode=this.lat0<0?vt.S_POLE:vt.N_POLE:Math.abs(this.lat0)<S?this.mode=vt.EQUIT:(this.mode=vt.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 i=this.tilt,s=this.azi;this.cg=Math.cos(s),this.sg=Math.sin(s),this.cw=Math.cos(i),this.sw=Math.sin(i)}function Cu(i){i.x-=this.long0;var s=Math.sin(i.y),n=Math.cos(i.y),r=Math.cos(i.x),o,l;switch(this.mode){case vt.OBLIQ:l=this.sinph0*s+this.cosph0*n*r;break;case vt.EQUIT:l=n*r;break;case vt.S_POLE:l=-s;break;case vt.N_POLE:l=s;break}switch(l=this.pn1/(this.p-l),o=l*n*Math.sin(i.x),this.mode){case vt.OBLIQ:l*=this.cosph0*s-this.sinph0*n*r;break;case vt.EQUIT:l*=s;break;case vt.N_POLE:l*=-(n*r);break;case vt.S_POLE:l*=n*r;break}var f,c;return f=l*this.cg+o*this.sg,c=1/(f*this.sw*this.h1+this.cw),o=(o*this.cg-l*this.sg)*this.cw*c,l=f*c,i.x=o*this.a,i.y=l*this.a,i}function Eu(i){i.x/=this.a,i.y/=this.a;var s={x:i.x,y:i.y},n,r,o;o=1/(this.pn1-i.y*this.sw),n=this.pn1*i.x*o,r=this.pn1*i.y*this.cw*o,i.x=n*this.cg+r*this.sg,i.y=r*this.cg-n*this.sg;var l=Lt(i.x,i.y);if(Math.abs(l)<S)s.x=0,s.y=i.y;else{var f,c;switch(c=1-l*l*this.pfact,c=(this.p-Math.sqrt(c))/(this.pn1/l+l/this.pn1),f=Math.sqrt(1-c*c),this.mode){case vt.OBLIQ:s.y=Math.asin(f*this.sinph0+i.y*c*this.cosph0/l),i.y=(f-this.sinph0*Math.sin(s.y))*l,i.x*=c*this.cosph0;break;case vt.EQUIT:s.y=Math.asin(i.y*c/l),i.y=f*l,i.x*=c;break;case vt.N_POLE:s.y=Math.asin(f),i.y=-i.y;break;case vt.S_POLE:s.y=-Math.asin(f);break}s.x=Math.atan2(i.x,i.y)}return i.x=s.x+this.long0,i.y=s.y,i}var Su=["Tilted_Perspective","tpers"];const Ou={init:Tu,forward:Cu,inverse:Eu,names:Su};function Iu(){if(this.flip_axis=this.sweep==="x"?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,this.es!==0){var i=1-this.es,s=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=s,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")}function zu(i){var s=i.x,n=i.y,r,o,l,f;if(s=s-this.long0,this.shape==="ellipse"){n=Math.atan(this.radius_p2*Math.tan(n));var c=this.radius_p/Lt(this.radius_p*Math.cos(n),Math.sin(n));if(o=c*Math.cos(s)*Math.cos(n),l=c*Math.sin(s)*Math.cos(n),f=c*Math.sin(n),(this.radius_g-o)*o-l*l-f*f*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;r=this.radius_g-o,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Lt(f,r)),i.y=this.radius_g_1*Math.atan(f/r)):(i.x=this.radius_g_1*Math.atan(l/r),i.y=this.radius_g_1*Math.atan(f/Lt(l,r)))}else this.shape==="sphere"&&(r=Math.cos(n),o=Math.cos(s)*r,l=Math.sin(s)*r,f=Math.sin(n),r=this.radius_g-o,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Lt(f,r)),i.y=this.radius_g_1*Math.atan(f/r)):(i.x=this.radius_g_1*Math.atan(l/r),i.y=this.radius_g_1*Math.atan(f/Lt(l,r))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function Nu(i){var s=-1,n=0,r=0,o,l,f,c;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Lt(1,r)):(n=Math.tan(i.x/this.radius_g_1),r=Math.tan(i.y/this.radius_g_1)*Lt(1,n));var d=r/this.radius_p;if(o=n*n+d*d+s*s,l=2*this.radius_g*s,f=l*l-4*o*this.C,f<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(f))/(2*o),s=this.radius_g+c*s,n*=c,r*=c,i.x=Math.atan2(n,s),i.y=Math.atan(r*Math.cos(i.x)/s),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(i.x/this.radius_g_1),r=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+r*r+s*s,l=2*this.radius_g*s,f=l*l-4*o*this.C,f<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(f))/(2*o),s=this.radius_g+c*s,n*=c,r*=c,i.x=Math.atan2(n,s),i.y=Math.atan(r*Math.cos(i.x)/s)}return i.x=i.x+this.long0,i}var ku=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Bu={init:Iu,forward:zu,inverse:Nu,names:ku};var Vi=1.340264,Qi=-.081106,Xi=893e-6,Ki=.003796,Ce=Math.sqrt(3)/2;function Ru(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function Du(i){var s=O(i.x-this.long0),n=i.y,r=Math.asin(Ce*Math.sin(n)),o=r*r,l=o*o*o;return i.x=s*Math.cos(r)/(Ce*(Vi+3*Qi*o+l*(7*Xi+9*Ki*o))),i.y=r*(Vi+Qi*o+l*(Xi+Ki*o)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function Zu(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var s=1e-9,n=12,r=i.y,o,l,f,c,d,m;for(m=0;m<n&&(o=r*r,l=o*o*o,f=r*(Vi+Qi*o+l*(Xi+Ki*o))-i.y,c=Vi+3*Qi*o+l*(7*Xi+9*Ki*o),r-=d=f/c,!(Math.abs(d)<s));++m);return o=r*r,l=o*o*o,i.x=Ce*i.x*(Vi+3*Qi*o+l*(7*Xi+9*Ki*o))/Math.cos(r),i.y=Math.asin(Math.sin(r)/Ce),i.x=O(i.x+this.long0),i}var Fu=["eqearth","Equal Earth","Equal_Earth"];const qu={init:Ru,forward:Du,inverse:Zu,names:Fu};var Yi=1e-10;function Gu(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<Yi)throw new Error;this.es?(this.en=es(this.es),this.m1=yi(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=ju,this.forward=Uu):(Math.abs(this.phi1)+Yi>=C?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Wu,this.forward=Hu)}function Uu(i){var s=O(i.x-(this.long0||0)),n=i.y,r,o,l;return r=this.am1+this.m1-yi(n,o=Math.sin(n),l=Math.cos(n),this.en),o=l*s/(r*Math.sqrt(1-this.es*o*o)),i.x=r*Math.sin(o),i.y=this.am1-r*Math.cos(o),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function ju(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var s,n,r,o;if(n=Lt(i.x,i.y=this.am1-i.y),o=ss(this.am1+this.m1-n,this.es,this.en),(s=Math.abs(o))<C)s=Math.sin(o),r=n*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*s*s)/Math.cos(o);else if(Math.abs(s-C)<=Yi)r=0;else throw new Error;return i.x=O(r+(this.long0||0)),i.y=ii(o),i}function Hu(i){var s=O(i.x-(this.long0||0)),n=i.y,r,o;return o=this.cphi1+this.phi1-n,Math.abs(o)>Yi?(i.x=o*Math.sin(r=s*Math.cos(n)/o),i.y=this.cphi1-o*Math.cos(r)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function Wu(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var s,n,r=Lt(i.x,i.y=this.cphi1-i.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>C)throw new Error;return Math.abs(Math.abs(n)-C)<=Yi?s=0:s=r*Math.atan2(i.x,i.y)/Math.cos(n),i.x=O(s+(this.long0||0)),i.y=ii(n),i}var $u=["bonne","Bonne (Werner lat_1=90)"];const Vu={init:Gu,names:$u};function Qu(i){i.Proj.projections.add(be),i.Proj.projections.add(Le),i.Proj.projections.add(Ur),i.Proj.projections.add(Jr),i.Proj.projections.add(ah),i.Proj.projections.add(uh),i.Proj.projections.add(ph),i.Proj.projections.add(xh),i.Proj.projections.add(Ah),i.Proj.projections.add(Oh),i.Proj.projections.add(Vh),i.Proj.projections.add(tl),i.Proj.projections.add(al),i.Proj.projections.add(cl),i.Proj.projections.add(pl),i.Proj.projections.add(xl),i.Proj.projections.add(Al),i.Proj.projections.add(Ol),i.Proj.projections.add(Rl),i.Proj.projections.add(Gl),i.Proj.projections.add($l),i.Proj.projections.add(Yl),i.Proj.projections.add(su),i.Proj.projections.add(hu),i.Proj.projections.add(du),i.Proj.projections.add(xu),i.Proj.projections.add(Au),i.Proj.projections.add(Ou),i.Proj.projections.add(Bu),i.Proj.projections.add(qu),i.Proj.projections.add(Vu)}Et.defaultDatum="WGS84",Et.Proj=qt,Et.WGS84=new Et.Proj("WGS84"),Et.Point=vi,Et.toPoint=pn,Et.defs=yt,Et.nadgrid=Ho,Et.transform=we,Et.mgrs=rr,Et.version="__VERSION__",Qu(Et);const Xu=so(Object.freeze(Object.defineProperty({__proto__:null,default:Et},Symbol.toStringTag,{value:"Module"})));(function(i){(function(s){var n,r;n=$s(),r=Xu,i.exports=s(n,r)})(function(s,n){return n.__esModule&&n.default&&(n=n.default),s.Proj={},s.Proj._isProj4Obj=function(r){return typeof r.inverse<"u"&&typeof r.forward<"u"},s.Proj.Projection=s.Class.extend({initialize:function(r,o,l){var f=s.Proj._isProj4Obj(r);this._proj=f?r:this._projFromCodeDef(r,o),this.bounds=f?o:l},project:function(r){var o=this._proj.forward([r.lng,r.lat]);return new s.Point(o[0],o[1])},unproject:function(r,o){var l=this._proj.inverse([r.x,r.y]);return new s.LatLng(l[1],l[0],o)},_projFromCodeDef:function(r,o){if(o)n.defs(r,o);else if(n.defs[r]===void 0){var l=r.split(":");if(l.length>3&&(r=l[l.length-3]+":"+l[l.length-1]),n.defs[r]===void 0)throw"No projection definition for code "+r}return n(r)}}),s.Proj.CRS=s.Class.extend({includes:s.CRS,options:{transformation:new s.Transformation(1,0,-1,0)},initialize:function(r,o,l){var f,c,d,m;if(s.Proj._isProj4Obj(r)?(c=r,f=c.srsCode,m=o||{},this.projection=new s.Proj.Projection(c,m.bounds)):(f=r,d=o,m=l||{},this.projection=new s.Proj.Projection(f,d,m.bounds)),s.Util.setOptions(this,m),this.code=f,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new s.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var v=this.options.resolutions.length-1;v>=0;v--)this.options.resolutions[v]&&(this._scales[v]=1/this.options.resolutions[v])}this.infinite=!this.options.bounds},scale:function(r){var o=Math.floor(r),l,f,c,d;return r===o?this._scales[r]:(l=this._scales[o],f=this._scales[o+1],c=f-l,d=r-o,l+c*d)},zoom:function(r){var o=this._closestElement(this._scales,r),l=this._scales.indexOf(o),f,c,d;return r===o?l:o===void 0?-1/0:(c=l+1,f=this._scales[c],f===void 0?1/0:(d=f-o,(r-o)/d+l))},distance:s.CRS.Earth.distance,R:s.CRS.Earth.R,_closestElement:function(r,o){for(var l,f=r.length;f--;)r[f]<=o&&(l===void 0||l<r[f])&&(l=r[f]);return l}}),s.Proj.GeoJSON=s.GeoJSON.extend({initialize:function(r,o){this._callLevel=0,s.GeoJSON.prototype.initialize.call(this,r,o)},addData:function(r){var o;r&&(r.crs&&r.crs.type==="name"?o=new s.Proj.CRS(r.crs.properties.name):r.crs&&r.crs.type&&(o=new s.Proj.CRS(r.crs.type+":"+r.crs.properties.code)),o!==void 0&&(this.options.coordsToLatLng=function(l){var f=s.point(l[0],l[1]);return o.projection.unproject(f)})),this._callLevel++;try{s.GeoJSON.prototype.addData.call(this,r)}finally{this._callLevel--,this._callLevel===0&&delete this.options.coordsToLatLng}}}),s.Proj.geoJson=function(r,o){return new s.Proj.GeoJSON(r,o)},s.Proj.ImageOverlay=s.ImageOverlay.extend({initialize:function(r,o,l){s.ImageOverlay.prototype.initialize.call(this,r,null,l),this._projectedBounds=o},_animateZoom:function(r){var o=this._map.getZoomScale(r.zoom),l=s.point(this._projectedBounds.min.x,this._projectedBounds.max.y),f=this._projectedToNewLayerPoint(l,r.zoom,r.center);s.DomUtil.setTransform(this._image,f,o)},_reset:function(){var r=this._map.getZoom(),o=this._map.getPixelOrigin(),l=s.bounds(this._transform(this._projectedBounds.min,r)._subtract(o),this._transform(this._projectedBounds.max,r)._subtract(o)),f=l.getSize();s.DomUtil.setPosition(this._image,l.min),this._image.style.width=f.x+"px",this._image.style.height=f.y+"px"},_projectedToNewLayerPoint:function(r,o,l){var f=this._map.getSize()._divideBy(2),c=this._map.project(l,o)._subtract(f)._round(),d=c.add(this._map._getMapPanePos());return this._transform(r,o)._subtract(d)},_transform:function(r,o){var l=this._map.options.crs,f=l.transformation,c=l.scale(o);return f.transform(r,c)}}),s.Proj.imageOverlay=function(r,o,l){return new s.Proj.ImageOverlay(r,o,l)},s.Proj})})(ao);const hs=new M.Proj.CRS("EPSG:900913","+proj=merc +a=6378206 +b=6356584.314245179 +lat_ts=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",{resolutions:function(){var i=[];i[0]=Math.pow(2,18);for(var s=1;s<21;s++)i[s]=Math.pow(2,18-s);return i}(),origin:[0,0],bounds:M.bounds([20037508342789244e-9,0],[0,20037508342789244e-9])}),Rn=M.Layer.extend({provide:{TDT:"tdt",BAIDU:"bd",GAODE:"gd",YANDEX:"yandex"},source:{VECTOR:"vec",SATELITE:"img",ANNO:"cia",VEC_NO_ANNO:"vec_no_anno",SATELITE_NO_ANNO:"img_no_anno"},style:{NORMAL:"1",GRAY:"2",DARK:"3",BROWN:"4",BLUR:"5"},options:{provide:"tdt",source:"img",style:"normal",accessToken:"016b31f15f25e1365e85aec7e7b0464e"},initialize(i){i=_t.Util.deleteEmptyProperty(i),M.Util.setOptions(this,i)},onAdd(i){this.map=i,this.replaceProjection(),this.tileLayers=this.getLayerGroup(),i.addLayer(this.tileLayers)},onRemove(i){const s=this.getLayerGroup();i.removeLayer(s)},replaceProjection(){const i=this.map.getCenter(),s=this.map.getZoom();this.options.provide===this.provide.BAIDU?this.map.options.crs=hs:this.options.provide===this.provide.YANDEX?this.map.options.crs=M.CRS.EPSG3395:this.map.options.crs=M.CRS.EPSG3857,this._resetMapStatus(i,s)},_resetMapStatus(i,s){this.map.setView(i),this.map._resetView(i,s,!0)},getLayerGroup(){let i={},s={};switch(this.options.style&&this.options.style.split(",").forEach(n=>{switch(n){case this.style.DARK:i.invert=1;break;case this.style.GRAY:i.grayscale=1;break;case this.style.BROWN:i.sepia=1;break;case this.style.BLUR:i.blur="1px";break}}),this.options.provide){case this.provide.TDT:s={subdomains:_t.ArrayUtil.create(8),maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.BAIDU:s={subdomains:_t.ArrayUtil.create(10),tms:!0,corrdType:"bd09",maxNativeZoom:19,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.GAODE:s={subdomains:_t.ArrayUtil.create(4).map(n=>n+1),corrdType:"gcj02",maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.YANDEX:s={maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break}if(this.options.opacity>=0&&(i.opacity=this.options.opacity),this.options.url)return new M.TileLayer(this.options.url,{...s,style:i});switch(this.options.provide){case this.provide.TDT:let n;switch(s.maxNativeZoom=18,this.options.source){case this.source.VECTOR:n=["vec_w","cva_w"];break;case this.source.SATELITE:n=["img_w","cia_w"];break;case this.source.ANNO:n=["cva_w"];break;case this.source.VEC_NO_ANNO:n=["vec_w"];break;case this.source.SATELITE_NO_ANNO:n=["img_w"];break}return new M.LayerGroup(n.map(r=>new M.TileLayer(`http://t{s}.tianditu.gov.cn/DataServer?T=${r}&x={x}&y={y}&l={z}&tk=${this.options.accessToken}`,{...s,style:i})));case this.provide.BAIDU:switch(this.options.source){case this.source.VECTOR:return s.maxNativeZoom=19,new M.TileLayer("http://online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",{...s,style:i});case this.source.ANNO:return s.maxNativeZoom=19,new M.TileLayer("http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl",{...s,style:i});case this.source.SATELITE:return s.maxNativeZoom=17,new M.LayerGroup([new M.TileLayer("http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",{...s,style:i}),new M.TileLayer("http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return s.maxNativeZoom=19,new M.TileLayer("http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",{...s,style:i})}break;case this.provide.GAODE:switch(this.options.source){case this.source.VECTOR:return s.maxNativeZoom=18,new M.TileLayer("http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i});case this.source.ANNO:return s.maxNativeZoom=18,new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i});case this.source.SATELITE:return s.maxNativeZoom=16,new M.LayerGroup([new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=6",{...s,style:i}),new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return s.maxNativeZoom=18,new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=6",{...s,style:i})}break;case this.provide.YANDEX:switch(this.options.source){case this.source.ANNO:return new M.TileLayer("https://core-renderer-tiles.maps.yandex.net/tiles?l=skl&v=24.05.19-0-b240515214430&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps&experimental_ranking_mode_name=default-web-ranking&experimental_data_hd=vegetation_model_exp",{...s,style:i});case this.source.SATELITE:return new M.LayerGroup([new M.TileLayer("https://sat{s}.maps.yandex.net/tiles?l=sat&v=3.1238.0&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps",{...s,subdomains:["01","02","03","04"],style:i}),new M.TileLayer("https://core-renderer-tiles.maps.yandex.net/tiles?l=skl&v=24.05.19-0-b240515214430&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps&experimental_ranking_mode_name=default-web-ranking&experimental_data_hd=vegetation_model_exp",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return new M.TileLayer("https://sat{s}.maps.yandex.net/tiles?l=sat&v=3.1238.0&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps",{...s,subdomains:["01","02","03","04"],style:i})}break}},setOptions(i){M.Util.setOptions(this,i);const s=this.getLayerGroup();this.map.removeLayer(this.tileLayers),setTimeout(()=>{this.replaceProjection(),this.tileLayers=s.addTo(this.map)},500)}}),Dn=M.ImageOverlay.extend({initialize(i,s,n,r){typeof i=="string"?this._url=i:this._rawImage=i,this.topRightMarker=s,this.bottomLeftMarker=n,this.angle=0,M.setOptions(this,r),this._topLeft=new M.LatLng(r.corners[0]),this._topRight=new M.LatLng(r.corners[1]),this._bottomLeft=new M.LatLng(r.corners[3]),s.on("drag dragend",this.reposition,this),n.on("drag dragend",this.reposition,this)},onAdd(i){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M.DomUtil.addClass(this._rawImage,"leaflet-interactive"),this.addInteractiveTarget(this._rawImage)),i.on("zoomend resetview",this._reset,this),this.getPane().appendChild(this._image),this._reset()},onRemove(i){i.off("zoomend resetview",this._reset,this),M.ImageOverlay.prototype.onRemove.call(this,i)},_initImage(){let i=this._rawImage;this._url&&(i=M.DomUtil.create("img"),i.style.display="none",this.options.crossOrigin&&(i.crossOrigin=""),i.src=this._url,this._rawImage=i),M.DomUtil.addClass(i,"leaflet-image-layer");const s=this._image=M.DomUtil.create("div","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""));this._updateZIndex&&this._updateZIndex(),s.appendChild(i),s.onselectstart=M.Util.falseFn,s.onmousemove=M.Util.falseFn,i.onload=(function(){this._reset(),i.style.display="block",this.options.w=this._rawImage.width,this.options.h=this._rawImage.height,this.boundsRectBottomLeft=new M.Point(0,0),this.boundsRectTopRight=new M.Point(this.options.w,this.options.h),this.diagonalVector=this.boundsRectTopRight.subtract(this.boundsRectBottomLeft),this.fire("load")}).bind(this),i.alt=this.options.alt},_reset(){const i=this._image,s=this._map.latLngToLayerPoint(this._topLeft),n=this._map.latLngToLayerPoint(this._topRight),r=this._map.latLngToLayerPoint(this._bottomLeft),o=n.subtract(s).add(r),l=new M.Bounds([s,n,r,o]),f=l.getSize(),c=s.subtract(l.min),d=n.subtract(s),m=r.subtract(s),v=Math.atan2(d.y,d.x),p=Math.atan2(m.x,m.y);this.angle=((Math.abs(v)+Math.abs(p))/2*180).toFixed(2),this._bounds=new M.LatLngBounds(this._map.layerPointToLatLng(l.min),this._map.layerPointToLatLng(l.max)),M.DomUtil.setPosition(i,l.min),i.pxBounds=l,i.style.width=f.x+"px",i.style.height=f.y+"px";const y=this._rawImage.width,b=this._rawImage.height;if(!y||!b)return;const A=s.distanceTo(n)/y*Math.cos(v),P=s.distanceTo(r)/b*Math.cos(p);this._rawImage.style.transformOrigin="0 0",this._rawImage.style.transform="translate("+c.x+"px, "+c.y+"px)skew("+p+"rad, "+v+"rad) scale("+A+", "+P+") "},_animateZoom(i){const s=this._map.getZoomScale(i.zoom),r=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;M.DomUtil.setTransform(this._image,r,s)},reposition(){const i=this.topRightMarker.getLatLng(),s=this.bottomLeftMarker.getLatLng(),n=this.options.w,r=this.options.h,o=this.getCornerLatLng(new M.Point(0,r),s,i),l=this.getCornerLatLng(new M.Point(n,r),s,i),f=this.getCornerLatLng(new M.Point(0,0),s,i),c=this.getCornerLatLng(new M.Point(n,0),s,i);this.options.corners=[o,l,c,f],this._topLeft=new M.LatLng(o),this._topRight=new M.LatLng(l),this._bottomLeft=new M.LatLng(f),this._reset()},getCornerLatLng(i,s,n){const r=this.boundsRectBottomLeft,o=this.diagonalVector,l=i.subtract(r),f=this.getClockWiseRotate90DegreePoint(o),c=this.getDotProduction(o,l)/this.getDotProduction(o,o),d=-this.getDotProduction(f,l)/this.getDotProduction(f,f),m=new M.Projection.SphericalMercator.project(s),v=new M.Projection.SphericalMercator.project(n),p=m.add(v.subtract(m).multiplyBy(c)),y=this.getClockWiseRotate90DegreePoint(m.subtract(v)).multiplyBy(d),b=p.add(y);return new M.Projection.SphericalMercator.unproject(b)},setUrl(i){return this._url=i,this._rawImage&&(this._rawImage.src=i),this},getDotProduction(i,s){return i.x*s.x+i.y*s.y},getClockWiseRotate90DegreePoint(i){return new M.Point([i.y,-i.x])}}),Zn=M.Marker.extend({options:{fontSize:"12px",color:"#f00",fontShadowColor:"none",fontWeight:"normal",background:"rgba(0, 0, 0, 0)",minZoom:void 0,maxZoom:void 0},initialize(i,s,n={}){this._latlng=i,this._enabled=!1,this.options.id=n.id||"text_"+Utils.guid(),this.options.text=s||"",n=Object.assign(this.options,n),M.setOptions(this,n);const{id:r,fontSize:o,color:l,fontWeight:f,background:c,fontShadowColor:d}=this.options;this.options.icon=new M.DivIcon({html:`<span id=${r} style="padding:2px 4px;white-space:nowrap;font-weight:${f};font-size:${o};color:${l};background:${c};text-shadow:${d} 1px 0px 2px">${s||""}</span>`,className:"leaflet-text"})},setStyle(i){const s=document.getElementById(this.options.id),{text:n,color:r,fontSize:o,fontShadowColor:l,fontWeight:f}=i,c=i.background||"none";return s&&(r&&(this.options.color=r,s.style.color=r),f&&(this.options.fontWeight=f,s.style.fontWeight=f),o&&(this.options.fontSize=o,s.style.fontSize=o),c&&(this.options.background=c,s.style.background=c),n&&(this.options.text=n,s.textContent=n),l?(this.options.fontShadowColor=l,s.style["text-shadow"]=l+" 1px 0px 2px"):(this.options.fontShadowColor="none",s.style["text-shadow"]="none")),this},enableEdit(i){const{fontSize:s,color:n,text:r}=this.options;if(!this._enabled){this._enabled=!0;const o=new M.DivIcon({html:`<input type="text" id="text-input-icon" style="font-size:${s};color:${n};" value=${r}></input>`,className:"leaflet-text"});return this.setIcon(o),document.getElementById("text-input-icon").onblur=l=>{this.options.text=l.target.value,setTimeout(()=>{this.disableEdit(),i&&i(this)},100)},document.getElementById("text-input-icon").onkeydown=function(l){l.keyCode===13&&(this.options.text=l.target.value,this.blur(l))},this}},disableEdit(i){if(this._enabled){this._enabled=!1;const{id:s,color:n,fontSize:r,fontWeight:o,fontShadowColor:l}=this.options,f=new M.DivIcon({html:`<span id=${s} style="padding:2px 4px;white-space:nowrap;font-weight:${o};font-size:${r};color:${n};text-shadow:${l} 1px 2px 3px">${this.options.text}</span>`,className:"leaflet-text"});return this.setIcon(f),i&&i(this),this}}}),Fn=M.LayerGroup.extend({initialize(i){M.Util.setOptions(this,i),M.LayerGroup.prototype.initialize.call(this,i)},getRasterLayers(){const i={},s=n=>{if(n._layers&&n.getLayer)for(const r in n._layers){const o=n._layers[r];o._layers&&o.getLayer?s(o):i[o._leaflet_id]=o}else i[layer._leaflet_id]=layer};return s(this),i},removeRasterLayer(i){const s=function(n){if(n._layers&&n.getLayer&&n.getLayer(i)){const r=n.getLayer(i);n.removeLayer(r)}else if(n._layers)for(const r in n._layers){const o=n._layers[r];if(o._layers&&o.getLayer&&o.getLayer(i)){const l=o.getLayer(i);o.removeLayer(l)}else o._layers&&s(o)}};s(this)},getRasterTop(){const i=Object.values(this.getRasterLayers());return i.length?Math.max(...i.map(s=>s.options.zIndex))+1:null}});function Ku(i){const s=document.createElement("style"),n=document.head||document.documentElement;s.innerHTML=`
9
+ northing meters`+i;var y=p/2,b=0,A=0,P,E,z,B,k;return y>0&&(P=1e5/Math.pow(10,y),E=i.substring(l,l+y),b=parseFloat(E)*P,z=i.substring(l+y),A=parseFloat(z)*P),B=b+m,k=A+v,{easting:B,northing:k,zoneLetter:c,zoneNumber:f,accuracy:P}}function _r(i,s){for(var n=xn.charCodeAt(s-1),r=1e5,o=!1;n!==i.charCodeAt(0);){if(n++,n===bt&&n++,n===Ot&&n++,n>qi){if(o)throw"Bad character: "+i;n=gi,o=!0}r+=1e5}return r}function mr(i,s){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var n=wn.charCodeAt(s-1),r=0,o=!1;n!==i.charCodeAt(0);){if(n++,n===bt&&n++,n===Ot&&n++,n>Fi){if(o)throw"Bad character: "+i;n=gi,o=!0}r+=1e5}return r}function pr(i){var s;switch(i){case"C":s=11e5;break;case"D":s=2e6;break;case"E":s=28e5;break;case"F":s=37e5;break;case"G":s=46e5;break;case"H":s=55e5;break;case"J":s=64e5;break;case"K":s=73e5;break;case"L":s=82e5;break;case"M":s=91e5;break;case"N":s=0;break;case"P":s=8e5;break;case"Q":s=17e5;break;case"R":s=26e5;break;case"S":s=35e5;break;case"T":s=44e5;break;case"U":s=53e5;break;case"V":s=62e5;break;case"W":s=7e6;break;case"X":s=79e5;break;default:s=-1}if(s>=0)return s;throw"Invalid zone letter: "+i}function vi(i,s,n){if(!(this instanceof vi))return new vi(i,s,n);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof s>"u"){var r=i.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=i,this.y=s,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}vi.fromMGRS=function(i){return new vi(Ln(i))},vi.prototype.toMGRS=function(i){return bn([this.x,this.y],i)};var gr=1,vr=.25,Cn=.046875,En=.01953125,Sn=.01068115234375,yr=.75,Mr=.46875,xr=.013020833333333334,wr=.007120768229166667,br=.3645833333333333,Lr=.005696614583333333,Pr=.3076171875;function es(i){var s=[];s[0]=gr-i*(vr+i*(Cn+i*(En+i*Sn))),s[1]=i*(yr-i*(Cn+i*(En+i*Sn)));var n=i*i;return s[2]=n*(Mr-i*(xr+i*wr)),n*=i,s[3]=n*(br-i*Lr),s[4]=n*i*Pr,s}function yi(i,s,n,r){return n*=s,s*=s,r[0]*i-n*(r[1]+s*(r[2]+s*(r[3]+s*r[4])))}var Ar=20;function ss(i,s,n){for(var r=1/(1-s),o=i,l=Ar;l;--l){var f=Math.sin(o),c=1-s*f*f;if(c=(yi(o,f,Math.cos(o),n)-i)*(c*Math.sqrt(c))*r,o-=c,Math.abs(c)<S)return o}return o}function Tr(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=es(this.es),this.ml0=yi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Cr(i){var s=i.x,n=i.y,r=O(s-this.long0),o,l,f,c=Math.sin(n),d=Math.cos(n);if(this.es){var v=d*r,p=Math.pow(v,2),y=this.ep2*Math.pow(d,2),b=Math.pow(y,2),A=Math.abs(d)>S?Math.tan(n):0,P=Math.pow(A,2),E=Math.pow(P,2);o=1-this.es*Math.pow(c,2),v=v/Math.sqrt(o);var z=yi(n,c,d,this.en);l=this.a*(this.k0*v*(1+p/6*(1-P+y+p/20*(5-18*P+E+14*y-58*P*y+p/42*(61+179*E-E*P-479*P)))))+this.x0,f=this.a*(this.k0*(z-this.ml0+c*r*v/2*(1+p/12*(5-P+9*y+4*b+p/30*(61+E-58*P+270*y-330*P*y+p/56*(1385+543*E-E*P-3111*P))))))+this.y0}else{var m=d*Math.sin(r);if(Math.abs(Math.abs(m)-1)<S)return 93;if(l=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,f=d*Math.cos(r)/Math.sqrt(1-Math.pow(m,2)),m=Math.abs(f),m>=1){if(m-1>S)return 93;f=0}else f=Math.acos(f);n<0&&(f=-f),f=this.a*this.k0*(f-this.lat0)+this.y0}return i.x=l,i.y=f,i}function Er(i){var s,n,r,o,l=(i.x-this.x0)*(1/this.a),f=(i.y-this.y0)*(1/this.a);if(this.es)if(s=this.ml0+f/this.k0,n=ss(s,this.es,this.en),Math.abs(n)<C){var p=Math.sin(n),y=Math.cos(n),b=Math.abs(y)>S?Math.tan(n):0,A=this.ep2*Math.pow(y,2),P=Math.pow(A,2),E=Math.pow(b,2),z=Math.pow(E,2);s=1-this.es*Math.pow(p,2);var B=l*Math.sqrt(s)/this.k0,k=Math.pow(B,2);s=s*b,r=n-s*k/(1-this.es)*.5*(1-k/12*(5+3*E-9*A*E+A-4*P-k/30*(61+90*E-252*A*E+45*z+46*A-k/56*(1385+3633*E+4095*z+1574*z*E)))),o=O(this.long0+B*(1-k/6*(1+2*E+A-k/20*(5+28*E+24*z+8*A*E+6*A-k/42*(61+662*E+1320*z+720*z*E))))/y)}else r=C*Di(f),o=0;else{var c=Math.exp(l/this.k0),d=.5*(c-1/c),m=this.lat0+f/this.k0,v=Math.cos(m);s=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(d,2))),r=Math.asin(s),f<0&&(r=-r),d===0&&v===0?o=0:o=O(Math.atan2(d,v)+this.long0)}return i.x=o,i.y=r,i}var Sr=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const be={init:Tr,forward:Cr,inverse:Er,names:Sr};function On(i){var s=Math.exp(i);return s=(s-1/s)/2,s}function Lt(i,s){i=Math.abs(i),s=Math.abs(s);var n=Math.max(i,s),r=Math.min(i,s)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))}function Or(i){var s=1+i,n=s-1;return n===0?i:i*Math.log(s)/n}function Ir(i){var s=Math.abs(i);return s=Or(s*(1+s/(Lt(1,s)+1))),i<0?-s:s}function ns(i,s){for(var n=2*Math.cos(2*s),r=i.length-1,o=i[r],l=0,f;--r>=0;)f=-l+n*o+i[r],l=o,o=f;return s+f*Math.sin(2*s)}function zr(i,s){for(var n=2*Math.cos(s),r=i.length-1,o=i[r],l=0,f;--r>=0;)f=-l+n*o+i[r],l=o,o=f;return Math.sin(s)*f}function Nr(i){var s=Math.exp(i);return s=(s+1/s)/2,s}function In(i,s,n){for(var r=Math.sin(s),o=Math.cos(s),l=On(n),f=Nr(n),c=2*o*f,d=-2*r*l,m=i.length-1,v=i[m],p=0,y=0,b=0,A,P;--m>=0;)A=y,P=p,y=v,p=b,v=-A+c*y-d*p+i[m],b=-P+d*y+c*p;return c=r*f,d=o*l,[c*v-d*b,c*b+d*v]}function kr(){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&&(be.init.apply(this),this.forward=be.forward,this.inverse=be.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),s=i/(2-i),n=s;this.cgb[0]=s*(2+s*(-2/3+s*(-2+s*(116/45+s*(26/45+s*(-2854/675)))))),this.cbg[0]=s*(-2+s*(2/3+s*(4/3+s*(-82/45+s*(32/45+s*(4642/4725)))))),n=n*s,this.cgb[1]=n*(7/3+s*(-8/5+s*(-227/45+s*(2704/315+s*(2323/945))))),this.cbg[1]=n*(5/3+s*(-16/15+s*(-13/9+s*(904/315+s*(-1522/945))))),n=n*s,this.cgb[2]=n*(56/15+s*(-136/35+s*(-1262/105+s*(73814/2835)))),this.cbg[2]=n*(-26/15+s*(34/21+s*(8/5+s*(-12686/2835)))),n=n*s,this.cgb[3]=n*(4279/630+s*(-332/35+s*(-399572/14175))),this.cbg[3]=n*(1237/630+s*(-12/5+s*(-24832/14175))),n=n*s,this.cgb[4]=n*(4174/315+s*(-144838/6237)),this.cbg[4]=n*(-734/315+s*(109598/31185)),n=n*s,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=s*(-.5+s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=n*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=n*(13/48+s*(-3/5+s*(557/1440+s*(281/630+s*(-1983433/1935360))))),n=n*s,this.utg[2]=n*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=n*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),n=n*s,this.utg[3]=n*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=n*(49561/161280+s*(-179/168+s*(6601661/7257600))),n=n*s,this.utg[4]=n*(-4583/161280+s*(108847/3991680)),this.gtu[4]=n*(34729/80640+s*(-3418889/1995840)),n=n*s,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=n*(212378941/319334400);var r=ns(this.cbg,this.lat0);this.Zb=-this.Qn*(r+zr(this.gtu,2*r))}function Br(i){var s=O(i.x-this.long0),n=i.y;n=ns(this.cbg,n);var r=Math.sin(n),o=Math.cos(n),l=Math.sin(s),f=Math.cos(s);n=Math.atan2(r,f*o),s=Math.atan2(l*o,Lt(r,o*f)),s=Ir(Math.tan(s));var c=In(this.gtu,2*n,2*s);n=n+c[0],s=s+c[1];var d,m;return Math.abs(s)<=2.623395162778?(d=this.a*(this.Qn*s)+this.x0,m=this.a*(this.Qn*n+this.Zb)+this.y0):(d=1/0,m=1/0),i.x=d,i.y=m,i}function Rr(i){var s=(i.x-this.x0)*(1/this.a),n=(i.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,s=s/this.Qn;var r,o;if(Math.abs(s)<=2.623395162778){var l=In(this.utg,2*n,2*s);n=n+l[0],s=s+l[1],s=Math.atan(On(s));var f=Math.sin(n),c=Math.cos(n),d=Math.sin(s),m=Math.cos(s);n=Math.atan2(f*m,Lt(d,m*c)),s=Math.atan2(d,m*c),r=O(s+this.long0),o=ns(this.cgb,n)}else r=1/0,o=1/0;return i.x=r,i.y=o,i}var Dr=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Le={init:kr,forward:Br,inverse:Rr,names:Dr};function Zr(i,s){if(i===void 0){if(i=Math.floor((O(s)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var Fr="etmerc";function qr(){var i=Zr(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*mt,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Le.init.apply(this),this.forward=Le.forward,this.inverse=Le.inverse}var Gr=["Universal Transverse Mercator System","utm"];const Ur={init:qr,names:Gr,dependsOn:Fr};function as(i,s){return Math.pow((1-i)/(1+i),s)}var jr=20;function Hr(){var i=Math.sin(this.lat0),s=Math.cos(this.lat0);s*=s,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*s*s/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+X)/(Math.pow(Math.tan(.5*this.lat0+X),this.C)*as(this.e*i,this.ratexp))}function Wr(i){var s=i.x,n=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+X),this.C)*as(this.e*Math.sin(n),this.ratexp))-C,i.x=this.C*s,i}function $r(i){for(var s=1e-14,n=i.x/this.C,r=i.y,o=Math.pow(Math.tan(.5*r+X)/this.K,1/this.C),l=jr;l>0&&(r=2*Math.atan(o*as(this.e*Math.sin(i.y),-.5*this.e))-C,!(Math.abs(r-i.y)<s));--l)i.y=r;return l?(i.x=n,i.y=r,i):null}var Vr=["gauss"];const os={init:Hr,forward:Wr,inverse:$r,names:Vr};function Qr(){os.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"))}function Xr(i){var s,n,r,o;return i.x=O(i.x-this.long0),os.forward.apply(this,[i]),s=Math.sin(i.y),n=Math.cos(i.y),r=Math.cos(i.x),o=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*n*r),i.x=o*n*Math.sin(i.x),i.y=o*(this.cosc0*s-this.sinc0*n*r),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function Kr(i){var s,n,r,o,l;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,l=Lt(i.x,i.y)){var f=2*Math.atan2(l,this.R2);s=Math.sin(f),n=Math.cos(f),o=Math.asin(n*this.sinc0+i.y*s*this.cosc0/l),r=Math.atan2(i.x*s,l*this.cosc0*n-i.y*this.sinc0*s)}else o=this.phic0,r=0;return i.x=r,i.y=o,os.inverse.apply(this,[i]),i.x=O(i.x+this.long0),i}var Yr=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Jr={init:Qr,forward:Xr,inverse:Kr,names:Yr};function th(i,s,n){return s*=n,Math.tan(.5*(C+i))*Math.pow((1-s)/(1+s),.5*n)}function ih(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=S&&(this.k0=.5*(1+Di(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=S&&(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)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=S&&Math.abs(Math.cos(this.lat_ts))>S&&(this.k0=.5*this.cons*Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/kt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ft(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-C,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function eh(i){var s=i.x,n=i.y,r=Math.sin(n),o=Math.cos(n),l,f,c,d,m,v,p=O(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=S&&Math.abs(n+this.lat0)<=S?(i.x=NaN,i.y=NaN,i):this.sphere?(l=2*this.k0/(1+this.sinlat0*r+this.coslat0*o*Math.cos(p)),i.x=this.a*l*o*Math.sin(p)+this.x0,i.y=this.a*l*(this.coslat0*r-this.sinlat0*o*Math.cos(p))+this.y0,i):(f=2*Math.atan(this.ssfn_(n,r,this.e))-C,d=Math.cos(f),c=Math.sin(f),Math.abs(this.coslat0)<=S?(m=kt(this.e,n*this.con,this.con*r),v=2*this.a*this.k0*m/this.cons,i.x=this.x0+v*Math.sin(s-this.long0),i.y=this.y0-this.con*v*Math.cos(s-this.long0),i):(Math.abs(this.sinlat0)<S?(l=2*this.a*this.k0/(1+d*Math.cos(p)),i.y=l*c):(l=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*c+this.cosX0*d*Math.cos(p))),i.y=l*(this.cosX0*c-this.sinX0*d*Math.cos(p))+this.y0),i.x=l*d*Math.sin(p)+this.x0,i))}function sh(i){i.x-=this.x0,i.y-=this.y0;var s,n,r,o,l,f=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var c=2*Math.atan(f/(2*this.a*this.k0));return s=this.long0,n=this.lat0,f<=S?(i.x=s,i.y=n,i):(n=Math.asin(Math.cos(c)*this.sinlat0+i.y*Math.sin(c)*this.coslat0/f),Math.abs(this.coslat0)<S?this.lat0>0?s=O(this.long0+Math.atan2(i.x,-1*i.y)):s=O(this.long0+Math.atan2(i.x,i.y)):s=O(this.long0+Math.atan2(i.x*Math.sin(c),f*this.coslat0*Math.cos(c)-i.y*this.sinlat0*Math.sin(c))),i.x=s,i.y=n,i)}else if(Math.abs(this.coslat0)<=S){if(f<=S)return n=this.lat0,s=this.long0,i.x=s,i.y=n,i;i.x*=this.con,i.y*=this.con,r=f*this.cons/(2*this.a*this.k0),n=this.con*Zi(this.e,r),s=this.con*O(this.con*this.long0+Math.atan2(i.x,-1*i.y))}else o=2*Math.atan(f*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,f<=S?l=this.X0:(l=Math.asin(Math.cos(o)*this.sinX0+i.y*Math.sin(o)*this.cosX0/f),s=O(this.long0+Math.atan2(i.x*Math.sin(o),f*this.cosX0*Math.cos(o)-i.y*this.sinX0*Math.sin(o)))),n=-1*Zi(this.e,Math.tan(.5*(C+l)));return i.x=s,i.y=n,i}var nh=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const ah={init:ih,forward:eh,inverse:sh,names:nh,ssfn_:th};function oh(){var i=this.lat0;this.lambda0=this.long0;var s=Math.sin(i),n=this.a,r=this.rf,o=1/r,l=2*o-Math.pow(o,2),f=this.e=Math.sqrt(l);this.R=this.k0*n*Math.sqrt(1-l)/(1-l*Math.pow(s,2)),this.alpha=Math.sqrt(1+l/(1-l)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(s/this.alpha);var c=Math.log(Math.tan(Math.PI/4+this.b0/2)),d=Math.log(Math.tan(Math.PI/4+i/2)),m=Math.log((1+f*s)/(1-f*s));this.K=c-this.alpha*d+this.alpha*f/2*m}function rh(i){var s=Math.log(Math.tan(Math.PI/4-i.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),r=-this.alpha*(s+n)+this.K,o=2*(Math.atan(Math.exp(r))-Math.PI/4),l=this.alpha*(i.x-this.lambda0),f=Math.atan(Math.sin(l)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(l))),c=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(l));return i.y=this.R/2*Math.log((1+Math.sin(c))/(1-Math.sin(c)))+this.y0,i.x=this.R*f+this.x0,i}function hh(i){for(var s=i.x-this.x0,n=i.y-this.y0,r=s/this.R,o=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),l=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(r)),f=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(o))),c=this.lambda0+f/this.alpha,d=0,m=l,v=-1e3,p=0;Math.abs(m-v)>1e-7;){if(++p>20)return;d=1/this.alpha*(Math.log(Math.tan(Math.PI/4+l/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(m))/2)),v=m,m=2*Math.atan(Math.exp(d))-Math.PI/2}return i.x=c,i.y=m,i}var lh=["somerc"];const uh={init:oh,forward:rh,inverse:hh,names:lh};var Mi=1e-7;function ch(i){var s=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],n=typeof i.PROJECTION=="object"?Object.keys(i.PROJECTION)[0]:i.PROJECTION;return"no_uoff"in i||"no_off"in i||s.indexOf(n)!==-1}function fh(){var i,s,n,r,o,l,f,c,d,m,v=0,p,y=0,b=0,A=0,P=0,E=0,z=0;this.no_off=ch(this),this.no_rot="no_rot"in this;var B=!1;"alpha"in this&&(B=!0);var k=!1;if("rectified_grid_angle"in this&&(k=!0),B&&(z=this.alpha),k&&(v=this.rectified_grid_angle*mt),B||k)y=this.longc;else if(b=this.long1,P=this.lat1,A=this.long2,E=this.lat2,Math.abs(P-E)<=Mi||(i=Math.abs(P))<=Mi||Math.abs(i-C)<=Mi||Math.abs(Math.abs(this.lat0)-C)<=Mi||Math.abs(Math.abs(E)-C)<=Mi)throw new Error;var j=1-this.es;s=Math.sqrt(j),Math.abs(this.lat0)>S?(c=Math.sin(this.lat0),n=Math.cos(this.lat0),i=1-this.es*c*c,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/j),this.A=this.B*this.k0*s/i,r=this.B*s/(n*Math.sqrt(i)),o=r*r-1,o<=0?o=0:(o=Math.sqrt(o),this.lat0<0&&(o=-o)),this.E=o+=r,this.E*=Math.pow(kt(this.e,this.lat0,c),this.B)):(this.B=1/s,this.A=this.k0,this.E=r=o=1),B||k?(B?(p=Math.asin(Math.sin(z)/r),k||(v=z)):(p=v,z=Math.asin(r*Math.sin(p))),this.lam0=y-Math.asin(.5*(o-1/o)*Math.tan(p))/this.B):(l=Math.pow(kt(this.e,P,Math.sin(P)),this.B),f=Math.pow(kt(this.e,E,Math.sin(E)),this.B),o=this.E/l,d=(f-l)/(f+l),m=this.E*this.E,m=(m-f*l)/(m+f*l),i=b-A,i<-Math.pi?A-=Bi:i>Math.pi&&(A+=Bi),this.lam0=O(.5*(b+A)-Math.atan(m*Math.tan(.5*this.B*(b-A))/d)/this.B),p=Math.atan(2*Math.sin(this.B*O(b-this.lam0))/(o-1/o)),v=z=Math.asin(r*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),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(z))),this.lat0<0&&(this.u_0=-this.u_0)),o=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(X-o)),this.v_pole_s=this.ArB*Math.log(Math.tan(X+o))}function dh(i){var s={},n,r,o,l,f,c,d,m;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-C)>S){if(f=this.E/Math.pow(kt(this.e,i.y,Math.sin(i.y)),this.B),c=1/f,n=.5*(f-c),r=.5*(f+c),l=Math.sin(this.B*i.x),o=(n*this.singam-l*this.cosgam)/r,Math.abs(Math.abs(o)-1)<S)throw new Error;m=.5*this.ArB*Math.log((1-o)/(1+o)),c=Math.cos(this.B*i.x),Math.abs(c)<Mi?d=this.A*i.x:d=this.ArB*Math.atan2(n*this.cosgam+l*this.singam,c)}else m=i.y>0?this.v_pole_n:this.v_pole_s,d=this.ArB*i.y;return this.no_rot?(s.x=d,s.y=m):(d-=this.u_0,s.x=m*this.cosrot+d*this.sinrot,s.y=d*this.cosrot-m*this.sinrot),s.x=this.a*s.x+this.x0,s.y=this.a*s.y+this.y0,s}function _h(i){var s,n,r,o,l,f,c,d={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(n=i.y,s=i.x):(n=i.x*this.cosrot-i.y*this.sinrot,s=i.y*this.cosrot+i.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),o=.5*(r-1/r),l=.5*(r+1/r),f=Math.sin(this.BrA*s),c=(f*this.cosgam+o*this.singam)/l,Math.abs(Math.abs(c)-1)<S)d.x=0,d.y=c<0?-C:C;else{if(d.y=this.E/Math.sqrt((1+c)/(1-c)),d.y=Zi(this.e,Math.pow(d.y,1/this.B)),d.y===1/0)throw new Error;d.x=-this.rB*Math.atan2(o*this.cosgam-f*this.singam,Math.cos(this.BrA*s))}return d.x+=this.lam0,d}var mh=["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"];const ph={init:fh,forward:dh,inverse:_h,names:mh};function gh(){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)<S)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var s=Math.sin(this.lat1),n=Math.cos(this.lat1),r=Ft(this.e,s,n),o=kt(this.e,this.lat1,s),l=Math.sin(this.lat2),f=Math.cos(this.lat2),c=Ft(this.e,l,f),d=kt(this.e,this.lat2,l),m=kt(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>S?this.ns=Math.log(r/c)/Math.log(o/d):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=r/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(m,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function vh(i){var s=i.x,n=i.y;Math.abs(2*Math.abs(n)-Math.PI)<=S&&(n=Di(n)*(C-2*S));var r=Math.abs(Math.abs(n)-C),o,l;if(r>S)o=kt(this.e,n,Math.sin(n)),l=this.a*this.f0*Math.pow(o,this.ns);else{if(r=n*this.ns,r<=0)return null;l=0}var f=this.ns*O(s-this.long0);return i.x=this.k0*(l*Math.sin(f))+this.x0,i.y=this.k0*(this.rh-l*Math.cos(f))+this.y0,i}function yh(i){var s,n,r,o,l,f=(i.x-this.x0)/this.k0,c=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(f*f+c*c),n=1):(s=-Math.sqrt(f*f+c*c),n=-1);var d=0;if(s!==0&&(d=Math.atan2(n*f,n*c)),s!==0||this.ns>0){if(n=1/this.ns,r=Math.pow(s/(this.a*this.f0),n),o=Zi(this.e,r),o===-9999)return null}else o=-C;return l=O(d/this.ns+this.long0),i.x=l,i.y=o,i}var Mh=["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)"];const xh={init:gh,forward:vh,inverse:yh,names:Mh};function wh(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),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}function bh(i){var s,n,r,o,l,f,c,d=i.x,m=i.y,v=O(d-this.long0);return s=Math.pow((1+this.e*Math.sin(m))/(1-this.e*Math.sin(m)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(m/2+this.s45),this.alfa)/s)-this.s45),r=-v*this.alfa,o=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),l=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(o)),f=this.n*l,c=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(o/2+this.s45),this.n),i.y=c*Math.cos(f)/1,i.x=c*Math.sin(f)/1,this.czech||(i.y*=-1,i.x*=-1),i}function Lh(i){var s,n,r,o,l,f,c,d,m=i.x;i.x=i.y,i.y=m,this.czech||(i.y*=-1,i.x*=-1),f=Math.sqrt(i.x*i.x+i.y*i.y),l=Math.atan2(i.y,i.x),o=l/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/f,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),s=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(o)),n=Math.asin(Math.cos(r)*Math.sin(o)/Math.cos(s)),i.x=this.long0-n/this.alfa,c=s,d=0;var v=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(s/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.e/2))-this.s45),Math.abs(c-i.y)<1e-10&&(d=1),c=i.y,v+=1;while(d===0&&v<15);return v>=15?null:i}var Ph=["Krovak","krovak"];const Ah={init:wh,forward:bh,inverse:Lh,names:Ph};function Mt(i,s,n,r,o){return i*o-s*Math.sin(2*o)+n*Math.sin(4*o)-r*Math.sin(6*o)}function Gi(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Ui(i){return .375*i*(1+.25*i*(1+.46875*i))}function ji(i){return .05859375*i*i*(1+.75*i)}function Hi(i){return i*i*i*(35/3072)}function xi(i,s,n){var r=s*n;return i/Math.sqrt(1-r*r)}function ii(i){return Math.abs(i)<C?i:i-Di(i)*Math.PI}function Pe(i,s,n,r,o){var l,f;l=i/s;for(var c=0;c<15;c++)if(f=(i-(s*l-n*Math.sin(2*l)+r*Math.sin(4*l)-o*Math.sin(6*l)))/(s-2*n*Math.cos(2*l)+4*r*Math.cos(4*l)-6*o*Math.cos(6*l)),l+=f,Math.abs(f)<=1e-10)return l;return NaN}function Th(){this.sphere||(this.e0=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.ml0=this.a*Mt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Ch(i){var s,n,r=i.x,o=i.y;if(r=O(r-this.long0),this.sphere)s=this.a*Math.asin(Math.cos(o)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(o),Math.cos(r))-this.lat0);else{var l=Math.sin(o),f=Math.cos(o),c=xi(this.a,this.e,l),d=Math.tan(o)*Math.tan(o),m=r*Math.cos(o),v=m*m,p=this.es*f*f/(1-this.es),y=this.a*Mt(this.e0,this.e1,this.e2,this.e3,o);s=c*m*(1-v*d*(1/6-(8-d+8*p)*v/120)),n=y-this.ml0+c*l/f*v*(.5+(5-d+6*p)*v/24)}return i.x=s+this.x0,i.y=n+this.y0,i}function Eh(i){i.x-=this.x0,i.y-=this.y0;var s=i.x/this.a,n=i.y/this.a,r,o;if(this.sphere){var l=n+this.lat0;r=Math.asin(Math.sin(l)*Math.cos(s)),o=Math.atan2(Math.tan(s),Math.cos(l))}else{var f=this.ml0/this.a+n,c=Pe(f,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(c)-C)<=S)return i.x=this.long0,i.y=C,n<0&&(i.y*=-1),i;var d=xi(this.a,this.e,Math.sin(c)),m=d*d*d/this.a/this.a*(1-this.es),v=Math.pow(Math.tan(c),2),p=s*this.a/d,y=p*p;r=c-d*Math.tan(c)/m*p*p*(.5-(1+3*v)*p*p/24),o=p*(1-y*(v/3+(1+3*v)*v*y/15))/Math.cos(c)}return i.x=O(o+this.long0),i.y=ii(r),i}var Sh=["Cassini","Cassini_Soldner","cass"];const Oh={init:Th,forward:Ch,inverse:Eh,names:Sh};function ei(i,s){var n;return i>1e-7?(n=i*s,(1-i*i)*(s/(1-n*n)-.5/i*Math.log((1-n)/(1+n)))):2*s}var Ih=1,zh=2,Nh=3,kh=4;function Bh(){var i=Math.abs(this.lat0);if(Math.abs(i-C)<S?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<S?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var s;switch(this.qp=ei(this.e,1),this.mmf=.5/(1-this.es),this.apa=Hh(this.es),this.mode){case this.N_POLE:this.dd=1;break;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),s=Math.sin(this.lat0),this.sinb1=ei(this.e,s)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*s*s)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Rh(i){var s,n,r,o,l,f,c,d,m,v,p=i.x,y=i.y;if(p=O(p-this.long0),this.sphere){if(l=Math.sin(y),v=Math.cos(y),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+v*r:1+this.sinph0*l+this.cosph0*v*r,n<=S)return null;n=Math.sqrt(2/n),s=n*v*Math.sin(p),n*=this.mode===this.EQUIT?l:this.cosph0*l-this.sinph0*v*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(y+this.lat0)<S)return null;n=X-y*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),s=n*Math.sin(p),n*=r}}else{switch(c=0,d=0,m=0,r=Math.cos(p),o=Math.sin(p),l=Math.sin(y),f=ei(this.e,l),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(c=f/this.qp,d=Math.sqrt(1-c*c)),this.mode){case this.OBLIQ:m=1+this.sinb1*c+this.cosb1*d*r;break;case this.EQUIT:m=1+d*r;break;case this.N_POLE:m=C+y,f=this.qp-f;break;case this.S_POLE:m=y-C,f=this.qp+f;break}if(Math.abs(m)<S)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:m=Math.sqrt(2/m),this.mode===this.OBLIQ?n=this.ymf*m*(this.cosb1*c-this.sinb1*d*r):n=(m=Math.sqrt(2/(1+d*r)))*c*this.ymf,s=this.xmf*m*d*o;break;case this.N_POLE:case this.S_POLE:f>=0?(s=(m=Math.sqrt(f))*o,n=r*(this.mode===this.S_POLE?m:-m)):s=n=0;break}}return i.x=this.a*s+this.x0,i.y=this.a*n+this.y0,i}function Dh(i){i.x-=this.x0,i.y-=this.y0;var s=i.x/this.a,n=i.y/this.a,r,o,l,f,c,d,m;if(this.sphere){var v=0,p,y=0;if(p=Math.sqrt(s*s+n*n),o=p*.5,o>1)return null;switch(o=2*Math.asin(o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(y=Math.sin(o),v=Math.cos(o)),this.mode){case this.EQUIT:o=Math.abs(p)<=S?0:Math.asin(n*y/p),s*=y,n=v*p;break;case this.OBLIQ:o=Math.abs(p)<=S?this.lat0:Math.asin(v*this.sinph0+n*y*this.cosph0/p),s*=y*this.cosph0,n=(v-Math.sin(o)*this.sinph0)*p;break;case this.N_POLE:n=-n,o=C-o;break;case this.S_POLE:o-=C;break}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(s,n)}else{if(m=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s/=this.dd,n*=this.dd,d=Math.sqrt(s*s+n*n),d<S)return i.x=this.long0,i.y=this.lat0,i;f=2*Math.asin(.5*d/this.rq),l=Math.cos(f),s*=f=Math.sin(f),this.mode===this.OBLIQ?(m=l*this.sinb1+n*f*this.cosb1/d,c=this.qp*m,n=d*this.cosb1*l-n*this.sinb1*f):(m=n*f/d,c=this.qp*m,n=d*l)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),c=s*s+n*n,!c)return i.x=this.long0,i.y=this.lat0,i;m=1-c/this.qp,this.mode===this.S_POLE&&(m=-m)}r=Math.atan2(s,n),o=Wh(Math.asin(m),this.apa)}return i.x=O(this.long0+r),i.y=o,i}var Zh=.3333333333333333,Fh=.17222222222222222,qh=.10257936507936508,Gh=.06388888888888888,Uh=.0664021164021164,jh=.016415012942191543;function Hh(i){var s,n=[];return n[0]=i*Zh,s=i*i,n[0]+=s*Fh,n[1]=s*Gh,s*=i,n[0]+=s*qh,n[1]+=s*Uh,n[2]=s*jh,n}function Wh(i,s){var n=i+i;return i+s[0]*Math.sin(n)+s[1]*Math.sin(n+n)+s[2]*Math.sin(n+n+n)}var $h=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Vh={init:Bh,forward:Rh,inverse:Dh,names:$h,S_POLE:Ih,N_POLE:zh,EQUIT:Nh,OBLIQ:kh};function si(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function Qh(){Math.abs(this.lat1+this.lat2)<S||(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=Ft(this.e3,this.sin_po,this.cos_po),this.qs1=ei(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=Ft(this.e3,this.sin_po,this.cos_po),this.qs2=ei(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=ei(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>S?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)}function Xh(i){var s=i.x,n=i.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=ei(this.e3,this.sin_phi),o=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,l=this.ns0*O(s-this.long0),f=o*Math.sin(l)+this.x0,c=this.rh-o*Math.cos(l)+this.y0;return i.x=f,i.y=c,i}function Kh(i){var s,n,r,o,l,f;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(s=Math.sqrt(i.x*i.x+i.y*i.y),r=1):(s=-Math.sqrt(i.x*i.x+i.y*i.y),r=-1),o=0,s!==0&&(o=Math.atan2(r*i.x,r*i.y)),r=s*this.ns0/this.a,this.sphere?f=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,f=this.phi1z(this.e3,n)),l=O(o/this.ns0+this.long0),i.x=l,i.y=f,i}function Yh(i,s){var n,r,o,l,f,c=si(.5*s);if(i<S)return c;for(var d=i*i,m=1;m<=25;m++)if(n=Math.sin(c),r=Math.cos(c),o=i*n,l=1-o*o,f=.5*l*l/r*(s/(1-d)-n/l+.5/i*Math.log((1-o)/(1+o))),c=c+f,Math.abs(f)<=1e-7)return c;return null}var Jh=["Albers_Conic_Equal_Area","Albers","aea"];const tl={init:Qh,forward:Xh,inverse:Kh,names:Jh,phi1z:Yh};function il(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function el(i){var s,n,r,o,l,f,c,d,m=i.x,v=i.y;return r=O(m-this.long0),s=Math.sin(v),n=Math.cos(v),o=Math.cos(r),f=this.sin_p14*s+this.cos_p14*n*o,l=1,f>0||Math.abs(f)<=S?(c=this.x0+this.a*l*n*Math.sin(r)/f,d=this.y0+this.a*l*(this.cos_p14*s-this.sin_p14*n*o)/f):(c=this.x0+this.infinity_dist*n*Math.sin(r),d=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*n*o)),i.x=c,i.y=d,i}function sl(i){var s,n,r,o,l,f;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(s=Math.sqrt(i.x*i.x+i.y*i.y))?(o=Math.atan2(s,this.rc),n=Math.sin(o),r=Math.cos(o),f=si(r*this.sin_p14+i.y*n*this.cos_p14/s),l=Math.atan2(i.x*n,s*this.cos_p14*r-i.y*this.sin_p14*n),l=O(this.long0+l)):(f=this.phic0,l=0),i.x=l,i.y=f,i}var nl=["gnom"];const al={init:il,forward:el,inverse:sl,names:nl};function ol(i,s){var n=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(s)-n)<1e-6)return s<0?-1*C:C;for(var r=Math.asin(.5*s),o,l,f,c,d=0;d<30;d++)if(l=Math.sin(r),f=Math.cos(r),c=i*l,o=Math.pow(1-c*c,2)/(2*f)*(s/(1-i*i)-l/(1-c*c)+.5/i*Math.log((1-c)/(1+c))),r+=o,Math.abs(o)<=1e-10)return r;return NaN}function rl(){this.sphere||(this.k0=Ft(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function hl(i){var s=i.x,n=i.y,r,o,l=O(s-this.long0);if(this.sphere)r=this.x0+this.a*l*Math.cos(this.lat_ts),o=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var f=ei(this.e,Math.sin(n));r=this.x0+this.a*this.k0*l,o=this.y0+this.a*f*.5/this.k0}return i.x=r,i.y=o,i}function ll(i){i.x-=this.x0,i.y-=this.y0;var s,n;return this.sphere?(s=O(this.long0+i.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(n=ol(this.e,2*i.y*this.k0/this.a),s=O(this.long0+i.x/(this.a*this.k0))),i.x=s,i.y=n,i}var ul=["cea"];const cl={init:rl,forward:hl,inverse:ll,names:ul};function fl(){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)}function dl(i){var s=i.x,n=i.y,r=O(s-this.long0),o=ii(n-this.lat0);return i.x=this.x0+this.a*r*this.rc,i.y=this.y0+this.a*o,i}function _l(i){var s=i.x,n=i.y;return i.x=O(this.long0+(s-this.x0)/(this.a*this.rc)),i.y=ii(this.lat0+(n-this.y0)/this.a),i}var ml=["Equirectangular","Equidistant_Cylindrical","eqc"];const pl={init:fl,forward:dl,inverse:_l,names:ml};var zn=20;function gl(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.ml0=this.a*Mt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function vl(i){var s=i.x,n=i.y,r,o,l,f=O(s-this.long0);if(l=f*Math.sin(n),this.sphere)Math.abs(n)<=S?(r=this.a*f,o=-1*this.a*this.lat0):(r=this.a*Math.sin(l)/Math.tan(n),o=this.a*(ii(n-this.lat0)+(1-Math.cos(l))/Math.tan(n)));else if(Math.abs(n)<=S)r=this.a*f,o=-1*this.ml0;else{var c=xi(this.a,this.e,Math.sin(n))/Math.tan(n);r=c*Math.sin(l),o=this.a*Mt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+c*(1-Math.cos(l))}return i.x=r+this.x0,i.y=o+this.y0,i}function yl(i){var s,n,r,o,l,f,c,d,m;if(r=i.x-this.x0,o=i.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=S)s=O(r/this.a+this.long0),n=0;else{f=this.lat0+o/this.a,c=r*r/this.a/this.a+f*f,d=f;var v;for(l=zn;l;--l)if(v=Math.tan(d),m=-1*(f*(d*v+1)-d-.5*(d*d+c)*v)/((d-f)/v-1),d+=m,Math.abs(m)<=S){n=d;break}s=O(this.long0+Math.asin(r*Math.tan(d)/this.a)/Math.sin(n))}else if(Math.abs(o+this.ml0)<=S)n=0,s=O(this.long0+r/this.a);else{f=(this.ml0+o)/this.a,c=r*r/this.a/this.a+f*f,d=f;var p,y,b,A,P;for(l=zn;l;--l)if(P=this.e*Math.sin(d),p=Math.sqrt(1-P*P)*Math.tan(d),y=this.a*Mt(this.e0,this.e1,this.e2,this.e3,d),b=this.e0-2*this.e1*Math.cos(2*d)+4*this.e2*Math.cos(4*d)-6*this.e3*Math.cos(6*d),A=y/this.a,m=(f*(p*A+1)-A-.5*p*(A*A+c))/(this.es*Math.sin(2*d)*(A*A+c-2*f*A)/(4*p)+(f-A)*(p*b-2/Math.sin(2*d))-b),d-=m,Math.abs(m)<=S){n=d;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),s=O(this.long0+Math.asin(r*p/this.a)/Math.sin(n))}return i.x=s,i.y=n,i}var Ml=["Polyconic","poly"];const xl={init:gl,forward:vl,inverse:yl,names:Ml};function wl(){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}function bl(i){var s,n=i.x,r=i.y,o=r-this.lat0,l=n-this.long0,f=o/ki*1e-5,c=l,d=1,m=0;for(s=1;s<=10;s++)d=d*f,m=m+this.A[s]*d;var v=m,p=c,y=1,b=0,A,P,E=0,z=0;for(s=1;s<=6;s++)A=y*v-b*p,P=b*v+y*p,y=A,b=P,E=E+this.B_re[s]*y-this.B_im[s]*b,z=z+this.B_im[s]*y+this.B_re[s]*b;return i.x=z*this.a+this.x0,i.y=E*this.a+this.y0,i}function Ll(i){var s,n=i.x,r=i.y,o=n-this.x0,l=r-this.y0,f=l/this.a,c=o/this.a,d=1,m=0,v,p,y=0,b=0;for(s=1;s<=6;s++)v=d*f-m*c,p=m*f+d*c,d=v,m=p,y=y+this.C_re[s]*d-this.C_im[s]*m,b=b+this.C_im[s]*d+this.C_re[s]*m;for(var A=0;A<this.iterations;A++){var P=y,E=b,z,B,k=f,j=c;for(s=2;s<=6;s++)z=P*y-E*b,B=E*y+P*b,P=z,E=B,k=k+(s-1)*(this.B_re[s]*P-this.B_im[s]*E),j=j+(s-1)*(this.B_im[s]*P+this.B_re[s]*E);P=1,E=0;var H=this.B_re[1],W=this.B_im[1];for(s=2;s<=6;s++)z=P*y-E*b,B=E*y+P*b,P=z,E=B,H=H+s*(this.B_re[s]*P-this.B_im[s]*E),W=W+s*(this.B_im[s]*P+this.B_re[s]*E);var ct=H*H+W*W;y=(k*H+j*W)/ct,b=(j*H-k*W)/ct}var tt=y,Pt=b,Gt=1,nt=0;for(s=1;s<=9;s++)Gt=Gt*tt,nt=nt+this.D[s]*Gt;var pt=this.lat0+nt*ki*1e5,cs=this.long0+Pt;return i.x=cs,i.y=pt,i}var Pl=["New_Zealand_Map_Grid","nzmg"];const Al={init:wl,forward:bl,inverse:Ll,names:Pl};function Tl(){}function Cl(i){var s=i.x,n=i.y,r=O(s-this.long0),o=this.x0+this.a*r,l=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return i.x=o,i.y=l,i}function El(i){i.x-=this.x0,i.y-=this.y0;var s=O(this.long0+i.x/this.a),n=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=s,i.y=n,i}var Sl=["Miller_Cylindrical","mill"];const Ol={init:Tl,forward:Cl,inverse:El,names:Sl};var Il=20;function zl(){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=es(this.es)}function Nl(i){var s,n,r=i.x,o=i.y;if(r=O(r-this.long0),this.sphere){if(!this.m)o=this.n!==1?Math.asin(this.n*Math.sin(o)):o;else for(var l=this.n*Math.sin(o),f=Il;f;--f){var c=(this.m*o+Math.sin(o)-l)/(this.m+Math.cos(o));if(o-=c,Math.abs(c)<S)break}s=this.a*this.C_x*r*(this.m+Math.cos(o)),n=this.a*this.C_y*o}else{var d=Math.sin(o),m=Math.cos(o);n=this.a*yi(o,d,m,this.en),s=this.a*r*m/Math.sqrt(1-this.es*d*d)}return i.x=s,i.y=n,i}function kl(i){var s,n,r,o;return i.x-=this.x0,r=i.x/this.a,i.y-=this.y0,s=i.y/this.a,this.sphere?(s/=this.C_y,r=r/(this.C_x*(this.m+Math.cos(s))),this.m?s=si((this.m*s+Math.sin(s))/this.n):this.n!==1&&(s=si(Math.sin(s)/this.n)),r=O(r+this.long0),s=ii(s)):(s=ss(i.y/this.a,this.es,this.en),o=Math.abs(s),o<C?(o=Math.sin(s),n=this.long0+i.x*Math.sqrt(1-this.es*o*o)/(this.a*Math.cos(s)),r=O(n)):o-S<C&&(r=this.long0)),i.x=r,i.y=s,i}var Bl=["Sinusoidal","sinu"];const Rl={init:zl,forward:Nl,inverse:kl,names:Bl};function Dl(){}function Zl(i){for(var s=i.x,n=i.y,r=O(s-this.long0),o=n,l=Math.PI*Math.sin(n);;){var f=-(o+Math.sin(o)-l)/(1+Math.cos(o));if(o+=f,Math.abs(f)<S)break}o/=2,Math.PI/2-Math.abs(n)<S&&(r=0);var c=.900316316158*this.a*r*Math.cos(o)+this.x0,d=1.4142135623731*this.a*Math.sin(o)+this.y0;return i.x=c,i.y=d,i}function Fl(i){var s,n;i.x-=this.x0,i.y-=this.y0,n=i.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),s=Math.asin(n);var r=O(this.long0+i.x/(.900316316158*this.a*Math.cos(s)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*s+Math.sin(2*s))/Math.PI,Math.abs(n)>1&&(n=1);var o=Math.asin(n);return i.x=r,i.y=o,i}var ql=["Mollweide","moll"];const Gl={init:Dl,forward:Zl,inverse:Fl,names:ql};function Ul(){Math.abs(this.lat1+this.lat2)<S||(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=Gi(this.es),this.e1=Ui(this.es),this.e2=ji(this.es),this.e3=Hi(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Ft(this.e,this.sinphi,this.cosphi),this.ml1=Mt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<S?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Ft(this.e,this.sinphi,this.cosphi),this.ml2=Mt(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=Mt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function jl(i){var s=i.x,n=i.y,r;if(this.sphere)r=this.a*(this.g-n);else{var o=Mt(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-o)}var l=this.ns*O(s-this.long0),f=this.x0+r*Math.sin(l),c=this.y0+this.rh-r*Math.cos(l);return i.x=f,i.y=c,i}function Hl(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var s,n,r,o;this.ns>=0?(n=Math.sqrt(i.x*i.x+i.y*i.y),s=1):(n=-Math.sqrt(i.x*i.x+i.y*i.y),s=-1);var l=0;if(n!==0&&(l=Math.atan2(s*i.x,s*i.y)),this.sphere)return o=O(this.long0+l/this.ns),r=ii(this.g-n/this.a),i.x=o,i.y=r,i;var f=this.g-n/this.a;return r=Pe(f,this.e0,this.e1,this.e2,this.e3),o=O(this.long0+l/this.ns),i.x=o,i.y=r,i}var Wl=["Equidistant_Conic","eqdc"];const $l={init:Ul,forward:jl,inverse:Hl,names:Wl};function Vl(){this.R=this.a}function Ql(i){var s=i.x,n=i.y,r=O(s-this.long0),o,l;Math.abs(n)<=S&&(o=this.x0+this.R*r,l=this.y0);var f=si(2*Math.abs(n/Math.PI));(Math.abs(r)<=S||Math.abs(Math.abs(n)-C)<=S)&&(o=this.x0,n>=0?l=this.y0+Math.PI*this.R*Math.tan(.5*f):l=this.y0+Math.PI*this.R*-Math.tan(.5*f));var c=.5*Math.abs(Math.PI/r-r/Math.PI),d=c*c,m=Math.sin(f),v=Math.cos(f),p=v/(m+v-1),y=p*p,b=p*(2/m-1),A=b*b,P=Math.PI*this.R*(c*(p-A)+Math.sqrt(d*(p-A)*(p-A)-(A+d)*(y-A)))/(A+d);r<0&&(P=-P),o=this.x0+P;var E=d+p;return P=Math.PI*this.R*(b*E-c*Math.sqrt((A+d)*(d+1)-E*E))/(A+d),n>=0?l=this.y0+P:l=this.y0-P,i.x=o,i.y=l,i}function Xl(i){var s,n,r,o,l,f,c,d,m,v,p,y,b;return i.x-=this.x0,i.y-=this.y0,p=Math.PI*this.R,r=i.x/p,o=i.y/p,l=r*r+o*o,f=-Math.abs(o)*(1+l),c=f-2*o*o+r*r,d=-2*f+1+2*o*o+l*l,b=o*o/d+(2*c*c*c/d/d/d-9*f*c/d/d)/27,m=(f-c*c/3/d)/d,v=2*Math.sqrt(-m/3),p=3*b/m/v,Math.abs(p)>1&&(p>=0?p=1:p=-1),y=Math.acos(p)/3,i.y>=0?n=(-v*Math.cos(y+Math.PI/3)-c/3/d)*Math.PI:n=-(-v*Math.cos(y+Math.PI/3)-c/3/d)*Math.PI,Math.abs(r)<S?s=this.long0:s=O(this.long0+Math.PI*(l-1+Math.sqrt(1+2*(r*r-o*o)+l*l))/2/r),i.x=s,i.y=n,i}var Kl=["Van_der_Grinten_I","VanDerGrinten","vandg"];const Yl={init:Vl,forward:Ql,inverse:Xl,names:Kl};function Jl(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function tu(i){var s=i.x,n=i.y,r=Math.sin(i.y),o=Math.cos(i.y),l=O(s-this.long0),f,c,d,m,v,p,y,b,A,P,E,z,B,k,j,H,W,ct,tt,Pt,Gt,nt,pt;return this.sphere?Math.abs(this.sin_p12-1)<=S?(i.x=this.x0+this.a*(C-n)*Math.sin(l),i.y=this.y0-this.a*(C-n)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=S?(i.x=this.x0+this.a*(C+n)*Math.sin(l),i.y=this.y0+this.a*(C+n)*Math.cos(l),i):(ct=this.sin_p12*r+this.cos_p12*o*Math.cos(l),H=Math.acos(ct),W=H?H/Math.sin(H):1,i.x=this.x0+this.a*W*o*Math.sin(l),i.y=this.y0+this.a*W*(this.cos_p12*r-this.sin_p12*o*Math.cos(l)),i):(f=Gi(this.es),c=Ui(this.es),d=ji(this.es),m=Hi(this.es),Math.abs(this.sin_p12-1)<=S?(v=this.a*Mt(f,c,d,m,C),p=this.a*Mt(f,c,d,m,n),i.x=this.x0+(v-p)*Math.sin(l),i.y=this.y0-(v-p)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=S?(v=this.a*Mt(f,c,d,m,C),p=this.a*Mt(f,c,d,m,n),i.x=this.x0+(v+p)*Math.sin(l),i.y=this.y0+(v+p)*Math.cos(l),i):(y=r/o,b=xi(this.a,this.e,this.sin_p12),A=xi(this.a,this.e,r),P=Math.atan((1-this.es)*y+this.es*b*this.sin_p12/(A*o)),E=Math.atan2(Math.sin(l),this.cos_p12*Math.tan(P)-this.sin_p12*Math.cos(l)),E===0?tt=Math.asin(this.cos_p12*Math.sin(P)-this.sin_p12*Math.cos(P)):Math.abs(Math.abs(E)-Math.PI)<=S?tt=-Math.asin(this.cos_p12*Math.sin(P)-this.sin_p12*Math.cos(P)):tt=Math.asin(Math.sin(l)*Math.cos(P)/Math.sin(E)),z=this.e*this.sin_p12/Math.sqrt(1-this.es),B=this.e*this.cos_p12*Math.cos(E)/Math.sqrt(1-this.es),k=z*B,j=B*B,Pt=tt*tt,Gt=Pt*tt,nt=Gt*tt,pt=nt*tt,H=b*tt*(1-Pt*j*(1-j)/6+Gt/8*k*(1-2*j)+nt/120*(j*(4-7*j)-3*z*z*(1-7*j))-pt/48*k),i.x=this.x0+H*Math.sin(E),i.y=this.y0+H*Math.cos(E),i))}function iu(i){i.x-=this.x0,i.y-=this.y0;var s,n,r,o,l,f,c,d,m,v,p,y,b,A,P,E,z,B,k,j,H,W,ct,tt;return this.sphere?(s=Math.sqrt(i.x*i.x+i.y*i.y),s>2*C*this.a?void 0:(n=s/this.a,r=Math.sin(n),o=Math.cos(n),l=this.long0,Math.abs(s)<=S?f=this.lat0:(f=si(o*this.sin_p12+i.y*r*this.cos_p12/s),c=Math.abs(this.lat0)-C,Math.abs(c)<=S?this.lat0>=0?l=O(this.long0+Math.atan2(i.x,-i.y)):l=O(this.long0-Math.atan2(-i.x,i.y)):l=O(this.long0+Math.atan2(i.x*r,s*this.cos_p12*o-i.y*this.sin_p12*r))),i.x=l,i.y=f,i)):(d=Gi(this.es),m=Ui(this.es),v=ji(this.es),p=Hi(this.es),Math.abs(this.sin_p12-1)<=S?(y=this.a*Mt(d,m,v,p,C),s=Math.sqrt(i.x*i.x+i.y*i.y),b=y-s,f=Pe(b/this.a,d,m,v,p),l=O(this.long0+Math.atan2(i.x,-1*i.y)),i.x=l,i.y=f,i):Math.abs(this.sin_p12+1)<=S?(y=this.a*Mt(d,m,v,p,C),s=Math.sqrt(i.x*i.x+i.y*i.y),b=s-y,f=Pe(b/this.a,d,m,v,p),l=O(this.long0+Math.atan2(i.x,i.y)),i.x=l,i.y=f,i):(s=Math.sqrt(i.x*i.x+i.y*i.y),E=Math.atan2(i.x,i.y),A=xi(this.a,this.e,this.sin_p12),z=Math.cos(E),B=this.e*this.cos_p12*z,k=-B*B/(1-this.es),j=3*this.es*(1-k)*this.sin_p12*this.cos_p12*z/(1-this.es),H=s/A,W=H-k*(1+k)*Math.pow(H,3)/6-j*(1+3*k)*Math.pow(H,4)/24,ct=1-k*W*W/2-H*W*W*W/6,P=Math.asin(this.sin_p12*Math.cos(W)+this.cos_p12*Math.sin(W)*z),l=O(this.long0+Math.asin(Math.sin(E)*Math.sin(W)/Math.cos(P))),tt=Math.sin(P),f=Math.atan2((tt-this.es*ct*this.sin_p12)*Math.tan(P),tt*(1-this.es)),i.x=l,i.y=f,i))}var eu=["Azimuthal_Equidistant","aeqd"];const su={init:Jl,forward:tu,inverse:iu,names:eu};function nu(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function au(i){var s,n,r,o,l,f,c,d,m=i.x,v=i.y;return r=O(m-this.long0),s=Math.sin(v),n=Math.cos(v),o=Math.cos(r),f=this.sin_p14*s+this.cos_p14*n*o,l=1,(f>0||Math.abs(f)<=S)&&(c=this.a*l*n*Math.sin(r),d=this.y0+this.a*l*(this.cos_p14*s-this.sin_p14*n*o)),i.x=c,i.y=d,i}function ou(i){var s,n,r,o,l,f,c;return i.x-=this.x0,i.y-=this.y0,s=Math.sqrt(i.x*i.x+i.y*i.y),n=si(s/this.a),r=Math.sin(n),o=Math.cos(n),f=this.long0,Math.abs(s)<=S?(c=this.lat0,i.x=f,i.y=c,i):(c=si(o*this.sin_p14+i.y*r*this.cos_p14/s),l=Math.abs(this.lat0)-C,Math.abs(l)<=S?(this.lat0>=0?f=O(this.long0+Math.atan2(i.x,-i.y)):f=O(this.long0-Math.atan2(-i.x,i.y)),i.x=f,i.y=c,i):(f=O(this.long0+Math.atan2(i.x*r,s*this.cos_p14*o-i.y*this.sin_p14*r)),i.x=f,i.y=c,i))}var ru=["ortho"];const hu={init:nu,forward:au,inverse:ou,names:ru};var it={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},K={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function lu(){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>=C-X/2?this.face=it.TOP:this.lat0<=-(C-X/2)?this.face=it.BOTTOM:Math.abs(this.long0)<=X?this.face=it.FRONT:Math.abs(this.long0)<=C+X?this.face=this.long0>0?it.RIGHT:it.LEFT:this.face=it.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function uu(i){var s={x:0,y:0},n,r,o,l,f,c,d={value:0};if(i.x-=this.long0,this.es!==0?n=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):n=i.y,r=i.x,this.face===it.TOP)l=C-n,r>=X&&r<=C+X?(d.value=K.AREA_0,o=r-C):r>C+X||r<=-(C+X)?(d.value=K.AREA_1,o=r>0?r-at:r+at):r>-(C+X)&&r<=-X?(d.value=K.AREA_2,o=r+C):(d.value=K.AREA_3,o=r);else if(this.face===it.BOTTOM)l=C+n,r>=X&&r<=C+X?(d.value=K.AREA_0,o=-r+C):r<X&&r>=-X?(d.value=K.AREA_1,o=-r):r<-X&&r>=-(C+X)?(d.value=K.AREA_2,o=-r-C):(d.value=K.AREA_3,o=r>0?-r+at:-r-at);else{var m,v,p,y,b,A,P;this.face===it.RIGHT?r=wi(r,+C):this.face===it.BACK?r=wi(r,+at):this.face===it.LEFT&&(r=wi(r,-C)),y=Math.sin(n),b=Math.cos(n),A=Math.sin(r),P=Math.cos(r),m=b*P,v=b*A,p=y,this.face===it.FRONT?(l=Math.acos(m),o=Ae(l,p,v,d)):this.face===it.RIGHT?(l=Math.acos(v),o=Ae(l,p,-m,d)):this.face===it.BACK?(l=Math.acos(-m),o=Ae(l,p,-v,d)):this.face===it.LEFT?(l=Math.acos(-v),o=Ae(l,p,m,d)):(l=o=0,d.value=K.AREA_0)}return c=Math.atan(12/at*(o+Math.acos(Math.sin(o)*Math.cos(X))-C)),f=Math.sqrt((1-Math.cos(l))/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(o))))),d.value===K.AREA_1?c+=C:d.value===K.AREA_2?c+=at:d.value===K.AREA_3&&(c+=1.5*at),s.x=f*Math.cos(c),s.y=f*Math.sin(c),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,i.x=s.x,i.y=s.y,i}function cu(i){var s={lam:0,phi:0},n,r,o,l,f,c,d,m,v,p={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,r=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),n=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?p.value=K.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(p.value=K.AREA_1,n-=C):i.x<0&&-i.x>=Math.abs(i.y)?(p.value=K.AREA_2,n=n<0?n+at:n-at):(p.value=K.AREA_3,n+=C),v=at/12*Math.tan(n),f=Math.sin(v)/(Math.cos(v)-1/Math.sqrt(2)),c=Math.atan(f),o=Math.cos(n),l=Math.tan(r),d=1-o*o*l*l*(1-Math.cos(Math.atan(1/Math.cos(c)))),d<-1?d=-1:d>1&&(d=1),this.face===it.TOP)m=Math.acos(d),s.phi=C-m,p.value===K.AREA_0?s.lam=c+C:p.value===K.AREA_1?s.lam=c<0?c+at:c-at:p.value===K.AREA_2?s.lam=c-C:s.lam=c;else if(this.face===it.BOTTOM)m=Math.acos(d),s.phi=m-C,p.value===K.AREA_0?s.lam=-c+C:p.value===K.AREA_1?s.lam=-c:p.value===K.AREA_2?s.lam=-c-C:s.lam=c<0?-c-at:-c+at;else{var y,b,A;y=d,v=y*y,v>=1?A=0:A=Math.sqrt(1-v)*Math.sin(c),v+=A*A,v>=1?b=0:b=Math.sqrt(1-v),p.value===K.AREA_1?(v=b,b=-A,A=v):p.value===K.AREA_2?(b=-b,A=-A):p.value===K.AREA_3&&(v=b,b=A,A=-v),this.face===it.RIGHT?(v=y,y=-b,b=v):this.face===it.BACK?(y=-y,b=-b):this.face===it.LEFT&&(v=y,y=b,b=-v),s.phi=Math.acos(-A)-C,s.lam=Math.atan2(b,y),this.face===it.RIGHT?s.lam=wi(s.lam,-C):this.face===it.BACK?s.lam=wi(s.lam,-at):this.face===it.LEFT&&(s.lam=wi(s.lam,+C))}if(this.es!==0){var P,E,z;P=s.phi<0?1:0,E=Math.tan(s.phi),z=this.b/Math.sqrt(E*E+this.one_minus_f_squared),s.phi=Math.atan(Math.sqrt(this.a*this.a-z*z)/(this.one_minus_f*z)),P&&(s.phi=-s.phi)}return s.lam+=this.long0,i.x=s.lam,i.y=s.phi,i}function Ae(i,s,n,r){var o;return i<S?(r.value=K.AREA_0,o=0):(o=Math.atan2(s,n),Math.abs(o)<=X?r.value=K.AREA_0:o>X&&o<=C+X?(r.value=K.AREA_1,o-=C):o>C+X||o<=-(C+X)?(r.value=K.AREA_2,o=o>=0?o-at:o+at):(r.value=K.AREA_3,o+=C)),o}function wi(i,s){var n=i+s;return n<-at?n+=Bi:n>+at&&(n-=Bi),n}var fu=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const du={init:lu,forward:uu,inverse:cu,names:fu};var rs=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.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,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.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]],Wi=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Nn=.8487,kn=1.3523,Bn=Dt/5,_u=1/Bn,bi=18,Te=function(i,s){return i[0]+s*(i[1]+s*(i[2]+s*i[3]))},mu=function(i,s){return i[1]+s*(2*i[2]+s*3*i[3])};function pu(i,s,n,r){for(var o=s;r;--r){var l=i(o);if(o-=l,Math.abs(l)<n)break}return o}function gu(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function vu(i){var s=O(i.x-this.long0),n=Math.abs(i.y),r=Math.floor(n*Bn);r<0?r=0:r>=bi&&(r=bi-1),n=Dt*(n-_u*r);var o={x:Te(rs[r],n)*s,y:Te(Wi[r],n)};return i.y<0&&(o.y=-o.y),o.x=o.x*this.a*Nn+this.x0,o.y=o.y*this.a*kn+this.y0,o}function yu(i){var s={x:(i.x-this.x0)/(this.a*Nn),y:Math.abs(i.y-this.y0)/(this.a*kn)};if(s.y>=1)s.x/=rs[bi][0],s.y=i.y<0?-C:C;else{var n=Math.floor(s.y*bi);for(n<0?n=0:n>=bi&&(n=bi-1);;)if(Wi[n][0]>s.y)--n;else if(Wi[n+1][0]<=s.y)++n;else break;var r=Wi[n],o=5*(s.y-r[0])/(Wi[n+1][0]-r[0]);o=pu(function(l){return(Te(r,l)-s.y)/mu(r,l)},o,S,100),s.x/=Te(rs[n],o),s.y=(5*n+o)*mt,i.y<0&&(s.y=-s.y)}return s.x=O(s.x+this.long0),s}var Mu=["Robinson","robin"];const xu={init:gu,forward:vu,inverse:yu,names:Mu};function wu(){this.name="geocent"}function bu(i){var s=cn(i,this.es,this.a);return s}function Lu(i){var s=fn(i,this.es,this.a,this.b);return s}var Pu=["Geocentric","geocentric","geocent","Geocent"];const Au={init:wu,forward:bu,inverse:Lu,names:Pu};var vt={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}};function Tu(){if(Object.keys($i).forEach((function(n){if(typeof this[n]>"u")this[n]=$i[n].def;else{if($i[n].num&&isNaN(this[n]))throw new Error("Invalid parameter value, must be numeric "+n+" = "+this[n]);$i[n].num&&(this[n]=parseFloat(this[n]))}$i[n].degrees&&(this[n]=this[n]*mt)}).bind(this)),Math.abs(Math.abs(this.lat0)-C)<S?this.mode=this.lat0<0?vt.S_POLE:vt.N_POLE:Math.abs(this.lat0)<S?this.mode=vt.EQUIT:(this.mode=vt.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 i=this.tilt,s=this.azi;this.cg=Math.cos(s),this.sg=Math.sin(s),this.cw=Math.cos(i),this.sw=Math.sin(i)}function Cu(i){i.x-=this.long0;var s=Math.sin(i.y),n=Math.cos(i.y),r=Math.cos(i.x),o,l;switch(this.mode){case vt.OBLIQ:l=this.sinph0*s+this.cosph0*n*r;break;case vt.EQUIT:l=n*r;break;case vt.S_POLE:l=-s;break;case vt.N_POLE:l=s;break}switch(l=this.pn1/(this.p-l),o=l*n*Math.sin(i.x),this.mode){case vt.OBLIQ:l*=this.cosph0*s-this.sinph0*n*r;break;case vt.EQUIT:l*=s;break;case vt.N_POLE:l*=-(n*r);break;case vt.S_POLE:l*=n*r;break}var f,c;return f=l*this.cg+o*this.sg,c=1/(f*this.sw*this.h1+this.cw),o=(o*this.cg-l*this.sg)*this.cw*c,l=f*c,i.x=o*this.a,i.y=l*this.a,i}function Eu(i){i.x/=this.a,i.y/=this.a;var s={x:i.x,y:i.y},n,r,o;o=1/(this.pn1-i.y*this.sw),n=this.pn1*i.x*o,r=this.pn1*i.y*this.cw*o,i.x=n*this.cg+r*this.sg,i.y=r*this.cg-n*this.sg;var l=Lt(i.x,i.y);if(Math.abs(l)<S)s.x=0,s.y=i.y;else{var f,c;switch(c=1-l*l*this.pfact,c=(this.p-Math.sqrt(c))/(this.pn1/l+l/this.pn1),f=Math.sqrt(1-c*c),this.mode){case vt.OBLIQ:s.y=Math.asin(f*this.sinph0+i.y*c*this.cosph0/l),i.y=(f-this.sinph0*Math.sin(s.y))*l,i.x*=c*this.cosph0;break;case vt.EQUIT:s.y=Math.asin(i.y*c/l),i.y=f*l,i.x*=c;break;case vt.N_POLE:s.y=Math.asin(f),i.y=-i.y;break;case vt.S_POLE:s.y=-Math.asin(f);break}s.x=Math.atan2(i.x,i.y)}return i.x=s.x+this.long0,i.y=s.y,i}var Su=["Tilted_Perspective","tpers"];const Ou={init:Tu,forward:Cu,inverse:Eu,names:Su};function Iu(){if(this.flip_axis=this.sweep==="x"?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,this.es!==0){var i=1-this.es,s=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=s,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")}function zu(i){var s=i.x,n=i.y,r,o,l,f;if(s=s-this.long0,this.shape==="ellipse"){n=Math.atan(this.radius_p2*Math.tan(n));var c=this.radius_p/Lt(this.radius_p*Math.cos(n),Math.sin(n));if(o=c*Math.cos(s)*Math.cos(n),l=c*Math.sin(s)*Math.cos(n),f=c*Math.sin(n),(this.radius_g-o)*o-l*l-f*f*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;r=this.radius_g-o,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Lt(f,r)),i.y=this.radius_g_1*Math.atan(f/r)):(i.x=this.radius_g_1*Math.atan(l/r),i.y=this.radius_g_1*Math.atan(f/Lt(l,r)))}else this.shape==="sphere"&&(r=Math.cos(n),o=Math.cos(s)*r,l=Math.sin(s)*r,f=Math.sin(n),r=this.radius_g-o,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Lt(f,r)),i.y=this.radius_g_1*Math.atan(f/r)):(i.x=this.radius_g_1*Math.atan(l/r),i.y=this.radius_g_1*Math.atan(f/Lt(l,r))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function Nu(i){var s=-1,n=0,r=0,o,l,f,c;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Lt(1,r)):(n=Math.tan(i.x/this.radius_g_1),r=Math.tan(i.y/this.radius_g_1)*Lt(1,n));var d=r/this.radius_p;if(o=n*n+d*d+s*s,l=2*this.radius_g*s,f=l*l-4*o*this.C,f<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(f))/(2*o),s=this.radius_g+c*s,n*=c,r*=c,i.x=Math.atan2(n,s),i.y=Math.atan(r*Math.cos(i.x)/s),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(i.x/this.radius_g_1),r=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+r*r+s*s,l=2*this.radius_g*s,f=l*l-4*o*this.C,f<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(f))/(2*o),s=this.radius_g+c*s,n*=c,r*=c,i.x=Math.atan2(n,s),i.y=Math.atan(r*Math.cos(i.x)/s)}return i.x=i.x+this.long0,i}var ku=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Bu={init:Iu,forward:zu,inverse:Nu,names:ku};var Vi=1.340264,Qi=-.081106,Xi=893e-6,Ki=.003796,Ce=Math.sqrt(3)/2;function Ru(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function Du(i){var s=O(i.x-this.long0),n=i.y,r=Math.asin(Ce*Math.sin(n)),o=r*r,l=o*o*o;return i.x=s*Math.cos(r)/(Ce*(Vi+3*Qi*o+l*(7*Xi+9*Ki*o))),i.y=r*(Vi+Qi*o+l*(Xi+Ki*o)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function Zu(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var s=1e-9,n=12,r=i.y,o,l,f,c,d,m;for(m=0;m<n&&(o=r*r,l=o*o*o,f=r*(Vi+Qi*o+l*(Xi+Ki*o))-i.y,c=Vi+3*Qi*o+l*(7*Xi+9*Ki*o),r-=d=f/c,!(Math.abs(d)<s));++m);return o=r*r,l=o*o*o,i.x=Ce*i.x*(Vi+3*Qi*o+l*(7*Xi+9*Ki*o))/Math.cos(r),i.y=Math.asin(Math.sin(r)/Ce),i.x=O(i.x+this.long0),i}var Fu=["eqearth","Equal Earth","Equal_Earth"];const qu={init:Ru,forward:Du,inverse:Zu,names:Fu};var Yi=1e-10;function Gu(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<Yi)throw new Error;this.es?(this.en=es(this.es),this.m1=yi(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=ju,this.forward=Uu):(Math.abs(this.phi1)+Yi>=C?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Wu,this.forward=Hu)}function Uu(i){var s=O(i.x-(this.long0||0)),n=i.y,r,o,l;return r=this.am1+this.m1-yi(n,o=Math.sin(n),l=Math.cos(n),this.en),o=l*s/(r*Math.sqrt(1-this.es*o*o)),i.x=r*Math.sin(o),i.y=this.am1-r*Math.cos(o),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function ju(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var s,n,r,o;if(n=Lt(i.x,i.y=this.am1-i.y),o=ss(this.am1+this.m1-n,this.es,this.en),(s=Math.abs(o))<C)s=Math.sin(o),r=n*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*s*s)/Math.cos(o);else if(Math.abs(s-C)<=Yi)r=0;else throw new Error;return i.x=O(r+(this.long0||0)),i.y=ii(o),i}function Hu(i){var s=O(i.x-(this.long0||0)),n=i.y,r,o;return o=this.cphi1+this.phi1-n,Math.abs(o)>Yi?(i.x=o*Math.sin(r=s*Math.cos(n)/o),i.y=this.cphi1-o*Math.cos(r)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function Wu(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var s,n,r=Lt(i.x,i.y=this.cphi1-i.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>C)throw new Error;return Math.abs(Math.abs(n)-C)<=Yi?s=0:s=r*Math.atan2(i.x,i.y)/Math.cos(n),i.x=O(s+(this.long0||0)),i.y=ii(n),i}var $u=["bonne","Bonne (Werner lat_1=90)"];const Vu={init:Gu,names:$u};function Qu(i){i.Proj.projections.add(be),i.Proj.projections.add(Le),i.Proj.projections.add(Ur),i.Proj.projections.add(Jr),i.Proj.projections.add(ah),i.Proj.projections.add(uh),i.Proj.projections.add(ph),i.Proj.projections.add(xh),i.Proj.projections.add(Ah),i.Proj.projections.add(Oh),i.Proj.projections.add(Vh),i.Proj.projections.add(tl),i.Proj.projections.add(al),i.Proj.projections.add(cl),i.Proj.projections.add(pl),i.Proj.projections.add(xl),i.Proj.projections.add(Al),i.Proj.projections.add(Ol),i.Proj.projections.add(Rl),i.Proj.projections.add(Gl),i.Proj.projections.add($l),i.Proj.projections.add(Yl),i.Proj.projections.add(su),i.Proj.projections.add(hu),i.Proj.projections.add(du),i.Proj.projections.add(xu),i.Proj.projections.add(Au),i.Proj.projections.add(Ou),i.Proj.projections.add(Bu),i.Proj.projections.add(qu),i.Proj.projections.add(Vu)}Et.defaultDatum="WGS84",Et.Proj=qt,Et.WGS84=new Et.Proj("WGS84"),Et.Point=vi,Et.toPoint=pn,Et.defs=yt,Et.nadgrid=Ho,Et.transform=we,Et.mgrs=rr,Et.version="__VERSION__",Qu(Et);const Xu=so(Object.freeze(Object.defineProperty({__proto__:null,default:Et},Symbol.toStringTag,{value:"Module"})));(function(i){(function(s){var n,r;n=$s(),r=Xu,i.exports=s(n,r)})(function(s,n){return n.__esModule&&n.default&&(n=n.default),s.Proj={},s.Proj._isProj4Obj=function(r){return typeof r.inverse<"u"&&typeof r.forward<"u"},s.Proj.Projection=s.Class.extend({initialize:function(r,o,l){var f=s.Proj._isProj4Obj(r);this._proj=f?r:this._projFromCodeDef(r,o),this.bounds=f?o:l},project:function(r){var o=this._proj.forward([r.lng,r.lat]);return new s.Point(o[0],o[1])},unproject:function(r,o){var l=this._proj.inverse([r.x,r.y]);return new s.LatLng(l[1],l[0],o)},_projFromCodeDef:function(r,o){if(o)n.defs(r,o);else if(n.defs[r]===void 0){var l=r.split(":");if(l.length>3&&(r=l[l.length-3]+":"+l[l.length-1]),n.defs[r]===void 0)throw"No projection definition for code "+r}return n(r)}}),s.Proj.CRS=s.Class.extend({includes:s.CRS,options:{transformation:new s.Transformation(1,0,-1,0)},initialize:function(r,o,l){var f,c,d,m;if(s.Proj._isProj4Obj(r)?(c=r,f=c.srsCode,m=o||{},this.projection=new s.Proj.Projection(c,m.bounds)):(f=r,d=o,m=l||{},this.projection=new s.Proj.Projection(f,d,m.bounds)),s.Util.setOptions(this,m),this.code=f,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new s.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var v=this.options.resolutions.length-1;v>=0;v--)this.options.resolutions[v]&&(this._scales[v]=1/this.options.resolutions[v])}this.infinite=!this.options.bounds},scale:function(r){var o=Math.floor(r),l,f,c,d;return r===o?this._scales[r]:(l=this._scales[o],f=this._scales[o+1],c=f-l,d=r-o,l+c*d)},zoom:function(r){var o=this._closestElement(this._scales,r),l=this._scales.indexOf(o),f,c,d;return r===o?l:o===void 0?-1/0:(c=l+1,f=this._scales[c],f===void 0?1/0:(d=f-o,(r-o)/d+l))},distance:s.CRS.Earth.distance,R:s.CRS.Earth.R,_closestElement:function(r,o){for(var l,f=r.length;f--;)r[f]<=o&&(l===void 0||l<r[f])&&(l=r[f]);return l}}),s.Proj.GeoJSON=s.GeoJSON.extend({initialize:function(r,o){this._callLevel=0,s.GeoJSON.prototype.initialize.call(this,r,o)},addData:function(r){var o;r&&(r.crs&&r.crs.type==="name"?o=new s.Proj.CRS(r.crs.properties.name):r.crs&&r.crs.type&&(o=new s.Proj.CRS(r.crs.type+":"+r.crs.properties.code)),o!==void 0&&(this.options.coordsToLatLng=function(l){var f=s.point(l[0],l[1]);return o.projection.unproject(f)})),this._callLevel++;try{s.GeoJSON.prototype.addData.call(this,r)}finally{this._callLevel--,this._callLevel===0&&delete this.options.coordsToLatLng}}}),s.Proj.geoJson=function(r,o){return new s.Proj.GeoJSON(r,o)},s.Proj.ImageOverlay=s.ImageOverlay.extend({initialize:function(r,o,l){s.ImageOverlay.prototype.initialize.call(this,r,null,l),this._projectedBounds=o},_animateZoom:function(r){var o=this._map.getZoomScale(r.zoom),l=s.point(this._projectedBounds.min.x,this._projectedBounds.max.y),f=this._projectedToNewLayerPoint(l,r.zoom,r.center);s.DomUtil.setTransform(this._image,f,o)},_reset:function(){var r=this._map.getZoom(),o=this._map.getPixelOrigin(),l=s.bounds(this._transform(this._projectedBounds.min,r)._subtract(o),this._transform(this._projectedBounds.max,r)._subtract(o)),f=l.getSize();s.DomUtil.setPosition(this._image,l.min),this._image.style.width=f.x+"px",this._image.style.height=f.y+"px"},_projectedToNewLayerPoint:function(r,o,l){var f=this._map.getSize()._divideBy(2),c=this._map.project(l,o)._subtract(f)._round(),d=c.add(this._map._getMapPanePos());return this._transform(r,o)._subtract(d)},_transform:function(r,o){var l=this._map.options.crs,f=l.transformation,c=l.scale(o);return f.transform(r,c)}}),s.Proj.imageOverlay=function(r,o,l){return new s.Proj.ImageOverlay(r,o,l)},s.Proj})})(ao);const hs=new M.Proj.CRS("EPSG:900913","+proj=merc +a=6378206 +b=6356584.314245179 +lat_ts=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",{resolutions:function(){var i=[];i[0]=Math.pow(2,18);for(var s=1;s<21;s++)i[s]=Math.pow(2,18-s);return i}(),origin:[0,0],bounds:M.bounds([20037508342789244e-9,0],[0,20037508342789244e-9])}),Rn=M.Layer.extend({provide:{TDT:"tdt",BAIDU:"bd",GAODE:"gd",YANDEX:"yandex"},source:{VECTOR:"vec",SATELITE:"img",ANNO:"cia",VEC_NO_ANNO:"vec_no_anno",SATELITE_NO_ANNO:"img_no_anno"},style:{NORMAL:"normal",GRAY:"gray",DARK:"dark",BROWN:"brown",BLUR:"blur"},options:{provide:"tdt",source:"img",style:"normal",accessToken:"016b31f15f25e1365e85aec7e7b0464e"},initialize(i){i=_t.Util.deleteEmptyProperty(i),M.Util.setOptions(this,i)},onAdd(i){this.map=i,this.replaceProjection(),this.tileLayers=this.getLayerGroup(),i.addLayer(this.tileLayers)},onRemove(i){const s=this.getLayerGroup();i.removeLayer(s)},replaceProjection(){const i=this.map.getCenter(),s=this.map.getZoom();this.options.provide===this.provide.BAIDU?this.map.options.crs=hs:this.options.provide===this.provide.YANDEX?this.map.options.crs=M.CRS.EPSG3395:this.map.options.crs=M.CRS.EPSG3857,this._resetMapStatus(i,s)},_resetMapStatus(i,s){this.map.setView(i),this.map._resetView(i,s,!0)},getLayerGroup(){let i={},s={};switch(this.options.style&&this.options.style.split(",").forEach(n=>{switch(n){case this.style.DARK:i.invert=1;break;case this.style.GRAY:i.grayscale=1;break;case this.style.BROWN:i.sepia=1;break;case this.style.BLUR:i.blur="1px";break}}),this.options.provide){case this.provide.TDT:s={subdomains:_t.ArrayUtil.create(8),maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.BAIDU:s={subdomains:_t.ArrayUtil.create(10),tms:!0,corrdType:"bd09",maxNativeZoom:19,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.GAODE:s={subdomains:_t.ArrayUtil.create(4).map(n=>n+1),corrdType:"gcj02",maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break;case this.provide.YANDEX:s={maxNativeZoom:18,minZoom:0,maxZoom:this.map.getMaxZoom()};break}if(this.options.opacity>=0&&(i.opacity=this.options.opacity),this.options.url)return new M.TileLayer(this.options.url,{...s,style:i});switch(this.options.provide){case this.provide.TDT:let n;switch(s.maxNativeZoom=18,this.options.source){case this.source.VECTOR:n=["vec_w","cva_w"];break;case this.source.SATELITE:n=["img_w","cia_w"];break;case this.source.ANNO:n=["cva_w"];break;case this.source.VEC_NO_ANNO:n=["vec_w"];break;case this.source.SATELITE_NO_ANNO:n=["img_w"];break}return new M.LayerGroup(n.map(r=>new M.TileLayer(`http://t{s}.tianditu.gov.cn/DataServer?T=${r}&x={x}&y={y}&l={z}&tk=${this.options.accessToken}`,{...s,style:i})));case this.provide.BAIDU:switch(this.options.source){case this.source.VECTOR:return s.maxNativeZoom=19,new M.TileLayer("http://online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",{...s,style:i});case this.source.ANNO:return s.maxNativeZoom=19,new M.TileLayer("http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl",{...s,style:i});case this.source.SATELITE:return s.maxNativeZoom=17,new M.LayerGroup([new M.TileLayer("http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",{...s,style:i}),new M.TileLayer("http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return s.maxNativeZoom=19,new M.TileLayer("http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",{...s,style:i})}break;case this.provide.GAODE:switch(this.options.source){case this.source.VECTOR:return s.maxNativeZoom=18,new M.TileLayer("http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i});case this.source.ANNO:return s.maxNativeZoom=18,new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i});case this.source.SATELITE:return s.maxNativeZoom=16,new M.LayerGroup([new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=6",{...s,style:i}),new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return s.maxNativeZoom=18,new M.TileLayer("http://webst0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=6",{...s,style:i})}break;case this.provide.YANDEX:switch(this.options.source){case this.source.ANNO:return new M.TileLayer("https://core-renderer-tiles.maps.yandex.net/tiles?l=skl&v=24.05.19-0-b240515214430&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps&experimental_ranking_mode_name=default-web-ranking&experimental_data_hd=vegetation_model_exp",{...s,style:i});case this.source.SATELITE:return new M.LayerGroup([new M.TileLayer("https://sat{s}.maps.yandex.net/tiles?l=sat&v=3.1238.0&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps",{...s,subdomains:["01","02","03","04"],style:i}),new M.TileLayer("https://core-renderer-tiles.maps.yandex.net/tiles?l=skl&v=24.05.19-0-b240515214430&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps&experimental_ranking_mode_name=default-web-ranking&experimental_data_hd=vegetation_model_exp",{...s,style:i})]);case this.source.SATELITE_NO_ANNO:return new M.TileLayer("https://sat{s}.maps.yandex.net/tiles?l=sat&v=3.1238.0&x={x}&y={y}&z={z}&scale=1&lang=en_US&client_id=yandex-web-maps",{...s,subdomains:["01","02","03","04"],style:i})}break}},setOptions(i){M.Util.setOptions(this,i);const s=this.getLayerGroup();this.map.removeLayer(this.tileLayers),setTimeout(()=>{this.replaceProjection(),this.tileLayers=s.addTo(this.map)},500)}}),Dn=M.ImageOverlay.extend({initialize(i,s,n,r){typeof i=="string"?this._url=i:this._rawImage=i,this.topRightMarker=s,this.bottomLeftMarker=n,this.angle=0,M.setOptions(this,r),this._topLeft=new M.LatLng(r.corners[0]),this._topRight=new M.LatLng(r.corners[1]),this._bottomLeft=new M.LatLng(r.corners[3]),s.on("drag dragend",this.reposition,this),n.on("drag dragend",this.reposition,this)},onAdd(i){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M.DomUtil.addClass(this._rawImage,"leaflet-interactive"),this.addInteractiveTarget(this._rawImage)),i.on("zoomend resetview",this._reset,this),this.getPane().appendChild(this._image),this._reset()},onRemove(i){i.off("zoomend resetview",this._reset,this),M.ImageOverlay.prototype.onRemove.call(this,i)},_initImage(){let i=this._rawImage;this._url&&(i=M.DomUtil.create("img"),i.style.display="none",this.options.crossOrigin&&(i.crossOrigin=""),i.src=this._url,this._rawImage=i),M.DomUtil.addClass(i,"leaflet-image-layer");const s=this._image=M.DomUtil.create("div","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""));this._updateZIndex&&this._updateZIndex(),s.appendChild(i),s.onselectstart=M.Util.falseFn,s.onmousemove=M.Util.falseFn,i.onload=(function(){this._reset(),i.style.display="block",this.options.w=this._rawImage.width,this.options.h=this._rawImage.height,this.boundsRectBottomLeft=new M.Point(0,0),this.boundsRectTopRight=new M.Point(this.options.w,this.options.h),this.diagonalVector=this.boundsRectTopRight.subtract(this.boundsRectBottomLeft),this.fire("load")}).bind(this),i.alt=this.options.alt},_reset(){const i=this._image,s=this._map.latLngToLayerPoint(this._topLeft),n=this._map.latLngToLayerPoint(this._topRight),r=this._map.latLngToLayerPoint(this._bottomLeft),o=n.subtract(s).add(r),l=new M.Bounds([s,n,r,o]),f=l.getSize(),c=s.subtract(l.min),d=n.subtract(s),m=r.subtract(s),v=Math.atan2(d.y,d.x),p=Math.atan2(m.x,m.y);this.angle=((Math.abs(v)+Math.abs(p))/2*180).toFixed(2),this._bounds=new M.LatLngBounds(this._map.layerPointToLatLng(l.min),this._map.layerPointToLatLng(l.max)),M.DomUtil.setPosition(i,l.min),i.pxBounds=l,i.style.width=f.x+"px",i.style.height=f.y+"px";const y=this._rawImage.width,b=this._rawImage.height;if(!y||!b)return;const A=s.distanceTo(n)/y*Math.cos(v),P=s.distanceTo(r)/b*Math.cos(p);this._rawImage.style.transformOrigin="0 0",this._rawImage.style.transform="translate("+c.x+"px, "+c.y+"px)skew("+p+"rad, "+v+"rad) scale("+A+", "+P+") "},_animateZoom(i){const s=this._map.getZoomScale(i.zoom),r=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;M.DomUtil.setTransform(this._image,r,s)},reposition(){const i=this.topRightMarker.getLatLng(),s=this.bottomLeftMarker.getLatLng(),n=this.options.w,r=this.options.h,o=this.getCornerLatLng(new M.Point(0,r),s,i),l=this.getCornerLatLng(new M.Point(n,r),s,i),f=this.getCornerLatLng(new M.Point(0,0),s,i),c=this.getCornerLatLng(new M.Point(n,0),s,i);this.options.corners=[o,l,c,f],this._topLeft=new M.LatLng(o),this._topRight=new M.LatLng(l),this._bottomLeft=new M.LatLng(f),this._reset()},getCornerLatLng(i,s,n){const r=this.boundsRectBottomLeft,o=this.diagonalVector,l=i.subtract(r),f=this.getClockWiseRotate90DegreePoint(o),c=this.getDotProduction(o,l)/this.getDotProduction(o,o),d=-this.getDotProduction(f,l)/this.getDotProduction(f,f),m=new M.Projection.SphericalMercator.project(s),v=new M.Projection.SphericalMercator.project(n),p=m.add(v.subtract(m).multiplyBy(c)),y=this.getClockWiseRotate90DegreePoint(m.subtract(v)).multiplyBy(d),b=p.add(y);return new M.Projection.SphericalMercator.unproject(b)},setUrl(i){return this._url=i,this._rawImage&&(this._rawImage.src=i),this},getDotProduction(i,s){return i.x*s.x+i.y*s.y},getClockWiseRotate90DegreePoint(i){return new M.Point([i.y,-i.x])}}),Zn=M.Marker.extend({options:{fontSize:"12px",color:"#f00",fontShadowColor:"none",fontWeight:"normal",background:"rgba(0, 0, 0, 0)",minZoom:void 0,maxZoom:void 0},initialize(i,s,n={}){this._latlng=i,this._enabled=!1,this.options.id=n.id||"text_"+Utils.guid(),this.options.text=s||"",n=Object.assign(this.options,n),M.setOptions(this,n);const{id:r,fontSize:o,color:l,fontWeight:f,background:c,fontShadowColor:d}=this.options;this.options.icon=new M.DivIcon({html:`<span id=${r} style="padding:2px 4px;white-space:nowrap;font-weight:${f};font-size:${o};color:${l};background:${c};text-shadow:${d} 1px 0px 2px">${s||""}</span>`,className:"leaflet-text"})},setStyle(i){const s=document.getElementById(this.options.id),{text:n,color:r,fontSize:o,fontShadowColor:l,fontWeight:f}=i,c=i.background||"none";return s&&(r&&(this.options.color=r,s.style.color=r),f&&(this.options.fontWeight=f,s.style.fontWeight=f),o&&(this.options.fontSize=o,s.style.fontSize=o),c&&(this.options.background=c,s.style.background=c),n&&(this.options.text=n,s.textContent=n),l?(this.options.fontShadowColor=l,s.style["text-shadow"]=l+" 1px 0px 2px"):(this.options.fontShadowColor="none",s.style["text-shadow"]="none")),this},enableEdit(i){const{fontSize:s,color:n,text:r}=this.options;if(!this._enabled){this._enabled=!0;const o=new M.DivIcon({html:`<input type="text" id="text-input-icon" style="font-size:${s};color:${n};" value=${r}></input>`,className:"leaflet-text"});return this.setIcon(o),document.getElementById("text-input-icon").onblur=l=>{this.options.text=l.target.value,setTimeout(()=>{this.disableEdit(),i&&i(this)},100)},document.getElementById("text-input-icon").onkeydown=function(l){l.keyCode===13&&(this.options.text=l.target.value,this.blur(l))},this}},disableEdit(i){if(this._enabled){this._enabled=!1;const{id:s,color:n,fontSize:r,fontWeight:o,fontShadowColor:l}=this.options,f=new M.DivIcon({html:`<span id=${s} style="padding:2px 4px;white-space:nowrap;font-weight:${o};font-size:${r};color:${n};text-shadow:${l} 1px 2px 3px">${this.options.text}</span>`,className:"leaflet-text"});return this.setIcon(f),i&&i(this),this}}}),Fn=M.LayerGroup.extend({initialize(i){M.Util.setOptions(this,i),M.LayerGroup.prototype.initialize.call(this,i)},getRasterLayers(){const i={},s=n=>{if(n._layers&&n.getLayer)for(const r in n._layers){const o=n._layers[r];o._layers&&o.getLayer?s(o):i[o._leaflet_id]=o}else i[layer._leaflet_id]=layer};return s(this),i},removeRasterLayer(i){const s=function(n){if(n._layers&&n.getLayer&&n.getLayer(i)){const r=n.getLayer(i);n.removeLayer(r)}else if(n._layers)for(const r in n._layers){const o=n._layers[r];if(o._layers&&o.getLayer&&o.getLayer(i)){const l=o.getLayer(i);o.removeLayer(l)}else o._layers&&s(o)}};s(this)},getRasterTop(){const i=Object.values(this.getRasterLayers());return i.length?Math.max(...i.map(s=>s.options.zIndex))+1:null}});function Ku(i){const s=document.createElement("style"),n=document.head||document.documentElement;s.innerHTML=`
10
10
  .${i}-statusbar {
11
11
  display: flex;
12
12
  color: #fff;
@@ -23,4 +23,4 @@ northing meters`+i;var y=p/2,b=0,A=0,P,E,z,B,k;return y>0&&(P=1e5/Math.pow(10,y)
23
23
  }
24
24
  .${i}-statusbar-item + .${i}-statusbar-item {
25
25
  margin-left: 10px
26
- }`,n.appendChild(s)}(i=>{const s=Object.create(no)||{};return s.LANG=zi,s.BaseMap=M.Map.extend({options:{doubleClickZoom:!1,closePopupOnClick:!1,zoomControl:!1,attributionControl:!1,scaleControl:!0,statusBarControl:!0,minZoom:5,maxZoom:19,contextmenu:!0,center:[0,0],zoom:17},initialize(n,r={},o){var l;if(typeof n=="string"&&(n=document.querySelector("#"+n)),!n instanceof HTMLElement||!n.clientWidth||!n.clientHeight)throw new Error("地图容器不存在或元素尺寸为0");this.lang=typeof r.lang=="string"?r.lang:"zh_CN",this.clsPrefix=typeof r.clsPrefix=="string"?r.clsPrefix:"gis2d",Ku(this.clsPrefix),M.Util.setOptions(this,r),M.Control.Zoom.mergeOptions({position:((l=this.options.zoomControl)==null?void 0:l.position)||"topleft",zoomInTitle:zi[this.lang].zoomIn,zoomOutTitle:zi[this.lang].zoomOut}),M.Control.Attribution.mergeOptions({prefix:`<a href="http://www.${this.clsPrefix}.com" target="_blank">Guo.Yan</a>`}),M.Map.prototype.initialize.call(this,n,this.options),M.DomEvent.on(this._container,"click",f=>{var d;const c=this._container.querySelector(".add");c&&(c.style.display="none"),(d=this.contextmenu)==null||d.hide()},this),r.debug?(document.onselectstart=()=>r.debug.allowSelect,n.oncontextmenu=()=>r.debug.allowContextmenu,document.onkeydown=function(f){if(f&&f.keyCode===123)return r.debug.allowDevtool}):(document.onkeydown=function(f){if(f&&f.keyCode===123)return!1},n.oncontextmenu=()=>!1),i[o||"$m"]=this},getCursor(){return this.getContainer().style.cursor||"default"},setCursor(n="default"){const r=this.getContainer();["auto","pointer","crosshair","move","text","wait","help","grab","default"].includes(n)?r.style.cursor=n:r.style.cursor=typeof n=="string"?`url(${"./images/cursor/"+n+".cur"}), auto`:`url(${n}), auto`},flyTo(n,r=0,o={animate:!1}){n instanceof M.Marker?(n=n._latlng,M.Map.prototype.flyTo.call(this,n,r||this.getZoom(),o)):n instanceof M.Path||n instanceof M.FeatureGroup?(n=n.getBounds(),M.Map.prototype.flyToBounds.call(this,n,o)):M.Map.prototype.flyTo.call(this,n,r||this.getZoom(),o)}}),s.StatusBar=me,s.CRS.BaiDu=hs,s.WebMercatorTiledLayer=Rn,s.Knob=Vs,s.EagleMap=pe,s.LayerManager=Fn,s.ImageOverlay.Rotated=Dn,s.Text=Zn,s.VertexMarkers=Ve,s.Measurement=Ni,i.L=s})(window);function ls(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("未找到全局对象")}const us=function(i,s={}){us.installed||(ls().Gis=to)};ls().Vue&&us(ls().Vue);const Yu={install:us};ft.BaiDuCRS=hs,ft.Draw=Qs,ft.EagleMap=pe,ft.Knob=Vs,ft.LayerManager=Fn,ft.MeasureMent=Ni,ft.RotatedImageOverLayer=Dn,ft.StatusBar=me,ft.TextLayer=Zn,ft.VertexMarker=Ve,ft.WebMercatorTiledLayer=Rn,ft.default=Yu,Object.defineProperties(ft,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
26
+ }`,n.appendChild(s)}(i=>{const s=Object.create(no)||{};return s.LANG=zi,s.BaseMap=M.Map.extend({options:{doubleClickZoom:!1,closePopupOnClick:!1,zoomControl:!1,attributionControl:!1,scaleControl:!0,statusBarControl:!0,minZoom:5,maxZoom:19,contextmenu:!0,center:[0,0],zoom:17},initialize(n,r={},o){var l;if(typeof n=="string"&&(n=document.getElementById(n)),!n instanceof HTMLElement||!n.clientWidth||!n.clientHeight)throw new Error("地图容器不存在或元素尺寸为0");this.lang=typeof r.lang=="string"?r.lang:"zh_CN",this.clsPrefix=typeof r.clsPrefix=="string"?r.clsPrefix:"gis2d",Ku(this.clsPrefix),M.Util.setOptions(this,r),M.Control.Zoom.mergeOptions({position:((l=this.options.zoomControl)==null?void 0:l.position)||"topleft",zoomInTitle:zi[this.lang].zoomIn,zoomOutTitle:zi[this.lang].zoomOut}),M.Control.Attribution.mergeOptions({prefix:`<a href="http://www.${this.clsPrefix}.com" target="_blank">Guo.Yan</a>`}),M.Map.prototype.initialize.call(this,n,this.options),M.DomEvent.on(this._container,"click",f=>{var d;const c=this._container.querySelector(".add");c&&(c.style.display="none"),(d=this.contextmenu)==null||d.hide()},this),r.debug?(document.onselectstart=()=>r.debug.allowSelect,n.oncontextmenu=()=>r.debug.allowContextmenu,document.onkeydown=function(f){if(f&&f.keyCode===123)return r.debug.allowDevtool}):process.env.NODE_ENV!=="development"&&(document.onkeydown=function(f){if(f&&f.keyCode===123)return!1},n.oncontextmenu=()=>!1),i[o||"$m"]=this},getCursor(){return this.getContainer().style.cursor||"default"},setCursor(n="default"){const r=this.getContainer();["auto","pointer","crosshair","move","text","wait","help","grab","default"].includes(n)?r.style.cursor=`${n}`:r.style.cursor=typeof n=="string"?`url(${"./images/cursor/"+n+".cur"}), auto`:`url(${n}), auto`},flyTo(n,r=0,o={animate:!1}){n instanceof M.Marker?(n=n._latlng,M.Map.prototype.flyTo.call(this,n,r||this.getZoom(),o)):n instanceof M.Path||n instanceof M.FeatureGroup?(n=n.getBounds(),M.Map.prototype.flyToBounds.call(this,n,o)):M.Map.prototype.flyTo.call(this,n,r||this.getZoom(),o)}}),s.StatusBar=me,s.CRS.BaiDu=hs,s.WebMercatorTiledLayer=Rn,s.Knob=Vs,s.EagleMap=pe,s.LayerManager=Fn,s.ImageOverlay.Rotated=Dn,s.Text=Zn,s.VertexMarkers=Ve,s.Measurement=Ni,i.L=s})(window);function ls(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("未找到全局对象")}const us=function(i,s={}){us.installed||(ls().Gis=to)};ls().Vue&&us(ls().Vue);const Yu={install:us};ft.BaiDuCRS=hs,ft.Draw=Qs,ft.EagleMap=pe,ft.Knob=Vs,ft.LayerManager=Fn,ft.MeasureMent=Ni,ft.RotatedImageOverLayer=Dn,ft.StatusBar=me,ft.TextLayer=Zn,ft.VertexMarker=Ve,ft.WebMercatorTiledLayer=Rn,ft.default=Yu,Object.defineProperties(ft,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gis-leaflet-helper",
3
- "version": "2.1.22",
3
+ "version": "2.1.23",
4
4
  "author": "Guo.Yan <luv02@vip.qq.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -28,7 +28,7 @@
28
28
  "url": ""
29
29
  },
30
30
  "dependencies": {
31
- "gis-common": "^4.2.13",
31
+ "gis-common": "^4.2.15",
32
32
  "leaflet": "^1.8.0",
33
33
  "proj4leaflet": "^1.0.2",
34
34
  "vue": "^3.2.16"