Select to view content in your preferred language

How do i get the Scale value of the map?

440
1
08-31-2010 03:55 AM
jonataspovoas
Regular Contributor
Hi,

I'm making a "Zoom by scale" function for the SL map application here at work, and i'm having a little trouble getting the map scale.

I tried to get it by the map directly, and by the ESRI Scalebar, but i didn't find a way to get the value so i could make the math necessary to the way i found to build it.

Here's how I'm trying to make it:

private void BtnGo_Click(object sender, RoutedEventArgs e)
{
    double zoomFactor = 0;
    //mapScale should be the scale of the map and 
    //txtScale is a textbox where the user typed the desired scale
    zoomFactor = double.Parse(txtScale.Text) / mapScale;
    mapa.Zoom(zoomFactor);
}
0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor
Please see the API Reference for the map, where the relation between scale and resolution is explained:
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Map.html
0 Kudos