Select to view content in your preferred language

measure LIne, Polygon display distance in window,How 2 Convert One MapUnit to another

675
3
08-17-2010 02:04 AM
AnurithaPathireddy
Emerging Contributor
Hi all,

Is it Possible to Convert one MapUnit to another MapUnit?
We are able to find the Distance of the Measured Polyline and Polygon area,Perimeter in Map Units...

But I am displaying the Distance in A new window... I have a Dropdown to Change the Measure Units.

the Problem is When I Change the Mesure Unit and remeasure the featutes on Map It should show the distance in Selected Measure Unit... But How Can I Convert One ScalebarUnit to another ScalebarUnit (For AreaUnit also Same).



Anuritha Pathireddy
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
You can measure in one unit and convert into another unit. Here's some conversion table I found online: http://library.thinkquest.org/3804/length.html

If they will be choosing unit of measurement before calculating distance, you can change the Distance Parameter (Distance Unit) before calling DistanceAsync(). Here's the SDK sample:http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Distance

But if you expect the unit of measurement to change after Distance has been calculated, it would make sense to just perform the conversion to the new unit of measurement instead of re-calculating distance.
0 Kudos
AnurithaPathireddy
Emerging Contributor
Hi Thanks for your response...

I have seen the sample That was given in ArcGIS Silverlight API Samples.... But the Only thing I didn't get is How could we Know the Map Units at Runtime? for all the MapServices The MapUnits will not be Same.We can get the MapUnits by ArcGISDynamicMapServiceLayer.Units But How Can I convert the Map Units dynamically... ?


My Problem is Whatever will be the Map Service Units They need to be Converted to the Unit which I Select at runtime.... How it is Possible?


Anuritha Pathireddy
0 Kudos
JenniferNery
Esri Regular Contributor
You can set DistanceParameter's DisplayUnit to always be in Kilometers for example, and then if user chooses another unit, convert from Kilometers to the desired unit.
0 Kudos