ESRI.ArcGIS.ADF.IMS
Zoom(Double) Method
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto Namespace > View Class > Zoom Method : Zoom(Double) Method




scaleFactor
Positive value to zoom-in, negative value to zoom-out.
Zooms in to center of the map with a desired scale factor.

Syntax

Visual Basic (Declaration) 
Public Overloads Overridable Function Zoom( _
   ByVal scaleFactor As Double _
) As CartoImage
Visual Basic (Usage)Copy Code
Dim instance As View
Dim scaleFactor As Double
Dim value As CartoImage
 
value = instance.Zoom(scaleFactor)
C# 
public virtual CartoImage Zoom( 
   double scaleFactor
)

Parameters

scaleFactor
Positive value to zoom-in, negative value to zoom-out.

Return Value

New zoomed map image, in the form of a CartoImage object. Use CartoImage.Url to retrieve the image's URL.

Example

This example sets the map envelope, then zooms the map in by a positive scale factor, and prints the resulting extent to a label.
C#Copy Code
Envelope env = new Envelope(-60, -60, 60, 60); 

mapView.Extent = env; 

  

mapView.Zoom(2); 

env = mapView.Extent; 

// Map extent is now (-30, -30, 30, 30); 

lblCartoImage.Text = "<br>Extent after zoom: " + env.XMin.ToString() + "," + env.XMax.ToString() 

    + ", " + env.YMin.ToString() + "," + env.YMax.ToString(); 

    
Visual BasicCopy Code
Dim env As New Envelope(-60, -60, 60, 60)

mapView.Extent = env



mapView.Zoom(2)

env = mapView.Extent

' Map extent Is now (-30, -30, 30, 30);

lblCartoImage.Text = "<br>Extent after zoom: " + env.XMin.ToString() + "," + env.XMax.ToString() _

    + ", " + env.YMin.ToString() + "," + env.YMax.ToString()

Remarks

This method zooms the center in or out from the current center point. Positive values zoom the map in. Negative values zoom the map out.

If the scaleFactor is positive, the map is zoomed in such that the map extent in x and y are each 1/(scaleFactor) as large as previously. For example, Zoom(2) will generate a new image that has one-half the extent in each direction as before, or approximately one-quarter the previous area.

If the scaleFactor is negative, the map is zoomed out such that the map extent in x and y are each ((-1)scaleFactor) times as large as previously. For example, Zoom(-2) will generate a new map that has twice the extent in each direction as before, and will cover approximately four times the previous area.

Any Zoom, Pan, CenterAt or Draw method which changes the map extent also changes the map extent for the MapView.

Note that all zoom, pan, and re-center methods cause the server to generate a map, whether it is accessed or not. If the result of this method is not assigned to a CartoImage object, the image can be retrieved with the Image property of the view.

See Also

© 2010 All Rights Reserved.