Select to view content in your preferred language

MeasureAction, ScaleLine returning different results

2387
3
04-25-2011 09:19 AM
CaleBerkey
Emerging Contributor
I'm learning the Silverlight API (2.2) by building a sample app and incorporating many of the features found in the interactive SDK.

I've noticed a difference in the results returned from the ScaleLine and the MeasureAction measure tool.  Please see the attached image, showing that the MeasureAction result in red displays 2 miles, where the ScaleLine displays 1 mile.  I can confirm that the ScaleLine is correct, where the MeasureAction results are ~ 1.5-2x inflated. 

ScaleLine definition:
            <esri:ScaleLine Margin="5" 
                            MapUnit="Meters" 
                            VerticalAlignment="Bottom"
                            HorizontalAlignment="Left"
                            Map="{Binding ElementName=Map}" />


MeasureAction definition:
                                <esri:MeasureAction AreaUnit="SquareMiles"
                                                    DisplayTotals="True"
                                                    DistanceUnit="Miles"
                                                    MapUnits="Meters"
                                                    MeasureMode="Polyline"                                   
                                                    FillSymbol="{StaticResource DefaultFillSymbol}"
                                                    TargetName="Map"/>


My base layer is the ubiquitous world street map layer:  http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer

Any pointers in the right direction would be greatly appreciated!  Interestingly, the results I'm getting are the same as in the interactive SDK - the sample must be incorrect?  Additionally, I can return correct results using the 'Line Lengths' sample, but that includes a bit of code, compared to the simple XAML declaration for the MeasureAction sample.  Obviously, I'd prefer less code, but it is nice to know I have a viable backup.
0 Kudos
3 Replies
RyanCoodey
Frequent Contributor
I think this is due to a know bug with the MeasureAction in Web Mercator in the 2.2 beta... sounds like it will be fixed in the next beta or final.  Check out this post: http://forums.arcgis.com/threads/27909-MeasureAction-in-Web-Mercator-Issues...

Hope that helps.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I confirm Ryan's answer.
It's likely a measure action bug which is fixed in final : the web mercator projection was not taken into account and the rounding of the measure was not always the best.
0 Kudos
CaleBerkey
Emerging Contributor
Ryan, Dominique,

Thanks for your responses.  Good to know I wasn't missing something. 

Interesting that the scaleline should work with Mercator, but the measureaction be unable to handle it at this point.  Looking forward to ESRI addressing the bug.  Also good to know that I'm left with the backup option, which, at least, I can fine tune.

Many thanks.
0 Kudos