张卓
2022-09-29 4ef1c909df36c48f7f040e9ec408fc15e6745e71
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6f5de554"],{2114:function(t,e,i){var r=i("313e");function s(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}var n=r.extendComponentView({type:"bmap",render:function(t,e,i){var n=!0,o=t.getBMap(),a=i.getZr().painter.getViewportRoot(),l=t.coordinateSystem,u=function(e,r){if(!n){var s=a.parentNode.parentNode.parentNode,o=[-parseInt(s.style.left,10)||0,-parseInt(s.style.top,10)||0];a.style.left=o[0]+"px",a.style.top=o[1]+"px",l.setMapOffset(o),t.__mapOffset=o,i.dispatchAction({type:"bmapRoam"})}};function h(){n||i.dispatchAction({type:"bmapRoam"})}o.removeEventListener("moving",this._oldMoveHandler),o.removeEventListener("moveend",this._oldMoveHandler),o.removeEventListener("zoomend",this._oldZoomEndHandler),o.addEventListener("moving",u),o.addEventListener("moveend",u),o.addEventListener("zoomend",h),this._oldMoveHandler=u,this._oldZoomEndHandler=h;var c=t.get("roam");c&&"scale"!==c?o.enableDragging():o.disableDragging(),c&&"move"!==c?(o.enableScrollWheelZoom(),o.enableDoubleClickZoom(),o.enablePinchToZoom()):(o.disableScrollWheelZoom(),o.disableDoubleClickZoom(),o.disablePinchToZoom());var p=t.__mapStyle,d=t.get("mapStyle")||{},m=JSON.stringify(d);JSON.stringify(p)!==m&&(s(y)||o.setMapStyle(r.util.clone(d)),t.__mapStyle=JSON.parse(m));var f=t.__mapStyle2,y=t.get("mapStyleV2")||{},g=JSON.stringify(y);JSON.stringify(f)!==g&&(s(y)||o.setMapStyleV2(r.util.clone(y)),t.__mapStyle2=JSON.parse(g)),n=!1}});t.exports=n},"2f21":function(t,e,i){"use strict";var r=i("79e5");t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},3023:function(t,e,i){"use strict";i.r(e);var r=i("6808"),s=window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest,n=""===document.documentElement.style.pointerEvents,o={cors:s,pointerEvents:n},a={attributionWidthOffset:55},l=i("e11eb"),u=0;function h(t){var e="";for(var i in t.f=t.f||"json",t)if(t.hasOwnProperty(i)){var r,s=t[i],n=Object.prototype.toString.call(s);e.length&&(e+="&"),r="[object Array]"===n?"[object Object]"===Object.prototype.toString.call(s[0])?JSON.stringify(s):s.join(","):"[object Object]"===n?JSON.stringify(s):"[object Date]"===n?s.valueOf():s,e+=encodeURIComponent(i)+"="+encodeURIComponent(r)}return e}function c(t,e){var i=new window.XMLHttpRequest;return i.onerror=function(r){i.onreadystatechange=l["Util"].falseFn,t.call(e,{error:{code:500,message:"XMLHttpRequest error"}},null)},i.onreadystatechange=function(){var r,s;if(4===i.readyState){try{r=JSON.parse(i.responseText)}catch(n){r=null,s={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!s&&r.error&&(s=r.error,r=null),i.onerror=l["Util"].falseFn,t.call(e,s,r)}},i.ontimeout=function(){this.onerror()},i}function p(t,e,i,r){var s=c(i,r);return s.open("POST",t),"undefined"!==typeof r&&null!==r&&"undefined"!==typeof r.options&&(s.timeout=r.options.timeout),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),s.send(h(e)),s}function d(t,e,i,r){var s=c(i,r);return s.open("GET",t+"?"+h(e),!0),"undefined"!==typeof r&&null!==r&&"undefined"!==typeof r.options&&(s.timeout=r.options.timeout,r.options.withCredentials&&(s.withCredentials=!0)),s.send(null),s}function m(t,e,i,r){var s=h(e),n=c(i,r),a=(t+"?"+s).length;if(a<=2e3&&o.cors?n.open("GET",t+"?"+s):a>2e3&&o.cors&&(n.open("POST",t),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")),"undefined"!==typeof r&&null!==r&&"undefined"!==typeof r.options&&(n.timeout=r.options.timeout,r.options.withCredentials&&(n.withCredentials=!0)),a<=2e3&&o.cors)n.send(null);else{if(!(a>2e3&&o.cors))return a<=2e3&&!o.cors?f(t,e,i,r):void g("a request to "+t+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html");n.send(s)}return n}function f(t,e,i,r){window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{};var s="c"+u;e.callback="window._EsriLeafletCallbacks."+s,window._EsriLeafletCallbacks[s]=function(t){if(!0!==window._EsriLeafletCallbacks[s]){var e,n=Object.prototype.toString.call(t);"[object Object]"!==n&&"[object Array]"!==n&&(e={error:{code:500,message:"Expected array or object as JSONP response"}},t=null),!e&&t.error&&(e=t,t=null),i.call(r,e,t),window._EsriLeafletCallbacks[s]=!0}};var n=l["DomUtil"].create("script",null,document.body);return n.type="text/javascript",n.src=t+"?"+h(e),n.id=s,n.onerror=function(t){if(t&&!0!==window._EsriLeafletCallbacks[s]){var e={error:{code:500,message:"An unknown error occurred"}};i.call(r,e),window._EsriLeafletCallbacks[s]=!0}},l["DomUtil"].addClass(n,"esri-leaflet-jsonp"),u++,{id:s,url:n.src,abort:function(){window._EsriLeafletCallbacks._callback[s]({code:0,message:"Request aborted."})}}}var y=o.cors?d:f;function g(){console&&console.warn&&console.warn.apply(console,arguments)}y.CORS=d,y.JSONP=f;var _={request:m,get:y,post:p},v=_,b=function(t,e,i,r){var s=(r[0]-i[0])*(t[1]-i[1])-(r[1]-i[1])*(t[0]-i[0]),n=(e[0]-t[0])*(t[1]-i[1])-(e[1]-t[1])*(t[0]-i[0]),o=(r[1]-i[1])*(e[0]-t[0])-(r[0]-i[0])*(e[1]-t[1]);if(0!==o){var a=s/o,l=n/o;if(a>=0&&a<=1&&l>=0&&l<=1)return!0}return!1},x=function(t,e){for(var i=!1,r=-1,s=t.length,n=s-1;++r<s;n=r)(t[r][1]<=e[1]&&e[1]<t[n][1]||t[n][1]<=e[1]&&e[1]<t[r][1])&&e[0]<(t[n][0]-t[r][0])*(e[1]-t[r][1])/(t[n][1]-t[r][1])+t[r][0]&&(i=!i);return i},S=function(t,e){for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},L=function(t,e){for(var i=0;i<t.length-1;i++)for(var r=0;r<e.length-1;r++)if(b(t[i],t[i+1],e[r],e[r+1]))return!0;return!1},A=function(t){return S(t[0],t[t.length-1])||t.push(t[0]),t},w=function(t){var e,i=0,r=0,s=t.length,n=t[r];for(r;r<s-1;r++)e=t[r+1],i+=(e[0]-n[0])*(e[1]+n[1]),n=e;return i>=0},T=function(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},C=function(t,e){var i=L(t,e),r=x(t,e[0]);return!(i||!r)},I=function(t){for(var e,i,r,s=[],n=[],o=0;o<t.length;o++){var a=A(t[o].slice(0));if(!(a.length<4))if(w(a)){var l=[a.slice().reverse()];s.push(l)}else n.push(a.slice().reverse())}var u=[];while(n.length){r=n.pop();var h=!1;for(e=s.length-1;e>=0;e--)if(i=s[e][0],C(i,r)){s[e].push(r),h=!0;break}h||u.push(r)}while(u.length){r=u.pop();var c=!1;for(e=s.length-1;e>=0;e--)if(i=s[e][0],L(i,r)){s[e].push(r),c=!0;break}c||s.push([r.reverse()])}return 1===s.length?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s}},O=function(t,e){for(var i=e?[e,"OBJECTID","FID"]:["OBJECTID","FID"],r=0;r<i.length;r++){var s=i[r];if(s in t&&("string"===typeof t[s]||"number"===typeof t[s]))return t[s]}throw Error("No valid id attribute found")},P=function t(e,i){var r={};if(e.features){r.type="FeatureCollection",r.features=[];for(var s=0;s<e.features.length;s++)r.features.push(t(e.features[s],i))}if("number"===typeof e.x&&"number"===typeof e.y&&(r.type="Point",r.coordinates=[e.x,e.y],"number"===typeof e.z&&r.coordinates.push(e.z)),e.points&&(r.type="MultiPoint",r.coordinates=e.points.slice(0)),e.paths&&(1===e.paths.length?(r.type="LineString",r.coordinates=e.paths[0].slice(0)):(r.type="MultiLineString",r.coordinates=e.paths.slice(0))),e.rings&&(r=I(e.rings.slice(0))),"number"===typeof e.xmin&&"number"===typeof e.ymin&&"number"===typeof e.xmax&&"number"===typeof e.ymax&&(r.type="Polygon",r.coordinates=[[[e.xmax,e.ymax],[e.xmin,e.ymax],[e.xmin,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax]]]),(e.geometry||e.attributes)&&(r.type="Feature",r.geometry=e.geometry?t(e.geometry):null,r.properties=e.attributes?T(e.attributes):null,e.attributes))try{r.id=O(e.attributes,i)}catch(n){}return JSON.stringify(r.geometry)===JSON.stringify({})&&(r.geometry=null),e.spatialReference&&e.spatialReference.wkid&&4326!==e.spatialReference.wkid&&console.warn("Object converted in non-standard crs - "+JSON.stringify(e.spatialReference)),r},R=function(t){var e=[],i=t.slice(0),r=A(i.shift().slice(0));if(r.length>=4){w(r)||r.reverse(),e.push(r);for(var s=0;s<i.length;s++){var n=A(i[s].slice(0));n.length>=4&&(w(n)&&n.reverse(),e.push(n))}}return e},k=function(t){for(var e=[],i=0;i<t.length;i++)for(var r=R(t[i]),s=r.length-1;s>=0;s--){var n=r[s].slice(0);e.push(n)}return e},F=function t(e,i){i=i||"OBJECTID";var r,s={wkid:4326},n={};switch(e.type){case"Point":n.x=e.coordinates[0],n.y=e.coordinates[1],e.coordinates[2]&&(n.z=e.coordinates[2]),n.spatialReference=s;break;case"MultiPoint":n.points=e.coordinates.slice(0),e.coordinates[0][2]&&(n.hasZ=!0),n.spatialReference=s;break;case"LineString":n.paths=[e.coordinates.slice(0)],e.coordinates[0][2]&&(n.hasZ=!0),n.spatialReference=s;break;case"MultiLineString":n.paths=e.coordinates.slice(0),e.coordinates[0][0][2]&&(n.hasZ=!0),n.spatialReference=s;break;case"Polygon":n.rings=R(e.coordinates.slice(0)),e.coordinates[0][0][2]&&(n.hasZ=!0),n.spatialReference=s;break;case"MultiPolygon":n.rings=k(e.coordinates.slice(0)),e.coordinates[0][0][0][2]&&(n.hasZ=!0),n.spatialReference=s;break;case"Feature":e.geometry&&(n.geometry=t(e.geometry,i)),n.attributes=e.properties?T(e.properties):{},e.id&&(n.attributes[i]=e.id);break;case"FeatureCollection":for(n=[],r=0;r<e.features.length;r++)n.push(t(e.features[r],i));break;case"GeometryCollection":for(n=[],r=0;r<e.geometries.length;r++)n.push(t(e.geometries[r],i));break}return n},M='<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>',G='Powered by <a href="https://www.esri.com">Esri</a>';function E(t,e){return F(t,e)}function U(t,e){return P(t,e)}function D(t){if("NaN"!==t.xmin&&"NaN"!==t.ymin&&"NaN"!==t.xmax&&"NaN"!==t.ymax){var e=Object(l["latLng"])(t.ymin,t.xmin),i=Object(l["latLng"])(t.ymax,t.xmax);return Object(l["latLngBounds"])(e,i)}return null}function B(t){return t=Object(l["latLngBounds"])(t),{xmin:t.getSouthWest().lng,ymin:t.getSouthWest().lat,xmax:t.getNorthEast().lng,ymax:t.getNorthEast().lat,spatialReference:{wkid:4326}}}var Z=/^(OBJECTID|FID|OID|ID)$/i;function z(t){var e;if(t.objectIdFieldName)e=t.objectIdFieldName;else if(t.fields){for(var i=0;i<=t.fields.length-1;i++)if("esriFieldTypeOID"===t.fields[i].type){e=t.fields[i].name;break}if(!e)for(i=0;i<=t.fields.length-1;i++)if(t.fields[i].name.match(Z)){e=t.fields[i].name;break}}return e}function j(t){for(var e in t.attributes)if(e.match(Z))return e}function q(t,e){var i,r=t.features||t.results,s=r&&r.length;i=e||z(t);var n={type:"FeatureCollection",features:[]};if(s)for(var o=r.length-1;o>=0;o--){var a=U(r[o],i||j(r[o]));n.features.push(a)}return n}function N(t){return t=l["Util"].trim(t),"/"!==t[t.length-1]&&(t+="/"),t}function W(t){if(-1!==t.url.indexOf("?")){t.requestParams=t.requestParams||{};var e=t.url.substring(t.url.indexOf("?")+1);t.url=t.url.split("?")[0],t.requestParams=JSON.parse('{"'+decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')}return t.url=N(t.url.split("?")[0]),t}function J(t){return/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.test(t)}function V(t){var e;switch(t){case"Point":e="esriGeometryPoint";break;case"MultiPoint":e="esriGeometryMultipoint";break;case"LineString":e="esriGeometryPolyline";break;case"MultiLineString":e="esriGeometryPolyline";break;case"Polygon":e="esriGeometryPolygon";break;case"MultiPolygon":e="esriGeometryPolygon";break}return e}function H(t){return t.getSize().x-a.attributionWidthOffset+"px"}function Q(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 i=document.createElement("style");i.type="text/css",i.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: "+H(t)+";}",document.getElementsByTagName("head")[0].appendChild(i),t.on("resize",(function(e){t.attributionControl&&(t.attributionControl._container.style.maxWidth=H(e.target))})),t.attributionControl._esriAttributionAddedOnce=!0}t.attributionControl.setPrefix(M+" | "+G),l["DomUtil"].addClass(t.attributionControl._container,"esri-truncated-attribution:hover"),l["DomUtil"].addClass(t.attributionControl._container,"esri-truncated-attribution")}t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount+1}}function K(t){t.attributionControl&&(t.attributionControl._esriAttributionLayerCount&&1===t.attributionControl._esriAttributionLayerCount&&(t.attributionControl.setPrefix(M),l["DomUtil"].removeClass(t.attributionControl._container,"esri-truncated-attribution:hover"),l["DomUtil"].removeClass(t.attributionControl._container,"esri-truncated-attribution")),t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount-1)}function X(t){var e={geometry:null,geometryType:null};return t instanceof l["LatLngBounds"]?(e.geometry=B(t),e.geometryType="esriGeometryEnvelope",e):(t.getLatLng&&(t=t.getLatLng()),t instanceof l["LatLng"]&&(t={type:"Point",coordinates:[t.lng,t.lat]}),t instanceof l["GeoJSON"]&&(t=t.getLayers()[0].feature.geometry,e.geometry=E(t),e.geometryType=V(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=E(t),e.geometryType=V(t.type),e):void g("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))}function Y(t,e){o.cors&&m(t,{},l["Util"].bind((function(t,i){if(!t){e._esriAttributions=[];for(var r=0;r<i.contributors.length;r++)for(var s=i.contributors[r],n=0;n<s.coverageAreas.length;n++){var o=s.coverageAreas[n],a=Object(l["latLng"])(o.bbox[0],o.bbox[1]),u=Object(l["latLng"])(o.bbox[2],o.bbox[3]);e._esriAttributions.push({attribution:s.attribution,score:o.score,bounds:Object(l["latLngBounds"])(a,u),minZoom:o.zoomMin,maxZoom:o.zoomMax})}e._esriAttributions.sort((function(t,e){return e.score-t.score}));var h={target:e};$(h)}}),this))}function $(t){var e=t.target,i=e._esriAttributions;if(e&&e.attributionControl){var r=e.attributionControl._container.querySelector(".esri-dynamic-attribution");if(r&&i){for(var s="",n=e.getBounds(),o=Object(l["latLngBounds"])(n.getSouthWest().wrap(),n.getNorthEast().wrap()),a=e.getZoom(),u=0;u<i.length;u++){var h=i[u],c=h.attribution;!s.match(c)&&h.bounds.intersects(o)&&a>=h.minZoom&&a<=h.maxZoom&&(s+=", "+c)}s=s.substr(2),r.innerHTML=s,r.style.maxWidth=H(e),e.fire("attributionupdated",{attribution:s})}}}var tt={warn:g,cleanUrl:N,getUrlParams:W,isArcgisOnline:J,geojsonTypeToArcGIS:V,responseToFeatureCollection:q,geojsonToArcGIS:E,arcgisToGeoJSON:U,boundsToExtent:B,extentToBounds:D,calcAttributionWidth:H,setEsriAttribution:Q,_setGeometry:X,_getAttributionData:Y,_updateMapAttribution:$,_findIdAttributeFromFeature:j,_findIdAttributeFromResponse:z},et=l["Class"].extend({options:{proxy:!1,useCors:s},generateSetter:function(t,e){return l["Util"].bind((function(e){return this.params[t]=e,this}),e)},initialize:function(t){if(t.request&&t.options?(this._service=t,l["Util"].setOptions(this,t.options)):(l["Util"].setOptions(this,t),this.options.url=N(t.url)),this.params=l["Util"].extend({},this.params||{}),this.setters)for(var e in this.setters){var i=this.setters[e];this[e]=this.generateSetter(i,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&&l["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,e,i,r,s){var n=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?v[t](n,i,r,s):v.get.JSONP(n,i,r,s)}});function it(t){return t=W(t),new et(t)}var rt=et.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=Object(l["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,e){return this.params.time=[t.valueOf(),e.valueOf()],this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},orderBy:function(t,e){return e=e||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[t,e].join(" "),this},run:function(t,e){return this._cleanParams(),this.options.isModern||J(this.options.url)&&void 0===this.options.isModern?(this.params.f="geojson",this.request((function(i,r){this._trapSQLerrors(i),t.call(e,i,r,r)}),this)):this.request((function(i,r){this._trapSQLerrors(i),t.call(e,i,r&&q(r),r)}),this)},count:function(t,e){return this._cleanParams(),this.params.returnCountOnly=!0,this.request((function(e,i){t.call(this,e,i&&i.count,i)}),e)},ids:function(t,e){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request((function(e,i){t.call(this,e,i&&i.objectIds,i)}),e)},bounds:function(t,e){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request((function(i,r){r&&r.extent&&D(r.extent)?t.call(e,i,D(r.extent),r):(i={message:"Invalid Bounds"},t.call(e,i,null,r))}),e)},distinct:function(){return this.params.returnGeometry=!1,this.params.returnDistinctValues=!0,this},pixelSize:function(t){var e=Object(l["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&&g("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 e=X(t);this.params.geometry=e.geometry,this.params.geometryType=e.geometryType}});function st(t){return new rt(t)}var nt=st,ot=et.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,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},run:function(t,e){return this.request((function(i,r){t.call(e,i,r&&q(r),r)}),e)}});function at(t){return new ot(t)}var lt=at,ut=et.extend({path:"identify",between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this}});function ht(t){return new ut(t)}var ct=ut.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(t){var e=B(t.getBounds()),i=t.getSize();return this.params.imageDisplay=[i.x,i.y,96],this.params.mapExtent=[e.xmin,e.ymin,e.xmax,e.ymax],this},at:function(t){return 2===t.length&&(t=Object(l["latLng"])(t)),this._setGeometryParams(t),this},layerDef:function(t,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},run:function(t,e){return this.request((function(i,r){if(i)t.call(e,i,void 0,r);else{var s=q(r);r.results=r.results.reverse();for(var n=0;n<s.features.length;n++){var o=s.features[n];o.layerId=r.results[n].layerId}t.call(e,void 0,s,r)}}))},_setGeometryParams:function(t){var e=X(t);this.params.geometry=e.geometry,this.params.geometryType=e.geometryType}});function pt(t){return new ct(t)}var dt=pt,mt=ut.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(t){return t=Object(l["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,e){return this.request((function(i,r){t.call(e,i,r&&this._responseToGeoJSON(r),r)}),this)},_responseToGeoJSON:function(t){var e=t.location,i=t.catalogItems,r=t.catalogItemVisibilities,s={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[e.x,e.y]},crs:{type:"EPSG",properties:{code:e.spatialReference.wkid}},properties:{OBJECTID:t.objectId,name:t.name,value:t.value},id:t.objectId}};if(t.properties&&t.properties.Values&&(s.pixel.properties.values=t.properties.Values),i&&i.features&&(s.catalogItems=q(i),r&&r.length===s.catalogItems.features.length))for(var n=r.length-1;n>=0;n--)s.catalogItems.features[n].properties.catalogItemVisibility=r[n];return s}});function ft(t){return new mt(t)}var yt=ft,gt=l["Evented"].extend({options:{proxy:!1,useCors:s,timeout:0},initialize:function(t){t=t||{},this._requestQueue=[],this._authenticating=!1,l["Util"].setOptions(this,t),this.options.url=N(this.options.url)},get:function(t,e,i,r){return this._request("get",t,e,i,r)},post:function(t,e,i,r){return this._request("post",t,e,i,r)},request:function(t,e,i,r){return this._request("request",t,e,i,r)},metadata:function(t,e){return this._request("get","",{},t,e)},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,i,r,s){this.fire("requeststart",{url:this.options.url+e,params:i,method:t},!0);var n=this._createServiceCallback(t,e,i,r,s);if(this.options.token&&(i.token=this.options.token),this.options.requestParams&&l["Util"].extend(i,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?v[t](o,i,n,s):v.get.JSONP(o,i,n,s)}this._requestQueue.push([t,e,i,r,s])},_createServiceCallback:function(t,e,i,r,s){return l["Util"].bind((function(n,o){!n||499!==n.code&&498!==n.code||(this._authenticating=!0,this._requestQueue.push([t,e,i,r,s]),this.fire("authenticationrequired",{authenticate:l["Util"].bind(this.authenticate,this)},!0),n.authenticate=l["Util"].bind(this.authenticate,this)),r.call(s,n,o),n?this.fire("requesterror",{url:this.options.url+e,params:i,message:n.message,code:n.code,method:t},!0):this.fire("requestsuccess",{url:this.options.url+e,params:i,response:o,method:t},!0),this.fire("requestend",{url:this.options.url+e,params:i,method:t},!0)}),this)},_runQueue:function(){for(var t=this._requestQueue.length-1;t>=0;t--){var e=this._requestQueue[t],i=e.shift();this[i].apply(this,e)}this._requestQueue=[]}});function _t(t){return t=W(t),new gt(t)}var vt=gt.extend({identify:function(){return dt(this)},find:function(){return lt(this)},query:function(){return nt(this)}});function bt(t){return new vt(t)}var xt=bt,St=gt.extend({query:function(){return nt(this)},identify:function(){return yt(this)}});function Lt(t){return new St(t)}var At=Lt,wt=gt.extend({options:{idAttribute:"OBJECTID"},query:function(){return nt(this)},addFeature:function(t,e,i){this.addFeatures(t,e,i)},addFeatures:function(t,e,i){for(var r=t.features?t.features:[t],s=r.length-1;s>=0;s--)delete r[s].id;return t=E(t),t=r.length>1?t:[t],this.post("addFeatures",{features:t},(function(t,r){var s=r&&r.addResults?r.addResults.length>1?r.addResults:r.addResults[0]:void 0;e&&e.call(i,t||r.addResults[0].error,s)}),i)},updateFeature:function(t,e,i){this.updateFeatures(t,e,i)},updateFeatures:function(t,e,i){var r=t.features?t.features:[t];return t=E(t,this.options.idAttribute),t=r.length>1?t:[t],this.post("updateFeatures",{features:t},(function(t,r){var s=r&&r.updateResults?r.updateResults.length>1?r.updateResults:r.updateResults[0]:void 0;e&&e.call(i,t||r.updateResults[0].error,s)}),i)},deleteFeature:function(t,e,i){this.deleteFeatures(t,e,i)},deleteFeatures:function(t,e,i){return this.post("deleteFeatures",{objectIds:t},(function(t,r){var s=r&&r.deleteResults?r.deleteResults.length>1?r.deleteResults:r.deleteResults[0]:void 0;e&&e.call(i,t||r.deleteResults[0].error,s)}),i)}});function Tt(t){return new wt(t)}var Ct=Tt,It="https:"!==window.location.protocol?"http:":"https:",Ot=l["TileLayer"].extend({statics:{TILES:{Streets:{urlTemplate:It+"//{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:It+"//{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:It+"//{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:It+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:n?"esri-labels":"tilePane",attribution:""}},NationalGeographic:{urlTemplate:It+"//{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:It+"//{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:It+"//{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:n?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:It+"//{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:It+"//{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:n?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:It+"//{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:It+"//{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:n?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:It+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:n?"esri-labels":"tilePane",attribution:""}},ShadedRelief:{urlTemplate:It+"//{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:It+"//{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:n?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:It+"//{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:It+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:n?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:It+"//{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:It+"//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:It+"//{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:It+"//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 i;if("object"===typeof t&&t.urlTemplate&&t.options)i=t;else{if("string"!==typeof t||!Ot.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"');i=Ot.TILES[t]}var r=l["Util"].extend(i.options,e);l["Util"].setOptions(this,r),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===i.urlTemplate.indexOf("token=")&&(i.urlTemplate+="?token="+this.options.token),this.options.proxy&&(i.urlTemplate=this.options.proxy+"?"+i.urlTemplate),l["TileLayer"].prototype.initialize.call(this,i.urlTemplate,r)},onAdd:function(t){Q(t),"esri-labels"===this.options.pane&&this._initPane(),this.options.attributionUrl&&Y((this.options.proxy?this.options.proxy+"?":"")+this.options.attributionUrl,t),t.on("moveend",$),l["TileLayer"].prototype.onAdd.call(this,t)},onRemove:function(t){K(t),t.off("moveend",$),l["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}});function Pt(t,e){return new Ot(t,e)}var Rt=l["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=l["Util"].setOptions(this,t),t=W(t),this.tileUrl=(t.proxy?t.proxy+"?":"")+t.url+"tile/{z}/{y}/{x}"+(t.requestParams&&Object.keys(t.requestParams).length>0?l["Util"].getParamString(t.requestParams):""),-1!==t.url.indexOf("{s}")&&t.subdomains&&(t.url=t.url.replace("{s}",t.subdomains[0])),this.service=xt(t),this.service.addEventParent(this);var e=new RegExp(/tiles.arcgis(online)?\.com/g);e.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),l["TileLayer"].prototype.initialize.call(this,this.tileUrl,t)},getTileUrl:function(t){var e=this._getZoomForUrl();return l["Util"].template(this.tileUrl,l["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 i=document.createElement("img");return l["DomEvent"].on(i,"load",l["Util"].bind(this._tileOnLoad,this,e,i)),l["DomEvent"].on(i,"error",l["Util"].bind(this._tileOnError,this,e,i)),this.options.crossOrigin&&(i.crossOrigin=""),i.alt="",!this._lodMap||this._lodMap&&this._lodMap[this._getZoomForUrl()]?i.src=this.getTileUrl(t):this.once("lodmap",(function(){i.src=this.getTileUrl(t)}),this),i},onAdd:function(t){Q(t),this._lodMap||this.metadata((function(e,i){if(!e&&i.spatialReference){var r=i.spatialReference.latestWkid||i.spatialReference.wkid;if(!this.options.attribution&&t.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,t.attributionControl.addAttribution(this.getAttribution())),t.options.crs!==l["CRS"].EPSG3857||102100!==r&&3857!==r)t.options.crs&&t.options.crs.code&&t.options.crs.code.indexOf(r)>-1||g("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 s=i.tileInfo.lods,n=Rt.MercatorZoomLevels,o=0;o<s.length;o++){var a=s[o];for(var u in n){var h=n[u];if(this._withinPercentage(a.resolution,h,this.options.zoomOffsetAllowance)){this._lodMap[u]=a.level;break}}}this.fire("lodmap")}}}),this),l["TileLayer"].prototype.onAdd.call(this,t)},onRemove:function(t){K(t),l["TileLayer"].prototype.onRemove.call(this,t)},metadata:function(t,e){return this.service.metadata(t,e),this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(t){var e="?token="+t;return this.tileUrl=this.options.token?this.tileUrl.replace(/\?token=(.+)/g,e):this.tileUrl+e,this.options.token=t,this.service.authenticate(t),this},_withinPercentage:function(t,e,i){var r=Math.abs(t/e-1);return r<i}});function kt(t,e){return new Rt(t,e)}var Ft=l["ImageOverlay"].extend({onAdd:function(t){this._topLeft=t.getPixelBounds().min,l["ImageOverlay"].prototype.onAdd.call(this,t)},_reset:function(){this._map.options.crs===l["CRS"].EPSG3857?l["ImageOverlay"].prototype._reset.call(this):l["DomUtil"].setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}),Mt=l["Layer"].extend({options:{opacity:1,position:"front",f:"image",useCors:s,attribution:null,interactive:!1,alt:""},onAdd:function(t){Q(t),this.options.zIndex&&(this.options.position=null),this._update=l["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(e,i){!e&&!this.options.attribution&&t.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}),this)},onRemove:function(t){K(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=Object(l["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 e,i=this._currentImage.getPane().children,r=-t(-1/0,1/0),s=0,n=i.length;s<n;s++)e=i[s].style.zIndex,i[s]!==this._currentImage._image&&e&&(r=t(r,+e));isFinite(r)&&(this.options.zIndex=r+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,e){return this.options.from=t,this.options.to=e,this._update(),this},metadata:function(t,e){return this.service.metadata(t,e),this},authenticate:function(t){return this.service.authenticate(t),this},redraw:function(){this._update()},_renderImage:function(t,e,i){if(this._map){if(i&&(t="data:"+i+";base64,"+t),!t)return;var r=new Ft(t,e,{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),s=function(){this._map.removeLayer(r),this.fire("error"),r.off("load",n,this)},n=function(t){if(r.off("error",n,this),this._map){var i=t.target,s=this._currentImage;i._bounds.equals(e)&&i._bounds.equals(this._map.getBounds())?(this._currentImage=i,"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),s&&this._map&&this._map.removeLayer(s),s&&s._map&&s._map.removeLayer(s)):this._map.removeLayer(i)}this.fire("load",{bounds:e})};r.once("error",s,this),r.once("load",n,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 i=this._buildExportParams();l["Util"].extend(i,this.options.requestParams),i?(this._requestExport(i,e),this.fire("loading",{bounds:e})):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)}}},_renderPopup:function(t,e,i,r){if(t=Object(l["latLng"])(t),this._shouldRenderPopup&&this._lastClick.equals(t)){var s=this._popupFunction(e,i,r);s&&this._popup.setLatLng(t).setContent(s).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()),i=this._map.unproject(t.getTopRight()),r=this._map.options.crs.project(i),s=this._map.options.crs.project(e),n=Object(l["bounds"])(r,s);return[n.getBottomLeft().x,n.getBottomLeft().y,n.getTopRight().x,n.getTopRight().y].join(",")},_calculateImageSize:function(){var t=this._map.getPixelBounds(),e=this._map.getSize(),i=this._map.unproject(t.getBottomLeft()),r=this._map.unproject(t.getTopRight()),s=this._map.latLngToLayerPoint(r).y,n=this._map.latLngToLayerPoint(i).y;return(s>0||n<e.y)&&(e.y=n-s),e.x+","+e.y}}),Gt=Mt.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=W(t),this.service=At(t),this.service.addEventParent(this),l["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 l["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 l["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=l["Util"].bind((function(e,i,r){e||setTimeout(l["Util"].bind((function(){this._renderPopup(t.latlng,e,i,r)}),this),300)}),this),i=this.identify().at(t.latlng);this.options.mosaicRule&&i.setMosaicRule(this.options.mosaicRule),i.run(e),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),e={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&&(e.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.options.pixelType&&(e.pixelType=this.options.pixelType),this.options.interpolation&&(e.interpolation=this.options.interpolation),this.options.compressionQuality&&(e.compressionQuality=this.options.compressionQuality),this.options.bandIds&&(e.bandIds=this.options.bandIds),(0===this.options.noData||this.options.noData)&&(e.noData=this.options.noData),this.options.noDataInterpretation&&(e.noDataInterpretation=this.options.noDataInterpretation),this.service.options.token&&(e.token=this.service.options.token),this.options.renderingRule&&(e.renderingRule=JSON.stringify(this.options.renderingRule)),this.options.mosaicRule&&(e.mosaicRule=JSON.stringify(this.options.mosaicRule)),e},_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 i=this.options.url+"exportImage"+l["Util"].getParamString(t);this.options.proxy&&(i=this.options.proxy+"?"+i),this._renderImage(i,e)}}});function Et(t,e){return new Gt(t,e)}var Ut=Mt.extend({options:{updateInterval:150,layers:!1,layerDefs:!1,timeOptions:!1,format:"png32",transparent:!0,f:"json"},initialize:function(t){t=W(t),this.service=xt(t),this.service.addEventParent(this),l["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,i=l["Util"].bind((function(e,i,r){e||setTimeout(l["Util"].bind((function(){this._renderPopup(t.latlng,e,i,r)}),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),e.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 r in this.options.layerDefs)this.options.layerDefs.hasOwnProperty(r)&&e.layerDef(r,this.options.layerDefs[r]);e.run(i),this._shouldRenderPopup=!0,this._lastClick=t.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),e={bbox:this._calculateBbox(),size:this._calculateImageSize(),dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};if(this.options.dynamicLayers&&(e.dynamicLayers=this.options.dynamicLayers),this.options.layers){if(0===this.options.layers.length)return;e.layers="show:"+this.options.layers.join(",")}return this.options.layerDefs&&(e.layerDefs="string"===typeof this.options.layerDefs?this.options.layerDefs:JSON.stringify(this.options.layerDefs)),this.options.timeOptions&&(e.timeOptions=JSON.stringify(this.options.timeOptions)),this.options.from&&this.options.to&&(e.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.service.options.token&&(e.token=this.service.options.token),this.options.proxy&&(e.proxy=this.options.proxy),this.options.disableCache&&(e._ts=Date.now()),e},_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 i=this.options.url+"export"+l["Util"].getParamString(t);this.options.proxy&&(i=this.options.proxy+"?"+i),this._renderImage(i,e)}}});function Dt(t,e){return new Ut(t,e)}var Bt=l["Layer"].extend({options:{cellSize:512,updateWhenIdle:l["Browser"].mobile,updateInterval:150,noWrap:!1,keepBuffer:1.5},initialize:function(t){l["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=l["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 l["Point"]?t:new l["Point"](t,t)},_pruneCells:function(){if(this._map){var t,e;for(t in this._cells)e=this._cells[t],e.retain=e.current;for(t in this._cells)if(e=this._cells[t],e.current&&!e.active){var i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.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,i,r){var s=Math.floor(t/2),n=Math.floor(e/2),o=i-1,a=new l["Point"](+s,+n);a.z=+o;var u=this._cellCoordsToKey(a),h=this._cells[u];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),o>r&&this._retainParent(s,n,o,r))},_retainChildren:function(t,e,i,r){for(var s=2*t;s<2*t+2;s++)for(var n=2*e;n<2*e+2;n++){var o=new l["Point"](s,n);o.z=i+1;var a=this._cellCoordsToKey(o),u=this._cells[a];u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),i+1<r&&this._retainChildren(s,n,i+1,r))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);e||this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_setView:function(t,e,i,r){var s=Math.round(e);r||(this._cellZoom=s,this._abortLoading&&this._abortLoading(),this._resetGrid(),void 0!==s&&this._update(t),i||this._pruneCells(),this._noPrune=!!i)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._cellSize=this.getCellSize(),r=this._cellZoom,s=this._map.getPixelWorldBounds(this._cellZoom);s&&(this._globalCellRange=this._pxBoundsToCellRange(s)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],r).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],r).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],r).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],r).y/i.y)]},_onMoveEnd:function(t){var e=t&&(t.pinch||t.flyTo);e||!this._map||this._map._animatingZoom||this._update()},_getCelldPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),r=e.getZoomScale(i,this._cellZoom),s=e.project(t,this._cellZoom).floor(),n=e.getSize().divideBy(2*r);return new l["Bounds"](s.subtract(n),s.add(n))},_update:function(t){var e=this._map;if(e){var i=Math.round(e.getZoom());void 0===t&&(t=e.getCenter());var r=this._getCelldPixelBounds(t),s=this._pxBoundsToCellRange(r),n=s.getCenter(),o=[],a=this.options.keepBuffer,u=new l["Bounds"](s.getBottomLeft().subtract([a,-a]),s.getTopRight().add([a,-a]));if(!(isFinite(s.min.x)&&isFinite(s.min.y)&&isFinite(s.max.x)&&isFinite(s.max.y)))throw new Error("Attempted to load an infinite number of cells");for(var h in this._cells){var c=this._cells[h].coords;c.z===this._cellZoom&&u.contains(new l["Point"](c.x,c.y))||(this._cells[h].current=!1)}if(Math.abs(i-this._cellZoom)>1)this._setView(t,i);else{for(var p=s.min.y;p<=s.max.y;p++)for(var d=s.min.x;d<=s.max.x;d++){var m=new l["Point"](d,p);if(m.z=this._cellZoom,this._isValidCell(m)){var f=this._cells[this._cellCoordsToKey(m)];f?f.current=!0:o.push(m)}}if(o.sort((function(t,e){return t.distanceTo(n)-e.distanceTo(n)})),0!==o.length)for(this._loading||(this._loading=!0),d=0;d<o.length;d++){var y=this._cellCoordsToKey(o[d]),g=this._keyToCellCoords(y);this._activeCells[g]?this._reuseCell(o[d]):this._createCell(o[d])}}}},_isValidCell:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalCellRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var r=this._cellCoordsToBounds(t);return Object(l["toLatLngBounds"])(this.options.bounds).overlaps(r)},_keyToBounds:function(t){return this._cellCoordsToBounds(this._keyToCellCoords(t))},_cellCoordsToNwSe:function(t){var e=this._map,i=this.getCellSize(),r=t.scaleBy(i),s=r.add(i),n=e.unproject(r,t.z),o=e.unproject(s,t.z);return[n,o]},_cellCoordsToBounds:function(t){var e=this._cellCoordsToNwSe(t),i=new l["LatLngBounds"](e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_cellCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToCellCoords:function(t){var e=t.split(":"),i=new l["Point"](+e[0],+e[1]);return i.z=+e[2],i},_removeCell:function(t){var e=this._cells[t];if(e){var i=this._keyToCellCoords(t),r=this._wrapCoords(i),s=this._cellCoordsToBounds(this._wrapCoords(i));e.current=!1,delete this._cells[t],this._activeCells[t]=e,this.cellLeave(s,r,t),this.fire("cellleave",{key:t,coords:r,bounds:s})}},_reuseCell:function(t){var e=this._cellCoordsToKey(t);this._cells[e]=this._activeCells[e],this._cells[e].current=!0;var i=this._wrapCoords(t),r=this._cellCoordsToBounds(this._wrapCoords(t));this.cellEnter(r,i,e),this.fire("cellenter",{key:e,coords:i,bounds:r})},_createCell:function(t){var e=this._cellCoordsToKey(t),i=this._wrapCoords(t),r=this._cellCoordsToBounds(this._wrapCoords(t));this.createCell(r,i,e),this.fire("cellcreate",{key:e,coords:i,bounds:r}),this._cells[e]={coords:t,current:!0},l["Util"].requestAnimFrame(this._pruneCells,this)},_cellReady:function(t,e,i){var r=this._cellCoordsToKey(t);i=this._cells[r],i&&(i.loaded=+new Date,i.active=!0)},_getCellPos:function(t){return t.scaleBy(this.getCellSize())},_wrapCoords:function(t){var e=new l["Point"](this._wrapX?l["Util"].wrapNum(t.x,this._wrapX):t.x,this._wrapY?l["Util"].wrapNum(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToCellRange:function(t){var e=this.getCellSize();return new l["Bounds"](t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))}});function Zt(t){this.values=[].concat(t||[])}Zt.prototype.query=function(t){var e=this.getIndex(t);return this.values[e]},Zt.prototype.getIndex=function(t){this.dirty&&this.sort();var e,i,r=0,s=this.values.length-1;while(r<=s)if(e=(r+s)/2|0,i=this.values[Math.round(e)],+i.value<+t)r=e+1;else{if(!(+i.value>+t))return e;s=e-1}return Math.abs(~s)},Zt.prototype.between=function(t,e){var i=this.getIndex(t),r=this.getIndex(e);if(0===i&&0===r)return[];while(this.values[i-1]&&this.values[i-1].value===t)i--;while(this.values[r+1]&&this.values[r+1].value===e)r++;return this.values[r]&&this.values[r].value===e&&this.values[r+1]&&r++,this.values.slice(i,r)},Zt.prototype.insert=function(t){return this.values.splice(this.getIndex(t.value),0,t),this},Zt.prototype.bulkAdd=function(t,e){return this.values=this.values.concat([].concat(t||[])),e?this.sort():this.dirty=!0,this},Zt.prototype.sort=function(){return this.values.sort((function(t,e){return+e.value-+t.value})).reverse(),this.dirty=!1,this};var zt=Zt,jt=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=W(t),t=l["Util"].setOptions(this,t),this.service=Ct(t),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var e=!1,i=0;i<this.options.fields.length;i++)this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)&&(e=!0);!1===e&&g("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 zt,this._endTimeIndex=new zt):this.options.timeField&&(this._timeIndex=new zt),this._cache={},this._currentSnapshot=[],this._activeRequests=0},onAdd:function(t){return Q(t),this.service.metadata((function(e,i){if(!e){var r=i.supportedQueryFormats,s=!1;(!1===this.service.options.isModern||this.options.fetchAllFeatures)&&(s=!0),!s&&r&&-1!==r.indexOf("geoJSON")&&(this.service.options.isModern=!0),i.objectIdField&&(this.service.options.idAttribute=i.objectIdField),!this.options.attribution&&t.attributionControl&&i.copyrightText&&(this.options.attribution=i.copyrightText,t.attributionControl.addAttribution(this.getAttribution()))}}),this),t.on("zoomend",this._handleZoomChange,this),Bt.prototype.onAdd.call(this,t)},onRemove:function(t){return K(t),t.off("zoomend",this._handleZoomChange,this),Bt.prototype.onRemove.call(this,t)},getAttribution:function(){return this.options.attribution},createCell:function(t,e){this._visibleZoom()&&this._requestFeatures(t,e)},_requestFeatures:function(t,e,i,r){this._activeRequests++,r=r||0;var s=this.options.where;return 1===this._activeRequests&&this.fire("loading",{bounds:t},!0),this._buildQuery(t,r).run((function(n,o,a){a&&a.exceededTransferLimit&&this.fire("drawlimitexceeded"),this.options.where===s&&(!n&&o&&o.features.length&&l["Util"].requestAnimFrame(l["Util"].bind((function(){this._addFeatures(o.features,e),this._postProcessFeatures(t)}),this)),n||!o||o.features.length||this._postProcessFeatures(t),n&&this._postProcessFeatures(t),i&&i.call(this,n,o),a&&(a.exceededTransferLimit||a.properties&&a.properties.exceededTransferLimit)&&this.options.fetchAllFeatures&&this._requestFeatures(t,e,i,r+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,e){if(e){var i=this._cacheKey(e);this._cache[i]=this._cache[i]||[]}for(var r=t.length-1;r>=0;r--){var s=t[r].id;-1===this._currentSnapshot.indexOf(s)&&this._currentSnapshot.push(s),"undefined"!==typeof i&&-1===this._cache[i].indexOf(s)&&this._cache[i].push(s)}this.options.timeField&&this._buildTimeIndexes(t),this.createLayers(t)},_buildQuery:function(t,e){var i=this.service.query().intersects(t).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.fetchAllFeatures&&!isNaN(parseInt(e))&&(i=i.offset(e)),i.params["resultType"]="tile",this.options.requestParams&&l["Util"].extend(i.params,this.options.requestParams),this.options.simplifyFactor&&i.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&i.between(this.options.from,this.options.to),i},setWhere:function(t,e,i){this.options.where=t&&t.length?t:"1=1";for(var r=[],s=[],n=0,o=null,a=l["Util"].bind((function(a,u){if(a&&(o=a),u)for(var h=u.features.length-1;h>=0;h--)s.push(u.features[h].id);n--,n<=0&&this._visibleZoom()&&t===this.options.where&&(this._currentSnapshot=s,l["Util"].requestAnimFrame(l["Util"].bind((function(){this.removeLayers(r),this.addLayers(s),e&&e.call(i,o)}),this)))}),this),u=this._currentSnapshot.length-1;u>=0;u--)r.push(this._currentSnapshot[u]);for(var h in this._cache={},this._cells){n++;var c=this._keyToCellCoords(h),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,a)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,e,i,r){var s=this.options.from,n=this.options.to,o=0,a=null,u=l["Util"].bind((function(l){l&&(a=l),this._filterExistingFeatures(s,n,t,e),o--,i&&o<=0&&i.call(r,a)}),this);if(this.options.from=t,this.options.to=e,this._filterExistingFeatures(s,n,t,e),"server"===this.options.timeFilterMode)for(var h in this._cells){o++;var c=this._keyToCellCoords(h),p=this._cellCoordsToBounds(c);this._requestFeatures(p,c,u)}return this},refresh:function(){this.setWhere(this.options.where)},_filterExistingFeatures:function(t,e,i,r){var s=t&&e?this._getFeaturesInTimeRange(t,e):this._currentSnapshot,n=this._getFeaturesInTimeRange(i,r);if(n.indexOf)for(var o=0;o<n.length;o++){var a=s.indexOf(n[o]);a>=0&&s.splice(a,1)}l["Util"].requestAnimFrame(l["Util"].bind((function(){this.removeLayers(s),this.addLayers(n)}),this))},_getFeaturesInTimeRange:function(t,e){var i,r=[];if(this.options.timeField.start&&this.options.timeField.end){var s=this._startTimeIndex.between(t,e),n=this._endTimeIndex.between(t,e);i=s.concat(n)}else{if(!this._timeIndex)return g("You must set timeField in the layer constructor in order to manipulate the start and end time filter."),[];i=this._timeIndex.between(t,e)}for(var o=i.length-1;o>=0;o--)r.push(i[o].id);return r},_buildTimeIndexes:function(t){var e,i;if(this.options.timeField.start&&this.options.timeField.end){var r=[],s=[];for(e=t.length-1;e>=0;e--)i=t[e],r.push({id:i.id,value:new Date(i.properties[this.options.timeField.start])}),s.push({id:i.id,value:new Date(i.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(r),this._endTimeIndex.bulkAdd(s)}else{var n=[];for(e=t.length-1;e>=0;e--)i=t[e],n.push({id:i.id,value:new Date(i.properties[this.options.timeField])});this._timeIndex.bulkAdd(n)}},_featureWithinTimeRange:function(t){if(!this.options.from||!this.options.to)return!0;var e=+this.options.from.valueOf(),i=+this.options.to.valueOf();if("string"===typeof this.options.timeField){var r=+t.properties[this.options.timeField];return r>=e&&r<=i}if(this.options.timeField.start&&this.options.timeField.end){var s=+t.properties[this.options.timeField.start],n=+t.properties[this.options.timeField.end];return s>=e&&s<=i||n>=e&&n<=i||s<=e&&n>=i}},_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 e=this._cells[t].coords,i=this._cacheKey(e);this._cache[i]&&this.addLayers(this._cache[i])}else this.removeLayers(this._currentSnapshot),this._currentSnapshot=[]},authenticate:function(t){return this.service.authenticate(t),this},metadata:function(t,e){return this.service.metadata(t,e),this},query:function(){return this.service.query()},_getMetadata:function(t){var e;this._metadata?t(e,this._metadata):this.metadata(l["Util"].bind((function(e,i){this._metadata=i,t(e,this._metadata)}),this))},addFeature:function(t,e,i){this.addFeatures(t,e,i)},addFeatures:function(t,e,i){this._getMetadata(l["Util"].bind((function(r,s){if(r)e&&e.call(this,r,null);else{var n=t.features?t.features:[t];this.service.addFeatures(t,l["Util"].bind((function(t,r){if(!t){for(var o=n.length-1;o>=0;o--)n[o].properties[s.objectIdField]=n.length>1?r[o].objectId:r.objectId,n[o].id=n.length>1?r[o].objectId:r.objectId;this._addFeatures(n)}e&&e.call(i,t,r)}),this))}}),this))},updateFeature:function(t,e,i){this.updateFeatures(t,e,i)},updateFeatures:function(t,e,i){var r=t.features?t.features:[t];this.service.updateFeatures(t,(function(t,s){if(!t){for(var n=r.length-1;n>=0;n--)this.removeLayers([r[n].id],!0);this._addFeatures(r)}e&&e.call(i,t,s)}),this)},deleteFeature:function(t,e,i){this.deleteFeatures(t,e,i)},deleteFeatures:function(t,e,i){return this.service.deleteFeatures(t,(function(t,r){var s=r.length?r:[r];if(!t&&s.length>0)for(var n=s.length-1;n>=0;n--)this.removeLayers([s[n].objectId],!0);e&&e.call(i,t,r)}),this)}}),qt=jt.extend({options:{cacheLayers:!0},initialize:function(t){t.apikey&&(t.token=t.apikey),jt.prototype.initialize.call(this,t),this._originalStyle=this.options.style,this._layers={}},onRemove:function(t){for(var e in this._layers)t.removeLayer(this._layers[e]),this.fire("removefeature",{feature:this._layers[e].feature,permanent:!1},!0);return jt.prototype.onRemove.call(this,t)},createNewLayer:function(t){var e=l["GeoJSON"].geometryToLayer(t,this.options);return e&&(e.defaultOptions=e.options),e},_updateLayer:function(t,e){var i=[],r=this.options.coordsToLatLng||l["GeoJSON"].coordsToLatLng;switch(e.properties&&(t.feature.properties=e.properties),e.geometry.type){case"Point":i=l["GeoJSON"].coordsToLatLng(e.geometry.coordinates),t.setLatLng(i);break;case"LineString":i=l["GeoJSON"].coordsToLatLngs(e.geometry.coordinates,0,r),t.setLatLngs(i);break;case"MultiLineString":i=l["GeoJSON"].coordsToLatLngs(e.geometry.coordinates,1,r),t.setLatLngs(i);break;case"Polygon":i=l["GeoJSON"].coordsToLatLngs(e.geometry.coordinates,1,r),t.setLatLngs(i);break;case"MultiPolygon":i=l["GeoJSON"].coordsToLatLngs(e.geometry.coordinates,2,r),t.setLatLngs(i);break}this.redraw(t.feature.id)},createLayers:function(t){for(var e=t.length-1;e>=0;e--){var i,r=t[e],s=this._layers[r.id];!this._visibleZoom()||!s||this._map.hasLayer(s)||this.options.timeField&&!this._featureWithinTimeRange(r)||(this._map.addLayer(s),this.fire("addfeature",{feature:s.feature},!0)),s&&(s.setLatLngs||s.setLatLng)&&this._updateLayer(s,r),s||(i=this.createNewLayer(r),i?(i.feature=r,i.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(i.feature,i),this._layers[i.feature.id]=i,this.setFeatureStyle(i.feature.id,this.options.style),this.fire("createfeature",{feature:i.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(r))&&this._map.addLayer(i)):g("invalid GeoJSON encountered"))}},addLayers:function(t){for(var e=t.length-1;e>=0;e--){var i=this._layers[t[e]];!i||this.options.timeField&&!this._featureWithinTimeRange(i.feature)||(this._map.addLayer(i),this.fire("addfeature",{feature:i.feature},!0))}},removeLayers:function(t,e){for(var i=t.length-1;i>=0;i--){var r=t[i],s=this._layers[r];s&&(this.fire("removefeature",{feature:s.feature,permanent:e},!0),this._map.removeLayer(s)),s&&e&&delete this._layers[r]}},cellEnter:function(t,e){this._visibleZoom()&&!this._zooming&&this._map&&l["Util"].requestAnimFrame(l["Util"].bind((function(){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),r=this._cache[t];this._activeCells[i]&&r&&this.addLayers(r)}),this))},cellLeave:function(t,e){this._zooming||l["Util"].requestAnimFrame(l["Util"].bind((function(){if(this._map){var t=this._cacheKey(e),i=this._cellCoordsToKey(e),r=this._cache[t],s=this._map.getBounds();if(!this._activeCells[i]&&r){for(var n=!0,o=0;o<r.length;o++){var a=this._layers[r[o]];a&&a.getBounds&&s.intersects(a.getBounds())&&(n=!1)}n&&this.removeLayers(r,!this.options.cacheLayers),!this.options.cacheLayers&&n&&(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(e){this.setFeatureStyle(e.feature.id,t)}),this),this},resetFeatureStyle:function(t){var e=this._layers[t],i=this._originalStyle||l["Path"].prototype.options;return e&&(l["Util"].extend(e.options,e.defaultOptions),this.setFeatureStyle(t,i)),this},setFeatureStyle:function(t,e){var i=this._layers[t];return"function"===typeof e&&(e=e(i.feature)),i.setStyle&&i.setStyle(e),this},eachActiveFeature:function(t,e){if(this._map){var i=this._map.getBounds();for(var r in this._layers)-1!==this._currentSnapshot.indexOf(this._layers[r].feature.id)&&("function"===typeof this._layers[r].getLatLng&&i.contains(this._layers[r].getLatLng())||"function"===typeof this._layers[r].getBounds&&i.intersects(this._layers[r].getBounds()))&&t.call(e,this._layers[r])}return this},eachFeature:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);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],i=e.feature;if(e&&e.setIcon&&this.options.pointToLayer&&this.options.pointToLayer){var r=this.options.pointToLayer(i,Object(l["latLng"])(i.geometry.coordinates[1],i.geometry.coordinates[0])),s=r.options.icon;e.setIcon(s)}if(e&&e.setStyle&&this.options.pointToLayer){var n=this.options.pointToLayer(i,Object(l["latLng"])(i.geometry.coordinates[1],i.geometry.coordinates[0])),o=n.options;this.setFeatureStyle(i.id,o)}e&&e.setStyle&&this.options.style&&this.resetStyle(i.id)}});function Nt(t){return new qt(t)}i.d(e,"VERSION",(function(){return Wt})),i.d(e,"Support",(function(){return o})),i.d(e,"options",(function(){return a})),i.d(e,"Util",(function(){return tt})),i.d(e,"get",(function(){return y})),i.d(e,"post",(function(){return p})),i.d(e,"request",(function(){return m})),i.d(e,"Task",(function(){return et})),i.d(e,"task",(function(){return it})),i.d(e,"Query",(function(){return rt})),i.d(e,"query",(function(){return st})),i.d(e,"Find",(function(){return ot})),i.d(e,"find",(function(){return at})),i.d(e,"Identify",(function(){return ut})),i.d(e,"identify",(function(){return ht})),i.d(e,"IdentifyFeatures",(function(){return ct})),i.d(e,"identifyFeatures",(function(){return pt})),i.d(e,"IdentifyImage",(function(){return mt})),i.d(e,"identifyImage",(function(){return ft})),i.d(e,"Service",(function(){return gt})),i.d(e,"service",(function(){return _t})),i.d(e,"MapService",(function(){return vt})),i.d(e,"mapService",(function(){return bt})),i.d(e,"ImageService",(function(){return St})),i.d(e,"imageService",(function(){return Lt})),i.d(e,"FeatureLayerService",(function(){return wt})),i.d(e,"featureLayerService",(function(){return Tt})),i.d(e,"BasemapLayer",(function(){return Ot})),i.d(e,"basemapLayer",(function(){return Pt})),i.d(e,"TiledMapLayer",(function(){return Rt})),i.d(e,"tiledMapLayer",(function(){return kt})),i.d(e,"RasterLayer",(function(){return Mt})),i.d(e,"ImageMapLayer",(function(){return Gt})),i.d(e,"imageMapLayer",(function(){return Et})),i.d(e,"DynamicMapLayer",(function(){return Ut})),i.d(e,"dynamicMapLayer",(function(){return Dt})),i.d(e,"FeatureManager",(function(){return jt})),i.d(e,"FeatureLayer",(function(){return qt})),i.d(e,"featureLayer",(function(){return Nt}));var Wt=r.version},"4ae9":function(t,e,i){var r,s=i("313e"),n=s.util,o=s.graphic,a=s.matrix;function l(t,e){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=new BMap.MercatorProjection}function u(t,e){return e=e||[0,0],n.map([0,1],(function(i){var r=e[i],s=t[i]/2,n=[],o=[];return n[i]=r-s,o[i]=r+s,n[1-i]=o[1-i]=e[1-i],Math.abs(this.dataToPoint(n)[i]-this.dataToPoint(o)[i])}),this)}function h(){function t(t){this._root=t}return t.prototype=new BMap.Overlay,t.prototype.initialize=function(t){return t.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}l.prototype.dimensions=["lng","lat"],l.prototype.setZoom=function(t){this._zoom=t},l.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))},l.prototype.setMapOffset=function(t){this._mapOffset=t},l.prototype.getBMap=function(){return this._bmap},l.prototype.dataToPoint=function(t){var e=new BMap.Point(t[0],t[1]),i=this._bmap.pointToOverlayPixel(e),r=this._mapOffset;return[i.x-r[0],i.y-r[1]]},l.prototype.pointToData=function(t){var e=this._mapOffset;t=this._bmap.overlayPixelToPoint({x:t[0]+e[0],y:t[1]+e[1]});return[t.lng,t.lat]},l.prototype.getViewRect=function(){var t=this._api;return new o.BoundingRect(0,0,t.getWidth(),t.getHeight())},l.prototype.getRoamTransform=function(){return a.create()},l.prototype.prepareCustoms=function(t){var e=this.getViewRect();return{coordSys:{type:"bmap",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:n.bind(this.dataToPoint,this),size:n.bind(u,this)}}},l.dimensions=l.prototype.dimensions,l.create=function(t,e){var i,s=e.getDom();t.eachComponent("bmap",(function(t){var n=e.getZr().painter,o=n.getViewportRoot();if("undefined"===typeof BMap)throw new Error("BMap api is not loaded");if(r=r||h(),i)throw new Error("Only one bmap component can exist");if(!t.__bmap){var a=s.querySelector(".ec-extension-bmap");a&&(o.style.left="0px",o.style.top="0px",s.removeChild(a)),a=document.createElement("div"),a.style.cssText="width:100%;height:100%",a.classList.add("ec-extension-bmap"),s.appendChild(a);var u=t.get("mapOptions")||{};delete u.mapType;var c=t.__bmap=new BMap.Map(a,u),p=new r(o);c.addOverlay(p),n.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}c=t.__bmap;var d=t.get("center"),m=t.get("zoom");if(d&&m){var f=c.getCenter(),y=c.getZoom(),g=t.centerOrZoomChanged([f.lng,f.lat],y);if(g){var _=new BMap.Point(d[0],d[1]);c.centerAndZoom(_,m)}}i=new l(c,e),i.setMapOffset(t.__mapOffset||[0,0]),i.setZoom(m),i.setCenter(d),t.coordinateSystem=i})),t.eachSeries((function(t){"bmap"===t.get("coordinateSystem")&&(t.coordinateSystem=i)}))};var c=l;t.exports=c},"55dd":function(t,e,i){"use strict";var r=i("5ca1"),s=i("d8e8"),n=i("4bf8"),o=i("79e5"),a=[].sort,l=[1,2,3];r(r.P+r.F*(o((function(){l.sort(void 0)}))||!o((function(){l.sort(null)}))||!i("2f21")(a)),"Array",{sort:function(t){return void 0===t?a.call(n(this)):a.call(n(this),s(t))}})},"5d99":function(t,e,i){var r=i("313e");function s(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}var n=r.extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged:function(t,e){var i=this.option;return!(s(t,i.center)&&e===i.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},mapStyleV2:{},mapOptions:{},roam:!1}});t.exports=n},6808:function(t){t.exports={name:"esri-leaflet",description:"Leaflet plugins for consuming ArcGIS Online and ArcGIS Server services.",version:"3.0.7",author:"Patrick Arlt <parlt@esri.com> (http://patrickarlt.com)",bugs:{url:"https://github.com/esri/esri-leaflet/issues"},contributors:["Patrick Arlt <parlt@esri.com> (http://patrickarlt.com)","John Gravois <jgravois@esri.com> (https://johngravois.com)","Gavin Rehkemper <grehkemper@esri.com> (https://gavinr.com)","Jacob Wasilkowski <jwasilkowski@esri.com> (https://jwasilgeo.github.io)"],dependencies:{"@terraformer/arcgis":"^2.1.0","tiny-binary-search":"^1.0.3"},devDependencies:{"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.3",chai:"4.3.6","gh-release":"^6.0.1","highlight.js":"^11.4.0","http-server":"^14.1.0",husky:"^1.1.1",karma:"^6.3.16","karma-chai-sinon":"^0.1.5","karma-chrome-launcher":"^3.1.0","karma-coverage":"^2.2.0","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-sourcemap-loader":"^0.3.8",leaflet:"^1.6.0",mkdirp:"^1.0.4",mocha:"^9.2.0","npm-run-all":"^4.1.5",rollup:"^2.67.2","rollup-plugin-terser":"^7.0.2",semistandard:"^9.0.0",sinon:"^13.0.1","sinon-chai":"3.7.0",snazzy:"^9.0.0","uglify-js":"^3.15.1",watch:"^1.0.2"},files:["src/**/*.js","dist/esri-leaflet.js","dist/esri-leaflet.js.map","dist/esri-leaflet-debug.js.map","dist/siteData.json","profiles/*.js"],homepage:"http://esri.github.io/esri-leaflet",module:"src/EsriLeaflet.js","jsnext:main":"src/EsriLeaflet.js",jspm:{registry:"npm",format:"es6",main:"src/EsriLeaflet.js"},keywords:["arcgis","esri","esri leaflet","gis","leaflet plugin","mapping"],license:"Apache-2.0",main:"dist/esri-leaflet-debug.js",peerDependencies:{leaflet:"^1.0.0"},readmeFilename:"README.md",repository:{type:"git",url:"git@github.com:Esri/esri-leaflet.git"},scripts:{build:"rollup -c profiles/debug.js & rollup -c profiles/production.js",lint:"semistandard | snazzy",prebuild:"mkdirp dist",pretest:"npm run build",precommit:"npm run lint",fix:"semistandard --fix",release:"./scripts/release.sh","start-watch":'watch "npm run build" src',start:"run-p start-watch serve",serve:"http-server -p 5000 -c-1 -o",test:"npm run lint && karma start","test:ci":"npm run lint && karma start --browsers Chrome_travis_ci"},semistandard:{globals:["expect","L","XMLHttpRequest","sinon","xhr","proj4"]},unpkg:"dist/esri-leaflet-debug.js"}},a00a:function(t,e,i){var r=i("313e"),s=i("4ae9");i("5d99"),i("2114"),r.registerCoordinateSystem("bmap",s),r.registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},(function(t,e){e.eachComponent("bmap",(function(t){var e=t.getBMap(),i=e.getCenter();t.setCenterAndZoom([i.lng,i.lat],e.getZoom())}))}));var n="1.0.0";e.version=n}}]);