src/pyams_gis/resources/js/leaflet-esri-2.0.8.min.js
changeset 56 37970a213463
child 63 77c839e343af
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-2.0.8.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{}),b.L))}(this,function(O,S){var Y="default" in S?S["default"]:S;var s="2.0.8";var aJ=((window.XMLHttpRequest&&"withCredentials" in new window.XMLHttpRequest()));var a=document.documentElement.style.pointerEvents==="";var ag={cors:aJ,pointerEvents:a};var W={attributionWidthOffset:55};var o=0;function c(aP){var aN="";aP.f=aP.f||"json";for(var aK in aP){if(aP.hasOwnProperty(aK)){var aO=aP[aK];var aL=Object.prototype.toString.call(aO);var aM;if(aN.length){aN+="&"}if(aL==="[object Array]"){aM=(Object.prototype.toString.call(aO[0])==="[object Object]")?JSON.stringify(aO):aO.join(",")}else{if(aL==="[object Object]"){aM=JSON.stringify(aO)}else{if(aL==="[object Date]"){aM=aO.valueOf()}else{aM=aO}}}aN+=encodeURIComponent(aK)+"="+encodeURIComponent(aM)}}return aN}function y(aM,aL){var aK=new window.XMLHttpRequest();aK.onerror=function(aN){aK.onreadystatechange=S.Util.falseFn;aM.call(aL,{error:{code:500,message:"XMLHttpRequest error"}},null)};aK.onreadystatechange=function(){var aN;var aO;if(aK.readyState===4){try{aN=JSON.parse(aK.responseText)}catch(aP){aN=null;aO={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}if(!aO&&aN.error){aO=aN.error;aN=null}aK.onerror=S.Util.falseFn;aM.call(aL,aO,aN)}};aK.ontimeout=function(){this.onerror()};return aK}function aA(aL,aN,aO,aM){var aK=y(aO,aM);aK.open("POST",aL);if(typeof aM!=="undefined"&&aM!==null){if(typeof aM.options!=="undefined"){aK.timeout=aM.options.timeout}}aK.setRequestHeader("Content-Type","application/x-www-form-urlencoded");aK.send(c(aN));return aK}function b(aL,aN,aO,aM){var aK=y(aO,aM);aK.open("GET",aL+"?"+c(aN),true);if(typeof aM!=="undefined"&&aM!==null){if(typeof aM.options!=="undefined"){aK.timeout=aM.options.timeout}}aK.send(null);return aK}function ah(aL,aP,aQ,aN){var aO=c(aP);var aK=y(aQ,aN);var aM=(aL+"?"+aO).length;if(aM<=2000&&ag.cors){aK.open("GET",aL+"?"+aO)}else{if(aM>2000&&ag.cors){aK.open("POST",aL);aK.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}}if(typeof aN!=="undefined"&&aN!==null){if(typeof aN.options!=="undefined"){aK.timeout=aN.options.timeout}}if(aM<=2000&&ag.cors){aK.send(null)}else{if(aM>2000&&ag.cors){aK.send(aO)}else{if(aM<=2000&&!ag.cors){return g(aL,aP,aQ,aN)}else{aF("a request to "+aL+" 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");return}}}return aK}function g(aL,aO,aP,aM){window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{};var aN="c"+o;aO.callback="window._EsriLeafletCallbacks."+aN;window._EsriLeafletCallbacks[aN]=function(aQ){if(window._EsriLeafletCallbacks[aN]!==true){var aS;var aR=Object.prototype.toString.call(aQ);if(!(aR==="[object Object]"||aR==="[object Array]")){aS={error:{code:500,message:"Expected array or object as JSONP response"}};aQ=null}if(!aS&&aQ.error){aS=aQ;aQ=null}aP.call(aM,aS,aQ);window._EsriLeafletCallbacks[aN]=true}};var aK=S.DomUtil.create("script",null,document.body);aK.type="text/javascript";aK.src=aL+"?"+c(aO);aK.id=aN;o++;return{id:aN,url:aK.src,abort:function(){window._EsriLeafletCallbacks._callback[aN]({code:0,message:"Request aborted."})}}}var al=((ag.cors)?b:g);al.CORS=b;al.JSONP=g;var G={request:ah,get:al,post:aA};function af(aL,aK){for(var aM=0;aM<aL.length;aM++){if(aL[aM]!==aK[aM]){return false}}return true}function D(aK){if(!af(aK[0],aK[aK.length-1])){aK.push(aK[0])}return aK}function t(aL){var aM=0;var aK=0;var aO=aL.length;var aP=aL[aK];var aN;for(aK;aK<aO-1;aK++){aN=aL[aK+1];aM+=(aN[0]-aP[0])*(aN[1]+aP[1]);aP=aN}return(aM>=0)}function u(aO,aN,aS,aR){var aL=(aR[0]-aS[0])*(aO[1]-aS[1])-(aR[1]-aS[1])*(aO[0]-aS[0]);var aQ=(aN[0]-aO[0])*(aO[1]-aS[1])-(aN[1]-aO[1])*(aO[0]-aS[0]);var aP=(aR[1]-aS[1])*(aN[0]-aO[0])-(aR[0]-aS[0])*(aN[1]-aO[1]);if(aP!==0){var aM=aL/aP;var aK=aQ/aP;if(aM>=0&&aM<=1&&aK>=0&&aK<=1){return true}}return false}function h(aL,aK){for(var aN=0;aN<aL.length-1;aN++){for(var aM=0;aM<aK.length-1;aM++){if(u(aL[aN],aL[aN+1],aK[aM],aK[aM+1])){return true}}}return false}function aE(aP,aK){var aO=false;for(var aN=-1,aL=aP.length,aM=aL-1;++aN<aL;aM=aN){if(((aP[aN][1]<=aK[1]&&aK[1]<aP[aM][1])||(aP[aM][1]<=aK[1]&&aK[1]<aP[aN][1]))&&(aK[0]<(aP[aM][0]-aP[aN][0])*(aK[1]-aP[aN][1])/(aP[aM][1]-aP[aN][1])+aP[aN][0])){aO=!aO}}return aO}function an(aM,aK){var aN=h(aM,aK);var aL=aE(aM,aK[0]);if(!aN&&aL){return true}return false}function k(aT){var aQ=[];var aN=[];var aU;var aP;var aK;for(var aL=0;aL<aT.length;aL++){var aM=D(aT[aL].slice(0));if(aM.length<4){continue}if(t(aM)){var aS=[aM];aQ.push(aS)}else{aN.push(aM)}}var aV=[];while(aN.length){aK=aN.pop();var aR=false;for(aU=aQ.length-1;aU>=0;aU--){aP=aQ[aU][0];if(an(aP,aK)){aQ[aU].push(aK);aR=true;break}}if(!aR){aV.push(aK)}}while(aV.length){aK=aV.pop();var aO=false;for(aU=aQ.length-1;aU>=0;aU--){aP=aQ[aU][0];if(h(aP,aK)){aQ[aU].push(aK);aO=true;break}}if(!aO){aQ.push([aK.reverse()])}}if(aQ.length===1){return{type:"Polygon",coordinates:aQ[0]}}else{return{type:"MultiPolygon",coordinates:aQ}}}function I(aP){var aL=[];var aN=aP.slice(0);var aK=D(aN.shift().slice(0));if(aK.length>=4){if(!t(aK)){aK.reverse()}aL.push(aK);for(var aM=0;aM<aN.length;aM++){var aO=D(aN[aM].slice(0));if(aO.length>=4){if(t(aO)){aO.reverse()}aL.push(aO)}}}return aL}function p(aP){var aL=[];for(var aO=0;aO<aP.length;aO++){var aN=I(aP[aO]);for(var aK=aN.length-1;aK>=0;aK--){var aM=aN[aK].slice(0);aL.push(aM)}}return aL}function ak(aM){var aL={};for(var aK in aM){if(aM.hasOwnProperty(aK)){aL[aK]=aM[aK]}}return aL}function e(aM,aL){var aK={};if(typeof aM.x==="number"&&typeof aM.y==="number"){aK.type="Point";aK.coordinates=[aM.x,aM.y]}if(aM.points){aK.type="MultiPoint";aK.coordinates=aM.points.slice(0)}if(aM.paths){if(aM.paths.length===1){aK.type="LineString";aK.coordinates=aM.paths[0].slice(0)}else{aK.type="MultiLineString";aK.coordinates=aM.paths.slice(0)}}if(aM.rings){aK=k(aM.rings.slice(0))}if(aM.geometry||aM.attributes){aK.type="Feature";aK.geometry=(aM.geometry)?e(aM.geometry):null;aK.properties=(aM.attributes)?ak(aM.attributes):null;if(aM.attributes){aK.id=aM.attributes[aL]||aM.attributes.OBJECTID||aM.attributes.FID}}return aK}function v(aL,aO){aO=aO||"OBJECTID";var aN={wkid:4326};var aK={};var aM;switch(aL.type){case"Point":aK.x=aL.coordinates[0];aK.y=aL.coordinates[1];aK.spatialReference=aN;break;case"MultiPoint":aK.points=aL.coordinates.slice(0);aK.spatialReference=aN;break;case"LineString":aK.paths=[aL.coordinates.slice(0)];aK.spatialReference=aN;break;case"MultiLineString":aK.paths=aL.coordinates.slice(0);aK.spatialReference=aN;break;case"Polygon":aK.rings=I(aL.coordinates.slice(0));aK.spatialReference=aN;break;case"MultiPolygon":aK.rings=p(aL.coordinates.slice(0));aK.spatialReference=aN;break;case"Feature":if(aL.geometry){aK.geometry=v(aL.geometry,aO)}aK.attributes=(aL.properties)?ak(aL.properties):{};if(aL.id){aK.attributes[aO]=aL.id}break;case"FeatureCollection":aK=[];for(aM=0;aM<aL.features.length;aM++){aK.push(v(aL.features[aM],aO))}break;case"GeometryCollection":aK=[];for(aM=0;aM<aL.geometries.length;aM++){aK.push(v(aL.geometries[aM],aO))}break}return aK}function ap(aK,aL){return v(aK,aL)}function ac(aK,aL){return e(aK,aL)}function aD(aM){var aL={};for(var aK in aM){if(aM.hasOwnProperty(aK)){aL[aK]=aM[aK]}}return aL}function Q(aL){if(aL.xmin!=="NaN"&&aL.ymin!=="NaN"&&aL.xmax!=="NaN"&&aL.ymax!=="NaN"){var aK=S.latLng(aL.ymin,aL.xmin);var aM=S.latLng(aL.ymax,aL.xmax);return S.latLngBounds(aK,aM)}else{return null}}function aj(aK){aK=S.latLngBounds(aK);return{xmin:aK.getSouthWest().lng,ymin:aK.getSouthWest().lat,xmax:aK.getNorthEast().lng,ymax:aK.getNorthEast().lat,spatialReference:{wkid:4326}}}function r(aM,aR){var aQ;var aL=aM.features||aM.results;var aP=aL.length;if(aR){aQ=aR}else{if(aM.objectIdFieldName){aQ=aM.objectIdFieldName}else{if(aM.fields){for(var aN=0;aN<=aM.fields.length-1;aN++){if(aM.fields[aN].type==="esriFieldTypeOID"){aQ=aM.fields[aN].name;break}}}else{if(aP){for(var aS in aL[0].attributes){if(aS.match(/^(OBJECTID|FID|OID|ID)$/i)){aQ=aS;break}}}}}}var aK={type:"FeatureCollection",features:[]};if(aP){for(var aO=aL.length-1;aO>=0;aO--){var aT=ac(aL[aO],aQ);aK.features.push(aT)}}return aK}function T(aK){aK=S.Util.trim(aK);if(aK[aK.length-1]!=="/"){aK+="/"}return aK}function z(aK){return(/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i).test(aK)}function aI(aK){var aL;switch(aK){case"Point":aL="esriGeometryPoint";break;case"MultiPoint":aL="esriGeometryMultipoint";break;case"LineString":aL="esriGeometryPolyline";break;case"MultiLineString":aL="esriGeometryPolyline";break;case"Polygon":aL="esriGeometryPolygon";break;case"MultiPolygon":aL="esriGeometryPolygon";break}return aL}function aF(){if(console&&console.warn){console.warn.apply(console,arguments)}}function C(aK){return(aK.getSize().x-W.attributionWidthOffset)+"px"}function ay(aM){if(aM.attributionControl&&!aM.attributionControl._esriAttributionAdded){aM.attributionControl.setPrefix('<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a> | Powered by <a href="https://www.esri.com">Esri</a>');var aL=document.createElement("style");aL.type="text/css";aL.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}";document.getElementsByTagName("head")[0].appendChild(aL);S.DomUtil.addClass(aM.attributionControl._container,"esri-truncated-attribution:hover");var aK=document.createElement("style");aK.type="text/css";aK.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: "+C(aM)+";}";document.getElementsByTagName("head")[0].appendChild(aK);S.DomUtil.addClass(aM.attributionControl._container,"esri-truncated-attribution");aM.on("resize",function(aN){aM.attributionControl._container.style.maxWidth=C(aN.target)});aM.attributionControl._esriAttributionAdded=true}}function V(aK,aL){g(aK,{},S.Util.bind(function(aU,aM){if(aU){return}aL._esriAttributions=[];for(var aT=0;aT<aM.contributors.length;aT++){var aP=aM.contributors[aT];for(var aS=0;aS<aP.coverageAreas.length;aS++){var aQ=aP.coverageAreas[aS];var aN=S.latLng(aQ.bbox[0],aQ.bbox[1]);var aO=S.latLng(aQ.bbox[2],aQ.bbox[3]);aL._esriAttributions.push({attribution:aP.attribution,score:aQ.score,bounds:S.latLngBounds(aN,aO),minZoom:aQ.zoomMin,maxZoom:aQ.zoomMax})}}aL._esriAttributions.sort(function(aW,aV){return aV.score-aW.score});var aR={target:aL};aB(aR)},this))}function aB(aQ){var aM=aQ.target;var aP=aM._esriAttributions;if(aM&&aM.attributionControl&&aP){var aO="";var aL=aM.getBounds();var aK=S.latLngBounds(aL.getSouthWest().wrap(),aL.getNorthEast().wrap());var aU=aM.getZoom();for(var aN=0;aN<aP.length;aN++){var aS=aP[aN];var aR=aS.attribution;if(!aO.match(aR)&&aS.bounds.intersects(aK)&&aU>=aS.minZoom&&aU<=aS.maxZoom){aO+=(", "+aR)}}aO=aO.substr(2);var aT=aM.attributionControl._container.querySelector(".esri-dynamic-attribution");aT.innerHTML=aO;aT.style.maxWidth=C(aM);aM.fire("attributionupdated",{attribution:aO})}}var X={shallowClone:aD,warn:aF,cleanUrl:T,isArcgisOnline:z,geojsonTypeToArcGIS:aI,responseToFeatureCollection:r,geojsonToArcGIS:ap,arcgisToGeoJSON:ac,boundsToExtent:aj,extentToBounds:Q,calcAttributionWidth:C,setEsriAttribution:ay,_getAttributionData:V,_updateMapAttribution:aB};var aC=S.Class.extend({options:{proxy:false,useCors:aJ},generateSetter:function(aL,aK){return S.Util.bind(function(aM){this.params[aL]=aM;return this},aK)},initialize:function(aL){if(aL.request&&aL.options){this._service=aL;S.Util.setOptions(this,aL.options)}else{S.Util.setOptions(this,aL);this.options.url=T(aL.url)}this.params=S.Util.extend({},this.params||{});if(this.setters){for(var aM in this.setters){var aK=this.setters[aM];this[aM]=this.generateSetter(aK,this)}}},token:function(aK){if(this._service){this._service.authenticate(aK)}else{this.params.token=aK}return this},request:function(aL,aK){if(this._service){return this._service.request(this.path,this.params,aL,aK)}return this._request("request",this.path,this.params,aL,aK)},_request:function(aP,aM,aN,aO,aL){var aK=(this.options.proxy)?this.options.proxy+"?"+this.options.url+aM:this.options.url+aM;if((aP==="get"||aP==="request")&&!this.options.useCors){return G.get.JSONP(aK,aN,aO,aL)}return G[aP](aK,aN,aO,aL)}});function am(aK){return new aC(aK)}var R=aC.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:true,where:"1=1",outSr:4326,outFields:"*"},within:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelContains";return this},intersects:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelIntersects";return this},contains:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelWithin";return this},crosses:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelCrosses";return this},touches:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelTouches";return this},overlaps:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelOverlaps";return this},bboxIntersects:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelEnvelopeIntersects";return this},indexIntersects:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelIndexIntersects";return this},nearby:function(aL,aK){aL=S.latLng(aL);this.params.geometry=[aL.lng,aL.lat];this.params.geometryType="esriGeometryPoint";this.params.spatialRel="esriSpatialRelIntersects";this.params.units="esriSRUnit_Meter";this.params.distance=aK;this.params.inSr=4326;return this},where:function(aK){this.params.where=aK;return this},between:function(aL,aK){this.params.time=[aL.valueOf(),aK.valueOf()];return this},simplify:function(aM,aL){var aK=Math.abs(aM.getBounds().getWest()-aM.getBounds().getEast());this.params.maxAllowableOffset=(aK/aM.getSize().y)*aL;return this},orderBy:function(aL,aK){aK=aK||"ASC";this.params.orderByFields=(this.params.orderByFields)?this.params.orderByFields+",":"";this.params.orderByFields+=([aL,aK]).join(" ");return this},run:function(aL,aK){this._cleanParams();if(this.options.isModern||z(this.options.url)){this.params.f="geojson";return this.request(function(aN,aM){this._trapSQLerrors(aN);aL.call(aK,aN,aM,aM)},this)}else{return this.request(function(aN,aM){this._trapSQLerrors(aN);aL.call(aK,aN,(aM&&r(aM)),aM)},this)}},count:function(aL,aK){this._cleanParams();this.params.returnCountOnly=true;return this.request(function(aN,aM){aL.call(this,aN,(aM&&aM.count),aM)},aK)},ids:function(aL,aK){this._cleanParams();this.params.returnIdsOnly=true;return this.request(function(aN,aM){aL.call(this,aN,(aM&&aM.objectIds),aM)},aK)},bounds:function(aL,aK){this._cleanParams();this.params.returnExtentOnly=true;return this.request(function(aN,aM){if(aM&&aM.extent&&Q(aM.extent)){aL.call(aK,aN,Q(aM.extent),aM)}else{aN={message:"Invalid Bounds"};aL.call(aK,aN,null,aM)}},aK)},pixelSize:function(aK){var aL=S.point(aK);this.params.pixelSize=[aL.x,aL.y];return this},layer:function(aK){this.path=aK+"/query";return this},_trapSQLerrors:function(aK){if(aK){if(aK.code==="400"){aF("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},_setGeometry:function(aK){this.params.inSr=4326;if(aK instanceof S.LatLngBounds){this.params.geometry=aj(aK);this.params.geometryType="esriGeometryEnvelope";return}if(aK.getLatLng){aK=aK.getLatLng()}if(aK instanceof S.LatLng){aK={type:"Point",coordinates:[aK.lng,aK.lat]}}if(aK instanceof S.GeoJSON){aK=aK.getLayers()[0].feature.geometry;this.params.geometry=ap(aK);this.params.geometryType=aI(aK.type)}if(aK.toGeoJSON){aK=aK.toGeoJSON()}if(aK.type==="Feature"){aK=aK.geometry}if(aK.type==="Point"||aK.type==="LineString"||aK.type==="Polygon"||aK.type==="MultiPolygon"){this.params.geometry=ap(aK);this.params.geometryType=aI(aK.type);return}aF("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object");return}});function K(aK){return new R(aK)}var l=aC.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:true,returnGeometry:true,returnZ:true,returnM:false},layerDefs:function(aL,aK){this.params.layerDefs=(this.params.layerDefs)?this.params.layerDefs+";":"";this.params.layerDefs+=([aL,aK]).join(":");return this},simplify:function(aM,aL){var aK=Math.abs(aM.getBounds().getWest()-aM.getBounds().getEast());this.params.maxAllowableOffset=(aK/aM.getSize().y)*aL;return this},run:function(aL,aK){return this.request(function(aN,aM){aL.call(aK,aN,(aM&&r(aM)),aM)},aK)}});function aH(aK){return new l(aK)}var ax=aC.extend({path:"identify",between:function(aL,aK){this.params.time=[aL.valueOf(),aK.valueOf()];return this}});function ao(aK){return new ax(aK)}var au=ax.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:true},on:function(aM){var aL=aj(aM.getBounds());var aK=aM.getSize();this.params.imageDisplay=[aK.x,aK.y,96];this.params.mapExtent=[aL.xmin,aL.ymin,aL.xmax,aL.ymax];return this},at:function(aK){aK=S.latLng(aK);this.params.geometry=[aK.lng,aK.lat];this.params.geometryType="esriGeometryPoint";return this},layerDef:function(aL,aK){this.params.layerDefs=(this.params.layerDefs)?this.params.layerDefs+";":"";this.params.layerDefs+=([aL,aK]).join(":");return this},simplify:function(aM,aL){var aK=Math.abs(aM.getBounds().getWest()-aM.getBounds().getEast());this.params.maxAllowableOffset=(aK/aM.getSize().y)*aL;return this},run:function(aL,aK){return this.request(function(aN,aM){if(aN){aL.call(aK,aN,undefined,aM);return}else{var aQ=r(aM);aM.results=aM.results.reverse();for(var aP=0;aP<aQ.features.length;aP++){var aO=aQ.features[aP];aO.layerId=aM.results[aP].layerId}aL.call(aK,undefined,aQ,aM)}})}});function N(aK){return new au(aK)}var d=ax.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:false},at:function(aK){aK=S.latLng(aK);this.params.geometry=JSON.stringify({x:aK.lng,y:aK.lat,spatialReference:{wkid:4326}});this.params.geometryType="esriGeometryPoint";return this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(aL,aK){return this.request(function(aN,aM){aL.call(aK,aN,(aM&&this._responseToGeoJSON(aM)),aM)},this)},_responseToGeoJSON:function(aL){var aK=aL.location;var aN=aL.catalogItems;var aO=aL.catalogItemVisibilities;var aP={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[aK.x,aK.y]},crs:{type:"EPSG",properties:{code:aK.spatialReference.wkid}},properties:{OBJECTID:aL.objectId,name:aL.name,value:aL.value},id:aL.objectId}};if(aL.properties&&aL.properties.Values){aP.pixel.properties.values=aL.properties.Values}if(aN&&aN.features){aP.catalogItems=r(aN);if(aO&&aO.length===aP.catalogItems.features.length){for(var aM=aO.length-1;aM>=0;aM--){aP.catalogItems.features[aM].properties.catalogItemVisibility=aO[aM]}}}return aP}});function n(aK){return new d(aK)}var ae=S.Evented.extend({options:{proxy:false,useCors:aJ,timeout:0},initialize:function(aK){aK=aK||{};this._requestQueue=[];this._authenticating=false;S.Util.setOptions(this,aK);this.options.url=T(this.options.url)},get:function(aL,aM,aN,aK){return this._request("get",aL,aM,aN,aK)},post:function(aL,aM,aN,aK){return this._request("post",aL,aM,aN,aK)},request:function(aL,aM,aN,aK){return this._request("request",aL,aM,aN,aK)},metadata:function(aL,aK){return this._request("get","",{},aL,aK)},authenticate:function(aK){this._authenticating=false;this.options.token=aK;this._runQueue();return this},getTimeout:function(){return this.options.timeout},setTimeout:function(aK){this.options.timeout=aK},_request:function(aQ,aM,aO,aP,aL){this.fire("requeststart",{url:this.options.url+aM,params:aO,method:aQ},true);var aN=this._createServiceCallback(aQ,aM,aO,aP,aL);if(this.options.token){aO.token=this.options.token}if(this._authenticating){this._requestQueue.push([aQ,aM,aO,aP,aL]);return}else{var aK=(this.options.proxy)?this.options.proxy+"?"+this.options.url+aM:this.options.url+aM;if((aQ==="get"||aQ==="request")&&!this.options.useCors){return G.get.JSONP(aK,aO,aN,aL)}else{return G[aQ](aK,aO,aN,aL)}}},_createServiceCallback:function(aO,aL,aM,aN,aK){return S.Util.bind(function(aQ,aP){if(aQ&&(aQ.code===499||aQ.code===498)){this._authenticating=true;this._requestQueue.push([aO,aL,aM,aN,aK]);this.fire("authenticationrequired",{authenticate:S.Util.bind(this.authenticate,this)},true);aQ.authenticate=S.Util.bind(this.authenticate,this)}aN.call(aK,aQ,aP);if(aQ){this.fire("requesterror",{url:this.options.url+aL,params:aM,message:aQ.message,code:aQ.code,method:aO},true)}else{this.fire("requestsuccess",{url:this.options.url+aL,params:aM,response:aP,method:aO},true)}this.fire("requestend",{url:this.options.url+aL,params:aM,method:aO},true)},this)},_runQueue:function(){for(var aK=this._requestQueue.length-1;aK>=0;aK--){var aL=this._requestQueue[aK];var aM=aL.shift();this[aM].apply(this,aL)}this._requestQueue=[]}});function aG(aK){return new ae(aK)}var m=ae.extend({identify:function(){return N(this)},find:function(){return aH(this)},query:function(){return K(this)}});function f(aK){return new m(aK)}var ar=ae.extend({query:function(){return K(this)},identify:function(){return n(this)}});function P(aK){return new ar(aK)}var az=ae.extend({options:{idAttribute:"OBJECTID"},query:function(){return K(this)},addFeature:function(aL,aM,aK){delete aL.id;aL=ap(aL);return this.post("addFeatures",{features:[aL]},function(aP,aO){var aN=(aO&&aO.addResults)?aO.addResults[0]:undefined;if(aM){aM.call(aK,aP||aO.addResults[0].error,aN)}},aK)},updateFeature:function(aL,aM,aK){aL=ap(aL,this.options.idAttribute);return this.post("updateFeatures",{features:[aL]},function(aP,aO){var aN=(aO&&aO.updateResults)?aO.updateResults[0]:undefined;if(aM){aM.call(aK,aP||aO.updateResults[0].error,aN)}},aK)},deleteFeature:function(aM,aL,aK){return this.post("deleteFeatures",{objectIds:aM},function(aP,aO){var aN=(aO&&aO.deleteResults)?aO.deleteResults[0]:undefined;if(aL){aL.call(aK,aP||aO.deleteResults[0].error,aN)}},aK)},deleteFeatures:function(aL,aM,aK){return this.post("deleteFeatures",{objectIds:aL},function(aP,aO){var aN=(aO&&aO.deleteResults)?aO.deleteResults:undefined;if(aM){aM.call(aK,aP||aO.deleteResults[0].error,aN)}},aK)}});function ab(aK){return new az(aK)}var x=(window.location.protocol!=="https:")?"http:":"https:";var ad=S.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:x+"//{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:x+"//{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:x+"//{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:x+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane"}},NationalGeographic:{urlTemplate:x+"//{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:x+"//{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:x+"//{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:(a)?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:x+"//{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:x+"//{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:(a)?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:x+"//{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"}},ImageryLabels:{urlTemplate:x+"//{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:(a)?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane"}},ShadedRelief:{urlTemplate:x+"//{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:x+"//{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:(a)?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:x+"//{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:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:x+"//{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"}}}},initialize:function(aM,aL){var aK;if(typeof aM==="object"&&aM.urlTemplate&&aM.options){aK=aM}else{if(typeof aM==="string"&&ad.TILES[aM]){aK=ad.TILES[aM]}else{throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"')}}var aN=S.Util.extend(aK.options,aL);S.Util.setOptions(this,aN);if(this.options.token){aK.urlTemplate+=("?token="+this.options.token)}S.TileLayer.prototype.initialize.call(this,aK.urlTemplate,aN)},onAdd:function(aK){ay(aK);if(this.options.pane==="esri-labels"){this._initPane()}if(this.options.attributionUrl){V(this.options.attributionUrl,aK)}aK.on("moveend",aB);S.TileLayer.prototype.onAdd.call(this,aK)},onRemove:function(aK){aK.off("moveend",aB);S.TileLayer.prototype.onRemove.call(this,aK)},_initPane:function(){if(!this._map.getPane(this.options.pane)){var aK=this._map.createPane(this.options.pane);aK.style.pointerEvents="none";aK.style.zIndex=500}},getAttribution:function(){if(this.options.attribution){var aK='<span class="esri-dynamic-attribution">'+this.options.attribution+"</span>"}return aK}});function w(aL,aK){return new ad(aL,aK)}var q=S.TileLayer.extend({options:{zoomOffsetAllowance:0.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":0.597164283559817,"19":0.298582141647617,"20":0.14929107082381,"21":0.07464553541191,"22":0.0373227677059525,"23":0.0186613838529763}},initialize:function(aK){aK.url=T(aK.url);aK=S.Util.setOptions(this,aK);this.tileUrl=aK.url+"tile/{z}/{y}/{x}";this.service=f(aK);this.service.addEventParent(this);var aL=new RegExp(/tiles.arcgis(online)?\.com/g);if(aL.test(aK.url)){this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}");aK.subdomains=["1","2","3","4"]}if(this.options.token){this.tileUrl+=("?token="+this.options.token)}S.TileLayer.prototype.initialize.call(this,this.tileUrl,aK)},getTileUrl:function(aK){var aL=this._getZoomForUrl();return S.Util.template(this.tileUrl,S.Util.extend({s:this._getSubdomain(aK),x:aK.x,y:aK.y,z:(this._lodMap&&this._lodMap[aL])?this._lodMap[aL]:aL},this.options))},createTile:function(aM,aK){var aL=document.createElement("img");L.DomEvent.on(aL,"load",L.bind(this._tileOnLoad,this,aK,aL));L.DomEvent.on(aL,"error",L.bind(this._tileOnError,this,aK,aL));if(this.options.crossOrigin){aL.crossOrigin=""}aL.alt="";if(!this._lodMap||(this._lodMap&&this._lodMap[this._getZoomForUrl()])){aL.src=this.getTileUrl(aM)}else{this.once("lodmap",function(){aL.src=this.getTileUrl(aM)},this)}return aL},onAdd:function(aK){ay(aK);if(!this._lodMap){this.metadata(function(aP,aQ){if(!aP&&aQ.spatialReference){var aL=aQ.spatialReference.latestWkid||aQ.spatialReference.wkid;if(!this.options.attribution&&aK.attributionControl&&aQ.copyrightText){this.options.attribution=aQ.copyrightText;aK.attributionControl.addAttribution(this.getAttribution())}if(aK.options.crs===L.CRS.EPSG3857&&aL===102100||aL===3857){this._lodMap={};var aM=aQ.tileInfo.lods;var aN=q.MercatorZoomLevels;for(var aO=0;aO<aM.length;aO++){var aR=aM[aO];for(var aT in aN){var aS=aN[aT];if(this._withinPercentage(aR.resolution,aS,this.options.zoomOffsetAllowance)){this._lodMap[aT]=aR.level;break}}}this.fire("lodmap")}else{if(!proj4){aF("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")}}}},this)}S.TileLayer.prototype.onAdd.call(this,aK)},metadata:function(aL,aK){this.service.metadata(aL,aK);return this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(aK){var aL="?token="+aK;this.tileUrl=(this.options.token)?this.tileUrl.replace(/\?token=(.+)/g,aL):this.tileUrl+aL;this.options.token=aK;this.service.authenticate(aK);return this},_withinPercentage:function(aM,aK,aL){var aN=Math.abs((aM/aK)-1);return aN<aL}});function U(aL,aK){return new q(aL,aK)}var M=S.ImageOverlay.extend({onAdd:function(aK){this._topLeft=aK.getPixelBounds().min;S.ImageOverlay.prototype.onAdd.call(this,aK)},_reset:function(){if(this._map.options.crs===S.CRS.EPSG3857){S.ImageOverlay.prototype._reset.call(this)}else{S.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}});var aw=S.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:aJ,attribution:null,interactive:false,alt:""},onAdd:function(aK){ay(aK);this._update=S.Util.throttle(this._update,this.options.updateInterval,this);aK.on("moveend",this._update,this);if(this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())){aK.addLayer(this._currentImage)}else{if(this._currentImage){this._map.removeLayer(this._currentImage);this._currentImage=null}}this._update();if(this._popup){this._map.on("click",this._getPopupData,this);this._map.on("dblclick",this._resetPopupState,this)}this.metadata(function(aM,aL){if(!aM&&!this.options.attribution&&aK.attributionControl&&aL.copyrightText){this.options.attribution=aL.copyrightText;aK.attributionControl.addAttribution(this.getAttribution())}},this)},onRemove:function(aK){if(this._currentImage){this._map.removeLayer(this._currentImage)}if(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(aK,aL){this._shouldRenderPopup=false;this._lastClick=false;this._popup=S.popup(aL);this._popupFunction=aK;if(this._map){this._map.on("click",this._getPopupData,this);this._map.on("dblclick",this._resetPopupState,this)}return this},unbindPopup:function(){if(this._map){this._map.closePopup(this._popup);this._map.off("click",this._getPopupData,this);this._map.off("dblclick",this._resetPopupState,this)}this._popup=false;return this},bringToFront:function(){this.options.position="front";if(this._currentImage){this._currentImage.bringToFront()}return this},bringToBack:function(){this.options.position="back";if(this._currentImage){this._currentImage.bringToBack()}return this},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(aK){this.options.opacity=aK;if(this._currentImage){this._currentImage.setOpacity(aK)}return this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(aL,aK){this.options.from=aL;this.options.to=aK;this._update();return this},metadata:function(aL,aK){this.service.metadata(aL,aK);return this},authenticate:function(aK){this.service.authenticate(aK);return this},redraw:function(){this._update()},_renderImage:function(aK,aL,aN){if(this._map){if(aN){aK="data:"+aN+";base64,"+aK}var aM=new M(aK,aL,{opacity:0,crossOrigin:this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map);aM.once("load",function(aP){if(this._map){var aQ=aP.target;var aO=this._currentImage;if(aQ._bounds.equals(aL)&&aQ._bounds.equals(this._map.getBounds())){this._currentImage=aQ;if(this.options.position==="front"){this.bringToFront()}else{this.bringToBack()}if(this._map&&this._currentImage._map){this._currentImage.setOpacity(this.options.opacity)}else{this._currentImage._map.removeLayer(this._currentImage)}if(aO&&this._map){this._map.removeLayer(aO)}if(aO&&aO._map){aO._map.removeLayer(aO)}}else{this._map.removeLayer(aQ)}}this.fire("load",{bounds:aL})},this);this.fire("loading",{bounds:aL})}},_update:function(){if(!this._map){return}var aL=this._map.getZoom();var aK=this._map.getBounds();if(this._animatingZoom){return}if(this._map._panTransition&&this._map._panTransition._inProgress){return}if(aL>this.options.maxZoom||aL<this.options.minZoom){if(this._currentImage){this._currentImage._map.removeLayer(this._currentImage);this._currentImage=null}return}var aM=this._buildExportParams();this._requestExport(aM,aK)},_renderPopup:function(aO,aL,aM,aK){aO=S.latLng(aO);if(this._shouldRenderPopup&&this._lastClick.equals(aO)){var aN=this._popupFunction(aL,aM,aK);if(aN){this._popup.setLatLng(aO).setContent(aN).openOn(this._map)}}},_resetPopupState:function(aK){this._shouldRenderPopup=false;this._lastClick=aK.latlng}});var at=aw.extend({options:{updateInterval:150,format:"jpgpng",transparent:true,f:"json"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(aK){aK.url=T(aK.url);this.service=P(aK);this.service.addEventParent(this);S.Util.setOptions(this,aK)},setPixelType:function(aK){this.options.pixelType=aK;this._update();return this},getPixelType:function(){return this.options.pixelType},setBandIds:function(aK){if(S.Util.isArray(aK)){this.options.bandIds=aK.join(",")}else{this.options.bandIds=aK.toString()}this._update();return this},getBandIds:function(){return this.options.bandIds},setNoData:function(aK,aL){if(S.Util.isArray(aK)){this.options.noData=aK.join(",")}else{this.options.noData=aK.toString()}if(aL){this.options.noDataInterpretation=aL}this._update();return this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(aK){this.options.renderingRule=aK;this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(aK){this.options.mosaicRule=aK;this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(aL){var aM=S.Util.bind(function(aO,aP,aN){if(aO){return}setTimeout(S.Util.bind(function(){this._renderPopup(aL.latlng,aO,aP,aN)},this),300)},this);var aK=this.identify().at(aL.latlng);if(this.options.mosaicRule){aK.setMosaicRule(this.options.mosaicRule)}aK.run(aM);this._shouldRenderPopup=true;this._lastClick=aL.latlng},_buildExportParams:function(){var aO=this._map.getBounds();var aM=this._map.getSize();var aQ=this._map.options.crs.project(aO._northEast);var aK=this._map.options.crs.project(aO._southWest);var aP=this._map.latLngToLayerPoint(aO._northEast);var aL=this._map.latLngToLayerPoint(aO._southWest);if(aP.y>0||aL.y<aM.y){aM.y=aL.y-aP.y}var aN=parseInt(this._map.options.crs.code.split(":")[1],10);var aR={bbox:[aK.x,aK.y,aQ.x,aQ.y].join(","),size:aM.x+","+aM.y,format:this.options.format,transparent:this.options.transparent,bboxSR:aN,imageSR:aN};if(this.options.from&&this.options.to){aR.time=this.options.from.valueOf()+","+this.options.to.valueOf()}if(this.options.pixelType){aR.pixelType=this.options.pixelType}if(this.options.interpolation){aR.interpolation=this.options.interpolation}if(this.options.compressionQuality){aR.compressionQuality=this.options.compressionQuality}if(this.options.bandIds){aR.bandIds=this.options.bandIds}if(this.options.noData){aR.noData=this.options.noData}if(this.options.noDataInterpretation){aR.noDataInterpretation=this.options.noDataInterpretation}if(this.service.options.token){aR.token=this.service.options.token}if(this.options.renderingRule){aR.renderingRule=JSON.stringify(this.options.renderingRule)}if(this.options.mosaicRule){aR.mosaicRule=JSON.stringify(this.options.mosaicRule)}return aR},_requestExport:function(aL,aK){if(this.options.f==="json"){this.service.request("exportImage",aL,function(aN,aM){if(aN){return}if(this.options.token){aM.href+=("?token="+this.options.token)}this._renderImage(aM.href,aK)},this)}else{aL.f="image";this._renderImage(this.options.url+"exportImage"+S.Util.getParamString(aL),aK)}}});function j(aL,aK){return new at(aL,aK)}var J=aw.extend({options:{updateInterval:150,layers:false,layerDefs:false,timeOptions:false,format:"png24",transparent:true,f:"json"},initialize:function(aK){aK.url=T(aK.url);this.service=f(aK);this.service.addEventParent(this);if((aK.proxy||aK.token)&&aK.f!=="json"){aK.f="json"}S.Util.setOptions(this,aK)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(aK){this.options.dynamicLayers=aK;this._update();return this},getLayers:function(){return this.options.layers},setLayers:function(aK){this.options.layers=aK;this._update();return this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(aK){this.options.layerDefs=aK;this._update();return this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(aK){this.options.timeOptions=aK;this._update();return this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(aL){var aM=S.Util.bind(function(aO,aP,aN){if(aO){return}setTimeout(S.Util.bind(function(){this._renderPopup(aL.latlng,aO,aP,aN)},this),300)},this);var aK=this.identify().on(this._map).at(aL.latlng);aK.simplify(this._map,0.5);if(this.options.layers){aK.layers("visible:"+this.options.layers.join(","))}else{aK.layers("visible")}aK.run(aM);this._shouldRenderPopup=true;this._lastClick=aL.latlng},_buildExportParams:function(){var aO=this._map.getBounds();var aM=this._map.getSize();var aQ=this._map.options.crs.project(aO.getNorthEast());var aK=this._map.options.crs.project(aO.getSouthWest());var aN=parseInt(this._map.options.crs.code.split(":")[1],10);var aP=this._map.latLngToLayerPoint(aO._northEast);var aL=this._map.latLngToLayerPoint(aO._southWest);if(aP.y>0||aL.y<aM.y){aM.y=aL.y-aP.y}var aR={bbox:[aK.x,aK.y,aQ.x,aQ.y].join(","),size:aM.x+","+aM.y,dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:aN,imageSR:aN};if(this.options.dynamicLayers){aR.dynamicLayers=this.options.dynamicLayers}if(this.options.layers){aR.layers="show:"+this.options.layers.join(",")}if(this.options.layerDefs){aR.layerDefs=typeof this.options.layerDefs==="string"?this.options.layerDefs:JSON.stringify(this.options.layerDefs)}if(this.options.timeOptions){aR.timeOptions=JSON.stringify(this.options.timeOptions)}if(this.options.from&&this.options.to){aR.time=this.options.from.valueOf()+","+this.options.to.valueOf()}if(this.service.options.token){aR.token=this.service.options.token}if(this.options.proxy){aR.proxy=this.options.proxy}return aR},_requestExport:function(aL,aK){if(this.options.f==="json"){this.service.request("export",aL,function(aN,aM){if(aN){return}if(this.options.token){aM.href+=("?token="+this.options.token)}if(this.options.proxy){aM.href=this.options.proxy+"?"+aM.href}if(aM.href){this._renderImage(aM.href,aK)}else{this._renderImage(aM.imageData,aK,aM.contentType)}},this)}else{aL.f="image";this._renderImage(this.options.url+"export"+S.Util.getParamString(aL),aK)}}});function aq(aL,aK){return new J(aL,aK)}var Z=Y.Layer.extend({options:{cellSize:512,updateInterval:150},initialize:function(aK){aK=Y.setOptions(this,aK);this._zooming=false},onAdd:function(aK){this._map=aK;this._update=Y.Util.throttle(this._update,this.options.updateInterval,this);this._reset();this._update()},onRemove:function(){this._map.removeEventListener(this.getEvents(),this);this._removeCells()},getEvents:function(){var aK={moveend:this._update,zoomstart:this._zoomstart,zoomend:this._reset};return aK},addTo:function(aK){aK.addLayer(this);return this},removeFrom:function(aK){aK.removeLayer(this);return this},_zoomstart:function(){this._zooming=true},_reset:function(){this._removeCells();this._cells={};this._activeCells={};this._cellsToLoad=0;this._cellsTotal=0;this._cellNumBounds=this._getCellNumBounds();this._resetWrap();this._zooming=false},_resetWrap:function(){var aL=this._map;var aK=aL.options.crs;if(aK.infinite){return}var aM=this._getCellSize();if(aK.wrapLng){this._wrapLng=[Math.floor(aL.project([0,aK.wrapLng[0]]).x/aM),Math.ceil(aL.project([0,aK.wrapLng[1]]).x/aM)]}if(aK.wrapLat){this._wrapLat=[Math.floor(aL.project([aK.wrapLat[0],0]).y/aM),Math.ceil(aL.project([aK.wrapLat[1],0]).y/aM)]}},_getCellSize:function(){return this.options.cellSize},_update:function(){if(!this._map){return}var aL=this._map.getPixelBounds();var aM=this._getCellSize();var aK=Y.bounds(aL.min.divideBy(aM).floor(),aL.max.divideBy(aM).floor());this._removeOtherCells(aK);this._addCells(aK);this.fire("cellsupdated")},_addCells:function(aQ){var aM=[];var aL=aQ.getCenter();var aP=this._map.getZoom();var aN,aO,aR;for(aN=aQ.min.y;aN<=aQ.max.y;aN++){for(aO=aQ.min.x;aO<=aQ.max.x;aO++){aR=Y.point(aO,aN);aR.z=aP;if(this._isValidCell(aR)){aM.push(aR)}}}var aK=aM.length;if(aK===0){return}this._cellsToLoad+=aK;this._cellsTotal+=aK;aM.sort(function(aT,aS){return aT.distanceTo(aL)-aS.distanceTo(aL)});for(aO=0;aO<aK;aO++){this._addCell(aM[aO])}},_isValidCell:function(aN){var aK=this._map.options.crs;if(!aK.infinite){var aM=this._cellNumBounds;if((!aK.wrapLng&&(aN.x<aM.min.x||aN.x>aM.max.x))||(!aK.wrapLat&&(aN.y<aM.min.y||aN.y>aM.max.y))){return false}}if(!this.options.bounds){return true}var aL=this._cellCoordsToBounds(aN);return Y.latLngBounds(this.options.bounds).intersects(aL)},_cellCoordsToBounds:function(aO){var aP=this._map;var aQ=this.options.cellSize;var aM=aO.multiplyBy(aQ);var aK=aM.add([aQ,aQ]);var aL=aP.wrapLatLng(aP.unproject(aM,aO.z));var aN=aP.wrapLatLng(aP.unproject(aK,aO.z));return Y.latLngBounds(aL,aN)},_cellCoordsToKey:function(aK){return aK.x+":"+aK.y},_keyToCellCoords:function(aL){var aM=aL.split(":");var aK=parseInt(aM[0],10);var aN=parseInt(aM[1],10);return Y.point(aK,aN)},_removeOtherCells:function(aL){for(var aK in this._cells){if(!aL.contains(this._keyToCellCoords(aK))){this._removeCell(aK)}}},_removeCell:function(aL){var aK=this._activeCells[aL];if(aK){delete this._activeCells[aL];if(this.cellLeave){this.cellLeave(aK.bounds,aK.coords)}this.fire("cellleave",{bounds:aK.bounds,coords:aK.coords})}},_removeCells:function(){for(var aK in this._cells){var aL=this._cells[aK].bounds;var aM=this._cells[aK].coords;if(this.cellLeave){this.cellLeave(aL,aM)}this.fire("cellleave",{bounds:aL,coords:aM})}},_addCell:function(aM){this._wrapCoords(aM);var aL=this._cellCoordsToKey(aM);var aK=this._cells[aL];if(aK&&!this._activeCells[aL]){if(this.cellEnter){this.cellEnter(aK.bounds,aM)}this.fire("cellenter",{bounds:aK.bounds,coords:aM});this._activeCells[aL]=aK}if(!aK){aK={coords:aM,bounds:this._cellCoordsToBounds(aM)};this._cells[aL]=aK;this._activeCells[aL]=aK;if(this.createCell){this.createCell(aK.bounds,aM)}this.fire("cellcreate",{bounds:aK.bounds,coords:aM})}},_wrapCoords:function(aK){aK.x=this._wrapLng?Y.Util.wrapNum(aK.x,this._wrapLng):aK.x;aK.y=this._wrapLat?Y.Util.wrapNum(aK.y,this._wrapLat):aK.y},_getCellNumBounds:function(){var aL=this._map.getPixelWorldBounds();var aK=this._getCellSize();return aL?Y.bounds(aL.min.divideBy(aK).floor(),aL.max.divideBy(aK).ceil().subtract([1,1])):null}});function aa(aK){this.values=[].concat(aK||[])}aa.prototype.query=function(aL){var aK=this.getIndex(aL);return this.values[aK]};aa.prototype.getIndex=function i(aO){if(this.dirty){this.sort()}var aM=0;var aN=this.values.length-1;var aK;var aL;while(aM<=aN){aK=(aM+aN)/2|0;aL=this.values[Math.round(aK)];if(+aL.value<+aO){aM=aK+1}else{if(+aL.value>+aO){aN=aK-1}else{return aK}}}return Math.abs(~aN)};aa.prototype.between=function H(aN,aK){var aM=this.getIndex(aN);var aL=this.getIndex(aK);if(aM===0&&aL===0){return[]}while(this.values[aM-1]&&this.values[aM-1].value===aN){aM--}while(this.values[aL+1]&&this.values[aL+1].value===aK){aL++}if(this.values[aL]&&this.values[aL].value===aK&&this.values[aL+1]){aL++}return this.values.slice(aM,aL)};aa.prototype.insert=function B(aK){this.values.splice(this.getIndex(aK.value),0,aK);return this};aa.prototype.bulkAdd=function A(aK,aL){this.values=this.values.concat([].concat(aK||[]));if(aL){this.sort()}else{this.dirty=true}return this};aa.prototype.sort=function F(){this.values.sort(function(aL,aK){return +aK.value-+aL.value}).reverse();this.dirty=false;return this};var av=Z.extend({options:{attribution:null,where:"1=1",fields:["*"],from:false,to:false,timeField:false,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(aK){Z.prototype.initialize.call(this,aK);aK.url=T(aK.url);aK=S.setOptions(this,aK);this.service=ab(aK);this.service.addEventParent(this);if(this.options.fields[0]!=="*"){var aM=false;for(var aL=0;aL<this.options.fields.length;aL++){if(this.options.fields[aL].match(/^(OBJECTID|FID|OID|ID)$/i)){aM=true}}if(aM===false){aF("no known esriFieldTypeOID field detected in fields Array.  Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}}if(this.options.timeField.start&&this.options.timeField.end){this._startTimeIndex=new aa();this._endTimeIndex=new aa()}else{if(this.options.timeField){this._timeIndex=new aa()}}this._cache={};this._currentSnapshot=[];this._activeRequests=0},onAdd:function(aK){ay(aK);this.service.metadata(function(aM,aL){if(!aM){var aO=aL.supportedQueryFormats;var aN=false;if(this.service.options.isModern===false){aN=true}if(!aN&&aO&&aO.indexOf("geoJSON")!==-1){this.service.options.isModern=true}if(!this.options.attribution&&aK.attributionControl&&aL.copyrightText){this.options.attribution=aL.copyrightText;aK.attributionControl.addAttribution(this.getAttribution())}}},this);aK.on("zoomend",this._handleZoomChange,this);return Z.prototype.onAdd.call(this,aK)},onRemove:function(aK){aK.off("zoomend",this._handleZoomChange,this);return Z.prototype.onRemove.call(this,aK)},getAttribution:function(){return this.options.attribution},createCell:function(aK,aL){if(this._visibleZoom()){this._requestFeatures(aK,aL)}},_requestFeatures:function(aK,aL,aM){this._activeRequests++;if(this._activeRequests===1){this.fire("loading",{bounds:aK},true)}return this._buildQuery(aK).run(function(aO,aP,aN){if(aN&&aN.exceededTransferLimit){this.fire("drawlimitexceeded")}if(!aO&&aP&&aP.features.length){S.Util.requestAnimFrame(S.Util.bind(function(){this._addFeatures(aP.features,aL);this._postProcessFeatures(aK)},this))}if(!aO&&aP&&!aP.features.length){this._postProcessFeatures(aK)}if(aO){this._postProcessFeatures(aK)}if(aM){aM.call(this,aO,aP)}},this)},_postProcessFeatures:function(aK){this._activeRequests--;if(this._activeRequests<=0){this.fire("load",{bounds:aK})}},_cacheKey:function(aK){return aK.z+":"+aK.x+":"+aK.y},_addFeatures:function(aM,aN){var aL=this._cacheKey(aN);this._cache[aL]=this._cache[aL]||[];for(var aK=aM.length-1;aK>=0;aK--){var aO=aM[aK].id;if(this._currentSnapshot.indexOf(aO)===-1){this._currentSnapshot.push(aO)}if(this._cache[aL].indexOf(aO)===-1){this._cache[aL].push(aO)}}if(this.options.timeField){this._buildTimeIndexes(aM)}this.createLayers(aM)},_buildQuery:function(aK){var aL=this.service.query().intersects(aK).where(this.options.where).fields(this.options.fields).precision(this.options.precision);if(this.options.simplifyFactor){aL.simplify(this._map,this.options.simplifyFactor)}if(this.options.timeFilterMode==="server"&&this.options.from&&this.options.to){aL.between(this.options.from,this.options.to)}return aL},setWhere:function(aP,aU,aL){this.options.where=(aP&&aP.length)?aP:"1=1";var aN=[];var aT=[];var aM=0;var aR=null;var aV=S.Util.bind(function(aW,aY){if(aW){aR=aW}if(aY){for(var aX=aY.features.length-1;aX>=0;aX--){aT.push(aY.features[aX].id)}}aM--;if(aM<=0){this._currentSnapshot=aT;S.Util.requestAnimFrame(S.Util.bind(function(){this.removeLayers(aN);this.addLayers(aT);if(aU){aU.call(aL,aR)}},this))}},this);for(var aO=this._currentSnapshot.length-1;aO>=0;aO--){aN.push(this._currentSnapshot[aO])}for(var aS in this._activeCells){aM++;var aQ=this._keyToCellCoords(aS);var aK=this._cellCoordsToBounds(aQ);this._requestFeatures(aK,aS,aV)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(aO,aP,aU,aL){var aT=this.options.from;var aS=this.options.to;var aM=0;var aQ=null;var aV=S.Util.bind(function(aW){if(aW){aQ=aW}this._filterExistingFeatures(aT,aS,aO,aP);aM--;if(aU&&aM<=0){aU.call(aL,aQ)}},this);this.options.from=aO;this.options.to=aP;this._filterExistingFeatures(aT,aS,aO,aP);if(this.options.timeFilterMode==="server"){for(var aR in this._activeCells){aM++;var aN=this._keyToCellCoords(aR);var aK=this._cellCoordsToBounds(aN);this._requestFeatures(aK,aR,aV)}}return this},refresh:function(){for(var aK in this._activeCells){var aM=this._keyToCellCoords(aK);var aL=this._cellCoordsToBounds(aM);this._requestFeatures(aL,aK)}if(this.redraw){this.once("load",function(){this.eachFeature(function(aN){this._redraw(aN.feature.id)},this)},this)}},_filterExistingFeatures:function(aL,aR,aP,aM){var aO=(aL&&aR)?this._getFeaturesInTimeRange(aL,aR):this._currentSnapshot;var aQ=this._getFeaturesInTimeRange(aP,aM);if(aQ.indexOf){for(var aN=0;aN<aQ.length;aN++){var aK=aO.indexOf(aQ[aN]);if(aK>=0){aO.splice(aK,1)}}}S.Util.requestAnimFrame(S.Util.bind(function(){this.removeLayers(aO);this.addLayers(aQ)},this))},_getFeaturesInTimeRange:function(aQ,aK){var aP=[];var aO;if(this.options.timeField.start&&this.options.timeField.end){var aN=this._startTimeIndex.between(aQ,aK);var aL=this._endTimeIndex.between(aQ,aK);aO=aN.concat(aL)}else{aO=this._timeIndex.between(aQ,aK)}for(var aM=aO.length-1;aM>=0;aM--){aP.push(aO[aM].id)}return aP},_buildTimeIndexes:function(aL){var aO;var aN;if(this.options.timeField.start&&this.options.timeField.end){var aP=[];var aK=[];for(aO=aL.length-1;aO>=0;aO--){aN=aL[aO];aP.push({id:aN.id,value:new Date(aN.properties[this.options.timeField.start])});aK.push({id:aN.id,value:new Date(aN.properties[this.options.timeField.end])})}this._startTimeIndex.bulkAdd(aP);this._endTimeIndex.bulkAdd(aK)}else{var aM=[];for(aO=aL.length-1;aO>=0;aO--){aN=aL[aO];aM.push({id:aN.id,value:new Date(aN.properties[this.options.timeField])})}this._timeIndex.bulkAdd(aM)}},_featureWithinTimeRange:function(aM){if(!this.options.from||!this.options.to){return true}var aP=+this.options.from.valueOf();var aO=+this.options.to.valueOf();if(typeof this.options.timeField==="string"){var aL=+aM.properties[this.options.timeField];return(aL>=aP)&&(aL<=aO)}if(this.options.timeField.start&&this.options.timeField.end){var aK=+aM.properties[this.options.timeField.start];var aN=+aM.properties[this.options.timeField.end];return((aK>=aP)&&(aK<=aO))||((aN>=aP)&&(aN<=aO))}},_visibleZoom:function(){if(!this._map){return false}var aK=this._map.getZoom();if(aK>this.options.maxZoom||aK<this.options.minZoom){return false}else{return true}},_handleZoomChange:function(){if(!this._visibleZoom()){this.removeLayers(this._currentSnapshot);this._currentSnapshot=[]}else{for(var aL in this._activeCells){var aM=this._activeCells[aL].coords;var aK=this._cacheKey(aM);if(this._cache[aK]){this.addLayers(this._cache[aK])}}}},authenticate:function(aK){this.service.authenticate(aK);return this},metadata:function(aL,aK){this.service.metadata(aL,aK);return this},query:function(){return this.service.query()},_getMetadata:function(aL){if(this._metadata){var aK;aL(aK,this._metadata)}else{this.metadata(S.Util.bind(function(aN,aM){this._metadata=aM;aL(aN,this._metadata)},this))}},addFeature:function(aL,aM,aK){this._getMetadata(S.Util.bind(function(aN,aO){if(aN){if(aM){aM.call(this,aN,null)}return}this.service.addFeature(aL,S.Util.bind(function(aQ,aP){if(!aQ){aL.properties[aO.objectIdField]=aP.objectId;aL.id=aP.objectId;this.createLayers([aL])}if(aM){aM.call(aK,aQ,aP)}},this))},this))},updateFeature:function(aL,aM,aK){this.service.updateFeature(aL,function(aO,aN){if(!aO){this.removeLayers([aL.id],true);this.createLayers([aL])}if(aM){aM.call(aK,aO,aN)}},this)},deleteFeature:function(aM,aL,aK){this.service.deleteFeature(aM,function(aO,aN){if(!aO&&aN.objectId){this.removeLayers([aN.objectId],true)}if(aL){aL.call(aK,aO,aN)}},this)},deleteFeatures:function(aL,aM,aK){return this.service.deleteFeatures(aL,function(aO,aN){if(!aO&&aN.length>0){for(var aP=0;aP<aN.length;aP++){this.removeLayers([aN[aP].objectId],true)}}if(aM){aM.call(aK,aO,aN)}},this)}});var ai=av.extend({options:{cacheLayers:true},initialize:function(aK){av.prototype.initialize.call(this,aK);this._originalStyle=this.options.style;this._layers={}},onRemove:function(aL){for(var aK in this._layers){aL.removeLayer(this._layers[aK]);this.fire("removefeature",{feature:this._layers[aK].feature,permanent:false},true)}return av.prototype.onRemove.call(this,aL)},createNewLayer:function(aK){var aL=S.GeoJSON.geometryToLayer(aK,this.options);aL.defaultOptions=aL.options;return aL},_updateLayer:function(aM,aL){var aK=[];var aN=this.options.coordsToLatLng||S.GeoJSON.coordsToLatLng;if(aL.properties){aM.feature.properties=aL.properties}switch(aL.geometry.type){case"Point":aK=S.GeoJSON.coordsToLatLng(aL.geometry.coordinates);aM.setLatLng(aK);break;case"LineString":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,0,aN);aM.setLatLngs(aK);break;case"MultiLineString":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,1,aN);aM.setLatLngs(aK);break;case"Polygon":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,1,aN);aM.setLatLngs(aK);break;case"MultiPolygon":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,2,aN);aM.setLatLngs(aK);break}},createLayers:function(aO){for(var aM=aO.length-1;aM>=0;aM--){var aK=aO[aM];var aL=this._layers[aK.id];var aN;if(this._visibleZoom()&&aL&&!this._map.hasLayer(aL)){this._map.addLayer(aL);this.fire("addfeature",{feature:aL.feature},true)}if(aL&&this.options.simplifyFactor>0&&(aL.setLatLngs||aL.setLatLng)){this._updateLayer(aL,aK)}if(!aL){aN=this.createNewLayer(aK);aN.feature=aK;aN.addEventParent(this);if(this.options.onEachFeature){this.options.onEachFeature(aN.feature,aN)}this._layers[aN.feature.id]=aN;this.setFeatureStyle(aN.feature.id,this.options.style);this.fire("createfeature",{feature:aN.feature},true);if(this._visibleZoom()&&(!this.options.timeField||(this.options.timeField&&this._featureWithinTimeRange(aK)))){this._map.addLayer(aN)}}}},addLayers:function(aM){for(var aL=aM.length-1;aL>=0;aL--){var aK=this._layers[aM[aL]];if(aK){this._map.addLayer(aK)}}},removeLayers:function(aM,aN){for(var aL=aM.length-1;aL>=0;aL--){var aO=aM[aL];var aK=this._layers[aO];if(aK){this.fire("removefeature",{feature:aK.feature,permanent:aN},true);this._map.removeLayer(aK)}if(aK&&aN){delete this._layers[aO]}}},cellEnter:function(aK,aL){if(this._visibleZoom()&&!this._zooming&&this._map){S.Util.requestAnimFrame(S.Util.bind(function(){var aN=this._cacheKey(aL);var aO=this._cellCoordsToKey(aL);var aM=this._cache[aN];if(this._activeCells[aO]&&aM){this.addLayers(aM)}},this))}},cellLeave:function(aK,aL){if(!this._zooming){S.Util.requestAnimFrame(S.Util.bind(function(){if(this._map){var aR=this._cacheKey(aL);var aS=this._cellCoordsToKey(aL);var aQ=this._cache[aR];var aM=this._map.getBounds();if(!this._activeCells[aS]&&aQ){var aN=true;for(var aP=0;aP<aQ.length;aP++){var aO=this._layers[aQ[aP]];if(aO&&aO.getBounds&&aM.intersects(aO.getBounds())){aN=false}}if(aN){this.removeLayers(aQ,!this.options.cacheLayers)}if(!this.options.cacheLayers&&aN){delete this._cache[aR];delete this._cells[aS];delete this._activeCells[aS]}}}},this))}},resetStyle:function(){this.options.style=this._originalStyle;this.eachFeature(function(aK){this.resetFeatureStyle(aK.feature.id)},this);return this},setStyle:function(aK){this.options.style=aK;this.eachFeature(function(aL){this.setFeatureStyle(aL.feature.id,aK)},this);return this},resetFeatureStyle:function(aM){var aK=this._layers[aM];var aL=this._originalStyle||L.Path.prototype.options;if(aK){S.Util.extend(aK.options,aK.defaultOptions);this.setFeatureStyle(aM,aL)}return this},setFeatureStyle:function(aM,aL){var aK=this._layers[aM];if(typeof aL==="function"){aL=aL(aK.feature)}if(aK.setStyle){aK.setStyle(aL)}return this},eachActiveFeature:function(aM,aL){if(this._map){var aN=this._map.getBounds();for(var aK in this._layers){if(aN.intersects(this._layers[aK].getBounds())&&this._currentSnapshot.indexOf(this._layers[aK].feature.id)!==-1){aM.call(aL,this._layers[aK])}}}return this},eachFeature:function(aM,aL){for(var aK in this._layers){aM.call(aL,this._layers[aK])}return this},getFeature:function(aK){return this._layers[aK]},bringToBack:function(){this.eachFeature(function(aK){if(aK.bringToBack){aK.bringToBack()}})},bringToFront:function(){this.eachFeature(function(aK){if(aK.bringToFront){aK.bringToFront()}})},redraw:function(aK){if(aK){this._redraw(aK)}return this},_redraw:function(aQ){var aN=this._layers[aQ];var aM=aN.feature;if(aN&&aN.setIcon&&this.options.pointToLayer){if(this.options.pointToLayer){var aP=this.options.pointToLayer(aM,S.latLng(aM.geometry.coordinates[1],aM.geometry.coordinates[0]));var aO=aP.options.icon;aN.setIcon(aO)}}if(aN&&aN.setStyle&&this.options.pointToLayer){var aK=this.options.pointToLayer(aM,S.latLng(aM.geometry.coordinates[1],aM.geometry.coordinates[0]));var aL=aK.options;this.setFeatureStyle(aM.id,aL)}if(aN&&aN.setStyle&&this.options.style){this.resetStyle(aM.id)}}});function E(aK){return new ai(aK)}O.VERSION=s;O.Support=ag;O.options=W;O.Util=X;O.get=al;O.post=aA;O.request=ah;O.Task=aC;O.task=am;O.Query=R;O.query=K;O.Find=l;O.find=aH;O.Identify=ax;O.identify=ao;O.IdentifyFeatures=au;O.identifyFeatures=N;O.IdentifyImage=d;O.identifyImage=n;O.Service=ae;O.service=aG;O.MapService=m;O.mapService=f;O.ImageService=ar;O.imageService=P;O.FeatureLayerService=az;O.featureLayerService=ab;O.BasemapLayer=ad;O.basemapLayer=w;O.TiledMapLayer=q;O.tiledMapLayer=U;O.RasterLayer=aw;O.ImageMapLayer=at;O.imageMapLayer=j;O.DynamicMapLayer=J;O.dynamicMapLayer=aq;O.FeatureManager=av;O.FeatureLayer=ai;O.featureLayer=E}));
\ No newline at end of file