ESRI.ArcGIS.ADF.IMS
DefaultExtent Property
See Also  Example Send Feedback
ESRI.ArcGIS.ADF.IMS.Carto Namespace > MapService Class : DefaultExtent Property




Gets the default extent of the Map as defined in the service configuration.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property DefaultExtent As Envelope
Visual Basic (Usage)Copy Code
Dim instance As MapService
Dim value As Envelope
 
value = instance.DefaultExtent
C# 
public Envelope DefaultExtent {get;}

Example

This example prints the extents for three types of envelopes that may be defined for the MapService: DefaultExtent , RecommendedMaxExtent and FullExtent .
C#Copy Code
StringBuilder sb = new StringBuilder();
Envelope theEnv;
 
// DefaultExtent is the initial extent, usually extent in map as saved when authored
theEnv = mapService.DefaultExtent;
sb.Append("Default extent: XMin=" + theEnv.XMin.ToString() + ", XMax=" + theEnv.XMax.ToString());
sb.Append(", YMin=" + theEnv.YMin.ToString() + ", YMax=" + theEnv.YMax.ToString() + "<br/>");
 
// RecommendedMaxExtent only valid for image services, and only if Extent_Limit is included
theEnv = mapService.RecommendedMaxExtent;
sb.Append("Recommended maximum extent: XMin=" + theEnv.XMin.ToString() + ", XMax=" + theEnv.XMax.ToString());
sb.Append(", YMin=" + theEnv.YMin.ToString() + ", YMax=" + theEnv.YMax.ToString() + "<br/>");
 
// FullExtent only valid if LoadLayerExtents is true in InitializationParameters
theEnv = mapService.FullExtent;
sb.Append("Extent of all layers: XMin=" + theEnv.XMin.ToString() + ", XMax=" + theEnv.XMax.ToString());
sb.Append(", YMin=" + theEnv.YMin.ToString() + ", YMax=" + theEnv.YMax.ToString() + "<br/>");
 
lblEnvelopes.Text = sb.ToString();
Visual BasicCopy Code
Dim sb As New StringBuilder()
Dim theEnv As Envelope
 
' DefaultExtent is the initial extent, usually extent in map as saved when authored
theEnv = mapService.DefaultExtent
sb.Append("Default extent: XMin=" + theEnv.XMin.ToString() + ", XMax=" + theEnv.XMax.ToString())
sb.Append(", YMin=" + theEnv.YMin.ToString() + ", YMax=" + theEnv.YMax.ToString() + "<br/>")
 
' RecommendedMaxExtent only valid for image services, and only if Extent_Limit is included
theEnv = mapService.RecommendedMaxExtent
sb.Append("Recommended maximum extent: XMin=" + theEnv.XMin.ToString() + ", XMax=" + theEnv.XMax.ToString())
sb.Append(", YMin=" + theEnv.YMin.ToString() + ", YMax=" + theEnv.YMax.ToString() + "<br/>")
 
' FullExtent only valid if LoadLayerExtents is True in InitializationParameters
theEnv = mapService.FullExtent
sb.Append("Extent of all layers: XMin=" + theEnv.XMin.ToString() + ", XMax=" + theEnv.XMax.ToString())
sb.Append(", YMin=" + theEnv.YMin.ToString() + ", YMax=" + theEnv.YMax.ToString() + "<br/>")
 
lblEnvelopes.Text = sb.ToString()

Remarks

Defines the recommended initial extent of the map. For standard image services, this is the extent set with the ENVELOPE tag that includes the name attribute "Initial_Extent". If the Author application is used to create the map configuration file, this will be the extent when the map was saved. For ArcMap image services, this is the extent of the map when saved in the ArcMap desktop application.

The DefaultExtent is not necessarily the full extent of all layers or features. See RecommendedMaxExtent and FullExtent for obtaining maximum or full extent information.

This property, as with all properties of MapService, is read-only.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2011 All Rights Reserved.