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 |
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 Basic | Copy 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
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