/*
 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
 */

if(!dojo._hasResource["esri.map"]){dojo._hasResource["esri.map"]=true;dojo.provide("esri.map");dojo.require("esri._coremap");if(esri.isTouchEnabled){dojo.require("esri.touchcontainer");}else{dojo.declare("esri._MapContainer",esri._CoreMap,(function(){var dc=dojo.connect,_1=dojo.disconnect,dh=dojo.hitch,_2=dojo.mixin,_3=dojo.isMozilla,_4=dojo.stopEvent,_5=dojo.fixEvent,_6=esri.geometry.Point;var _7=navigator.userAgent.indexOf("Macintosh")!==-1?1:3,_8=dojo.isChrome<2?360:120,_9=1,_a=1,_b=300;return {constructor:function(_c){_2(this,{_dragEnd:false,_clickDuration:_b,_downCoords:null,_clickTimer:null,_onKeyDown_connect:null,_onKeyUp_connect:null,_onMouseDragHandler_connect:null});var _d=this.__container,_e=this._connects;_e.push(dc(_d,"onselectstart",function(_f){_4(_f);return false;}),dc(_d,"ondragstart",function(evt){_4(evt);return false;}));if(_3){dojo.style(_d,"MozUserSelect","none");}_e.push(dc(_d,"onmouseenter",this,"_onMouseEnterHandler"),dc(_d,"onmouseleave",this,"_onMouseLeaveHandler"),dc(_d,"onmousedown",this,"_onMouseDownHandler"),dc(_d,"onclick",this,"_onClickHandler"),dc(_d,"ondblclick",this,"_onDblClickHandler"));this.enableMouseWheel(false);this._onMouseMoveHandler_connect=dc(_d,"onmousemove",this,"_onMouseMoveHandler");this._onMouseUpHandler_connect=dc(_d,"onmouseup",this,"_onMouseUpHandler");this._processEvent=dh(this,this._processEvent);this._fireClickEvent=dh(this,this._fireClickEvent);},_cleanUp:function(){_1(this._onMouseMoveHandler_connect);_1(this._onMouseUpHandler_connect);_1(this._onMouseDragHandler_connect);_1(this._scrollHandle);var _10=this._connects,i;for(i=_10.length;i>=0;i--){_1(_10[i]);delete _10[i];}this.inherited("_cleanUp",arguments);},_processEvent:function(evt){evt=_5(evt,evt.target);if(evt.type==="DOMMouseScroll"&&dojo.isFF<3){evt.screenPoint=new _6(window.scrollX+evt.screenX-this.position.x,window.scrollY+evt.screenY-this.position.y);}else{evt.screenPoint=new _6(evt.pageX-this.position.x,evt.pageY-this.position.y);}evt.mapPoint=this.extent?this.toMap(evt.screenPoint):new _6();return evt;},_onMouseEnterHandler:function(evt){_1(this._onKeyDown_connect);_1(this._onKeyUp_connect);this._onKeyDown_connect=dc(document,"onkeydown",this,"_onKeyDownHandler");this._onKeyUp_connect=dc(document,"onkeyup",this,"_onKeyUpHandler");this.onMouseOver(this._processEvent(evt));},_onMouseLeaveHandler:function(evt){_1(this._onKeyDown_connect);_1(this._onKeyUp_connect);this.onMouseOut(this._processEvent(evt));},_onMouseMoveHandler:function(evt){if(this._dragEnd){this._dragEnd=false;return;}this.onMouseMove(this._processEvent(evt));},_onMouseDownHandler:function(evt){_1(this._onMouseMoveHandler_connect);var _11=this.__container;if(_11.setCapture){_11.setCapture(false);}this._onMouseDragHandler_connect=dc(document,"onmousemove",this,"_onMouseDragHandler");evt=this._processEvent(evt);this._downCoords=evt.screenPoint.x+","+evt.screenPoint.y;this.onMouseDown(evt);},_onMouseUpHandler:function(evt){var _12=this.__container;if(_12.releaseCapture){_12.releaseCapture();}evt=this._processEvent(evt);_1(this._onMouseDragHandler_connect);_1(this._onMouseMoveHandler_connect);this._onMouseMoveHandler_connect=dc(_12,"onmousemove",this,"_onMouseMoveHandler");this.onMouseUp(evt);},_onMouseDragHandler:function(evt){_1(this._onMouseDragHandler_connect);this._onMouseDragHandler_connect=dc(document,"onmousemove",this,"_onMouseDraggingHandler");_1(this._onMouseUpHandler_connect);this._onMouseUpHandler_connect=dc(document,"onmouseup",this,"_onDragMouseUpHandler");this._docLeaveConnect=dc(document,"onmouseout",this,"_onDocMouseOut");this.onMouseDragStart(this._processEvent(evt));},_onDocMouseOut:function(evt){var _13=evt.relatedTarget,_14=evt.relatedTarget&&evt.relatedTarget.nodeName.toLowerCase();if(!_13||(dojo.isChrome&&_14==="html")){this._onDragMouseUpHandler(evt);}},_onMouseDraggingHandler:function(evt){this.onMouseDrag(this._processEvent(evt));dojo.stopEvent(evt);},_onDragMouseUpHandler:function(evt){var _15=this.__container;if(_15.releaseCapture){_15.releaseCapture();}this._dragEnd=true;evt=this._processEvent(evt);this.onMouseDragEnd(evt);_1(this._docLeaveConnect);_1(this._onMouseDragHandler_connect);_1(this._onMouseUpHandler_connect);this._onMouseMoveHandler_connect=dc(_15,"onmousemove",this,"_onMouseMoveHandler");this._onMouseUpHandler_connect=dc(_15,"onmouseup",this,"_onMouseUpHandler");this.onMouseUp(evt);},_onClickHandler:function(evt){evt=this._processEvent(evt);if(this._downCoords!==(evt.screenPoint.x+","+evt.screenPoint.y)){return;}clearTimeout(this._clickTimer);this._clickEvent=_2({},evt);this._clickTimer=setTimeout(this._fireClickEvent,this._clickDuration);},_fireClickEvent:function(){clearTimeout(this._clickTimer);if(dojo.isIE<9){var GL=esri.layers.GraphicsLayer;this._clickEvent.graphic=GL._clicked;delete GL._clicked;}this.onClick(this._clickEvent);},_onDblClickHandler:function(evt){clearTimeout(this._clickTimer);this.onDblClick(this._processEvent(evt));},_onMouseWheelHandler:function(evt){if(this.__canStopSWEvt()){dojo.stopEvent(evt);}evt=this._processEvent(evt);var _16=dojo.isIE||dojo.isWebKit?evt.wheelDelta/_8:-evt.detail/_7,_17=Math.abs(_16);if(_17<=_9){_17=_9;}else{_17=_a;}evt.value=_16<0?-_17:_17;this.onMouseWheel(evt);},__canStopSWEvt:function(){},_onKeyDownHandler:function(evt){this.onKeyDown(evt);},_onKeyUpHandler:function(evt){this.onKeyUp(evt);},__setClickDuration:function(dur){this._clickDuration=dur;},__resetClickDuration:function(){this._clickDuration=_b;},enableMouseWheel:function(_18){_1(this._scrollHandle);this._scrollHandle=dc(this.__container,(dojo.isFF||_3)?(_18?"MozMousePixelScroll":"DOMMouseScroll"):"onmousewheel",this,this._onMouseWheelHandler);},onMouseOver:function(){},onMouseMove:function(){},onMouseOut:function(){},onMouseDown:function(){},onMouseDragStart:function(){},onMouseDrag:function(){},onMouseDragEnd:function(){},onMouseUp:function(){},onClick:function(){},onDblClick:function(){},onMouseWheel:function(){},onKeyDown:function(){},onKeyUp:function(){}};}()));}dojo.declare("esri.Map",esri._MapContainer,(function(){var _19=30,_1a=100,_1b=30,_1c=10,_1d=1,_1e=-1,_1f=dojo.mouseButtons.LEFT,_20={up:"panUp",right:"panRight",down:"panDown",left:"panLeft"},_21={upperRight:"panUpperRight",lowerRight:"panLowerRight",lowerLeft:"panLowerLeft",upperLeft:"panUpperLeft"};var dc=dojo.connect,ddc=dojo.disconnect,dcr=dojo.create,ds=dojo.style,dh=dojo.hitch,abs=Math.abs,_22=dojo.coords,_23=dojo.deprecated,dk=dojo.keys,_24=dojo.mixin,_25=esri.geometry.Rect,_26=esri.geometry.Point,_27=esri.geometry.Extent;var _28=[dk.NUMPAD_PLUS,61,dk.NUMPAD_MINUS,dk.UP_ARROW,dk.NUMPAD_8,dk.RIGHT_ARROW,dk.NUMPAD_6,dk.DOWN_ARROW,dk.NUMPAD_2,dk.LEFT_ARROW,dk.NUMPAD_4,dk.PAGE_UP,dk.NUMPAD_9,dk.PAGE_DOWN,dk.NUMPAD_3,dk.END,dk.NUMPAD_1,dk.HOME,dk.NUMPAD_7];return {constructor:function(_29,_2a){_24(this,{_dragOrigin:null,_slider:null,_navDiv:null,_zoomRect:null,_mapParams:_24({slider:true,nav:false,logo:true,sliderStyle:"default"},_2a||{}),_zoom:0,_keyboardPanDx:0,_keyboardPanDy:0});_24(this,{_onLoadHandler_connect:null,_panHandler_connect:null,_panStartHandler_connect:null,_upPanHandler_connect:null,_dblClickZoomHandler_connect:null,_recenterZoomHandler_connect:null,_recenterHandler_connect:null,_downPanHandler_connect:null,_downZoomHandler_connect:null,_keyNavigatingHandler_connect:null,_keyNavigationEndHandler_connect:null,_scrollZoomHandler_connect:null,_zoomHandler_connect:null,_upZoomHandler_connect:null});_24(this,{isDoubleClickZoom:false,isShiftDoubleClickZoom:false,isClickRecenter:false,isScrollWheelZoom:false,isPan:false,isRubberBandZoom:false,isKeyboardNavigation:false,isPanArrows:false,isZoomSlider:false});if(dojo.isFunction(esri._css)){esri._css=esri._css(this._mapParams.force3DTransforms);this.force3DTransforms=this._mapParams.force3DTransforms;}var _2b=(esri._hasTransforms&&esri._hasTransitions);this.navigationMode=this._mapParams.navigationMode||(_2b&&"css-transforms")||"classic";if(this.navigationMode==="css-transforms"&&!_2b){this.navigationMode="classic";}this.fadeOnZoom=esri._isDefined(this._mapParams.fadeOnZoom)?this._mapParams.fadeOnZoom:(this.navigationMode==="css-transforms");if(this.navigationMode!=="css-transforms"){this.fadeOnZoom=false;}this._zoomRect=new esri.Graphic(null,new esri.symbol.SimpleFillSymbol(esri.config.defaults.map.zoomSymbol));this.setMapCursor("default");this.smartNavigation=_2a&&_2a.smartNavigation;if(!esri._isDefined(this.smartNavigation)&&dojo.isMac&&!esri.isTouchEnabled&&!(dojo.isFF<=3.5)){var _2c=navigator.userAgent.match(/Mac\s+OS\s+X\s+([\d]+)(\.|\_)([\d]+)\D/i);if(_2c&&esri._isDefined(_2c[1])&&esri._isDefined(_2c[3])){var _2d=parseInt(_2c[1],10),_2e=parseInt(_2c[3],10);this.smartNavigation=((_2d>10)||(_2d===10&&_2e>=6));}}this._onLoadHandler_connect=dc(this,"onLoad",this,"_onLoadInitNavsHandler");if(this._mapParams.logo){var _2f={right:(this._mapParams.nav?"25px":"")};if(dojo.isIE===6){_2f.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='"+dojo.moduleUrl("esri","../../images/map/logo-med.png")+"')";}var _30=this._ogol=dcr("div",{style:_2f},this.root);if((this.root.clientWidth*this.root.clientHeight)<250000){dojo.addClass(_30,"logo-sm");}else{dojo.addClass(_30,"logo-med");}if(!esri.isTouchEnabled){this._ogol_connect=dc(_30,"onclick",this,"_openLogoLink");}}if(esri.isTouchEnabled){this._panInitEvent="onTouchStart";this._zoomInitEvent="onGestureStart";}else{this._panInitEvent="onMouseDown";this._zoomInitEvent="onMouseDown";}},_cleanUp:function(){this.disableMapNavigation();var i;for(i=this._connects.length;i>=0;i--){ddc(this._connects[i]);delete this._connects[i];}ddc(this._slider_connect);ddc(this._ogol_connect);var _31=this._slider;if(_31&&_31.destroy){_31.destroy();}var _32=this._navDiv;if(_32){dojo.destroy(_32);}this.inherited("_cleanUp",arguments);},_normalizeRect:function(evt){var xy=evt.screenPoint,dx=this._dragOrigin.x,dy=this._dragOrigin.y,_33=new _25((xy.x<dx?xy.x:dx)-this.__visibleRect.x,(xy.y<dy?xy.y:dy)-this.__visibleRect.y,abs(xy.x-dx),abs(xy.y-dy));if(_33.width===0){_33.width=1;}if(_33.height===0){_33.height=1;}return _33;},_downZoomHandler:function(evt){if(evt.button===_1f&&evt.shiftKey&&this.isRubberBandZoom){this._dragOrigin=_24({},evt.screenPoint);this.setCursor("crosshair");this._zoomHandler_connect=dc(this,"onMouseDrag",this,"_zoomHandler");this._upZoomHandler_connect=dc(this,"onMouseUp",this,"_upZoomHandler");if(evt.ctrlKey){this._zoom=_1e;}else{this._zoom=_1d;}if(dojo.isChrome){evt.preventDefault();}}},_zoomHandler:function(evt){var _34=this._normalizeRect(evt).offset(this.__visibleRect.x,this.__visibleRect.y),g=this.graphics,_35=this._zoomRect;if(!_35.geometry){this.setCursor("crosshair");}if(_35.geometry){g.remove(_35,true);}var tl=this.toMap(new _26(_34.x,_34.y)),br=this.toMap(new _26(_34.x+_34.width,_34.y+_34.height));_34=new _25(tl.x,tl.y,br.x-tl.x,tl.y-br.y);_34._originOnly=true;_35.setGeometry(_34);g.add(_35,true);},_upZoomHandler:function(evt){var _36=this._zoomRect;ddc(this._zoomHandler_connect);ddc(this._upZoomHandler_connect);if(this._canZoom(this._zoom)&&_36.getDojoShape()){this.graphics.remove(_36);_36.geometry=null;var _37=this._normalizeRect(evt);_37.x+=this.__visibleRect.x;_37.y+=this.__visibleRect.y;var _38;if(this._zoom===_1e){var _39=this.extent.getWidth(),_3a=(_39*this.width)/_37.width,_3b=(_3a-_39)/2,ext=this.extent;_38=new _27(ext.xmin-_3b,ext.ymin-_3b,ext.xmax+_3b,ext.ymax+_3b,this.spatialReference);}else{var min=this.toMap({x:_37.x,y:(_37.y+_37.height)}),max=this.toMap({x:(_37.x+_37.width),y:_37.y});_38=new _27(min.x,min.y,max.x,max.y,this.spatialReference);}this._extentUtil(null,null,_38);}if(_36.getDojoShape()){this.graphics.remove(_36,true);}this._zoom=0;this.resetMapCursor();},_downPanHandler:function(evt){if(evt.button===_1f&&!evt.shiftKey&&this.isPan){this._dragOrigin=new _26(0,0);_24(this._dragOrigin,evt.screenPoint);this._panHandler_connect=dc(this,"onMouseDrag",this,"_panHandler");this._panStartHandler_connect=dc(this,"onMouseDragStart",this,"_panStartHandler");this._upPanHandler_connect=dc(this,"onMouseUp",this,"_upPanHandler");if(dojo.isChrome){evt.preventDefault();}}},_panStartHandler:function(evt){this.setCursor("move");this.__panStart(evt.screenPoint.x,evt.screenPoint.y);},_panHandler:function(evt){this.__pan(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);},_upPanHandler:function(evt){ddc(this._panHandler_connect);ddc(this._panStartHandler_connect);ddc(this._upPanHandler_connect);if(this.__panning){this.__panEnd(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);this.resetMapCursor();}},_isPanningOrZooming:function(){return this.__panning||this.__zooming;},_recenterHandler:function(evt){if(evt.shiftKey&&!this._isPanningOrZooming()){this.centerAt(evt.mapPoint);}},_recenterZoomHandler:function(evt){if(evt.shiftKey&&!this._isPanningOrZooming()){evt.value=evt.ctrlKey?-1:1;this._scrollZoomHandler(evt,true);}},_dblClickZoomHandler:function(evt){if(!this._isPanningOrZooming()){evt.value=1;this._scrollZoomHandler(evt,true);}},_canZoom:function(_3c){if(!this.__tileInfo){return true;}var _3d=this.getLevel(),_3e=this.getNumLevels();if((_3d===0&&_3c<0)||(_3d===_3e-1&&_3c>0)){return false;}return true;},_scrollZoomHandler:function(evt,_3f){if(!_3f){if(this.smartNavigation&&!evt.shiftKey&&!this._isPanningOrZooming()){this.disableScrollWheelZoom();this._setScrollWheelPan(true);this._scrollPanHandler(evt);return;}var _40=evt.timeStamp;if(!esri._isDefined(_40)||_40<=0){_40=(new Date()).getTime();}var _41=this._ts?(_40-this._ts):_40;if(_41<_1a){return;}this._ts=_40;}if(!this._canZoom(evt.value)){return;}this._extentUtil({numLevels:evt.value,mapAnchor:evt.mapPoint,screenAnchor:evt.screenPoint});},_scrollPanHandler:function(evt){if(evt.shiftKey&&!this._isPanningOrZooming()){this._setScrollWheelPan(false);this.enableScrollWheelZoom();this._scrollZoomHandler(evt);return;}var dx=0,dy=0;if(dojo.isFF){if(evt.axis===evt.HORIZONTAL_AXIS){dx=-evt.detail;}else{dy=-evt.detail;}}else{dx=evt.wheelDeltaX;dy=evt.wheelDeltaY;}this.translate(dx,dy);},_keyNavigatingHandler:function(evt){var kc=evt.keyCode;if(dojo.indexOf(_28,kc)!==-1){if(kc===dk.NUMPAD_PLUS||kc===61){this._extentUtil({numLevels:1});}else{if(kc===dk.NUMPAD_MINUS){this._extentUtil({numLevels:-1});}else{if(!this.__panning){this.__panStart(0,0);}switch(kc){case dk.UP_ARROW:case dk.NUMPAD_8:this._keyboardPanDy+=_1c;break;case dk.RIGHT_ARROW:case dk.NUMPAD_6:this._keyboardPanDx-=_1c;break;case dk.DOWN_ARROW:case dk.NUMPAD_2:this._keyboardPanDy-=_1c;break;case dk.LEFT_ARROW:case dk.NUMPAD_4:this._keyboardPanDx+=_1c;break;case dk.PAGE_UP:case dk.NUMPAD_9:this._keyboardPanDx-=_1c;this._keyboardPanDy+=_1c;break;case dk.PAGE_DOWN:case dk.NUMPAD_3:this._keyboardPanDx-=_1c;this._keyboardPanDy-=_1c;break;case dk.END:case dk.NUMPAD_1:this._keyboardPanDx+=_1c;this._keyboardPanDy-=_1c;break;case dk.HOME:case dk.NUMPAD_7:this._keyboardPanDx+=_1c;this._keyboardPanDy+=_1c;break;default:return;}this.__pan(this._keyboardPanDx,this._keyboardPanDy);}}dojo.stopEvent(evt);}},_keyNavigationEndHandler:function(evt){if(this.__panning&&(evt.keyCode!==dk.SHIFT)){this.__panEnd(this._keyboardPanDx,this._keyboardPanDy);this._keyboardPanDx=this._keyboardPanDy=0;}},_onLoadInitNavsHandler:function(){this.enableMapNavigation();this._createNav();if(this._mapParams.sliderStyle==="small"||!this._createSlider){this._createSimpleSlider();}else{this._createSlider();}ddc(this._onLoadHandler_connect);},_createNav:function(){if(this._mapParams.nav){var div,v,i,_42=dojo.addClass,id=this.id;this._navDiv=dcr("div",{id:id+"_navdiv"},this.root);_42(this._navDiv,"navDiv");var w2=this.width/2,h2=this.height/2,wh;for(i in _20){v=_20[i];div=dcr("div",{id:id+"_pan_"+i},this._navDiv);_42(div,"fixedPan "+v);if(i==="up"||i==="down"){wh=parseInt(_22(div).w,10)/2;ds(div,{left:(w2-wh)+"px",zIndex:_19});}else{wh=parseInt(_22(div).h,10)/2;ds(div,{top:(h2-wh)+"px",zIndex:_19});}this._connects.push(dc(div,"onclick",dh(this,this[v])));}this._onMapResizeNavHandler_connect=dc(this,"onResize",this,"_onMapResizeNavHandler");for(i in _21){v=_21[i];div=dcr("div",{id:id+"_pan_"+i,style:{zIndex:_19}},this._navDiv);_42(div,"fixedPan "+v);this._connects.push(dc(div,"onclick",dh(this,this[v])));}this.isPanArrows=true;}},_onMapResizeNavHandler:function(_43,wd,ht){var id=this.id,w2=wd/2,h2=ht/2,_44=dojo.byId,i,div,wh;for(i in _20){div=_44(id+"_pan_"+i);if(i==="up"||i==="down"){wh=parseInt(_22(div).w,10)/2;ds(div,"left",(w2-wh)+"px");}else{wh=parseInt(_22(div).h,10)/2;ds(div,"top",(h2-wh)+"px");}}},_createSimpleSlider:function(){if(this._mapParams.slider){var _45=(this._slider=dcr("div",{id:this.id+"_zoom_slider","class":"esriSimpleSlider",style:"z-index: "+_1b+";"}));dojo.addClass(_45,esri.config.defaults.map.slider.width?"esriSimpleSliderHorizontal":"esriSimpleSliderVertical");var _46=dcr("div",{"class":"esriSimpleSliderIncrementButton"},_45);_46.innerHTML="+";var _47=dcr("div",{"class":"esriSimpleSliderDecrementButton"},_45);_47.innerHTML="-";if(dojo.isIE<8){dojo.addClass(_47,"dj_ie67Fix");}this._connects.push(dc(_46,"onclick",this,this._simpleSliderChangeHandler));this._connects.push(dc(_47,"onclick",this,this._simpleSliderChangeHandler));this.root.appendChild(_45);this.isZoomSlider=true;}},_simpleSliderChangeHandler:function(evt){var _48=(evt.currentTarget.className.indexOf("IncrementButton")!==-1)?true:false;this._extentUtil({numLevels:_48?1:-1});},_openLogoLink:function(evt){window.open(esri.config.defaults.map.logoLink,"_blank");dojo.stopEvent(evt);},enableMapNavigation:function(){this.enableDoubleClickZoom();this.enableClickRecenter();this.enablePan();this.enableRubberBandZoom();this.enableKeyboardNavigation();if(this.smartNavigation){this._setScrollWheelPan(true);}else{this.enableScrollWheelZoom();}},disableMapNavigation:function(){this.disableDoubleClickZoom();this.disableClickRecenter();this.disablePan();this.disableRubberBandZoom();this.disableKeyboardNavigation();this.disableScrollWheelZoom();if(this.smartNavigation){this._setScrollWheelPan(false);}},enableDoubleClickZoom:function(){if(!this.isDoubleClickZoom){this._dblClickZoomHandler_connect=dc(this,"onDblClick",this,"_dblClickZoomHandler");this.isDoubleClickZoom=true;}},disableDoubleClickZoom:function(){if(this.isDoubleClickZoom){ddc(this._dblClickZoomHandler_connect);this.isDoubleClickZoom=false;}},enableShiftDoubleClickZoom:function(){if(!this.isShiftDoubleClickZoom){_23(this.declaredClass+": "+esri.bundle.map.deprecateShiftDblClickZoom,null,"v2.0");this._recenterZoomHandler_connect=dc(this,"onDblClick",this,"_recenterZoomHandler");this.isShiftDoubleClickZoom=true;}},disableShiftDoubleClickZoom:function(){if(this.isShiftDoubleClickZoom){_23(this.declaredClass+": "+esri.bundle.map.deprecateShiftDblClickZoom,null,"v2.0");ddc(this._recenterZoomHandler_connect);this.isShiftDoubleClickZoom=false;}},enableClickRecenter:function(){if(!this.isClickRecenter){this._recenterHandler_connect=dc(this,"onClick",this,"_recenterHandler");this.isClickRecenter=true;}},disableClickRecenter:function(){if(this.isClickRecenter){ddc(this._recenterHandler_connect);this.isClickRecenter=false;}},enablePan:function(){if(!this.isPan){this._downPanHandler_connect=dc(this,this._panInitEvent,this,"_downPanHandler");this.isPan=true;}},disablePan:function(){if(this.isPan){ddc(this._downPanHandler_connect);this.isPan=false;}},enableRubberBandZoom:function(){if(!this.isRubberBandZoom){this._downZoomHandler_connect=dc(this,this._zoomInitEvent,this,"_downZoomHandler");this.isRubberBandZoom=true;}},disableRubberBandZoom:function(){if(this.isRubberBandZoom){ddc(this._downZoomHandler_connect);this.isRubberBandZoom=false;}},enableKeyboardNavigation:function(){if(!this.isKeyboardNavigation){this._keyNavigatingHandler_connect=dc(this,"onKeyDown",this,"_keyNavigatingHandler");this._keyNavigationEndHandler_connect=dc(this,"onKeyUp",this,"_keyNavigationEndHandler");this.isKeyboardNavigation=true;}},disableKeyboardNavigation:function(){if(this.isKeyboardNavigation){ddc(this._keyNavigatingHandler_connect);ddc(this._keyNavigationEndHandler_connect);this.isKeyboardNavigation=false;}},enableScrollWheelZoom:function(){if(!this.isScrollWheelZoom){this._scrollZoomHandler_connect=dc(this,"onMouseWheel",this,"_scrollZoomHandler");this.isScrollWheelZoom=true;}},__canStopSWEvt:function(){return this.isScrollWheelZoom||this.isScrollWheelPan;},disableScrollWheelZoom:function(){if(this.isScrollWheelZoom){ddc(this._scrollZoomHandler_connect);this.isScrollWheelZoom=false;}},_setScrollWheelPan:function(_49){this.isScrollWheelPan=_49;this.enableMouseWheel(_49);ddc(this._mwMacHandle);if(_49){this._mwMacHandle=dc(this,"onMouseWheel",this,this._scrollPanHandler);}},showPanArrows:function(){if(this._navDiv){esri.show(this._navDiv);this.isPanArrows=true;}},hidePanArrows:function(){if(this._navDiv){esri.hide(this._navDiv);this.isPanArrows=false;}},showZoomSlider:function(){if(this._slider){ds(this._slider.domNode||this._slider,"visibility","visible");this.isZoomSlider=true;}},hideZoomSlider:function(){if(this._slider){ds(this._slider.domNode||this._slider,"visibility","hidden");this.isZoomSlider=false;}}};}()));dojo.require("esri.layers.agsdynamic");dojo.require("esri.layers.agstiled");if(esri.isTouchEnabled){dojo.extend(esri.Map,(function(){var dc=dojo.connect,ddc=dojo.disconnect,_4a=esri.geometry.Point,_4b=esri.geometry.getLength,_4c=esri.TileUtils.getCandidateTileInfo;return {_multiTouchTapZoomHandler:function(evt){if(!this._isPanningOrZooming()){evt.value=-1;this._scrollZoomHandler(evt,true);}},_downPanHandler:function(evt){var _4d=this._zoomAnim||this._panAnim;if(_4d&&_4d._active){_4d.stop();_4d._fire("onEnd",[_4d.node]);}this._dragOrigin=new _4a(0,0);dojo.mixin(this._dragOrigin,evt.screenPoint);ddc(this._panHandler_connect);ddc(this._upPanHandler_connect);this._panHandler_connect=dc(this,"onTouchMove",this,this._panHandler);this._upPanHandler_connect=dc(this,"onTouchEnd",this,this._upPanHandler);},_panHandler:function(evt){evt.preventDefault();if(this.__panning){this._panX=evt.screenPoint.x;this._panY=evt.screenPoint.y;this.__pan(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);}else{this.setCursor("move");this.__panStart(evt.screenPoint.x,evt.screenPoint.y);}},_upPanHandler:function(evt){ddc(this._panHandler_connect);ddc(this._upPanHandler_connect);if(this.__panning){this.__panEnd(evt.screenPoint.x-this._dragOrigin.x,evt.screenPoint.y-this._dragOrigin.y);this.resetMapCursor();}},_downZoomHandler:function(evt){var _4e=this._zoomAnim||this._panAnim;if(_4e&&_4e._active){_4e.stop();_4e._fire("onEnd",[_4e.node]);}else{if(this.__panning){evt.screenPoint=new _4a(this._panX,this._panY);evt.mapPoint=this.toMap(evt.screenPoint);this._upPanHandler(evt);}}ddc(this._zoomHandler_connect);ddc(this._upZoomHandler_connect);this._zoomHandler_connect=dc(this,"onGestureChange",this,this._zoomHandler);this._upZoomHandler_connect=dc(this,"onGestureEnd",this,this._upZoomHandler);},_zoomHandler:function(evt){if(evt.screenPoints){evt.preventDefault();this.currLength=_4b(evt.screenPoints[0],evt.screenPoints[1]);if(this.__zooming){var _4f=this.currLength/this._length;this._zoomStartExtent=this.__scaleExtent(this.extent,_4f,this._dragOrigin);this.__zoom(this._zoomStartExtent,_4f,this._dragOrigin);}else{this._dragOrigin=new _4a((evt.screenPoints[0].x+evt.screenPoints[1].x)/2,(evt.screenPoints[0].y+evt.screenPoints[1].y)/2);this._length=this.currLength;this.__zoomStart(this.extent,this._dragOrigin);}this._fireOnScale(this.currLength/this._length,this._dragOrigin,true);}},_upZoomHandler:function(evt){ddc(this._zoomHandler_connect);ddc(this._upZoomHandler_connect);if(evt.processMultiTouchTap){this._multiTouchTapZoomHandler(evt);evt.preventDefault();}else{if(this.__zooming&&this._zoomAnim===null){var _50=this.currLength/this._length,_51=this.extent.getWidth();this._zoomAnimAnchor=this.toMap(this._dragOrigin);this._zoomStartExtent=this.__scaleExtent(this.extent,1/_50,this._zoomAnimAnchor);if(this.__tileInfo){var ct=_4c(this,this.__tileInfo,this._zoomStartExtent),_52=this.__getExtentForLevel(ct.lod.level,this._zoomAnimAnchor),_53=this.getNumLevels()-1,_54=_52.extent,_55=_52.lod,_56=_51/_54.getWidth(),_57=ct.lod.level;if(_50<1){if(_56>_50){_57--;}}else{if(_56<_50){_57++;}}if(_57<0){_57=0;}else{if(_57>_53){_57=_53;}}if(_57!==ct.lod.level){_52=this.__getExtentForLevel(_57,this._zoomAnimAnchor);_54=_52.extent;_55=_52.lod;}this._zoomEndExtent=_54;this._zoomEndLod=_55;this._zoomAnim=esri.fx.animateRange({range:{start:(_51/this._zoomStartExtent.getWidth()),end:_56},duration:esri.config.defaults.map.zoomDuration,rate:esri.config.defaults.map.zoomRate,onAnimate:dojo.hitch(this,"_adjustZoomHandler"),onEnd:dojo.hitch(this,"_adjustZoomEndHandler")}).play();this._fireOnScale(this.extent.getWidth()/this._zoomEndExtent.getWidth(),this._dragOrigin);}else{this._zoomEndExtent=this._zoomStartExtent;this._fireOnScale(this.extent.getWidth()/this._zoomEndExtent.getWidth(),this._dragOrigin);this._adjustZoomEndHandler();}}}},_adjustZoomHandler:function(_58){var _59=this.__scaleExtent(this.extent,_58,this._zoomAnimAnchor);this.__zoom(_59,_58,this._dragOrigin);},_adjustZoomEndHandler:function(){var _5a=this.extent.getWidth()/this._zoomEndExtent.getWidth(),_5b=this.__scaleExtent(this.extent,1/_5a,this._zoomAnimAnchor);this.__zoomEnd(_5b,_5a,this._dragOrigin,this._zoomEndLod,true);this._zoomStartExtent=this._zoomEndExtent=this._zoomEndLod=this._dragOrigin=this._zoomAnim=this._zoomAnimAnchor=null;}};}()));}}