Pages

Jan 2, 2010

how to zoom to a particular coordinate location in ArcGIS .Net webADF

Below is the method used to zoom in to a particular location using the coordinates. Unlike MapExtreme, ArcGIS uses ZoomFactor to zoom in and zoom out instead of ZoomWidth in MapExtreme.
Method:
private void ZoomToCoordinates()
    {
        ESRI.ArcGIS.ADF.Web.Geometry.Point center = null;
        try
        {            
            center = new ESRI.ArcGIS.ADF.Web.Geometry.Point(17.7244, 1.1883);
           // Numeric value is the Zoom factor(1-10 ZoomsIn & 0 to 1 ZoomsOut)
            Map1.Zoom(2, center);
        }
        catch (Exception)
        {
            throw;
        }
        finally
        {
            center = null;
        }
    }

No comments: