/*
 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.dijit.Measurement"]){dojo._hasResource["esri.dijit.Measurement"]=true;dojo.provide("esri.dijit.Measurement");dojo.require("dijit._Widget");dojo.require("dijit._Templated");dojo.require("esri.map");dojo.require("esri.geometry");dojo.require("esri.symbol");dojo.require("dojo.parser");dojo.require("dijit.layout.ContentPane");dojo.require("dijit.Menu");dojo.require("dijit.form.Button");dojo.require("esri.tasks.geometry");dojo.require("esri.WKIDUnitConversion");(function(){var _1=[dojo.moduleUrl("esri.dijit","css/Measurement.css")];var _2=document.getElementsByTagName("head").item(0),_3;for(var i=0,il=_1.length;i<il;i++){_3=document.createElement("link");_3.type="text/css";_3.rel="stylesheet";_3.href=_1[i].toString();_2.appendChild(_3);}}());dojo.declare("esri.dijit.Measurement",[dijit._Widget,dijit._Templated],{widgetsInTemplate:true,templateString:"<div class=\"esriMeasurement\">\r\n  <div dojoType='dijit.form.ToggleButton' baseClass='esriButton' dojoAttachPoint='area' checked='false' iconClass='areaIcon' showLabel='false' dojoAttachEvent='onClick:areaToggleButton'></div>\r\n  <div dojoType='dijit.form.ToggleButton' baseClass='esriButton' dojoAttachPoint='distance' iconClass='distanceIcon' showLabel='false' dojoAttachEvent='onClick:distanceToggleButton'></div>\r\n  <div dojoType='dijit.form.ToggleButton' baseClass='esriButton' dojoAttachPoint='location' iconClass='locationIcon' showLabel='false' dojoAttachEvent='onClick:locationToggleButton'></div>\r\n  <div style=\"display:inline;margin-left:2px;margin-right:2px;padding-top:2px;\">|</div>\r\n  <button dojoType='dijit.form.DropDownButton' baseClass='esriToggleButton' dojoAttachPoint='unit' label='unit' value='unit' style='visibility:hidden;'></button>\r\n  <div dojoType='dijit.layout.ContentPane' dojoAttachPoint='resultLabel' class='resultLabel'></div>\r\n  <div dojoType='dijit.layout.ContentPane' dojoAttachPoint='resultValue' align='left' class='result'></div>\r\n</div>\r\n",unitDictionary:[],result:null,inputPoints:[],measureGraphics:[],numberPattern:"#,###,###,##0.0",constructor:function(_4,_5){_4=_4||{};if(!_4.map){console.log("dijit.MeasureTool: unable to find the 'map' property in parameters");return;}this._map=_4.map;this._map.cs=this._checkCS(this._map.spatialReference);this._geometryService=esri.config.defaults.geometryService;if(_4.pointSymbol){this._pointSymbol=_4.pointSymbol;}else{var _6=dojo.moduleUrl("esri.dijit","./images/flag.png");this._pointSymbol=new esri.symbol.PictureMarkerSymbol(_6.uri,24,24);this._pointSymbol.setOffset(9,11);}if(_4.lineSymbol){this._lineSymbol=_4.lineSymbol;}else{this._lineSymbol=new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,128,255]),3);}if(_4.defaultLengthUnit){this._defaultLengthUnit=_4.defaultLengthUnit;}else{this._defaultLengthUnit=esri.Units.MILES;}if(_4.defaultAreaUnit){this._defaultAreaUnit=_4.defaultAreaUnit;}else{this._defaultAreaUnit=esri.Units.ACRES;}if(_4.defaultLocationUnit){this._defaultLocationUnit=_4.defaultLocationUnit;}else{this._defaultLocationUnit=esri.Units.DECIMAL_DEGREES;}this._snappingCallback=dojo.hitch(this,this._snappingCallback);},startup:function(){var _7=esri.bundle.widgets.measurement;this.unitDictionary[_7.NLS_length_miles]=1;this.unitDictionary[_7.NLS_length_kilometers]=1.609344;this.unitDictionary[_7.NLS_length_feet]=5280;this.unitDictionary[_7.NLS_length_meters]=1609.34;this.unitDictionary[_7.NLS_length_yards]=1760;this.unitDictionary["Nautical Miles"]=0.869;this.unitDictionary[_7.NLS_area_acres]=1;this.unitDictionary[_7.NLS_area_sq_kilometers]=0.004047;this.unitDictionary[_7.NLS_area_sq_miles]=0.0015625;this.unitDictionary[_7.NLS_area_sq_feet]=43560;this.unitDictionary[_7.NLS_area_sq_meters]=4046.87;this.unitDictionary[_7.NLS_area_hectares]=0.4047;this.unitDictionary[_7.NLS_area_sq_yards]=4840;this.units={"esriMiles":_7.NLS_length_miles,"esriKilometers":_7.NLS_length_kilometers,"esriFeet":_7.NLS_length_feet,"esriMeters":_7.NLS_length_meters,"esriYards":_7.NLS_length_yards,"esriAcres":_7.NLS_area_acres,"esriSquareKilometers":_7.NLS_area_sq_kilometers,"esriSquareMiles":_7.NLS_area_sq_miles,"esriSquareFeet":_7.NLS_area_sq_feet,"esriSquareMeters":_7.NLS_area_sq_meters,"esriHectares":_7.NLS_area_hectares,"esriSquareYards":_7.NLS_area_sq_yards,"esriDecimalDegrees":_7.NLS_decimal_degrees,"esriDegreeMinuteSeconds":_7.NLS_deg_min_sec};dijit.byNode(this.distance.domNode).setLabel(esri.bundle.widgets.measurement.NLS_distance);dijit.byNode(this.area.domNode).setLabel(esri.bundle.widgets.measurement.NLS_area);dijit.byNode(this.location.domNode).setLabel(esri.bundle.widgets.measurement.NLS_location);dijit.byNode(this.resultLabel.domNode).setContent(esri.bundle.widgets.measurement.NLS_resultLabel);},measureArea:function(){this._map.__setClickDuration(0);this._createAreaUnitList();this.inputPoints=[];this.tempGraphic=new esri.Graphic();this.tempGraphic.setSymbol(this._lineSymbol);this.tempGraphic.setGeometry(new esri.geometry.Polyline());this._map.graphics.add(this.tempGraphic);if(this._map.cs==="PCS"){this._geometryAreaHandler=dojo.connect(this._geometryService,"onAreasAndLengthsComplete",this,"_outputArea");}this.mouseClickMapHandler=dojo.connect(this._map,"onClick",this,"_measureAreaMouseClickHandler");this.doubleClickMapHandler=dojo.connect(this._map,"onDblClick",this,"_measureAreaDblClickHandler");},measureDistance:function(){this._map.__setClickDuration(0);if(this._map.cs==="PCS"){this._projectMapExtent(this._map.extent);this._mapExtentChangeHandler=dojo.connect(this._map,"onExtentChange",this,"_projectMapExtent");}this.inputPoints=[];this._createLengthUnitList();this.mouseClickMapHandler=dojo.connect(this._map,"onClick",this,"_measureDistanceMouseClickHandler");this.doubleClickMapHandler=dojo.connect(this._map,"onDblClick",this,"_measureDistanceDblClickHandler");},measureLocation:function(){this._map.__setClickDuration(0);this.measureGraphics=[];this._createLocationUnitList();this._map.graphics.remove(this.locationGraphic);if(this._map.cs==="PCS"){this._projectMapExtent(this._map.extent);this._mapExtentChangeHandler=dojo.connect(this._map,"onExtentChange",dojo.hitch(this,this._projectMapExtent));}this._clickMapHandler=dojo.connect(this._map,"onClick",this,"_measureLocationClickHandler");this.mouseMoveMapHandler=dojo.connect(this._map,"onMouseMove",this,"_showCoordinates");this.mouseDragMapHandler=dojo.connect(this._map,"onMouseDrag",dojo.hitch(this,function(){dijit.byNode(this.resultValue.domNode).setAttribute("disabled",true);}));},setTool:function(_8,_9){this.closeTool();var _a=dijit.byNode(this[_8].domNode).checked;dojo.style(this.unit.domNode,"visibility","visible");dijit.byNode(this.area.domNode).setAttribute("checked",false);dijit.byNode(this.distance.domNode).setAttribute("checked",false);dijit.byNode(this.location.domNode).setAttribute("checked",false);if(_9===true||_9===false){_a=_9;}dijit.byNode(this[_8].domNode).setAttribute("checked",_a);if(_a){this.activeTool=_8;if(this.map.isDoubleClickZoom){this._map.disableDoubleClickZoom();}if(_8==="area"){this.measureArea();}else{if(_8==="distance"){this.measureDistance();}else{if(_8==="location"){this.measureLocation();}}}if(this._map.snappingManager){this._map.snappingManager._startSelectionLayerQuery();this._map.snappingManager._setUpSnapping();}}},areaToggleButton:function(){this.clearResult();this.setTool("area");},distanceToggleButton:function(){this.clearResult();this.setTool("distance");},locationToggleButton:function(){this.clearResult();this.setTool("location");},closeTool:function(){var _b=this._map;_b.__resetClickDuration();if(!_b.isDoubleClickZoom){_b.enableDoubleClickZoom();}this.inputPoints=[];if(_b.snappingManager&&_b.snappingManager._snappingGraphic){_b.graphics.remove(_b.snappingManager._snappingGraphic);}dojo.disconnect(this.mouseClickMapHandler);dojo.disconnect(this.mouseMoveMapHandler);dojo.disconnect(this.doubleClickMapHandler);dojo.disconnect(this.mouseDragMapHandler);dojo.disconnect(this._clickMapHandler);dojo.disconnect(this._mapExtentChangeHandler);dojo.disconnect(this._geometryAreaHandler);if(this._map.snappingManager){this._map.snappingManager._stopSelectionLayerQuery();this._map.snappingManager._killOffSnapping();}},clearResult:function(){var _c=this._map;this.result=0;dijit.byNode(this.resultValue.domNode).setAttribute("content","");for(var i=0;i<this.measureGraphics.length;i++){_c.graphics.remove(this.measureGraphics[i]);}this.measureGraphics=[];_c.graphics.remove(this.tempGraphic);},show:function(){esri.show(this.domNode);},hide:function(){esri.hide(this.domNode);},showTool:function(_d){var _e=this[_d].domNode;_e.style.display="inline";},hideTool:function(_f){var _10=this[_f].domNode;_10.style.display="none";},destroy:function(){this.closeTool();this.clearResult();this.inherited(arguments);this._map=this._geometryService=this.measureGraphic=this.measureGraphic=this.tempGraphic=null;},onMeasureEnd:function(){},_densifyGeometry:function(_11){if(this._map.cs==="Web Mercator"){_11=esri.geometry.webMercatorToGeographic(_11);}var _12;if(this._map.cs==="PCS"){_12=_11;}else{_12=esri.geometry.geodesicDensify(_11,500000);}if(this._map.cs==="Web Mercator"){_12=esri.geometry.geographicToWebMercator(_12);}return _12;},_measureAreaMouseClickHandler:function(evt){var _13;if(this._map.snappingManager){_13=this._map.snappingManager._snappingPoint;}var _14=_13||evt.mapPoint;this.inputPoints.push(_14);this._currentStartPt=_14;if(this.inputPoints.length===1){this.tempGraphic.setGeometry(new esri.geometry.Polyline());for(var i=0;i<this.measureGraphics.length;i++){this._map.graphics.remove(this.measureGraphics[i]);}this.measureGraphics=[];this.result=0;this._outputResult(this.result,esri.bundle.widgets.measurement.NLS_area_acres);this.mouseMoveMapHandler=dojo.connect(this._map,"onMouseMove",this,"_measureAreaMouseMoveHandler");}this.measureGraphic=new esri.Graphic();this.measureGraphic.setSymbol(this._lineSymbol);this.measureGraphics.push(this.measureGraphic);if(this.inputPoints.length>1){var _15=new esri.geometry.Polyline(this._map.spatialReference);_15.addPath([this.inputPoints[this.inputPoints.length-2],_14]);var _16=new esri.geometry.Polyline(this._map.spatialReference);_16.addPath([this.inputPoints[0],_14]);var _17=this._densifyGeometry(_15);var _18=this._densifyGeometry(_16);this.tempGraphic.setGeometry(_18);this.measureGraphic.setGeometry(_17);this._map.graphics.add(this.measureGraphic);}},_measureAreaMouseMoveHandler:function(evt){var _19;if(this.inputPoints.length>0){var _1a=new esri.geometry.Polyline(this._map.spatialReference);var _1b;if(this._map.snappingManager){_1b=this._map.snappingManager._snappingPoint;}_19=_1b||evt.mapPoint;_1a.addPath([this._currentStartPt,_19]);var _1c=this._densifyGeometry(_1a);this.tempGraphic.setGeometry(_1c);}if(this.inputPoints.length>1){var _1d=new esri.geometry.Polyline(this._map.spatialReference);_1d.addPath([_19,this.inputPoints[0]]);var _1e=this._densifyGeometry(_1d);this.tempGraphic.setGeometry(this.tempGraphic.geometry.addPath(_1e.paths[0]));}},_measureAreaDblClickHandler:function(evt){dojo.disconnect(this.mouseMoveMapHandler);var _1f=new esri.geometry.Polygon(this._map.spatialReference);var _20=[];for(var i=0;i<this.inputPoints.length;i++){_20.push([this.inputPoints[i].x,this.inputPoints[i].y]);}_20.push([this.inputPoints[0].x,this.inputPoints[0].y]);_1f.addRing(_20);this.inputPoints=[];this.measurementGeometry=this._densifyGeometry(_1f);this._getArea(_1f);},_getArea:function(_21){var _22=[];var _23=new esri.tasks.AreasAndLengthsParameters();_23.areaUnit=esri.tasks.GeometryService.UNIT_ACRES;if(esri.geometry.polygonSelfIntersecting(_21)){this._geometryService.simplify([_21],dojo.hitch(this,function(_24){dojo.forEach(_24,dojo.hitch(this,function(_25,idx){if(this._map.cs==="PCS"){_23.polygons=_24;this._geometryService.areasAndLengths(_23);return;}else{if(this._map.cs==="Web Mercator"){_25=esri.geometry.webMercatorToGeographic(_25);}}_22.push(_25);}));var _26=esri.geometry.geodesicAreas(_22,esri.Units.ACRES);this._showArea(_26[0]);}));}else{if(this._map.cs==="Web Mercator"){_21=esri.geometry.webMercatorToGeographic(_21);}_22.push(_21);if(this._map.cs==="PCS"){_23.polygons=_22;this._geometryService.areasAndLengths(_23);return;}var _27=esri.geometry.geodesicAreas(_22,esri.Units.ACRES);this._showArea(Math.abs(_27[0]));}},_outputArea:function(_28){this._showArea(Math.abs(_28.areas[0]));},_showArea:function(_29){if(_29){this.result=_29;var _2a=dijit.byNode(this.unit.domNode).label;this._outputResult(this.result,_2a);}this.onMeasureEnd(this.activeTool,this.measurementGeometry);},_measureDistanceDblClickHandler:function(evt){dojo.disconnect(this.mouseMoveMapHandler);var _2b=new esri.geometry.Polyline(this._map.spatialReference);_2b.addPath(this.inputPoints);_2b=this._densifyGeometry(_2b);this.inputPoints=[];this.onMeasureEnd(this.activeTool,_2b);},_measureDistanceMouseClickHandler:function(evt){var _2c;if(this._map.snappingManager){_2c=this._map.snappingManager._snappingPoint;}var _2d=_2c||evt.mapPoint;this.inputPoints.push(_2d);this._currentStartPt=_2d;if(this.inputPoints.length===1){for(var i=0;i<this.measureGraphics.length;i++){this._map.graphics.remove(this.measureGraphics[i]);}this._map.graphics.remove(this.tempGraphic);this.measureGraphics=[];this.result=0;this._outputResult(this.result,esri.bundle.widgets.measurement.NLS_length_miles);this.tempGraphic=new esri.Graphic();this.tempGraphic.setSymbol(this._lineSymbol);this._map.graphics.add(this.tempGraphic);this.mouseMoveMapHandler=dojo.connect(this._map,"onMouseMove",this,"_measureDistanceMouseMoveHandler");}this.tempGraphic.setGeometry(new esri.geometry.Polyline());this.flagGraphic=new esri.Graphic();this.flagGraphic.setSymbol(this._pointSymbol);this.flagGraphic.setGeometry(_2d);this.measureGraphics.push(this.flagGraphic);this._map.graphics.add(this.flagGraphic);if(this.inputPoints.length>1){this.measureGraphic=new esri.Graphic();this.measureGraphic.setSymbol(this._lineSymbol);this.measureGraphics.push(this.measureGraphic);var _2e=new esri.geometry.Polyline(this._map.spatialReference);_2e.addPath([this.inputPoints[this.inputPoints.length-2],_2d]);var _2f=this._densifyGeometry(_2e);this.measureGraphic.setGeometry(_2f);this._map.graphics.add(this.measureGraphic);this.result+=this._geodesicDistance(this.inputPoints[this.inputPoints.length-2],_2d);this._showDistance(this.result);}},_measureDistanceMouseMoveHandler:function(evt){if(this.inputPoints.length>0){var _30=new esri.geometry.Polyline(this._map.spatialReference);var _31;if(this._map.snappingManager){_31=this._map.snappingManager._snappingPoint;}var _32=_31||evt.mapPoint;_30.addPath([this._currentStartPt,_32]);var _33=this._densifyGeometry(_30);this.tempGraphic.setGeometry(_33);var _34=this._geodesicDistance(this._currentStartPt,_32);this._showDistance(_34+this.result);}},_geodesicDistance:function(pt1,pt2){var _35=new esri.geometry.Polyline(this._map.spatialReference);if(this._map.cs==="PCS"){pt1=this._getGCSLocation(pt1);pt2=this._getGCSLocation(pt2);}_35.addPath([pt1,pt2]);if(this._map.cs==="Web Mercator"){_35=esri.geometry.webMercatorToGeographic(_35);}return esri.geometry.geodesicLengths([_35],esri.Units.MILES)[0];},_showDistance:function(_36){if(_36){this._outputResult(_36,dijit.byNode(this.unit.domNode).label);}},_measureLocationClickHandler:function(evt){dijit.byNode(this.location.domNode).setAttribute("checked",false);var _37;if(this._map.snappingManager){_37=this._map.snappingManager._snappingPoint;}var _38=_37||evt.mapPoint;this.locationToggleButton();this.locationGraphic=new esri.Graphic();this.locationGraphic.setGeometry(_38);this.locationGraphic.setSymbol(this._pointSymbol);this._map.graphics.add(this.locationGraphic);this.measureGraphics.push(this.locationGraphic);var _39={mapPoint:_38};this._showCoordinates(_39);this.onMeasureEnd(this.activeTool,_38);},_getGCSLocation:function(pt){var _3a=pt;if(this._map.cs==="Web Mercator"){_3a=esri.geometry.webMercatorToGeographic(_3a);}else{if(this._map.cs==="PCS"){if(this._map._newExtent){var _3b=Math.abs((this._map._newExtent.xmax-this._map._newExtent.xmin)/(this._map.extent.xmax-this._map.extent.xmin));var _3c=Math.abs((this._map._newExtent.ymax-this._map._newExtent.ymin)/(this._map.extent.ymax-this._map.extent.ymin));var _3d=(_3a.x-this._map.extent.xmin)*_3b+this._map._newExtent.xmin;var _3e=(_3a.y-this._map.extent.ymin)*_3c+this._map._newExtent.ymin;_3a=new esri.geometry.Point(_3d,_3e);}}}return _3a;},_projectMapExtent:function(_3f){var _40=new esri.Graphic(_3f);var _41=new esri.SpatialReference({wkid:4326});this._geometryService.project([_40.geometry],_41,dojo.hitch(this,function(_42){if(!this.mouseMoveMapHandler&&this.activeTool==="location"){this.mouseMoveMapHandler=dojo.connect(this._map,"onMouseMove",dojo.hitch(this,this._showCoordinates));this.mouseDragMapHandler=dojo.connect(this._map,"onMouseDrag",dojo.hitch(this,function(){dijit.byNode(this.resultValue.domNode).setAttribute("disabled",true);}));}this._map._newExtent=_42[0];}));},_showCoordinates:function(evt){var _43;if(this._map.snappingManager){_43=this._map.snappingManager._snappingPoint;}var _44=_43||evt.mapPoint;var _45=this._getGCSLocation(_44);this.locationX=_45.x;this.locationY=_45.y;this._outputLocationResult(_45.x,_45.y,dijit.byNode(this.unit.domNode).label);},_checkCS:function(_46){if(_46.wkid){if(_46.wkid===3857||_46.wkid===102100||_46.wkid===102113){return "Web Mercator";}if(esri._isDefined(esri.WKIDUnitConversion[_46.wkid])){return "PCS";}return "GCS";}if(_46.wkt){if(_46.wkt.indexOf("WGS_1984_Web_Mercator")!==-1){return "Web Mercator";}if(_46.wkt.indexOf("PROJCS")===0){return "PCS";}return "GCS";}},_switchUnit:function(_47){dijit.byNode(this.unit.domNode).setAttribute("label",_47);if(this.result===null){return;}this._outputResult(this.result,_47);},_outputResult:function(_48,_49){var _4a=_48*this.unitDictionary[_49];if(_4a===0){dijit.byNode(this.resultValue.domNode).setAttribute("content","");}else{if(_4a>1000000){dijit.byNode(this.resultValue.domNode).setAttribute("content",dojo.number.format(_4a.toPrecision(9),{pattern:this.numberPattern})+" "+_49);}else{dijit.byNode(this.resultValue.domNode).setAttribute("content",dojo.number.format(_4a.toFixed(2),{pattern:this.numberPattern})+" "+_49);}}},_switchLocationUnit:function(_4b){dijit.byNode(this.unit.domNode).setAttribute("label",_4b);if(this.result===null){return;}this._outputLocationResult(this.locationX,this.locationY,_4b);},_outputLocationResult:function(x,y,_4c){var lon,lat;var _4d=esri.bundle.widgets.measurement;if(_4c===_4d.NLS_decimal_degrees){lon=x.toFixed(6);lat=y.toFixed(6);}else{if(_4c===_4d.NLS_deg_min_sec){var _4e=false;var _4f=false;if(x<0){_4e=true;x=Math.abs(x);}if(y<0){_4f=true;y=Math.abs(y);}lon=Math.floor(x)+"°"+Math.floor((x-Math.floor(x))*60)+"'"+Math.floor(((x-Math.floor(x))*60-Math.floor((x-Math.floor(x))*60))*60)+"\"";lat=Math.floor(y)+"°"+Math.floor((y-Math.floor(y))*60)+"'"+Math.floor(((y-Math.floor(y))*60-Math.floor((y-Math.floor(y))*60))*60)+"\"";if(_4e){lon="-"+lon;}if(_4f){lat="-"+lat;}}}dijit.byNode(this.resultValue.domNode).setAttribute("content",esri.bundle.widgets.measurement.NLS_longitude+": "+lon+"<br/>"+esri.bundle.widgets.measurement.NLS_latitude+": "+lat);},_createLengthUnitList:function(){var _50=new dijit.Menu({style:"display: none;"});var _51=esri.bundle.widgets.measurement;var _52=[_51.NLS_length_miles,_51.NLS_length_kilometers,_51.NLS_length_feet,_51.NLS_length_meters,_51.NLS_length_yards];dojo.forEach(_52,dojo.hitch(this,function(_53,idx){var _54=new dijit.MenuItem({label:_53,onClick:dojo.hitch(this,function(){this._switchUnit(_53);})});_54.setAttribute("class","unitDropDown");_50.addChild(_54);}));dijit.byNode(this.unit.domNode).setAttribute("dropDown",_50);var _55=this.units[this._defaultLengthUnit];dijit.byNode(this.unit.domNode).setAttribute("label",_55);},_createAreaUnitList:function(){var _56=new dijit.Menu({style:"display: none;"});var _57=esri.bundle.widgets.measurement;var _58=[_57.NLS_area_acres,_57.NLS_area_sq_miles,_57.NLS_area_sq_kilometers,_57.NLS_area_hectares,_57.NLS_area_sq_yards,_57.NLS_area_sq_feet,_57.NLS_area_sq_meters];dojo.forEach(_58,dojo.hitch(this,function(_59,idx){var _5a=new dijit.MenuItem({label:_59,onClick:dojo.hitch(this,function(){this._switchUnit(_59);})});_5a.setAttribute("class","unitDropDown");_56.addChild(_5a);}));dijit.byNode(this.unit.domNode).setAttribute("dropDown",_56);var _5b=this.units[this._defaultAreaUnit];dijit.byNode(this.unit.domNode).setAttribute("label",_5b);},_createLocationUnitList:function(){var _5c=new dijit.Menu({style:"display: none;"});var _5d=esri.bundle.widgets.measurement;var _5e=[_5d.NLS_decimal_degrees,_5d.NLS_deg_min_sec];dojo.forEach(_5e,dojo.hitch(this,function(_5f,idx){var _60=new dijit.MenuItem({label:_5f,onClick:dojo.hitch(this,function(){this._switchLocationUnit(_5f);})});_60.setAttribute("class","unitDropDown");_5c.addChild(_60);}));dijit.byNode(this.unit.domNode).setAttribute("dropDown",_5c);var _61=this.units[this._defaultLocationUnit];dijit.byNode(this.unit.domNode).setAttribute("label",_61);}});}