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
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/>")
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/>")
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
See Also