/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */

window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","esri._coremap"],["require","dijit._base.manager"],["require","esri.geometry"],["require","esri.utils"],["require","esri.fx"],["require","dojox.gfx.matrix"],["require","esri.layers.graphics"],["require","esri.dijit.InfoWindow"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri._coremap"]){_4._hasResource["esri._coremap"]=true;_4.provide("esri._coremap");_4.require("dijit._base.manager");_4.require("esri.geometry");_4.require("esri.utils");_4.require("esri.fx");_4.require("dojox.gfx.matrix");_4.require("esri.layers.graphics");_4.require("esri.dijit.InfoWindow");_4.declare("esri._CoreMap",null,(function(){var _7=esri.geometry.toMapPoint,_8=esri.geometry.toScreenPoint,dc=_4.connect,_9=_4.disconnect,dh=_4.hitch,ds=_4.style,_a=_4.indexOf,_b=_4.mixin,_c=esri.geometry.Point,_d=esri.geometry.Extent,_e=esri.layers.GraphicsLayer,_f=esri.geometry.Rect,uid=0,_10=esri.config.defaults.map;var _11=1000000,_12=0.75,_13=0.25,_14=3,_15=20,_16=40;function _17(_18,_19){var _1a=_18.lods;_1a.sort(function(l1,l2){if(l1.scale>l2.scale){return -1;}else{if(l1.scale<l2.scale){return 1;}}return 0;});var _1b=[];_1a=_4.filter(_1a,function(l){if(_a(_1b,l.scale)===-1){_1b.push(l.scale);return true;}});var pl=(_19.lods=[]),l;_4.forEach(_1a,function(lod,_1c){l=(pl[_1c]=new esri.layers.LOD(lod));l.level=_1c;});_19.tileInfo=new esri.layers.TileInfo(_b(_18,{lods:pl}));};return {resizeDelay:300,constructor:function(_1d,_1e){_b(this,{_internalLayerIds:[],_layers:[],_layerDivs:[],_layerSize:0,_clickHandles:[],_connects:[]});_b(this,{_zoomAnimDiv:null,_zoomAnim:null,_layersDiv:null,_firstLayerId:null,_delta:null,_gc:null,_cursor:null,_ratioW:1,_ratioH:1,_params:null});_b(this,{cursor:null,layerIds:[],graphicsLayerIds:[],graphics:null,loaded:false});_b(this,{__panning:false,__zooming:false,__container:null,root:null,__LOD:null,__tileInfo:null,__visibleRect:null,__visibleDelta:null});var _1f=(this.container=_4.byId(_1d));var id=(this.id=_4.attr(_1f,"id")||_5.getUniqueId(this.declaredClass));_4.addClass(_1f,"map");var box=_4.contentBox(_1f),dac=_4.addClass,dcr=_4.create;this.position=new _c(0,0);this._reposition();var _20=(this.width=(box.w||_10.width));var _21=(this.height=box.h||_10.height);if(box.w===0){ds(_1f,"width",_20+"px");}if(box.h===0){ds(_1f,"height",_21+"px");}var _22=(this.root=dcr("div",{id:id+"_root",style:{width:_20+"px",height:_21+"px"}}));dac(_22,"container");var _23=(this.__container=dcr("div",{id:id+"_container"},_22));ds(_23,"position","absolute");dac(_23,"container");_1f.appendChild(_22);var _24=(this._params=_b({slider:true,nav:false,extent:null,layer:null,scales:null,showInfoWindowOnClick:true,displayGraphicsOnPan:true,lods:null,tileInfo:null,wrapAround180:false,fitExtent:false},_1e||{}));this.wrapAround180=_24.wrapAround180;if(esri._isDefined(_24.resizeDelay)){this.resizeDelay=_24.resizeDelay;}if(_24.lods){_17({rows:512,cols:512,dpi:96,format:"JPEG",compressionQuality:75,origin:{x:-180,y:90},spatialReference:{wkid:4326},lods:_24.lods},_24);this.__tileInfo=_24.tileInfo;}var ext=(this.extent=_24.extent);this.spatialReference=(ext&&ext.spatialReference)?ext.spatialReference:null;this.__visibleRect=new _f(0,0,_20,_21);this.__visibleDelta=new _f(0,0,_20,_21);var _25=(this._layersDiv=dcr("div",{id:id+"_layers"}));dac(_25,"layersDiv");_23.appendChild(_25);this._zoomAnimDiv=dcr("div",{style:{position:"absolute"}});if(_24.infoWindow){this.infoWindow=_24.infoWindow;}else{var iw=(this.infoWindow=new esri.dijit.InfoWindow({map:this,title:"",id:id+"_infowindow"},dcr("div",null,_22)));iw.startup();iw._ootb=true;ds(iw.domNode,"zIndex",_16);}this._zoomStartHandler=dh(this,this._zoomStartHandler);this._zoomingHandler=dh(this,this._zoomingHandler);this._zoomEndHandler=dh(this,this._zoomEndHandler);this._panningHandler=dh(this,this._panningHandler);this._panEndHandler=dh(this,this._panEndHandler);this._endTranslate=dh(this,this._endTranslate);_4.addOnWindowUnload(this,this.destroy);},_cleanUp:function(){var iw=this.infoWindow;if(iw){if(iw._ootb){iw.destroy();}else{iw.unsetMap(this);}delete this.infoWindow;}var _26=this._connects,i;for(i=_26.length-1;i>=0;i--){_9(_26[i]);delete _26[i];}_9(this._tsTimeExtentChange_connect);this.setInfoWindowOnClick(false);_4.destroy(this.root);this.root=null;},_addLayer:function(_27,_28,_29){var id=(_27.id=_27.id||(_27 instanceof _e?_10.graphicsLayerNamePrefix:_10.layerNamePrefix)+(uid++));this._layers[id]=_27;var i;if(_28===this.layerIds||_28===this.graphicsLayerIds){i=this._layerSize;this._layerSize++;}_29=(_29===undefined||_29<0||_29>_28.length)?_28.length:_29;if(i===0){this._firstLayerId=id;}_28.splice(_29,0,id);var _2a=dh(this,this._addLayerHandler),_2b=this,_2c=this._connects,_2d=function(){if(_27.loaded){_2a(_27);}else{_2b[id+"_addtoken_load"]=dc(_27,"onLoad",_2b,"_addLayerHandler");_2b[id+"_addtoken_err"]=dc(_27,"onError",_2b,function(_2e){_2a(_27,_2e,_28);});}};if(this.loaded||i===0||(_27.loaded&&_a(this.graphicsLayerIds,id)===-1)){_2d();}else{_2c.push(dc(this,"onLoad",_2d));}return _27;},_addLayerHandler:function(_2f,_30,_31){var id=this.id,_32=_2f.id,_33=_a(_2f instanceof _e?this.graphicsLayerIds:this.layerIds,_32),_34=_33,_35=false,_36=this._params;_9(this[_32+"_addtoken_load"]);_9(this[_32+"_addtoken_err"]);if(_30){delete this._layers[_32];if(_33!==-1){_31.splice(_33,1);this.onLayerAddResult(_2f,_30);}return;}if(_33===-1){_33=_a(this._internalLayerIds,_32);_34=_15+_33;_35=true;}if(_2f instanceof _e){var _37=_2f._setMap(this,this._gc._surface);_37.id=id+"_"+_32;this._layerDivs[_32]=_37;this._reorderLayers(this.graphicsLayerIds);if(_36.showInfoWindowOnClick){this._clickHandles.push(dc(_2f,"onClick",this,"_gClickHandler"));}}else{var _38=_2f._setMap(this,this._layersDiv,_34,this.__LOD);_38.id=id+"_"+_32;this._layerDivs[_32]=_38;this._reorderLayers(this.layerIds);if(!_35&&_2f.declaredClass.indexOf("VETiledLayer")!==-1){this._onBingLayerAdd(_2f);}}if(_32===this._firstLayerId){this.spatialReference=this.spatialReference||_2f.spatialReference;var _39=this.spatialReference;this.wrapAround180=(this.wrapAround180&&_39&&_39._isWrappable())?true:false;if(_2f.tileInfo){if(!this.__tileInfo){_17(_b({},_2f.tileInfo),_36);this.__tileInfo=_36.tileInfo;}else{var _3a=this.__tileInfo.lods;this.__tileInfo=_b({},_2f.tileInfo);this.__tileInfo.lods=_3a;}}if(this.wrapAround180){var _3b=this.__tileInfo,_3c=_39._getInfo();if(!_3b||Math.abs(_3c.origin[0]-_3b.origin.x)>_3c.dx){this.wrapAround180=false;}if(this.wrapAround180&&_3b){esri.TileUtils._addFrameInfo(_3b,_3c);}}_36.units=_2f.units;this._gc=new esri.layers._GraphicsContainer();var gc=this._gc._setMap(this,this._layersDiv);gc.id=id+"_gc";this.graphics=new _e({id:id+"_graphics",displayOnPan:_36.displayGraphicsOnPan});this._addLayer(this.graphics,this._internalLayerIds,_15);}if(_2f===this.graphics){if(this.extent){var x=this._fixExtent(this.extent,_36.fitExtent);this.extent=x.extent;this.__LOD=x.lod;}var fli=this._firstLayerId;this._firstLayerId=null;this.__setExtent(this.extent||new _d(this._layers[fli].initialExtent),null,null,_36.fitExtent);this.loaded=true;this.infoWindow.setMap(this);this.onLoad(this);}if(!_35){this.onLayerAdd(_2f);this.onLayerAddResult(_2f);}_9(this[_32+"_addLayerHandler_connect"]);},_reorderLayers:function(_3d){var _3e=this.onLayerReorder,djp=_4.place,_3f=this._layerDivs,_40=this._layers,_41=this._gc?this._gc._surface.getEventSource():null;if(_3d===this.graphicsLayerIds){_4.forEach(_3d,function(id,i){var _42=_3f[id];if(_42){djp(_42.getEventSource(),_41,i);_3e(_40[id],i);}});}else{var g=this.graphics,gId=g?g.id:null,_43=this._layersDiv,_44;_4.forEach(_3d,function(id,i){_44=_3f[id];if(id!==gId&&_44){djp(_44,_43,i);_3e(_40[id],i);}});if(_41){_41=esri.vml?_41.parentNode:_41;djp(_41,_41.parentNode,_3d.length);}}this.onLayersReordered([].concat(_3d));},_zoomStartHandler:function(){this.__zoomStart(this._zoomAnimDiv.startingExtent,this._zoomAnimDiv.anchor);},_zoomingHandler:function(_45){var rl=parseFloat(_45.left),rt=parseFloat(_45.top),_46=new _d(rl,rt-parseFloat(_45.height),rl+parseFloat(_45.width),rt,this.spatialReference),_47=this.extent.getWidth()/_46.getWidth();this.__zoom(_46,_47,this._zoomAnimDiv.anchor);},_zoomEndHandler:function(){var _48=this._zoomAnimDiv,_49=_48.extent,_4a=this.extent.getWidth()/_49.getWidth();var _4b=_48.anchor,_4c=_48.newLod,_4d=_48.levelChange;_48.extent=_48.anchor=_48.levelChange=_48.startingExtent=_48.newLod=this._delta=this._zoomAnim=null;this.__zoomEnd(_49,_4a,_4b,_4c,_4d);},_panningHandler:function(_4e){if(isNaN(parseFloat(_4e.left))||isNaN(parseFloat(_4e.top))){var _4f=Math.round,_50=_4.style,_51=this._panAnim.node;_4e.left=(-1*(this._delta.x-_4f(this.width/2)))+"px";_4e.top=(-1*(this._delta.y-_4f(this.height/2)))+"px";_50(_51,"left",_4e.left);_50(_51,"top",_4e.top);}var d=new _c(parseFloat(_4e.left),parseFloat(_4e.top)),dm=this.toMap(d);this.onPan(this.extent.offset(dm.x,dm.y),d);},_panEndHandler:function(_52){this.__panning=false;var _53=Math.round,_54=new _c(-_53(parseFloat(_52.style.left)),-_53(parseFloat(_52.style.top))),dx=_54.x,dy=_54.y,_55=this.__visibleRect,_56=this.__visibleDelta;_55.x+=-dx;_55.y+=-dy;_56.x+=-dx;_56.y+=-dy;ds(this._zoomAnimDiv,{left:"0px",top:"0px"});var _57=this.extent,rw=this._ratioW,rh=this._ratioH;_57=(this.extent=new _d(_57.xmin+(dx/rw),_57.ymin-(dy/rh),_57.xmax+(dx/rw),_57.ymax-(dy/rh),this.spatialReference));_54.setX(-_54.x);_54.setY(-_54.y);this._delta=this._panAnim=null;this.onPanEnd(_57,_54);this.onExtentChange(_57,_54,false,this.__LOD);},_fixExtent:function(_58,fit){var _59=this._reshapeExtent(_58),_5a=1+_13;while(fit===true&&(_59.extent.getWidth()<_58.getWidth()||_59.extent.getHeight()<_58.getHeight())&&_59.lod.level>0&&_5a<=_14){_59=this._reshapeExtent(_58.expand(_5a));_5a+=_13;}return _59;},_getFrameWidth:function(){var _5b=-1,_5c=this.spatialReference._getInfo();if(this.__LOD){var _5d=this.__LOD._frameInfo;if(_5d){_5b=_5d[3];}}else{if(_5c){_5b=Math.round((2*_5c.valid[1])/(this.extent.getWidth()/this.width));}}return _5b;},_reshapeExtent:function(_5e){var w=_5e.getWidth(),h=_5e.getHeight(),r=w/h,_5f=this.width/this.height,dw=0,dh=0;if(this.width>this.height){if(w>h){if(_5f>r){dw=(h*_5f)-w;}else{dh=(w/_5f)-h;}}else{if(w<h){dw=(h*_5f)-w;}else{dw=(h*_5f)-w;}}}else{if(this.width<this.height){if(w>h){dh=(w/_5f)-h;}else{if(w<h){if(_5f>r){dw=(h*_5f)-w;}else{dh=(w/_5f)-h;}}else{dh=(w/_5f)-h;}}}else{if(w<h){dw=h-w;}else{if(w>h){dh=(w/_5f)-h;}}}}if(dw){_5e.xmin-=dw/2;_5e.xmax+=dw/2;}if(dh){_5e.ymin-=dh/2;_5e.ymax+=dh/2;}return this._getAdjustedExtent(_5e);},_getAdjustedExtent:function(_60){if(this.__tileInfo){return esri.TileUtils.getCandidateTileInfo(this,this.__tileInfo,_60);}else{return {extent:_60};}},_fixedPan:function(dx,dy){this._extentUtil(null,{dx:dx,dy:dy});},_gClickHandler:function(evt){var _61=evt.graphic,iw=this.infoWindow;if(_61._getEffInfoTemplate()&&iw){_4.stopEvent(evt);var _62=_61.geometry,_63=(_62&&_62.type==="point")?_62:evt.mapPoint;iw.setTitle(_61.getTitle());iw.setContent(_61.getContent());iw.show(_63);}},_onBingLayerAdd:function(_64){this["__"+_64.id+"_vis_connect"]=_4.connect(_64,"onVisibilityChange",this,"_toggleBingLogo");this._toggleBingLogo(_64.visible);},_onBingLayerRemove:function(_65){_4.disconnect(this["__"+_65.id+"_vis_connect"]);delete this["__"+_65.id+"_vis_connect"];var _66=this.layerIds;var _67=_4.some(_66,function(_68){var _69=this._layers[_68];return _69&&_69.visible&&_69.declaredClass.indexOf("VETiledLayer")!==-1;},this);this._toggleBingLogo(_67);},_toggleBingLogo:function(_6a){if(_6a&&!this._bingLogo){var _6b={left:(this._mapParams&&this._mapParams.nav?"25px":"")};if(_4.isIE===6){_6b.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='"+_4.moduleUrl("esri","../../images/map/logo-med.png")+"')";}var _6c=this._bingLogo=_4.create("div",{style:_6b},this.root);_4.addClass(_6c,"bingLogo-lg");}else{if(!_6a&&this._bingLogo){_4.destroy(this._bingLogo);delete this._bingLogo;}}},__panStart:function(x,y){var _6d=this._zoomAnim,_6e=this._panAnim;if(_6d&&_6d._active){_6d.stop();_6d._fire("onEnd",[_6d.node]);}else{if(_6e&&_6e._active){_6e.stop();this._panAnim=null;var _6f=_6e.curve.getValue(_6e._getStep()),rl=Math.round(parseFloat(_6f.left)),rt=Math.round(parseFloat(_6f.top)),_70=this._dragOrigin;this.__pan(rl,rt);if(_70){_70.x-=rl;_70.y-=rt;}return;}}this.__panning=true;this.onPanStart(this.extent,new _c(x,y));},__pan:function(dx,dy){var _71=this.extent,rw=this._ratioW,rh=this._ratioH;this.onPan(new _d(_71.xmin-(dx/rw),_71.ymin+(dy/rh),_71.xmax-(dx/rw),_71.ymax+(dy/rh),this.spatialReference),new _c(dx,dy));},__panEnd:function(dx,dy){var _72=this.__visibleRect,_73=this.__visibleDelta;_72.x+=dx;_72.y+=dy;_73.x+=dx;_73.y+=dy;var d=new _c(dx,dy),_74=this.extent,rw=this._ratioW,rh=this._ratioH;_74=(this.extent=new _d(_74.xmin-(dx/rw),_74.ymin+(dy/rh),_74.xmax-(dx/rw),_74.ymax+(dy/rh),this.spatialReference));this.__panning=false;this.onPanEnd(_74,d);this.onExtentChange(_74,d,false,this.__LOD);},__zoomStart:function(_75,_76){this.__zooming=true;this.onZoomStart(_75,1,_76,this.__LOD?this.__LOD.level:null);},__zoom:function(_77,_78,_79){this.onZoom(_77,_78,_79);},__zoomEnd:function(_7a,_7b,_7c,lod,_7d){ds(this._layersDiv,{left:"0px",top:"0px"});this._delta=new _c(0,0);this.__visibleRect.x=(this.__visibleRect.y=0);_7a=(this.extent=new _d(_7a));this.__LOD=lod;this._ratioW=this.width/_7a.getWidth();this._ratioH=this.height/_7a.getHeight();var _7e=this._delta;this._delta=null;this.__zooming=false;this.onZoomEnd(_7a,_7b,_7c,lod?lod.level:null);this.onExtentChange(_7a,_7e,_7d,lod);},_extentUtil:function(_7f,pan,_80,fit,_81){var _82,_83,_84,_85,_86,_87,dx,dy,_88=this.width,_89=this.height;if(_7f){_82=_7f.numLevels;_83=_7f.targetLevel;_84=_7f.factor;_85=_7f.mapAnchor;_86=_7f.screenAnchor;_87=_7f.mapCenter;}if(pan){dx=pan.dx;dy=pan.dy;_87=pan.mapCenter;}var _8a=this._panAnim,_8b=this._stopAnim(),_8c=_8b?_8b.divExtent:this.extent,_8d=this.__tileInfo,_8e,_8f,ewd,eht;if(_8a&&_85&&_86){_85=_7(this.extent,_88,_89,_86);}if(_8b&&_85&&_86){_85=_7(_8b.divExtent,_88,_89,_86);}if(esri._isDefined(_83)){if(_8d){var _90=this.getNumLevels()-1;if(_83<0){_83=0;}else{if(_83>_90){_83=_90;}}_82=_83-(_8b?_8b.level:this.getLevel());}else{_82=_83>0?-1:1;}}if(_80){}else{if(esri._isDefined(_82)){var _91;if(_8d){var _92=_8b?_8b.level:this.getLevel();_91=this.__getExtentForLevel(_92+_82,_87,_8c).extent;}else{var _93=_8b?_8b.end:this.extent;_91=_93.expand(_82>0?0.5*_82:2*-_82);}if(_91){if(_87){_80=_91;}else{var _94=_85||_8c.getCenter(),_95=_8c.ymax-((_91.getHeight()-_8c.getHeight())*(_94.y-_8c.ymax)/_8c.getHeight());_8e=_8c.xmin-((_91.getWidth()-_8c.getWidth())*(_94.x-_8c.xmin)/_8c.getWidth());_80=new _d(_8e,_95-_91.getHeight(),_8e+_91.getWidth(),_95,this.spatialReference);}}}else{if(esri._isDefined(_84)){_80=_8c.expand(_84);}else{if(dx||dy){if(_8b){var end=_8b.end,c1=end.getCenter(),c2=_8(end,_88,_89,c1);c2.x+=dx;c2.y+=dy;c2=_7(end,_88,_89,c2);_80=end.offset(c2.x-c1.x,c2.y-c1.y);}else{var _96=new _c((_88/2)+dx,(_89/2)+dy),_97=_7(_8c,_88,_89,_96);ewd=_8c.getWidth();eht=_8c.getHeight();_8e=_97.x-(ewd/2);_8f=_97.y-(eht/2);_80=new _d(_8e,_8f,_8e+ewd,_8f+eht);}}}}}if(!_80){if(_87){var ext=_8b?_8b.end:_8c;ewd=ext.getWidth();eht=ext.getHeight();_8e=_87.x-(ewd/2);_8f=_87.y-(eht/2);_80=new _d(_8e,_8f,_8e+ewd,_8f+eht);}else{if(_8b){_80=_8b.end;}}}if(_80){this.__setExtent(_80,null,_86,fit,_8b,_81);}},__setExtent:function(_98,_99,_9a,fit,_9b,_9c){try{if(this._firstLayerId){this.extent=_98;return;}var _9d=true,ext=_9b?_9b.divExtent:this.extent,_9e=this._fixExtent(_98,fit||false);_98=_9e.extent;var _9f=_98.getWidth(),_a0=_98.getHeight(),_a1=Math.round;if(ext){var tw=_a1(ext.getWidth()*_11),w=_a1(_9f*_11),th=_a1(ext.getHeight()*_11),h=_a1(_a0*_11);_9d=(tw!==w)||(th!==h);}var _a2,end,_a3,_a4,_a5=_9b&&_9b.rect,_a6=_9b&&_9b.divExtent;if(_10.zoomDuration&&_9d&&ext){_a6=_a6||new _d(ext);_a5=_a5||{left:ext.xmin,top:ext.ymax,width:ext.getWidth(),height:ext.getHeight()};end={left:_98.xmin,top:_98.ymax,width:_9f,height:_a0};_a3=_a5.width/end.width;_a4=_a5.height/end.height;var mtl=new _c(_98.xmin,_98.ymax),mbl=new _c(_98.xmin,_98.ymin),etl=new _c(this.extent.xmin,this.extent.ymax),ebl=new _c(this.extent.xmin,this.extent.ymin);_a2=esri.geometry.getLineIntersection(etl,mtl,ebl,mbl);if(!_a2&&!_9b){_9d=false;}}this._ratioW=this.width/_9f;this._ratioH=this.height/_a0;var _a7=this._zoomAnimDiv;if(_9d){ds(this._layersDiv,{left:"0px",top:"0px"});_99=new _c(0,0);this.__visibleRect.x=(this.__visibleRect.y=0);if(_a5&&end){this._delta=_99;_a7.id="_zAD";_a7.startingExtent=_a6;_a7.extent=_98;_a7.levelChange=_9d;_a7.newLod=_9e.lod;if(_9a){_a7.anchor=_9a;}else{if(!_a2&&_9b){_a7.anchor=_9b.anchor;}else{_a7.anchor=_8(this.extent,this.width,this.height,_a2);}}this._zoomAnim=esri.fx.resize({node:_a7,start:_a5,end:end,duration:_10.zoomDuration,rate:_10.zoomRate,beforeBegin:!_9b?this._zoomStartHandler:null,onAnimate:this._zoomingHandler,onEnd:this._zoomEndHandler}).play();this._fireOnScale(this.extent.getWidth()/_98.getWidth(),_a7.anchor);}else{this.extent=_98;this.onExtentChange(this.extent,_99,_9d,(this.__LOD=_9e.lod));}}else{if(!this.__panning){if(this.loaded===false||_9c){this.extent=_98;this.onExtentChange(this.extent,_99,_9d,(this.__LOD=_9e.lod));}else{this.__panning=true;_a5=new _f(0,0,this.width,this.height,this.spatialReference).getCenter();_a5.x=_a1(_a5.x);_a5.y=_a1(_a5.y);this.onPanStart(this.extent,new _c(0,0));var _a8=(this._delta=this.toScreen(_98.getCenter()));this._panAnim=esri.fx.slideTo({node:_a7,left:_a5.x-_a8.x,top:_a5.y-_a8.y,duration:_10.panDuration,rate:_10.panRate,onAnimate:this._panningHandler,onEnd:this._panEndHandler});this._panAnim.play();}}}}catch(e){console.log(e.stack);console.error(e);}},_fireOnScale:function(_a9,_aa,_ab){if(this.navigationMode==="css-transforms"){var vd=this.__visibleDelta;this.onScale(_6.gfx.matrix.scaleAt(_a9,{x:-1*((this.width/2)-(_aa.x-vd.x)),y:-1*((this.height/2)-(_aa.y-vd.y))}),_ab);}},_stopAnim:function(){var _ac=this._zoomAnim,_ad=this._panAnim;if(_ac&&_ac._active){_ac.stop();var _ae=_ac.curve.getValue(_ac._getStep()),rl=parseFloat(_ae.left),rt=parseFloat(_ae.top),_af=_ac.node;return {anchor:_af.anchor,start:_af.startingExtent,end:_af.extent,level:_af.newLod&&_af.newLod.level,rect:_ae,divExtent:new _d(rl,rt-parseFloat(_ae.height),rl+parseFloat(_ae.width),rt,this.spatialReference)};}else{if(_ad&&_ad._active){_ad.stop();_ad._fire("onEnd",[_ad.node]);}}},__getExtentForLevel:function(_b0,_b1,_b2){var ti=this.__tileInfo;_b2=_b2||this.extent;_b1=_b1||_b2.getCenter();if(ti){var _b3=ti.lods;if(_b0<0||_b0>=_b3.length){return {};}var lod=_b3[_b0],_b4=this.width*lod.resolution/2,_b5=this.height*lod.resolution/2;return {extent:new _d(_b1.x-_b4,_b1.y-_b5,_b1.x+_b4,_b1.y+_b5,_b1.spatialReference),lod:lod};}else{return {extent:_b2.expand(_b0).centerAt(_b1)};}},__scaleExtent:function(_b6,_b7,_b8){var _b9=_b8||_b6.getCenter();var _ba=_b6.expand(_b7),_bb=_b6.xmin-((_ba.getWidth()-_b6.getWidth())*(_b9.x-_b6.xmin)/_b6.getWidth()),_bc=_b6.ymax-((_ba.getHeight()-_b6.getHeight())*(_b9.y-_b6.ymax)/_b6.getHeight());return new _d(_bb,_bc-_ba.getHeight(),_bb+_ba.getWidth(),_bc,_b6.spatialReference);},_jobs:0,_incr:function(){if((++this._jobs)===1){this.updating=true;this.onUpdateStart();}},_decr:function(){var _bd=--this._jobs;if(!_bd){this.updating=false;this.onUpdateEnd();}else{if(_bd<0){this._jobs=0;}}},onUpdateStart:function(){},onUpdateEnd:function(){},onLoad:function(){this._setClipRect();},onUnload:function(){},onExtentChange:function(a,b,_be){if(_be){this._setClipRect();}},onTimeExtentChange:function(){},onLayerAdd:function(){},onLayerAddResult:function(){},onLayersAddResult:function(){},onLayerRemove:function(){},onLayersRemoved:function(){},onLayerReorder:function(){},onLayersReordered:function(){},onPanStart:function(){},onPan:function(){},onPanEnd:function(){},onScale:function(){},onZoomStart:function(){},onZoom:function(){},onZoomEnd:function(){},onResize:function(){this._setClipRect();},onReposition:function(){},destroy:function(){if(!this._destroyed){this.removeAllLayers();this._cleanUp();if(this._gc){this._gc._cleanUp();}this._destroyed=true;this.onUnload(this);}},setCursor:function(_bf){ds(this.__container,"cursor",(this.cursor=_bf));},setMapCursor:function(c){this.setCursor((this._cursor=c));},resetMapCursor:function(){this.setCursor(this._cursor);},setInfoWindow:function(_c0){var iw=this.infoWindow;if(iw){iw.unsetMap(this);}this.infoWindow=_c0;if(this.loaded&&_c0){_c0.setMap(this);}},setInfoWindowOnClick:function(_c1){var _c2=this._params;if(_c1){if(!_c2.showInfoWindowOnClick){var _c3=[this.graphics].concat(_4.map(this.graphicsLayerIds,this.getLayer,this));_4.map(_c3,function(_c4){if(_c4&&_c4.loaded){this._clickHandles.push(dc(_c4,"onClick",this,"_gClickHandler"));}},this);}}else{_4.forEach(this._clickHandles,_9);this._clickHandles=[];}_c2.showInfoWindowOnClick=_c1;},getInfoWindowAnchor:function(pt){var w2=this.width/2,h2=this.height/2,_c5;if(pt.y<h2){_c5="LOWER";}else{_c5="UPPER";}if(pt.x<w2){return esri.dijit.InfoWindow["ANCHOR_"+_c5+"RIGHT"];}else{return esri.dijit.InfoWindow["ANCHOR_"+_c5+"LEFT"];}},toScreen:function(pt,_c6){return _8(this.extent,this.width,this.height,pt,_c6);},toMap:function(pt){return _7(this.extent,this.width,this.height,pt);},addLayer:function(_c7,_c8){return this._addLayer(_c7,_c7 instanceof _e?this.graphicsLayerIds:this.layerIds,_c8);},addLayers:function(_c9){var _ca=[],_cb=_c9.length,_cc,i,len=_c9.length;var _cd=function(_ce,_cf){if(_4.indexOf(_c9,_ce)!==-1){_cb--;_ca.push({"layer":_ce,"success":!_cf,"error":_cf});if(!_cb){_4.disconnect(_cc);this.onLayersAddResult(_ca);}}};_cc=_4.connect(this,"onLayerAddResult",_cd);for(i=0;i<len;i++){this.addLayer(_c9[i]);}return this;},removeLayer:function(_d0){var id=_d0.id,ids=_d0 instanceof _e?this.graphicsLayerIds:this.layerIds,i=_a(ids,id);if(i>=0){ids.splice(i,1);if(_d0 instanceof _e){_9(this["_gl_"+_d0.id+"_click_connect"]);if(_d0.loaded){_d0._unsetMap(this,this._gc._surface);}}else{if(_d0.loaded){_d0._unsetMap(this,this._layersDiv);if(_d0.declaredClass.indexOf("VETiledLayer")!==-1){this._onBingLayerRemove(_d0);}}}delete this._layers[id];delete this._layerDivs[id];this._reorderLayers(ids);this.onLayerRemove(_d0);}},removeAllLayers:function(){var ids=this.layerIds,i;for(i=ids.length-1;i>=0;i--){this.removeLayer(this._layers[ids[i]]);}ids=this.graphicsLayerIds;for(i=ids.length-1;i>=0;i--){this.removeLayer(this._layers[ids[i]]);}this.onLayersRemoved();},reorderLayer:function(_d1,_d2){if(_4.isString(_d1)){_4.deprecated(this.declaredClass+": "+esri.bundle.map.deprecateReorderLayerString,null,"v2.0");_d1=this.getLayer(_d1);}var id=_d1.id,ids=_d1 instanceof _e?this.graphicsLayerIds:this.layerIds;if(_d2<0){_d2=0;}else{if(_d2>=ids.length){_d2=ids.length-1;}}var i=_a(ids,id);if(i===-1||i===_d2){return;}ids.splice(i,1);ids.splice(_d2,0,id);this._reorderLayers(ids);},getLayer:function(id){return this._layers[id];},setExtent:function(_d3,fit){_d3=new esri.geometry.Extent(_d3.toJson());var _d4=_d3.getWidth(),_d5=_d3.getHeight();if(_d4===0&&_d5===0){this.centerAt(new esri.geometry.Point({x:_d3.xmin,y:_d3.ymin,spatialReference:_d3.spatialReference&&_d3.spatialReference.toJson()}));}else{this._extentUtil(null,null,_d3,fit);}},centerAt:function(_d6){this._extentUtil(null,{mapCenter:_d6});},centerAndZoom:function(_d7,_d8){this._extentUtil({targetLevel:_d8,mapCenter:_d7});},getNumLevels:function(){return this.__tileInfo?this.__tileInfo.lods.length:0;},getLevel:function(){return this.__LOD?this.__LOD.level:-1;},setLevel:function(_d9){this._extentUtil({targetLevel:_d9});},translate:function(dx,dy){dx=dx||0;dy=dy||0;if(!this._txTimer){this._tx=this._ty=0;var _da=this.toScreen(this.extent.getCenter());this.__panStart(_da.x,_da.y);}this._tx+=dx;this._ty+=dy;this.__pan(this._tx,this._ty);clearTimeout(this._txTimer);this._txTimer=setTimeout(this._endTranslate,150);},_endTranslate:function(){clearTimeout(this._txTimer);this._txTimer=null;var dx=this._tx,dy=this._ty;this._tx=this._ty=0;this.__panEnd(dx,dy);},setTimeExtent:function(_db){this.timeExtent=_db;var arg=_db?new esri.TimeExtent(_db.startTime,_db.endTime):null;this.onTimeExtentChange(arg);},setTimeSlider:function(_dc){if(this.timeSlider){_9(this._tsTimeExtentChange_connect);this._tsTimeExtentChange_connect=null;this.timeSlider=null;}if(_dc){this.timeSlider=_dc;this.setTimeExtent(_dc.getCurrentTimeExtent());this._tsTimeExtentChange_connect=dc(_dc,"onTimeExtentChange",this,"setTimeExtent");}},resize:function(_dd){var _de=this,_df=function(){clearTimeout(_de._resizeT);_de.reposition();_de._resize();};clearTimeout(_de._resizeT);if(_dd===true){_df();}else{_de._resizeT=setTimeout(_df,_de.resizeDelay);}},_resize:function(){var w=this.width,h=this.height,box=_4.contentBox(this.container);if(w===box.w&&h===box.h){return;}var _e0=this._zoomAnim||this._panAnim;if(_e0){_e0.stop();_e0._fire("onEnd",[_e0.node]);}ds(this.root,{width:(this.width=box.w)+"px",height:(this.height=box.h)+"px"});var wd=this.width,ht=this.height;this.__visibleRect.update(this.__visibleRect.x,this.__visibleRect.y,wd,ht);this.__visibleDelta.update(this.__visibleDelta.x,this.__visibleDelta.y,wd,ht);var r=esri.geometry._extentToRect(this.extent),ne=(esri.geometry._rectToExtent(new _f(r.x,r.y,r.width*(wd/w),r.height*(ht/h),this.spatialReference)));this.onResize(ne,wd,ht);this._extentUtil(null,null,ne,null,true);},reposition:function(){this._reposition();this.onReposition(this.position.x,this.position.y);},_reposition:function(){var pos=_4.coords(this.container,true),_e1=_4._getPadBorderExtents(this.container);this.position.update(pos.x+_e1.l,pos.y+_e1.t);},_setClipRect:function(){delete this._clip;var _e2=_4.isIE?"rect(auto,auto,auto,auto)":null;if(this.wrapAround180){var _e3=this.width,_e4=this.height,_e5=this._getFrameWidth(),_e6=_e3-_e5;if(_e6>0){var _e7=_e6/2;_e2="rect(0px,"+(_e7+_e5)+"px,"+_e4+"px,"+_e7+"px)";var _e8=this.extent.getWidth(),_e9=_e8*(_e5/_e3);this._clip=[(_e8-_e9)/2,_e9];}}ds(this.__container,"clip",_e2);},_getAvailExtent:function(){var _ea=this.extent,_eb=this._clip;if(_eb){if(!_ea._clip){var _ec=new esri.geometry._extentToRect(_ea);_ec.width=_eb[1];_ec.x=_ec.x+_eb[0];_ea._clip=_ec.getExtent();}return _ea._clip;}return _ea;},panUp:function(){this._fixedPan(0,this.height*-_12);},panUpperRight:function(){this._fixedPan(this.width*_12,this.height*-_12);},panRight:function(){this._fixedPan(this.width*_12,0);},panLowerRight:function(){this._fixedPan(this.width*_12,this.height*_12);},panDown:function(){this._fixedPan(0,this.height*_12);},panLowerLeft:function(){this._fixedPan(this.width*-_12,this.height*_12);},panLeft:function(){this._fixedPan(this.width*-_12,0);},panUpperLeft:function(){this._fixedPan(this.width*-_12,this.height*-_12);},enableSnapping:function(_ed){if(!_ed){_ed={};}if(_ed.declaredClass==="esri.SnappingManager"){this.snappingManager=_ed;}else{this.snappingManager=new esri.SnappingManager(_4.mixin({map:this},_ed));}return this.snappingManager;},disableSnapping:function(){if(this.snappingManager){this.snappingManager.destroy();}this.snappingManager=null;}};}()));}}};});