
(function(){var _1=function(){var _2=function(){var _3=parseFloat(navigator.appVersion.split("MSIE ")[1])||0;var _4=4326;var _5=102113;var _6=[102113,102100,3857];var _7="{*}";var _8="kmz";var _9="json";var _a=256;var _b=256;var _c=0;var _d=19;var _e=[156543.039989205,78271.5200078317,39135.7599906866,19567.880000635,9783.9400003175,4891.96999883583,2445.98499994708,1222.99250010583,611.496250052917,305.748124894166,152.8740625,76.4370312632292,38.2185156316146,19.1092578131615,9.55462890525781,4.77731445262891,2.38865722657904,1.19432861315723,0.597164306578613,0.298582153289307];var _f=window.GBrowserIsCompatible?true:false;var _10=!_f;var _11={polylineStrokeColor:"#ff0000",polylineStrokeWeight:5,polylineStrokeOpacity:0.75,polygonFillColor:"#0000ff",polygonFillOpacity:0.3,polygonStrokeColor:"#0000ff",polygonStrokeWeight:2,polygonStrokeOpacity:0.75,geometryServiceUrl:null,proxyUrl:null,alwaysUseProxy:false};var _12=function(_13,_14,_15,_16){if(_13&&_14){var arg=[_13,_14];arg=arg.concat(_16);GEvent.trigger.apply(null,arg);}if(_15){_15.apply(null,_16);}};var _18=function(_19){var j;if(_19&&/^[\],:{}\s]*$/.test(_19.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+_19+")");return j;}throw new Error("Error: Invalid JSON");};var _1b;if(_3===6){var _1c=document.createElement("div");_1c.style.display="none";_1b=function(_1d){_1c.appendChild(_1d);_1c.innerHTML="";};}else{_1b=function(_1e){_1e.parentNode.removeChild(_1e);};}var _1f=function(_20){if(_20){if(_20 instanceof Array||(typeof _20.length==="number"&&!_20.propertyIsEnumerable("length")&&typeof _20.splice==="function")){return true;}}return false;};var _21=function(_22){return(typeof _22==="function"||_22 instanceof Function);};var _23=function(_24){if(typeof _24==="undefined"){return false;}return(_24===null||typeof _24==="object"||_1f(_24)||_21(_24));};var _25=function(_26){if(_26===undefined||_26===null||_26===""){return false;}else{return true;}};var _27=function(_28){return(typeof _28==="string"||_28 instanceof String);};var _29=function(arr,_2b){if(arr&&arr.length){for(var i=0,il=arr.length;i<il;i++){if(arr[i]===_2b){return i;}}}return-1;};var _2e=function(url){var ret={};var idx=url.indexOf("?");if(idx===-1){ret.path=url;ret.query={};}else{ret.path=url.substring(0,idx);var q=(ret.query={});var str=url.substring(idx+1);var qp=str.split("&");var dec=decodeURIComponent;for(var i=0,il=qp.length;i<il;i++){var it=qp[i];if(it.length){var _39=it.split("=");var _3a=dec(_39.shift());var val=dec(_39.join("="));if(_25(q[_3a])){q[_3a]=[q[_3a]];}if(_1f(q[_3a])){q[_3a].push(val);}else{q[_3a]=val;}}}}return ret;};var _3c=function(url,_3e){var tok=_3e.token;if(_25(tok)){url+=("?token="+encodeURIComponent(tok));}return url;};var _40=function(_41){var _42=0;var _43=_41.length;var p1,p2;for(var i=0;i<_43;i++){p1=_41[i];p2=_41[(i+1)%_43];_42+=((p1[0]*p2[1])-(p2[0]*p1[1]));}if((_42/2)>0){return _41.reverse();}return _41;};var _47=function(obj){if(obj){for(var x in obj){if(obj.hasOwnProperty(x)){return true;}}}return false;};var _4a=function(obj){var _4c;if(!obj){return obj;}if(_1f(obj)){_4c=[];for(var i=0,il=obj.length;i<il;i++){_4c.push(_4a(obj[i]));}return _4c;}else{if(_21(obj)){return obj;}else{if(_23(obj)){_4c=new obj.constructor();for(var x in obj){if(!(x in _4c)||_4c[x]!==obj[x]){_4c[x]=_4a(obj[x]);}}return _4c;}}}return obj;};var _50=function(_51,_52){var _53="";if(_51===_7){for(var x in _52){if(_52.hasOwnProperty(x)){_53+=("<b>"+x+": </b>"+_52[x]+"<br/>");}}}else{_53=_51.replace(/\{([^\s\:\}]+)\}/g,function(_55,key){var _57=_52[key];if(_57===undefined||_57===null){_57=_55;}return _57;});}return _53;};var _58=function(_59){var _5a={gmapsType:null,esriType:null};var gm=null,es=null;if(_59 instanceof GLatLng){gm="GLatLng";es="esriGeometryPoint";}else{if(_59 instanceof GMarker){gm="GMarker";es="esriGeometryPoint";}else{if(_59 instanceof GLatLngBounds){gm="GLatLngBounds";es="esriGeometryEnvelope";}else{if(_59 instanceof GPolyline){gm="GPolyline";es="esriGeometryPolyline";}else{if(_59 instanceof GPolygon){gm="GPolygon";es="esriGeometryPolygon";}else{if(_1f(_59)){_5a=_58(_59[0]);if(_5a.gmapsType){_5a.gmapsType+="[]";if(_5a.esriType==="esriGeometryPoint"){_5a.esriType="esriGeometryMultipoint";}}return _5a;}}}}}}_5a.gmapsType=gm;_5a.esriType=es;return _5a;};var _5d=(function(){var _5e=6378137;var _PI=Math.PI;var _60=57.29577951308232;var _61=0.017453292519943;var _62=function(rad){return rad*_60;};var _64=function(deg){return deg*_61;};return{xToLng:function(x){var _67=x/_5e;var _68=_62(_67);var _69=Math.floor((_68+180)/360);var lng=_68-(_69*360);return lng;},yToLat:function(y){var _6c=(_PI/2)-(2*Math.atan(Math.exp(-1*y/_5e)));var _6d=_62(_6c);return _6d;},lngToX:function(lng){return _64(lng)*_5e;},latToY:function(lat){var _70=_64(lat);var y=_5e/2*Math.log((1+Math.sin(_70))/(1-Math.sin(_70)));return y;}};}());var _72=function(_73){return"{"+"x:"+_73.lng()+",y:"+_73.lat()+",spatialReference:{wkid:"+_4+"}"+"}";};var _74=function(_75){var loc;var _77=[];for(var i=0,_79=_75.length;i<_79;i++){loc=_75[i];_77.push("["+loc.lng()+","+loc.lat()+"]");}return"{points:["+_77.join(",")+"],spatialReference:{wkid:"+_4+"}}";};var _7a=function(_7b){return _72(_7b.getLatLng());};var _7c=function(_7d){var loc,_7f=[];for(var i=0,_81=_7d.length;i<_81;i++){loc=_7d[i].getLatLng();_7f.push("["+loc.lng()+","+loc.lat()+"]");}return"{points:["+_7f.join(",")+"],spatialReference:{wkid:"+_4+"}}";};var _82=function(_83){var sw=_83.getSouthWest();var ne=_83.getNorthEast();return"{"+"xmin:"+sw.lng()+",ymin:"+sw.lat()+",xmax:"+ne.lng()+",ymax:"+ne.lat()+",spatialReference:{wkid:"+_4+"}"+"}";};var _86={};var _87,_88;if(_10){_86.getLatLngsAsync=function(_89,_8a){var in1=[];for(var i=0,il=_89.length;i<il;i++){in1.push(_89[i]);in1.push("getPoint");}in1.push(function(){var _8e=[];for(var j=0,jl=arguments.length;j<jl;j++){_8e.push(arguments[j]);}_8a(_8e);});GAsync.apply(null,in1);};_86._markerToJsonTextAsync=function(_91,_92){_86.getLatLngsAsync([_91],function(_93){_92(_72(_93[0]));});};_86._markersToJsonTextAsync=function(_94,_95){_86.getLatLngsAsync(_94,function(_96){var loc,_98=[];for(var i=0,_9a=_96.length;i<_9a;i++){loc=_96[i];_98.push("["+loc.lng()+","+loc.lat()+"]");}_95("{points:["+_98.join(",")+"],spatialReference:{wkid:"+_4+"}}");});};_86._getVerticesAsync=function(_9b,_9c){var in1=[];for(var i=0,il=_9b.length;i<il;i++){in1.push(_9b[i]);in1.push("getVertexCount");}in1.push(function(){var in2=[],_a1=[],_a2,j,k,jl;for(j=0,jl=arguments.length;j<jl;j++){_a2=arguments[j];_a1.push(_a2);for(k=0;k<_a2;k++){in2.push(_9b[j]);in2.push("getVertex");in2.push([k]);}}in2.push(function(){var _a6=[],_a7=null;var _a8=0,cnt,x,y,xl;for(x=0,xl=_a1.length;x<xl;x++){cnt=_a1[x];_a7=[];for(y=_a8;y<_a8+cnt;y++){_a7.push(arguments[y]);}_a6.push(_a7);_a8+=cnt;}_9c(_a6);});GAsync.apply(null,in2);});GAsync.apply(null,in1);};_86._polylinesToJsonTextAsync=function(_ad,_ae){_86._getVerticesAsync(_ad,function(_af){var _b0,vtx,_b2,_b3=[];for(var i=0,il=_af.length;i<il;i++){_b2=_af[i];_b0=[];for(var j=0,jl=_b2.length;j<jl;j++){vtx=_b2[j];_b0.push("["+vtx.lng()+","+vtx.lat()+"]");}_b3.push("["+_b0.join(",")+"]");}_ae("{paths:["+_b3.join(",")+"],spatialReference:{wkid:"+_4+"}}");});};_86._polygonsToJsonTextAsync=function(_b8,_b9){_86._getVerticesAsync(_b8,function(_ba){var _bb,vtx,_bd,_be=[];for(var i=0,il=_ba.length;i<il;i++){_bd=_ba[i];_bb=[];for(var j=0,jl=_bd.length;j<jl;j++){vtx=_bd[j];_bb.push("["+vtx.lng()+","+vtx.lat()+"]");}_be.push("["+_bb.join(",")+"]");}_b9("{rings:["+_be.join(",")+"],spatialReference:{wkid:"+_4+"}}");});};}else{_87=function(_c3){var vtx;var _c5,_c6;var _c7=[];for(var i=0,_c9=_c3.length;i<_c9;i++){_c6=_c3[i];_c5=[];for(var j=0,_cb=_c6.getVertexCount();j<_cb;j++){vtx=_c6.getVertex(j);_c5.push("["+vtx.lng()+","+vtx.lat()+"]");}_c7.push("["+_c5.join(",")+"]");}return"{paths:["+_c7.join(",")+"],spatialReference:{wkid:"+_4+"}}";};_88=function(_cc){var vtx;var _ce,_cf;var _d0=[];for(var i=0,_d2=_cc.length;i<_d2;i++){_cf=_cc[i];_ce=[];for(var j=0,_d4=_cf.getVertexCount();j<_d4;j++){vtx=_cf.getVertex(j);_ce.push("["+vtx.lng()+","+vtx.lat()+"]");}_d0.push("["+_ce.join(",")+"]");}return"{rings:["+_d0.join(",")+"],spatialReference:{wkid:"+_4+"}}";};}var _d5=function(_d6,_d7,_d8){var _d9="";switch(_d7){case"GLatLng":_d9=_72(_d6);break;case"GLatLng[]":_d9=_74(_d6);break;case"GMarker":if(_d8){_86._markerToJsonTextAsync(_d6,_d8);return;}else{_d9=_7a(_d6);}break;case"GMarker[]":if(_d8){_86._markersToJsonTextAsync(_d6,_d8);return;}else{_d9=_7c(_d6);}break;case"GLatLngBounds":_d9=_82(_d6);break;case"GPolyline":if(_d8){_86._polylinesToJsonTextAsync([_d6],_d8);return;}else{_d9=_87([_d6]);}break;case"GPolyline[]":if(_d8){_86._polylinesToJsonTextAsync(_d6,_d8);return;}else{_d9=_87(_d6);}break;case"GPolygon":if(_d8){_86._polygonsToJsonTextAsync([_d6],_d8);return;}else{_d9=_88([_d6]);}break;case"GPolygon[]":if(_d8){_86._polygonsToJsonTextAsync(_d6,_d8);return;}else{_d9=_88(_d6);}break;default:throw new Error("_geometryToJsonText(): unsupported geometry type - supported types are GLatLng, GLatLng[], GMarker, GMarker[], GLatLngBounds, GPolyline, GPolyline[], GPolygon, GPolygon[]");}if(_d8){_d8(_d9);}else{return _d9;}};var _da;var _db=function(arr){var _dd=[];var val,enc=encodeURIComponent;if(arr._AG_){var _e0=arr._PT_?arr[0]:arr;return _d5(_e0,_58(_e0).gmapsType);}for(var x=0,xl=arr.length;x<xl;x++){val=arr[x];if(_25(val)&&typeof val!=="function"){if(_1f(val)){val._AG_=arr._AAG_;_dd.push(_db(val));}else{if(typeof val==="object"){val._AG_=arr._AAG_;_dd.push(_da(val));}else{_dd.push(enc(_27(val)?("\""+val+"\""):val));}}}}return"["+_dd.join(",")+"]";};var _e3;_da=function(obj){var _e5=[];var val,enc=encodeURIComponent;if(obj._AG_){return _d5(obj,_58(obj).gmapsType);}else{if(obj instanceof _e3){var _e8=obj.features,_e9=obj.geometryType||"",_ea,_eb,len,b;if(_1f(_e8)){for(b=0;b<_e8.length;b++){_ea=_e8[b];_eb=_ea.geometry;len=_eb.length;if(_ea&&_eb){_eb._AG_=true;if(_e9!=="esriGeometryMultipoint"&&_e9==="esriGeometryPoint"||len===1){_eb._PT_=true;}}}}}}for(var x in obj){if(obj.hasOwnProperty(x)){val=obj[x];if(_25(val)&&typeof val!=="function"){if(_1f(val)){_e5.push(x+":"+_db(val));}else{if(typeof val==="object"){_e5.push(x+":"+_da(val));}else{_e5.push(x+":"+enc(_27(val)?("\""+val+"\""):val));}}}}}return"{"+_e5.join(",")+"}";};var _ef=function(_f0){var _f1=[];var val,enc=encodeURIComponent;for(var x in _f0){if(_f0.hasOwnProperty(x)){val=_f0[x];if(_25(val)&&typeof val!=="function"){if(_1f(val)){if(_25(val[0])&&typeof val[0]!=="function"&&typeof val[0]==="object"){_f1.push(x+"="+_db(val));}else{_f1.push(x+"="+enc(val.join(",")));}}else{if(typeof val==="object"){_f1.push(x+"="+_da(val));}else{_f1.push(x+"="+enc(val));}}}}}return _f1.join("&");};if(_10){_86._arrayToJsonTextAsync=function(arr,_f6){var _f7=[];var _f8=[];var val,enc=encodeURIComponent;if(arr._AG_){var _fb=arr._PT_?arr[0]:arr;_d5(_fb,_58(_fb).gmapsType,_f6);return;}for(var x=0,xl=arr.length;x<xl;x++){val=arr[x];if(_25(val)&&typeof val!=="function"){if(_1f(val)){val._AG_=arr._AAG_;_f8.push(_86);_f8.push("_arrayToJsonText");_f8.push([val]);}else{if(typeof val==="object"){val._AG_=arr._AAG_;_f8.push(_86);_f8.push("_objectToJsonText");_f8.push([val]);}else{_f7.push(enc(_27(val)?("\""+val+"\""):val));}}}}if(_f8.length>0){_f8.push(function(){for(var i=0,il=arguments.length;i<il;i++){_f7.push(arguments[i]);}_f6("["+_f7.join(",")+"]");});GAsync.apply(null,_f8);}else{_f6("["+_f7.join(",")+"]");}};_86._objectToJsonTextAsync=function(obj,_101){var _102=[];var args=[],prop=[];var val,enc=encodeURIComponent;if(obj._AG_){_d5(obj,_58(obj).gmapsType,_101);return;}else{if(obj instanceof _e3){var _107=obj.features,type=obj.geometryType||"",_109,geom,len,b;if(_1f(_107)){for(b=0;b<_107.length;b++){_109=_107[b];geom=_109.geometry;len=geom.length;if(_109&&geom){geom._AG_=true;if(type!=="esriGeometryMultipoint"&&type==="esriGeometryPoint"||len===1){geom._PT_=true;}}}}}}for(var x in obj){if(obj.hasOwnProperty(x)){val=obj[x];if(_25(val)&&typeof val!=="function"){if(_1f(val)){args.push(_86);args.push("_arrayToJsonText");args.push([val]);prop.push(x);}else{if(typeof val==="object"){args.push(_86);args.push("_objectToJsonText");args.push([val]);prop.push(x);}else{_102.push(x+":"+enc(_27(val)?("\""+val+"\""):val));}}}}}if(args.length>0){args.push(function(){for(var i=0,il=prop.length;i<il;i++){_102.push(prop[i]+":"+arguments[i]);}_101("{"+_102.join(",")+"}");});GAsync.apply(null,args);}else{_101("{"+_102.join(",")+"}");}};_86._parametersToJsonTextAsync=function(_110,_111){var _112=[];var args=[],_114=[];var val,enc=encodeURIComponent;for(var x in _110){if(_110.hasOwnProperty(x)){val=_110[x];if(_25(val)&&typeof val!=="function"){if(_1f(val)){if(_25(val[0])&&typeof val[0]!=="function"&&typeof val[0]==="object"){args.push(_86);args.push("_arrayToJsonText");args.push([val]);_114.push(x);}else{_112.push(x+"="+enc(val.join(",")));}}else{if(typeof val==="object"){args.push(_86);args.push("_objectToJsonText");args.push([val]);_114.push(x);}else{_112.push(x+"="+enc(val));}}}}}if(args.length>0){args.push(function(){for(var i=0,il=_114.length;i<il;i++){_112.push(_114[i]+"="+arguments[i]);}_111(_112.join("&"));});GAsync.apply(null,args);}else{_111(_112.join("&"));}};}var _11a=function(json){return new GMarker(new GLatLng(json.y,json.x));};var _11c=function(json){return[new GMarker(new GLatLng(json.y,json.x))];};var _11e=function(json){var _120=json.points;var pt;var _122=[];for(var i=0,npts=_120.length;i<npts;i++){pt=_120[i];_122[i]=new GMarker(new GLatLng(pt[1],pt[0]));}return _122;};var _125=function(json){var sw=new GLatLng(json.ymin,json.xmin);var nw=new GLatLng(json.ymax,json.xmin);var ne=new GLatLng(json.ymax,json.xmax);var se=new GLatLng(json.ymin,json.xmax);var poly=new GPolygon([sw,nw,ne,se],_11.polygonStrokeColor,_11.polygonStrokeWeight,_11.polygonStrokeOpacity,_11.polygonFillColor,_11.polygonFillOpacity);return[poly];};var _12c=function(json,_12e){var xmin=json.xmin,ymin=json.ymin;var xmax=json.xmax,ymax=json.ymax;var _133=_5d.xToLng;var _134=_5d.yToLat;if(_12e){xmin=_133(xmin);ymin=_134(ymin);xmax=_133(xmax);ymax=_134(ymax);}var sw=new GLatLng(ymin,xmin);var ne=new GLatLng(ymax,xmax);var _137=new GLatLngBounds(sw,ne);return _137;};var _138=function(json){var _13a=json.paths;var _13b,_13c,_13d,pt;_13d=[];for(var i=0,nseg=_13a.length;i<nseg;i++){_13b=_13a[i];_13c=[];for(var j=0,npts=_13b.length;j<npts;j++){pt=_13b[j];_13c[j]=new GLatLng(pt[1],pt[0]);}_13d[i]=new GPolyline(_13c,_11.polylineStrokeColor,_11.polylineStrokeWeight,_11.polylineStrokeOpacity);}return _13d;};var _143=function(_144){var _145=0,_146=0,_147=[],x,y,i,len,_14c=_144.replace(/(\+)|(\-)/g," $&").split(" "),_14d=parseInt(_14c[1],32);for(i=2,len=_14c.length;i<len;i+=2){_145=(x=parseInt(_14c[i],32)+_145);_146=(y=parseInt(_14c[i+1],32)+_146);_147.push([x/_14d,y/_14d]);}return _147;};var _14e=function(json){var _150=json.rings;var _151,_152,_153,pt;_153=[];for(var i=0,nseg=_150.length;i<nseg;i++){_151=_150[i];_152=[];for(var j=0,npts=_151.length;j<npts;j++){pt=_151[j];_152[j]=new GLatLng(pt[1],pt[0]);}_153[i]=new GPolygon(_152,_11.polygonStrokeColor,_11.polygonStrokeWeight,_11.polygonStrokeOpacity,_11.polygonFillColor,_11.polygonFillOpacity);}return _153;};var _159=function(_15a,html,_15c,_15d,map){if(_15d&&html){if(_15a.openInfoWindow){if(_1f(html)){GEvent.addListener(_15a,"click",function(){_15a.openInfoWindowTabsHtml(html,_15c);});}else{GEvent.addListener(_15a,"click",function(){_15a.openInfoWindowHtml(html,_15c);});}}else{if(_1f(html)){GEvent.addListener(_15a,"click",function(_15f){map.openInfoWindowTabsHtml(_15f,html,_15c);});}else{GEvent.addListener(_15a,"click",function(_160){map.openInfoWindowHtml(_160,html,_15c);});}}}map.addOverlay(_15a);};var _161=function(_162,type){var line=(type==="GPolyline[]")?true:false;var _165={stc:(_162&&_162.strokeColor!==undefined)?_162.strokeColor:(line)?_11.polylineStrokeColor:_11.polygonStrokeColor,stw:(_162&&_162.strokeWeight!==undefined)?_162.strokeWeight:(line)?_11.polylineStrokeWeight:_11.polygonStrokeWeight,sto:(_162&&_162.strokeOpacity!==undefined)?_162.strokeOpacity:(line)?_11.polylineStrokeOpacity:_11.polygonStrokeOpacity,fic:(_162&&_162.fillColor!==undefined)?_162.fillColor:_11.polygonFillColor,fio:(_162&&_162.fillOpacity!==undefined)?_162.fillOpacity:_11.polygonFillOpacity};return _165;};var _166,_167,_168;if(_10){_86._createAddMarkersAsync=function(_169,_16a,_16b,_16c,map,_16e){var args=[];for(var i=0,il=_169.length;i<il;i++){args.push(_169[i]);args.push("getPoint");}args.push(function(){var _172=[],mark,opts,_175=_16c.attr,iw=_16c.meta.flags.clickable,html=_16c.html;for(var j=0,jl=arguments.length;j<jl;j++){opts=_4a(_16a.markerOptions);if(opts&&opts.title){opts.title=_50(opts.title,_175);}mark=new GMarker(arguments[j],opts);_159(mark,html,_16b,iw,map);_172.push(mark);}_16e(_172);});GAsync.apply(null,args);};_86._createAddPolylinesAsync=function(_17a,_17b,_17c,_17d,map,_17f){_86._getVerticesAsync(_17a,function(_180){var _181=[],poly,i,il,_185=_17d.meta.style,iw=_17d.meta.flags.clickable,html=_17d.html;var opts=_17b.polylineOptions;for(i=0,il=_180.length;i<il;i++){poly=new GPolyline(_180[i],_185.stc,_185.stw,_185.sto,opts);_159(poly,html,_17c,iw,map);_181.push(poly);}_17f(_181);});};_86._createAddPolygonsAsync=function(_189,_18a,_18b,_18c,map,_18e){_86._getVerticesAsync(_189,function(_18f){var _190=[],poly,i,il,_194=_18c.meta.style,iw=_18c.meta.flags.clickable,html=_18c.html;var opts=_18a.polylineOptions;for(i=0,il=_18f.length;i<il;i++){poly=new GPolygon(_18f[i],_194.stc,_194.stw,_194.sto,_194.fic,_194.fio,opts);_159(poly,html,_18b,iw,map);_190.push(poly);}_18e(_190);});};}else{_166=function(_198,_199,_19a,_19b,map){var _19d=[],mark,opts,i,il,_1a2=_19b.attr,iw=_19b.meta.flags.clickable,html=_19b.html;for(i=0,il=_198.length;i<il;i++){opts=_4a(_199.markerOptions);if(opts&&opts.title){opts.title=_50(opts.title,_1a2);}mark=new GMarker(_198[i].getLatLng(),opts);_159(mark,html,_19a,iw,map);_19d.push(mark);}return _19d;};_167=function(_1a5,_1a6,_1a7,_1a8,map){var _1aa=[],_1ab,poly,opts,_1ae,i,il,j,jl,_1b3=_1a8.meta.style,iw=_1a8.meta.flags.clickable,html=_1a8.html;opts=_1a6.polylineOptions;for(i=0,il=_1a5.length;i<il;i++){_1ab=_1a5[i];_1ae=[];for(j=0,jl=_1ab.getVertexCount();j<jl;j++){_1ae.push(_1ab.getVertex(j));}poly=new GPolyline(_1ae,_1b3.stc,_1b3.stw,_1b3.sto,opts);_159(poly,html,_1a7,iw,map);_1aa.push(poly);}return _1aa;};_168=function(_1b6,_1b7,_1b8,_1b9,map){var _1bb=[],_1bc,poly,opts,_1bf,i,il,j,jl,_1c4=_1b9.meta.style,iw=_1b9.meta.flags.clickable,html=_1b9.html;opts=_1b7.polygonOptions;for(i=0,il=_1b6.length;i<il;i++){_1bc=_1b6[i];_1bf=[];for(j=0,jl=_1bc.getVertexCount();j<jl;j++){_1bf.push(_1bc.getVertex(j));}poly=new GPolygon(_1bf,_1c4.stc,_1c4.stw,_1c4.sto,_1c4.fic,_1c4.fio,opts);_159(poly,html,_1b8,iw,map);_1bb.push(poly);}return _1bb;};}var _1c7=function(_1c8,_1c9){if(_1f(_1c8)){var tab,_1cb,_1cc;var tabs=[];for(var i=0,ilen=_1c8.length;i<ilen;i++){tab=_1c8[i];_1cb=_50(tab.label,_1c9);_1cc=_50(tab.content,_1c9);tabs[i]=new GInfoWindowTab(_1cb,_1cc);}return tabs;}else{return _50(_1c8,_1c9);}};var _1d0=function(_1d1,_1d2,_1d3,meta,map,_1d6){var geom=_1d1.geometry;var attr=_1d1.attributes;var type=meta.type;var _1da=meta.flags;var iwc,_1dc;if(_1d3){iwc=_1d3.content;_1dc=_1d3.contentTabs;}var _1dd={attr:attr,html:_1c7((iwc||_1dc||_7),attr),meta:meta};var ovs,_1df=false;switch(type){case"GMarker[]":if(_1da.marker){if(_1d6){_86._createAddMarkersAsync(geom,_1d2,_1d3,_1dd,map,_1d6);return;}else{ovs=_166(geom,_1d2,_1d3,_1dd,map);}}else{ovs=geom;_1df=true;}break;case"GPolyline[]":if(_1da.newpolyline){if(_1d6){_86._createAddPolylinesAsync(geom,_1d2,_1d3,_1dd,map,_1d6);return;}else{ovs=_167(geom,_1d2,_1d3,_1dd,map);}}else{_1df=true;ovs=geom;}break;case"GPolygon[]":if(_1da.newpolygon){if(_1d6){_86._createAddPolygonsAsync(geom,_1d2,_1d3,_1dd,map,_1d6);return;}else{ovs=_168(geom,_1d2,_1d3,_1dd,map);}}else{_1df=true;ovs=geom;}break;}if(_1df){for(var i=0,il=ovs.length;i<il;i++){_159(ovs[i],_1dd.html,_1d3,_1da.clickable,map);}}if(_1d6){_1d6(ovs);}else{return ovs;}};_86._addCustomOverlaysAsync=_1d0;var _1e2=function(_1e3,type){var _1e5,_1e6,_1e7,_1e8,_1e9;_1e5=_1e6=_1e7=_1e8=_1e9=false;var _1ea=true;if(_1e3){var fco=_1e3.fillColor;var fop=_1e3.fillOpacity;var sco=_1e3.strokeColor;var swt=_1e3.strokeWeight;var sop=_1e3.strokeOpacity;var mop=_1e3.markerOptions;var plop=_1e3.polylineOptions;var pgop=_1e3.polygonOptions;_1e5=(fco||fop)?true:false;_1e6=(sco||swt||sop)?true:false;_1e7=(mop&&_47(mop))?true:false;_1e8=(plop&&_47(plop))?true:false;_1e9=(pgop&&_47(pgop))?true:false;if(_1e7&&_25(mop.clickable)){_1ea=mop.clickable;}if(_1e8&&_25(plop.clickable)){_1ea=plop.clickable;}if(_1e9&&_25(pgop.clickable)){_1ea=pgop.clickable;}}var _1f3={fill:_1e5,stroke:_1e6,marker:_1e7,polyline:_1e8,polygon:_1e9,clickable:(_10&&(type==="GPolyline[]"||type==="GPolygon[]"))?false:_1ea,newpolyline:_1e6||_1e8,newpolygon:_1e6||_1e5||_1e9};return _1f3;};var _1f4=function(){var purl=_11.proxyUrl;if(!purl){throw new Error("Error: esri.arcgis.gmaps.Config.proxyUrl is not set. A web proxy page is required to make cross-domain XMLHttpRequest calls");}return _2e(purl);};var _1f6=function(url){if(_11.alwaysUseProxy){var uo=_1f4();var _url=_2e(url);var p1=_ef(uo.query);var p2=_ef(_url.query);p1=p1&&("?"+p1);p2=p2&&(((p1&&"&")||("?"))+p2);url=uo.path+"?"+_url.path+p1+p2;}return url;};var _1fc=(function(){var _1fd=[];var _1fe="ArcGISJsonScript_";var _1ff="ArcGISJson_";var _200="ArcGISKmz_";var _201=2000;var _202=function(id){delete _1fd[id];};var _204=function(url,_206){this.url=url;this.handler=_206;var nat=window.XMLHttpRequest;var acx=window.ActiveXObject;this._xhr=null;if(nat&&!(acx)){this._xhr=new XMLHttpRequest();}else{if(acx){try{this._xhr=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{this._xhr=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){}}}else{throw new Error("This browser does not support XMLHttpRequest object");}}var self=this;this._xhr.onreadystatechange=function(){self._callback.call(self);};this._xhr.open("POST",url,true);};_204.prototype.send=function(_20a){this._xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this._xhr.send(_20a);};_204.prototype._callback=function(){var req=this._xhr;if(req.readyState===4){this.handler(_18(req.responseText));}};_204.prototype.cancel=function(){this._xhr.abort();};var _20c=function(id,url,_20f,_210){this.id=_1ff+id;this.url=url;this.handler=_20f;this._id=id;this.cbParamName=_210||"callback";};_20c.prototype.send=function(_211){var plen=_211.length+this.url.length;if(plen>_201||_11.alwaysUseProxy){var _213=window.location.protocol+"//"+window.location.host+"/";var url=this.url.replace(/^\s\s*/,"").replace(/\s\s*$/,"")+"/";var p1="";if(url.indexOf(_213)||_11.alwaysUseProxy){var uo=_1f4();p1=_ef(uo.query);url=uo.path+"?"+this.url;}else{url=this.url;}p1=p1&&((_211&&"&")+p1);var self=this;this._xhr=new _204(url,function(){self._callback.call(self,arguments[0]);});this._xhr.send(_211+p1+"&f=json");}else{var el=document.createElement("script");el.id=(this.scriptId=_1fe+this._id);el.type="text/javascript";el.src=this.url+"?"+_211+"&f=json"+"&"+this.cbParamName+"=esri.arcgis.gmaps._RestRequest._requestQueue."+this.id+"._callback";document.getElementsByTagName("head").item(0).appendChild(el);}};_20c.prototype._callback=function(_219){this._cleanup();if(this.cancelled){return;}var err=_219.error||null;if(err){_219=null;}this.handler.call(null,_219,err);};_20c.prototype._cleanup=function(){if(this.scriptId){var el=document.getElementById(this.scriptId);el.parentNode.removeChild(el);}_202(this.id);};_20c.prototype.cancel=function(){if(!this.cancelled){this.cancelled=true;var xhr=this._xhr;if(xhr){xhr.cancel();this._cleanup();}}};var _21d=function(id,url,_220){this.id=_200+id;this.url=url;this.handler=_220;};_21d.prototype.send=function(_221){var self=this;var _223=null;var _cb=function(){self._callback.call(self,_223);};_223=new GGeoXml(this.url+"?"+_221+"&f=kmz",_cb);if(_10){_cb();}};_21d.prototype._callback=function(_225){this._cleanup();if(this.cancelled){return;}if(_f){if(!_225.hasLoaded()){throw new Error("GGeoXml object could not finish loading the KML file");}else{if(!_225.loadedCorrectly()){throw new Error("GGeoXml object could not load the KML file correctly");}}}this.handler.call(null,_225,null);};_21d.prototype._cleanup=function(){_202(this.id);};_21d.prototype.cancel=function(){if(!this.cancelled){this.cancelled=true;}};return{_requestQueue:_1fd,create:function(url,_227,_228,_229){var nid=Math.random().toString(10).substring(2);var jh=null;switch(_228){case _9:jh=new _20c(nid,url,_227,_229);_1fd[_1ff+nid]=jh;break;case _8:jh=new _21d(nid,url,_227);_1fd[_200+nid]=jh;break;default:throw new Error("_RestRequest.create(): The requested REST response format '"+_228+"' is not supported. Supported formats are: json, kmz");}return jh;},handle:function(url,op,_22e,_22f,_230,_231,_232,_233,_234){if(!_22f){_22f="";}if(!op){op="";}var uo=_2e(url);url=uo.path+"/"+op;var p3=_ef(uo.query);p3=(p3==="")?p3:("&"+p3);var _h=function(){var args=[];for(var i=0,il=arguments.length;i<il;i++){args.push(arguments[i]);}args.push(_233);_232.apply(_231,args);};var req=_1fc.create(url,_h,_230,_234);if(req){var _cb=function(text){var par=text+_22f+p3;par=(par.indexOf("&")===0)?((par.length!==1)?par.substring(1):""):par;req.send(par);};if(_f){_cb(_ef(_22e));}else{_86._parametersToJsonTextAsync(_22e,_cb);}}return req;},cancel:function(_23f){_23f.cancel();},JSONRequest:function(url,_241,_242,_243){_243=_243||{};return _1fc.handle(url,null,_242,null,_9,null,_241,null,_243.callbackParamName);}};}());var _244={INTERSECTS:"esriSpatialRelIntersects",CONTAINS:"esriSpatialRelContains",CROSSES:"esriSpatialRelCrosses",ENVELOPE_INTERSECTS:"esriSpatialRelEnvelopeIntersects",INDEX_INTERSECTS:"esriSpatialRelIndexIntersects",OVERLAPS:"esriSpatialRelOverlaps",TOUCHES:"esriSpatialRelTouches",WITHIN:"esriSpatialRelWithin"};var _245=function(){this.queryGeometry=null;this.outFields=null;this.returnGeometry=true;this.spatialRelationship=_244.INTERSECTS;this.text=null;this.where=null;};var _246=function(){this.attributes=null;this.geometry=null;};_e3=function(){this.displayFieldName=null;this.features=null;this.geometryType=null;this.spatialReference={"wkid":_4};this.fieldAliases=null;};var _247=function(json,type){var conv,geom,_24c;switch(type){case"esriGeometryPoint":conv=_11c;break;case"esriGeometryMultipoint":conv=_11e;break;case"esriGeometryEnvelope":conv=_125;break;case"esriGeometryPolyline":conv=_138;break;case"esriGeometryPolygon":conv=_14e;break;}_24c=new _246();_24c.attributes=json.attributes;geom=json.geometry;_24c.geometry=(geom&&conv)?conv(geom):null;return _24c;};var _24d=function(json){var fset=new _e3();fset.displayFieldName=json.displayFieldName;var type=(fset.geometryType=json.geometryType);var sr=json.spatialReference;fset.spatialReference=(sr)?{"wkid":sr.wkid}:null;fset.fieldAliases=json.fieldAliases;var _252=(fset.features=[]);var _253=json.features;var _254;if(_253){for(var i=0,flen=_253.length;i<flen;i++){_254=_253[i];_252.push(_247(_254,type));}}return fset;};var _257=function(url){this.url=url;};_257.prototype.execute=function(_259,_25a,_25b){if(!_259){throw new Error("QueryTask.execute(): 'parameters' argument is required");}var geom=_259.queryGeometry;var txt=_259.text;var _25e=_259.where;if(!(_25(geom)||_25(txt)||_25(_25e))){throw new Error("QueryTask.execute(): 'Query' must have value for atleast one of 'queryGeometry', 'text', 'where' properties");}var _25f={geometryType:_58(geom).esriType,geometry:geom,inSR:_4,outSR:_4,spatialRel:_259.spatialRelationship,returnGeometry:_259.returnGeometry,text:txt,where:_25e,outFields:_259.outFields};if(geom){_25f.geometry._AG_=true;}_1fc.handle(this.url,"query",_25f,null,((_25a)?_8:_9),this,this._responseHandler,_25b);};_257.prototype._responseHandler=function(_260,_261,_262){var _263=null;if(_260){if(_260 instanceof GGeoXml){_263=_260;}else{_263=_24d(_260);}}_12(this,"executecomplete",_262,[_263,_261]);};var _264=function(){this.address=null;this.location=null;this.score=null;this.attributes=null;};var _265=function(){this.addressCandidates=null;};var _266=function(_267){var _268=new _246();_268.geometry=[_267.location];var _269=(_268.attributes={});var _26a=_267.address;if(typeof(_26a)==="string"){_269.address=_26a;}else{for(var x in _26a){if(_26a.hasOwnProperty(x)){_269[x]=_26a[x];}}}var _26c=_267.attributes;if(_26c){for(var y in _26c){if(_26c.hasOwnProperty(y)){_269[y]=_26c[y];}}}_269.score=_267.score;return _268;};var _26e=function(url){this.url=url;};_26e.prototype.addressToLocations=function(_270,_271,_272,_273){if(!_270){throw new Error("Locator.addressToLocations(): 'address' argument is required");}_270.outFields=_271;_1fc.handle(this.url,"findAddressCandidates",_270,null,((_272)?_8:_9),this,this._geocodeHandler,_273);};_26e.prototype.locationToAddress=function(_274,_275,_276,_277){if(!_274){throw new Error("Locator.locationToAddress(): 'latlng' argument is required");}if(!_275){throw new Error("Locator.locationToAddress(): 'distance' argument is required");}var _278={location:_274.lng()+","+_274.lat(),distance:_275};_1fc.handle(this.url,"reverseGeocode",_278,null,((_276)?_8:_9),this,this._reverseGeocodeHandler,_277);};_26e.prototype._geocodeHandler=function(_279,_27a,_27b){var _27c=null;if(_279){if(_279 instanceof GGeoXml){_27c=_279;}else{var _27d=new _265();var _27e=(_27d.addressCandidates=[]);var _27f=_279.candidates;var _280,ac;for(var i=0,il=_27f.length;i<il;i++){_280=_27f[i];ac=new _264();ac.address=_280.address;ac.location=_11a(_280.location);ac.score=_280.score;ac.attributes=_280.attributes;_27e.push(ac);}_27c=_27d;}}_12(this,"addresstolocationscomplete",_27b,[_27c,_27a]);};_26e.prototype._reverseGeocodeHandler=function(_284,_285,_286){var _287=null;if(_284){if(_284 instanceof GGeoXml){_287=_284;}else{var _288=new _264();_288.address=_284.address;_288.location=_11a(_284.location);_288.score=100;_287=_288;}}_12(this,"locationtoaddresscomplete",_286,[_287,_285]);};var _289=function(){this.geometry=null;this.tolerance=2;this.layerIds=null;this.layerOption="top";this.returnGeometry=true;this.dpi=96;this.bounds=null;this.width=null;this.height=null;};var _28a=function(){this.layerId=null;this.layerName=null;this.displayFieldName=null;this.feature=null;};var _28b=function(){this.identifyResults=null;};var _28c=function(url){this.url=url;};_28c.prototype.execute=function(_28e,_28f){if(!_28e){throw new Error("IdentifyTask.execute(): 'parameters' argument is required");}var geom=_28e.geometry;var tol=_28e.tolerance;var ext=_28e.bounds;var w=_28e.width;var h=_28e.height;var dpi=_28e.dpi;if(!(_25(geom)&&_25(tol)&&_25(ext)&&_25(w)&&_25(h)&&_25(dpi))){throw new Error("IdentifyTask.execute(): 'IdentifyParameters' must have value for the following properties: 'geometry', 'tolerance', 'bounds', 'width', 'height' and 'dpi'");}var _296=_28e.layerOption;var lids=_28e.layerIds;if(lids){_296+=(":"+lids.join(","));}var _298={geometry:geom,geometryType:_58(geom).esriType,sr:_4,layers:_296,tolerance:tol,mapExtent:ext,imageDisplay:w+","+h+","+dpi,returnGeometry:_28e.returnGeometry};_298.geometry._AG_=true;_298.mapExtent._AG_=true;_1fc.handle(this.url,"identify",_298,null,_9,this,this._responseHandler,_28f);};_28c.prototype._responseHandler=function(_299,_29a,_29b){var _29c=null;if(_299){var _29d=_299.results;_29c=new _28b();var _29e=(_29c.identifyResults=[]);var _29f,_2a0;for(var i=0,il=_29d.length;i<il;i++){_29f=_29d[i];_2a0=new _28a();_2a0.layerId=_29f.layerId;_2a0.layerName=_29f.layerName;_2a0.displayFieldName=_29f.displayFieldName;_2a0.feature=_247({attributes:_29f.attributes,geometry:_29f.geometry},_29f.geometryType);_29e.push(_2a0);}}_12(this,"executecomplete",_29b,[_29c,_29a]);};var _2a3=function(){this.searchText=null;this.contains=true;this.searchFields=null;this.layerIds=null;this.returnGeometry=true;};var _2a4=function(){this.layerId=null;this.layerName=null;this.displayFieldName=null;this.foundFieldName=null;this.feature=null;};var _2a5=function(){this.findResults=null;};var _2a6=function(url){this.url=url;};_2a6.prototype.execute=function(_2a8,_2a9){if(!_2a8){throw new Error("FindTask.execute(): 'parameters' argument is required");}var txt=_2a8.searchText;var lyrs=_2a8.layerIds;if(!(_25(txt)&&_25(lyrs))){throw new Error("FindTask.execute(): 'FindParameters' must have value for the following properties: 'searchText' and 'layerIds'");}var _2ac={searchText:txt,contains:_2a8.contains,searchFields:_2a8.searchFields,sr:_4,layers:lyrs,returnGeometry:_2a8.returnGeometry};_1fc.handle(this.url,"find",_2ac,null,_9,this,this._responseHandler,_2a9);};_2a6.prototype._responseHandler=function(_2ad,_2ae,_2af){var _2b0=null;if(_2ad){var _2b1=_2ad.results;_2b0=new _2a5();var _2b2=(_2b0.findResults=[]);var _2b3,fres;for(var i=0,il=_2b1.length;i<il;i++){_2b3=_2b1[i];fres=new _2a4();fres.layerId=_2b3.layerId;fres.layerName=_2b3.layerName;fres.displayFieldName=_2b3.displayFieldName;fres.foundFieldName=_2b3.foundFieldName;fres.feature=_247({attributes:_2b3.attributes,geometry:_2b3.geometry},_2b3.geometryType);_2b2.push(fres);}}_12(this,"executecomplete",_2af,[_2b0,_2ae]);};var _2b7=function(){this.name=null;this.where=null;this.geometry=null;this.spatialRelationship=null;};var _2b8={NONE:"esriNAOutputLineNone",STRAIGHT:"esriNAOutputLineStraight",TRUE_SHAPE:"esriNAOutputLineTrueShape",TRUE_SHAPE_WITH_MEASURE:"esriNAOutputLineTrueShapeWithMeasure"};var _2b9={ALLOW_BACKTRACK:"esriNFSBAllowBacktrack",AT_DEAD_ENDS_ONLY:"esriNFSBAtDeadEndsOnly",NO_BACKTRACK:"esriNFSBNoBacktrack"};var _2ba={CENTIMETERS:"esriCentimeters",DECIMAL_DEGREES:"esriDecimalDegrees",DECIMETERS:"esriDecimeters",FEET:"esriFeet",INCHES:"esriInches",KILOMETERS:"esriKilometers",METERS:"esriMeters",MILES:"esriMiles",MILLIMETERS:"esriMillimeters",NAUTICAL_MILES:"esriNauticalMiles",POINTS:"esriPoints",UNKNOWN:"esriUnknownUnits",YARDS:"esriYards"};var _2bb={"esriCentimeters":"esriNAUCentimeters","esriDecimalDegrees":"esriNAUDecimalDegrees","esriDecimeters":"esriNAUDecimeters","esriFeet":"esriNAUFeet","esriInches":"esriNAUInches","esriKilometers":"esriNAUKilometers","esriMeters":"esriNAUMeters","esriMiles":"esriNAUMiles","esriMillimeters":"esriNAUMillimeters","esriNauticalMiles":"esriNAUNauticalMiles","esriPoints":"esriNAUPoints","esriUnknownUnits":"esriNAUUnknown","esriYards":"esriNAUYards"};var _2bc=function(){this.accumulateAttributes=null;this.barriers=null;this.directionsLanguage=null;this.directionsLengthUnits=null;this.directionsTimeAttribute=null;this.doNotLocateOnRestrictedElements=false;this.findBestSequence=null;this.ignoreInvalidLocations=null;this.impedanceAttribute=null;this.outputLines=null;this.outputGeometryPrecision=null;this.outputGeometryPrecisionUnits=null;this.preserveFirstStop=null;this.preserveLastStop=null;this.restrictionAttributes=null;this.restrictUTurns=null;this.returnBarriers=false;this.returnDirections=false;this.returnRoutes=true;this.returnStops=false;this.startTime=null;this.stops=null;this.useHierarchy=null;this.useTimeWindows=null;};var _2bd=function(){this.bounds=null;this.mergedGeometry=null;this.routeId=null;this.routeName=null;this.totalLength=null;this.totalTime=null;this.totalDriveTime=null;this.features=null;this.geometryType="esriGeometryPolyline";this.spatialReference={"wkid":_4};};_2bd.prototype=new _e3();var _2be=function(){this.directions=null;this.route=null;this.routeName=null;this.stops=null;};var _2bf=function(){this.results=null;this.barriers=null;this.messages=null;};var _2c0=function(url){this.url=url;};_2c0.prototype._getNetworkLocations=function(arg,type){var ret={};var geom,name;if(arg instanceof _e3){ret=arg;delete ret.geometryType;delete ret.displayFieldName;delete ret.fieldAliases;delete ret.spatialReference;ret.type="features";var _2c7=(ret.features=arg.features);if(type==="stops"&&_2c7){var _2c8=true,_2c9=true,attr;for(var i=0,len=_2c7.length;i<len;i++){attr=_2c7[i].attributes;if(attr&&attr.RouteName){_2c9=false;}else{_2c8=false;}}if(!_2c8&&!_2c9){throw new Error("RouteTask.solve(): some of the '"+type+"' don't have a valid route name");}}}else{if(arg instanceof _2b7){geom=arg.geometry;name=arg.name;if(!_25(name)){throw new Error("RouteTask.solve(): '"+type+"' referencing a data layer in the map service should have a valid 'name'");}ret.type="layer";ret.layerName=name;ret.where=arg.where;ret.geometry=geom;ret.geometryType=_58(geom).esriType;ret.spatialRel=arg.spatialRelationship;if(geom){geom._AG_=true;}}else{throw new Error("RouteTask.solve(): '"+type+"' must be specified as a feature set or as a data layer");}}return ret;};_2c0.prototype.solve=function(_2cd,_2ce){if(!_2cd){throw new Error("RouteTask.solve(): 'parameters' argument is required");}var _2cf=_2cd.stops,_2d0;if(!_2cf){throw new Error("RouteTask.solve(): 'stops' not specified in the route parameters");}_2d0=this._getNetworkLocations(_2cf,"stops");_2d0.doNotLocateOnRestrictedElements=_2cd.doNotLocateOnRestrictedElements;var _2d1=_2cd.barriers,_2d2;if(_2d1){_2d2=this._getNetworkLocations(_2d1,"barriers");}var _2d3={stops:_2d0,barriers:_2d2,returnDirections:_2cd.returnDirections,returnRoutes:_2cd.returnRoutes,returnStops:_2cd.returnStops,returnBarriers:_2cd.returnBarriers,outSR:_4,ignoreInvalidLocations:_2cd.ignoreInvalidLocations,outputLines:_2cd.outputLines,findBestSequence:_2cd.findBestSequence,preserveFirstStop:_2cd.preserveFirstStop,preserveLastStop:_2cd.preserveLastStop,useTimeWindows:_2cd.useTimeWindows,startTime:_2cd.startTime?_2cd.startTime.getTime():null,accumulateAttributeNames:_2cd.accumulateAttributes,impedanceAttributeName:_2cd.impedanceAttribute,restrictionAttributeNames:_2cd.restrictionAttributes,restrictUTurns:_2cd.restrictUTurns,useHierarchy:_2cd.useHierarchy,directionsLanguage:_2cd.directionsLanguage,outputGeometryPrecision:_2cd.outputGeometryPrecision,outputGeometryPrecisionUnits:_2cd.outputGeometryPrecisionUnits,directionsLengthUnits:_2cd.directionsLengthUnits?_2bb[_2cd.directionsLengthUnits]:null,directionsTimeAttributeName:_2cd.directionsTimeAttribute};_1fc.handle(this.url,"solve",_2d3,null,_9,this,this._responseHandler,_2ce);};var _2d4;_2c0.prototype._responseHandler=function(_2d5,_2d6,_2d7){var _2d8=null;if(_2d5){var _2d9=_2d5.directions,_2da=_2d5.routes,_2db=_2d5.stops,_2dc=_2d5.barriers,_2dd=_2d5.messages;var i,j,k,len,flen,plen,tmp,_2e5,_2e6,feat;_2d8=new _2bf();_2d8.results=[];if(_2dd&&_2dd.length>0){_2d8.messages=_2d4(_2dd);}if(_2dc){_2e5=_2dc.features;if(_2e5&&_2e5.length){_2e6=_2d8.barriers=[];for(i=0,len=_2e5.length;i<len;i++){_2e6[i]=_247(_2e5[i],"esriGeometryPoint");}}}var _2e8,_2e9={},map,_2eb,_2ec=true,dirs,summ,_2ef,_2f0,pts,pt,_2f3,_2f4;if(_2db){_2e5=_2db.features;if(_2e5&&_2e5.length){for(i=0,len=_2e5.length;i<len;i++){feat=_247(_2e5[i],"esriGeometryPoint");_2eb=feat.attributes.RouteName;map=(_2e9[_2eb]=_2e9[_2eb]||{});map.stops=map.stops||[];map.stops[feat.attributes.Sequence-1]=feat;if(_2ec&&_25(_2eb)){_2ec=false;}}}}if(_2da){_2e5=_2da.features;if(_2e5&&_2e5.length){for(i=0,len=_2e5.length;i<len;i++){feat=_247(_2e5[i],"esriGeometryPolyline");_2eb=feat.attributes.Name;map=(_2e9[_2eb]=_2e9[_2eb]||{});map.route=feat;map.routeName=_2eb;}}}if(_2d9&&_2d9.length>0){for(i=0,len=_2d9.length;i<len;i++){tmp=_2d9[i];summ=tmp.summary;_2e6=tmp.features;dirs=new _2bd();dirs.routeId=tmp.routeId;_2eb=(dirs.routeName=tmp.routeName);if(summ){dirs.totalLength=summ.totalLength;dirs.totalTime=summ.totalTime;dirs.totalDriveTime=summ.totalDriveTime;dirs.bounds=_12c(summ.envelope);}_2e5=(dirs.features=[]);_2f0=[];for(j=0,flen=_2e6.length;j<flen;j++){feat=_2e6[j];pts=_143(feat.compressedGeometry);feat.geometry={paths:[pts]};feat=_247(feat,"esriGeometryPolyline");_2e5.push(feat);_2f0=_2f0.concat(pts);}_2f3=[0,0];_2f4=[];for(k=0,plen=_2f0.length;k<plen;k++){pt=_2f0[k];if(pt[0]!==_2f3[0]||pt[1]!==_2f3[1]){_2f4.push(new GLatLng(pt[1],pt[0]));_2f3=pt;}}dirs.mergedGeometry=new GPolyline(_2f4,_11.polylineStrokeColor,_11.polylineStrokeWeight,_11.polylineStrokeOpacity);map=(_2e9[_2eb]=_2e9[_2eb]||{});map.directions=dirs;map.routeName=_2eb;}}if(_2ec&&_2e9["null"]){_2ef=_2e9["null"].stops;delete _2e9["null"];}for(_2eb in _2e9){if(_2e9.hasOwnProperty(_2eb)){map=_2e9[_2eb];_2e8=new _2be();_2e8.directions=map.directions;_2e8.routeName=map.routeName;_2e8.route=map.route;if(_2ec){_2e8.stops=_2ef;}else{_2e8.stops=map.stops;}_2d8.results.push(_2e8);}}if(_2d8.results.length===0&&_2ef){_2e8=new _2be();_2e8.stops=_2ef;_2d8.results.push(_2e8);}}_12(this,"solvecomplete",_2d7,[_2d8,_2d6]);};var _2f5={METER:9001,GERMAN_METER:9031,FOOT:9002,SURVEY_FOOT:9003,CLARKE_FOOT:9005,FATHOM:9014,NAUTICAL_MILE:9030,SURVEY_CHAIN:9033,SURVEY_LINK:9034,SURVEY_MILE:9035,KILOMETER:9036,CLARKE_YARD:9037,CLARKE_CHAIN:9038,CLARKE_LINK:9039,SEARS_YARD:9040,SEARS_FOOT:9041,SEARS_CHAIN:9042,SEARS_LINK:9043,BENOIT_1895A_YARD:9050,BENOIT_1895A_FOOT:9051,BENOIT_1895A_CHAIN:9052,BENOIT_1895A_LINK:9053,BENOIT_1895B_YARD:9060,BENOIT_1895B_FOOT:9061,BENOIT_1895B_CHAIN:9062,BENOIT_1895B_LINK:9063,INDIAN_FOOT:9080,INDIAN_1937_FOOT:9081,INDIAN_1962_FOOT:9082,INDIAN_1975_FOOT:9083,INDIAN_YARD:9084,INDIAN_1937_YARD:9085,INDIAN_1962_YARD:9086,INDIAN_1975_YARD:9087,FOOT_1865:9070,RADIAN:9101,DEGREE:9102,ARCMINUTE:9103,ARCSECOND:9104,GRAD:9105,GON:9106,MICRORADIAN:9109,ARCMINUTE_CENTESIMAL:9112,ARCSECOND_CENTESIMAL:9113,MIL6400:9114,BRITISH_1936_FOOT:9095,GOLDCOAST_FOOT:9094,INTERNATIONAL_CHAIN:109003,INTERNATIONAL_LINK:109004,INTERNATIONAL_YARD:109001,STATUTE_MILE:9093,SURVEY_YARD:109002,LENGTH_50KILOMETER:109030,LENGTH_150KILOMETER:109031,DECIMETER:109005,CENTIMETER:109006,MILLIMETER:109007,INTERNATIONAL_INCH:109008,US_SURVEY_INCH:109009,INTERNATIONAL_ROD:109010,US_SURVEY_ROD:109011,US_NAUTICAL_MILE:109012,UK_NAUTICAL_MILE:109013};var _2f6=function(){this.geometries=null;this.inSpatialReference=null;this.outSpatialReference=null;this.geometryType=null;};var _2f7=function(){this.geometries=null;this.distances=null;this.unit=_2f5.METER;this.unionResults=false;this.bufferSpatialReference=null;};var _2f8=function(){this.geometries1=null;this.geometries2=null;this.relation=null;this.comparisonString=null;};var _2f9={CROSS:"esriGeometryRelationCross",DISJOINT:"esriGeometryRelationDisjoint",IN:"esriGeometryRelationIn",INTERIOR_INTERSECTION:"esriGeometryRelationInteriorIntersection",INTERSECTION:"esriGeometryRelationIntersection",LINE_COINCIDENCE:"esriGeometryRelationLineCoincidence",LINE_TOUCH:"esriGeometryRelationLineTouch",OVERLAP:"esriGeometryRelationOverlap",POINT_TOUCH:"esriGeometryRelationPointTouch",TOUCH:"esriGeometryRelationTouch",WITHIN:"esriGeometryRelationWithin",RELATION:"esriGeometryRelationRelation"};var _2fa=function(){this.geometries=null;};var _2fb=function(){this.geometries=null;};var _2fc=function(){this.geometries=null;};var _2fd=function(url){this.url=url;};_2fd.ANGULAR_UNITS=[9101,9102,9103,9104,9105,9106,9109,9112,9113,9114];_2fd.prototype.project=function(_2ff,_300){if(!_2ff){throw new Error("Geometry.project(): 'parameters' argument is required");}var geom=_2ff.geometries;var _302=_58(geom[0]).esriType;var type=_2ff.geometryType||_302;var insr=_2ff.inSpatialReference;var _305=_2ff.outSpatialReference;if(!(_25(geom)&&_25(insr)&&_25(_305)&&_25(type))){throw new Error("Geometry.project(): 'parameters' must have value for the following properties: 'geometries', 'inSpatialReference', 'outSpatialReference' and 'geometryType'");}var _306={geometries:{geometryType:type,geometries:geom},inSR:insr,outSR:_305};if(_302){_306.geometries.geometries._AAG_=true;}_1fc.handle(this.url,"project",_306,null,_9,this,this._projectHandler,[_305,type,_300]);};_2fd.prototype._projectHandler=function(_307,_308,_309){var _30a=_309[0];var type=_309[1];var _30c=_309[2];var _30d=null;if(_307){var _30e=_307.geometries;_30d=new _2fa();if(_30a===_4){var _30f=(_30d.geometries=[]);for(var i=0,il=_30e.length;i<il;i++){_30f.push(_247({geometry:_30e[i]},type).geometry);}}else{_30d.geometries=_30e;}}_12(this,"projectcomplete",_30c,[_30d,_308]);};_2fd.prototype.simplify=function(_312,_313){if(!_312){throw new Error("Geometry.simplify(): 'geometries' argument is required");}var _314=_58(_312[0]).esriType;var _315={geometries:{geometryType:_314,geometries:_312},sr:_4};_315.geometries.geometries._AAG_=true;_1fc.handle(this.url,"simplify",_315,null,_9,this,this._simplifyHandler,[_314,_313]);};_2fd.prototype._simplifyHandler=function(_316,_317,_318){var type=_318[0];var _31a=_318[1];var _31b=null;if(_316){var _31c=_316.geometries;_31b=new _2fb();var _31d=(_31b.geometries=[]);for(var i=0,il=_31c.length;i<il;i++){_31d.push(_247({geometry:_31c[i]},type).geometry);}}_12(this,"simplifycomplete",_31a,[_31b,_317]);};_2fd.prototype.buffer=function(_320,_321){if(!_320){throw new Error("Geometry.buffer(): 'parameters' argument is required");}var geom=_320.geometries;var dt=_320.distances;if(!(_25(geom)&&_25(dt))){throw new Error("Geometry.buffer(): 'parameters' must have value for the following properties: 'geometries', 'distances'");}var unit=_320.unit;var _325={geometries:{geometryType:_58(geom[0]).esriType,geometries:geom},inSR:_4,bufferSR:_320.bufferSpatialReference||((_29(_2fd.ANGULAR_UNITS,unit)!==-1)?_4:_5),outSR:_4,distances:dt,unit:unit,unionResults:_320.unionResults};_325.geometries.geometries._AAG_=true;_1fc.handle(this.url,"buffer",_325,null,_9,this,this._bufferHandler,_321);};_2fd.prototype._bufferHandler=function(_326,_327,_328){var _329=null;if(_326){var _32a=_326.geometries;_329=new _2fc();var _32b=(_329.geometries=[]);for(var i=0,il=_32a.length;i<il;i++){_32b.push(_14e(_32a[i]));}}_12(this,"buffercomplete",_328,[_329,_327]);};_2fd.prototype.getAreasAndLengths=function(_32e,_32f){if(!_32e){throw new Error("Geometry.getAreasAndLengths(): 'polygons' argument is required");}var inSR,_331=_32e[0];if(_331&&_331.spatialReference){inSR=_331.spatialReference.wkid;}else{inSR=_4;}var self=this;if(inSR!==_5){var _333=new _2f6();_333.geometries=_32e;_333.inSpatialReference=inSR;_333.outSpatialReference=_5;_333.geometryType="esriGeometryPolygon";this.project(_333,function(_334,_335){if(_335){throw new Error("Error "+_335.code+": "+_335.message+"("+_335.details.join(",")+")");}self._areasAndLengths(_334.geometries,_32f);});}else{this._areasAndLengths(_32e,_32f);}};_2fd.prototype._areasAndLengths=function(_336,_337){var _338={polygons:_336,sr:_5};_1fc.handle(this.url,"areasAndLengths",_338,null,_9,this,this._alHandler,_337);};_2fd.prototype._alHandler=function(_339,_33a,_33b){_12(this,"areasandlengthscomplete",_33b,[_339,_33a]);};_2fd.prototype.getLengths=function(_33c,_33d){if(!_33c){throw new Error("Geometry.getLengths(): 'polylines' argument is required");}var inSR,_33f=_33c[0];if(_33f&&_33f.spatialReference){inSR=_33f.spatialReference.wkid;}else{inSR=_4;}var self=this;if(inSR!==_5){var _341=new _2f6();_341.geometries=_33c;_341.inSpatialReference=inSR;_341.outSpatialReference=_5;_341.geometryType="esriGeometryPolyline";this.project(_341,function(_342,_343){if(_343){throw new Error("Error "+_343.code+": "+_343.message+"("+_343.details.join(",")+")");}self._lengths(_342.geometries,_33d);});}else{this._lengths(_33c,_33d);}};_2fd.prototype._lengths=function(_344,_345){var _346={polylines:_344,sr:_5};_1fc.handle(this.url,"lengths",_346,null,_9,this,this._lHandler,_345);};_2fd.prototype._lHandler=function(_347,_348,_349){_12(this,"lengthscomplete",_349,[_347,_348]);};_2fd.prototype.getLabelPoints=function(_34a,_34b){if(!_34a){throw new Error("Geometry.getLabelPoints(): 'polygons' argument is required");}var _34c={polygons:_34a,sr:_4};_34c.polygons._AAG_=true;_1fc.handle(this.url,"labelPoints",_34c,null,_9,this,this._lpHandler,_34b);};_2fd.prototype._lpHandler=function(_34d,_34e,_34f){var _350=null;if(_34d){var _351=_34d.labelPoints,_352=[],i;if(_351){for(i=0;i<_351.length;i++){_352[i]=_11a(_351[i]);}}_350={labelPoints:_352};}_12(this,"labelpointscomplete",_34f,[_350,_34e]);};_2fd.prototype.relation=function(_354,_355){if(!_354){throw new Error("Geometry.relation(): 'parameters' argument is required");}var g1=_354.geometries1,g2=_354.geometries2,_358=_354.relation,_359=_354.comparisonString;if(!(_25(g1)&&_25(g2)&&_25(_358))){throw new Error("Geometry.relation(): 'parameters' must have value for the following properties: 'geometries1', 'geometries2', 'relation'");}if(_358===_2f9.RELATION&&!_25(_359)){throw new Error("Geometry.relation(): 'parameters' must have a valid 'comparisonString' property when 'relation' is RelationType.RELATION");}var _35a={geometries1:{geometryType:_58(g1[0]).esriType,geometries:g1},geometries2:{geometryType:_58(g2[0]).esriType,geometries:g2},relation:_358,relationParam:_359,sr:_4};_35a.geometries1.geometries._AAG_=_35a.geometries2.geometries._AAG_=true;_1fc.handle(this.url,"relation",_35a,null,_9,this,this._relHandler,_355);};_2fd.prototype._relHandler=function(_35b,_35c,_35d){_12(this,"relationcomplete",_35d,[_35b,_35c]);};var _35e=function(){this.paramName=null;this.dataType=null;this.value=null;};var _35f=function(){this.type=null;this.description=null;};var _360=function(){this.date=null;this.format=null;};var _361=function(){this.distance=null;this.units=null;};var _362=function(){this.url=null;};var _363=function(){this.url=null;this.format=null;};var _364=function(){this.href=null;this.width=null;this.height=null;this.bounds=null;this.scale=null;};var _365=function(){this.results=null;this.messages=null;};var _366=function(){this.jobId=null;this.jobStatus=null;this.messages=null;};var _367={CANCELLED:"esriJobCancelled",CANCELLING:"esriJobCancelling",DELETED:"esriJobDeleted",DELETING:"esriJobDeleting",EXECUTING:"esriJobExecuting",FAILED:"esriJobFailed",NEW:"esriJobNew",SUBMITTED:"esriJobSubmitted",SUCCEEDED:"esriJobSucceeded",TIMED_OUT:"esriJobTimedOut",WAITING:"esriJobWaiting"};var _368=function(){this.format="png8";this.transparent=true;this.dpi=96;this.layerIds=null;this.layerOption="show";this.layerDefinitions=[];this.bounds=null;this.width=null;this.height=null;this.zoomLevel=null;this.imageSpatialReference=_5;};var _369=function(_36a,_36b,_36c,_36d,_36e){var _36f=_36a.layerOption;var lids=_36a.layerIds;if(lids){_36f+=(":"+lids.join(","));}else{_36f="";}var bb=_36b||_36a.bounds;var _372=_36a.layerDefinitions,defs=[];for(var id in _372){if(_372.hasOwnProperty(id)&&id&&_372[id]){defs.push(id+":"+_372[id]);}}var _375={bbox:bb,size:(_36c||_36a.width||400)+","+(_36d||_36a.height||400),dpi:_36a.dpi,imageSR:(_36a.imageSpatialReference||_5),bboxSR:_36e?_5:_4,format:_36a.format,transparent:_36a.transparent,layers:_36f,layerDefs:defs.join(";")};if(bb&&bb instanceof GLatLngBounds){_375.bbox._AG_=true;}return _375;};var _376=function(json,_378){var mimg=new _364();mimg.href=json.href;mimg.width=json.width;mimg.height=json.height;mimg.scale=json.scale;var _37a=json.extent;if(_37a){mimg.bounds=_12c(_37a,_378);}return mimg;};_2d4=function(json){var out=[];var msg,_37e;if(json&&json.length){for(var i=0,il=json.length;i<il;i++){msg=json[i];_37e=new _35f();_37e.type=msg.type;_37e.description=msg.description;out.push(_37e);}}return out;};var _381=function(type,json){if(_29(["GPBoolean","GPDouble","GPLong","GPString"],type)!==-1){return json;}var out=null;var mimg;switch(type){case"GPDate":out=new _360();out.date=json;out.format="dow mon dd hh:mm:ss zzz yyyy";break;case"GPLinearUnit":out=new _361();out.distance=json.distance;out.units=json.units;break;case"GPDataFile":out=new _362();out.url=json.url;break;case"GPRasterData":case"GPRasterDataLayer":mimg=json.mapImage;if(mimg){out=_376(mimg);}else{out=new _363();out.url=json.url;out.format=json.format;}break;case"GPRecordSet":case"GPFeatureRecordSetLayer":mimg=json.mapImage;if(mimg){out=_376(mimg);}else{out=_24d(json);}break;default:out=json;break;}return out;};var _386=function(url,_388){this.url=url;this._delay=(_388)?(_388.statusUpdateInterval||1000):1000;this._outSR=(_388)?(_388.outSpatialReference||_4):_4;this._processSR=_388&&_388.processSpatialReference;this._timers=[];};_386.prototype.execute=function(_389,_38a,_38b){if(!_389){throw new Error("Geoprocessor.execute(): 'parameters' argument is required");}_389["env:outSR"]=this._outSR;_389["env:processSR"]=this._processSR;_1fc.handle(this.url,"execute",_389,null,((_38a)?_8:_9),this,this._executeHandler,_38b);};_386.prototype._executeHandler=function(_38c,_38d,_38e){var _38f=null;if(_38c){if(_38c instanceof GGeoXml){_38f=_38c;}else{var _390=_38c.results;var _391=new _365();var _392=(_391.results=[]);var res,pval,_395;for(var i=0,il=_390.length;i<il;i++){res=_390[i];pval=new _35e();pval.paramName=res.paramName;_395=(pval.dataType=res.dataType);pval.value=_381(_395,res.value);_392.push(pval);}_391.messages=_2d4(_38c.messages);_38f=_391;}}_12(this,"executecomplete",_38e,[_38f,_38d]);};_386.prototype.submitJob=function(_398,_399,_39a){if(!_398){throw new Error("Geoprocessor.submitJob(): 'parameters' argument is required");}_398["env:outSR"]=this._outSR;_398["env:processSR"]=this._processSR;_1fc.handle(this.url,"submitJob",_398,null,_9,this,this._jobHandler,[_39a,_399,true]);};_386.prototype._jobHandler=function(_39b,_39c,_39d){var cb=_39d[0];var scb=_39d[1];var _3a0=_39d[2];if(_39c){_12(this,"jobstatusupdate",null,[null,_39c]);if(_3a0){_12(this,"jobcomplete",null,[null,_39c]);}_12(null,null,scb,[null,_39c]);if(_3a0){_12(null,null,cb,[null,_39c]);}return;}var ji=new _366();var id=(ji.jobId=_39b.jobId);var _3a3=(ji.jobStatus=_39b.jobStatus);ji.messages=_2d4(_39b.messages);_12(this,"jobstatusupdate",null,[ji]);var done=false;if(_3a0){this.cancelJobStatusUpdates(id);switch(_3a3){case _367.SUBMITTED:case _367.EXECUTING:case _367.WAITING:case _367.NEW:var self=this;this._timers[id]=setTimeout(function(){self.checkJobStatus.call(self,id,cb,scb);},this._delay);break;default:done=true;_12(this,"jobcomplete",null,[ji]);break;}}_12(null,null,scb,[ji]);if(done){_12(null,null,cb,[ji]);}};_386.prototype.checkJobStatus=function(_3a6,_3a7){if(!_3a6){throw new Error("Geoprocessor.checkJobStatus(): 'jobId' argument is required");}var _3a8;if(arguments.length===3){_3a8=[_3a7,arguments[2],true];}else{_3a8=[null,_3a7,false];}_1fc.handle(this.url,"jobs/"+_3a6,{returnMessages:true},null,_9,this,this._jobHandler,_3a8);};_386.prototype.cancelJobStatusUpdates=function(_3a9){clearTimeout(this._timers[_3a9]);delete this._timers[_3a9];};_386.prototype.getResultData=function(_3aa,_3ab,_3ac,_3ad){if(!(_3aa&&_3ab)){throw new Error("Geoprocessor.getResultData(): 'jobId' and 'resultParameterName' arguments are required");}_1fc.handle(this.url,"jobs/"+_3aa+"/results/"+_3ab,{returnType:"data",outSR:_4},null,((_3ac)?_8:_9),this,this._resultDataHandler,_3ad);};_386.prototype._resultDataHandler=function(_3ae,_3af,_3b0){var _3b1=null;if(_3ae){if(_3ae instanceof GGeoXml){_3b1=_3ae;}else{var out=new _35e();out.paramName=_3ae.paramName;var _3b3=(out.dataType=_3ae.dataType);out.value=_381(_3b3,_3ae.value);_3b1=out;}}_12(this,"getresultdatacomplete",_3b0,[_3b1,_3af]);};_386.prototype.getResultImage=function(_3b4,_3b5,_3b6,_3b7){if(!(_3b4&&_3b5)){throw new Error("Geoprocessor.getResultImage(): 'jobId' and 'resultParameterName' arguments are required");}var _3b8=_369(_3b6||new _368());_1fc.handle(this.url,"jobs/"+_3b4+"/results/"+_3b5,_3b8,null,_9,this,this._resultImageHandler,_3b7);};_386.prototype._resultImageHandler=function(_3b9,_3ba,_3bb){var mi=null;if(_3b9){var _3bd=_3b9.href?_3b9:_3b9.value.mapImage;var ext=_3bd.extent;var sr=(ext)?ext.spatialReference:null;mi=_376(_3bd,((sr&&sr.wkid===102113)?true:false));}_12(this,"getresultimagecomplete",_3bb,[mi,_3ba]);};var _3c0;_386.prototype.getResultImageLayer=function(_3c1,_3c2,_3c3){if(!(_3c1&&_3c2)){throw new Error("Geoprocessor.getResultLayer(): 'jobId' and 'resultParameterName' arguments are required");}var uo=_2e(this.url);var url=uo.path+"/jobs/"+_3c1+"/results/"+_3c2;url=_3c(url,uo.query);return new _3c0(url,_3c3,1,null,true);};var _3c6=function(){this.id=null;this.name=null;this.parentLayerId=null;this.subLayerIds=null;this.defaultVisibility=null;};var _3c7=function(res,xmin,xmax,_3cb){if(!res){var _3cc=_5d.lngToX;var x1=_3cc(xmin);var x2=_3cc(xmax);res=(x2-x1)/_3cb;}var _3cf,_3d0,_3d1,glev,gres,_3d4,_3d5;_3cf=_3d0=-1;for(var i=0;i<=_d;i++){glev=i;gres=_e[i];if(res>=gres){_3d0=glev;_3cf=_3d0-1;break;}}if(_3d0===-1){_3d1=_d;}else{if(_3cf===-1){_3d1=_c;}else{_3d4=_e[_3cf]-res;_3d5=res-_e[_3d0];if(_3d4<=_3d5){_3d1=_3cf;}else{_3d1=_3d0;}}}return _3d1;};var _3d7=function(json){var _3d9=[];var lyr,_3db;for(var i=0,il=json.length;i<il;i++){lyr=json[i];_3db=new _3c6();_3db.id=lyr.id;_3db.name=lyr.name;_3db.parentLayerId=lyr.parentLayerId;_3db.subLayerIds=lyr.subLayerIds;_3db.defaultVisibility=lyr.defaultVisibility;_3d9.push(_3db);}return _3d9;};var _3de=function(url,_3e0,_3e1){this.url=url;this.fullExtent=null;this.initialExtent=null;this.layerInfos=null;this.description=null;this.copyright=null;var _3e2,opac,_3e4,_3e5;_3e2=opac=_3e4=_3e5=null;if(_3e0){_3e2=_3e0.copyrights;opac=_3e0.opacity;_3e4=_3e0.minResolution;_3e5=_3e0.maxResolution;}this._options=_4a(_3e0);this._copyrights=_3e2;this._opacity=(opac!==null)?opac:1;this._minZoomLevel=(this._minResolution=(_3e4!==null)?_3e4:_c);this._maxZoomLevel=(this._maxResolution=(_3e5!==null)?_3e5:_d);this._format=null;this._fileExtension=null;this._tileZoomLevels=null;_1fc.handle(url,null,null,null,_9,this,this._responseHandler,_3e1);};if(_f){_3de.prototype=new GTileLayer();}_3de._BLANK_TILE="http://serverapi.arcgisonline.com/jsapi/gmaps/transparent.png";_3de.prototype.getTileUrl=function(tile,zoom){var _3e8=_3de._BLANK_TILE;if(zoom<this._minZoomLevel||zoom>this._maxZoomLevel){return _3e8;}var tx=tile.x;var ty=tile.y;var trng=this._tileRange[zoom];var swX=trng.swX;var swY=trng.swY;var neX=trng.neX;var neY=trng.neY;if((tx<swX||tx>neX)||(ty<neY||ty>swY)){return _3e8;}var uo=_2e(this.url);var url=uo.path+"/tile/"+this._tileZoomLevels[zoom]+"/"+ty+"/"+tx+"."+this._fileExtension;url=_3c(url,uo.query);url=_1f6(url);return url;};_3de.prototype.isPng=function(){return(this._fileExtension==="png")?true:false;};_3de.prototype.getOpacity=function(){return this._opacity;};_3de.prototype.getCopyright=function(_3f2,zoom){var _3f4=this._copyrights;return(_3f4)?_3f4.getCopyrightNotice(_3f2,zoom):(this.copyright||"");};_3de.prototype._responseHandler=function(_3f5,_3f6,_3f7){if(_3f5){var sr=_3f5.spatialReference;var _3f9=_3f5.tileInfo;if(!_3f9){throw new Error("The map service, "+this.url+", does not have tile information");}var wkid=sr.wkid||null;if(_29(_6,wkid)===-1){throw new Error("Spatial reference, "+wkid+", of the map service, "+this.url+", is not compatible with Google Maps. Expected one of the following spatial references: "+_6.join(","));}var rows=_3f9.rows||null;var cols=_3f9.cols||null;if(rows!==_a||cols!==_b){throw new Error("Tile size, "+rows+"px X "+cols+"px, of the map service, "+this.url+", is not compatible with Google Maps. Expected tile size = "+_a+"px X "+_b+"px");}var lods=_3f9.lods;if(!lods){throw new Error("The map service, "+this.url+", does not have zoom level information");}var full=_3f5.fullExtent;this.description=_3f5.description;this.copyright=_3f5.copyrightText;this.fullExtent=_12c(full,true);this.initialExtent=_12c(_3f5.initialExtent,true);this.layerInfos=_3d7(_3f5.layers);this._format=_3f9.format;this._fileExtension={PNG:"png",PNG8:"png",PNG24:"png",PNG32:"png",JPG:"jpg",JPEG:"jpg",GIF:"gif"}[this._format];this._setZoomLevels(lods);var _3ff=(this._tileRange=[]);var ori=_3f9.origin;for(var i=_c;i<=_d;i++){_3ff[i]=this._getTileCoordinates(ori,full,i);}if(_10){var uo=_2e(this.url);var url=uo.path+"/tile/{Z}/{Y}/{X}."+this._fileExtension;url=_3c(url,uo.query);url=_1f6(url);this._options.tileUrlTemplate=url;GTileLayer.call(this,null,this._minResolution,this._maxResolution,this._options);}}_12(this,"load",_3f7,[this,_3f6]);};_3de.prototype._getTileCoordinates=function(_404,_405,zoom){var abs=Math.abs;var _408=Math.floor;var res=_e[zoom];var _40a=res*_b;var _40b=res*_a;var _40c=abs(_405.xmin-_404.x);var _40d=abs(_405.ymin-_404.y);var _40e=abs(_405.xmax-_404.x);var _40f=abs(_405.ymax-_404.y);return{swX:_408(_40c/_40a),swY:_408(_40d/_40b),neX:_408(_40e/_40a),neY:_408(_40f/_40b)};};_3de.prototype._setZoomLevels=function(lods){var tzl=(this._tileZoomLevels=[]);var lod,lev,res,_415;var _416=_d;var _417=_c;for(var i=0,il=lods.length;i<il;i++){lod=lods[i];lev=lod.level;res=lod.resolution;_415=_3c7(res);tzl[_415]=lev;if(_415<_416){_416=_415;}if(_415>_417){_417=_415;}}this._minZoomLevel=(_416>this._minResolution)?_416:this._minResolution;this._maxZoomLevel=(_417<this._maxResolution)?_417:this._maxResolution;};_3c0=function(url,_41b,_41c,_41d){this.url=url;this.fullExtent=null;this.initialExtent=null;this.layerInfos=null;this.description=null;this.copyright=null;this._options=(_41b)?_4a(_41b):new _368();this._opacity=_25(_41c)?_41c:1;this._callback=_41d;this._operation="export";this._setImageTag();var gp=arguments[4];if(gp){this._GP_=true;this._operation="";return this;}else{_1fc.handle(this.url,null,null,null,_9,this,this._responseHandler,_41d);}};if(_f){_3c0.prototype=new GOverlay();}_3c0.prototype.initialize=function(map){var div=document.createElement("div");div.style.position="absolute";map.getPane(G_MAP_OVERLAY_LAYER_PANE).appendChild(div);this._map=map;this._div=div;if(!_25(this._visible)||this._visible){this.show();}};_3c0.prototype.remove=function(){var div=this._div;this._cancelRequests();this.hide();this._markImages();this._removeImages();if(div){_1b(div);}this._images=this._div=this._map=null;};_3c0.prototype.copy=function(){return new _3c0(this.url,this._options,this._opacity);};_3c0.prototype.redraw=function(_422){};_3c0.prototype._redraw=function(_423){if(this._pending){this._cancelRequests();}this._requests=[];this._pending=1;var _424=this._map.getBounds();var _425=_424.isFullLng();var _426=this._getAdjustedExtents(_424);var _427=this._getRequestParameters(_426),i,len=_427.length;this._pending=len;this._markImages();if(_423){this._removeImages();}for(i=0;i<len;i++){this._requests[i]=_1fc.handle(this.url,this._operation,_427[i],null,_9,this,this._redrawHandler,[_425,len]);}};_3c0.prototype._redrawHandler=function(_42a,_42b,_42c){if(_42b){throw new Error("Error "+_42b.code+": "+_42b.message+"("+_42b.details.join(",")+")");}if(this._moving){this._cancelRequests();return;}var _42d=_42c[0],_42e=_42c[1];if(this._png24){if(this._pending===_42e){this._removeImages();}this._pending--;}var _42f=_42a.href?_42a:_42a.value.mapImage;var uo=_2e(this.url);var url=_42f.href;url=_3c(url,uo.query);url=_1f6(url);var _432=_12c(_42f.extent,true);var div=this._div;var map=this._map;var left=map.fromLatLngToDivPixel(_432.getSouthWest()).x;var top=map.fromLatLngToDivPixel(_432.getNorthEast()).y;var _437=map.getSize().width;var _438=[[left,top]];if(_42d){var _439=parseInt(div.parentNode.parentNode.style.left,10);var _43a=Math.floor(Math.pow(2,map.getZoom())*_b);var pos=left-_43a,_43c=pos+_439,_43d;while(_43c>0){_438.push([pos,top]);_43c-=_43a;pos-=_43a;}_438.push([pos,top]);pos=left+_43a;_43d=pos+_439;while(_43d<=_437){_438.push([pos,top]);_43d+=_43a;pos+=_43a;}if(!this._png24){this._pending=_438.length;}}this._createImages(url,_438,_42f.width+"px",_42f.height+"px");this.setOpacity(this._opacity);if(this._png24){div.style.display="";if(this._pending===0){_12(this,"update",null,[]);}}};_3c0.prototype._cancelRequests=function(){var req=this._requests;if(!req){return;}var i,len=req.length;for(i=0;i<len;i++){_1fc.cancel(req[i]);}this._requests=this._pending=null;var j,_442=this._images;if(_442){len=_442.length;for(j=0;j<len;j++){GEvent.clearListeners(_442[j],"load");}}this._images=this._markedImages;this._markedImages=null;};_3c0.prototype._createImages=function(url,_444,_445,_446){var i,len=_444.length,div=this._div,img,_44b=this._images||[],ist;for(i=0;i<len;i++){img=document.createElement(this._tag);ist=img.style;ist.position="absolute";ist.MozUserSelect="none";ist.left=_444[i][0]+"px";ist.top=_444[i][1]+"px";if(this._png24){ist.width=_445;ist.height=_446;var img2=document.createElement("div");var ist2=img2.style;ist2.filter="alpha(opacity=0)";ist2.width=_445;ist2.height=_446;img.appendChild(img2);div.appendChild(img);}else{GEvent.addDomListener(img,"load",GEvent.callbackArgs(this,this._imageLoaded,img));}img.src=url;_44b.push(img);}this._images=_44b;};_3c0.prototype._imageLoaded=function(img){GEvent.clearListeners(img,"load");this._pending--;if(this._pending===0){_12(this,"update",null,[]);this._removeImages();this._div.style.display="";this._addImages();}};_3c0.prototype._addImages=function(){var i,_451=this._images,len,div=this._div;if(!_451){return;}len=_451.length;for(i=0;i<len;i++){div.appendChild(_451[i]);}};_3c0.prototype._markImages=function(){this._markedImages=this._images;this._images=null;};_3c0.prototype._removeImages=function(){var _454=this._markedImages;if(!_454){return;}var i,len=_454.length,img;for(i=0;i<len;i++){img=_454[i];_1b(img);}this._markedImages=null;};_3c0.prototype._getRequestParameters=function(_458){var _459,i,len=_458.length,map=this._map,abs=Math.abs,xmin,ymin,xmax,ymax,c1,c2,_464,_465,merc=_5d,_467=[];for(i=0;i<len;i++){_459=_458[i];xmin=_459.xmin;ymin=_459.ymin;xmax=_459.xmax;ymax=_459.ymax;c1=map.fromLatLngToDivPixel(new GLatLng(ymin,xmin));c2=map.fromLatLngToDivPixel(new GLatLng(ymax,xmax));_464=abs(c1.x-c2.x);_465=abs(c1.y-c2.y);_464=this._getAdjustedWidth(xmin,xmax,map.getZoom(),_464);_459.xmin=merc.lngToX(_459.xmin);_459.ymin=merc.latToY(_459.ymin);_459.xmax=merc.lngToX(_459.xmax);_459.ymax=merc.latToY(_459.ymax);_467.push(this._getExportParameters(this._options,_459,_464,_465,true));}return _467;};_3c0.prototype._getExportParameters=_369;_3c0.prototype._getAdjustedExtents=function(_468){var sw=_468.getSouthWest();var ne=_468.getNorthEast();var xmin=sw.lng(),ymin=sw.lat();var xmax=ne.lng(),ymax=ne.lat();if(ymax>89){ymax=89;}if(ymin<-89){ymin=-89;}var _46f=[{xmin:xmin,ymin:ymin,xmax:xmax,ymax:ymax}];if(xmin>xmax){_46f[1]=_4a(_46f[0]);_46f[1].xmin=-180;_46f[0].xmax=180;}return _46f;};_3c0.prototype._getAdjustedWidth=function(xmin,xmax,zoom,_473){var _474=Math.floor;if(!_473){var _475=_5d.lngToX;var x1=_475(xmin);var x2=_475(xmax);_473=_474((x2-x1)/_e[zoom]);}if(xmin===-180&&xmax===180){_473=_474(Math.pow(2,zoom)*_b);}return _473;};_3c0.prototype._getHeight=function(ymin,ymax,zoom){var _47b=_5d.latToY;var y1=_47b(ymin);var y2=_47b(ymax);var _47e=Math.floor((y2-y1)/_e[zoom]);return _47e;};_3c0.prototype._moveStartHandler=function(){this._movestart=true;this._div.style.display="";};_3c0.prototype._moveHandler=function(){if(!this._movestart){this._div.style.display="none";}else{this._div.style.display="";this._moving=true;}};_3c0.prototype._moveEndHandler=function(){var _47f=!this._movestart;this._movestart=false;this._moving=false;this._redraw(_47f);};_3c0.prototype._setHandlers=function(){var map=this._map;var bind=GEvent.bind;if(!this._handle_movestart){this._handle_movestart=bind(map,"movestart",this,this._moveStartHandler);}if(!this._handle_move){this._handle_move=bind(map,"move",this,this._moveHandler);}if(!this._handle_moveend){this._handle_moveend=bind(map,"moveend",this,this._moveEndHandler);}};_3c0.prototype._clearHandlers=function(){var _482=this._handle_movestart;var move=this._handle_move;var end=this._handle_moveend;var _485=GEvent.removeListener;if(_482){_485(_482);}if(move){_485(move);}if(end){_485(end);}this._handle_movestart=this._handle_move=this._handle_moveend=null;};_3c0.prototype._setVisiblity=function(v){var div=this._div;if(!div){return;}if(v){if(!this._visible){this._redraw();this._setHandlers();}}else{if(this._visible){div.style.display="none";this._clearHandlers();}}};_3c0.prototype.show=function(){this._setVisiblity(true);this._visible=true;};_3c0.prototype.hide=function(){this._setVisiblity(false);this._visible=false;};_3c0.prototype.isHidden=function(){return!this._visible;};_3c0.prototype.supportsHide=function(){return true;};_3c0.prototype.refresh=function(){if(this._visible&&this._map){this._redraw();}};_3c0.prototype.setVisibleLayers=function(_488){var opts=this._options;opts.layerIds=_488;opts.layerOption="show";this.refresh();};_3c0.prototype.getVisibleLayers=function(){var _48a=this._options.layerIds,_48b=this._defaultVisibleLayers,_48c=null;if(_48a){_48c=_48a.slice(0);}else{if(_48b){_48c=_48b.slice(0);}}return _48c;};_3c0.prototype.setDefaultVisibleLayers=function(){this._options.layerIds=null;this.refresh();};_3c0.prototype.setLayerDefinitions=function(_48d){this._options.layerDefinitions=_48d;this.refresh();};_3c0.prototype.getLayerDefinitions=function(){var _48e=this._options.layerDefinitions,_48f=null,id;if(_48e){_48f=[];for(id in _48e){if(_48e.hasOwnProperty(id)){_48f[id]=_48e[id];}}}return _48f;};_3c0.prototype.clearLayerDefinitions=function(){this._options.layerDefinitions=null;this.refresh();};_3c0.prototype._setImageTag=function(){var _491=this._options.format;this._png24=_3===6&&_491&&_491.toLowerCase()==="png24"&&this._options.transparent;this._tag=this._png24?"div":"img";};_3c0.prototype.setImageFormat=function(_492){this._options.format=_492;this._setImageTag();this.refresh();};_3c0.prototype.setOpacity=function(_493){var op=(this._opacity=_493);var _495=this._images;if(!_495){return;}if(op<0){op=0;}if(op>1){op=1;}var _496,_497,ist=document.createElement("img").style;if("filter"in ist){var _op=Math.floor(op*100);_496="filter";_497="alpha(opacity:"+_op+")";}if("KHTMLOpacity"in ist){_496="KHTMLOpacity";_497=op;}if("MozOpacity"in ist){_496="MozOpacity";_497=op;}if("opacity"in ist){_496="opacity";_497=op;}var i,len=_495.length;for(i=0;i<len;i++){_495[i].style[_496]=this._png24?"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_495[i].src+"'), "+_497:_497;}};_3c0.prototype._responseHandler=function(_49c,_49d,_49e){var done=true;if(_49c){this.description=_49c.description;this.copyright=_49c.copyrightText;this.layerInfos=_3d7(_49c.layers);var i,_4a1=[],_4a2=this.layerInfos,len=_4a2.length,_4a4;for(i=0;i<len;i++){_4a4=_4a2[i];if(_4a4.defaultVisibility){_4a1.push(_4a4.id);}}this._defaultVisibleLayers=_4a1;var init=_49c.initialExtent;var full=_49c.fullExtent;var isr=init.spatialReference.wkid;done=true;switch(isr){case 4326:this.initialExtent=_12c(init);this.fullExtent=_12c(full);break;case 102113:this.initialExtent=_12c(init,true);this.fullExtent=_12c(full,true);break;default:var _4a8=_11.geometryServiceUrl;this.initialExtent=init;this.fullExtent=full;if(_4a8){done=false;var gs=new _2fd(_4a8);var _4aa=[{x:init.xmin,y:init.ymin},{x:init.xmax,y:init.ymax},{x:full.xmin,y:full.ymin},{x:full.xmax,y:full.ymax}];var _4ab=new _2f6();_4ab.geometries=_4aa;_4ab.geometryType="esriGeometryPoint";_4ab.inSpatialReference=isr;_4ab.outSpatialReference=_4;var self=this;var _cb=function(){self._projectHandler.call(self,arguments[0],arguments[1],_49e);};gs.project(_4ab,_cb);}break;}}if(done){_12(this,"load",_49e,[this,_49d]);}};_3c0.prototype._projectHandler=function(_4ae,_4af,_4b0){if(_4ae){var _4b1=_4ae.geometries;this.initialExtent=new GLatLngBounds(_4b1[0][0].getLatLng(),_4b1[1][0].getLatLng());this.fullExtent=new GLatLngBounds(_4b1[2][0].getLatLng(),_4b1[3][0].getLatLng());}_12(this,"load",_4b0,[this,_4af]);};_3c0.prototype.exportMapImage=function(_4b2,_4b3){var _4b4=_4a(this._options),_4b5;if(_4b2){for(_4b5 in _4b2){if(_4b2.hasOwnProperty(_4b5)){_4b4[_4b5]=_4b2[_4b5];}}}var map=this._map;var _4b7=_4b4.bounds||map&&map.getBounds();var size=map&&map.getSize();var _4b9=_4b4.width||size&&size.width;var _4ba=_4b4.height||size&&size.height;var zoom=_4b4.zoomLevel;if(!_25(_4b7)){throw new Error("DynamicMapServiceLayer.exportMapImage(): 'parameters' must have a value for 'bounds' property");}if(_25(zoom)){_4b7=this._getAdjustedExtents(_4b7)[0];var xmin=_4b7.xmin,ymin=_4b7.ymin,xmax=_4b7.xmax,ymax=_4b7.ymax;_4b9=this._getAdjustedWidth(xmin,xmax,zoom);_4ba=this._getHeight(ymin,ymax,zoom);}_1fc.handle(this.url,this._operation,this._getExportParameters(_4b4,_4b7,_4b9,_4ba),null,_9,this,this._exportHandler,_4b3);};_3c0.prototype._exportHandler=function(_4c0,_4c1,_4c2){var mi=null;if(_4c0){var ext=_4c0.extent;var sr=(ext)?ext.spatialReference:null;mi=_376(_4c0,((sr&&sr.wkid===102113)?true:false));}_12(this,"exportcomplete",_4c2,[mi,_4c1]);};var _4c6=function(){this.bounds=null;this.width=null;this.height=null;this.format="png";this.interpolation=null;this.compressionQuality=null;this.bandIds=null;this.imageSpatialReference=_5;};var _4c7=function(url,_4c9,_4ca,_4cb){this.url=url;this._options=(_4c9)?_4a(_4c9):new _368();this._opacity=_25(_4ca)?_4ca:1;this._callback=_4cb;this._operation="exportImage";this._setImageTag();_1fc.handle(this.url,null,null,null,_9,this,this._responseHandler,_4cb);};var _4cc=_3c0.prototype;if(_f){_4c7.prototype=new GOverlay();}_4c7.prototype.initialize=_4cc.initialize;_4c7.prototype.remove=_4cc.remove;_4c7.prototype.copy=function(){return new _4c7(this.url,this._options,this._opacity);};_4c7.prototype.redraw=_4cc.redraw;_4c7.prototype._redraw=_4cc._redraw;_4c7.prototype._redrawHandler=_4cc._redrawHandler;_4c7.prototype._cancelRequests=_4cc._cancelRequests;_4c7.prototype._createImages=_4cc._createImages;_4c7.prototype._imageLoaded=_4cc._imageLoaded;_4c7.prototype._addImages=_4cc._addImages;_4c7.prototype._markImages=_4cc._markImages;_4c7.prototype._removeImages=_4cc._removeImages;_4c7.prototype._getRequestParameters=_4cc._getRequestParameters;_4c7.prototype._getExportParameters=function(_4cd,_4ce,_4cf,_4d0,_4d1){var bb=_4ce||_4cd.bounds;var _4d3={bbox:bb,size:(_4cf||_4cd.width||400)+","+(_4d0||_4cd.height||400),imageSR:(_4cd.imageSpatialReference||_5),bboxSR:_4d1?_5:_4,format:_4cd.format,interpolation:_4cd.interpolation,compressionQuality:_4cd.compressionQuality,bandIds:_4cd.bandIds};if(bb&&bb instanceof GLatLngBounds){_4d3.bbox._AG_=true;}return _4d3;};_4c7.prototype._getAdjustedExtents=_4cc._getAdjustedExtents;_4c7.prototype._getAdjustedWidth=_4cc._getAdjustedWidth;_4c7.prototype._getHeight=_4cc._getHeight;_4c7.prototype._moveStartHandler=_4cc._moveStartHandler;_4c7.prototype._moveHandler=_4cc._moveHandler;_4c7.prototype._moveEndHandler=_4cc._moveEndHandler;_4c7.prototype._setHandlers=_4cc._setHandlers;_4c7.prototype._clearHandlers=_4cc._clearHandlers;_4c7.prototype._setVisiblity=_4cc._setVisiblity;_4c7.prototype.show=_4cc.show;_4c7.prototype.hide=_4cc.hide;_4c7.prototype.isHidden=_4cc.isHidden;_4c7.prototype.supportsHide=_4cc.supportsHide;_4c7.prototype.refresh=_4cc.refresh;_4c7.prototype.setInterpolation=function(type){this._options.interpolation=type;this.refresh();};_4c7.prototype.setCompressionQuality=function(_4d5){this._options.compressionQuality=_4d5;this.refresh();};_4c7.prototype.setBandIds=function(_4d6){this._options.bandIds=_4d6;this.refresh();};_4c7.prototype._setImageTag=function(){var _4d7=this._options.format;this._png24=_3===6&&_4d7&&_4d7.toLowerCase()==="png24";this._tag=this._png24?"div":"img";};_4c7.prototype.setImageFormat=_4cc.setImageFormat;_4c7.prototype.setOpacity=_4cc.setOpacity;_4c7.prototype._responseHandler=function(_4d8,_4d9,_4da){var done=true;if(_4d8){this.name=_4d8.name;this.description=_4d8.description;this.pixelSize=new GSize(_4d8.pixelSizeX,_4d8.pixelSizeY);this.pixelType=_4d8.pixelType;this.minPixelSize=_4d8.minPixelSize;this.maxPixelSize=_4d8.maxPixelSize;this.copyright=_4d8.copyrightText;this.serviceDataType=_4d8.serviceDataType;var _4dc=_4d8.bandCount;var _4dd=[];var min=_4d8.minValues;var max=_4d8.maxValues;var mean=_4d8.meanValues;var stdv=_4d8.stdvValues;for(var i=0;i<_4dc;i++){_4dd[i]={min:min[i],max:max[i],mean:mean[i],stddev:stdv[i]};}this.bands=_4dd;this.extent=_4d8.extent;var ext=this.extent,sr=ext.spatialReference.wkid;done=true;switch(sr){case 4326:this.extent=_12c(ext);break;case 102113:this.extent=_12c(ext,true);break;default:var _4e5=_11.geometryServiceUrl;if(_4e5){done=false;var gs=new _2fd(_4e5);var _4e7=[{x:ext.xmin,y:ext.ymin},{x:ext.xmax,y:ext.ymax}];var _4e8=new _2f6();_4e8.geometries=_4e7;_4e8.geometryType="esriGeometryPoint";_4e8.inSpatialReference=sr;_4e8.outSpatialReference=_4;var self=this;var _cb=function(){self._projectHandler.call(self,arguments[0],arguments[1],_4da);};gs.project(_4e8,_cb);}break;}}if(done){_12(this,"load",_4da,[this,_4d9]);}};_4c7.prototype._projectHandler=function(_4eb,_4ec,_4ed){if(_4eb){var _4ee=_4eb.geometries;this.extent=new GLatLngBounds(_4ee[0][0].getLatLng(),_4ee[1][0].getLatLng());}_12(this,"load",_4ed,[this,_4ec]);};_4c7.prototype.exportImage=function(_4ef,_4f0){var _4f1=_4a(this._options),_4f2;if(_4ef){for(_4f2 in _4ef){if(_4ef.hasOwnProperty(_4f2)){_4f1[_4f2]=_4ef[_4f2];}}}var map=this._map;var _4f4=_4f1.bounds||map&&map.getBounds();var size=map&&map.getSize();var _4f6=_4f1.width||size&&size.width;var _4f7=_4f1.height||size&&size.height;if(!_25(_4f4)){throw new Error("DynamicMapServiceLayer.exportImage(): 'parameters' must have a value for 'bounds' property");}_1fc.handle(this.url,this._operation,this._getExportParameters(_4f1,_4f4,_4f6,_4f7),null,_9,this,this._exportHandler,_4f0);};_4c7.prototype._exportHandler=_4cc._exportHandler;var _4f8=function(_4f9){var _4fa=[],res;if(_4f9 instanceof _246){_4fa.push(_4f9);}else{if(_4f9 instanceof _e3){res=_4f9.features;for(var i=0,il=res.length;i<il;i++){_4fa.push(res[i]);}}}return _4fa;};var _4fe=function(_4ff){var _500=[],res;if(_4ff instanceof _264){_500.push(_266(_4ff));}else{if(_4ff instanceof _265){res=_4ff.addressCandidates;for(var i=0,il=res.length;i<il;i++){_500.push(_266(res[i]));}}}return _500;};var _504=function(_505){var _506=[],res;if(_505 instanceof _28a){_506.push(_505.feature);}else{if(_505 instanceof _28b){res=_505.identifyResults;for(var i=0,il=res.length;i<il;i++){_506.push(res[i].feature);}}}return _506;};var _50a=function(_50b){var _50c=[],res;if(_50b instanceof _2a4){_50c.push(_50b.feature);}else{if(_50b instanceof _2a5){res=_50b.findResults;for(var i=0,il=res.length;i<il;i++){_50c.push(res[i].feature);}}}return _50c;};var _510=function(_511){var _512=[],res,val,_515,i,il,j,jl;if(_511 instanceof _35e){val=_511.value;if(val&&val instanceof _e3){res=val.features;for(i=0,il=res.length;i<il;i++){_512.push(res[i]);}}}else{if(_511 instanceof _365){_515=_511.results;for(i=0,il=_515.length;i<il;i++){val=_515[i].value;if(val&&val instanceof _e3){res=val.features;for(j=0,jl=res.length;j<jl;j++){_512.push(res[j]);}}}}}return _512;};var _51a=function(_51b){var _51c=[],res;res=_51b.geometries;for(var i=0,il=res.length;i<il;i++){_51c.push({geometry:res[i]});}return _51c;};var _520=function(_521){var ovs=null;if(_521 instanceof _246||_521 instanceof _e3){ovs=_4f8(_521);}else{if(_521 instanceof _264||_521 instanceof _265){ovs=_4fe(_521);}else{if(_521 instanceof _28a||_521 instanceof _28b){ovs=_504(_521);}else{if(_521 instanceof _2a4||_521 instanceof _2a5){ovs=_50a(_521);}else{if(_521 instanceof _2fa||_521 instanceof _2fb||_521 instanceof _2fc){ovs=_51a(_521);}else{if(_521 instanceof _35e||_521 instanceof _365){ovs=_510(_521);}}}}}}return ovs;};var _523=function(map){this.map=map;};_523.prototype.addToMap=function(_525,_526,_527){if(_10){throw new Error("MapExtension: Asynchronous call to synchronous method: addToMap. Use addToMapAsync instead");}var _528=[],ovs,i,il,fe,type="",meta;var map=this.map;var fes=_520(_525);if(fes){fe=fes[0];if(fe&&fe.geometry){type=_58(fe.geometry).gmapsType;}meta={flags:_1e2(_526,type),style:_161(_526,type),type:type};for(i=0,il=fes.length;i<il;i++){ovs=_1d0(fes[i],_526,_527,meta,map);_528.push(ovs);}}else{if(_525 instanceof GGeoXml){map.addOverlay(_525);_528.push([_525]);}else{if(_525 instanceof _3de){var tov=new GTileLayerOverlay(_525);map.addOverlay(tov);_528.push([tov]);}else{throw new Error("MapExtension.addToMap(): 'results' argument should be one of the following types: FeatureSet, Feature, FindResults, FindResult, IdentifyResults, IdentifyResult, AddressResults, AddressCandidate, ProjectResults, SimplifyResults, BufferResults, GGeoXml, ParameterValue, GPResults, TiledMapServiceLayer");}}}return _528;};_523.prototype.addToMapAsync=function(_532,_533,_534,_535){if(!_535){throw new Error("MapExtension.addToMapAsync(): 'callback' argument is required");}_533=_4a(_533);_534=_4a(_534);var _536=[],i,il,fe,type="",meta;var map=this.map;var args=[];var fes=_520(_532);if(fes){fe=fes[0];if(fe&&fe.geometry){type=_58(fe.geometry).gmapsType;}meta={flags:_1e2(_533,type),style:_161(_533,type),type:type};for(i=0,il=fes.length;i<il;i++){args.push(_86);args.push("_addCustomOverlays");args.push([fes[i],_533,_534,meta,map]);}args.push(function(){var j,jl,_536=[];for(j=0,jl=arguments.length;j<jl;j++){_536.push(arguments[j]);}_535(_536);});GAsync.apply(null,args);}else{if(_532 instanceof GGeoXml){map.addOverlay(_532);_536.push([_532]);_535(_536);}else{if(_532 instanceof _3de){var tov=new GTileLayerOverlay(_532);map.addOverlay(tov);_536.push([tov]);_535(_536);}else{throw new Error("MapExtension.addToMapAsync(): 'results' argument should be one of the following types: FeatureSet, Feature, FindResults, FindResult, IdentifyResults, IdentifyResult, AddressResults, AddressCandidate, ProjectResults, SimplifyResults, BufferResults, GGeoXml, ParameterValue, GPResults, TiledMapServiceLayer");}}}};_523.prototype.removeFromMap=function(_542){if(!_542){return;}var map=this.map;var ovs,ov;for(var i=0,il=_542.length;i<il;i++){ovs=_542[i];for(var j=0,jl=ovs.length;j<jl;j++){ov=ovs[j];GEvent.clearListeners(ov,"click");map.removeOverlay(ov);}}};return{_RestRequest:_1fc,JSONRequest:_1fc.JSONRequest,_MercatorProjection:_5d,SpatialRelationship:_244,Config:_11,QueryTask:_257,Locator:_26e,FindTask:_2a6,Geometry:_2fd,Geoprocessor:_386,IdentifyTask:_28c,RouteTask:_2c0,Query:_245,IdentifyParameters:_289,FindParameters:_2a3,FeatureSet:_e3,Feature:_246,SRUnitType:_2f5,ProjectParameters:_2f6,BufferParameters:_2f7,RelationParameters:_2f8,RelationType:_2f9,GPDate:_360,LinearUnit:_361,DataFile:_362,RasterData:_363,JobStatus:_367,DataLayer:_2b7,NAOutputLine:_2b8,NAUTurn:_2b9,Units:_2ba,RouteParameters:_2bc,DirectionsFeatureSet:_2bd,TiledMapServiceLayer:_3de,DynamicMapServiceLayer:_3c0,ImageParameters:_368,ImageServiceLayer:_4c7,ImageServiceParameters:_4c6,MapExtension:_523};};return{gmaps:_2()};};var _54a=function(ns,_54c){var ns_t=typeof _54c[ns];if(ns_t==="undefined"){_54c[ns]={};return _54c[ns];}else{if(ns_t==="object"){return _54c[ns];}}throw new Error("Unable to establish namespace for the library. Namespace \""+ns+"\" of type \""+ns_t+"\" already exists.");};var _54e=_54a("esri",this);var _54f=_54a("arcgis",_54e);_54f.gmaps=_1().gmaps;}());
