Select to view content in your preferred language

Measure units precision

1569
7
08-19-2010 08:40 PM
JeremyMoore
Deactivated User
Is there a way to get the Miles measure unit to display with decimal miles instead of rounding the preceding integer? I want it to display each segment and total in decimal miles (example 1.25).
0 Kudos
7 Replies
myfirstmyfirst
New Contributor
Is there a way to get the Miles measure unit to display with decimal miles instead of rounding the preceding integer? I want it to display each segment and total in decimal miles (example 1.25).


use:Math.Round(value, 2);
0 Kudos
JeremyMoore
Deactivated User
use:Math.Round(value, 2);


Thanks for the reply.  I can see your method will work for displaying the values using the geometryService.LengthsAsync.  I was just wondering if it was possible to somehow get the units to
diplay that way using the MeasureAction class.
<i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <esri:MeasureAction                                 
                                    AreaUnit="SquareMiles"
                                    DisplayTotals="True"
                                    DistanceUnit="Miles"
                                    MapUnits="DecimalDegrees"
                                    MeasureMode="Polygon"                                  
                                    FillSymbol="{StaticResource DefaultFillSymbol}"
                                    TargetName="MyMap"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>

But it doesn't appear to give you that option.

Thanks
0 Kudos
dotMorten_esri
Esri Notable Contributor
The precision of the output is based on the zoom scale you are at. Basically the more you zoom in, the more accurate you are measuring, and more decimals will be shown. So in other words: It only shows the number of significant digits. Showing anything more than that would be misleading.
0 Kudos
JeremyMoore
Deactivated User
The precision of the output is based on the zoom scale you are at. Basically the more you zoom in, the more accurate you are measuring, and more decimals will be shown. So in other words: It only shows the number of significant digits. Showing anything more than that would be misleading.


So, how would you change the number of significant digits then?  Can you give me an example of this in action?  The utilities measure in the samples SDK does not adjust the decimals as I zoom in. It shows zero Miles unitl I reach the next integer threshold. 

Thanks. I really appreciate the assistance.

Jeremy
0 Kudos
TomWang
Emerging Contributor
Do we have a solution for the question? ESRI Siverlight 2.1 or next version?

Thanks,
0 Kudos
TomWang
Emerging Contributor
Today is Apr. 07, 2011
0 Kudos
DominiqueBroux
Esri Frequent Contributor
The rounding of the measures will be enhanced in 2.2.
Not done yet  in beta though.
0 Kudos