mars2d-esri 3.1.4 → 3.1.5

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  <p align="center">
3
- <img src="https://cdn.jsdelivr.net/gh/muyao1987/cdn/mars2d.cn/logo.png" width="300px" />
3
+ <img src="http://mars2d.cn/logo.png" width="300px" />
4
4
  </p>
5
5
 
6
6
  <p align="center">🌎 一款免费的二维地图客户端开发平台</p>
@@ -3,4 +3,4 @@
3
3
  * @terraformer/arcgis - v2.0.7 - MIT
4
4
  * Copyright (c) 2012-2021 Environmental Systems Research Institute, Inc.
5
5
  * Thu Jul 22 2021 13:58:30 GMT-0700 (Pacific Daylight Time)
6
- */function T(t,i){return O(t,i)}function N(t,i){return P(t,i)}function E(t){if("NaN"!==t.xmin&&"NaN"!==t.ymin&&"NaN"!==t.xmax&&"NaN"!==t.ymax){var e=i.latLng(t.ymin,t.xmin),s=i.latLng(t.ymax,t.xmax);return i.latLngBounds(e,s)}return null}function R(t){return{xmin:(t=i.latLngBounds(t)).getSouthWest().lng,ymin:t.getSouthWest().lat,xmax:t.getNorthEast().lng,ymax:t.getNorthEast().lat,spatialReference:{wkid:4326}}}var q=/^(OBJECTID|FID|OID|ID)$/i;function F(t){var i;if(t.objectIdFieldName)i=t.objectIdFieldName;else if(t.fields){for(var e=0;e<=t.fields.length-1;e++)if("esriFieldTypeOID"===t.fields[e].type){i=t.fields[e].name;break}if(!i)for(e=0;e<=t.fields.length-1;e++)if(t.fields[e].name.match(q)){i=t.fields[e].name;break}}return i}function G(t){for(var i in t.attributes)if(i.match(q))return i}function j(t,i){var e,s=t.features||t.results,a=s&&s.length;e=i||F(t);var r={type:"FeatureCollection",features:[]};if(a)for(var n=s.length-1;n>=0;n--){var o=N(s[n],e||G(s[n]));r.features.push(o)}return r}function U(t){return"/"!==(t=i.Util.trim(t))[t.length-1]&&(t+="/"),t}function z(t){if(-1!==t.url.indexOf("?")){t.requestParams=t.requestParams||{};var i=t.url.substring(t.url.indexOf("?")+1);t.url=t.url.split("?")[0],t.requestParams=JSON.parse('{"'+decodeURI(i).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}return t.url=U(t.url.split("?")[0]),t}function B(t){return/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.test(t)}function D(t){var i;switch(t){case"Point":i="esriGeometryPoint";break;case"MultiPoint":i="esriGeometryMultipoint";break;case"LineString":case"MultiLineString":i="esriGeometryPolyline";break;case"Polygon":case"MultiPolygon":i="esriGeometryPolygon"}return i}function Z(t){return t.getSize().x-c.attributionWidthOffset+"px"}function W(t){if(t.attributionControl){if(t.attributionControl._esriAttributionLayerCount||(t.attributionControl._esriAttributionLayerCount=0),0===t.attributionControl._esriAttributionLayerCount){if(!t.attributionControl._esriAttributionAddedOnce){var e=document.createElement("style");e.type="text/css",e.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}",document.getElementsByTagName("head")[0].appendChild(e);var s=document.createElement("style");s.type="text/css",s.innerHTML=".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: "+Z(t)+";}",document.getElementsByTagName("head")[0].appendChild(s),t.on("resize",(function(i){t.attributionControl&&(t.attributionControl._container.style.maxWidth=Z(i.target))})),t.attributionControl._esriAttributionAddedOnce=!0}t.attributionControl.setPrefix(k+' | Powered by <a href="https://www.esri.com">Esri</a>'),i.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution:hover"),i.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution")}t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount+1}}function J(t){t.attributionControl&&(t.attributionControl._esriAttributionLayerCount&&1===t.attributionControl._esriAttributionLayerCount&&(t.attributionControl.setPrefix(k),i.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution:hover"),i.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution")),t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount-1)}function Q(t){var e={geometry:null,geometryType:null};return t instanceof i.LatLngBounds?(e.geometry=R(t),e.geometryType="esriGeometryEnvelope",e):(t.getLatLng&&(t=t.getLatLng()),t instanceof i.LatLng&&(t={type:"Point",coordinates:[t.lng,t.lat]}),t instanceof i.GeoJSON&&(t=t.getLayers()[0].feature.geometry,e.geometry=T(t),e.geometryType=D(t.type)),t.toGeoJSON&&(t=t.toGeoJSON()),"Feature"===t.type&&(t=t.geometry),"Point"===t.type||"LineString"===t.type||"Polygon"===t.type||"MultiPolygon"===t.type?(e.geometry=T(t),e.geometryType=D(t.type),e):void v("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))}function V(t,e){u.cors&&g(t,{},i.Util.bind((function(t,s){if(!t){e._esriAttributions=[];for(var a=0;a<s.contributors.length;a++)for(var r=s.contributors[a],n=0;n<r.coverageAreas.length;n++){var o=r.coverageAreas[n],h=i.latLng(o.bbox[0],o.bbox[1]),l=i.latLng(o.bbox[2],o.bbox[3]);e._esriAttributions.push({attribution:r.attribution,score:o.score,bounds:i.latLngBounds(h,l),minZoom:o.zoomMin,maxZoom:o.zoomMax})}e._esriAttributions.sort((function(t,i){return i.score-t.score})),H({target:e})}}),this))}function H(t){var e=t.target,s=e._esriAttributions;if(e&&e.attributionControl){var a=e.attributionControl._container.querySelector(".esri-dynamic-attribution");if(a&&s){for(var r="",n=e.getBounds(),o=i.latLngBounds(n.getSouthWest().wrap(),n.getNorthEast().wrap()),h=e.getZoom(),l=0;l<s.length;l++){var u=s[l],c=u.attribution;!r.match(c)&&u.bounds.intersects(o)&&h>=u.minZoom&&h<=u.maxZoom&&(r+=", "+c)}r=r.substr(2),a.innerHTML=r,a.style.maxWidth=Z(e),e.fire("attributionupdated",{attribution:r})}}}var X={warn:v,cleanUrl:U,getUrlParams:z,isArcgisOnline:B,geojsonTypeToArcGIS:D,responseToFeatureCollection:j,geojsonToArcGIS:T,arcgisToGeoJSON:N,boundsToExtent:R,extentToBounds:E,calcAttributionWidth:Z,setEsriAttribution:W,_setGeometry:Q,_getAttributionData:V,_updateMapAttribution:H,_findIdAttributeFromFeature:G,_findIdAttributeFromResponse:F},K=i.Class.extend({options:{proxy:!1,useCors:h},generateSetter:function(t,e){return i.Util.bind((function(i){return this.params[t]=i,this}),e)},initialize:function(t){if(t.request&&t.options?(this._service=t,i.Util.setOptions(this,t.options)):(i.Util.setOptions(this,t),this.options.url=U(t.url)),this.params=i.Util.extend({},this.params||{}),this.setters)for(var e in this.setters){var s=this.setters[e];this[e]=this.generateSetter(s,this)}},token:function(t){return this._service?this._service.authenticate(t):this.params.token=t,this},apikey:function(t){return this.token(t)},format:function(t){return this.params.returnUnformattedValues=!t,this},request:function(t,e){return this.options.requestParams&&i.Util.extend(this.params,this.options.requestParams),this._service?this._service.request(this.path,this.params,t,e):this._request("request",this.path,this.params,t,e)},_request:function(t,i,e,s,a){var r=this.options.proxy?this.options.proxy+"?"+this.options.url+i:this.options.url+i;return"get"!==t&&"request"!==t||this.options.useCors?b[t](r,e,s,a):b.get.JSONP(r,e,s,a)}});var Y=K.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",returnM:"returnM",transform:"datumTransformation",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSR:4326,outFields:"*"},within:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelWithin",this},crosses:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelCrosses",this},touches:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelTouches",this},overlaps:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelOverlaps",this},bboxIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelEnvelopeIntersects",this},indexIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIndexIntersects",this},nearby:function(t,e){return t=i.latLng(t),this.params.geometry=[t.lng,t.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=e,this.params.inSR=4326,this},where:function(t){return this.params.where=t,this},between:function(t,i){return this.params.time=[t.valueOf(),i.valueOf()],this},simplify:function(t,i){var e=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=e/t.getSize().y*i,this},orderBy:function(t,i){return i=i||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[t,i].join(" "),this},run:function(t,i){return this._cleanParams(),this.options.isModern||B(this.options.url)&&void 0===this.options.isModern?(this.params.f="geojson",this.request((function(e,s){this._trapSQLerrors(e),t.call(i,e,s,s)}),this)):this.request((function(e,s){this._trapSQLerrors(e),t.call(i,e,s&&j(s),s)}),this)},count:function(t,i){return this._cleanParams(),this.params.returnCountOnly=!0,this.request((function(i,e){t.call(this,i,e&&e.count,e)}),i)},ids:function(t,i){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request((function(i,e){t.call(this,i,e&&e.objectIds,e)}),i)},bounds:function(t,i){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request((function(e,s){s&&s.extent&&E(s.extent)?t.call(i,e,E(s.extent),s):(e={message:"Invalid Bounds"},t.call(i,e,null,s))}),i)},distinct:function(){return this.params.returnGeometry=!1,this.params.returnDistinctValues=!0,this},pixelSize:function(t){var e=i.point(t);return this.params.pixelSize=[e.x,e.y],this},layer:function(t){return this.path=t+"/query",this},_trapSQLerrors:function(t){t&&"400"===t.code&&v("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometryParams:function(t){this.params.inSR=4326;var i=Q(t);this.params.geometry=i.geometry,this.params.geometryType=i.geometryType}});function $(t){return new Y(t)}var tt=K.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(t,i){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,i].join(":"),this},simplify:function(t,i){var e=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=e/t.getSize().y*i,this},run:function(t,i){return this.request((function(e,s){t.call(i,e,s&&j(s),s)}),i)}});function it(t){return new tt(t)}var et=K.extend({path:"identify",between:function(t,i){return this.params.time=[t.valueOf(),i.valueOf()],this}});var st=et.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(t){var i=R(t.getBounds()),e=t.getSize();return this.params.imageDisplay=[e.x,e.y,96],this.params.mapExtent=[i.xmin,i.ymin,i.xmax,i.ymax],this},at:function(t){return 2===t.length&&(t=i.latLng(t)),this._setGeometryParams(t),this},layerDef:function(t,i){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,i].join(":"),this},simplify:function(t,i){var e=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=e/t.getSize().y*i,this},run:function(t,i){return this.request((function(e,s){if(e)t.call(i,e,void 0,s);else{var a=j(s);s.results=s.results.reverse();for(var r=0;r<a.features.length;r++){a.features[r].layerId=s.results[r].layerId}t.call(i,void 0,a,s)}}))},_setGeometryParams:function(t){var i=Q(t);this.params.geometry=i.geometry,this.params.geometryType=i.geometryType}});function at(t){return new st(t)}var rt=et.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(t){return t=i.latLng(t),this.params.geometry=JSON.stringify({x:t.lng,y:t.lat,spatialReference:{wkid:4326}}),this.params.geometryType="esriGeometryPoint",this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(t,i){return this.request((function(e,s){t.call(i,e,s&&this._responseToGeoJSON(s),s)}),this)},_responseToGeoJSON:function(t){var i=t.location,e=t.catalogItems,s=t.catalogItemVisibilities,a={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[i.x,i.y]},crs:{type:"EPSG",properties:{code:i.spatialReference.wkid}},properties:{OBJECTID:t.objectId,name:t.name,value:t.value},id:t.objectId}};if(t.properties&&t.properties.Values&&(a.pixel.properties.values=t.properties.Values),e&&e.features&&(a.catalogItems=j(e),s&&s.length===a.catalogItems.features.length))for(var r=s.length-1;r>=0;r--)a.catalogItems.features[r].properties.catalogItemVisibility=s[r];return a}});function nt(t){return new rt(t)}var ot=i.Evented.extend({options:{proxy:!1,useCors:h,timeout:0},initialize:function(t){t=t||{},this._requestQueue=[],this._authenticating=!1,i.Util.setOptions(this,t),this.options.url=U(this.options.url)},get:function(t,i,e,s){return this._request("get",t,i,e,s)},post:function(t,i,e,s){return this._request("post",t,i,e,s)},request:function(t,i,e,s){return this._request("request",t,i,e,s)},metadata:function(t,i){return this._request("get","",{},t,i)},authenticate:function(t){return this._authenticating=!1,this.options.token=t,this._runQueue(),this},getTimeout:function(){return this.options.timeout},setTimeout:function(t){this.options.timeout=t},_request:function(t,e,s,a,r){this.fire("requeststart",{url:this.options.url+e,params:s,method:t},!0);var n=this._createServiceCallback(t,e,s,a,r);if(this.options.token&&(s.token=this.options.token),this.options.requestParams&&i.Util.extend(s,this.options.requestParams),!this._authenticating){var o=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?b[t](o,s,n,r):b.get.JSONP(o,s,n,r)}this._requestQueue.push([t,e,s,a,r])},_createServiceCallback:function(t,e,s,a,r){return i.Util.bind((function(n,o){!n||499!==n.code&&498!==n.code||(this._authenticating=!0,this._requestQueue.push([t,e,s,a,r]),this.fire("authenticationrequired",{authenticate:i.Util.bind(this.authenticate,this)},!0),n.authenticate=i.Util.bind(this.authenticate,this)),a.call(r,n,o),n?this.fire("requesterror",{url:this.options.url+e,params:s,message:n.message,code:n.code,method:t},!0):this.fire("requestsuccess",{url:this.options.url+e,params:s,response:o,method:t},!0),this.fire("requestend",{url:this.options.url+e,params:s,method:t},!0)}),this)},_runQueue:function(){for(var t=this._requestQueue.length-1;t>=0;t--){var i=this._requestQueue[t];this[i.shift()].apply(this,i)}this._requestQueue=[]}});var ht=ot.extend({identify:function(){return at(this)},find:function(){return it(this)},query:function(){return $(this)}});function lt(t){return new ht(t)}var ut=ot.extend({query:function(){return $(this)},identify:function(){return nt(this)}});function ct(t){return new ut(t)}var pt=ot.extend({options:{idAttribute:"OBJECTID"},query:function(){return $(this)},addFeature:function(t,i,e){this.addFeatures(t,i,e)},addFeatures:function(t,i,e){for(var s=t.features?t.features:[t],a=s.length-1;a>=0;a--)delete s[a].id;return t=T(t),t=s.length>1?t:[t],this.post("addFeatures",{features:t},(function(t,s){var a=s&&s.addResults?s.addResults.length>1?s.addResults:s.addResults[0]:void 0;i&&i.call(e,t||s.addResults[0].error,a)}),e)},updateFeature:function(t,i,e){this.updateFeatures(t,i,e)},updateFeatures:function(t,i,e){var s=t.features?t.features:[t];return t=T(t,this.options.idAttribute),t=s.length>1?t:[t],this.post("updateFeatures",{features:t},(function(t,s){var a=s&&s.updateResults?s.updateResults.length>1?s.updateResults:s.updateResults[0]:void 0;i&&i.call(e,t||s.updateResults[0].error,a)}),e)},deleteFeature:function(t,i,e){this.deleteFeatures(t,i,e)},deleteFeatures:function(t,i,e){return this.post("deleteFeatures",{objectIds:t},(function(t,s){var a=s&&s.deleteResults?s.deleteResults.length>1?s.deleteResults:s.deleteResults[0]:void 0;i&&i.call(e,t||s.deleteResults[0].error,a)}),e)}});function ft(t){return new pt(t)}var dt="https:"!==window.location.protocol?"http:":"https:",mt=i.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map"}},Topographic:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map"}},Oceans:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap"}},OceansLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},NationalGeographic:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},GrayLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}},ImageryLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},ShadedRelief:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS"}},ShadedReliefLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:12,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS, NOAA"}},TerrainLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"USGS, National Geographic Society, i-cubed"}},ImageryClarity:{urlTemplate:dt+"//clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community"}},Physical:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:8,subdomains:["server","services"],attribution:"U.S. National Park Service"}},ImageryFirefly:{urlTemplate:dt+"//fly.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Firefly/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}}}},initialize:function(t,e){var s;if("object"==typeof t&&t.urlTemplate&&t.options)s=t;else{if("string"!=typeof t||!mt.TILES[t])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Physical", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ImageryClarity", "ImageryFirefly", ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"');s=mt.TILES[t]}var a=i.Util.extend(s.options,e);i.Util.setOptions(this,a),this.options.ignoreDeprecationWarning||console.warn("WARNING: L.esri.BasemapLayer uses data services that are in mature support and are not being updated. Please use L.esri.Vector.vectorBasemapLayer instead. More info: https://esriurl.com/esri-leaflet-basemap"),this.options.token&&-1===s.urlTemplate.indexOf("token=")&&(s.urlTemplate+="?token="+this.options.token),this.options.proxy&&(s.urlTemplate=this.options.proxy+"?"+s.urlTemplate),i.TileLayer.prototype.initialize.call(this,s.urlTemplate,a)},onAdd:function(t){W(t),"esri-labels"===this.options.pane&&this._initPane(),this.options.attributionUrl&&V((this.options.proxy?this.options.proxy+"?":"")+this.options.attributionUrl,t),t.on("moveend",H),i.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){J(t),t.off("moveend",H),i.TileLayer.prototype.onRemove.call(this,t)},_initPane:function(){if(!this._map.getPane(this.options.pane)){var t=this._map.createPane(this.options.pane);t.style.pointerEvents="none",t.style.zIndex=500}},getAttribution:function(){if(this.options.attribution)var t='<span class="esri-dynamic-attribution">'+this.options.attribution+"</span>";return t}});var yt=i.TileLayer.extend({options:{zoomOffsetAllowance:.1,errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEABAMAAACuXLVVAAAAA1BMVEUzNDVszlHHAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAAAAAAAAAB6mUWpAAAADZJREFUeJztwQEBAAAAgiD/r25IQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7waBAAABw08RwAAAAABJRU5ErkJggg=="},statics:{MercatorZoomLevels:{0:156543.033928,1:78271.5169639999,2:39135.7584820001,3:19567.8792409999,4:9783.93962049996,5:4891.96981024998,6:2445.98490512499,7:1222.99245256249,8:611.49622628138,9:305.748113140558,10:152.874056570411,11:76.4370282850732,12:38.2185141425366,13:19.1092570712683,14:9.55462853563415,15:4.77731426794937,16:2.38865713397468,17:1.19432856685505,18:.597164283559817,19:.298582141647617,20:.14929107082381,21:.07464553541191,22:.0373227677059525,23:.0186613838529763}},initialize:function(t){t=z(t=i.Util.setOptions(this,t)),this.tileUrl=(t.proxy?t.proxy+"?":"")+t.url+"tile/{z}/{y}/{x}"+(t.requestParams&&Object.keys(t.requestParams).length>0?i.Util.getParamString(t.requestParams):""),-1!==t.url.indexOf("{s}")&&t.subdomains&&(t.url=t.url.replace("{s}",t.subdomains[0])),this.service=lt(t),this.service.addEventParent(this),new RegExp(/tiles.arcgis(online)?\.com/g).test(t.url)&&(this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}"),t.subdomains=["1","2","3","4"]),this.options.token&&(this.tileUrl+="?token="+this.options.token),i.TileLayer.prototype.initialize.call(this,this.tileUrl,t)},getTileUrl:function(t){var e=this._getZoomForUrl();return i.Util.template(this.tileUrl,i.Util.extend({s:this._getSubdomain(t),x:t.x,y:t.y,z:this._lodMap&&this._lodMap[e]?this._lodMap[e]:e},this.options))},createTile:function(t,e){var s=document.createElement("img");return i.DomEvent.on(s,"load",i.Util.bind(this._tileOnLoad,this,e,s)),i.DomEvent.on(s,"error",i.Util.bind(this._tileOnError,this,e,s)),this.options.crossOrigin&&(s.crossOrigin=""),s.alt="",!this._lodMap||this._lodMap&&this._lodMap[this._getZoomForUrl()]?s.src=this.getTileUrl(t):this.once("lodmap",(function(){s.src=this.getTileUrl(t)}),this),s},onAdd:function(t){W(t),this._lodMap||this.metadata((function(e,s){if(!e&&s.spatialReference){var a=s.spatialReference.latestWkid||s.spatialReference.wkid;if(!this.options.attribution&&t.attributionControl&&s.copyrightText&&(this.options.attribution=s.copyrightText,t.attributionControl.addAttribution(this.getAttribution())),t.options.crs!==i.CRS.EPSG3857||102100!==a&&3857!==a)t.options.crs&&t.options.crs.code&&t.options.crs.code.indexOf(a)>-1||v("L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html");else{this._lodMap={};for(var r=s.tileInfo.lods,n=yt.MercatorZoomLevels,o=0;o<r.length;o++){var h=r[o];for(var l in n){var u=n[l];if(this._withinPercentage(h.resolution,u,this.options.zoomOffsetAllowance)){this._lodMap[l]=h.level;break}}}this.fire("lodmap")}}}),this),i.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){J(t),i.TileLayer.prototype.onRemove.call(this,t)},metadata:function(t,i){return this.service.metadata(t,i),this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(t){var i="?token="+t;return this.tileUrl=this.options.token?this.tileUrl.replace(/\?token=(.+)/g,i):this.tileUrl+i,this.options.token=t,this.service.authenticate(t),this},_withinPercentage:function(t,i,e){return Math.abs(t/i-1)<e}});var gt=i.ImageOverlay.extend({onAdd:function(t){this._topLeft=t.getPixelBounds().min,i.ImageOverlay.prototype.onAdd.call(this,t)},_reset:function(){this._map.options.crs===i.CRS.EPSG3857?i.ImageOverlay.prototype._reset.call(this):i.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}),_t=i.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:h,attribution:null,interactive:!1,alt:""},onAdd:function(t){W(t),this.options.zIndex&&(this.options.position=null),this._update=i.Util.throttle(this._update,this.options.updateInterval,this),t.on("moveend",this._update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?t.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this._update(),this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this.metadata((function(i,e){!i&&!this.options.attribution&&t.attributionControl&&e.copyrightText&&(this.options.attribution=e.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}),this)},onRemove:function(t){J(t),this._currentImage&&this._map.removeLayer(this._currentImage),this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._map.off("moveend",this._update,this)},bindPopup:function(t,e){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=i.popup(e),this._popupFunction=t,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},bringToFront:function(){return this.options.position="front",this._currentImage&&(this._currentImage.bringToFront(),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this.options.position="back",this._currentImage&&(this._currentImage.bringToBack(),this._setAutoZIndex(Math.min)),this},setZIndex:function(t){return this.options.zIndex=t,this._currentImage&&this._currentImage.setZIndex(t),this},_setAutoZIndex:function(t){if(this._currentImage){for(var i,e=this._currentImage.getPane().children,s=-t(-1/0,1/0),a=0,r=e.length;a<r;a++)i=e[a].style.zIndex,e[a]!==this._currentImage._image&&i&&(s=t(s,+i));isFinite(s)&&(this.options.zIndex=s+t(-1,1),this.setZIndex(this.options.zIndex))}},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(t){return this.options.opacity=t,this._currentImage&&this._currentImage.setOpacity(t),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,i){return this.options.from=t,this.options.to=i,this._update(),this},metadata:function(t,i){return this.service.metadata(t,i),this},authenticate:function(t){return this.service.authenticate(t),this},redraw:function(){this._update()},_renderImage:function(t,i,e){if(this._map){if(e&&(t="data:"+e+";base64,"+t),!t)return;var s=new gt(t,i,{opacity:0,crossOrigin:this.options.withCredentials?"use-credentials":this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map),a=function(t){if(s.off("error",a,this),this._map){var e=t.target,r=this._currentImage;e._bounds.equals(i)&&e._bounds.equals(this._map.getBounds())?(this._currentImage=e,"front"===this.options.position?this.bringToFront():"back"===this.options.position&&this.bringToBack(),this.options.zIndex&&this.setZIndex(this.options.zIndex),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),r&&this._map&&this._map.removeLayer(r),r&&r._map&&r._map.removeLayer(r)):this._map.removeLayer(e)}this.fire("load",{bounds:i})};s.once("error",(function(){this._map.removeLayer(s),this.fire("error"),s.off("load",a,this)}),this),s.once("load",a,this)}},_update:function(){if(this._map){var t=this._map.getZoom(),e=this._map.getBounds();if(!(this._animatingZoom||this._map._panTransition&&this._map._panTransition._inProgress))if(t>this.options.maxZoom||t<this.options.minZoom)this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null);else{var s=this._buildExportParams();i.Util.extend(s,this.options.requestParams),s?(this._requestExport(s,e),this.fire("loading",{bounds:e})):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)}}},_renderPopup:function(t,e,s,a){if(t=i.latLng(t),this._shouldRenderPopup&&this._lastClick.equals(t)){var r=this._popupFunction(e,s,a);r&&this._popup.setLatLng(t).setContent(r).openOn(this._map)}},_resetPopupState:function(t){this._shouldRenderPopup=!1,this._lastClick=t.latlng},_calculateBbox:function(){var t=this._map.getPixelBounds(),e=this._map.unproject(t.getBottomLeft()),s=this._map.unproject(t.getTopRight()),a=this._map.options.crs.project(s),r=this._map.options.crs.project(e),n=i.bounds(a,r);return[n.getBottomLeft().x,n.getBottomLeft().y,n.getTopRight().x,n.getTopRight().y].join(",")},_calculateImageSize:function(){var t=this._map.getPixelBounds(),i=this._map.getSize(),e=this._map.unproject(t.getBottomLeft()),s=this._map.unproject(t.getTopRight()),a=this._map.latLngToLayerPoint(s).y,r=this._map.latLngToLayerPoint(e).y;return(a>0||r<i.y)&&(i.y=r-a),i.x+","+i.y}}),Mt=_t.extend({options:{updateInterval:150,format:"jpgpng",transparent:!0,f:"image"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(t){t=z(t),this.service=ct(t),this.service.addEventParent(this),i.Util.setOptions(this,t)},setPixelType:function(t){return this.options.pixelType=t,this._update(),this},getPixelType:function(){return this.options.pixelType},setBandIds:function(t){return i.Util.isArray(t)?this.options.bandIds=t.join(","):this.options.bandIds=t.toString(),this._update(),this},getBandIds:function(){return this.options.bandIds},setNoData:function(t,e){return i.Util.isArray(t)?this.options.noData=t.join(","):this.options.noData=t.toString(),e&&(this.options.noDataInterpretation=e),this._update(),this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(t){this.options.renderingRule=t,this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(t){this.options.mosaicRule=t,this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(t){var e=i.Util.bind((function(e,s,a){e||setTimeout(i.Util.bind((function(){this._renderPopup(t.latlng,e,s,a)}),this),300)}),this),s=this.identify().at(t.latlng);this.options.mosaicRule&&s.setMosaicRule(this.options.mosaicRule),s.run(e),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),i={bbox:this._calculateBbox(),size:this._calculateImageSize(),format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};return this.options.from&&this.options.to&&(i.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.options.pixelType&&(i.pixelType=this.options.pixelType),this.options.interpolation&&(i.interpolation=this.options.interpolation),this.options.compressionQuality&&(i.compressionQuality=this.options.compressionQuality),this.options.bandIds&&(i.bandIds=this.options.bandIds),(0===this.options.noData||this.options.noData)&&(i.noData=this.options.noData),this.options.noDataInterpretation&&(i.noDataInterpretation=this.options.noDataInterpretation),this.service.options.token&&(i.token=this.service.options.token),this.options.renderingRule&&(i.renderingRule=JSON.stringify(this.options.renderingRule)),this.options.mosaicRule&&(i.mosaicRule=JSON.stringify(this.options.mosaicRule)),i},_requestExport:function(t,e){if("json"===this.options.f)this.service.request("exportImage",t,(function(t,i){t||(this.options.token&&(i.href+="?token="+this.options.token),this.options.proxy&&(i.href=this.options.proxy+"?"+i.href),this._renderImage(i.href,e))}),this);else{t.f="image";var s=this.options.url+"exportImage"+i.Util.getParamString(t);this.options.proxy&&(s=this.options.proxy+"?"+s),this._renderImage(s,e)}}});var vt=_t.extend({options:{updateInterval:150,layers:!1,layerDefs:!1,timeOptions:!1,format:"png32",transparent:!0,f:"json"},initialize:function(t){t=z(t),this.service=lt(t),this.service.addEventParent(this),i.Util.setOptions(this,t)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(t){return this.options.dynamicLayers=t,this._update(),this},getLayers:function(){return this.options.layers},setLayers:function(t){return this.options.layers=t,this._update(),this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(t){return this.options.layerDefs=t,this._update(),this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(t){return this.options.timeOptions=t,this._update(),this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(t){var e,s=i.Util.bind((function(e,s,a){e||setTimeout(i.Util.bind((function(){this._renderPopup(t.latlng,e,s,a)}),this),300)}),this);if((e=this.options.popup?this.options.popup.on(this._map).at(t.latlng):this.identify().on(this._map).at(t.latlng)).params.maxAllowableOffset||e.simplify(this._map,.5),this.options.popup&&this.options.popup.params&&this.options.popup.params.layers||(this.options.layers?e.layers("visible:"+this.options.layers.join(",")):e.layers("visible")),this.options.layerDefs&&"string"!=typeof this.options.layerDefs&&!e.params.layerDefs)for(var a in this.options.layerDefs)this.options.layerDefs.hasOwnProperty(a)&&e.layerDef(a,this.options.layerDefs[a]);e.run(s),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),i={bbox:this._calculateBbox(),size:this._calculateImageSize(),dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};if(this.options.dynamicLayers&&(i.dynamicLayers=this.options.dynamicLayers),this.options.layers){if(0===this.options.layers.length)return;i.layers="show:"+this.options.layers.join(",")}return this.options.layerDefs&&(i.layerDefs="string"==typeof this.options.layerDefs?this.options.layerDefs:JSON.stringify(this.options.layerDefs)),this.options.timeOptions&&(i.timeOptions=JSON.stringify(this.options.timeOptions)),this.options.from&&this.options.to&&(i.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.service.options.token&&(i.token=this.service.options.token),this.options.proxy&&(i.proxy=this.options.proxy),this.options.disableCache&&(i._ts=Date.now()),i},_requestExport:function(t,e){if("json"===this.options.f)this.service.request("export",t,(function(t,i){t||(this.options.token&&i.href&&(i.href+="?token="+this.options.token),this.options.proxy&&i.href&&(i.href=this.options.proxy+"?"+i.href),i.href?this._renderImage(i.href,e):this._renderImage(i.imageData,e,i.contentType))}),this);else{t.f="image";var s=this.options.url+"export"+i.Util.getParamString(t);this.options.proxy&&(s=this.options.proxy+"?"+s),this._renderImage(s,e)}}});var bt=i.Layer.extend({options:{cellSize:512,updateWhenIdle:i.Browser.mobile,updateInterval:150,noWrap:!1,keepBuffer:1.5},initialize:function(t){i.Util.setOptions(this,t)},onAdd:function(t){this._cells={},this._activeCells={},this._resetView(),this._update()},onRemove:function(t){this._removeAllCells(),this._cellZoom=void 0},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllCells(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=i.Util.throttle(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),t},createCell:function(){return document.createElement("div")},removeCell:function(){},reuseCell:function(){},cellLeave:function(){},cellEnter:function(){},getCellSize:function(){var t=this.options.cellSize;return t instanceof i.Point?t:new i.Point(t,t)},_pruneCells:function(){if(this._map){var t,i;for(t in this._cells)(i=this._cells[t]).retain=i.current;for(t in this._cells)if((i=this._cells[t]).current&&!i.active){var e=i.coords;this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2)}for(t in this._cells)this._cells[t].retain||this._removeCell(t)}},_removeAllCells:function(){for(var t in this._cells)this._removeCell(t)},_invalidateAll:function(){this._removeAllCells(),this._cellZoom=void 0},_retainParent:function(t,e,s,a){var r=Math.floor(t/2),n=Math.floor(e/2),o=s-1,h=new i.Point(+r,+n);h.z=+o;var l=this._cellCoordsToKey(h),u=this._cells[l];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),o>a&&this._retainParent(r,n,o,a))},_retainChildren:function(t,e,s,a){for(var r=2*t;r<2*t+2;r++)for(var n=2*e;n<2*e+2;n++){var o=new i.Point(r,n);o.z=s+1;var h=this._cellCoordsToKey(o),l=this._cells[h];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),s+1<a&&this._retainChildren(r,n,s+1,a))}},_resetView:function(t){var i=t&&(t.pinch||t.flyTo);i||this._setView(this._map.getCenter(),this._map.getZoom(),i,i)},_setView:function(t,i,e,s){var a=Math.round(i);s||(this._cellZoom=a,this._abortLoading&&this._abortLoading(),this._resetGrid(),void 0!==a&&this._update(t),e||this._pruneCells(),this._noPrune=!!e)},_resetGrid:function(){var t=this._map,i=t.options.crs,e=this._cellSize=this.getCellSize(),s=this._cellZoom,a=this._map.getPixelWorldBounds(this._cellZoom);a&&(this._globalCellRange=this._pxBoundsToCellRange(a)),this._wrapX=i.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,i.wrapLng[0]],s).x/e.x),Math.ceil(t.project([0,i.wrapLng[1]],s).x/e.y)],this._wrapY=i.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([i.wrapLat[0],0],s).y/e.x),Math.ceil(t.project([i.wrapLat[1],0],s).y/e.y)]},_onMoveEnd:function(t){t&&(t.pinch||t.flyTo)||!this._map||this._map._animatingZoom||this._update()},_getCelldPixelBounds:function(t){var e=this._map,s=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),a=e.getZoomScale(s,this._cellZoom),r=e.project(t,this._cellZoom).floor(),n=e.getSize().divideBy(2*a);return new i.Bounds(r.subtract(n),r.add(n))},_update:function(t){var e=this._map;if(e){var s=Math.round(e.getZoom());void 0===t&&(t=e.getCenter());var a=this._getCelldPixelBounds(t),r=this._pxBoundsToCellRange(a),n=r.getCenter(),o=[],h=this.options.keepBuffer,l=new i.Bounds(r.getBottomLeft().subtract([h,-h]),r.getTopRight().add([h,-h]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of cells");for(var u in this._cells){var c=this._cells[u].coords;c.z===this._cellZoom&&l.contains(new i.Point(c.x,c.y))||(this._cells[u].current=!1)}if(Math.abs(s-this._cellZoom)>1)this._setView(t,s);else{for(var p=r.min.y;p<=r.max.y;p++)for(var f=r.min.x;f<=r.max.x;f++){var d=new i.Point(f,p);if(d.z=this._cellZoom,this._isValidCell(d)){var m=this._cells[this._cellCoordsToKey(d)];m?m.current=!0:o.push(d)}}if(o.sort((function(t,i){return t.distanceTo(n)-i.distanceTo(n)})),0!==o.length)for(this._loading||(this._loading=!0),f=0;f<o.length;f++){var y=this._cellCoordsToKey(o[f]),g=this._keyToCellCoords(y);this._activeCells[g]?this._reuseCell(o[f]):this._createCell(o[f])}}}},_isValidCell:function(t){var e=this._map.options.crs;if(!e.infinite){var s=this._globalCellRange;if(!e.wrapLng&&(t.x<s.min.x||t.x>s.max.x)||!e.wrapLat&&(t.y<s.min.y||t.y>s.max.y))return!1}if(!this.options.bounds)return!0;var a=this._cellCoordsToBounds(t);return i.toLatLngBounds(this.options.bounds).overlaps(a)},_keyToBounds:function(t){return this._cellCoordsToBounds(this._keyToCellCoords(t))},_cellCoordsToNwSe:function(t){var i=this._map,e=this.getCellSize(),s=t.scaleBy(e),a=s.add(e);return[i.unproject(s,t.z),i.unproject(a,t.z)]},_cellCoordsToBounds:function(t){var e=this._cellCoordsToNwSe(t),s=new i.LatLngBounds(e[0],e[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_cellCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToCellCoords:function(t){var e=t.split(":"),s=new i.Point(+e[0],+e[1]);return s.z=+e[2],s},_removeCell:function(t){var i=this._cells[t];if(i){var e=this._keyToCellCoords(t),s=this._wrapCoords(e),a=this._cellCoordsToBounds(this._wrapCoords(e));i.current=!1,delete this._cells[t],this._activeCells[t]=i,this.cellLeave(a,s,t),this.fire("cellleave",{key:t,coords:s,bounds:a})}},_reuseCell:function(t){var i=this._cellCoordsToKey(t);this._cells[i]=this._activeCells[i],this._cells[i].current=!0;var e=this._wrapCoords(t),s=this._cellCoordsToBounds(this._wrapCoords(t));this.cellEnter(s,e,i),this.fire("cellenter",{key:i,coords:e,bounds:s})},_createCell:function(t){var e=this._cellCoordsToKey(t),s=this._wrapCoords(t),a=this._cellCoordsToBounds(this._wrapCoords(t));this.createCell(a,s,e),this.fire("cellcreate",{key:e,coords:s,bounds:a}),this._cells[e]={coords:t,current:!0},i.Util.requestAnimFrame(this._pruneCells,this)},_cellReady:function(t,i,e){var s=this._cellCoordsToKey(t);(e=this._cells[s])&&(e.loaded=+new Date,e.active=!0)},_getCellPos:function(t){return t.scaleBy(this.getCellSize())},_wrapCoords:function(t){var e=new i.Point(this._wrapX?i.Util.wrapNum(t.x,this._wrapX):t.x,this._wrapY?i.Util.wrapNum(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToCellRange:function(t){var e=this.getCellSize();return new i.Bounds(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))}});function xt(t){this.values=[].concat(t||[])}xt.prototype.query=function(t){var i=this.getIndex(t);return this.values[i]},xt.prototype.getIndex=function(t){this.dirty&&this.sort();for(var i,e,s=0,a=this.values.length-1;s<=a;)if(i=(s+a)/2|0,+(e=this.values[Math.round(i)]).value<+t)s=i+1;else{if(!(+e.value>+t))return i;a=i-1}return Math.abs(~a)},xt.prototype.between=function(t,i){var e=this.getIndex(t),s=this.getIndex(i);if(0===e&&0===s)return[];for(;this.values[e-1]&&this.values[e-1].value===t;)e--;for(;this.values[s+1]&&this.values[s+1].value===i;)s++;return this.values[s]&&this.values[s].value===i&&this.values[s+1]&&s++,this.values.slice(e,s)},xt.prototype.insert=function(t){return this.values.splice(this.getIndex(t.value),0,t),this},xt.prototype.bulkAdd=function(t,i){return this.values=this.values.concat([].concat(t||[])),i?this.sort():this.dirty=!0,this},xt.prototype.sort=function(){return this.values.sort((function(t,i){return+i.value-+t.value})).reverse(),this.dirty=!1,this};var wt=bt.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6,fetchAllFeatures:!1},initialize:function(t){if(bt.prototype.initialize.call(this,t),t=z(t),t=i.Util.setOptions(this,t),this.service=ft(t),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var e=!1,s=0;s<this.options.fields.length;s++)this.options.fields[s].match(/^(OBJECTID|FID|OID|ID)$/i)&&(e=!0);!1===e&&v("no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}this.options.timeField.start&&this.options.timeField.end?(this._startTimeIndex=new xt,this._endTimeIndex=new xt):this.options.timeField&&(this._timeIndex=new xt),this._cache={},this._currentSnapshot=[],this._activeRequests=0},onAdd:function(t){return W(t),this.service.metadata((function(i,e){if(!i){var s=e.supportedQueryFormats,a=!1;(!1===this.service.options.isModern||this.options.fetchAllFeatures)&&(a=!0),!a&&s&&-1!==s.indexOf("geoJSON")&&(this.service.options.isModern=!0),e.objectIdField&&(this.service.options.idAttribute=e.objectIdField),!this.options.attribution&&t.attributionControl&&e.copyrightText&&(this.options.attribution=e.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}}),this),t.on("zoomend",this._handleZoomChange,this),bt.prototype.onAdd.call(this,t)},onRemove:function(t){return J(t),t.off("zoomend",this._handleZoomChange,this),bt.prototype.onRemove.call(this,t)},getAttribution:function(){return this.options.attribution},createCell:function(t,i){this._visibleZoom()&&this._requestFeatures(t,i)},_requestFeatures:function(t,e,s,a){this._activeRequests++,a=a||0;var r=this.options.where;return 1===this._activeRequests&&this.fire("loading",{bounds:t},!0),this._buildQuery(t,a).run((function(n,o,h){h&&h.exceededTransferLimit&&this.fire("drawlimitexceeded"),this.options.where===r&&(!n&&o&&o.features.length&&i.Util.requestAnimFrame(i.Util.bind((function(){this._addFeatures(o.features,e),this._postProcessFeatures(t)}),this)),n||!o||o.features.length||this._postProcessFeatures(t),n&&this._postProcessFeatures(t),s&&s.call(this,n,o),h&&(h.exceededTransferLimit||h.properties&&h.properties.exceededTransferLimit)&&this.options.fetchAllFeatures&&this._requestFeatures(t,e,s,a+o.features.length))}),this)},_postProcessFeatures:function(t){this._activeRequests--,this._activeRequests<=0&&this.fire("load",{bounds:t})},_cacheKey:function(t){return t.z+":"+t.x+":"+t.y},_addFeatures:function(t,i){if(i){var e=this._cacheKey(i);this._cache[e]=this._cache[e]||[]}for(var s=t.length-1;s>=0;s--){var a=t[s].id;-1===this._currentSnapshot.indexOf(a)&&this._currentSnapshot.push(a),void 0!==e&&-1===this._cache[e].indexOf(a)&&this._cache[e].push(a)}this.options.timeField&&this._buildTimeIndexes(t),this.createLayers(t)},_buildQuery:function(t,e){var s=this.service.query().intersects(t).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.fetchAllFeatures&&!isNaN(parseInt(e))&&(s=s.offset(e)),s.params.resultType="tile",this.options.requestParams&&i.Util.extend(s.params,this.options.requestParams),this.options.simplifyFactor&&s.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&s.between(this.options.from,this.options.to),s},setWhere:function(t,e,s){this.options.where=t&&t.length?t:"1=1";for(var a=[],r=[],n=0,o=null,h=i.Util.bind((function(h,l){if(h&&(o=h),l)for(var u=l.features.length-1;u>=0;u--)r.push(l.features[u].id);--n<=0&&this._visibleZoom()&&t===this.options.where&&(this._currentSnapshot=r,i.Util.requestAnimFrame(i.Util.bind((function(){this.removeLayers(a),this.addLayers(r),e&&e.call(s,o)}),this)))}),this),l=this._currentSnapshot.length-1;l>=0;l--)a.push(this._currentSnapshot[l]);for(var u in this._cache={},this._cells){n++;var c=this._keyToCellCoords(u),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,h)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,e,s,a){var r=this.options.from,n=this.options.to,o=0,h=null,l=i.Util.bind((function(i){i&&(h=i),this._filterExistingFeatures(r,n,t,e),o--,s&&o<=0&&s.call(a,h)}),this);if(this.options.from=t,this.options.to=e,this._filterExistingFeatures(r,n,t,e),"server"===this.options.timeFilterMode)for(var u in this._cells){o++;var c=this._keyToCellCoords(u),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,l)}return this},refresh:function(){this.setWhere(this.options.where)},_filterExistingFeatures:function(t,e,s,a){var r=t&&e?this._getFeaturesInTimeRange(t,e):this._currentSnapshot,n=this._getFeaturesInTimeRange(s,a);if(n.indexOf)for(var o=0;o<n.length;o++){var h=r.indexOf(n[o]);h>=0&&r.splice(h,1)}i.Util.requestAnimFrame(i.Util.bind((function(){this.removeLayers(r),this.addLayers(n)}),this))},_getFeaturesInTimeRange:function(t,i){var e,s=[];if(this.options.timeField.start&&this.options.timeField.end){var a=this._startTimeIndex.between(t,i),r=this._endTimeIndex.between(t,i);e=a.concat(r)}else{if(!this._timeIndex)return v("You must set timeField in the layer constructor in order to manipulate the start and end time filter."),[];e=this._timeIndex.between(t,i)}for(var n=e.length-1;n>=0;n--)s.push(e[n].id);return s},_buildTimeIndexes:function(t){var i,e;if(this.options.timeField.start&&this.options.timeField.end){var s=[],a=[];for(i=t.length-1;i>=0;i--)e=t[i],s.push({id:e.id,value:new Date(e.properties[this.options.timeField.start])}),a.push({id:e.id,value:new Date(e.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(s),this._endTimeIndex.bulkAdd(a)}else{var r=[];for(i=t.length-1;i>=0;i--)e=t[i],r.push({id:e.id,value:new Date(e.properties[this.options.timeField])});this._timeIndex.bulkAdd(r)}},_featureWithinTimeRange:function(t){if(!this.options.from||!this.options.to)return!0;var i=+this.options.from.valueOf(),e=+this.options.to.valueOf();if("string"==typeof this.options.timeField){var s=+t.properties[this.options.timeField];return s>=i&&s<=e}if(this.options.timeField.start&&this.options.timeField.end){var a=+t.properties[this.options.timeField.start],r=+t.properties[this.options.timeField.end];return a>=i&&a<=e||r>=i&&r<=e||a<=i&&r>=e}},_visibleZoom:function(){if(!this._map)return!1;var t=this._map.getZoom();return!(t>this.options.maxZoom||t<this.options.minZoom)},_handleZoomChange:function(){if(this._visibleZoom())for(var t in this._cells){var i=this._cells[t].coords,e=this._cacheKey(i);this._cache[e]&&this.addLayers(this._cache[e])}else this.removeLayers(this._currentSnapshot),this._currentSnapshot=[]},authenticate:function(t){return this.service.authenticate(t),this},metadata:function(t,i){return this.service.metadata(t,i),this},query:function(){return this.service.query()},_getMetadata:function(t){this._metadata?t(undefined,this._metadata):this.metadata(i.Util.bind((function(i,e){this._metadata=e,t(i,this._metadata)}),this))},addFeature:function(t,i,e){this.addFeatures(t,i,e)},addFeatures:function(t,e,s){this._getMetadata(i.Util.bind((function(a,r){if(a)e&&e.call(this,a,null);else{var n=t.features?t.features:[t];this.service.addFeatures(t,i.Util.bind((function(t,i){if(!t){for(var a=n.length-1;a>=0;a--)n[a].properties[r.objectIdField]=n.length>1?i[a].objectId:i.objectId,n[a].id=n.length>1?i[a].objectId:i.objectId;this._addFeatures(n)}e&&e.call(s,t,i)}),this))}}),this))},updateFeature:function(t,i,e){this.updateFeatures(t,i,e)},updateFeatures:function(t,i,e){var s=t.features?t.features:[t];this.service.updateFeatures(t,(function(t,a){if(!t){for(var r=s.length-1;r>=0;r--)this.removeLayers([s[r].id],!0);this._addFeatures(s)}i&&i.call(e,t,a)}),this)},deleteFeature:function(t,i,e){this.deleteFeatures(t,i,e)},deleteFeatures:function(t,i,e){return this.service.deleteFeatures(t,(function(t,s){var a=s.length?s:[s];if(!t&&a.length>0)for(var r=a.length-1;r>=0;r--)this.removeLayers([a[r].objectId],!0);i&&i.call(e,t,s)}),this)}}),St=wt.extend({options:{cacheLayers:!0},initialize:function(t){t.apikey&&(t.token=t.apikey),wt.prototype.initialize.call(this,t),this._originalStyle=this.options.style,this._layers={}},onRemove:function(t){for(var i in this._layers)t.removeLayer(this._layers[i]),this.fire("removefeature",{feature:this._layers[i].feature,permanent:!1},!0);return wt.prototype.onRemove.call(this,t)},createNewLayer:function(t){var e=i.GeoJSON.geometryToLayer(t,this.options);return e&&(e.defaultOptions=e.options),e},_updateLayer:function(t,e){var s=[],a=this.options.coordsToLatLng||i.GeoJSON.coordsToLatLng;switch(e.properties&&(t.feature.properties=e.properties),e.geometry.type){case"Point":s=i.GeoJSON.coordsToLatLng(e.geometry.coordinates),t.setLatLng(s);break;case"LineString":s=i.GeoJSON.coordsToLatLngs(e.geometry.coordinates,0,a),t.setLatLngs(s);break;case"MultiLineString":case"Polygon":s=i.GeoJSON.coordsToLatLngs(e.geometry.coordinates,1,a),t.setLatLngs(s);break;case"MultiPolygon":s=i.GeoJSON.coordsToLatLngs(e.geometry.coordinates,2,a),t.setLatLngs(s)}this.redraw(t.feature.id)},createLayers:function(t){for(var i=t.length-1;i>=0;i--){var e,s=t[i],a=this._layers[s.id];!this._visibleZoom()||!a||this._map.hasLayer(a)||this.options.timeField&&!this._featureWithinTimeRange(s)||(this._map.addLayer(a),this.fire("addfeature",{feature:a.feature},!0)),a&&(a.setLatLngs||a.setLatLng)&&this._updateLayer(a,s),a||((e=this.createNewLayer(s))?(e.feature=s,e.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(e.feature,e),this._layers[e.feature.id]=e,this.setFeatureStyle(e.feature.id,this.options.style),this.fire("createfeature",{feature:e.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(s))&&this._map.addLayer(e)):v("invalid GeoJSON encountered"))}},addLayers:function(t){for(var i=t.length-1;i>=0;i--){var e=this._layers[t[i]];!e||this.options.timeField&&!this._featureWithinTimeRange(e.feature)||(this._map.addLayer(e),this.fire("addfeature",{feature:e.feature},!0))}},removeLayers:function(t,i){for(var e=t.length-1;e>=0;e--){var s=t[e],a=this._layers[s];a&&(this.fire("removefeature",{feature:a.feature,permanent:i},!0),this._map.removeLayer(a)),a&&i&&delete this._layers[s]}},cellEnter:function(t,e){this._visibleZoom()&&!this._zooming&&this._map&&i.Util.requestAnimFrame(i.Util.bind((function(){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),s=this._cache[t];this._activeCells[i]&&s&&this.addLayers(s)}),this))},cellLeave:function(t,e){this._zooming||i.Util.requestAnimFrame(i.Util.bind((function(){if(this._map){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),s=this._cache[t],a=this._map.getBounds();if(!this._activeCells[i]&&s){for(var r=!0,n=0;n<s.length;n++){var o=this._layers[s[n]];o&&o.getBounds&&a.intersects(o.getBounds())&&(r=!1)}r&&this.removeLayers(s,!this.options.cacheLayers),!this.options.cacheLayers&&r&&(delete this._cache[t],delete this._cells[i],delete this._activeCells[i])}}}),this))},resetStyle:function(){return this.options.style=this._originalStyle,this.eachFeature((function(t){this.resetFeatureStyle(t.feature.id)}),this),this},setStyle:function(t){return this.options.style=t,this.eachFeature((function(i){this.setFeatureStyle(i.feature.id,t)}),this),this},resetFeatureStyle:function(t){var e=this._layers[t],s=this._originalStyle||i.Path.prototype.options;return e&&(i.Util.extend(e.options,e.defaultOptions),this.setFeatureStyle(t,s)),this},setFeatureStyle:function(t,i){var e=this._layers[t];return"function"==typeof i&&(i=i(e.feature)),e.setStyle&&e.setStyle(i),this},eachActiveFeature:function(t,i){if(this._map){var e=this._map.getBounds();for(var s in this._layers)-1!==this._currentSnapshot.indexOf(this._layers[s].feature.id)&&("function"==typeof this._layers[s].getLatLng&&e.contains(this._layers[s].getLatLng())||"function"==typeof this._layers[s].getBounds&&e.intersects(this._layers[s].getBounds()))&&t.call(i,this._layers[s])}return this},eachFeature:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},getFeature:function(t){return this._layers[t]},bringToBack:function(){this.eachFeature((function(t){t.bringToBack&&t.bringToBack()}))},bringToFront:function(){this.eachFeature((function(t){t.bringToFront&&t.bringToFront()}))},redraw:function(t){return t&&this._redraw(t),this},_redraw:function(t){var e=this._layers[t],s=e.feature;if(e&&e.setIcon&&this.options.pointToLayer&&this.options.pointToLayer){var a=this.options.pointToLayer(s,i.latLng(s.geometry.coordinates[1],s.geometry.coordinates[0])).options.icon;e.setIcon(a)}if(e&&e.setStyle&&this.options.pointToLayer){var r=this.options.pointToLayer(s,i.latLng(s.geometry.coordinates[1],s.geometry.coordinates[0])).options;this.setFeatureStyle(s.id,r)}e&&e.setStyle&&this.options.style&&this.resetStyle(s.id)}});var Ct={__proto__:null,VERSION:o,Support:u,options:c,Util:X,get:M,post:m,request:g,Task:K,task:function(t){return t=z(t),new K(t)},Query:Y,query:$,Find:tt,find:it,Identify:et,identify:function(t){return new et(t)},IdentifyFeatures:st,identifyFeatures:at,IdentifyImage:rt,identifyImage:nt,Service:ot,service:function(t){return t=z(t),new ot(t)},MapService:ht,mapService:lt,ImageService:ut,imageService:ct,FeatureLayerService:pt,featureLayerService:ft,BasemapLayer:mt,basemapLayer:function(t,i){return new mt(t,i)},TiledMapLayer:yt,tiledMapLayer:function(t,i){return new yt(t,i)},RasterLayer:_t,ImageMapLayer:Mt,imageMapLayer:function(t,i){return new Mt(t,i)},DynamicMapLayer:vt,dynamicMapLayer:function(t,i){return new vt(t,i)},FeatureManager:wt,FeatureLayer:St,featureLayer:function(t){return new St(t)}};function At(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);i&&(s=s.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),e.push.apply(e,s)}return e}function It(t){for(var i=1;i<arguments.length;i++){var e=null!=arguments[i]?arguments[i]:{};i%2?At(Object(e),!0).forEach((function(i){kt(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):At(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}))}return t}function Pt(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function Lt(t,i){for(var e=0;e<i.length;e++){var s=i[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function Ot(t,i,e){return i&&Lt(t.prototype,i),e&&Lt(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function Tt(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),i&&Et(t,i)}function Nt(t){return Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Nt(t)}function Et(t,i){return Et=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t},Et(t,i)}function Rt(t,i){if(i&&("object"==typeof i||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function qt(t){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,s=Nt(t);if(i){var a=Nt(this).constructor;e=Reflect.construct(s,arguments,a)}else e=s.apply(this,arguments);return Rt(this,e)}}function Ft(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&null!==(t=Nt(t)););return t}function Gt(){return Gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,i,e){var s=Ft(t,i);if(s){var a=Object.getOwnPropertyDescriptor(s,i);return a.get?a.get.call(arguments.length<3?t:e):a.value}},Gt.apply(this,arguments)}var jt=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"initialize",value:function(t){t.pane=n.Util.defaultValue(t.pane,"tilePane"),Gt(Nt(e.prototype),"initialize",this).call(this,t),r.default.Util.stamp(this),this.options.id=n.Util.defaultValue(this.options.id,this.uuid),this.options.pid=n.Util.defaultValue(this.options.pid,-1),this.options.name=n.Util.defaultValue(this.options.name,"")}},{key:"uuid",get:function(){return this._leaflet_id}},{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}},{key:"opacity",get:function(){return this.options.opacity},set:function(t){this.options.opacity=t,this.setOpacity(t)}},{key:"bandIds",get:function(){return this.getBandIds()},set:function(t){this.setBandIds(t)}}]),e}(Mt);n.layer.ArcGisImageLayer=jt,n.LayerUtil.register("arcgis_image",jt);var Ut=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"initialize",value:function(t){Gt(Nt(e.prototype),"initialize",this).call(this,t),r.default.Util.stamp(this),this.options.id=n.Util.defaultValue(this.options.id,this.uuid),this.options.pid=n.Util.defaultValue(this.options.pid,-1),this.options.name=n.Util.defaultValue(this.options.name,"")}},{key:"uuid",get:function(){return this._leaflet_id}},{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}}]),e}(yt);n.layer.ArcGisTileLayer=Ut,n.LayerUtil.register("arcgis_tile",Ut);var zt=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"uuid",get:function(){return this._leaflet_id}},{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}},{key:"opacity",get:function(){return this.options.opacity},set:function(t){this.options.opacity=t,this.setOpacity(t)}},{key:"initialize",value:function(t){var i,s=this;if(t.popup&&(i=t.popup,delete t.popup),t.pane=n.Util.defaultValue(t.pane,"tilePane"),Gt(Nt(e.prototype),"initialize",this).call(this,t),r.default.Util.stamp(this),this.options.id=n.Util.defaultValue(this.options.id,this.uuid),this.options.pid=n.Util.defaultValue(this.options.pid,-1),this.options.name=n.Util.defaultValue(this.options.name,""),i){var a=this.options.popupOptions||{};this.bindPopup((function(t,e,r){if(null!=t&&t.code>0)return n.Util.msg(t.message),!1;var o=e.graphic;if(!o)return!1;var h=o.attr,l=s.name;return a.noTitle?l=null:a.title?l=a.title:a.titleField&&(l=h[a.titleField]),n.Util.getTemplateHtml({title:l,template:i,attr:h})}),{maxWidth:600})}}},{key:"onAdd",value:function(t){Gt(Nt(e.prototype),"onAdd",this).call(this,t),this._popup||!this.highlight&&!this.listens("click")||(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this))}},{key:"_renderPopup",value:function(t,i,s,a){var r,o=this,h=null===(r=this.options)||void 0===r?void 0:r.highlight,l=n.Util.geoJsonToGraphics(s,{type:null==h?void 0:h.type,style:h}),u={layer:this,graphic:l.length>0?l[0]:null,graphics:l,geojson:s,latlng:t};this._popup&&Gt(Nt(e.prototype),"_renderPopup",this).call(this,t,i,u,a),l&&h&&(this._graphicLayer||(this._graphicLayer=new n.layer.GraphicLayer({name:"高亮对象图层",noLayerManage:!0}),this._graphicLayer._mars2d_private=!0,this._map.addLayer(this._graphicLayer)),this._graphicLayer.clear(),this._graphicLayer.addGraphic(l),this._popup&&(this._popup._source=this,this.once(n.EventType.popupclose,(function(t){o._graphicLayer.clear()})))),this.listens("click")&&this.fire(n.EventType.click,u)}}]),e}(vt);n.layer.ArcGisDynamicLayer=zt,n.LayerUtil.register("arcgis_dynamic",zt);var Bt=6378137,Dt=.0066943799901413165,Zt=484813681109536e-20,Wt=Math.PI/2,Jt=1e-10,Qt=.017453292519943295,Vt=57.29577951308232,Ht=Math.PI/4,Xt=2*Math.PI,Kt=3.14159265359,Yt={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},$t={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},ti=/[\s_\-\/\(\)]/g;function ii(t,i){if(t[i])return t[i];for(var e,s=Object.keys(t),a=i.toLowerCase().replace(ti,""),r=-1;++r<s.length;)if((e=s[r]).toLowerCase().replace(ti,"")===a)return t[e]}function ei(t){var i,e,s,a={},r=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var e=i.split("=");return e.push(!0),t[e[0].toLowerCase()]=e[1],t}),{}),n={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*Qt},lat_1:function(t){a.lat1=t*Qt},lat_2:function(t){a.lat2=t*Qt},lat_ts:function(t){a.lat_ts=t*Qt},lon_0:function(t){a.long0=t*Qt},lon_1:function(t){a.long1=t*Qt},lon_2:function(t){a.long2=t*Qt},alpha:function(t){a.alpha=parseFloat(t)*Qt},gamma:function(t){a.rectified_grid_angle=parseFloat(t)},lonc:function(t){a.longc=t*Qt},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t;var i=ii($t,t);i&&(a.to_meter=i.to_meter)},from_greenwich:function(t){a.from_greenwich=t*Qt},pm:function(t){var i=ii(Yt,t);a.from_greenwich=(i||parseFloat(t))*Qt},nadgrids:function(t){"@null"===t?a.datumCode="none":a.nadgrids=t},axis:function(t){var i="ewnsud";3===t.length&&-1!==i.indexOf(t.substr(0,1))&&-1!==i.indexOf(t.substr(1,1))&&-1!==i.indexOf(t.substr(2,1))&&(a.axis=t)},approx:function(){a.approx=!0}};for(i in r)e=r[i],i in n?"function"==typeof(s=n[i])?s(e):a[s]=e:a[i]=e;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}var si=/\s/,ai=/[A-Za-z]/,ri=/[A-Za-z84_]/,ni=/[,\]]/,oi=/[\d\.E\-\+]/;function hi(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function li(t,i,e){Array.isArray(i)&&(e.unshift(i),i=null);var s=i?{}:t,a=e.reduce((function(t,i){return ui(i,t),t}),s);i&&(t[i]=a)}function ui(t,i){if(Array.isArray(t)){var e=t.shift();if("PARAMETER"===e&&(e=t.shift()),1===t.length)return Array.isArray(t[0])?(i[e]={},void ui(t[0],i[e])):void(i[e]=t[0]);if(t.length)if("TOWGS84"!==e){if("AXIS"===e)return e in i||(i[e]=[]),void i[e].push(t);var s;switch(Array.isArray(e)||(i[e]={}),e){case"UNIT":case"PRIMEM":case"VERT_DATUM":return i[e]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&ui(t[2],i[e]));case"SPHEROID":case"ELLIPSOID":return i[e]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&ui(t[3],i[e]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void li(i,e,t);default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return ui(t,i[e]);return li(i,e,t)}}else i[e]=t;else i[e]=!0}else i[t]=!0}hi.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;si.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},hi.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(ni.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},hi.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},hi.prototype.number=function(t){if(!oi.test(t)){if(ni.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},hi.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},hi.prototype.keyword=function(t){if(ri.test(t))this.word+=t;else{if("["===t){var i=[];return i.push(this.word),this.level++,null===this.root?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,void(this.state=1)}if(!ni.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},hi.prototype.neutral=function(t){if(ai.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(oi.test(t))return this.word=t,void(this.state=3);if(!ni.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},hi.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function ci(t){return.017453292519943295*t}function pi(t){var i=new hi(t).output(),e=i.shift(),s=i.shift();i.unshift(["name",s]),i.unshift(["type",e]);var a={};return ui(i,a),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var i="",e=0,s=t.AXIS.length;e<s;++e){var a=[t.AXIS[e][0].toLowerCase(),t.AXIS[e][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?i+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?i+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?i+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var r=t.GEOGCS;function n(i){return i*(t.to_meter||1)}"GEOGCS"===t.type&&(r=t),r&&(r.DATUM?t.datumCode=r.DATUM.name.toLowerCase():t.datumCode=r.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(t.datum_params=r.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",ci],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",ci],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",ci],["lat0","latitude_of_origin",ci],["lat0","standard_parallel_1",ci],["lat1","standard_parallel_1",ci],["lat2","standard_parallel_2",ci],["azimuth","Azimuth"],["alpha","azimuth",ci],["srsCode","name"]].forEach((function(i){return function(t,i){var e=i[0],s=i[1];!(e in t)&&s in t&&(t[e]=t[s],3===i.length&&(t[e]=i[2](t[e])))}(t,i)})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=ci(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(a),a}function fi(t){var i=this;if(2===arguments.length){var e=arguments[1];"string"==typeof e?"+"===e.charAt(0)?fi[t]=ei(arguments[1]):fi[t]=pi(arguments[1]):fi[t]=e}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?fi.apply(i,t):fi(t)}));if("string"==typeof t){if(t in fi)return fi[t]}else"EPSG"in t?fi["EPSG:"+t.EPSG]=t:"ESRI"in t?fi["ESRI:"+t.ESRI]=t:"IAU2000"in t?fi["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("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"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(fi);var di=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var mi=["3857","900913","3785","102113"];function yi(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in fi}(t))return fi[t];if(function(t){return di.some((function(i){return t.indexOf(i)>-1}))}(t)){var i=pi(t);if(function(t){var i=ii(t,"authority");if(i){var e=ii(i,"epsg");return e&&mi.indexOf(e)>-1}}(i))return fi["EPSG:3857"];var e=function(t){var i=ii(t,"extension");if(i)return ii(i,"proj4")}(i);return e?ei(e):i}return function(t){return"+"===t[0]}(t)?ei(t):void 0}function gi(t,i){var e,s;if(t=t||{},!i)return t;for(s in i)void 0!==(e=i[s])&&(t[s]=e);return t}function _i(t,i,e){var s=t*i;return e/Math.sqrt(1-s*s)}function Mi(t){return t<0?-1:1}function vi(t){return Math.abs(t)<=Kt?t:t-Mi(t)*Xt}function bi(t,i,e){var s=t*e,a=.5*t;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(Wt-i))/s}function xi(t,i){for(var e,s,a=.5*t,r=Wt-2*Math.atan(i),n=0;n<=15;n++)if(e=t*Math.sin(r),r+=s=Wt-2*Math.atan(i*Math.pow((1-e)/(1+e),a))-r,Math.abs(s)<=1e-10)return r;return-9999}function wi(t){return t}var Si=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"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=_i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var i,e,s=t.x,a=t.y;if(a*Vt>90&&a*Vt<-90&&s*Vt>180&&s*Vt<-180)return null;if(Math.abs(Math.abs(a)-Wt)<=Jt)return null;if(this.sphere)i=this.x0+this.a*this.k0*vi(s-this.long0),e=this.y0+this.a*this.k0*Math.log(Math.tan(Ht+.5*a));else{var r=Math.sin(a),n=bi(this.e,a,r);i=this.x0+this.a*this.k0*vi(s-this.long0),e=this.y0-this.a*this.k0*Math.log(n)}return t.x=i,t.y=e,t},inverse:function(t){var i,e,s=t.x-this.x0,a=t.y-this.y0;if(this.sphere)e=Wt-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var r=Math.exp(-a/(this.a*this.k0));if(-9999===(e=xi(this.e,r)))return null}return i=vi(this.long0+s/(this.a*this.k0)),t.x=i,t.y=e,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:wi,inverse:wi,names:["longlat","identity"]}],Ci={},Ai=[];function Ii(t,i){var e=Ai.length;return t.names?(Ai[e]=t,t.names.forEach((function(t){Ci[t.toLowerCase()]=e})),this):(console.log(i),!0)}var Pi={start:function(){Si.forEach(Ii)},add:Ii,get:function(t){if(!t)return!1;var i=t.toLowerCase();return void 0!==Ci[i]&&Ai[Ci[i]]?Ai[Ci[i]]:void 0}},Li={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Oi=Li.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Li.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ki={};ki.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ki.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ki.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ki.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ki.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ki.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ki.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ki.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ki.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ki.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ki.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ki.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ki.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ki.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ki.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ki.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ki.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var Ti={};function Ni(t){if(0===t.length)return null;var i="@"===t[0];return i&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:Ti[t]||null,isNull:!1}}function Ei(t){return t/3600*Math.PI/180}function Ri(t,i,e){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,e)))}function qi(t){return t.map((function(t){return[Ei(t.longitudeShift),Ei(t.latitudeShift)]}))}function Fi(t,i,e){return{name:Ri(t,i+8,i+16).trim(),parent:Ri(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,e),upperLatitude:t.getFloat64(i+88,e),lowerLongitude:t.getFloat64(i+104,e),upperLongitude:t.getFloat64(i+120,e),latitudeInterval:t.getFloat64(i+136,e),longitudeInterval:t.getFloat64(i+152,e),gridNodeCount:t.getInt32(i+168,e)}}function Gi(t,i,e,s){for(var a=i+176,r=[],n=0;n<e.gridNodeCount;n++){var o={latitudeShift:t.getFloat32(a+16*n,s),longitudeShift:t.getFloat32(a+16*n+4,s),latitudeAccuracy:t.getFloat32(a+16*n+8,s),longitudeAccuracy:t.getFloat32(a+16*n+12,s)};r.push(o)}return r}function ji(t,i){if(!(this instanceof ji))return new ji(t);i=i||function(t){if(t)throw t};var e=yi(t);if("object"==typeof e){var s=ji.projections.get(e.projName);if(s){if(e.datumCode&&"none"!==e.datumCode){var a=ii(ki,e.datumCode);a&&(e.datum_params=e.datum_params||(a.towgs84?a.towgs84.split(","):null),e.ellps=a.ellipse,e.datumName=a.datumName?a.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var r,n,o,h,l,u,c,p=function(t,i,e,s,a){if(!t){var r=ii(Li,s);r||(r=Oi),t=r.a,i=r.b,e=r.rf}return e&&!i&&(i=(1-1/e)*t),(0===e||Math.abs(t-i)<Jt)&&(a=!0,i=t),{a:t,b:i,rf:e,sphere:a}}(e.a,e.b,e.rf,e.ellps,e.sphere),f=(r=p.a,n=p.b,p.rf,o=e.R_A,u=((h=r*r)-(l=n*n))/h,c=0,o?(h=(r*=1-u*(.16666666666666666+u*(.04722222222222222+.022156084656084655*u)))*r,u=0):c=Math.sqrt(u),{es:u,e:c,ep2:(h-l)/l}),d=function(t){return void 0===t?null:t.split(",").map(Ni)}(e.nadgrids),m=e.datum||function(t,i,e,s,a,r,n){var o={};return o.datum_type=void 0===t||"none"===t?5:4,i&&(o.datum_params=i.map(parseFloat),0===o.datum_params[0]&&0===o.datum_params[1]&&0===o.datum_params[2]||(o.datum_type=1),o.datum_params.length>3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=2,o.datum_params[3]*=Zt,o.datum_params[4]*=Zt,o.datum_params[5]*=Zt,o.datum_params[6]=o.datum_params[6]/1e6+1))),n&&(o.datum_type=3,o.grids=n),o.a=e,o.b=s,o.es=a,o.ep2=r,o}(e.datumCode,e.datum_params,p.a,p.b,f.es,f.ep2,d);gi(this,e),gi(this,s),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=m,this.init(),i(null,this)}else i(t)}else i(t)}function Ui(t,i,e){var s,a,r,n,o=t.x,h=t.y,l=t.z?t.z:0;if(h<-Wt&&h>-1.001*Wt)h=-Wt;else if(h>Wt&&h<1.001*Wt)h=Wt;else{if(h<-Wt)return{x:-1/0,y:-1/0,z:t.z};if(h>Wt)return{x:1/0,y:1/0,z:t.z}}return o>Math.PI&&(o-=2*Math.PI),a=Math.sin(h),n=Math.cos(h),r=a*a,{x:((s=e/Math.sqrt(1-i*r))+l)*n*Math.cos(o),y:(s+l)*n*Math.sin(o),z:(s*(1-i)+l)*a}}function zi(t,i,e,s){var a,r,n,o,h,l,u,c,p,f,d,m,y,g,_,M=1e-12,v=t.x,b=t.y,x=t.z?t.z:0;if(a=Math.sqrt(v*v+b*b),r=Math.sqrt(v*v+b*b+x*x),a/e<M){if(g=0,r/e<M)return Wt,_=-s,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(b,v);n=x/r,c=(o=a/r)*(1-i)*(h=1/Math.sqrt(1-i*(2-i)*o*o)),p=n*h,y=0;do{y++,l=i*(u=e/Math.sqrt(1-i*p*p))/(u+(_=a*c+x*p-u*(1-i*p*p))),m=(d=n*(h=1/Math.sqrt(1-l*(2-l)*o*o)))*c-(f=o*(1-l)*h)*p,c=f,p=d}while(m*m>1e-24&&y<30);return{x:g,y:Math.atan(d/Math.abs(f)),z:_}}function Bi(t){return 1===t||2===t}function Di(t,i,e){if(function(t,i){return t.datum_type===i.datum_type&&!(t.a!==i.a||Math.abs(t.es-i.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:2!==t.datum_type||t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6])}(t,i))return e;if(5===t.datum_type||5===i.datum_type)return e;var s=t.a,a=t.es;if(3===t.datum_type){if(0!==Zi(t,!1,e))return;s=Bt,a=Dt}var r=i.a,n=i.b,o=i.es;if(3===i.datum_type&&(r=Bt,n=6356752.314,o=Dt),a===o&&s===r&&!Bi(t.datum_type)&&!Bi(i.datum_type))return e;if((e=Ui(e,a,s),Bi(t.datum_type)&&(e=function(t,i,e){if(1===i)return{x:t.x+e[0],y:t.y+e[1],z:t.z+e[2]};if(2===i){var s=e[0],a=e[1],r=e[2],n=e[3],o=e[4],h=e[5],l=e[6];return{x:l*(t.x-h*t.y+o*t.z)+s,y:l*(h*t.x+t.y-n*t.z)+a,z:l*(-o*t.x+n*t.y+t.z)+r}}}(e,t.datum_type,t.datum_params)),Bi(i.datum_type)&&(e=function(t,i,e){if(1===i)return{x:t.x-e[0],y:t.y-e[1],z:t.z-e[2]};if(2===i){var s=e[0],a=e[1],r=e[2],n=e[3],o=e[4],h=e[5],l=e[6],u=(t.x-s)/l,c=(t.y-a)/l,p=(t.z-r)/l;return{x:u+h*c-o*p,y:-h*u+c+n*p,z:o*u-n*c+p}}}(e,i.datum_type,i.datum_params)),e=zi(e,o,r,n),3===i.datum_type)&&0!==Zi(i,!0,e))return;return e}function Zi(t,i,e){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var s={x:-e.x,y:e.y},a={x:Number.NaN,y:Number.NaN},r=[],n=0;n<t.grids.length;n++){var o=t.grids[n];if(r.push(o.name),o.isNull){a=s;break}if(null!==o.grid){var h=o.grid.subgrids[0],l=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,u=h.ll[0]-l,c=h.ll[1]-l,p=h.ll[0]+(h.lim[0]-1)*h.del[0]+l,f=h.ll[1]+(h.lim[1]-1)*h.del[1]+l;if(!(c>s.y||u>s.x||f<s.y||p<s.x||(a=Wi(s,i,h),isNaN(a.x))))break}else if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1}return isNaN(a.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*Vt+" "+s.y*Vt+" tried: '"+r+"'"),-1):(e.x=-a.x,e.y=a.y,0)}function Wi(t,i,e){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var a={x:t.x,y:t.y};a.x-=e.ll[0],a.y-=e.ll[1],a.x=vi(a.x-Math.PI)+Math.PI;var r=Ji(a,e);if(i){if(isNaN(r.x))return s;r.x=a.x-r.x,r.y=a.y-r.y;var n,o,h=9;do{if(o=Ji(r,e),isNaN(o.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}n={x:a.x-(o.x+r.x),y:a.y-(o.y+r.y)},r.x+=n.x,r.y+=n.y}while(h--&&Math.abs(n.x)>1e-12&&Math.abs(n.y)>1e-12);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=vi(r.x+e.ll[0]),s.y=r.y+e.ll[1]}else isNaN(r.x)||(s.x=t.x+r.x,s.y=t.y+r.y);return s}function Ji(t,i){var e,s={x:t.x/i.del[0],y:t.y/i.del[1]},a=Math.floor(s.x),r=Math.floor(s.y),n=s.x-1*a,o=s.y-1*r,h={x:Number.NaN,y:Number.NaN};if(a<0||a>=i.lim[0])return h;if(r<0||r>=i.lim[1])return h;e=r*i.lim[0]+a;var l=i.cvs[e][0],u=i.cvs[e][1];e++;var c=i.cvs[e][0],p=i.cvs[e][1];e+=i.lim[0];var f=i.cvs[e][0],d=i.cvs[e][1];e--;var m=i.cvs[e][0],y=i.cvs[e][1],g=n*o,_=n*(1-o),M=(1-n)*(1-o),v=(1-n)*o;return h.x=M*l+_*c+v*m+g*f,h.y=M*u+_*p+v*y+g*d,h}function Qi(t,i,e){var s,a,r,n=e.x,o=e.y,h=e.z||0,l={};for(r=0;r<3;r++)if(!i||2!==r||void 0!==e.z)switch(0===r?(s=n,a=-1!=="ew".indexOf(t.axis[r])?"x":"y"):1===r?(s=o,a=-1!=="ns".indexOf(t.axis[r])?"y":"x"):(s=h,a="z"),t.axis[r]){case"e":case"n":l[a]=s;break;case"w":case"s":l[a]=-s;break;case"u":void 0!==e[a]&&(l.z=s);break;case"d":void 0!==e[a]&&(l.z=-s);break;default:return null}return l}function Vi(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Hi(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Xi(t,i,e,s){var a;if(Array.isArray(e)&&(e=Vi(e)),function(t){Hi(t.x),Hi(t.y)}(e),t.datum&&i.datum&&function(t,i){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==i.datumCode||(1===i.datum.datum_type||2===i.datum.datum_type)&&"WGS84"!==t.datumCode}(t,i)&&(e=Xi(t,a=new ji("WGS84"),e,s),t=a),s&&"enu"!==t.axis&&(e=Qi(t,!1,e)),"longlat"===t.projName)e={x:e.x*Qt,y:e.y*Qt,z:e.z||0};else if(t.to_meter&&(e={x:e.x*t.to_meter,y:e.y*t.to_meter,z:e.z||0}),!(e=t.inverse(e)))return;if(t.from_greenwich&&(e.x+=t.from_greenwich),e=Di(t.datum,i.datum,e))return i.from_greenwich&&(e={x:e.x-i.from_greenwich,y:e.y,z:e.z||0}),"longlat"===i.projName?e={x:e.x*Vt,y:e.y*Vt,z:e.z||0}:(e=i.forward(e),i.to_meter&&(e={x:e.x/i.to_meter,y:e.y/i.to_meter,z:e.z||0})),s&&"enu"!==i.axis?Qi(i,!0,e):e}ji.projections=Pi,ji.projections.start();var Ki=ji("WGS84");function Yi(t,i,e,s){var a,r,n;return Array.isArray(e)?(a=Xi(t,i,e,s)||{x:NaN,y:NaN},e.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name?"number"==typeof a.z?[a.x,a.y,a.z].concat(e.splice(3)):[a.x,a.y,e[2]].concat(e.splice(3)):[a.x,a.y].concat(e.splice(2)):[a.x,a.y]):(r=Xi(t,i,e,s),2===(n=Object.keys(e)).length||n.forEach((function(s){if(void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name){if("x"===s||"y"===s||"z"===s)return}else if("x"===s||"y"===s)return;r[s]=e[s]})),r)}function $i(t){return t instanceof ji?t:t.oProj?t.oProj:ji(t)}function te(t,i,e){t=$i(t);var s,a=!1;return void 0===i?(i=t,t=Ki,a=!0):(void 0!==i.x||Array.isArray(i))&&(e=i,i=t,t=Ki,a=!0),i=$i(i),e?Yi(t,i,e):(s={forward:function(e,s){return Yi(t,i,e,s)},inverse:function(e,s){return Yi(i,t,e,s)}},a&&(s.oProj=i),s)}var ie="AJSAJS",ee="AFAFAF",se=65,ae=73,re=79,ne=86,oe=90,he={forward:le,inverse:function(t){var i=fe(ye(t.toUpperCase()));if(i.lat&&i.lon)return[i.lon,i.lat,i.lon,i.lat];return[i.left,i.bottom,i.right,i.top]},toPoint:ue};function le(t,i){return i=i||5,function(t,i){var e="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(f=t.easting,d=t.northing,m=t.zoneNumber,y=me(m),g=Math.floor(f/1e5),_=Math.floor(d/1e5)%20,a=g,r=_,n=y,o=n-1,h=ie.charCodeAt(o),l=ee.charCodeAt(o),u=h+a-1,c=l+r,p=!1,u>oe&&(u=u-oe+se-1,p=!0),(u===ae||h<ae&&u>ae||(u>ae||h<ae)&&p)&&u++,(u===re||h<re&&u>re||(u>re||h<re)&&p)&&++u===ae&&u++,u>oe&&(u=u-oe+se-1),c>ne?(c=c-ne+se-1,p=!0):p=!1,(c===ae||l<ae&&c>ae||(c>ae||l<ae)&&p)&&c++,(c===re||l<re&&c>re||(c>re||l<re)&&p)&&++c===ae&&c++,c>ne&&(c=c-ne+se-1),String.fromCharCode(u)+String.fromCharCode(c))+e.substr(e.length-5,i)+s.substr(s.length-5,i);var a,r,n,o,h,l,u,c,p;var f,d,m,y,g,_}(function(t){var i,e,s,a,r,n,o,h,l=t.lat,u=t.lon,c=6378137,p=.00669438,f=.9996,d=ce(l),m=ce(u);h=Math.floor((u+180)/6)+1,180===u&&(h=60);l>=56&&l<64&&u>=3&&u<12&&(h=32);l>=72&&l<84&&(u>=0&&u<9?h=31:u>=9&&u<21?h=33:u>=21&&u<33?h=35:u>=33&&u<42&&(h=37));o=ce(6*(h-1)-180+3),i=p/(1-p),e=c/Math.sqrt(1-p*Math.sin(d)*Math.sin(d)),s=Math.tan(d)*Math.tan(d),a=i*Math.cos(d)*Math.cos(d),r=Math.cos(d)*(m-o),n=c*((1-p/4-3*p*p/64-5*p*p*p/256)*d-(3*p/8+3*p*p/32+45*p*p*p/1024)*Math.sin(2*d)+(15*p*p/256+45*p*p*p/1024)*Math.sin(4*d)-35*p*p*p/3072*Math.sin(6*d));var y=f*e*(r+(1-s+a)*r*r*r/6+(5-18*s+s*s+72*a-58*i)*r*r*r*r*r/120)+5e5,g=f*(n+e*Math.tan(d)*(r*r/2+(5-s+9*a+4*a*a)*r*r*r*r/24+(61-58*s+s*s+600*a-330*i)*r*r*r*r*r*r/720));l<0&&(g+=1e7);return{northing:Math.round(g),easting:Math.round(y),zoneNumber:h,zoneLetter:de(l)}}({lat:t[1],lon:t[0]}),i)}function ue(t){var i=fe(ye(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function ce(t){return t*(Math.PI/180)}function pe(t){return t/Math.PI*180}function fe(t){var i=t.northing,e=t.easting,s=t.zoneLetter,a=t.zoneNumber;if(a<0||a>60)return null;var r,n,o,h,l,u,c,p,f,d=.9996,m=6378137,y=.00669438,g=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=e-5e5,M=i;s<"N"&&(M-=1e7),c=6*(a-1)-180+3,r=.006739496752268451,f=(p=M/d/6367449.145945056)+(3*g/2-27*g*g*g/32)*Math.sin(2*p)+(21*g*g/16-55*g*g*g*g/32)*Math.sin(4*p)+151*g*g*g/96*Math.sin(6*p),n=m/Math.sqrt(1-y*Math.sin(f)*Math.sin(f)),o=Math.tan(f)*Math.tan(f),h=r*Math.cos(f)*Math.cos(f),l=.99330562*m/Math.pow(1-y*Math.sin(f)*Math.sin(f),1.5),u=_/(n*d);var v=f-n*Math.tan(f)/l*(u*u/2-(5+3*o+10*h-4*h*h-9*r)*u*u*u*u/24+(61+90*o+298*h+45*o*o-1.6983531815716497-3*h*h)*u*u*u*u*u*u/720);v=pe(v);var b,x=(u-(1+2*o+h)*u*u*u/6+(5-2*h+28*o-3*h*h+8*r+24*o*o)*u*u*u*u*u/120)/Math.cos(f);if(x=c+pe(x),t.accuracy){var w=fe({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:w.lat,right:w.lon,bottom:v,left:x}}else b={lat:v,lon:x};return b}function de(t){var i="Z";return 84>=t&&t>=72?i="X":72>t&&t>=64?i="W":64>t&&t>=56?i="V":56>t&&t>=48?i="U":48>t&&t>=40?i="T":40>t&&t>=32?i="S":32>t&&t>=24?i="R":24>t&&t>=16?i="Q":16>t&&t>=8?i="P":8>t&&t>=0?i="N":0>t&&t>=-8?i="M":-8>t&&t>=-16?i="L":-16>t&&t>=-24?i="K":-24>t&&t>=-32?i="J":-32>t&&t>=-40?i="H":-40>t&&t>=-48?i="G":-48>t&&t>=-56?i="F":-56>t&&t>=-64?i="E":-64>t&&t>=-72?i="D":-72>t&&t>=-80&&(i="C"),i}function me(t){var i=t%6;return 0===i&&(i=6),i}function ye(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var i,e=t.length,s=null,a="",r=0;!/[A-Z]/.test(i=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;a+=i,r++}var n=parseInt(a,10);if(0===r||r+3>e)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(r++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+t;s=t.substring(r,r+=2);for(var h=me(n),l=function(t,i){var e=ie.charCodeAt(i-1),s=1e5,a=!1;for(;e!==t.charCodeAt(0);){if(++e===ae&&e++,e===re&&e++,e>oe){if(a)throw"Bad character: "+t;e=se,a=!0}s+=1e5}return s}(s.charAt(0),h),u=function(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var e=ee.charCodeAt(i-1),s=0,a=!1;for(;e!==t.charCodeAt(0);){if(++e===ae&&e++,e===re&&e++,e>ne){if(a)throw"Bad character: "+t;e=se,a=!0}s+=1e5}return s}(s.charAt(1),h);u<ge(o);)u+=2e6;var c=e-r;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var p,f,d,m=c/2,y=0,g=0;return m>0&&(p=1e5/Math.pow(10,m),f=t.substring(r,r+m),y=parseFloat(f)*p,d=t.substring(r+m),g=parseFloat(d)*p),{easting:y+l,northing:g+u,zoneLetter:o,zoneNumber:n,accuracy:p}}function ge(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function _e(t,i,e){if(!(this instanceof _e))return new _e(t,i,e);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===i){var s=t.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=t,this.y=i,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}_e.fromMGRS=function(t){return new _e(ue(t))},_e.prototype.toMGRS=function(t){return le([this.x,this.y],t)};var Me=.046875,ve=.01953125,be=.01068115234375;function xe(t){var i=[];i[0]=1-t*(.25+t*(Me+t*(ve+t*be))),i[1]=t*(.75-t*(Me+t*(ve+t*be)));var e=t*t;return i[2]=e*(.46875-t*(.013020833333333334+.007120768229166667*t)),e*=t,i[3]=e*(.3645833333333333-.005696614583333333*t),i[4]=e*t*.3076171875,i}function we(t,i,e,s){return e*=i,i*=i,s[0]*t-e*(s[1]+i*(s[2]+i*(s[3]+i*s[4])))}function Se(t,i,e){for(var s=1/(1-i),a=t,r=20;r;--r){var n=Math.sin(a),o=1-i*n*n;if(a-=o=(we(a,n,Math.cos(a),e)-t)*(o*Math.sqrt(o))*s,Math.abs(o)<Jt)return a}return a}var Ce={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=xe(this.es),this.ml0=we(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var i,e,s,a=t.x,r=t.y,n=vi(a-this.long0),o=Math.sin(r),h=Math.cos(r);if(this.es){var l=h*n,u=Math.pow(l,2),c=this.ep2*Math.pow(h,2),p=Math.pow(c,2),f=Math.abs(h)>Jt?Math.tan(r):0,d=Math.pow(f,2),m=Math.pow(d,2);i=1-this.es*Math.pow(o,2),l/=Math.sqrt(i);var y=we(r,o,h,this.en);e=this.a*(this.k0*l*(1+u/6*(1-d+c+u/20*(5-18*d+m+14*c-58*d*c+u/42*(61+179*m-m*d-479*d)))))+this.x0,s=this.a*(this.k0*(y-this.ml0+o*n*l/2*(1+u/12*(5-d+9*c+4*p+u/30*(61+m-58*d+270*c-330*d*c+u/56*(1385+543*m-m*d-3111*d))))))+this.y0}else{var g=h*Math.sin(n);if(Math.abs(Math.abs(g)-1)<Jt)return 93;if(e=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,s=h*Math.cos(n)/Math.sqrt(1-Math.pow(g,2)),(g=Math.abs(s))>=1){if(g-1>Jt)return 93;s=0}else s=Math.acos(s);r<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return t.x=e,t.y=s,t},inverse:function(t){var i,e,s,a,r=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(e=Se(i=this.ml0+n/this.k0,this.es,this.en),Math.abs(e)<Wt){var o=Math.sin(e),h=Math.cos(e),l=Math.abs(h)>Jt?Math.tan(e):0,u=this.ep2*Math.pow(h,2),c=Math.pow(u,2),p=Math.pow(l,2),f=Math.pow(p,2);i=1-this.es*Math.pow(o,2);var d=r*Math.sqrt(i)/this.k0,m=Math.pow(d,2);s=e-(i*=l)*m/(1-this.es)*.5*(1-m/12*(5+3*p-9*u*p+u-4*c-m/30*(61+90*p-252*u*p+45*f+46*u-m/56*(1385+3633*p+4095*f+1574*f*p)))),a=vi(this.long0+d*(1-m/6*(1+2*p+u-m/20*(5+28*p+24*f+8*u*p+6*u-m/42*(61+662*p+1320*f+720*f*p))))/h)}else s=Wt*Mi(n),a=0;else{var y=Math.exp(r/this.k0),g=.5*(y-1/y),_=this.lat0+n/this.k0,M=Math.cos(_);i=Math.sqrt((1-Math.pow(M,2))/(1+Math.pow(g,2))),s=Math.asin(i),n<0&&(s=-s),a=0===g&&0===M?0:vi(Math.atan2(g,M)+this.long0)}return t.x=a,t.y=s,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Ae(t){var i=Math.exp(t);return i=(i-1/i)/2}function Ie(t,i){t=Math.abs(t),i=Math.abs(i);var e=Math.max(t,i),s=Math.min(t,i)/(e||1);return e*Math.sqrt(1+Math.pow(s,2))}function Pe(t){var i=Math.abs(t);return i=function(t){var i=1+t,e=i-1;return 0===e?t:t*Math.log(i)/e}(i*(1+i/(Ie(1,i)+1))),t<0?-i:i}function Le(t,i){for(var e,s=2*Math.cos(2*i),a=t.length-1,r=t[a],n=0;--a>=0;)e=s*r-n+t[a],n=r,r=e;return i+e*Math.sin(2*i)}function Oe(t,i,e){for(var s,a,r=Math.sin(i),n=Math.cos(i),o=Ae(e),h=function(t){var i=Math.exp(t);return(i+1/i)/2}(e),l=2*n*h,u=-2*r*o,c=t.length-1,p=t[c],f=0,d=0,m=0;--c>=0;)s=d,a=f,p=l*(d=p)-s-u*(f=m)+t[c],m=u*d-a+l*f;return[(l=r*h)*p-(u=n*o)*m,l*m+u*p]}var ke={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ce.init.apply(this),this.forward=Ce.forward,this.inverse=Ce.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),e=i;this.cgb[0]=i*(2+i*(-2/3+i*(i*(116/45+i*(26/45+i*(-2854/675)))-2))),this.cbg[0]=i*(i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))-2),e*=i,this.cgb[1]=e*(7/3+i*(i*(-227/45+i*(2704/315+i*(2323/945)))-1.6)),this.cbg[1]=e*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),e*=i,this.cgb[2]=e*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=e*(-26/15+i*(34/21+i*(1.6+i*(-12686/2835)))),e*=i,this.cgb[3]=e*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=e*(1237/630+i*(i*(-24832/14175)-2.4)),e*=i,this.cgb[4]=e*(4174/315+i*(-144838/6237)),this.cbg[4]=e*(-734/315+i*(109598/31185)),e*=i,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=i*(i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))-.5),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=e*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=e*(13/48+i*(i*(557/1440+i*(281/630+i*(-1983433/1935360)))-.6)),e*=i,this.utg[2]=e*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=e*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),e*=i,this.utg[3]=e*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=e*(49561/161280+i*(-179/168+i*(6601661/7257600))),e*=i,this.utg[4]=e*(-4583/161280+i*(108847/3991680)),this.gtu[4]=e*(34729/80640+i*(-3418889/1995840)),e*=i,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=.6650675310896665*e;var s=Le(this.cbg,this.lat0);this.Zb=-this.Qn*(s+function(t,i){for(var e,s=2*Math.cos(i),a=t.length-1,r=t[a],n=0;--a>=0;)e=s*r-n+t[a],n=r,r=e;return Math.sin(i)*e}(this.gtu,2*s))},forward:function(t){var i=vi(t.x-this.long0),e=t.y;e=Le(this.cbg,e);var s=Math.sin(e),a=Math.cos(e),r=Math.sin(i),n=Math.cos(i);e=Math.atan2(s,n*a),i=Math.atan2(r*a,Ie(s,a*n)),i=Pe(Math.tan(i));var o,h,l=Oe(this.gtu,2*e,2*i);return e+=l[0],i+=l[1],Math.abs(i)<=2.623395162778?(o=this.a*(this.Qn*i)+this.x0,h=this.a*(this.Qn*e+this.Zb)+this.y0):(o=1/0,h=1/0),t.x=o,t.y=h,t},inverse:function(t){var i,e,s=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(a=(a-this.Zb)/this.Qn,s/=this.Qn,Math.abs(s)<=2.623395162778){var r=Oe(this.utg,2*a,2*s);a+=r[0],s+=r[1],s=Math.atan(Ae(s));var n=Math.sin(a),o=Math.cos(a),h=Math.sin(s),l=Math.cos(s);a=Math.atan2(n*l,Ie(h,l*o)),i=vi((s=Math.atan2(h,l*o))+this.long0),e=Le(this.cgb,a)}else i=1/0,e=1/0;return t.x=i,t.y=e,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var Te={init:function(){var t=function(t,i){if(void 0===t){if((t=Math.floor(30*(vi(i)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Qt,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ke.init.apply(this),this.forward=ke.forward,this.inverse=ke.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Ne(t,i){return Math.pow((1-t)/(1+t),i)}var Ee={init:function(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Ht)/(Math.pow(Math.tan(.5*this.lat0+Ht),this.C)*Ne(this.e*t,this.ratexp))},forward:function(t){var i=t.x,e=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Ht),this.C)*Ne(this.e*Math.sin(e),this.ratexp))-Wt,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,e=t.y,s=Math.pow(Math.tan(.5*e+Ht)/this.K,1/this.C),a=20;a>0&&(e=2*Math.atan(s*Ne(this.e*Math.sin(t.y),-.5*this.e))-Wt,!(Math.abs(e-t.y)<1e-14));--a)t.y=e;return a?(t.x=i,t.y=e,t):null},names:["gauss"]};var Re={init:function(){Ee.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var i,e,s,a;return t.x=vi(t.x-this.long0),Ee.forward.apply(this,[t]),i=Math.sin(t.y),e=Math.cos(t.y),s=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*e*s),t.x=a*e*Math.sin(t.x),t.y=a*(this.cosc0*i-this.sinc0*e*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var i,e,s,a,r;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,r=Math.sqrt(t.x*t.x+t.y*t.y)){var n=2*Math.atan2(r,this.R2);i=Math.sin(n),e=Math.cos(n),a=Math.asin(e*this.sinc0+t.y*i*this.cosc0/r),s=Math.atan2(t.x*i,r*this.cosc0*e-t.y*this.sinc0*i)}else a=this.phic0,s=0;return t.x=s,t.y=a,Ee.inverse.apply(this,[t]),t.x=vi(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var qe={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Jt&&(this.k0=.5*(1+Mi(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Jt&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Jt&&(this.k0=.5*this.cons*_i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/bi(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=_i(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Wt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,e,s,a,r,n,o=t.x,h=t.y,l=Math.sin(h),u=Math.cos(h),c=vi(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=Jt&&Math.abs(h+this.lat0)<=Jt?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*l+this.coslat0*u*Math.cos(c)),t.x=this.a*i*u*Math.sin(c)+this.x0,t.y=this.a*i*(this.coslat0*l-this.sinlat0*u*Math.cos(c))+this.y0,t):(e=2*Math.atan(this.ssfn_(h,l,this.e))-Wt,a=Math.cos(e),s=Math.sin(e),Math.abs(this.coslat0)<=Jt?(r=bi(this.e,h*this.con,this.con*l),n=2*this.a*this.k0*r/this.cons,t.x=this.x0+n*Math.sin(o-this.long0),t.y=this.y0-this.con*n*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<Jt?(i=2*this.a*this.k0/(1+a*Math.cos(c)),t.y=i*s):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*a*Math.cos(c))),t.y=i*(this.cosX0*s-this.sinX0*a*Math.cos(c))+this.y0),t.x=i*a*Math.sin(c)+this.x0,t))},inverse:function(t){var i,e,s,a,r;t.x-=this.x0,t.y-=this.y0;var n=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(n/(2*this.a*this.k0));return i=this.long0,e=this.lat0,n<=Jt?(t.x=i,t.y=e,t):(e=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/n),i=Math.abs(this.coslat0)<Jt?this.lat0>0?vi(this.long0+Math.atan2(t.x,-1*t.y)):vi(this.long0+Math.atan2(t.x,t.y)):vi(this.long0+Math.atan2(t.x*Math.sin(o),n*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=i,t.y=e,t)}if(Math.abs(this.coslat0)<=Jt){if(n<=Jt)return e=this.lat0,i=this.long0,t.x=i,t.y=e,t;t.x*=this.con,t.y*=this.con,s=n*this.cons/(2*this.a*this.k0),e=this.con*xi(this.e,s),i=this.con*vi(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else a=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,n<=Jt?r=this.X0:(r=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/n),i=vi(this.long0+Math.atan2(t.x*Math.sin(a),n*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)))),e=-1*xi(this.e,Math.tan(.5*(Wt+r)));return t.x=i,t.y=e,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,i,e){return i*=e,Math.tan(.5*(Wt+t))*Math.pow((1-i)/(1+i),.5*e)}};var Fe={init:function(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),e=this.a,s=1/this.rf,a=2*s-Math.pow(s,2),r=this.e=Math.sqrt(a);this.R=this.k0*e*Math.sqrt(1-a)/(1-a*Math.pow(i,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),h=Math.log((1+r*i)/(1-r*i));this.K=n-this.alpha*o+this.alpha*r/2*h},forward:function(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(i+e)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),r=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(r))),o=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(r));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*n+this.x0,t},inverse:function(t){for(var i=t.x-this.x0,e=t.y-this.y0,s=i/this.R,a=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),n=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),o=this.lambda0+n/this.alpha,h=0,l=r,u=-1e3,c=0;Math.abs(l-u)>1e-7;){if(++c>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=o,t.y=l,t},names:["somerc"]},Ge=1e-7;var je={init:function(){var t,i,e,s,a,r,n,o,h,l,u,c,p,f=0,d=0,m=0,y=0,g=0,_=0,M=0;this.no_off=(p="object"==typeof(c=this).PROJECTION?Object.keys(c.PROJECTION)[0]:c.PROJECTION,"no_uoff"in c||"no_off"in c||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(p)),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),v&&(M=this.alpha),b&&(f=this.rectified_grid_angle*Qt),v||b)d=this.longc;else if(m=this.long1,g=this.lat1,y=this.long2,_=this.lat2,Math.abs(g-_)<=Ge||(t=Math.abs(g))<=Ge||Math.abs(t-Wt)<=Ge||Math.abs(Math.abs(this.lat0)-Wt)<=Ge||Math.abs(Math.abs(_)-Wt)<=Ge)throw new Error;var x=1-this.es;i=Math.sqrt(x),Math.abs(this.lat0)>Jt?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),t=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*i/t,(a=(s=this.B*i/(e*Math.sqrt(t)))*s-1)<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(bi(this.e,this.lat0,o),this.B)):(this.B=1/i,this.A=this.k0,this.E=s=a=1),v||b?(v?(u=Math.asin(Math.sin(M)/s),b||(f=M)):(u=f,M=Math.asin(s*Math.sin(u))),this.lam0=d-Math.asin(.5*(a-1/a)*Math.tan(u))/this.B):(r=Math.pow(bi(this.e,g,Math.sin(g)),this.B),n=Math.pow(bi(this.e,_,Math.sin(_)),this.B),a=this.E/r,h=(n-r)/(n+r),l=((l=this.E*this.E)-n*r)/(l+n*r),(t=m-y)<-Math.pi?y-=Xt:t>Math.pi&&(y+=Xt),this.lam0=vi(.5*(m+y)-Math.atan(l*Math.tan(.5*this.B*(m-y))/h)/this.B),u=Math.atan(2*Math.sin(this.B*vi(m-this.lam0))/(a-1/a)),f=M=Math.asin(s*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(f),this.cosrot=Math.cos(f),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(s*s-1)/Math.cos(M))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Ht-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(Ht+a))},forward:function(t){var i,e,s,a,r,n,o,h,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Wt)>Jt){if(i=.5*((r=this.E/Math.pow(bi(this.e,t.y,Math.sin(t.y)),this.B))-(n=1/r)),e=.5*(r+n),a=Math.sin(this.B*t.x),s=(i*this.singam-a*this.cosgam)/e,Math.abs(Math.abs(s)-1)<Jt)throw new Error;h=.5*this.ArB*Math.log((1-s)/(1+s)),n=Math.cos(this.B*t.x),o=Math.abs(n)<Ge?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+a*this.singam,n)}else h=t.y>0?this.v_pole_n:this.v_pole_s,o=this.ArB*t.y;return this.no_rot?(l.x=o,l.y=h):(o-=this.u_0,l.x=h*this.cosrot+o*this.sinrot,l.y=o*this.cosrot-h*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var i,e,s,a,r,n,o,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(e=t.y,i=t.x):(e=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),a=.5*((s=Math.exp(-this.BrA*e))-1/s),r=.5*(s+1/s),o=((n=Math.sin(this.BrA*i))*this.cosgam+a*this.singam)/r,Math.abs(Math.abs(o)-1)<Jt)h.x=0,h.y=o<0?-Wt:Wt;else{if(h.y=this.E/Math.sqrt((1+o)/(1-o)),h.y=xi(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(a*this.cosgam-n*this.singam,Math.cos(this.BrA*i))}return h.x+=this.lam0,h},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var Ue={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Jt)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),e=Math.cos(this.lat1),s=_i(this.e,i,e),a=bi(this.e,this.lat1,i),r=Math.sin(this.lat2),n=Math.cos(this.lat2),o=_i(this.e,r,n),h=bi(this.e,this.lat2,r),l=bi(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Jt?this.ns=Math.log(s/o)/Math.log(a/h):this.ns=i,isNaN(this.ns)&&(this.ns=i),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,e=t.y;Math.abs(2*Math.abs(e)-Math.PI)<=Jt&&(e=Mi(e)*(Wt-2e-10));var s,a,r=Math.abs(Math.abs(e)-Wt);if(r>Jt)s=bi(this.e,e,Math.sin(e)),a=this.a*this.f0*Math.pow(s,this.ns);else{if((r=e*this.ns)<=0)return null;a=0}var n=this.ns*vi(i-this.long0);return t.x=this.k0*(a*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(n))+this.y0,t},inverse:function(t){var i,e,s,a,r,n=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(n*n+o*o),e=1):(i=-Math.sqrt(n*n+o*o),e=-1);var h=0;if(0!==i&&(h=Math.atan2(e*n,e*o)),0!==i||this.ns>0){if(e=1/this.ns,s=Math.pow(i/(this.a*this.f0),e),-9999===(a=xi(this.e,s)))return null}else a=-Wt;return r=vi(h/this.ns+this.long0),t.x=r,t.y=a,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var ze={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var i,e,s,a,r,n,o,h=t.x,l=t.y,u=vi(h-this.long0);return i=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/i)-this.s45),s=-u*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(s)),r=Math.asin(Math.cos(e)*Math.sin(s)/Math.cos(a)),n=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=o*Math.cos(n)/1,t.x=o*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var i,e,s,a,r,n,o,h=t.x;t.x=t.y,t.y=h,this.czech||(t.y*=-1,t.x*=-1),r=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x)/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),e=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(i)),t.x=this.long0-e/this.alfa,n=i,o=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(o=1),n=t.y,l+=1}while(0===o&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function Be(t,i,e,s,a){return t*a-i*Math.sin(2*a)+e*Math.sin(4*a)-s*Math.sin(6*a)}function De(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ze(t){return.375*t*(1+.25*t*(1+.46875*t))}function We(t){return.05859375*t*t*(1+.75*t)}function Je(t){return t*t*t*(35/3072)}function Qe(t,i,e){var s=i*e;return t/Math.sqrt(1-s*s)}function Ve(t){return Math.abs(t)<Wt?t:t-Mi(t)*Math.PI}function He(t,i,e,s,a){var r,n;r=t/i;for(var o=0;o<15;o++)if(r+=n=(t-(i*r-e*Math.sin(2*r)+s*Math.sin(4*r)-a*Math.sin(6*r)))/(i-2*e*Math.cos(2*r)+4*s*Math.cos(4*r)-6*a*Math.cos(6*r)),Math.abs(n)<=1e-10)return r;return NaN}var Xe={init:function(){this.sphere||(this.e0=De(this.es),this.e1=Ze(this.es),this.e2=We(this.es),this.e3=Je(this.es),this.ml0=this.a*Be(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var i,e,s=t.x,a=t.y;if(s=vi(s-this.long0),this.sphere)i=this.a*Math.asin(Math.cos(a)*Math.sin(s)),e=this.a*(Math.atan2(Math.tan(a),Math.cos(s))-this.lat0);else{var r=Math.sin(a),n=Math.cos(a),o=Qe(this.a,this.e,r),h=Math.tan(a)*Math.tan(a),l=s*Math.cos(a),u=l*l,c=this.es*n*n/(1-this.es);i=o*l*(1-u*h*(1/6-(8-h+8*c)*u/120)),e=this.a*Be(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+o*r/n*u*(.5+(5-h+6*c)*u/24)}return t.x=i+this.x0,t.y=e+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,e,s=t.x/this.a,a=t.y/this.a;if(this.sphere){var r=a+this.lat0;i=Math.asin(Math.sin(r)*Math.cos(s)),e=Math.atan2(Math.tan(s),Math.cos(r))}else{var n=He(this.ml0/this.a+a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-Wt)<=Jt)return t.x=this.long0,t.y=Wt,a<0&&(t.y*=-1),t;var o=Qe(this.a,this.e,Math.sin(n)),h=o*o*o/this.a/this.a*(1-this.es),l=Math.pow(Math.tan(n),2),u=s*this.a/o,c=u*u;i=n-o*Math.tan(n)/h*u*u*(.5-(1+3*l)*u*u/24),e=u*(1-c*(l/3+(1+3*l)*l*c/15))/Math.cos(n)}return t.x=vi(e+this.long0),t.y=Ve(i),t},names:["Cassini","Cassini_Soldner","cass"]};function Ke(t,i){var e;return t>1e-7?(1-t*t)*(i/(1-(e=t*i)*e)-.5/t*Math.log((1-e)/(1+e))):2*i}var Ye=.3333333333333333,$e=.17222222222222222,ts=.10257936507936508,is=.06388888888888888,es=.0664021164021164,ss=.016415012942191543;var as={init:function(){var t,i=Math.abs(this.lat0);if(Math.abs(i-Wt)<Jt?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<Jt?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Ke(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var i,e=[];return e[0]=t*Ye,i=t*t,e[0]+=i*$e,e[1]=i*is,i*=t,e[0]+=i*ts,e[1]+=i*es,e[2]=i*ss,e}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ke(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,e,s,a,r,n,o,h,l,u,c=t.x,p=t.y;if(c=vi(c-this.long0),this.sphere){if(r=Math.sin(p),u=Math.cos(p),s=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((e=this.mode===this.EQUIT?1+u*s:1+this.sinph0*r+this.cosph0*u*s)<=Jt)return null;i=(e=Math.sqrt(2/e))*u*Math.sin(c),e*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*u*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(p+this.lat0)<Jt)return null;e=Ht-.5*p,i=(e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)))*Math.sin(c),e*=s}}else{switch(o=0,h=0,l=0,s=Math.cos(c),a=Math.sin(c),r=Math.sin(p),n=Ke(this.e,r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=n/this.qp,h=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:l=1+this.sinb1*o+this.cosb1*h*s;break;case this.EQUIT:l=1+h*s;break;case this.N_POLE:l=Wt+p,n=this.qp-n;break;case this.S_POLE:l=p-Wt,n=this.qp+n}if(Math.abs(l)<Jt)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),e=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*o-this.sinb1*h*s):(l=Math.sqrt(2/(1+h*s)))*o*this.ymf,i=this.xmf*l*h*a;break;case this.N_POLE:case this.S_POLE:n>=0?(i=(l=Math.sqrt(n))*a,e=s*(this.mode===this.S_POLE?l:-l)):i=e=0}}return t.x=this.a*i+this.x0,t.y=this.a*e+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,e,s,a,r,n,o,h,l,u,c=t.x/this.a,p=t.y/this.a;if(this.sphere){var f,d=0,m=0;if((e=.5*(f=Math.sqrt(c*c+p*p)))>1)return null;switch(e=2*Math.asin(e),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(e),d=Math.cos(e)),this.mode){case this.EQUIT:e=Math.abs(f)<=Jt?0:Math.asin(p*m/f),c*=m,p=d*f;break;case this.OBLIQ:e=Math.abs(f)<=Jt?this.lat0:Math.asin(d*this.sinph0+p*m*this.cosph0/f),c*=m*this.cosph0,p=(d-Math.sin(e)*this.sinph0)*f;break;case this.N_POLE:p=-p,e=Wt-e;break;case this.S_POLE:e-=Wt}i=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,p):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,p*=this.dd,(n=Math.sqrt(c*c+p*p))<Jt)return t.x=this.long0,t.y=this.lat0,t;a=2*Math.asin(.5*n/this.rq),s=Math.cos(a),c*=a=Math.sin(a),this.mode===this.OBLIQ?(o=s*this.sinb1+p*a*this.cosb1/n,r=this.qp*o,p=n*this.cosb1*s-p*this.sinb1*a):(o=p*a/n,r=this.qp*o,p=n*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(r=c*c+p*p))return t.x=this.long0,t.y=this.lat0,t;o=1-r/this.qp,this.mode===this.S_POLE&&(o=-o)}i=Math.atan2(c,p),h=Math.asin(o),l=this.apa,u=h+h,e=h+l[0]*Math.sin(u)+l[1]*Math.sin(u+u)+l[2]*Math.sin(u+u+u)}return t.x=vi(this.long0+i),t.y=e,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function rs(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var ns={init:function(){Math.abs(this.lat1+this.lat2)<Jt||(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=_i(this.e3,this.sin_po,this.cos_po),this.qs1=Ke(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=_i(this.e3,this.sin_po,this.cos_po),this.qs2=Ke(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ke(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>Jt?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var i=t.x,e=t.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var s=Ke(this.e3,this.sin_phi,this.cos_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,r=this.ns0*vi(i-this.long0),n=a*Math.sin(r)+this.x0,o=this.rh-a*Math.cos(r)+this.y0;return t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a,r,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),a=0,0!==i&&(a=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,this.sphere?n=Math.asin((this.c-s*s)/(2*this.ns0)):(e=(this.c-s*s)/this.ns0,n=this.phi1z(this.e3,e)),r=vi(a/this.ns0+this.long0),t.x=r,t.y=n,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,i){var e,s,a,r,n=rs(.5*i);if(t<Jt)return n;for(var o=t*t,h=1;h<=25;h++)if(n+=r=.5*(a=1-(s=t*(e=Math.sin(n)))*s)*a/Math.cos(n)*(i/(1-o)-e/a+.5/t*Math.log((1-s)/(1+s))),Math.abs(r)<=1e-7)return n;return null}};var os={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var i,e,s,a,r,n,o,h=t.x,l=t.y;return s=vi(h-this.long0),i=Math.sin(l),e=Math.cos(l),a=Math.cos(s),1,(r=this.sin_p14*i+this.cos_p14*e*a)>0||Math.abs(r)<=Jt?(n=this.x0+1*this.a*e*Math.sin(s)/r,o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*e*a)/r):(n=this.x0+this.infinity_dist*e*Math.sin(s),o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*e*a)),t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a,r,n;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(i,this.rc),e=Math.sin(a),n=rs((s=Math.cos(a))*this.sin_p14+t.y*e*this.cos_p14/i),r=Math.atan2(t.x*e,i*this.cos_p14*s-t.y*this.sin_p14*e),r=vi(this.long0+r)):(n=this.phic0,r=0),t.x=r,t.y=n,t},names:["gnom"]};var hs={init:function(){this.sphere||(this.k0=_i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var i,e,s=t.x,a=t.y,r=vi(s-this.long0);if(this.sphere)i=this.x0+this.a*r*Math.cos(this.lat_ts),e=this.y0+this.a*Math.sin(a)/Math.cos(this.lat_ts);else{var n=Ke(this.e,Math.sin(a));i=this.x0+this.a*this.k0*r,e=this.y0+this.a*n*.5/this.k0}return t.x=i,t.y=e,t},inverse:function(t){var i,e;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=vi(this.long0+t.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(e=function(t,i){var e=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-e)<1e-6)return i<0?-1*Wt:Wt;for(var s,a,r,n,o=Math.asin(.5*i),h=0;h<30;h++)if(a=Math.sin(o),r=Math.cos(o),n=t*a,o+=s=Math.pow(1-n*n,2)/(2*r)*(i/(1-t*t)-a/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),Math.abs(s)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),i=vi(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=e,t},names:["cea"]};var ls={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var i=t.x,e=t.y,s=vi(i-this.long0),a=Ve(e-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*a,t},inverse:function(t){var i=t.x,e=t.y;return t.x=vi(this.long0+(i-this.x0)/(this.a*this.rc)),t.y=Ve(this.lat0+(e-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var us={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=De(this.es),this.e1=Ze(this.es),this.e2=We(this.es),this.e3=Je(this.es),this.ml0=this.a*Be(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var i,e,s,a=t.x,r=t.y,n=vi(a-this.long0);if(s=n*Math.sin(r),this.sphere)Math.abs(r)<=Jt?(i=this.a*n,e=-1*this.a*this.lat0):(i=this.a*Math.sin(s)/Math.tan(r),e=this.a*(Ve(r-this.lat0)+(1-Math.cos(s))/Math.tan(r)));else if(Math.abs(r)<=Jt)i=this.a*n,e=-1*this.ml0;else{var o=Qe(this.a,this.e,Math.sin(r))/Math.tan(r);i=o*Math.sin(s),e=this.a*Be(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+o*(1-Math.cos(s))}return t.x=i+this.x0,t.y=e+this.y0,t},inverse:function(t){var i,e,s,a,r,n,o,h,l;if(s=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=Jt)i=vi(s/this.a+this.long0),e=0;else{var u;for(n=this.lat0+a/this.a,o=s*s/this.a/this.a+n*n,h=n,r=20;r;--r)if(h+=l=-1*(n*(h*(u=Math.tan(h))+1)-h-.5*(h*h+o)*u)/((h-n)/u-1),Math.abs(l)<=Jt){e=h;break}i=vi(this.long0+Math.asin(s*Math.tan(h)/this.a)/Math.sin(e))}else if(Math.abs(a+this.ml0)<=Jt)e=0,i=vi(this.long0+s/this.a);else{var c,p,f,d,m;for(n=(this.ml0+a)/this.a,o=s*s/this.a/this.a+n*n,h=n,r=20;r;--r)if(m=this.e*Math.sin(h),c=Math.sqrt(1-m*m)*Math.tan(h),p=this.a*Be(this.e0,this.e1,this.e2,this.e3,h),f=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),h-=l=(n*(c*(d=p/this.a)+1)-d-.5*c*(d*d+o))/(this.es*Math.sin(2*h)*(d*d+o-2*n*d)/(4*c)+(n-d)*(c*f-2/Math.sin(2*h))-f),Math.abs(l)<=Jt){e=h;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),i=vi(this.long0+Math.asin(s*c/this.a)/Math.sin(e))}return t.x=i,t.y=e,t},names:["Polyconic","poly"]};var cs={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var i,e=t.x,s=t.y-this.lat0,a=e-this.long0,r=s/Zt*1e-5,n=a,o=1,h=0;for(i=1;i<=10;i++)o*=r,h+=this.A[i]*o;var l,u=h,c=n,p=1,f=0,d=0,m=0;for(i=1;i<=6;i++)l=f*u+p*c,p=p*u-f*c,f=l,d=d+this.B_re[i]*p-this.B_im[i]*f,m=m+this.B_im[i]*p+this.B_re[i]*f;return t.x=m*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var i,e,s=t.x,a=t.y,r=s-this.x0,n=(a-this.y0)/this.a,o=r/this.a,h=1,l=0,u=0,c=0;for(i=1;i<=6;i++)e=l*n+h*o,h=h*n-l*o,l=e,u=u+this.C_re[i]*h-this.C_im[i]*l,c=c+this.C_im[i]*h+this.C_re[i]*l;for(var p=0;p<this.iterations;p++){var f,d=u,m=c,y=n,g=o;for(i=2;i<=6;i++)f=m*u+d*c,d=d*u-m*c,m=f,y+=(i-1)*(this.B_re[i]*d-this.B_im[i]*m),g+=(i-1)*(this.B_im[i]*d+this.B_re[i]*m);d=1,m=0;var _=this.B_re[1],M=this.B_im[1];for(i=2;i<=6;i++)f=m*u+d*c,d=d*u-m*c,m=f,_+=i*(this.B_re[i]*d-this.B_im[i]*m),M+=i*(this.B_im[i]*d+this.B_re[i]*m);var v=_*_+M*M;u=(y*_+g*M)/v,c=(g*_-y*M)/v}var b=u,x=c,w=1,S=0;for(i=1;i<=9;i++)w*=b,S+=this.D[i]*w;var C=this.lat0+S*Zt*1e5,A=this.long0+x;return t.x=A,t.y=C,t},names:["New_Zealand_Map_Grid","nzmg"]};var ps={init:function(){},forward:function(t){var i=t.x,e=t.y,s=vi(i-this.long0),a=this.x0+this.a*s,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return t.x=a,t.y=r,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i=vi(this.long0+t.x/this.a),e=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=e,t},names:["Miller_Cylindrical","mill"]};var fs={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=xe(this.es)},forward:function(t){var i,e,s=t.x,a=t.y;if(s=vi(s-this.long0),this.sphere){if(this.m)for(var r=this.n*Math.sin(a),n=20;n;--n){var o=(this.m*a+Math.sin(a)-r)/(this.m+Math.cos(a));if(a-=o,Math.abs(o)<Jt)break}else a=1!==this.n?Math.asin(this.n*Math.sin(a)):a;i=this.a*this.C_x*s*(this.m+Math.cos(a)),e=this.a*this.C_y*a}else{var h=Math.sin(a),l=Math.cos(a);e=this.a*we(a,h,l,this.en),i=this.a*s*l/Math.sqrt(1-this.es*h*h)}return t.x=i,t.y=e,t},inverse:function(t){var i,e,s;return t.x-=this.x0,e=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,e/=this.C_x*(this.m+Math.cos(i)),this.m?i=rs((this.m*i+Math.sin(i))/this.n):1!==this.n&&(i=rs(Math.sin(i)/this.n)),e=vi(e+this.long0),i=Ve(i)):(i=Se(t.y/this.a,this.es,this.en),(s=Math.abs(i))<Wt?(s=Math.sin(i),e=vi(this.long0+t.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(i)))):s-Jt<Wt&&(e=this.long0)),t.x=e,t.y=i,t},names:["Sinusoidal","sinu"]};var ds={init:function(){},forward:function(t){for(var i=t.x,e=t.y,s=vi(i-this.long0),a=e,r=Math.PI*Math.sin(e);;){var n=-(a+Math.sin(a)-r)/(1+Math.cos(a));if(a+=n,Math.abs(n)<Jt)break}a/=2,Math.PI/2-Math.abs(e)<Jt&&(s=0);var o=.900316316158*this.a*s*Math.cos(a)+this.x0,h=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=o,t.y=h,t},inverse:function(t){var i,e;t.x-=this.x0,t.y-=this.y0,e=t.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),i=Math.asin(e);var s=vi(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),e=(2*i+Math.sin(2*i))/Math.PI,Math.abs(e)>1&&(e=1);var a=Math.asin(e);return t.x=s,t.y=a,t},names:["Mollweide","moll"]};var ms={init:function(){Math.abs(this.lat1+this.lat2)<Jt||(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=De(this.es),this.e1=Ze(this.es),this.e2=We(this.es),this.e3=Je(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=_i(this.e,this.sinphi,this.cosphi),this.ml1=Be(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Jt?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=_i(this.e,this.sinphi,this.cosphi),this.ml2=Be(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=Be(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var i,e=t.x,s=t.y;if(this.sphere)i=this.a*(this.g-s);else{var a=Be(this.e0,this.e1,this.e2,this.e3,s);i=this.a*(this.g-a)}var r=this.ns*vi(e-this.long0),n=this.x0+i*Math.sin(r),o=this.y0+this.rh-i*Math.cos(r);return t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var r=0;return 0!==e&&(r=Math.atan2(i*t.x,i*t.y)),this.sphere?(a=vi(this.long0+r/this.ns),s=Ve(this.g-e/this.a),t.x=a,t.y=s,t):(s=He(this.g-e/this.a,this.e0,this.e1,this.e2,this.e3),a=vi(this.long0+r/this.ns),t.x=a,t.y=s,t)},names:["Equidistant_Conic","eqdc"]};var ys={init:function(){this.R=this.a},forward:function(t){var i,e,s=t.x,a=t.y,r=vi(s-this.long0);Math.abs(a)<=Jt&&(i=this.x0+this.R*r,e=this.y0);var n=rs(2*Math.abs(a/Math.PI));(Math.abs(r)<=Jt||Math.abs(Math.abs(a)-Wt)<=Jt)&&(i=this.x0,e=a>=0?this.y0+Math.PI*this.R*Math.tan(.5*n):this.y0+Math.PI*this.R*-Math.tan(.5*n));var o=.5*Math.abs(Math.PI/r-r/Math.PI),h=o*o,l=Math.sin(n),u=Math.cos(n),c=u/(l+u-1),p=c*c,f=c*(2/l-1),d=f*f,m=Math.PI*this.R*(o*(c-d)+Math.sqrt(h*(c-d)*(c-d)-(d+h)*(p-d)))/(d+h);r<0&&(m=-m),i=this.x0+m;var y=h+c;return m=Math.PI*this.R*(f*y-o*Math.sqrt((d+h)*(h+1)-y*y))/(d+h),e=a>=0?this.y0+m:this.y0-m,t.x=i,t.y=e,t},inverse:function(t){var i,e,s,a,r,n,o,h,l,u,c,p;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,r=(s=t.x/c)*s+(a=t.y/c)*a,c=3*(a*a/(h=-2*(n=-Math.abs(a)*(1+r))+1+2*a*a+r*r)+(2*(o=n-2*a*a+s*s)*o*o/h/h/h-9*n*o/h/h)/27)/(l=(n-o*o/3/h)/h)/(u=2*Math.sqrt(-l/3)),Math.abs(c)>1&&(c=c>=0?1:-1),p=Math.acos(c)/3,e=t.y>=0?(-u*Math.cos(p+Math.PI/3)-o/3/h)*Math.PI:-(-u*Math.cos(p+Math.PI/3)-o/3/h)*Math.PI,i=Math.abs(s)<Jt?this.long0:vi(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(s*s-a*a)+r*r))/2/s),t.x=i,t.y=e,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var gs={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var i,e,s,a,r,n,o,h,l,u,c,p,f,d,m,y,g,_,M,v,b,x,w=t.x,S=t.y,C=Math.sin(t.y),A=Math.cos(t.y),I=vi(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Jt?(t.x=this.x0+this.a*(Wt-S)*Math.sin(I),t.y=this.y0-this.a*(Wt-S)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=Jt?(t.x=this.x0+this.a*(Wt+S)*Math.sin(I),t.y=this.y0+this.a*(Wt+S)*Math.cos(I),t):(_=this.sin_p12*C+this.cos_p12*A*Math.cos(I),g=(y=Math.acos(_))?y/Math.sin(y):1,t.x=this.x0+this.a*g*A*Math.sin(I),t.y=this.y0+this.a*g*(this.cos_p12*C-this.sin_p12*A*Math.cos(I)),t):(i=De(this.es),e=Ze(this.es),s=We(this.es),a=Je(this.es),Math.abs(this.sin_p12-1)<=Jt?(r=this.a*Be(i,e,s,a,Wt),n=this.a*Be(i,e,s,a,S),t.x=this.x0+(r-n)*Math.sin(I),t.y=this.y0-(r-n)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=Jt?(r=this.a*Be(i,e,s,a,Wt),n=this.a*Be(i,e,s,a,S),t.x=this.x0+(r+n)*Math.sin(I),t.y=this.y0+(r+n)*Math.cos(I),t):(o=C/A,h=Qe(this.a,this.e,this.sin_p12),l=Qe(this.a,this.e,C),u=Math.atan((1-this.es)*o+this.es*h*this.sin_p12/(l*A)),M=0===(c=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(c)-Math.PI)<=Jt?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(I)*Math.cos(u)/Math.sin(c)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),y=h*M*(1-(v=M*M)*(m=(f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*f)*(1-m)/6+(b=v*M)/8*(d=p*f)*(1-2*m)+(x=b*M)/120*(m*(4-7*m)-3*p*p*(1-7*m))-x*M/48*d),t.x=this.x0+y*Math.sin(c),t.y=this.y0+y*Math.cos(c),t))},inverse:function(t){var i,e,s,a,r,n,o,h,l,u,c,p,f,d,m,y,g,_,M,v,b,x,w;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*Wt*this.a)return;return e=i/this.a,s=Math.sin(e),a=Math.cos(e),r=this.long0,Math.abs(i)<=Jt?n=this.lat0:(n=rs(a*this.sin_p12+t.y*s*this.cos_p12/i),o=Math.abs(this.lat0)-Wt,r=Math.abs(o)<=Jt?this.lat0>=0?vi(this.long0+Math.atan2(t.x,-t.y)):vi(this.long0-Math.atan2(-t.x,t.y)):vi(this.long0+Math.atan2(t.x*s,i*this.cos_p12*a-t.y*this.sin_p12*s))),t.x=r,t.y=n,t}return h=De(this.es),l=Ze(this.es),u=We(this.es),c=Je(this.es),Math.abs(this.sin_p12-1)<=Jt?(n=He(((p=this.a*Be(h,l,u,c,Wt))-(i=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,h,l,u,c),r=vi(this.long0+Math.atan2(t.x,-1*t.y)),t.x=r,t.y=n,t):Math.abs(this.sin_p12+1)<=Jt?(p=this.a*Be(h,l,u,c,Wt),n=He(((i=Math.sqrt(t.x*t.x+t.y*t.y))-p)/this.a,h,l,u,c),r=vi(this.long0+Math.atan2(t.x,t.y)),t.x=r,t.y=n,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),m=Math.atan2(t.x,t.y),f=Qe(this.a,this.e,this.sin_p12),y=Math.cos(m),_=-(g=this.e*this.cos_p12*y)*g/(1-this.es),M=3*this.es*(1-_)*this.sin_p12*this.cos_p12*y/(1-this.es),x=1-_*(b=(v=i/f)-_*(1+_)*Math.pow(v,3)/6-M*(1+3*_)*Math.pow(v,4)/24)*b/2-v*b*b*b/6,d=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*y),r=vi(this.long0+Math.asin(Math.sin(m)*Math.sin(b)/Math.cos(d))),w=Math.sin(d),n=Math.atan2((w-this.es*x*this.sin_p12)*Math.tan(d),w*(1-this.es)),t.x=r,t.y=n,t)},names:["Azimuthal_Equidistant","aeqd"]};var _s={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var i,e,s,a,r,n,o,h=t.x,l=t.y;return s=vi(h-this.long0),i=Math.sin(l),e=Math.cos(l),a=Math.cos(s),1,((r=this.sin_p14*i+this.cos_p14*e*a)>0||Math.abs(r)<=Jt)&&(n=1*this.a*e*Math.sin(s),o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*e*a)),t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a,r,n,o;return t.x-=this.x0,t.y-=this.y0,e=rs((i=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),s=Math.sin(e),a=Math.cos(e),n=this.long0,Math.abs(i)<=Jt?(o=this.lat0,t.x=n,t.y=o,t):(o=rs(a*this.sin_p14+t.y*s*this.cos_p14/i),r=Math.abs(this.lat0)-Wt,Math.abs(r)<=Jt?(n=this.lat0>=0?vi(this.long0+Math.atan2(t.x,-t.y)):vi(this.long0-Math.atan2(-t.x,t.y)),t.x=n,t.y=o,t):(n=vi(this.long0+Math.atan2(t.x*s,i*this.cos_p14*a-t.y*this.sin_p14*s)),t.x=n,t.y=o,t))},names:["ortho"]},Ms=1,vs=2,bs=3,xs=4,ws=5,Ss=6,Cs=1,As=2,Is=3,Ps=4;function Ls(t,i,e,s){var a;return t<Jt?(s.value=Cs,a=0):(a=Math.atan2(i,e),Math.abs(a)<=Ht?s.value=Cs:a>Ht&&a<=Wt+Ht?(s.value=As,a-=Wt):a>Wt+Ht||a<=-(Wt+Ht)?(s.value=Is,a=a>=0?a-Kt:a+Kt):(s.value=Ps,a+=Wt)),a}function Os(t,i){var e=t+i;return e<-Kt?e+=Xt:e>+Kt&&(e-=Xt),e}var ks={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Wt-Ht/2?this.face=ws:this.lat0<=-(Wt-Ht/2)?this.face=Ss:Math.abs(this.long0)<=Ht?this.face=Ms:Math.abs(this.long0)<=Wt+Ht?this.face=this.long0>0?vs:xs:this.face=bs,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,e,s,a,r,n,o={x:0,y:0},h={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,e=t.x,this.face===ws)a=Wt-i,e>=Ht&&e<=Wt+Ht?(h.value=Cs,s=e-Wt):e>Wt+Ht||e<=-(Wt+Ht)?(h.value=As,s=e>0?e-Kt:e+Kt):e>-(Wt+Ht)&&e<=-Ht?(h.value=Is,s=e+Wt):(h.value=Ps,s=e);else if(this.face===Ss)a=Wt+i,e>=Ht&&e<=Wt+Ht?(h.value=Cs,s=-e+Wt):e<Ht&&e>=-Ht?(h.value=As,s=-e):e<-Ht&&e>=-(Wt+Ht)?(h.value=Is,s=-e-Wt):(h.value=Ps,s=e>0?-e+Kt:-e-Kt);else{var l,u,c,p,f,d;this.face===vs?e=Os(e,+Wt):this.face===bs?e=Os(e,+Kt):this.face===xs&&(e=Os(e,-Wt)),p=Math.sin(i),f=Math.cos(i),d=Math.sin(e),l=f*Math.cos(e),u=f*d,c=p,this.face===Ms?s=Ls(a=Math.acos(l),c,u,h):this.face===vs?s=Ls(a=Math.acos(u),c,-l,h):this.face===bs?s=Ls(a=Math.acos(-l),c,-u,h):this.face===xs?s=Ls(a=Math.acos(-u),c,l,h):(a=s=0,h.value=Cs)}return n=Math.atan(12/Kt*(s+Math.acos(Math.sin(s)*Math.cos(Ht))-Wt)),r=Math.sqrt((1-Math.cos(a))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(s))))),h.value===As?n+=Wt:h.value===Is?n+=Kt:h.value===Ps&&(n+=1.5*Kt),o.x=r*Math.cos(n),o.y=r*Math.sin(n),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var i,e,s,a,r,n,o,h,l,u,c,p,f={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,e=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=Cs:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=As,i-=Wt):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=Is,i=i<0?i+Kt:i-Kt):(d.value=Ps,i+=Wt),l=Kt/12*Math.tan(i),r=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),n=Math.atan(r),(o=1-(s=Math.cos(i))*s*(a=Math.tan(e))*a*(1-Math.cos(Math.atan(1/Math.cos(n)))))<-1?o=-1:o>1&&(o=1),this.face===ws)h=Math.acos(o),f.phi=Wt-h,d.value===Cs?f.lam=n+Wt:d.value===As?f.lam=n<0?n+Kt:n-Kt:d.value===Is?f.lam=n-Wt:f.lam=n;else if(this.face===Ss)h=Math.acos(o),f.phi=h-Wt,d.value===Cs?f.lam=-n+Wt:d.value===As?f.lam=-n:d.value===Is?f.lam=-n-Wt:f.lam=n<0?-n-Kt:-n+Kt;else{var m,y,g;l=(m=o)*m,y=(l+=(g=l>=1?0:Math.sqrt(1-l)*Math.sin(n))*g)>=1?0:Math.sqrt(1-l),d.value===As?(l=y,y=-g,g=l):d.value===Is?(y=-y,g=-g):d.value===Ps&&(l=y,y=g,g=-l),this.face===vs?(l=m,m=-y,y=l):this.face===bs?(m=-m,y=-y):this.face===xs&&(l=m,m=y,y=-l),f.phi=Math.acos(-g)-Wt,f.lam=Math.atan2(y,m),this.face===vs?f.lam=Os(f.lam,-Wt):this.face===bs?f.lam=Os(f.lam,-Kt):this.face===xs&&(f.lam=Os(f.lam,+Wt))}return 0!==this.es&&(u=f.phi<0?1:0,c=Math.tan(f.phi),p=this.b/Math.sqrt(c*c+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),u&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Ts=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ns=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Es=.8487,Rs=1.3523,qs=Vt/5,Fs=18,Gs=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))};var js={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var i=vi(t.x-this.long0),e=Math.abs(t.y),s=Math.floor(e*qs);s<0?s=0:s>=Fs&&(s=17);var a={x:Gs(Ts[s],e=Vt*(e-.08726646259971647*s))*i,y:Gs(Ns[s],e)};return t.y<0&&(a.y=-a.y),a.x=a.x*this.a*Es+this.x0,a.y=a.y*this.a*Rs+this.y0,a},inverse:function(t){var i={x:(t.x-this.x0)/(this.a*Es),y:Math.abs(t.y-this.y0)/(this.a*Rs)};if(i.y>=1)i.x/=Ts[18][0],i.y=t.y<0?-Wt:Wt;else{var e=Math.floor(i.y*Fs);for(e<0?e=0:e>=Fs&&(e=17);;)if(Ns[e][0]>i.y)--e;else{if(!(Ns[e+1][0]<=i.y))break;++e}var s=Ns[e],a=5*(i.y-s[0])/(Ns[e+1][0]-s[0]);a=function(t,i,e,s){for(var a=i;s;--s){var r=t(a);if(a-=r,Math.abs(r)<e)break}return a}((function(t){return(Gs(s,t)-i.y)/function(t,i){return t[1]+i*(2*t[2]+3*i*t[3])}(s,t)}),a,Jt,100),i.x/=Gs(Ts[e],a),i.y=(5*e+a)*Qt,t.y<0&&(i.y=-i.y)}return i.x=vi(i.x+this.long0),i},names:["Robinson","robin"]};var Us={init:function(){this.name="geocent"},forward:function(t){return Ui(t,this.es,this.a)},inverse:function(t){return zi(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},zs=0,Bs=1,Ds=2,Zs=3,Ws={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var Js={init:function(){if(Object.keys(Ws).forEach(function(t){if(void 0===this[t])this[t]=Ws[t].def;else{if(Ws[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ws[t].num&&(this[t]=parseFloat(this[t]))}Ws[t].degrees&&(this[t]=this[t]*Qt)}.bind(this)),Math.abs(Math.abs(this.lat0)-Wt)<Jt?this.mode=this.lat0<0?Bs:zs:Math.abs(this.lat0)<Jt?this.mode=Ds:(this.mode=Zs,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 t=this.tilt,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var i,e,s,a,r=Math.sin(t.y),n=Math.cos(t.y),o=Math.cos(t.x);switch(this.mode){case Zs:e=this.sinph0*r+this.cosph0*n*o;break;case Ds:e=n*o;break;case Bs:e=-r;break;case zs:e=r}switch(i=(e=this.pn1/(this.p-e))*n*Math.sin(t.x),this.mode){case Zs:e*=this.cosph0*r-this.sinph0*n*o;break;case Ds:e*=r;break;case zs:e*=-n*o;break;case Bs:e*=n*o}return a=1/((s=e*this.cg+i*this.sg)*this.sw*this.h1+this.cw),i=(i*this.cg-e*this.sg)*this.cw*a,e=s*a,t.x=i*this.a,t.y=e*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var i,e,s,a={x:t.x,y:t.y};s=1/(this.pn1-t.y*this.sw),i=this.pn1*t.x*s,e=this.pn1*t.y*this.cw*s,t.x=i*this.cg+e*this.sg,t.y=e*this.cg-i*this.sg;var r=Ie(t.x,t.y);if(Math.abs(r)<Jt)a.x=0,a.y=t.y;else{var n,o;switch(o=1-r*r*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/r+r/this.pn1),n=Math.sqrt(1-o*o),this.mode){case Zs:a.y=Math.asin(n*this.sinph0+t.y*o*this.cosph0/r),t.y=(n-this.sinph0*Math.sin(a.y))*r,t.x*=o*this.cosph0;break;case Ds:a.y=Math.asin(t.y*o/r),t.y=n*r,t.x*=o;break;case zs:a.y=Math.asin(n),t.y=-t.y;break;case Bs:a.y=-Math.asin(n)}a.x=Math.atan2(t.x,t.y)}return t.x=a.x+this.long0,t.y=a.y,t},names:["Tilted_Perspective","tpers"]};var Qs={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var i,e,s,a,r=t.x,n=t.y;if(r-=this.long0,"ellipse"===this.shape){n=Math.atan(this.radius_p2*Math.tan(n));var o=this.radius_p/Ie(this.radius_p*Math.cos(n),Math.sin(n));if(e=o*Math.cos(r)*Math.cos(n),s=o*Math.sin(r)*Math.cos(n),a=o*Math.sin(n),(this.radius_g-e)*e-s*s-a*a*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=this.radius_g-e,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Ie(a,i)),t.y=this.radius_g_1*Math.atan(a/i)):(t.x=this.radius_g_1*Math.atan(s/i),t.y=this.radius_g_1*Math.atan(a/Ie(s,i)))}else"sphere"===this.shape&&(i=Math.cos(n),e=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=this.radius_g-e,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Ie(a,i)),t.y=this.radius_g_1*Math.atan(a/i)):(t.x=this.radius_g_1*Math.atan(s/i),t.y=this.radius_g_1*Math.atan(a/Ie(s,i))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var i,e,s,a,r=-1,n=0,o=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Ie(1,o)):(n=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Ie(1,n));var h=o/this.radius_p;if(i=n*n+h*h+r*r,(s=(e=2*this.radius_g*r)*e-4*i*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-e-Math.sqrt(s))/(2*i),r=this.radius_g+a*r,n*=a,o*=a,t.x=Math.atan2(n,r),t.y=Math.atan(o*Math.cos(t.x)/r),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+o*o)):(n=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+o*o+r*r,(s=(e=2*this.radius_g*r)*e-4*i*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-e-Math.sqrt(s))/(2*i),r=this.radius_g+a*r,n*=a,o*=a,t.x=Math.atan2(n,r),t.y=Math.atan(o*Math.cos(t.x)/r)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};function Vs(t){return null!=t}te.defaultDatum="WGS84",te.Proj=ji,te.WGS84=new te.Proj("WGS84"),te.Point=_e,te.toPoint=Vi,te.defs=fi,te.nadgrid=function(t,i){var e=new DataView(i),s=function(t){var i=t.getInt32(8,!1);if(11===i)return!1;11!==(i=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(e),a=function(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:Ri(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}(e,s);a.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var r=function(t,i,e){for(var s=176,a=[],r=0;r<i.nSubgrids;r++){var n=Fi(t,s,e),o=Gi(t,s,n,e),h=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),l=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);a.push({ll:[Ei(n.lowerLongitude),Ei(n.lowerLatitude)],del:[Ei(n.longitudeInterval),Ei(n.latitudeInterval)],lim:[h,l],count:n.gridNodeCount,cvs:qi(o)})}return a}(e,a,s),n={header:a,subgrids:r};return Ti[t]=n,n},te.transform=Xi,te.mgrs=he,te.version="__VERSION__",function(t){t.Proj.projections.add(Ce),t.Proj.projections.add(ke),t.Proj.projections.add(Te),t.Proj.projections.add(Re),t.Proj.projections.add(qe),t.Proj.projections.add(Fe),t.Proj.projections.add(je),t.Proj.projections.add(Ue),t.Proj.projections.add(ze),t.Proj.projections.add(Xe),t.Proj.projections.add(as),t.Proj.projections.add(ns),t.Proj.projections.add(os),t.Proj.projections.add(hs),t.Proj.projections.add(ls),t.Proj.projections.add(us),t.Proj.projections.add(cs),t.Proj.projections.add(ps),t.Proj.projections.add(fs),t.Proj.projections.add(ds),t.Proj.projections.add(ms),t.Proj.projections.add(ys),t.Proj.projections.add(gs),t.Proj.projections.add(_s),t.Proj.projections.add(ks),t.Proj.projections.add(js),t.Proj.projections.add(Us),t.Proj.projections.add(Js),t.Proj.projections.add(Qs)}(te);var Hs={}.hasOwnProperty;function Xs(t){return!!function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)&&!(t.constructor&&!Hs.call(t,"constructor")&&!Hs.call(t.constructor.prototype,"isPrototypeOf"))}function Ks(t,i,e){if(!t||("string"!=typeof(s=t)||s.constructor!==String))return t;var s;for(var a in i){var r=i[a];if(!r||"Null"===r||"Unknown"===r){if(!e)continue;r=""}t=t.replace(new RegExp("{"+a+"}","gm"),r)}return t}function Ys(){for(var t,i,e,s,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(i=0,e=n.length;i<e;i++)for(t in s=n[i])$s(a[t],s[t])?a[t]=It(It({},a[t]),s[t]):a[t]=s[t];return a}function $s(t,i){return!(!Vs(t)||!Vs(i))&&(!Array.isArray(t)&&!Array.isArray(i)&&!(!Xs(t)||!Xs(i)))}var ta=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"uuid",get:function(){return this._leaflet_id}},{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}},{key:"initialize",value:function(t){var i,s,a=this;if(t.popup&&(i=t.popup,delete t.popup),t.tooltip&&(s=t.tooltip,delete t.tooltip),Gt(Nt(e.prototype),"initialize",this).call(this,function(t){var i;if(!t.symbol)return t;var e=It({},t);null!==(i=t.symbol)&&void 0!==i&&i.styleOptions&&(e.pointToLayer=function(i,e){var s=i.properties,a=function(t,i,e){if(!t)return{};var s=It({},t.styleOptions);if(t.styleField&&i){var a=i[t.styleField],n=t.styleFieldOptions[a];null!=n&&(s=It(It({},s),n))}e&&s.iconUrlForSelect&&(s.iconUrl=s.iconUrlForSelect);if(s.hasOwnProperty("iconUrl"))t.icon=r.default.icon(s);else if(s.hasOwnProperty("iconFont")){var o=20;s.hasOwnProperty("iconSize")&&(o=s.iconSize[0]);var h=s.color||"#000000";s.className="",s.html='<i class="'+s.iconFont+'" style="color:'+h+";font-size:"+o+'px;"></i> ',t.icon=r.default.divIcon(s)}else{var l='<div class="centerat_animation" style="color:'+(s.color||"#0f89f5")+';"><p></p></div>';if(t.nameField)l+=' <div class="layer_divicon_name" style="top: 2px;left: 25px;" >'+i[t.nameField]+"</div>";t.icon=r.default.divIcon({className:"",iconSize:[10,10],iconAnchor:[5,5],popupAnchor:[5,-5],tooltipAnchor:[5,-5],html:l})}return t}(t.symbol,s);return r.default.marker(e,a)},e.style=function(i){var e=i.properties,s=function(t,i){if(!t)return{};var e=t.styleOptions?It({},t.styleOptions):{};if(t.styleField&&i){var s=i[t.styleField],a=t.styleFieldOptions[s];null!=a&&(e=Ys(e,a))}if(i)for(var r in e)e[r]=Ks(e[r],i);e.label&&(e.label=It({},e.label));e.highlight&&(e.highlight=It({},e.highlight));if(o=t.callback,o&&"function"==typeof o){var n=t.callback(i,e);null!=n&&(e=Ys(e,n))}var o;return e}(t.symbol,e);return s});return e}(t)),r.default.Util.stamp(this),this.options.id=n.Util.defaultValue(this.options.id,this.uuid),this.options.pid=n.Util.defaultValue(this.options.pid,-1),this.options.name=n.Util.defaultValue(this.options.name,""),i){var o=this.options.popupOptions||{};this.bindPopup((function(t){var e=t.feature.properties,s=a.name;return o.noTitle?s=null:o.title?s=o.title:o.titleField&&(s=e[o.titleField]),n.Util.getTemplateHtml({title:s,template:i,attr:e})}),{maxWidth:600})}if(s){var h=this.options.tooltipOptions||{};this.bindTooltip((function(t){var i=t.feature.properties,e=a.name;return h.noTitle?e=null:h.title?e=h.title:h.titleField&&(e=i[h.titleField]),n.Util.getTemplateHtml({title:e,template:s,attr:i})}),{direction:"top"})}}},{key:"eachGraphic",value:function(t,i){return this.eachFeature(t,i)}},{key:"getGraphicById",value:function(t){return this.getFeature(t)}}]),e}(St);n.layer.ArcGisFeatureLayer=ta,n.LayerUtil.register("arcgis_feature",ta),r.default.esri=Ct,n.esri=Ct,t.ArcGisDynamicLayer=zt,t.ArcGisFeatureLayer=ta,t.ArcGisImageLayer=jt,t.ArcGisTileLayer=Ut,Object.defineProperty(t,"__esModule",{value:!0})}));
6
+ */function T(t,i){return O(t,i)}function N(t,i){return P(t,i)}function E(t){if("NaN"!==t.xmin&&"NaN"!==t.ymin&&"NaN"!==t.xmax&&"NaN"!==t.ymax){var e=i.latLng(t.ymin,t.xmin),s=i.latLng(t.ymax,t.xmax);return i.latLngBounds(e,s)}return null}function R(t){return{xmin:(t=i.latLngBounds(t)).getSouthWest().lng,ymin:t.getSouthWest().lat,xmax:t.getNorthEast().lng,ymax:t.getNorthEast().lat,spatialReference:{wkid:4326}}}var q=/^(OBJECTID|FID|OID|ID)$/i;function F(t){var i;if(t.objectIdFieldName)i=t.objectIdFieldName;else if(t.fields){for(var e=0;e<=t.fields.length-1;e++)if("esriFieldTypeOID"===t.fields[e].type){i=t.fields[e].name;break}if(!i)for(e=0;e<=t.fields.length-1;e++)if(t.fields[e].name.match(q)){i=t.fields[e].name;break}}return i}function G(t){for(var i in t.attributes)if(i.match(q))return i}function j(t,i){var e,s=t.features||t.results,a=s&&s.length;e=i||F(t);var r={type:"FeatureCollection",features:[]};if(a)for(var n=s.length-1;n>=0;n--){var o=N(s[n],e||G(s[n]));r.features.push(o)}return r}function z(t){return"/"!==(t=i.Util.trim(t))[t.length-1]&&(t+="/"),t}function B(t){if(-1!==t.url.indexOf("?")){t.requestParams=t.requestParams||{};var i=t.url.substring(t.url.indexOf("?")+1);t.url=t.url.split("?")[0],t.requestParams=JSON.parse('{"'+decodeURI(i).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}return t.url=z(t.url.split("?")[0]),t}function U(t){return/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.test(t)}function D(t){var i;switch(t){case"Point":i="esriGeometryPoint";break;case"MultiPoint":i="esriGeometryMultipoint";break;case"LineString":case"MultiLineString":i="esriGeometryPolyline";break;case"Polygon":case"MultiPolygon":i="esriGeometryPolygon"}return i}function Z(t){return t.getSize().x-c.attributionWidthOffset+"px"}function W(t){if(t.attributionControl){if(t.attributionControl._esriAttributionLayerCount||(t.attributionControl._esriAttributionLayerCount=0),0===t.attributionControl._esriAttributionLayerCount){if(!t.attributionControl._esriAttributionAddedOnce){var e=document.createElement("style");e.type="text/css",e.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}",document.getElementsByTagName("head")[0].appendChild(e);var s=document.createElement("style");s.type="text/css",s.innerHTML=".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: "+Z(t)+";}",document.getElementsByTagName("head")[0].appendChild(s),t.on("resize",(function(i){t.attributionControl&&(t.attributionControl._container.style.maxWidth=Z(i.target))})),t.attributionControl._esriAttributionAddedOnce=!0}t.attributionControl.setPrefix(k+' | Powered by <a href="https://www.esri.com">Esri</a>'),i.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution:hover"),i.DomUtil.addClass(t.attributionControl._container,"esri-truncated-attribution")}t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount+1}}function J(t){t.attributionControl&&(t.attributionControl._esriAttributionLayerCount&&1===t.attributionControl._esriAttributionLayerCount&&(t.attributionControl.setPrefix(k),i.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution:hover"),i.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution")),t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount-1)}function Q(t){var e={geometry:null,geometryType:null};return t instanceof i.LatLngBounds?(e.geometry=R(t),e.geometryType="esriGeometryEnvelope",e):(t.getLatLng&&(t=t.getLatLng()),t instanceof i.LatLng&&(t={type:"Point",coordinates:[t.lng,t.lat]}),t instanceof i.GeoJSON&&(t=t.getLayers()[0].feature.geometry,e.geometry=T(t),e.geometryType=D(t.type)),t.toGeoJSON&&(t=t.toGeoJSON()),"Feature"===t.type&&(t=t.geometry),"Point"===t.type||"LineString"===t.type||"Polygon"===t.type||"MultiPolygon"===t.type?(e.geometry=T(t),e.geometryType=D(t.type),e):void v("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))}function H(t,e){u.cors&&g(t,{},i.Util.bind((function(t,s){if(!t){e._esriAttributions=[];for(var a=0;a<s.contributors.length;a++)for(var r=s.contributors[a],n=0;n<r.coverageAreas.length;n++){var o=r.coverageAreas[n],h=i.latLng(o.bbox[0],o.bbox[1]),l=i.latLng(o.bbox[2],o.bbox[3]);e._esriAttributions.push({attribution:r.attribution,score:o.score,bounds:i.latLngBounds(h,l),minZoom:o.zoomMin,maxZoom:o.zoomMax})}e._esriAttributions.sort((function(t,i){return i.score-t.score})),V({target:e})}}),this))}function V(t){var e=t.target,s=e._esriAttributions;if(e&&e.attributionControl){var a=e.attributionControl._container.querySelector(".esri-dynamic-attribution");if(a&&s){for(var r="",n=e.getBounds(),o=i.latLngBounds(n.getSouthWest().wrap(),n.getNorthEast().wrap()),h=e.getZoom(),l=0;l<s.length;l++){var u=s[l],c=u.attribution;!r.match(c)&&u.bounds.intersects(o)&&h>=u.minZoom&&h<=u.maxZoom&&(r+=", "+c)}r=r.substr(2),a.innerHTML=r,a.style.maxWidth=Z(e),e.fire("attributionupdated",{attribution:r})}}}var X={warn:v,cleanUrl:z,getUrlParams:B,isArcgisOnline:U,geojsonTypeToArcGIS:D,responseToFeatureCollection:j,geojsonToArcGIS:T,arcgisToGeoJSON:N,boundsToExtent:R,extentToBounds:E,calcAttributionWidth:Z,setEsriAttribution:W,_setGeometry:Q,_getAttributionData:H,_updateMapAttribution:V,_findIdAttributeFromFeature:G,_findIdAttributeFromResponse:F},K=i.Class.extend({options:{proxy:!1,useCors:h},generateSetter:function(t,e){return i.Util.bind((function(i){return this.params[t]=i,this}),e)},initialize:function(t){if(t.request&&t.options?(this._service=t,i.Util.setOptions(this,t.options)):(i.Util.setOptions(this,t),this.options.url=z(t.url)),this.params=i.Util.extend({},this.params||{}),this.setters)for(var e in this.setters){var s=this.setters[e];this[e]=this.generateSetter(s,this)}},token:function(t){return this._service?this._service.authenticate(t):this.params.token=t,this},apikey:function(t){return this.token(t)},format:function(t){return this.params.returnUnformattedValues=!t,this},request:function(t,e){return this.options.requestParams&&i.Util.extend(this.params,this.options.requestParams),this._service?this._service.request(this.path,this.params,t,e):this._request("request",this.path,this.params,t,e)},_request:function(t,i,e,s,a){var r=this.options.proxy?this.options.proxy+"?"+this.options.url+i:this.options.url+i;return"get"!==t&&"request"!==t||this.options.useCors?b[t](r,e,s,a):b.get.JSONP(r,e,s,a)}});var Y=K.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",returnM:"returnM",transform:"datumTransformation",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSR:4326,outFields:"*"},within:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelWithin",this},crosses:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelCrosses",this},touches:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelTouches",this},overlaps:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelOverlaps",this},bboxIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelEnvelopeIntersects",this},indexIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIndexIntersects",this},nearby:function(t,e){return t=i.latLng(t),this.params.geometry=[t.lng,t.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=e,this.params.inSR=4326,this},where:function(t){return this.params.where=t,this},between:function(t,i){return this.params.time=[t.valueOf(),i.valueOf()],this},simplify:function(t,i){var e=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=e/t.getSize().y*i,this},orderBy:function(t,i){return i=i||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[t,i].join(" "),this},run:function(t,i){return this._cleanParams(),this.options.isModern||U(this.options.url)&&void 0===this.options.isModern?(this.params.f="geojson",this.request((function(e,s){this._trapSQLerrors(e),t.call(i,e,s,s)}),this)):this.request((function(e,s){this._trapSQLerrors(e),t.call(i,e,s&&j(s),s)}),this)},count:function(t,i){return this._cleanParams(),this.params.returnCountOnly=!0,this.request((function(i,e){t.call(this,i,e&&e.count,e)}),i)},ids:function(t,i){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request((function(i,e){t.call(this,i,e&&e.objectIds,e)}),i)},bounds:function(t,i){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request((function(e,s){s&&s.extent&&E(s.extent)?t.call(i,e,E(s.extent),s):(e={message:"Invalid Bounds"},t.call(i,e,null,s))}),i)},distinct:function(){return this.params.returnGeometry=!1,this.params.returnDistinctValues=!0,this},pixelSize:function(t){var e=i.point(t);return this.params.pixelSize=[e.x,e.y],this},layer:function(t){return this.path=t+"/query",this},_trapSQLerrors:function(t){t&&"400"===t.code&&v("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometryParams:function(t){this.params.inSR=4326;var i=Q(t);this.params.geometry=i.geometry,this.params.geometryType=i.geometryType}});function $(t){return new Y(t)}var tt=K.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(t,i){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,i].join(":"),this},simplify:function(t,i){var e=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=e/t.getSize().y*i,this},run:function(t,i){return this.request((function(e,s){t.call(i,e,s&&j(s),s)}),i)}});function it(t){return new tt(t)}var et=K.extend({path:"identify",between:function(t,i){return this.params.time=[t.valueOf(),i.valueOf()],this}});var st=et.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(t){var i=R(t.getBounds()),e=t.getSize();return this.params.imageDisplay=[e.x,e.y,96],this.params.mapExtent=[i.xmin,i.ymin,i.xmax,i.ymax],this},at:function(t){return 2===t.length&&(t=i.latLng(t)),this._setGeometryParams(t),this},layerDef:function(t,i){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,i].join(":"),this},simplify:function(t,i){var e=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=e/t.getSize().y*i,this},run:function(t,i){return this.request((function(e,s){if(e)t.call(i,e,void 0,s);else{var a=j(s);s.results=s.results.reverse();for(var r=0;r<a.features.length;r++){a.features[r].layerId=s.results[r].layerId}t.call(i,void 0,a,s)}}))},_setGeometryParams:function(t){var i=Q(t);this.params.geometry=i.geometry,this.params.geometryType=i.geometryType}});function at(t){return new st(t)}var rt=et.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(t){return t=i.latLng(t),this.params.geometry=JSON.stringify({x:t.lng,y:t.lat,spatialReference:{wkid:4326}}),this.params.geometryType="esriGeometryPoint",this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(t,i){return this.request((function(e,s){t.call(i,e,s&&this._responseToGeoJSON(s),s)}),this)},_responseToGeoJSON:function(t){var i=t.location,e=t.catalogItems,s=t.catalogItemVisibilities,a={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[i.x,i.y]},crs:{type:"EPSG",properties:{code:i.spatialReference.wkid}},properties:{OBJECTID:t.objectId,name:t.name,value:t.value},id:t.objectId}};if(t.properties&&t.properties.Values&&(a.pixel.properties.values=t.properties.Values),e&&e.features&&(a.catalogItems=j(e),s&&s.length===a.catalogItems.features.length))for(var r=s.length-1;r>=0;r--)a.catalogItems.features[r].properties.catalogItemVisibility=s[r];return a}});function nt(t){return new rt(t)}var ot=i.Evented.extend({options:{proxy:!1,useCors:h,timeout:0},initialize:function(t){t=t||{},this._requestQueue=[],this._authenticating=!1,i.Util.setOptions(this,t),this.options.url=z(this.options.url)},get:function(t,i,e,s){return this._request("get",t,i,e,s)},post:function(t,i,e,s){return this._request("post",t,i,e,s)},request:function(t,i,e,s){return this._request("request",t,i,e,s)},metadata:function(t,i){return this._request("get","",{},t,i)},authenticate:function(t){return this._authenticating=!1,this.options.token=t,this._runQueue(),this},getTimeout:function(){return this.options.timeout},setTimeout:function(t){this.options.timeout=t},_request:function(t,e,s,a,r){this.fire("requeststart",{url:this.options.url+e,params:s,method:t},!0);var n=this._createServiceCallback(t,e,s,a,r);if(this.options.token&&(s.token=this.options.token),this.options.requestParams&&i.Util.extend(s,this.options.requestParams),!this._authenticating){var o=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?b[t](o,s,n,r):b.get.JSONP(o,s,n,r)}this._requestQueue.push([t,e,s,a,r])},_createServiceCallback:function(t,e,s,a,r){return i.Util.bind((function(n,o){!n||499!==n.code&&498!==n.code||(this._authenticating=!0,this._requestQueue.push([t,e,s,a,r]),this.fire("authenticationrequired",{authenticate:i.Util.bind(this.authenticate,this)},!0),n.authenticate=i.Util.bind(this.authenticate,this)),a.call(r,n,o),n?this.fire("requesterror",{url:this.options.url+e,params:s,message:n.message,code:n.code,method:t},!0):this.fire("requestsuccess",{url:this.options.url+e,params:s,response:o,method:t},!0),this.fire("requestend",{url:this.options.url+e,params:s,method:t},!0)}),this)},_runQueue:function(){for(var t=this._requestQueue.length-1;t>=0;t--){var i=this._requestQueue[t];this[i.shift()].apply(this,i)}this._requestQueue=[]}});var ht=ot.extend({identify:function(){return at(this)},find:function(){return it(this)},query:function(){return $(this)}});function lt(t){return new ht(t)}var ut=ot.extend({query:function(){return $(this)},identify:function(){return nt(this)}});function ct(t){return new ut(t)}var pt=ot.extend({options:{idAttribute:"OBJECTID"},query:function(){return $(this)},addFeature:function(t,i,e){this.addFeatures(t,i,e)},addFeatures:function(t,i,e){for(var s=t.features?t.features:[t],a=s.length-1;a>=0;a--)delete s[a].id;return t=T(t),t=s.length>1?t:[t],this.post("addFeatures",{features:t},(function(t,s){var a=s&&s.addResults?s.addResults.length>1?s.addResults:s.addResults[0]:void 0;i&&i.call(e,t||s.addResults[0].error,a)}),e)},updateFeature:function(t,i,e){this.updateFeatures(t,i,e)},updateFeatures:function(t,i,e){var s=t.features?t.features:[t];return t=T(t,this.options.idAttribute),t=s.length>1?t:[t],this.post("updateFeatures",{features:t},(function(t,s){var a=s&&s.updateResults?s.updateResults.length>1?s.updateResults:s.updateResults[0]:void 0;i&&i.call(e,t||s.updateResults[0].error,a)}),e)},deleteFeature:function(t,i,e){this.deleteFeatures(t,i,e)},deleteFeatures:function(t,i,e){return this.post("deleteFeatures",{objectIds:t},(function(t,s){var a=s&&s.deleteResults?s.deleteResults.length>1?s.deleteResults:s.deleteResults[0]:void 0;i&&i.call(e,t||s.deleteResults[0].error,a)}),e)}});function ft(t){return new pt(t)}var dt="https:"!==window.location.protocol?"http:":"https:",mt=i.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map"}},Topographic:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map"}},Oceans:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap"}},OceansLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},NationalGeographic:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},GrayLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}},ImageryLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},ShadedRelief:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS"}},ShadedReliefLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:12,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS, NOAA"}},TerrainLabels:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:l?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:dt+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"USGS, National Geographic Society, i-cubed"}},ImageryClarity:{urlTemplate:dt+"//clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community"}},Physical:{urlTemplate:dt+"//{s}.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:8,subdomains:["server","services"],attribution:"U.S. National Park Service"}},ImageryFirefly:{urlTemplate:dt+"//fly.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Firefly/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}}}},initialize:function(t,e){var s;if("object"==typeof t&&t.urlTemplate&&t.options)s=t;else{if("string"!=typeof t||!mt.TILES[t])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Physical", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ImageryClarity", "ImageryFirefly", ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"');s=mt.TILES[t]}var a=i.Util.extend(s.options,e);i.Util.setOptions(this,a),this.options.ignoreDeprecationWarning||console.warn("WARNING: L.esri.BasemapLayer uses data services that are in mature support and are not being updated. Please use L.esri.Vector.vectorBasemapLayer instead. More info: https://esriurl.com/esri-leaflet-basemap"),this.options.token&&-1===s.urlTemplate.indexOf("token=")&&(s.urlTemplate+="?token="+this.options.token),this.options.proxy&&(s.urlTemplate=this.options.proxy+"?"+s.urlTemplate),i.TileLayer.prototype.initialize.call(this,s.urlTemplate,a)},onAdd:function(t){W(t),"esri-labels"===this.options.pane&&this._initPane(),this.options.attributionUrl&&H((this.options.proxy?this.options.proxy+"?":"")+this.options.attributionUrl,t),t.on("moveend",V),i.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){J(t),t.off("moveend",V),i.TileLayer.prototype.onRemove.call(this,t)},_initPane:function(){if(!this._map.getPane(this.options.pane)){var t=this._map.createPane(this.options.pane);t.style.pointerEvents="none",t.style.zIndex=500}},getAttribution:function(){if(this.options.attribution)var t='<span class="esri-dynamic-attribution">'+this.options.attribution+"</span>";return t}});var yt=i.TileLayer.extend({options:{zoomOffsetAllowance:.1,errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEABAMAAACuXLVVAAAAA1BMVEUzNDVszlHHAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAAAAAAAAAB6mUWpAAAADZJREFUeJztwQEBAAAAgiD/r25IQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7waBAAABw08RwAAAAABJRU5ErkJggg=="},statics:{MercatorZoomLevels:{0:156543.033928,1:78271.5169639999,2:39135.7584820001,3:19567.8792409999,4:9783.93962049996,5:4891.96981024998,6:2445.98490512499,7:1222.99245256249,8:611.49622628138,9:305.748113140558,10:152.874056570411,11:76.4370282850732,12:38.2185141425366,13:19.1092570712683,14:9.55462853563415,15:4.77731426794937,16:2.38865713397468,17:1.19432856685505,18:.597164283559817,19:.298582141647617,20:.14929107082381,21:.07464553541191,22:.0373227677059525,23:.0186613838529763}},initialize:function(t){t=B(t=i.Util.setOptions(this,t)),this.tileUrl=(t.proxy?t.proxy+"?":"")+t.url+"tile/{z}/{y}/{x}"+(t.requestParams&&Object.keys(t.requestParams).length>0?i.Util.getParamString(t.requestParams):""),-1!==t.url.indexOf("{s}")&&t.subdomains&&(t.url=t.url.replace("{s}",t.subdomains[0])),this.service=lt(t),this.service.addEventParent(this),new RegExp(/tiles.arcgis(online)?\.com/g).test(t.url)&&(this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}"),t.subdomains=["1","2","3","4"]),this.options.token&&(this.tileUrl+="?token="+this.options.token),i.TileLayer.prototype.initialize.call(this,this.tileUrl,t)},getTileUrl:function(t){var e=this._getZoomForUrl();return i.Util.template(this.tileUrl,i.Util.extend({s:this._getSubdomain(t),x:t.x,y:t.y,z:this._lodMap&&this._lodMap[e]?this._lodMap[e]:e},this.options))},createTile:function(t,e){var s=document.createElement("img");return i.DomEvent.on(s,"load",i.Util.bind(this._tileOnLoad,this,e,s)),i.DomEvent.on(s,"error",i.Util.bind(this._tileOnError,this,e,s)),this.options.crossOrigin&&(s.crossOrigin=""),s.alt="",!this._lodMap||this._lodMap&&this._lodMap[this._getZoomForUrl()]?s.src=this.getTileUrl(t):this.once("lodmap",(function(){s.src=this.getTileUrl(t)}),this),s},onAdd:function(t){W(t),this._lodMap||this.metadata((function(e,s){if(!e&&s.spatialReference){var a=s.spatialReference.latestWkid||s.spatialReference.wkid;if(!this.options.attribution&&t.attributionControl&&s.copyrightText&&(this.options.attribution=s.copyrightText,t.attributionControl.addAttribution(this.getAttribution())),t.options.crs!==i.CRS.EPSG3857||102100!==a&&3857!==a)t.options.crs&&t.options.crs.code&&t.options.crs.code.indexOf(a)>-1||v("L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html");else{this._lodMap={};for(var r=s.tileInfo.lods,n=yt.MercatorZoomLevels,o=0;o<r.length;o++){var h=r[o];for(var l in n){var u=n[l];if(this._withinPercentage(h.resolution,u,this.options.zoomOffsetAllowance)){this._lodMap[l]=h.level;break}}}this.fire("lodmap")}}}),this),i.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){J(t),i.TileLayer.prototype.onRemove.call(this,t)},metadata:function(t,i){return this.service.metadata(t,i),this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(t){var i="?token="+t;return this.tileUrl=this.options.token?this.tileUrl.replace(/\?token=(.+)/g,i):this.tileUrl+i,this.options.token=t,this.service.authenticate(t),this},_withinPercentage:function(t,i,e){return Math.abs(t/i-1)<e}});var gt=i.ImageOverlay.extend({onAdd:function(t){this._topLeft=t.getPixelBounds().min,i.ImageOverlay.prototype.onAdd.call(this,t)},_reset:function(){this._map.options.crs===i.CRS.EPSG3857?i.ImageOverlay.prototype._reset.call(this):i.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}),_t=i.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:h,attribution:null,interactive:!1,alt:""},onAdd:function(t){W(t),this.options.zIndex&&(this.options.position=null),this._update=i.Util.throttle(this._update,this.options.updateInterval,this),t.on("moveend",this._update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?t.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this._update(),this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this.metadata((function(i,e){!i&&!this.options.attribution&&t.attributionControl&&e.copyrightText&&(this.options.attribution=e.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}),this)},onRemove:function(t){J(t),this._currentImage&&this._map.removeLayer(this._currentImage),this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._map.off("moveend",this._update,this)},bindPopup:function(t,e){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=i.popup(e),this._popupFunction=t,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},bringToFront:function(){return this.options.position="front",this._currentImage&&(this._currentImage.bringToFront(),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this.options.position="back",this._currentImage&&(this._currentImage.bringToBack(),this._setAutoZIndex(Math.min)),this},setZIndex:function(t){return this.options.zIndex=t,this._currentImage&&this._currentImage.setZIndex(t),this},_setAutoZIndex:function(t){if(this._currentImage){for(var i,e=this._currentImage.getPane().children,s=-t(-1/0,1/0),a=0,r=e.length;a<r;a++)i=e[a].style.zIndex,e[a]!==this._currentImage._image&&i&&(s=t(s,+i));isFinite(s)&&(this.options.zIndex=s+t(-1,1),this.setZIndex(this.options.zIndex))}},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(t){return this.options.opacity=t,this._currentImage&&this._currentImage.setOpacity(t),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,i){return this.options.from=t,this.options.to=i,this._update(),this},metadata:function(t,i){return this.service.metadata(t,i),this},authenticate:function(t){return this.service.authenticate(t),this},redraw:function(){this._update()},_renderImage:function(t,i,e){if(this._map){if(e&&(t="data:"+e+";base64,"+t),!t)return;var s=new gt(t,i,{opacity:0,crossOrigin:this.options.withCredentials?"use-credentials":this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map),a=function(t){if(s.off("error",a,this),this._map){var e=t.target,r=this._currentImage;e._bounds.equals(i)&&e._bounds.equals(this._map.getBounds())?(this._currentImage=e,"front"===this.options.position?this.bringToFront():"back"===this.options.position&&this.bringToBack(),this.options.zIndex&&this.setZIndex(this.options.zIndex),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),r&&this._map&&this._map.removeLayer(r),r&&r._map&&r._map.removeLayer(r)):this._map.removeLayer(e)}this.fire("load",{bounds:i})};s.once("error",(function(){this._map.removeLayer(s),this.fire("error"),s.off("load",a,this)}),this),s.once("load",a,this)}},_update:function(){if(this._map){var t=this._map.getZoom(),e=this._map.getBounds();if(!(this._animatingZoom||this._map._panTransition&&this._map._panTransition._inProgress))if(t>this.options.maxZoom||t<this.options.minZoom)this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null);else{var s=this._buildExportParams();i.Util.extend(s,this.options.requestParams),s?(this._requestExport(s,e),this.fire("loading",{bounds:e})):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)}}},_renderPopup:function(t,e,s,a){if(t=i.latLng(t),this._shouldRenderPopup&&this._lastClick.equals(t)){var r=this._popupFunction(e,s,a);r&&this._popup.setLatLng(t).setContent(r).openOn(this._map)}},_resetPopupState:function(t){this._shouldRenderPopup=!1,this._lastClick=t.latlng},_calculateBbox:function(){var t=this._map.getPixelBounds(),e=this._map.unproject(t.getBottomLeft()),s=this._map.unproject(t.getTopRight()),a=this._map.options.crs.project(s),r=this._map.options.crs.project(e),n=i.bounds(a,r);return[n.getBottomLeft().x,n.getBottomLeft().y,n.getTopRight().x,n.getTopRight().y].join(",")},_calculateImageSize:function(){var t=this._map.getPixelBounds(),i=this._map.getSize(),e=this._map.unproject(t.getBottomLeft()),s=this._map.unproject(t.getTopRight()),a=this._map.latLngToLayerPoint(s).y,r=this._map.latLngToLayerPoint(e).y;return(a>0||r<i.y)&&(i.y=r-a),i.x+","+i.y}}),Mt=_t.extend({options:{updateInterval:150,format:"jpgpng",transparent:!0,f:"image"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(t){t=B(t),this.service=ct(t),this.service.addEventParent(this),i.Util.setOptions(this,t)},setPixelType:function(t){return this.options.pixelType=t,this._update(),this},getPixelType:function(){return this.options.pixelType},setBandIds:function(t){return i.Util.isArray(t)?this.options.bandIds=t.join(","):this.options.bandIds=t.toString(),this._update(),this},getBandIds:function(){return this.options.bandIds},setNoData:function(t,e){return i.Util.isArray(t)?this.options.noData=t.join(","):this.options.noData=t.toString(),e&&(this.options.noDataInterpretation=e),this._update(),this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(t){this.options.renderingRule=t,this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(t){this.options.mosaicRule=t,this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(t){var e=i.Util.bind((function(e,s,a){e||setTimeout(i.Util.bind((function(){this._renderPopup(t.latlng,e,s,a)}),this),300)}),this),s=this.identify().at(t.latlng);this.options.mosaicRule&&s.setMosaicRule(this.options.mosaicRule),s.run(e),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),i={bbox:this._calculateBbox(),size:this._calculateImageSize(),format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};return this.options.from&&this.options.to&&(i.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.options.pixelType&&(i.pixelType=this.options.pixelType),this.options.interpolation&&(i.interpolation=this.options.interpolation),this.options.compressionQuality&&(i.compressionQuality=this.options.compressionQuality),this.options.bandIds&&(i.bandIds=this.options.bandIds),(0===this.options.noData||this.options.noData)&&(i.noData=this.options.noData),this.options.noDataInterpretation&&(i.noDataInterpretation=this.options.noDataInterpretation),this.service.options.token&&(i.token=this.service.options.token),this.options.renderingRule&&(i.renderingRule=JSON.stringify(this.options.renderingRule)),this.options.mosaicRule&&(i.mosaicRule=JSON.stringify(this.options.mosaicRule)),i},_requestExport:function(t,e){if("json"===this.options.f)this.service.request("exportImage",t,(function(t,i){t||(this.options.token&&(i.href+="?token="+this.options.token),this.options.proxy&&(i.href=this.options.proxy+"?"+i.href),this._renderImage(i.href,e))}),this);else{t.f="image";var s=this.options.url+"exportImage"+i.Util.getParamString(t);this.options.proxy&&(s=this.options.proxy+"?"+s),this._renderImage(s,e)}}});var vt=_t.extend({options:{updateInterval:150,layers:!1,layerDefs:!1,timeOptions:!1,format:"png32",transparent:!0,f:"json"},initialize:function(t){t=B(t),this.service=lt(t),this.service.addEventParent(this),i.Util.setOptions(this,t)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(t){return this.options.dynamicLayers=t,this._update(),this},getLayers:function(){return this.options.layers},setLayers:function(t){return this.options.layers=t,this._update(),this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(t){return this.options.layerDefs=t,this._update(),this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(t){return this.options.timeOptions=t,this._update(),this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(t){var e,s=i.Util.bind((function(e,s,a){e||setTimeout(i.Util.bind((function(){this._renderPopup(t.latlng,e,s,a)}),this),300)}),this);if((e=this.options.popup?this.options.popup.on(this._map).at(t.latlng):this.identify().on(this._map).at(t.latlng)).params.maxAllowableOffset||e.simplify(this._map,.5),this.options.popup&&this.options.popup.params&&this.options.popup.params.layers||(this.options.layers?e.layers("visible:"+this.options.layers.join(",")):e.layers("visible")),this.options.layerDefs&&"string"!=typeof this.options.layerDefs&&!e.params.layerDefs)for(var a in this.options.layerDefs)this.options.layerDefs.hasOwnProperty(a)&&e.layerDef(a,this.options.layerDefs[a]);e.run(s),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),i={bbox:this._calculateBbox(),size:this._calculateImageSize(),dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};if(this.options.dynamicLayers&&(i.dynamicLayers=this.options.dynamicLayers),this.options.layers){if(0===this.options.layers.length)return;i.layers="show:"+this.options.layers.join(",")}return this.options.layerDefs&&(i.layerDefs="string"==typeof this.options.layerDefs?this.options.layerDefs:JSON.stringify(this.options.layerDefs)),this.options.timeOptions&&(i.timeOptions=JSON.stringify(this.options.timeOptions)),this.options.from&&this.options.to&&(i.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.service.options.token&&(i.token=this.service.options.token),this.options.proxy&&(i.proxy=this.options.proxy),this.options.disableCache&&(i._ts=Date.now()),i},_requestExport:function(t,e){if("json"===this.options.f)this.service.request("export",t,(function(t,i){t||(this.options.token&&i.href&&(i.href+="?token="+this.options.token),this.options.proxy&&i.href&&(i.href=this.options.proxy+"?"+i.href),i.href?this._renderImage(i.href,e):this._renderImage(i.imageData,e,i.contentType))}),this);else{t.f="image";var s=this.options.url+"export"+i.Util.getParamString(t);this.options.proxy&&(s=this.options.proxy+"?"+s),this._renderImage(s,e)}}});var bt=i.Layer.extend({options:{cellSize:512,updateWhenIdle:i.Browser.mobile,updateInterval:150,noWrap:!1,keepBuffer:1.5},initialize:function(t){i.Util.setOptions(this,t)},onAdd:function(t){this._cells={},this._activeCells={},this._resetView(),this._update()},onRemove:function(t){this._removeAllCells(),this._cellZoom=void 0},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllCells(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=i.Util.throttle(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),t},createCell:function(){return document.createElement("div")},removeCell:function(){},reuseCell:function(){},cellLeave:function(){},cellEnter:function(){},getCellSize:function(){var t=this.options.cellSize;return t instanceof i.Point?t:new i.Point(t,t)},_pruneCells:function(){if(this._map){var t,i;for(t in this._cells)(i=this._cells[t]).retain=i.current;for(t in this._cells)if((i=this._cells[t]).current&&!i.active){var e=i.coords;this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2)}for(t in this._cells)this._cells[t].retain||this._removeCell(t)}},_removeAllCells:function(){for(var t in this._cells)this._removeCell(t)},_invalidateAll:function(){this._removeAllCells(),this._cellZoom=void 0},_retainParent:function(t,e,s,a){var r=Math.floor(t/2),n=Math.floor(e/2),o=s-1,h=new i.Point(+r,+n);h.z=+o;var l=this._cellCoordsToKey(h),u=this._cells[l];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),o>a&&this._retainParent(r,n,o,a))},_retainChildren:function(t,e,s,a){for(var r=2*t;r<2*t+2;r++)for(var n=2*e;n<2*e+2;n++){var o=new i.Point(r,n);o.z=s+1;var h=this._cellCoordsToKey(o),l=this._cells[h];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),s+1<a&&this._retainChildren(r,n,s+1,a))}},_resetView:function(t){var i=t&&(t.pinch||t.flyTo);i||this._setView(this._map.getCenter(),this._map.getZoom(),i,i)},_setView:function(t,i,e,s){var a=Math.round(i);s||(this._cellZoom=a,this._abortLoading&&this._abortLoading(),this._resetGrid(),void 0!==a&&this._update(t),e||this._pruneCells(),this._noPrune=!!e)},_resetGrid:function(){var t=this._map,i=t.options.crs,e=this._cellSize=this.getCellSize(),s=this._cellZoom,a=this._map.getPixelWorldBounds(this._cellZoom);a&&(this._globalCellRange=this._pxBoundsToCellRange(a)),this._wrapX=i.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,i.wrapLng[0]],s).x/e.x),Math.ceil(t.project([0,i.wrapLng[1]],s).x/e.y)],this._wrapY=i.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([i.wrapLat[0],0],s).y/e.x),Math.ceil(t.project([i.wrapLat[1],0],s).y/e.y)]},_onMoveEnd:function(t){t&&(t.pinch||t.flyTo)||!this._map||this._map._animatingZoom||this._update()},_getCelldPixelBounds:function(t){var e=this._map,s=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),a=e.getZoomScale(s,this._cellZoom),r=e.project(t,this._cellZoom).floor(),n=e.getSize().divideBy(2*a);return new i.Bounds(r.subtract(n),r.add(n))},_update:function(t){var e=this._map;if(e){var s=Math.round(e.getZoom());void 0===t&&(t=e.getCenter());var a=this._getCelldPixelBounds(t),r=this._pxBoundsToCellRange(a),n=r.getCenter(),o=[],h=this.options.keepBuffer,l=new i.Bounds(r.getBottomLeft().subtract([h,-h]),r.getTopRight().add([h,-h]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of cells");for(var u in this._cells){var c=this._cells[u].coords;c.z===this._cellZoom&&l.contains(new i.Point(c.x,c.y))||(this._cells[u].current=!1)}if(Math.abs(s-this._cellZoom)>1)this._setView(t,s);else{for(var p=r.min.y;p<=r.max.y;p++)for(var f=r.min.x;f<=r.max.x;f++){var d=new i.Point(f,p);if(d.z=this._cellZoom,this._isValidCell(d)){var m=this._cells[this._cellCoordsToKey(d)];m?m.current=!0:o.push(d)}}if(o.sort((function(t,i){return t.distanceTo(n)-i.distanceTo(n)})),0!==o.length)for(this._loading||(this._loading=!0),f=0;f<o.length;f++){var y=this._cellCoordsToKey(o[f]),g=this._keyToCellCoords(y);this._activeCells[g]?this._reuseCell(o[f]):this._createCell(o[f])}}}},_isValidCell:function(t){var e=this._map.options.crs;if(!e.infinite){var s=this._globalCellRange;if(!e.wrapLng&&(t.x<s.min.x||t.x>s.max.x)||!e.wrapLat&&(t.y<s.min.y||t.y>s.max.y))return!1}if(!this.options.bounds)return!0;var a=this._cellCoordsToBounds(t);return i.toLatLngBounds(this.options.bounds).overlaps(a)},_keyToBounds:function(t){return this._cellCoordsToBounds(this._keyToCellCoords(t))},_cellCoordsToNwSe:function(t){var i=this._map,e=this.getCellSize(),s=t.scaleBy(e),a=s.add(e);return[i.unproject(s,t.z),i.unproject(a,t.z)]},_cellCoordsToBounds:function(t){var e=this._cellCoordsToNwSe(t),s=new i.LatLngBounds(e[0],e[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_cellCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToCellCoords:function(t){var e=t.split(":"),s=new i.Point(+e[0],+e[1]);return s.z=+e[2],s},_removeCell:function(t){var i=this._cells[t];if(i){var e=this._keyToCellCoords(t),s=this._wrapCoords(e),a=this._cellCoordsToBounds(this._wrapCoords(e));i.current=!1,delete this._cells[t],this._activeCells[t]=i,this.cellLeave(a,s,t),this.fire("cellleave",{key:t,coords:s,bounds:a})}},_reuseCell:function(t){var i=this._cellCoordsToKey(t);this._cells[i]=this._activeCells[i],this._cells[i].current=!0;var e=this._wrapCoords(t),s=this._cellCoordsToBounds(this._wrapCoords(t));this.cellEnter(s,e,i),this.fire("cellenter",{key:i,coords:e,bounds:s})},_createCell:function(t){var e=this._cellCoordsToKey(t),s=this._wrapCoords(t),a=this._cellCoordsToBounds(this._wrapCoords(t));this.createCell(a,s,e),this.fire("cellcreate",{key:e,coords:s,bounds:a}),this._cells[e]={coords:t,current:!0},i.Util.requestAnimFrame(this._pruneCells,this)},_cellReady:function(t,i,e){var s=this._cellCoordsToKey(t);(e=this._cells[s])&&(e.loaded=+new Date,e.active=!0)},_getCellPos:function(t){return t.scaleBy(this.getCellSize())},_wrapCoords:function(t){var e=new i.Point(this._wrapX?i.Util.wrapNum(t.x,this._wrapX):t.x,this._wrapY?i.Util.wrapNum(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToCellRange:function(t){var e=this.getCellSize();return new i.Bounds(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))}});function xt(t){this.values=[].concat(t||[])}xt.prototype.query=function(t){var i=this.getIndex(t);return this.values[i]},xt.prototype.getIndex=function(t){this.dirty&&this.sort();for(var i,e,s=0,a=this.values.length-1;s<=a;)if(i=(s+a)/2|0,+(e=this.values[Math.round(i)]).value<+t)s=i+1;else{if(!(+e.value>+t))return i;a=i-1}return Math.abs(~a)},xt.prototype.between=function(t,i){var e=this.getIndex(t),s=this.getIndex(i);if(0===e&&0===s)return[];for(;this.values[e-1]&&this.values[e-1].value===t;)e--;for(;this.values[s+1]&&this.values[s+1].value===i;)s++;return this.values[s]&&this.values[s].value===i&&this.values[s+1]&&s++,this.values.slice(e,s)},xt.prototype.insert=function(t){return this.values.splice(this.getIndex(t.value),0,t),this},xt.prototype.bulkAdd=function(t,i){return this.values=this.values.concat([].concat(t||[])),i?this.sort():this.dirty=!0,this},xt.prototype.sort=function(){return this.values.sort((function(t,i){return+i.value-+t.value})).reverse(),this.dirty=!1,this};var wt=bt.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6,fetchAllFeatures:!1},initialize:function(t){if(bt.prototype.initialize.call(this,t),t=B(t),t=i.Util.setOptions(this,t),this.service=ft(t),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var e=!1,s=0;s<this.options.fields.length;s++)this.options.fields[s].match(/^(OBJECTID|FID|OID|ID)$/i)&&(e=!0);!1===e&&v("no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}this.options.timeField.start&&this.options.timeField.end?(this._startTimeIndex=new xt,this._endTimeIndex=new xt):this.options.timeField&&(this._timeIndex=new xt),this._cache={},this._currentSnapshot=[],this._activeRequests=0},onAdd:function(t){return W(t),this.service.metadata((function(i,e){if(!i){var s=e.supportedQueryFormats,a=!1;(!1===this.service.options.isModern||this.options.fetchAllFeatures)&&(a=!0),!a&&s&&-1!==s.indexOf("geoJSON")&&(this.service.options.isModern=!0),e.objectIdField&&(this.service.options.idAttribute=e.objectIdField),!this.options.attribution&&t.attributionControl&&e.copyrightText&&(this.options.attribution=e.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}}),this),t.on("zoomend",this._handleZoomChange,this),bt.prototype.onAdd.call(this,t)},onRemove:function(t){return J(t),t.off("zoomend",this._handleZoomChange,this),bt.prototype.onRemove.call(this,t)},getAttribution:function(){return this.options.attribution},createCell:function(t,i){this._visibleZoom()&&this._requestFeatures(t,i)},_requestFeatures:function(t,e,s,a){this._activeRequests++,a=a||0;var r=this.options.where;return 1===this._activeRequests&&this.fire("loading",{bounds:t},!0),this._buildQuery(t,a).run((function(n,o,h){h&&h.exceededTransferLimit&&this.fire("drawlimitexceeded"),this.options.where===r&&(!n&&o&&o.features.length&&i.Util.requestAnimFrame(i.Util.bind((function(){this._addFeatures(o.features,e),this._postProcessFeatures(t)}),this)),n||!o||o.features.length||this._postProcessFeatures(t),n&&this._postProcessFeatures(t),s&&s.call(this,n,o),h&&(h.exceededTransferLimit||h.properties&&h.properties.exceededTransferLimit)&&this.options.fetchAllFeatures&&this._requestFeatures(t,e,s,a+o.features.length))}),this)},_postProcessFeatures:function(t){this._activeRequests--,this._activeRequests<=0&&this.fire("load",{bounds:t})},_cacheKey:function(t){return t.z+":"+t.x+":"+t.y},_addFeatures:function(t,i){if(i){var e=this._cacheKey(i);this._cache[e]=this._cache[e]||[]}for(var s=t.length-1;s>=0;s--){var a=t[s].id;-1===this._currentSnapshot.indexOf(a)&&this._currentSnapshot.push(a),void 0!==e&&-1===this._cache[e].indexOf(a)&&this._cache[e].push(a)}this.options.timeField&&this._buildTimeIndexes(t),this.createLayers(t)},_buildQuery:function(t,e){var s=this.service.query().intersects(t).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.fetchAllFeatures&&!isNaN(parseInt(e))&&(s=s.offset(e)),s.params.resultType="tile",this.options.requestParams&&i.Util.extend(s.params,this.options.requestParams),this.options.simplifyFactor&&s.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&s.between(this.options.from,this.options.to),s},setWhere:function(t,e,s){this.options.where=t&&t.length?t:"1=1";for(var a=[],r=[],n=0,o=null,h=i.Util.bind((function(h,l){if(h&&(o=h),l)for(var u=l.features.length-1;u>=0;u--)r.push(l.features[u].id);--n<=0&&this._visibleZoom()&&t===this.options.where&&(this._currentSnapshot=r,i.Util.requestAnimFrame(i.Util.bind((function(){this.removeLayers(a),this.addLayers(r),e&&e.call(s,o)}),this)))}),this),l=this._currentSnapshot.length-1;l>=0;l--)a.push(this._currentSnapshot[l]);for(var u in this._cache={},this._cells){n++;var c=this._keyToCellCoords(u),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,h)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,e,s,a){var r=this.options.from,n=this.options.to,o=0,h=null,l=i.Util.bind((function(i){i&&(h=i),this._filterExistingFeatures(r,n,t,e),o--,s&&o<=0&&s.call(a,h)}),this);if(this.options.from=t,this.options.to=e,this._filterExistingFeatures(r,n,t,e),"server"===this.options.timeFilterMode)for(var u in this._cells){o++;var c=this._keyToCellCoords(u),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,l)}return this},refresh:function(){this.setWhere(this.options.where)},_filterExistingFeatures:function(t,e,s,a){var r=t&&e?this._getFeaturesInTimeRange(t,e):this._currentSnapshot,n=this._getFeaturesInTimeRange(s,a);if(n.indexOf)for(var o=0;o<n.length;o++){var h=r.indexOf(n[o]);h>=0&&r.splice(h,1)}i.Util.requestAnimFrame(i.Util.bind((function(){this.removeLayers(r),this.addLayers(n)}),this))},_getFeaturesInTimeRange:function(t,i){var e,s=[];if(this.options.timeField.start&&this.options.timeField.end){var a=this._startTimeIndex.between(t,i),r=this._endTimeIndex.between(t,i);e=a.concat(r)}else{if(!this._timeIndex)return v("You must set timeField in the layer constructor in order to manipulate the start and end time filter."),[];e=this._timeIndex.between(t,i)}for(var n=e.length-1;n>=0;n--)s.push(e[n].id);return s},_buildTimeIndexes:function(t){var i,e;if(this.options.timeField.start&&this.options.timeField.end){var s=[],a=[];for(i=t.length-1;i>=0;i--)e=t[i],s.push({id:e.id,value:new Date(e.properties[this.options.timeField.start])}),a.push({id:e.id,value:new Date(e.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(s),this._endTimeIndex.bulkAdd(a)}else{var r=[];for(i=t.length-1;i>=0;i--)e=t[i],r.push({id:e.id,value:new Date(e.properties[this.options.timeField])});this._timeIndex.bulkAdd(r)}},_featureWithinTimeRange:function(t){if(!this.options.from||!this.options.to)return!0;var i=+this.options.from.valueOf(),e=+this.options.to.valueOf();if("string"==typeof this.options.timeField){var s=+t.properties[this.options.timeField];return s>=i&&s<=e}if(this.options.timeField.start&&this.options.timeField.end){var a=+t.properties[this.options.timeField.start],r=+t.properties[this.options.timeField.end];return a>=i&&a<=e||r>=i&&r<=e||a<=i&&r>=e}},_visibleZoom:function(){if(!this._map)return!1;var t=this._map.getZoom();return!(t>this.options.maxZoom||t<this.options.minZoom)},_handleZoomChange:function(){if(this._visibleZoom())for(var t in this._cells){var i=this._cells[t].coords,e=this._cacheKey(i);this._cache[e]&&this.addLayers(this._cache[e])}else this.removeLayers(this._currentSnapshot),this._currentSnapshot=[]},authenticate:function(t){return this.service.authenticate(t),this},metadata:function(t,i){return this.service.metadata(t,i),this},query:function(){return this.service.query()},_getMetadata:function(t){this._metadata?t(undefined,this._metadata):this.metadata(i.Util.bind((function(i,e){this._metadata=e,t(i,this._metadata)}),this))},addFeature:function(t,i,e){this.addFeatures(t,i,e)},addFeatures:function(t,e,s){this._getMetadata(i.Util.bind((function(a,r){if(a)e&&e.call(this,a,null);else{var n=t.features?t.features:[t];this.service.addFeatures(t,i.Util.bind((function(t,i){if(!t){for(var a=n.length-1;a>=0;a--)n[a].properties[r.objectIdField]=n.length>1?i[a].objectId:i.objectId,n[a].id=n.length>1?i[a].objectId:i.objectId;this._addFeatures(n)}e&&e.call(s,t,i)}),this))}}),this))},updateFeature:function(t,i,e){this.updateFeatures(t,i,e)},updateFeatures:function(t,i,e){var s=t.features?t.features:[t];this.service.updateFeatures(t,(function(t,a){if(!t){for(var r=s.length-1;r>=0;r--)this.removeLayers([s[r].id],!0);this._addFeatures(s)}i&&i.call(e,t,a)}),this)},deleteFeature:function(t,i,e){this.deleteFeatures(t,i,e)},deleteFeatures:function(t,i,e){return this.service.deleteFeatures(t,(function(t,s){var a=s.length?s:[s];if(!t&&a.length>0)for(var r=a.length-1;r>=0;r--)this.removeLayers([a[r].objectId],!0);i&&i.call(e,t,s)}),this)}}),St=wt.extend({options:{cacheLayers:!0},initialize:function(t){t.apikey&&(t.token=t.apikey),wt.prototype.initialize.call(this,t),this._originalStyle=this.options.style,this._layers={}},onRemove:function(t){for(var i in this._layers)t.removeLayer(this._layers[i]),this.fire("removefeature",{feature:this._layers[i].feature,permanent:!1},!0);return wt.prototype.onRemove.call(this,t)},createNewLayer:function(t){var e=i.GeoJSON.geometryToLayer(t,this.options);return e&&(e.defaultOptions=e.options),e},_updateLayer:function(t,e){var s=[],a=this.options.coordsToLatLng||i.GeoJSON.coordsToLatLng;switch(e.properties&&(t.feature.properties=e.properties),e.geometry.type){case"Point":s=i.GeoJSON.coordsToLatLng(e.geometry.coordinates),t.setLatLng(s);break;case"LineString":s=i.GeoJSON.coordsToLatLngs(e.geometry.coordinates,0,a),t.setLatLngs(s);break;case"MultiLineString":case"Polygon":s=i.GeoJSON.coordsToLatLngs(e.geometry.coordinates,1,a),t.setLatLngs(s);break;case"MultiPolygon":s=i.GeoJSON.coordsToLatLngs(e.geometry.coordinates,2,a),t.setLatLngs(s)}this.redraw(t.feature.id)},createLayers:function(t){for(var i=t.length-1;i>=0;i--){var e,s=t[i],a=this._layers[s.id];!this._visibleZoom()||!a||this._map.hasLayer(a)||this.options.timeField&&!this._featureWithinTimeRange(s)||(this._map.addLayer(a),this.fire("addfeature",{feature:a.feature},!0)),a&&(a.setLatLngs||a.setLatLng)&&this._updateLayer(a,s),a||((e=this.createNewLayer(s))?(e.feature=s,e.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(e.feature,e),this._layers[e.feature.id]=e,this.setFeatureStyle(e.feature.id,this.options.style),this.fire("createfeature",{feature:e.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(s))&&this._map.addLayer(e)):v("invalid GeoJSON encountered"))}},addLayers:function(t){for(var i=t.length-1;i>=0;i--){var e=this._layers[t[i]];!e||this.options.timeField&&!this._featureWithinTimeRange(e.feature)||(this._map.addLayer(e),this.fire("addfeature",{feature:e.feature},!0))}},removeLayers:function(t,i){for(var e=t.length-1;e>=0;e--){var s=t[e],a=this._layers[s];a&&(this.fire("removefeature",{feature:a.feature,permanent:i},!0),this._map.removeLayer(a)),a&&i&&delete this._layers[s]}},cellEnter:function(t,e){this._visibleZoom()&&!this._zooming&&this._map&&i.Util.requestAnimFrame(i.Util.bind((function(){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),s=this._cache[t];this._activeCells[i]&&s&&this.addLayers(s)}),this))},cellLeave:function(t,e){this._zooming||i.Util.requestAnimFrame(i.Util.bind((function(){if(this._map){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),s=this._cache[t],a=this._map.getBounds();if(!this._activeCells[i]&&s){for(var r=!0,n=0;n<s.length;n++){var o=this._layers[s[n]];o&&o.getBounds&&a.intersects(o.getBounds())&&(r=!1)}r&&this.removeLayers(s,!this.options.cacheLayers),!this.options.cacheLayers&&r&&(delete this._cache[t],delete this._cells[i],delete this._activeCells[i])}}}),this))},resetStyle:function(){return this.options.style=this._originalStyle,this.eachFeature((function(t){this.resetFeatureStyle(t.feature.id)}),this),this},setStyle:function(t){return this.options.style=t,this.eachFeature((function(i){this.setFeatureStyle(i.feature.id,t)}),this),this},resetFeatureStyle:function(t){var e=this._layers[t],s=this._originalStyle||i.Path.prototype.options;return e&&(i.Util.extend(e.options,e.defaultOptions),this.setFeatureStyle(t,s)),this},setFeatureStyle:function(t,i){var e=this._layers[t];return"function"==typeof i&&(i=i(e.feature)),e.setStyle&&e.setStyle(i),this},eachActiveFeature:function(t,i){if(this._map){var e=this._map.getBounds();for(var s in this._layers)-1!==this._currentSnapshot.indexOf(this._layers[s].feature.id)&&("function"==typeof this._layers[s].getLatLng&&e.contains(this._layers[s].getLatLng())||"function"==typeof this._layers[s].getBounds&&e.intersects(this._layers[s].getBounds()))&&t.call(i,this._layers[s])}return this},eachFeature:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},getFeature:function(t){return this._layers[t]},bringToBack:function(){this.eachFeature((function(t){t.bringToBack&&t.bringToBack()}))},bringToFront:function(){this.eachFeature((function(t){t.bringToFront&&t.bringToFront()}))},redraw:function(t){return t&&this._redraw(t),this},_redraw:function(t){var e=this._layers[t],s=e.feature;if(e&&e.setIcon&&this.options.pointToLayer&&this.options.pointToLayer){var a=this.options.pointToLayer(s,i.latLng(s.geometry.coordinates[1],s.geometry.coordinates[0])).options.icon;e.setIcon(a)}if(e&&e.setStyle&&this.options.pointToLayer){var r=this.options.pointToLayer(s,i.latLng(s.geometry.coordinates[1],s.geometry.coordinates[0])).options;this.setFeatureStyle(s.id,r)}e&&e.setStyle&&this.options.style&&this.resetStyle(s.id)}});var Ct={__proto__:null,VERSION:o,Support:u,options:c,Util:X,get:M,post:m,request:g,Task:K,task:function(t){return t=B(t),new K(t)},Query:Y,query:$,Find:tt,find:it,Identify:et,identify:function(t){return new et(t)},IdentifyFeatures:st,identifyFeatures:at,IdentifyImage:rt,identifyImage:nt,Service:ot,service:function(t){return t=B(t),new ot(t)},MapService:ht,mapService:lt,ImageService:ut,imageService:ct,FeatureLayerService:pt,featureLayerService:ft,BasemapLayer:mt,basemapLayer:function(t,i){return new mt(t,i)},TiledMapLayer:yt,tiledMapLayer:function(t,i){return new yt(t,i)},RasterLayer:_t,ImageMapLayer:Mt,imageMapLayer:function(t,i){return new Mt(t,i)},DynamicMapLayer:vt,dynamicMapLayer:function(t,i){return new vt(t,i)},FeatureManager:wt,FeatureLayer:St,featureLayer:function(t){return new St(t)}};function At(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);i&&(s=s.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),e.push.apply(e,s)}return e}function It(t){for(var i=1;i<arguments.length;i++){var e=null!=arguments[i]?arguments[i]:{};i%2?At(Object(e),!0).forEach((function(i){kt(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):At(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}))}return t}function Pt(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function Lt(t,i){for(var e=0;e<i.length;e++){var s=i[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function Ot(t,i,e){return i&&Lt(t.prototype,i),e&&Lt(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function Tt(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),i&&Et(t,i)}function Nt(t){return Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Nt(t)}function Et(t,i){return Et=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t},Et(t,i)}function Rt(t,i){if(i&&("object"==typeof i||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function qt(t){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,s=Nt(t);if(i){var a=Nt(this).constructor;e=Reflect.construct(s,arguments,a)}else e=s.apply(this,arguments);return Rt(this,e)}}function Ft(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&null!==(t=Nt(t)););return t}function Gt(){return Gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,i,e){var s=Ft(t,i);if(s){var a=Object.getOwnPropertyDescriptor(s,i);return a.get?a.get.call(arguments.length<3?t:e):a.value}},Gt.apply(this,arguments)}var jt=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"initialize",value:function(t){var i,s,a;t.pane=null!==(i=t.pane)&&void 0!==i?i:"tilePane",this.options.id=null!==(s=this.options.id)&&void 0!==s?s:n.Util.createGuid(),this.options.pid=null!==(a=this.options.pid)&&void 0!==a?a:-1,Gt(Nt(e.prototype),"initialize",this).call(this,t)}},{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}},{key:"opacity",get:function(){return this.options.opacity},set:function(t){this.options.opacity=t,this.setOpacity(t)}},{key:"bandIds",get:function(){return this.getBandIds()},set:function(t){this.setBandIds(t)}}]),e}(Mt);n.layer.ArcGisImageLayer=jt,n.LayerUtil.register("arcgis_image",jt);var zt=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"initialize",value:function(t){var i,s;Gt(Nt(e.prototype),"initialize",this).call(this,t),this.options.id=null!==(i=this.options.id)&&void 0!==i?i:n.Util.createGuid(),this.options.pid=null!==(s=this.options.pid)&&void 0!==s?s:-1}},{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}}]),e}(yt);n.layer.ArcGisTileLayer=zt,n.LayerUtil.register("arcgis_tile",zt);var Bt=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}},{key:"opacity",get:function(){return this.options.opacity},set:function(t){this.options.opacity=t,this.setOpacity(t)}},{key:"initialize",value:function(t){var i,s,a,o,h=this;if(t.popup&&(o=t.popup,delete t.popup),t.pane=null!==(i=t.pane)&&void 0!==i?i:"tilePane",Gt(Nt(e.prototype),"initialize",this).call(this,t),r.default.Util.stamp(this),this.options.id=null!==(s=this.options.id)&&void 0!==s?s:n.Util.createGuid(),this.options.pid=null!==(a=this.options.pid)&&void 0!==a?a:-1,o){var l=this.options.popupOptions||{};this.bindPopup((function(t,i,e){if(null!=t&&t.code>0)return n.Util.msg(t.message),!1;var s=i.graphic;if(!s)return!1;var a=s.attr,r=h.name;return l.noTitle?r=null:l.title?r=l.title:l.titleField&&(r=a[l.titleField]),n.Util.getTemplateHtml({title:r,template:o,attr:a})}),{maxWidth:600})}}},{key:"onAdd",value:function(t){Gt(Nt(e.prototype),"onAdd",this).call(this,t),this._popup||!this.highlight&&!this.listens("click")||(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this))}},{key:"_renderPopup",value:function(t,i,s,a){var r,o=this,h=null===(r=this.options)||void 0===r?void 0:r.highlight,l=n.Util.geoJsonToGraphics(s,{type:null==h?void 0:h.type,style:h}),u={layer:this,graphic:l.length>0?l[0]:null,graphics:l,geojson:s,latlng:t};this._popup&&Gt(Nt(e.prototype),"_renderPopup",this).call(this,t,i,u,a),l&&h&&(this._graphicLayer||(this._graphicLayer=new n.layer.GraphicLayer({name:"高亮对象图层",isPrivate:!0}),this._map.addLayer(this._graphicLayer)),this._graphicLayer.clear(),this._graphicLayer.addGraphic(l),this._popup&&(this._popup._source=this,this.once(n.EventType.popupclose,(function(t){o._graphicLayer.clear()})))),this.listens("click")&&this.fire(n.EventType.click,u)}}]),e}(vt);n.layer.ArcGisDynamicLayer=Bt,n.LayerUtil.register("arcgis_dynamic",Bt);var Ut=6378137,Dt=.0066943799901413165,Zt=484813681109536e-20,Wt=Math.PI/2,Jt=1e-10,Qt=.017453292519943295,Ht=57.29577951308232,Vt=Math.PI/4,Xt=2*Math.PI,Kt=3.14159265359,Yt={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},$t={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},ti=/[\s_\-\/\(\)]/g;function ii(t,i){if(t[i])return t[i];for(var e,s=Object.keys(t),a=i.toLowerCase().replace(ti,""),r=-1;++r<s.length;)if((e=s[r]).toLowerCase().replace(ti,"")===a)return t[e]}function ei(t){var i,e,s,a={},r=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var e=i.split("=");return e.push(!0),t[e[0].toLowerCase()]=e[1],t}),{}),n={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*Qt},lat_1:function(t){a.lat1=t*Qt},lat_2:function(t){a.lat2=t*Qt},lat_ts:function(t){a.lat_ts=t*Qt},lon_0:function(t){a.long0=t*Qt},lon_1:function(t){a.long1=t*Qt},lon_2:function(t){a.long2=t*Qt},alpha:function(t){a.alpha=parseFloat(t)*Qt},gamma:function(t){a.rectified_grid_angle=parseFloat(t)},lonc:function(t){a.longc=t*Qt},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t;var i=ii($t,t);i&&(a.to_meter=i.to_meter)},from_greenwich:function(t){a.from_greenwich=t*Qt},pm:function(t){var i=ii(Yt,t);a.from_greenwich=(i||parseFloat(t))*Qt},nadgrids:function(t){"@null"===t?a.datumCode="none":a.nadgrids=t},axis:function(t){var i="ewnsud";3===t.length&&-1!==i.indexOf(t.substr(0,1))&&-1!==i.indexOf(t.substr(1,1))&&-1!==i.indexOf(t.substr(2,1))&&(a.axis=t)},approx:function(){a.approx=!0}};for(i in r)e=r[i],i in n?"function"==typeof(s=n[i])?s(e):a[s]=e:a[i]=e;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}var si=/\s/,ai=/[A-Za-z]/,ri=/[A-Za-z84_]/,ni=/[,\]]/,oi=/[\d\.E\-\+]/;function hi(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function li(t,i,e){Array.isArray(i)&&(e.unshift(i),i=null);var s=i?{}:t,a=e.reduce((function(t,i){return ui(i,t),t}),s);i&&(t[i]=a)}function ui(t,i){if(Array.isArray(t)){var e=t.shift();if("PARAMETER"===e&&(e=t.shift()),1===t.length)return Array.isArray(t[0])?(i[e]={},void ui(t[0],i[e])):void(i[e]=t[0]);if(t.length)if("TOWGS84"!==e){if("AXIS"===e)return e in i||(i[e]=[]),void i[e].push(t);var s;switch(Array.isArray(e)||(i[e]={}),e){case"UNIT":case"PRIMEM":case"VERT_DATUM":return i[e]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&ui(t[2],i[e]));case"SPHEROID":case"ELLIPSOID":return i[e]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&ui(t[3],i[e]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void li(i,e,t);default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return ui(t,i[e]);return li(i,e,t)}}else i[e]=t;else i[e]=!0}else i[t]=!0}hi.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;si.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},hi.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(ni.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},hi.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},hi.prototype.number=function(t){if(!oi.test(t)){if(ni.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},hi.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},hi.prototype.keyword=function(t){if(ri.test(t))this.word+=t;else{if("["===t){var i=[];return i.push(this.word),this.level++,null===this.root?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,void(this.state=1)}if(!ni.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},hi.prototype.neutral=function(t){if(ai.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(oi.test(t))return this.word=t,void(this.state=3);if(!ni.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},hi.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function ci(t){return.017453292519943295*t}function pi(t){var i=new hi(t).output(),e=i.shift(),s=i.shift();i.unshift(["name",s]),i.unshift(["type",e]);var a={};return ui(i,a),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var i="",e=0,s=t.AXIS.length;e<s;++e){var a=[t.AXIS[e][0].toLowerCase(),t.AXIS[e][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?i+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?i+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?i+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(i+="w")}2===i.length&&(i+="u"),3===i.length&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var r=t.GEOGCS;function n(i){return i*(t.to_meter||1)}"GEOGCS"===t.type&&(r=t),r&&(r.DATUM?t.datumCode=r.DATUM.name.toLowerCase():t.datumCode=r.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(t.datum_params=r.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",ci],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",ci],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",ci],["lat0","latitude_of_origin",ci],["lat0","standard_parallel_1",ci],["lat1","standard_parallel_1",ci],["lat2","standard_parallel_2",ci],["azimuth","Azimuth"],["alpha","azimuth",ci],["srsCode","name"]].forEach((function(i){return function(t,i){var e=i[0],s=i[1];!(e in t)&&s in t&&(t[e]=t[s],3===i.length&&(t[e]=i[2](t[e])))}(t,i)})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=ci(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(a),a}function fi(t){var i=this;if(2===arguments.length){var e=arguments[1];"string"==typeof e?"+"===e.charAt(0)?fi[t]=ei(arguments[1]):fi[t]=pi(arguments[1]):fi[t]=e}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?fi.apply(i,t):fi(t)}));if("string"==typeof t){if(t in fi)return fi[t]}else"EPSG"in t?fi["EPSG:"+t.EPSG]=t:"ESRI"in t?fi["ESRI:"+t.ESRI]=t:"IAU2000"in t?fi["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("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"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(fi);var di=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var mi=["3857","900913","3785","102113"];function yi(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in fi}(t))return fi[t];if(function(t){return di.some((function(i){return t.indexOf(i)>-1}))}(t)){var i=pi(t);if(function(t){var i=ii(t,"authority");if(i){var e=ii(i,"epsg");return e&&mi.indexOf(e)>-1}}(i))return fi["EPSG:3857"];var e=function(t){var i=ii(t,"extension");if(i)return ii(i,"proj4")}(i);return e?ei(e):i}return function(t){return"+"===t[0]}(t)?ei(t):void 0}function gi(t,i){var e,s;if(t=t||{},!i)return t;for(s in i)void 0!==(e=i[s])&&(t[s]=e);return t}function _i(t,i,e){var s=t*i;return e/Math.sqrt(1-s*s)}function Mi(t){return t<0?-1:1}function vi(t){return Math.abs(t)<=Kt?t:t-Mi(t)*Xt}function bi(t,i,e){var s=t*e,a=.5*t;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(Wt-i))/s}function xi(t,i){for(var e,s,a=.5*t,r=Wt-2*Math.atan(i),n=0;n<=15;n++)if(e=t*Math.sin(r),r+=s=Wt-2*Math.atan(i*Math.pow((1-e)/(1+e),a))-r,Math.abs(s)<=1e-10)return r;return-9999}function wi(t){return t}var Si=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"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=_i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var i,e,s=t.x,a=t.y;if(a*Ht>90&&a*Ht<-90&&s*Ht>180&&s*Ht<-180)return null;if(Math.abs(Math.abs(a)-Wt)<=Jt)return null;if(this.sphere)i=this.x0+this.a*this.k0*vi(s-this.long0),e=this.y0+this.a*this.k0*Math.log(Math.tan(Vt+.5*a));else{var r=Math.sin(a),n=bi(this.e,a,r);i=this.x0+this.a*this.k0*vi(s-this.long0),e=this.y0-this.a*this.k0*Math.log(n)}return t.x=i,t.y=e,t},inverse:function(t){var i,e,s=t.x-this.x0,a=t.y-this.y0;if(this.sphere)e=Wt-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var r=Math.exp(-a/(this.a*this.k0));if(-9999===(e=xi(this.e,r)))return null}return i=vi(this.long0+s/(this.a*this.k0)),t.x=i,t.y=e,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:wi,inverse:wi,names:["longlat","identity"]}],Ci={},Ai=[];function Ii(t,i){var e=Ai.length;return t.names?(Ai[e]=t,t.names.forEach((function(t){Ci[t.toLowerCase()]=e})),this):(console.log(i),!0)}var Pi={start:function(){Si.forEach(Ii)},add:Ii,get:function(t){if(!t)return!1;var i=t.toLowerCase();return void 0!==Ci[i]&&Ai[Ci[i]]?Ai[Ci[i]]:void 0}},Li={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Oi=Li.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Li.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ki={};ki.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ki.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ki.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ki.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ki.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ki.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ki.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ki.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},ki.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ki.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ki.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ki.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ki.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ki.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ki.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ki.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ki.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var Ti={};function Ni(t){if(0===t.length)return null;var i="@"===t[0];return i&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:Ti[t]||null,isNull:!1}}function Ei(t){return t/3600*Math.PI/180}function Ri(t,i,e){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,e)))}function qi(t){return t.map((function(t){return[Ei(t.longitudeShift),Ei(t.latitudeShift)]}))}function Fi(t,i,e){return{name:Ri(t,i+8,i+16).trim(),parent:Ri(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,e),upperLatitude:t.getFloat64(i+88,e),lowerLongitude:t.getFloat64(i+104,e),upperLongitude:t.getFloat64(i+120,e),latitudeInterval:t.getFloat64(i+136,e),longitudeInterval:t.getFloat64(i+152,e),gridNodeCount:t.getInt32(i+168,e)}}function Gi(t,i,e,s){for(var a=i+176,r=[],n=0;n<e.gridNodeCount;n++){var o={latitudeShift:t.getFloat32(a+16*n,s),longitudeShift:t.getFloat32(a+16*n+4,s),latitudeAccuracy:t.getFloat32(a+16*n+8,s),longitudeAccuracy:t.getFloat32(a+16*n+12,s)};r.push(o)}return r}function ji(t,i){if(!(this instanceof ji))return new ji(t);i=i||function(t){if(t)throw t};var e=yi(t);if("object"==typeof e){var s=ji.projections.get(e.projName);if(s){if(e.datumCode&&"none"!==e.datumCode){var a=ii(ki,e.datumCode);a&&(e.datum_params=e.datum_params||(a.towgs84?a.towgs84.split(","):null),e.ellps=a.ellipse,e.datumName=a.datumName?a.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var r,n,o,h,l,u,c,p=function(t,i,e,s,a){if(!t){var r=ii(Li,s);r||(r=Oi),t=r.a,i=r.b,e=r.rf}return e&&!i&&(i=(1-1/e)*t),(0===e||Math.abs(t-i)<Jt)&&(a=!0,i=t),{a:t,b:i,rf:e,sphere:a}}(e.a,e.b,e.rf,e.ellps,e.sphere),f=(r=p.a,n=p.b,p.rf,o=e.R_A,u=((h=r*r)-(l=n*n))/h,c=0,o?(h=(r*=1-u*(.16666666666666666+u*(.04722222222222222+.022156084656084655*u)))*r,u=0):c=Math.sqrt(u),{es:u,e:c,ep2:(h-l)/l}),d=function(t){return void 0===t?null:t.split(",").map(Ni)}(e.nadgrids),m=e.datum||function(t,i,e,s,a,r,n){var o={};return o.datum_type=void 0===t||"none"===t?5:4,i&&(o.datum_params=i.map(parseFloat),0===o.datum_params[0]&&0===o.datum_params[1]&&0===o.datum_params[2]||(o.datum_type=1),o.datum_params.length>3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=2,o.datum_params[3]*=Zt,o.datum_params[4]*=Zt,o.datum_params[5]*=Zt,o.datum_params[6]=o.datum_params[6]/1e6+1))),n&&(o.datum_type=3,o.grids=n),o.a=e,o.b=s,o.es=a,o.ep2=r,o}(e.datumCode,e.datum_params,p.a,p.b,f.es,f.ep2,d);gi(this,e),gi(this,s),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=m,this.init(),i(null,this)}else i(t)}else i(t)}function zi(t,i,e){var s,a,r,n,o=t.x,h=t.y,l=t.z?t.z:0;if(h<-Wt&&h>-1.001*Wt)h=-Wt;else if(h>Wt&&h<1.001*Wt)h=Wt;else{if(h<-Wt)return{x:-1/0,y:-1/0,z:t.z};if(h>Wt)return{x:1/0,y:1/0,z:t.z}}return o>Math.PI&&(o-=2*Math.PI),a=Math.sin(h),n=Math.cos(h),r=a*a,{x:((s=e/Math.sqrt(1-i*r))+l)*n*Math.cos(o),y:(s+l)*n*Math.sin(o),z:(s*(1-i)+l)*a}}function Bi(t,i,e,s){var a,r,n,o,h,l,u,c,p,f,d,m,y,g,_,M=1e-12,v=t.x,b=t.y,x=t.z?t.z:0;if(a=Math.sqrt(v*v+b*b),r=Math.sqrt(v*v+b*b+x*x),a/e<M){if(g=0,r/e<M)return Wt,_=-s,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(b,v);n=x/r,c=(o=a/r)*(1-i)*(h=1/Math.sqrt(1-i*(2-i)*o*o)),p=n*h,y=0;do{y++,l=i*(u=e/Math.sqrt(1-i*p*p))/(u+(_=a*c+x*p-u*(1-i*p*p))),m=(d=n*(h=1/Math.sqrt(1-l*(2-l)*o*o)))*c-(f=o*(1-l)*h)*p,c=f,p=d}while(m*m>1e-24&&y<30);return{x:g,y:Math.atan(d/Math.abs(f)),z:_}}function Ui(t){return 1===t||2===t}function Di(t,i,e){if(function(t,i){return t.datum_type===i.datum_type&&!(t.a!==i.a||Math.abs(t.es-i.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:2!==t.datum_type||t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6])}(t,i))return e;if(5===t.datum_type||5===i.datum_type)return e;var s=t.a,a=t.es;if(3===t.datum_type){if(0!==Zi(t,!1,e))return;s=Ut,a=Dt}var r=i.a,n=i.b,o=i.es;if(3===i.datum_type&&(r=Ut,n=6356752.314,o=Dt),a===o&&s===r&&!Ui(t.datum_type)&&!Ui(i.datum_type))return e;if((e=zi(e,a,s),Ui(t.datum_type)&&(e=function(t,i,e){if(1===i)return{x:t.x+e[0],y:t.y+e[1],z:t.z+e[2]};if(2===i){var s=e[0],a=e[1],r=e[2],n=e[3],o=e[4],h=e[5],l=e[6];return{x:l*(t.x-h*t.y+o*t.z)+s,y:l*(h*t.x+t.y-n*t.z)+a,z:l*(-o*t.x+n*t.y+t.z)+r}}}(e,t.datum_type,t.datum_params)),Ui(i.datum_type)&&(e=function(t,i,e){if(1===i)return{x:t.x-e[0],y:t.y-e[1],z:t.z-e[2]};if(2===i){var s=e[0],a=e[1],r=e[2],n=e[3],o=e[4],h=e[5],l=e[6],u=(t.x-s)/l,c=(t.y-a)/l,p=(t.z-r)/l;return{x:u+h*c-o*p,y:-h*u+c+n*p,z:o*u-n*c+p}}}(e,i.datum_type,i.datum_params)),e=Bi(e,o,r,n),3===i.datum_type)&&0!==Zi(i,!0,e))return;return e}function Zi(t,i,e){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var s={x:-e.x,y:e.y},a={x:Number.NaN,y:Number.NaN},r=[],n=0;n<t.grids.length;n++){var o=t.grids[n];if(r.push(o.name),o.isNull){a=s;break}if(null!==o.grid){var h=o.grid.subgrids[0],l=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,u=h.ll[0]-l,c=h.ll[1]-l,p=h.ll[0]+(h.lim[0]-1)*h.del[0]+l,f=h.ll[1]+(h.lim[1]-1)*h.del[1]+l;if(!(c>s.y||u>s.x||f<s.y||p<s.x||(a=Wi(s,i,h),isNaN(a.x))))break}else if(o.mandatory)return console.log("Unable to find mandatory grid '"+o.name+"'"),-1}return isNaN(a.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*Ht+" "+s.y*Ht+" tried: '"+r+"'"),-1):(e.x=-a.x,e.y=a.y,0)}function Wi(t,i,e){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var a={x:t.x,y:t.y};a.x-=e.ll[0],a.y-=e.ll[1],a.x=vi(a.x-Math.PI)+Math.PI;var r=Ji(a,e);if(i){if(isNaN(r.x))return s;r.x=a.x-r.x,r.y=a.y-r.y;var n,o,h=9;do{if(o=Ji(r,e),isNaN(o.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}n={x:a.x-(o.x+r.x),y:a.y-(o.y+r.y)},r.x+=n.x,r.y+=n.y}while(h--&&Math.abs(n.x)>1e-12&&Math.abs(n.y)>1e-12);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=vi(r.x+e.ll[0]),s.y=r.y+e.ll[1]}else isNaN(r.x)||(s.x=t.x+r.x,s.y=t.y+r.y);return s}function Ji(t,i){var e,s={x:t.x/i.del[0],y:t.y/i.del[1]},a=Math.floor(s.x),r=Math.floor(s.y),n=s.x-1*a,o=s.y-1*r,h={x:Number.NaN,y:Number.NaN};if(a<0||a>=i.lim[0])return h;if(r<0||r>=i.lim[1])return h;e=r*i.lim[0]+a;var l=i.cvs[e][0],u=i.cvs[e][1];e++;var c=i.cvs[e][0],p=i.cvs[e][1];e+=i.lim[0];var f=i.cvs[e][0],d=i.cvs[e][1];e--;var m=i.cvs[e][0],y=i.cvs[e][1],g=n*o,_=n*(1-o),M=(1-n)*(1-o),v=(1-n)*o;return h.x=M*l+_*c+v*m+g*f,h.y=M*u+_*p+v*y+g*d,h}function Qi(t,i,e){var s,a,r,n=e.x,o=e.y,h=e.z||0,l={};for(r=0;r<3;r++)if(!i||2!==r||void 0!==e.z)switch(0===r?(s=n,a=-1!=="ew".indexOf(t.axis[r])?"x":"y"):1===r?(s=o,a=-1!=="ns".indexOf(t.axis[r])?"y":"x"):(s=h,a="z"),t.axis[r]){case"e":case"n":l[a]=s;break;case"w":case"s":l[a]=-s;break;case"u":void 0!==e[a]&&(l.z=s);break;case"d":void 0!==e[a]&&(l.z=-s);break;default:return null}return l}function Hi(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Vi(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Xi(t,i,e,s){var a;if(Array.isArray(e)&&(e=Hi(e)),function(t){Vi(t.x),Vi(t.y)}(e),t.datum&&i.datum&&function(t,i){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==i.datumCode||(1===i.datum.datum_type||2===i.datum.datum_type)&&"WGS84"!==t.datumCode}(t,i)&&(e=Xi(t,a=new ji("WGS84"),e,s),t=a),s&&"enu"!==t.axis&&(e=Qi(t,!1,e)),"longlat"===t.projName)e={x:e.x*Qt,y:e.y*Qt,z:e.z||0};else if(t.to_meter&&(e={x:e.x*t.to_meter,y:e.y*t.to_meter,z:e.z||0}),!(e=t.inverse(e)))return;if(t.from_greenwich&&(e.x+=t.from_greenwich),e=Di(t.datum,i.datum,e))return i.from_greenwich&&(e={x:e.x-i.from_greenwich,y:e.y,z:e.z||0}),"longlat"===i.projName?e={x:e.x*Ht,y:e.y*Ht,z:e.z||0}:(e=i.forward(e),i.to_meter&&(e={x:e.x/i.to_meter,y:e.y/i.to_meter,z:e.z||0})),s&&"enu"!==i.axis?Qi(i,!0,e):e}ji.projections=Pi,ji.projections.start();var Ki=ji("WGS84");function Yi(t,i,e,s){var a,r,n;return Array.isArray(e)?(a=Xi(t,i,e,s)||{x:NaN,y:NaN},e.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name?"number"==typeof a.z?[a.x,a.y,a.z].concat(e.splice(3)):[a.x,a.y,e[2]].concat(e.splice(3)):[a.x,a.y].concat(e.splice(2)):[a.x,a.y]):(r=Xi(t,i,e,s),2===(n=Object.keys(e)).length||n.forEach((function(s){if(void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name){if("x"===s||"y"===s||"z"===s)return}else if("x"===s||"y"===s)return;r[s]=e[s]})),r)}function $i(t){return t instanceof ji?t:t.oProj?t.oProj:ji(t)}function te(t,i,e){t=$i(t);var s,a=!1;return void 0===i?(i=t,t=Ki,a=!0):(void 0!==i.x||Array.isArray(i))&&(e=i,i=t,t=Ki,a=!0),i=$i(i),e?Yi(t,i,e):(s={forward:function(e,s){return Yi(t,i,e,s)},inverse:function(e,s){return Yi(i,t,e,s)}},a&&(s.oProj=i),s)}var ie="AJSAJS",ee="AFAFAF",se=65,ae=73,re=79,ne=86,oe=90,he={forward:le,inverse:function(t){var i=fe(ye(t.toUpperCase()));if(i.lat&&i.lon)return[i.lon,i.lat,i.lon,i.lat];return[i.left,i.bottom,i.right,i.top]},toPoint:ue};function le(t,i){return i=i||5,function(t,i){var e="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(f=t.easting,d=t.northing,m=t.zoneNumber,y=me(m),g=Math.floor(f/1e5),_=Math.floor(d/1e5)%20,a=g,r=_,n=y,o=n-1,h=ie.charCodeAt(o),l=ee.charCodeAt(o),u=h+a-1,c=l+r,p=!1,u>oe&&(u=u-oe+se-1,p=!0),(u===ae||h<ae&&u>ae||(u>ae||h<ae)&&p)&&u++,(u===re||h<re&&u>re||(u>re||h<re)&&p)&&++u===ae&&u++,u>oe&&(u=u-oe+se-1),c>ne?(c=c-ne+se-1,p=!0):p=!1,(c===ae||l<ae&&c>ae||(c>ae||l<ae)&&p)&&c++,(c===re||l<re&&c>re||(c>re||l<re)&&p)&&++c===ae&&c++,c>ne&&(c=c-ne+se-1),String.fromCharCode(u)+String.fromCharCode(c))+e.substr(e.length-5,i)+s.substr(s.length-5,i);var a,r,n,o,h,l,u,c,p;var f,d,m,y,g,_}(function(t){var i,e,s,a,r,n,o,h,l=t.lat,u=t.lon,c=6378137,p=.00669438,f=.9996,d=ce(l),m=ce(u);h=Math.floor((u+180)/6)+1,180===u&&(h=60);l>=56&&l<64&&u>=3&&u<12&&(h=32);l>=72&&l<84&&(u>=0&&u<9?h=31:u>=9&&u<21?h=33:u>=21&&u<33?h=35:u>=33&&u<42&&(h=37));o=ce(6*(h-1)-180+3),i=p/(1-p),e=c/Math.sqrt(1-p*Math.sin(d)*Math.sin(d)),s=Math.tan(d)*Math.tan(d),a=i*Math.cos(d)*Math.cos(d),r=Math.cos(d)*(m-o),n=c*((1-p/4-3*p*p/64-5*p*p*p/256)*d-(3*p/8+3*p*p/32+45*p*p*p/1024)*Math.sin(2*d)+(15*p*p/256+45*p*p*p/1024)*Math.sin(4*d)-35*p*p*p/3072*Math.sin(6*d));var y=f*e*(r+(1-s+a)*r*r*r/6+(5-18*s+s*s+72*a-58*i)*r*r*r*r*r/120)+5e5,g=f*(n+e*Math.tan(d)*(r*r/2+(5-s+9*a+4*a*a)*r*r*r*r/24+(61-58*s+s*s+600*a-330*i)*r*r*r*r*r*r/720));l<0&&(g+=1e7);return{northing:Math.round(g),easting:Math.round(y),zoneNumber:h,zoneLetter:de(l)}}({lat:t[1],lon:t[0]}),i)}function ue(t){var i=fe(ye(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function ce(t){return t*(Math.PI/180)}function pe(t){return t/Math.PI*180}function fe(t){var i=t.northing,e=t.easting,s=t.zoneLetter,a=t.zoneNumber;if(a<0||a>60)return null;var r,n,o,h,l,u,c,p,f,d=.9996,m=6378137,y=.00669438,g=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=e-5e5,M=i;s<"N"&&(M-=1e7),c=6*(a-1)-180+3,r=.006739496752268451,f=(p=M/d/6367449.145945056)+(3*g/2-27*g*g*g/32)*Math.sin(2*p)+(21*g*g/16-55*g*g*g*g/32)*Math.sin(4*p)+151*g*g*g/96*Math.sin(6*p),n=m/Math.sqrt(1-y*Math.sin(f)*Math.sin(f)),o=Math.tan(f)*Math.tan(f),h=r*Math.cos(f)*Math.cos(f),l=.99330562*m/Math.pow(1-y*Math.sin(f)*Math.sin(f),1.5),u=_/(n*d);var v=f-n*Math.tan(f)/l*(u*u/2-(5+3*o+10*h-4*h*h-9*r)*u*u*u*u/24+(61+90*o+298*h+45*o*o-1.6983531815716497-3*h*h)*u*u*u*u*u*u/720);v=pe(v);var b,x=(u-(1+2*o+h)*u*u*u/6+(5-2*h+28*o-3*h*h+8*r+24*o*o)*u*u*u*u*u/120)/Math.cos(f);if(x=c+pe(x),t.accuracy){var w=fe({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:w.lat,right:w.lon,bottom:v,left:x}}else b={lat:v,lon:x};return b}function de(t){var i="Z";return 84>=t&&t>=72?i="X":72>t&&t>=64?i="W":64>t&&t>=56?i="V":56>t&&t>=48?i="U":48>t&&t>=40?i="T":40>t&&t>=32?i="S":32>t&&t>=24?i="R":24>t&&t>=16?i="Q":16>t&&t>=8?i="P":8>t&&t>=0?i="N":0>t&&t>=-8?i="M":-8>t&&t>=-16?i="L":-16>t&&t>=-24?i="K":-24>t&&t>=-32?i="J":-32>t&&t>=-40?i="H":-40>t&&t>=-48?i="G":-48>t&&t>=-56?i="F":-56>t&&t>=-64?i="E":-64>t&&t>=-72?i="D":-72>t&&t>=-80&&(i="C"),i}function me(t){var i=t%6;return 0===i&&(i=6),i}function ye(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var i,e=t.length,s=null,a="",r=0;!/[A-Z]/.test(i=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;a+=i,r++}var n=parseInt(a,10);if(0===r||r+3>e)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(r++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+t;s=t.substring(r,r+=2);for(var h=me(n),l=function(t,i){var e=ie.charCodeAt(i-1),s=1e5,a=!1;for(;e!==t.charCodeAt(0);){if(++e===ae&&e++,e===re&&e++,e>oe){if(a)throw"Bad character: "+t;e=se,a=!0}s+=1e5}return s}(s.charAt(0),h),u=function(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var e=ee.charCodeAt(i-1),s=0,a=!1;for(;e!==t.charCodeAt(0);){if(++e===ae&&e++,e===re&&e++,e>ne){if(a)throw"Bad character: "+t;e=se,a=!0}s+=1e5}return s}(s.charAt(1),h);u<ge(o);)u+=2e6;var c=e-r;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var p,f,d,m=c/2,y=0,g=0;return m>0&&(p=1e5/Math.pow(10,m),f=t.substring(r,r+m),y=parseFloat(f)*p,d=t.substring(r+m),g=parseFloat(d)*p),{easting:y+l,northing:g+u,zoneLetter:o,zoneNumber:n,accuracy:p}}function ge(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function _e(t,i,e){if(!(this instanceof _e))return new _e(t,i,e);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===i){var s=t.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=t,this.y=i,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}_e.fromMGRS=function(t){return new _e(ue(t))},_e.prototype.toMGRS=function(t){return le([this.x,this.y],t)};var Me=.046875,ve=.01953125,be=.01068115234375;function xe(t){var i=[];i[0]=1-t*(.25+t*(Me+t*(ve+t*be))),i[1]=t*(.75-t*(Me+t*(ve+t*be)));var e=t*t;return i[2]=e*(.46875-t*(.013020833333333334+.007120768229166667*t)),e*=t,i[3]=e*(.3645833333333333-.005696614583333333*t),i[4]=e*t*.3076171875,i}function we(t,i,e,s){return e*=i,i*=i,s[0]*t-e*(s[1]+i*(s[2]+i*(s[3]+i*s[4])))}function Se(t,i,e){for(var s=1/(1-i),a=t,r=20;r;--r){var n=Math.sin(a),o=1-i*n*n;if(a-=o=(we(a,n,Math.cos(a),e)-t)*(o*Math.sqrt(o))*s,Math.abs(o)<Jt)return a}return a}var Ce={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=xe(this.es),this.ml0=we(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var i,e,s,a=t.x,r=t.y,n=vi(a-this.long0),o=Math.sin(r),h=Math.cos(r);if(this.es){var l=h*n,u=Math.pow(l,2),c=this.ep2*Math.pow(h,2),p=Math.pow(c,2),f=Math.abs(h)>Jt?Math.tan(r):0,d=Math.pow(f,2),m=Math.pow(d,2);i=1-this.es*Math.pow(o,2),l/=Math.sqrt(i);var y=we(r,o,h,this.en);e=this.a*(this.k0*l*(1+u/6*(1-d+c+u/20*(5-18*d+m+14*c-58*d*c+u/42*(61+179*m-m*d-479*d)))))+this.x0,s=this.a*(this.k0*(y-this.ml0+o*n*l/2*(1+u/12*(5-d+9*c+4*p+u/30*(61+m-58*d+270*c-330*d*c+u/56*(1385+543*m-m*d-3111*d))))))+this.y0}else{var g=h*Math.sin(n);if(Math.abs(Math.abs(g)-1)<Jt)return 93;if(e=.5*this.a*this.k0*Math.log((1+g)/(1-g))+this.x0,s=h*Math.cos(n)/Math.sqrt(1-Math.pow(g,2)),(g=Math.abs(s))>=1){if(g-1>Jt)return 93;s=0}else s=Math.acos(s);r<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return t.x=e,t.y=s,t},inverse:function(t){var i,e,s,a,r=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(e=Se(i=this.ml0+n/this.k0,this.es,this.en),Math.abs(e)<Wt){var o=Math.sin(e),h=Math.cos(e),l=Math.abs(h)>Jt?Math.tan(e):0,u=this.ep2*Math.pow(h,2),c=Math.pow(u,2),p=Math.pow(l,2),f=Math.pow(p,2);i=1-this.es*Math.pow(o,2);var d=r*Math.sqrt(i)/this.k0,m=Math.pow(d,2);s=e-(i*=l)*m/(1-this.es)*.5*(1-m/12*(5+3*p-9*u*p+u-4*c-m/30*(61+90*p-252*u*p+45*f+46*u-m/56*(1385+3633*p+4095*f+1574*f*p)))),a=vi(this.long0+d*(1-m/6*(1+2*p+u-m/20*(5+28*p+24*f+8*u*p+6*u-m/42*(61+662*p+1320*f+720*f*p))))/h)}else s=Wt*Mi(n),a=0;else{var y=Math.exp(r/this.k0),g=.5*(y-1/y),_=this.lat0+n/this.k0,M=Math.cos(_);i=Math.sqrt((1-Math.pow(M,2))/(1+Math.pow(g,2))),s=Math.asin(i),n<0&&(s=-s),a=0===g&&0===M?0:vi(Math.atan2(g,M)+this.long0)}return t.x=a,t.y=s,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Ae(t){var i=Math.exp(t);return i=(i-1/i)/2}function Ie(t,i){t=Math.abs(t),i=Math.abs(i);var e=Math.max(t,i),s=Math.min(t,i)/(e||1);return e*Math.sqrt(1+Math.pow(s,2))}function Pe(t){var i=Math.abs(t);return i=function(t){var i=1+t,e=i-1;return 0===e?t:t*Math.log(i)/e}(i*(1+i/(Ie(1,i)+1))),t<0?-i:i}function Le(t,i){for(var e,s=2*Math.cos(2*i),a=t.length-1,r=t[a],n=0;--a>=0;)e=s*r-n+t[a],n=r,r=e;return i+e*Math.sin(2*i)}function Oe(t,i,e){for(var s,a,r=Math.sin(i),n=Math.cos(i),o=Ae(e),h=function(t){var i=Math.exp(t);return(i+1/i)/2}(e),l=2*n*h,u=-2*r*o,c=t.length-1,p=t[c],f=0,d=0,m=0;--c>=0;)s=d,a=f,p=l*(d=p)-s-u*(f=m)+t[c],m=u*d-a+l*f;return[(l=r*h)*p-(u=n*o)*m,l*m+u*p]}var ke={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ce.init.apply(this),this.forward=Ce.forward,this.inverse=Ce.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),e=i;this.cgb[0]=i*(2+i*(-2/3+i*(i*(116/45+i*(26/45+i*(-2854/675)))-2))),this.cbg[0]=i*(i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))-2),e*=i,this.cgb[1]=e*(7/3+i*(i*(-227/45+i*(2704/315+i*(2323/945)))-1.6)),this.cbg[1]=e*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),e*=i,this.cgb[2]=e*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=e*(-26/15+i*(34/21+i*(1.6+i*(-12686/2835)))),e*=i,this.cgb[3]=e*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=e*(1237/630+i*(i*(-24832/14175)-2.4)),e*=i,this.cgb[4]=e*(4174/315+i*(-144838/6237)),this.cbg[4]=e*(-734/315+i*(109598/31185)),e*=i,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=i*(i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))-.5),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=e*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=e*(13/48+i*(i*(557/1440+i*(281/630+i*(-1983433/1935360)))-.6)),e*=i,this.utg[2]=e*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=e*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),e*=i,this.utg[3]=e*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=e*(49561/161280+i*(-179/168+i*(6601661/7257600))),e*=i,this.utg[4]=e*(-4583/161280+i*(108847/3991680)),this.gtu[4]=e*(34729/80640+i*(-3418889/1995840)),e*=i,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=.6650675310896665*e;var s=Le(this.cbg,this.lat0);this.Zb=-this.Qn*(s+function(t,i){for(var e,s=2*Math.cos(i),a=t.length-1,r=t[a],n=0;--a>=0;)e=s*r-n+t[a],n=r,r=e;return Math.sin(i)*e}(this.gtu,2*s))},forward:function(t){var i=vi(t.x-this.long0),e=t.y;e=Le(this.cbg,e);var s=Math.sin(e),a=Math.cos(e),r=Math.sin(i),n=Math.cos(i);e=Math.atan2(s,n*a),i=Math.atan2(r*a,Ie(s,a*n)),i=Pe(Math.tan(i));var o,h,l=Oe(this.gtu,2*e,2*i);return e+=l[0],i+=l[1],Math.abs(i)<=2.623395162778?(o=this.a*(this.Qn*i)+this.x0,h=this.a*(this.Qn*e+this.Zb)+this.y0):(o=1/0,h=1/0),t.x=o,t.y=h,t},inverse:function(t){var i,e,s=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(a=(a-this.Zb)/this.Qn,s/=this.Qn,Math.abs(s)<=2.623395162778){var r=Oe(this.utg,2*a,2*s);a+=r[0],s+=r[1],s=Math.atan(Ae(s));var n=Math.sin(a),o=Math.cos(a),h=Math.sin(s),l=Math.cos(s);a=Math.atan2(n*l,Ie(h,l*o)),i=vi((s=Math.atan2(h,l*o))+this.long0),e=Le(this.cgb,a)}else i=1/0,e=1/0;return t.x=i,t.y=e,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var Te={init:function(){var t=function(t,i){if(void 0===t){if((t=Math.floor(30*(vi(i)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Qt,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ke.init.apply(this),this.forward=ke.forward,this.inverse=ke.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Ne(t,i){return Math.pow((1-t)/(1+t),i)}var Ee={init:function(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Vt)/(Math.pow(Math.tan(.5*this.lat0+Vt),this.C)*Ne(this.e*t,this.ratexp))},forward:function(t){var i=t.x,e=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Vt),this.C)*Ne(this.e*Math.sin(e),this.ratexp))-Wt,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,e=t.y,s=Math.pow(Math.tan(.5*e+Vt)/this.K,1/this.C),a=20;a>0&&(e=2*Math.atan(s*Ne(this.e*Math.sin(t.y),-.5*this.e))-Wt,!(Math.abs(e-t.y)<1e-14));--a)t.y=e;return a?(t.x=i,t.y=e,t):null},names:["gauss"]};var Re={init:function(){Ee.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var i,e,s,a;return t.x=vi(t.x-this.long0),Ee.forward.apply(this,[t]),i=Math.sin(t.y),e=Math.cos(t.y),s=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*e*s),t.x=a*e*Math.sin(t.x),t.y=a*(this.cosc0*i-this.sinc0*e*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var i,e,s,a,r;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,r=Math.sqrt(t.x*t.x+t.y*t.y)){var n=2*Math.atan2(r,this.R2);i=Math.sin(n),e=Math.cos(n),a=Math.asin(e*this.sinc0+t.y*i*this.cosc0/r),s=Math.atan2(t.x*i,r*this.cosc0*e-t.y*this.sinc0*i)}else a=this.phic0,s=0;return t.x=s,t.y=a,Ee.inverse.apply(this,[t]),t.x=vi(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var qe={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Jt&&(this.k0=.5*(1+Mi(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Jt&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Jt&&(this.k0=.5*this.cons*_i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/bi(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=_i(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Wt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,e,s,a,r,n,o=t.x,h=t.y,l=Math.sin(h),u=Math.cos(h),c=vi(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=Jt&&Math.abs(h+this.lat0)<=Jt?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*l+this.coslat0*u*Math.cos(c)),t.x=this.a*i*u*Math.sin(c)+this.x0,t.y=this.a*i*(this.coslat0*l-this.sinlat0*u*Math.cos(c))+this.y0,t):(e=2*Math.atan(this.ssfn_(h,l,this.e))-Wt,a=Math.cos(e),s=Math.sin(e),Math.abs(this.coslat0)<=Jt?(r=bi(this.e,h*this.con,this.con*l),n=2*this.a*this.k0*r/this.cons,t.x=this.x0+n*Math.sin(o-this.long0),t.y=this.y0-this.con*n*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<Jt?(i=2*this.a*this.k0/(1+a*Math.cos(c)),t.y=i*s):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*a*Math.cos(c))),t.y=i*(this.cosX0*s-this.sinX0*a*Math.cos(c))+this.y0),t.x=i*a*Math.sin(c)+this.x0,t))},inverse:function(t){var i,e,s,a,r;t.x-=this.x0,t.y-=this.y0;var n=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(n/(2*this.a*this.k0));return i=this.long0,e=this.lat0,n<=Jt?(t.x=i,t.y=e,t):(e=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/n),i=Math.abs(this.coslat0)<Jt?this.lat0>0?vi(this.long0+Math.atan2(t.x,-1*t.y)):vi(this.long0+Math.atan2(t.x,t.y)):vi(this.long0+Math.atan2(t.x*Math.sin(o),n*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=i,t.y=e,t)}if(Math.abs(this.coslat0)<=Jt){if(n<=Jt)return e=this.lat0,i=this.long0,t.x=i,t.y=e,t;t.x*=this.con,t.y*=this.con,s=n*this.cons/(2*this.a*this.k0),e=this.con*xi(this.e,s),i=this.con*vi(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else a=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,n<=Jt?r=this.X0:(r=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/n),i=vi(this.long0+Math.atan2(t.x*Math.sin(a),n*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)))),e=-1*xi(this.e,Math.tan(.5*(Wt+r)));return t.x=i,t.y=e,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,i,e){return i*=e,Math.tan(.5*(Wt+t))*Math.pow((1-i)/(1+i),.5*e)}};var Fe={init:function(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),e=this.a,s=1/this.rf,a=2*s-Math.pow(s,2),r=this.e=Math.sqrt(a);this.R=this.k0*e*Math.sqrt(1-a)/(1-a*Math.pow(i,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),h=Math.log((1+r*i)/(1-r*i));this.K=n-this.alpha*o+this.alpha*r/2*h},forward:function(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(i+e)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),r=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(r))),o=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(r));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*n+this.x0,t},inverse:function(t){for(var i=t.x-this.x0,e=t.y-this.y0,s=i/this.R,a=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),n=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),o=this.lambda0+n/this.alpha,h=0,l=r,u=-1e3,c=0;Math.abs(l-u)>1e-7;){if(++c>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),u=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=o,t.y=l,t},names:["somerc"]},Ge=1e-7;var je={init:function(){var t,i,e,s,a,r,n,o,h,l,u,c,p,f=0,d=0,m=0,y=0,g=0,_=0,M=0;this.no_off=(p="object"==typeof(c=this).PROJECTION?Object.keys(c.PROJECTION)[0]:c.PROJECTION,"no_uoff"in c||"no_off"in c||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(p)),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),v&&(M=this.alpha),b&&(f=this.rectified_grid_angle*Qt),v||b)d=this.longc;else if(m=this.long1,g=this.lat1,y=this.long2,_=this.lat2,Math.abs(g-_)<=Ge||(t=Math.abs(g))<=Ge||Math.abs(t-Wt)<=Ge||Math.abs(Math.abs(this.lat0)-Wt)<=Ge||Math.abs(Math.abs(_)-Wt)<=Ge)throw new Error;var x=1-this.es;i=Math.sqrt(x),Math.abs(this.lat0)>Jt?(o=Math.sin(this.lat0),e=Math.cos(this.lat0),t=1-this.es*o*o,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*i/t,(a=(s=this.B*i/(e*Math.sqrt(t)))*s-1)<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(bi(this.e,this.lat0,o),this.B)):(this.B=1/i,this.A=this.k0,this.E=s=a=1),v||b?(v?(u=Math.asin(Math.sin(M)/s),b||(f=M)):(u=f,M=Math.asin(s*Math.sin(u))),this.lam0=d-Math.asin(.5*(a-1/a)*Math.tan(u))/this.B):(r=Math.pow(bi(this.e,g,Math.sin(g)),this.B),n=Math.pow(bi(this.e,_,Math.sin(_)),this.B),a=this.E/r,h=(n-r)/(n+r),l=((l=this.E*this.E)-n*r)/(l+n*r),(t=m-y)<-Math.pi?y-=Xt:t>Math.pi&&(y+=Xt),this.lam0=vi(.5*(m+y)-Math.atan(l*Math.tan(.5*this.B*(m-y))/h)/this.B),u=Math.atan(2*Math.sin(this.B*vi(m-this.lam0))/(a-1/a)),f=M=Math.asin(s*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(f),this.cosrot=Math.cos(f),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(s*s-1)/Math.cos(M))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Vt-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(Vt+a))},forward:function(t){var i,e,s,a,r,n,o,h,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Wt)>Jt){if(i=.5*((r=this.E/Math.pow(bi(this.e,t.y,Math.sin(t.y)),this.B))-(n=1/r)),e=.5*(r+n),a=Math.sin(this.B*t.x),s=(i*this.singam-a*this.cosgam)/e,Math.abs(Math.abs(s)-1)<Jt)throw new Error;h=.5*this.ArB*Math.log((1-s)/(1+s)),n=Math.cos(this.B*t.x),o=Math.abs(n)<Ge?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+a*this.singam,n)}else h=t.y>0?this.v_pole_n:this.v_pole_s,o=this.ArB*t.y;return this.no_rot?(l.x=o,l.y=h):(o-=this.u_0,l.x=h*this.cosrot+o*this.sinrot,l.y=o*this.cosrot-h*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var i,e,s,a,r,n,o,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(e=t.y,i=t.x):(e=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),a=.5*((s=Math.exp(-this.BrA*e))-1/s),r=.5*(s+1/s),o=((n=Math.sin(this.BrA*i))*this.cosgam+a*this.singam)/r,Math.abs(Math.abs(o)-1)<Jt)h.x=0,h.y=o<0?-Wt:Wt;else{if(h.y=this.E/Math.sqrt((1+o)/(1-o)),h.y=xi(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(a*this.cosgam-n*this.singam,Math.cos(this.BrA*i))}return h.x+=this.lam0,h},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var ze={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Jt)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),e=Math.cos(this.lat1),s=_i(this.e,i,e),a=bi(this.e,this.lat1,i),r=Math.sin(this.lat2),n=Math.cos(this.lat2),o=_i(this.e,r,n),h=bi(this.e,this.lat2,r),l=bi(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Jt?this.ns=Math.log(s/o)/Math.log(a/h):this.ns=i,isNaN(this.ns)&&(this.ns=i),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,e=t.y;Math.abs(2*Math.abs(e)-Math.PI)<=Jt&&(e=Mi(e)*(Wt-2e-10));var s,a,r=Math.abs(Math.abs(e)-Wt);if(r>Jt)s=bi(this.e,e,Math.sin(e)),a=this.a*this.f0*Math.pow(s,this.ns);else{if((r=e*this.ns)<=0)return null;a=0}var n=this.ns*vi(i-this.long0);return t.x=this.k0*(a*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(n))+this.y0,t},inverse:function(t){var i,e,s,a,r,n=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(n*n+o*o),e=1):(i=-Math.sqrt(n*n+o*o),e=-1);var h=0;if(0!==i&&(h=Math.atan2(e*n,e*o)),0!==i||this.ns>0){if(e=1/this.ns,s=Math.pow(i/(this.a*this.f0),e),-9999===(a=xi(this.e,s)))return null}else a=-Wt;return r=vi(h/this.ns+this.long0),t.x=r,t.y=a,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Be={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var i,e,s,a,r,n,o,h=t.x,l=t.y,u=vi(h-this.long0);return i=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/i)-this.s45),s=-u*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(s)),r=Math.asin(Math.cos(e)*Math.sin(s)/Math.cos(a)),n=this.n*r,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=o*Math.cos(n)/1,t.x=o*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var i,e,s,a,r,n,o,h=t.x;t.x=t.y,t.y=h,this.czech||(t.y*=-1,t.x*=-1),r=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x)/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),e=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(i)),t.x=this.long0-e/this.alfa,n=i,o=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(o=1),n=t.y,l+=1}while(0===o&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function Ue(t,i,e,s,a){return t*a-i*Math.sin(2*a)+e*Math.sin(4*a)-s*Math.sin(6*a)}function De(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ze(t){return.375*t*(1+.25*t*(1+.46875*t))}function We(t){return.05859375*t*t*(1+.75*t)}function Je(t){return t*t*t*(35/3072)}function Qe(t,i,e){var s=i*e;return t/Math.sqrt(1-s*s)}function He(t){return Math.abs(t)<Wt?t:t-Mi(t)*Math.PI}function Ve(t,i,e,s,a){var r,n;r=t/i;for(var o=0;o<15;o++)if(r+=n=(t-(i*r-e*Math.sin(2*r)+s*Math.sin(4*r)-a*Math.sin(6*r)))/(i-2*e*Math.cos(2*r)+4*s*Math.cos(4*r)-6*a*Math.cos(6*r)),Math.abs(n)<=1e-10)return r;return NaN}var Xe={init:function(){this.sphere||(this.e0=De(this.es),this.e1=Ze(this.es),this.e2=We(this.es),this.e3=Je(this.es),this.ml0=this.a*Ue(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var i,e,s=t.x,a=t.y;if(s=vi(s-this.long0),this.sphere)i=this.a*Math.asin(Math.cos(a)*Math.sin(s)),e=this.a*(Math.atan2(Math.tan(a),Math.cos(s))-this.lat0);else{var r=Math.sin(a),n=Math.cos(a),o=Qe(this.a,this.e,r),h=Math.tan(a)*Math.tan(a),l=s*Math.cos(a),u=l*l,c=this.es*n*n/(1-this.es);i=o*l*(1-u*h*(1/6-(8-h+8*c)*u/120)),e=this.a*Ue(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+o*r/n*u*(.5+(5-h+6*c)*u/24)}return t.x=i+this.x0,t.y=e+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,e,s=t.x/this.a,a=t.y/this.a;if(this.sphere){var r=a+this.lat0;i=Math.asin(Math.sin(r)*Math.cos(s)),e=Math.atan2(Math.tan(s),Math.cos(r))}else{var n=Ve(this.ml0/this.a+a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-Wt)<=Jt)return t.x=this.long0,t.y=Wt,a<0&&(t.y*=-1),t;var o=Qe(this.a,this.e,Math.sin(n)),h=o*o*o/this.a/this.a*(1-this.es),l=Math.pow(Math.tan(n),2),u=s*this.a/o,c=u*u;i=n-o*Math.tan(n)/h*u*u*(.5-(1+3*l)*u*u/24),e=u*(1-c*(l/3+(1+3*l)*l*c/15))/Math.cos(n)}return t.x=vi(e+this.long0),t.y=He(i),t},names:["Cassini","Cassini_Soldner","cass"]};function Ke(t,i){var e;return t>1e-7?(1-t*t)*(i/(1-(e=t*i)*e)-.5/t*Math.log((1-e)/(1+e))):2*i}var Ye=.3333333333333333,$e=.17222222222222222,ts=.10257936507936508,is=.06388888888888888,es=.0664021164021164,ss=.016415012942191543;var as={init:function(){var t,i=Math.abs(this.lat0);if(Math.abs(i-Wt)<Jt?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<Jt?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Ke(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var i,e=[];return e[0]=t*Ye,i=t*t,e[0]+=i*$e,e[1]=i*is,i*=t,e[0]+=i*ts,e[1]+=i*es,e[2]=i*ss,e}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ke(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,e,s,a,r,n,o,h,l,u,c=t.x,p=t.y;if(c=vi(c-this.long0),this.sphere){if(r=Math.sin(p),u=Math.cos(p),s=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((e=this.mode===this.EQUIT?1+u*s:1+this.sinph0*r+this.cosph0*u*s)<=Jt)return null;i=(e=Math.sqrt(2/e))*u*Math.sin(c),e*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*u*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(p+this.lat0)<Jt)return null;e=Vt-.5*p,i=(e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)))*Math.sin(c),e*=s}}else{switch(o=0,h=0,l=0,s=Math.cos(c),a=Math.sin(c),r=Math.sin(p),n=Ke(this.e,r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=n/this.qp,h=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:l=1+this.sinb1*o+this.cosb1*h*s;break;case this.EQUIT:l=1+h*s;break;case this.N_POLE:l=Wt+p,n=this.qp-n;break;case this.S_POLE:l=p-Wt,n=this.qp+n}if(Math.abs(l)<Jt)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),e=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*o-this.sinb1*h*s):(l=Math.sqrt(2/(1+h*s)))*o*this.ymf,i=this.xmf*l*h*a;break;case this.N_POLE:case this.S_POLE:n>=0?(i=(l=Math.sqrt(n))*a,e=s*(this.mode===this.S_POLE?l:-l)):i=e=0}}return t.x=this.a*i+this.x0,t.y=this.a*e+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,e,s,a,r,n,o,h,l,u,c=t.x/this.a,p=t.y/this.a;if(this.sphere){var f,d=0,m=0;if((e=.5*(f=Math.sqrt(c*c+p*p)))>1)return null;switch(e=2*Math.asin(e),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(e),d=Math.cos(e)),this.mode){case this.EQUIT:e=Math.abs(f)<=Jt?0:Math.asin(p*m/f),c*=m,p=d*f;break;case this.OBLIQ:e=Math.abs(f)<=Jt?this.lat0:Math.asin(d*this.sinph0+p*m*this.cosph0/f),c*=m*this.cosph0,p=(d-Math.sin(e)*this.sinph0)*f;break;case this.N_POLE:p=-p,e=Wt-e;break;case this.S_POLE:e-=Wt}i=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,p):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,p*=this.dd,(n=Math.sqrt(c*c+p*p))<Jt)return t.x=this.long0,t.y=this.lat0,t;a=2*Math.asin(.5*n/this.rq),s=Math.cos(a),c*=a=Math.sin(a),this.mode===this.OBLIQ?(o=s*this.sinb1+p*a*this.cosb1/n,r=this.qp*o,p=n*this.cosb1*s-p*this.sinb1*a):(o=p*a/n,r=this.qp*o,p=n*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(r=c*c+p*p))return t.x=this.long0,t.y=this.lat0,t;o=1-r/this.qp,this.mode===this.S_POLE&&(o=-o)}i=Math.atan2(c,p),h=Math.asin(o),l=this.apa,u=h+h,e=h+l[0]*Math.sin(u)+l[1]*Math.sin(u+u)+l[2]*Math.sin(u+u+u)}return t.x=vi(this.long0+i),t.y=e,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function rs(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var ns={init:function(){Math.abs(this.lat1+this.lat2)<Jt||(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=_i(this.e3,this.sin_po,this.cos_po),this.qs1=Ke(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=_i(this.e3,this.sin_po,this.cos_po),this.qs2=Ke(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ke(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>Jt?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var i=t.x,e=t.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var s=Ke(this.e3,this.sin_phi,this.cos_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,r=this.ns0*vi(i-this.long0),n=a*Math.sin(r)+this.x0,o=this.rh-a*Math.cos(r)+this.y0;return t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a,r,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),a=0,0!==i&&(a=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,this.sphere?n=Math.asin((this.c-s*s)/(2*this.ns0)):(e=(this.c-s*s)/this.ns0,n=this.phi1z(this.e3,e)),r=vi(a/this.ns0+this.long0),t.x=r,t.y=n,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,i){var e,s,a,r,n=rs(.5*i);if(t<Jt)return n;for(var o=t*t,h=1;h<=25;h++)if(n+=r=.5*(a=1-(s=t*(e=Math.sin(n)))*s)*a/Math.cos(n)*(i/(1-o)-e/a+.5/t*Math.log((1-s)/(1+s))),Math.abs(r)<=1e-7)return n;return null}};var os={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var i,e,s,a,r,n,o,h=t.x,l=t.y;return s=vi(h-this.long0),i=Math.sin(l),e=Math.cos(l),a=Math.cos(s),1,(r=this.sin_p14*i+this.cos_p14*e*a)>0||Math.abs(r)<=Jt?(n=this.x0+1*this.a*e*Math.sin(s)/r,o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*e*a)/r):(n=this.x0+this.infinity_dist*e*Math.sin(s),o=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*e*a)),t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a,r,n;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(i,this.rc),e=Math.sin(a),n=rs((s=Math.cos(a))*this.sin_p14+t.y*e*this.cos_p14/i),r=Math.atan2(t.x*e,i*this.cos_p14*s-t.y*this.sin_p14*e),r=vi(this.long0+r)):(n=this.phic0,r=0),t.x=r,t.y=n,t},names:["gnom"]};var hs={init:function(){this.sphere||(this.k0=_i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var i,e,s=t.x,a=t.y,r=vi(s-this.long0);if(this.sphere)i=this.x0+this.a*r*Math.cos(this.lat_ts),e=this.y0+this.a*Math.sin(a)/Math.cos(this.lat_ts);else{var n=Ke(this.e,Math.sin(a));i=this.x0+this.a*this.k0*r,e=this.y0+this.a*n*.5/this.k0}return t.x=i,t.y=e,t},inverse:function(t){var i,e;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=vi(this.long0+t.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(e=function(t,i){var e=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-e)<1e-6)return i<0?-1*Wt:Wt;for(var s,a,r,n,o=Math.asin(.5*i),h=0;h<30;h++)if(a=Math.sin(o),r=Math.cos(o),n=t*a,o+=s=Math.pow(1-n*n,2)/(2*r)*(i/(1-t*t)-a/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),Math.abs(s)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),i=vi(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=e,t},names:["cea"]};var ls={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var i=t.x,e=t.y,s=vi(i-this.long0),a=He(e-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*a,t},inverse:function(t){var i=t.x,e=t.y;return t.x=vi(this.long0+(i-this.x0)/(this.a*this.rc)),t.y=He(this.lat0+(e-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var us={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=De(this.es),this.e1=Ze(this.es),this.e2=We(this.es),this.e3=Je(this.es),this.ml0=this.a*Ue(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var i,e,s,a=t.x,r=t.y,n=vi(a-this.long0);if(s=n*Math.sin(r),this.sphere)Math.abs(r)<=Jt?(i=this.a*n,e=-1*this.a*this.lat0):(i=this.a*Math.sin(s)/Math.tan(r),e=this.a*(He(r-this.lat0)+(1-Math.cos(s))/Math.tan(r)));else if(Math.abs(r)<=Jt)i=this.a*n,e=-1*this.ml0;else{var o=Qe(this.a,this.e,Math.sin(r))/Math.tan(r);i=o*Math.sin(s),e=this.a*Ue(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+o*(1-Math.cos(s))}return t.x=i+this.x0,t.y=e+this.y0,t},inverse:function(t){var i,e,s,a,r,n,o,h,l;if(s=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=Jt)i=vi(s/this.a+this.long0),e=0;else{var u;for(n=this.lat0+a/this.a,o=s*s/this.a/this.a+n*n,h=n,r=20;r;--r)if(h+=l=-1*(n*(h*(u=Math.tan(h))+1)-h-.5*(h*h+o)*u)/((h-n)/u-1),Math.abs(l)<=Jt){e=h;break}i=vi(this.long0+Math.asin(s*Math.tan(h)/this.a)/Math.sin(e))}else if(Math.abs(a+this.ml0)<=Jt)e=0,i=vi(this.long0+s/this.a);else{var c,p,f,d,m;for(n=(this.ml0+a)/this.a,o=s*s/this.a/this.a+n*n,h=n,r=20;r;--r)if(m=this.e*Math.sin(h),c=Math.sqrt(1-m*m)*Math.tan(h),p=this.a*Ue(this.e0,this.e1,this.e2,this.e3,h),f=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),h-=l=(n*(c*(d=p/this.a)+1)-d-.5*c*(d*d+o))/(this.es*Math.sin(2*h)*(d*d+o-2*n*d)/(4*c)+(n-d)*(c*f-2/Math.sin(2*h))-f),Math.abs(l)<=Jt){e=h;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),i=vi(this.long0+Math.asin(s*c/this.a)/Math.sin(e))}return t.x=i,t.y=e,t},names:["Polyconic","poly"]};var cs={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var i,e=t.x,s=t.y-this.lat0,a=e-this.long0,r=s/Zt*1e-5,n=a,o=1,h=0;for(i=1;i<=10;i++)o*=r,h+=this.A[i]*o;var l,u=h,c=n,p=1,f=0,d=0,m=0;for(i=1;i<=6;i++)l=f*u+p*c,p=p*u-f*c,f=l,d=d+this.B_re[i]*p-this.B_im[i]*f,m=m+this.B_im[i]*p+this.B_re[i]*f;return t.x=m*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var i,e,s=t.x,a=t.y,r=s-this.x0,n=(a-this.y0)/this.a,o=r/this.a,h=1,l=0,u=0,c=0;for(i=1;i<=6;i++)e=l*n+h*o,h=h*n-l*o,l=e,u=u+this.C_re[i]*h-this.C_im[i]*l,c=c+this.C_im[i]*h+this.C_re[i]*l;for(var p=0;p<this.iterations;p++){var f,d=u,m=c,y=n,g=o;for(i=2;i<=6;i++)f=m*u+d*c,d=d*u-m*c,m=f,y+=(i-1)*(this.B_re[i]*d-this.B_im[i]*m),g+=(i-1)*(this.B_im[i]*d+this.B_re[i]*m);d=1,m=0;var _=this.B_re[1],M=this.B_im[1];for(i=2;i<=6;i++)f=m*u+d*c,d=d*u-m*c,m=f,_+=i*(this.B_re[i]*d-this.B_im[i]*m),M+=i*(this.B_im[i]*d+this.B_re[i]*m);var v=_*_+M*M;u=(y*_+g*M)/v,c=(g*_-y*M)/v}var b=u,x=c,w=1,S=0;for(i=1;i<=9;i++)w*=b,S+=this.D[i]*w;var C=this.lat0+S*Zt*1e5,A=this.long0+x;return t.x=A,t.y=C,t},names:["New_Zealand_Map_Grid","nzmg"]};var ps={init:function(){},forward:function(t){var i=t.x,e=t.y,s=vi(i-this.long0),a=this.x0+this.a*s,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return t.x=a,t.y=r,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i=vi(this.long0+t.x/this.a),e=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=e,t},names:["Miller_Cylindrical","mill"]};var fs={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=xe(this.es)},forward:function(t){var i,e,s=t.x,a=t.y;if(s=vi(s-this.long0),this.sphere){if(this.m)for(var r=this.n*Math.sin(a),n=20;n;--n){var o=(this.m*a+Math.sin(a)-r)/(this.m+Math.cos(a));if(a-=o,Math.abs(o)<Jt)break}else a=1!==this.n?Math.asin(this.n*Math.sin(a)):a;i=this.a*this.C_x*s*(this.m+Math.cos(a)),e=this.a*this.C_y*a}else{var h=Math.sin(a),l=Math.cos(a);e=this.a*we(a,h,l,this.en),i=this.a*s*l/Math.sqrt(1-this.es*h*h)}return t.x=i,t.y=e,t},inverse:function(t){var i,e,s;return t.x-=this.x0,e=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,e/=this.C_x*(this.m+Math.cos(i)),this.m?i=rs((this.m*i+Math.sin(i))/this.n):1!==this.n&&(i=rs(Math.sin(i)/this.n)),e=vi(e+this.long0),i=He(i)):(i=Se(t.y/this.a,this.es,this.en),(s=Math.abs(i))<Wt?(s=Math.sin(i),e=vi(this.long0+t.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(i)))):s-Jt<Wt&&(e=this.long0)),t.x=e,t.y=i,t},names:["Sinusoidal","sinu"]};var ds={init:function(){},forward:function(t){for(var i=t.x,e=t.y,s=vi(i-this.long0),a=e,r=Math.PI*Math.sin(e);;){var n=-(a+Math.sin(a)-r)/(1+Math.cos(a));if(a+=n,Math.abs(n)<Jt)break}a/=2,Math.PI/2-Math.abs(e)<Jt&&(s=0);var o=.900316316158*this.a*s*Math.cos(a)+this.x0,h=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=o,t.y=h,t},inverse:function(t){var i,e;t.x-=this.x0,t.y-=this.y0,e=t.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),i=Math.asin(e);var s=vi(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),e=(2*i+Math.sin(2*i))/Math.PI,Math.abs(e)>1&&(e=1);var a=Math.asin(e);return t.x=s,t.y=a,t},names:["Mollweide","moll"]};var ms={init:function(){Math.abs(this.lat1+this.lat2)<Jt||(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=De(this.es),this.e1=Ze(this.es),this.e2=We(this.es),this.e3=Je(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=_i(this.e,this.sinphi,this.cosphi),this.ml1=Ue(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Jt?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=_i(this.e,this.sinphi,this.cosphi),this.ml2=Ue(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=Ue(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var i,e=t.x,s=t.y;if(this.sphere)i=this.a*(this.g-s);else{var a=Ue(this.e0,this.e1,this.e2,this.e3,s);i=this.a*(this.g-a)}var r=this.ns*vi(e-this.long0),n=this.x0+i*Math.sin(r),o=this.y0+this.rh-i*Math.cos(r);return t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var r=0;return 0!==e&&(r=Math.atan2(i*t.x,i*t.y)),this.sphere?(a=vi(this.long0+r/this.ns),s=He(this.g-e/this.a),t.x=a,t.y=s,t):(s=Ve(this.g-e/this.a,this.e0,this.e1,this.e2,this.e3),a=vi(this.long0+r/this.ns),t.x=a,t.y=s,t)},names:["Equidistant_Conic","eqdc"]};var ys={init:function(){this.R=this.a},forward:function(t){var i,e,s=t.x,a=t.y,r=vi(s-this.long0);Math.abs(a)<=Jt&&(i=this.x0+this.R*r,e=this.y0);var n=rs(2*Math.abs(a/Math.PI));(Math.abs(r)<=Jt||Math.abs(Math.abs(a)-Wt)<=Jt)&&(i=this.x0,e=a>=0?this.y0+Math.PI*this.R*Math.tan(.5*n):this.y0+Math.PI*this.R*-Math.tan(.5*n));var o=.5*Math.abs(Math.PI/r-r/Math.PI),h=o*o,l=Math.sin(n),u=Math.cos(n),c=u/(l+u-1),p=c*c,f=c*(2/l-1),d=f*f,m=Math.PI*this.R*(o*(c-d)+Math.sqrt(h*(c-d)*(c-d)-(d+h)*(p-d)))/(d+h);r<0&&(m=-m),i=this.x0+m;var y=h+c;return m=Math.PI*this.R*(f*y-o*Math.sqrt((d+h)*(h+1)-y*y))/(d+h),e=a>=0?this.y0+m:this.y0-m,t.x=i,t.y=e,t},inverse:function(t){var i,e,s,a,r,n,o,h,l,u,c,p;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,r=(s=t.x/c)*s+(a=t.y/c)*a,c=3*(a*a/(h=-2*(n=-Math.abs(a)*(1+r))+1+2*a*a+r*r)+(2*(o=n-2*a*a+s*s)*o*o/h/h/h-9*n*o/h/h)/27)/(l=(n-o*o/3/h)/h)/(u=2*Math.sqrt(-l/3)),Math.abs(c)>1&&(c=c>=0?1:-1),p=Math.acos(c)/3,e=t.y>=0?(-u*Math.cos(p+Math.PI/3)-o/3/h)*Math.PI:-(-u*Math.cos(p+Math.PI/3)-o/3/h)*Math.PI,i=Math.abs(s)<Jt?this.long0:vi(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(s*s-a*a)+r*r))/2/s),t.x=i,t.y=e,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var gs={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var i,e,s,a,r,n,o,h,l,u,c,p,f,d,m,y,g,_,M,v,b,x,w=t.x,S=t.y,C=Math.sin(t.y),A=Math.cos(t.y),I=vi(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Jt?(t.x=this.x0+this.a*(Wt-S)*Math.sin(I),t.y=this.y0-this.a*(Wt-S)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=Jt?(t.x=this.x0+this.a*(Wt+S)*Math.sin(I),t.y=this.y0+this.a*(Wt+S)*Math.cos(I),t):(_=this.sin_p12*C+this.cos_p12*A*Math.cos(I),g=(y=Math.acos(_))?y/Math.sin(y):1,t.x=this.x0+this.a*g*A*Math.sin(I),t.y=this.y0+this.a*g*(this.cos_p12*C-this.sin_p12*A*Math.cos(I)),t):(i=De(this.es),e=Ze(this.es),s=We(this.es),a=Je(this.es),Math.abs(this.sin_p12-1)<=Jt?(r=this.a*Ue(i,e,s,a,Wt),n=this.a*Ue(i,e,s,a,S),t.x=this.x0+(r-n)*Math.sin(I),t.y=this.y0-(r-n)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=Jt?(r=this.a*Ue(i,e,s,a,Wt),n=this.a*Ue(i,e,s,a,S),t.x=this.x0+(r+n)*Math.sin(I),t.y=this.y0+(r+n)*Math.cos(I),t):(o=C/A,h=Qe(this.a,this.e,this.sin_p12),l=Qe(this.a,this.e,C),u=Math.atan((1-this.es)*o+this.es*h*this.sin_p12/(l*A)),M=0===(c=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(c)-Math.PI)<=Jt?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(I)*Math.cos(u)/Math.sin(c)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),y=h*M*(1-(v=M*M)*(m=(f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*f)*(1-m)/6+(b=v*M)/8*(d=p*f)*(1-2*m)+(x=b*M)/120*(m*(4-7*m)-3*p*p*(1-7*m))-x*M/48*d),t.x=this.x0+y*Math.sin(c),t.y=this.y0+y*Math.cos(c),t))},inverse:function(t){var i,e,s,a,r,n,o,h,l,u,c,p,f,d,m,y,g,_,M,v,b,x,w;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*Wt*this.a)return;return e=i/this.a,s=Math.sin(e),a=Math.cos(e),r=this.long0,Math.abs(i)<=Jt?n=this.lat0:(n=rs(a*this.sin_p12+t.y*s*this.cos_p12/i),o=Math.abs(this.lat0)-Wt,r=Math.abs(o)<=Jt?this.lat0>=0?vi(this.long0+Math.atan2(t.x,-t.y)):vi(this.long0-Math.atan2(-t.x,t.y)):vi(this.long0+Math.atan2(t.x*s,i*this.cos_p12*a-t.y*this.sin_p12*s))),t.x=r,t.y=n,t}return h=De(this.es),l=Ze(this.es),u=We(this.es),c=Je(this.es),Math.abs(this.sin_p12-1)<=Jt?(n=Ve(((p=this.a*Ue(h,l,u,c,Wt))-(i=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,h,l,u,c),r=vi(this.long0+Math.atan2(t.x,-1*t.y)),t.x=r,t.y=n,t):Math.abs(this.sin_p12+1)<=Jt?(p=this.a*Ue(h,l,u,c,Wt),n=Ve(((i=Math.sqrt(t.x*t.x+t.y*t.y))-p)/this.a,h,l,u,c),r=vi(this.long0+Math.atan2(t.x,t.y)),t.x=r,t.y=n,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),m=Math.atan2(t.x,t.y),f=Qe(this.a,this.e,this.sin_p12),y=Math.cos(m),_=-(g=this.e*this.cos_p12*y)*g/(1-this.es),M=3*this.es*(1-_)*this.sin_p12*this.cos_p12*y/(1-this.es),x=1-_*(b=(v=i/f)-_*(1+_)*Math.pow(v,3)/6-M*(1+3*_)*Math.pow(v,4)/24)*b/2-v*b*b*b/6,d=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*y),r=vi(this.long0+Math.asin(Math.sin(m)*Math.sin(b)/Math.cos(d))),w=Math.sin(d),n=Math.atan2((w-this.es*x*this.sin_p12)*Math.tan(d),w*(1-this.es)),t.x=r,t.y=n,t)},names:["Azimuthal_Equidistant","aeqd"]};var _s={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var i,e,s,a,r,n,o,h=t.x,l=t.y;return s=vi(h-this.long0),i=Math.sin(l),e=Math.cos(l),a=Math.cos(s),1,((r=this.sin_p14*i+this.cos_p14*e*a)>0||Math.abs(r)<=Jt)&&(n=1*this.a*e*Math.sin(s),o=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*e*a)),t.x=n,t.y=o,t},inverse:function(t){var i,e,s,a,r,n,o;return t.x-=this.x0,t.y-=this.y0,e=rs((i=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),s=Math.sin(e),a=Math.cos(e),n=this.long0,Math.abs(i)<=Jt?(o=this.lat0,t.x=n,t.y=o,t):(o=rs(a*this.sin_p14+t.y*s*this.cos_p14/i),r=Math.abs(this.lat0)-Wt,Math.abs(r)<=Jt?(n=this.lat0>=0?vi(this.long0+Math.atan2(t.x,-t.y)):vi(this.long0-Math.atan2(-t.x,t.y)),t.x=n,t.y=o,t):(n=vi(this.long0+Math.atan2(t.x*s,i*this.cos_p14*a-t.y*this.sin_p14*s)),t.x=n,t.y=o,t))},names:["ortho"]},Ms=1,vs=2,bs=3,xs=4,ws=5,Ss=6,Cs=1,As=2,Is=3,Ps=4;function Ls(t,i,e,s){var a;return t<Jt?(s.value=Cs,a=0):(a=Math.atan2(i,e),Math.abs(a)<=Vt?s.value=Cs:a>Vt&&a<=Wt+Vt?(s.value=As,a-=Wt):a>Wt+Vt||a<=-(Wt+Vt)?(s.value=Is,a=a>=0?a-Kt:a+Kt):(s.value=Ps,a+=Wt)),a}function Os(t,i){var e=t+i;return e<-Kt?e+=Xt:e>+Kt&&(e-=Xt),e}var ks={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Wt-Vt/2?this.face=ws:this.lat0<=-(Wt-Vt/2)?this.face=Ss:Math.abs(this.long0)<=Vt?this.face=Ms:Math.abs(this.long0)<=Wt+Vt?this.face=this.long0>0?vs:xs:this.face=bs,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,e,s,a,r,n,o={x:0,y:0},h={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,e=t.x,this.face===ws)a=Wt-i,e>=Vt&&e<=Wt+Vt?(h.value=Cs,s=e-Wt):e>Wt+Vt||e<=-(Wt+Vt)?(h.value=As,s=e>0?e-Kt:e+Kt):e>-(Wt+Vt)&&e<=-Vt?(h.value=Is,s=e+Wt):(h.value=Ps,s=e);else if(this.face===Ss)a=Wt+i,e>=Vt&&e<=Wt+Vt?(h.value=Cs,s=-e+Wt):e<Vt&&e>=-Vt?(h.value=As,s=-e):e<-Vt&&e>=-(Wt+Vt)?(h.value=Is,s=-e-Wt):(h.value=Ps,s=e>0?-e+Kt:-e-Kt);else{var l,u,c,p,f,d;this.face===vs?e=Os(e,+Wt):this.face===bs?e=Os(e,+Kt):this.face===xs&&(e=Os(e,-Wt)),p=Math.sin(i),f=Math.cos(i),d=Math.sin(e),l=f*Math.cos(e),u=f*d,c=p,this.face===Ms?s=Ls(a=Math.acos(l),c,u,h):this.face===vs?s=Ls(a=Math.acos(u),c,-l,h):this.face===bs?s=Ls(a=Math.acos(-l),c,-u,h):this.face===xs?s=Ls(a=Math.acos(-u),c,l,h):(a=s=0,h.value=Cs)}return n=Math.atan(12/Kt*(s+Math.acos(Math.sin(s)*Math.cos(Vt))-Wt)),r=Math.sqrt((1-Math.cos(a))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(s))))),h.value===As?n+=Wt:h.value===Is?n+=Kt:h.value===Ps&&(n+=1.5*Kt),o.x=r*Math.cos(n),o.y=r*Math.sin(n),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var i,e,s,a,r,n,o,h,l,u,c,p,f={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,e=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=Cs:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=As,i-=Wt):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=Is,i=i<0?i+Kt:i-Kt):(d.value=Ps,i+=Wt),l=Kt/12*Math.tan(i),r=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),n=Math.atan(r),(o=1-(s=Math.cos(i))*s*(a=Math.tan(e))*a*(1-Math.cos(Math.atan(1/Math.cos(n)))))<-1?o=-1:o>1&&(o=1),this.face===ws)h=Math.acos(o),f.phi=Wt-h,d.value===Cs?f.lam=n+Wt:d.value===As?f.lam=n<0?n+Kt:n-Kt:d.value===Is?f.lam=n-Wt:f.lam=n;else if(this.face===Ss)h=Math.acos(o),f.phi=h-Wt,d.value===Cs?f.lam=-n+Wt:d.value===As?f.lam=-n:d.value===Is?f.lam=-n-Wt:f.lam=n<0?-n-Kt:-n+Kt;else{var m,y,g;l=(m=o)*m,y=(l+=(g=l>=1?0:Math.sqrt(1-l)*Math.sin(n))*g)>=1?0:Math.sqrt(1-l),d.value===As?(l=y,y=-g,g=l):d.value===Is?(y=-y,g=-g):d.value===Ps&&(l=y,y=g,g=-l),this.face===vs?(l=m,m=-y,y=l):this.face===bs?(m=-m,y=-y):this.face===xs&&(l=m,m=y,y=-l),f.phi=Math.acos(-g)-Wt,f.lam=Math.atan2(y,m),this.face===vs?f.lam=Os(f.lam,-Wt):this.face===bs?f.lam=Os(f.lam,-Kt):this.face===xs&&(f.lam=Os(f.lam,+Wt))}return 0!==this.es&&(u=f.phi<0?1:0,c=Math.tan(f.phi),p=this.b/Math.sqrt(c*c+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),u&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Ts=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ns=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Es=.8487,Rs=1.3523,qs=Ht/5,Fs=18,Gs=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))};var js={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var i=vi(t.x-this.long0),e=Math.abs(t.y),s=Math.floor(e*qs);s<0?s=0:s>=Fs&&(s=17);var a={x:Gs(Ts[s],e=Ht*(e-.08726646259971647*s))*i,y:Gs(Ns[s],e)};return t.y<0&&(a.y=-a.y),a.x=a.x*this.a*Es+this.x0,a.y=a.y*this.a*Rs+this.y0,a},inverse:function(t){var i={x:(t.x-this.x0)/(this.a*Es),y:Math.abs(t.y-this.y0)/(this.a*Rs)};if(i.y>=1)i.x/=Ts[18][0],i.y=t.y<0?-Wt:Wt;else{var e=Math.floor(i.y*Fs);for(e<0?e=0:e>=Fs&&(e=17);;)if(Ns[e][0]>i.y)--e;else{if(!(Ns[e+1][0]<=i.y))break;++e}var s=Ns[e],a=5*(i.y-s[0])/(Ns[e+1][0]-s[0]);a=function(t,i,e,s){for(var a=i;s;--s){var r=t(a);if(a-=r,Math.abs(r)<e)break}return a}((function(t){return(Gs(s,t)-i.y)/function(t,i){return t[1]+i*(2*t[2]+3*i*t[3])}(s,t)}),a,Jt,100),i.x/=Gs(Ts[e],a),i.y=(5*e+a)*Qt,t.y<0&&(i.y=-i.y)}return i.x=vi(i.x+this.long0),i},names:["Robinson","robin"]};var zs={init:function(){this.name="geocent"},forward:function(t){return zi(t,this.es,this.a)},inverse:function(t){return Bi(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},Bs=0,Us=1,Ds=2,Zs=3,Ws={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var Js={init:function(){if(Object.keys(Ws).forEach(function(t){if(void 0===this[t])this[t]=Ws[t].def;else{if(Ws[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ws[t].num&&(this[t]=parseFloat(this[t]))}Ws[t].degrees&&(this[t]=this[t]*Qt)}.bind(this)),Math.abs(Math.abs(this.lat0)-Wt)<Jt?this.mode=this.lat0<0?Us:Bs:Math.abs(this.lat0)<Jt?this.mode=Ds:(this.mode=Zs,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 t=this.tilt,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var i,e,s,a,r=Math.sin(t.y),n=Math.cos(t.y),o=Math.cos(t.x);switch(this.mode){case Zs:e=this.sinph0*r+this.cosph0*n*o;break;case Ds:e=n*o;break;case Us:e=-r;break;case Bs:e=r}switch(i=(e=this.pn1/(this.p-e))*n*Math.sin(t.x),this.mode){case Zs:e*=this.cosph0*r-this.sinph0*n*o;break;case Ds:e*=r;break;case Bs:e*=-n*o;break;case Us:e*=n*o}return a=1/((s=e*this.cg+i*this.sg)*this.sw*this.h1+this.cw),i=(i*this.cg-e*this.sg)*this.cw*a,e=s*a,t.x=i*this.a,t.y=e*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var i,e,s,a={x:t.x,y:t.y};s=1/(this.pn1-t.y*this.sw),i=this.pn1*t.x*s,e=this.pn1*t.y*this.cw*s,t.x=i*this.cg+e*this.sg,t.y=e*this.cg-i*this.sg;var r=Ie(t.x,t.y);if(Math.abs(r)<Jt)a.x=0,a.y=t.y;else{var n,o;switch(o=1-r*r*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/r+r/this.pn1),n=Math.sqrt(1-o*o),this.mode){case Zs:a.y=Math.asin(n*this.sinph0+t.y*o*this.cosph0/r),t.y=(n-this.sinph0*Math.sin(a.y))*r,t.x*=o*this.cosph0;break;case Ds:a.y=Math.asin(t.y*o/r),t.y=n*r,t.x*=o;break;case Bs:a.y=Math.asin(n),t.y=-t.y;break;case Us:a.y=-Math.asin(n)}a.x=Math.atan2(t.x,t.y)}return t.x=a.x+this.long0,t.y=a.y,t},names:["Tilted_Perspective","tpers"]};var Qs={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var i,e,s,a,r=t.x,n=t.y;if(r-=this.long0,"ellipse"===this.shape){n=Math.atan(this.radius_p2*Math.tan(n));var o=this.radius_p/Ie(this.radius_p*Math.cos(n),Math.sin(n));if(e=o*Math.cos(r)*Math.cos(n),s=o*Math.sin(r)*Math.cos(n),a=o*Math.sin(n),(this.radius_g-e)*e-s*s-a*a*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=this.radius_g-e,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Ie(a,i)),t.y=this.radius_g_1*Math.atan(a/i)):(t.x=this.radius_g_1*Math.atan(s/i),t.y=this.radius_g_1*Math.atan(a/Ie(s,i)))}else"sphere"===this.shape&&(i=Math.cos(n),e=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=this.radius_g-e,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Ie(a,i)),t.y=this.radius_g_1*Math.atan(a/i)):(t.x=this.radius_g_1*Math.atan(s/i),t.y=this.radius_g_1*Math.atan(a/Ie(s,i))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var i,e,s,a,r=-1,n=0,o=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Ie(1,o)):(n=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Ie(1,n));var h=o/this.radius_p;if(i=n*n+h*h+r*r,(s=(e=2*this.radius_g*r)*e-4*i*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-e-Math.sqrt(s))/(2*i),r=this.radius_g+a*r,n*=a,o*=a,t.x=Math.atan2(n,r),t.y=Math.atan(o*Math.cos(t.x)/r),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+o*o)):(n=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+o*o+r*r,(s=(e=2*this.radius_g*r)*e-4*i*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-e-Math.sqrt(s))/(2*i),r=this.radius_g+a*r,n*=a,o*=a,t.x=Math.atan2(n,r),t.y=Math.atan(o*Math.cos(t.x)/r)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};function Hs(t){return null!=t}te.defaultDatum="WGS84",te.Proj=ji,te.WGS84=new te.Proj("WGS84"),te.Point=_e,te.toPoint=Hi,te.defs=fi,te.nadgrid=function(t,i){var e=new DataView(i),s=function(t){var i=t.getInt32(8,!1);if(11===i)return!1;11!==(i=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(e),a=function(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:Ri(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}(e,s);a.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var r=function(t,i,e){for(var s=176,a=[],r=0;r<i.nSubgrids;r++){var n=Fi(t,s,e),o=Gi(t,s,n,e),h=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),l=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);a.push({ll:[Ei(n.lowerLongitude),Ei(n.lowerLatitude)],del:[Ei(n.longitudeInterval),Ei(n.latitudeInterval)],lim:[h,l],count:n.gridNodeCount,cvs:qi(o)})}return a}(e,a,s),n={header:a,subgrids:r};return Ti[t]=n,n},te.transform=Xi,te.mgrs=he,te.version="__VERSION__",function(t){t.Proj.projections.add(Ce),t.Proj.projections.add(ke),t.Proj.projections.add(Te),t.Proj.projections.add(Re),t.Proj.projections.add(qe),t.Proj.projections.add(Fe),t.Proj.projections.add(je),t.Proj.projections.add(ze),t.Proj.projections.add(Be),t.Proj.projections.add(Xe),t.Proj.projections.add(as),t.Proj.projections.add(ns),t.Proj.projections.add(os),t.Proj.projections.add(hs),t.Proj.projections.add(ls),t.Proj.projections.add(us),t.Proj.projections.add(cs),t.Proj.projections.add(ps),t.Proj.projections.add(fs),t.Proj.projections.add(ds),t.Proj.projections.add(ms),t.Proj.projections.add(ys),t.Proj.projections.add(gs),t.Proj.projections.add(_s),t.Proj.projections.add(ks),t.Proj.projections.add(js),t.Proj.projections.add(zs),t.Proj.projections.add(Js),t.Proj.projections.add(Qs)}(te);var Vs={}.hasOwnProperty;function Xs(t){return!!function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)&&!(t.constructor&&!Vs.call(t,"constructor")&&!Vs.call(t.constructor.prototype,"isPrototypeOf"))}function Ks(t,i,e){if(!t||("string"!=typeof(s=t)||s.constructor!==String))return t;var s;for(var a in i){var r=i[a];if(!r||"Null"===r||"Unknown"===r){if(!e)continue;r=""}t=t.replace(new RegExp("{"+a+"}","gm"),r)}return t}function Ys(){for(var t,i,e,s,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(i=0,e=n.length;i<e;i++)for(t in s=n[i])$s(a[t],s[t])?a[t]=It(It({},a[t]),s[t]):a[t]=s[t];return a}function $s(t,i){return!(!Hs(t)||!Hs(i))&&(!Array.isArray(t)&&!Array.isArray(i)&&!(!Xs(t)||!Xs(i)))}var ta=function(t){Tt(e,t);var i=qt(e);function e(){return Pt(this,e),i.apply(this,arguments)}return Ot(e,[{key:"isAdded",get:function(){return this._map&&this._map.hasLayer(this)}},{key:"pid",get:function(){return this.options.pid},set:function(t){this.options.pid=t}},{key:"id",get:function(){return this.options.id},set:function(t){this.options.id=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t}},{key:"initialize",value:function(t){var i,s,a,o,h=this;if(t.popup&&(a=t.popup,delete t.popup),t.tooltip&&(o=t.tooltip,delete t.tooltip),Gt(Nt(e.prototype),"initialize",this).call(this,function(t){var i;if(!t.symbol)return t;var e=It({},t);null!==(i=t.symbol)&&void 0!==i&&i.styleOptions&&(e.pointToLayer=function(i,e){var s=i.properties,a=function(t,i,e){if(!t)return{};var s=It({},t.styleOptions);if(t.styleField&&i){var a=i[t.styleField],n=t.styleFieldOptions[a];null!=n&&(s=It(It({},s),n))}e&&s.iconUrlForSelect&&(s.iconUrl=s.iconUrlForSelect);if(s.hasOwnProperty("iconUrl"))t.icon=r.default.icon(s);else if(s.hasOwnProperty("iconFont")){var o=20;s.hasOwnProperty("iconSize")&&(o=s.iconSize[0]);var h=s.color||"#000000";s.className="",s.html='<i class="'+s.iconFont+'" style="color:'+h+";font-size:"+o+'px;"></i> ',t.icon=r.default.divIcon(s)}else{var l='<div class="centerat_animation" style="color:'+(s.color||"#0f89f5")+';"><p></p></div>';if(t.nameField)l+=' <div class="layer_divicon_name" style="top: 2px;left: 25px;" >'+i[t.nameField]+"</div>";t.icon=r.default.divIcon({className:"",iconSize:[10,10],iconAnchor:[5,5],popupAnchor:[5,-5],tooltipAnchor:[5,-5],html:l})}return t}(t.symbol,s);return r.default.marker(e,a)},e.style=function(i){var e=i.properties,s=function(t,i){if(!t)return{};var e=t.styleOptions?It({},t.styleOptions):{};if(t.styleField&&i){var s=i[t.styleField],a=t.styleFieldOptions[s];null!=a&&(e=Ys(e,a))}if(i)for(var r in e)e[r]=Ks(e[r],i);e.label&&(e.label=It({},e.label));e.highlight&&(e.highlight=It({},e.highlight));if(o=t.callback,o&&"function"==typeof o){var n=t.callback(i,e);null!=n&&(e=Ys(e,n))}var o;return e}(t.symbol,e);return s});return e}(t)),r.default.Util.stamp(this),this.options.id=null!==(i=this.options.id)&&void 0!==i?i:n.Util.createGuid(),this.options.pid=null!==(s=this.options.pid)&&void 0!==s?s:-1,a){var l=this.options.popupOptions||{};this.bindPopup((function(t){var i=t.feature.properties,e=h.name;return l.noTitle?e=null:l.title?e=l.title:l.titleField&&(e=i[l.titleField]),n.Util.getTemplateHtml({title:e,template:a,attr:i})}),{maxWidth:600})}if(o){var u=this.options.tooltipOptions||{};this.bindTooltip((function(t){var i=t.feature.properties,e=h.name;return u.noTitle?e=null:u.title?e=u.title:u.titleField&&(e=i[u.titleField]),n.Util.getTemplateHtml({title:e,template:o,attr:i})}),{direction:"top"})}}},{key:"eachGraphic",value:function(t,i){return this.eachFeature(t,i)}},{key:"getGraphicById",value:function(t){return this.getFeature(t)}}]),e}(St);n.layer.ArcGisFeatureLayer=ta,n.LayerUtil.register("arcgis_feature",ta),r.default.esri=Ct,n.esri=Ct,t.ArcGisDynamicLayer=Bt,t.ArcGisFeatureLayer=ta,t.ArcGisImageLayer=jt,t.ArcGisTileLayer=zt,Object.defineProperty(t,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mars2d-esri",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Mars2D平台插件,ArcGIS Server功能支持插件",
5
5
  "main": "dist/mars2d-esri.js",
6
6
  "files": [
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "dependencies": {},
10
10
  "devDependencies": {
11
- "mars2d": "^3.1.4"
11
+ "mars2d": "^3.1.5"
12
12
  },
13
13
  "scripts": {
14
14
  "lint": "eslint ./src/**/*.{js,ts} --fix"