Select to view content in your preferred language

Measurement widget Change Miles to Kilometers

938
3
05-07-2013 03:39 PM
DavidMendoza
Emerging Contributor
Hi everyone!

I'm using de Measurement widget and it works great, how ever, I need to measure Distance in Km and Areas in Km2, actually this widget uses Miles an Acres.

I tried looking into the CSS that the widget uses whitout a good result.
0 Kudos
3 Replies
JianHuang
Deactivated User
David,

You can specify the default unit for area and length measurement. Please see the document at:
http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/measurement.html
You will find defaultAreaUnit and defaultLengthUnit is configurable.
Hope this helps.
0 Kudos
DavidMendoza
Emerging Contributor
Jian

Thank you so much! It gives the solution about mi need.
0 Kudos
Jorn_ArjanSijbertsma
Emerging Contributor
In kilometres:

#add the scale bar
dojo.connect(map, "onLoad", function(theMap) {
       var scalebar = new esri.dijit.Scalebar({
               map: map,
                scalebarUnit: "metric"
       });
});

This will do the job.

JS
0 Kudos