Select to view content in your preferred language

I need help to make an scaleZoom based application

577
1
08-18-2010 04:18 AM
jonataspovoas
Regular Contributor
Hi, where i work we have this application (on the screenshot):




The marked area is a zoom by scale function, where you type the scale and it zooms in till the map reaches the desired scale.

this application(.NET 4.0) doesn't use Silverlight, and what I need is to make an scale based zoom to our new applications, silverlight based.

does anyone have any idea of how to make it??
0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor
The Silverlight map uses resolution in stead of scale, since scale is a very misleading value on a computer screen (because you basically don't know the dimension of your screen).

So to zoom to a scale this use the Map.ZoomToResolution(mapUnitsPerPixel) method instead.
where mapUnitsPerPixels is how many meters/feets/degrees (based on what projection you use) one pixel covers.

To convert this value from a scale, you will need to know how big a pixel is on your screen. As mentioned above this is where it gets misleading, because most screens are different (when you connect a projector you even have two scales, one on your laptop and another one on your projector). An often used assumption is 96dpi (pixels per inch), so with a little math, you can calculate the resolution based on a specific scale (ie. 1:25000 means 1inch on screen = 25000 inches on the map, so at 96 dpi, 1 pixel is 25000/96, and lastly you should convert the inches to whatever unit your map projection is using) .
Also see the scale discussion here:
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Map.html
0 Kudos