2D Measuring with the ArcGIS API for JavaScript
esri.com