ESRI.ArcGIS.ADF
Extent Property
See Also  Send comments on this topic.
ESRI.ArcGIS.ADF.BaseClasses Namespace > BaseCustomGlobeLayer Class : Extent Property




The layers geodataset extent which is a union of the extents of all the items of the layer

Syntax

Visual Basic (Declaration) 
Public Overridable ReadOnly Property Extent As IEnvelope
Visual Basic (Usage)Copy Code
Dim instance As BaseCustomGlobeLayer
Dim value As IEnvelope
 
value = instance.Extent
C# 
public virtual IEnvelope Extent {get;}

Remarks

In your inheriting class, consider the following code to calculate the layer's extent:

public override IEnvelope Extent
            {
 get
 {
   m_extent  = GetLayerExtent();
   if (null == m_extent )
     return null;

   IEnvelope env = ((IClone)m_extent ).Clone() as IEnvelope;

   return env;
 }
            }
   private IEnvelope GetLayerExtent()
            {
 if (null == base.m_spRef)
 {
   base.m_spRef = CreateGeographicSpatialReference();
 }

 IEnvelope env = new EnvelopeClass();
 env.SpatialReference = base.m_spRef;
 IPoint point = new PointClass();
 point.SpatialReference = m_spRef;
 foreach (DataRow r in m_table.Rows)
 {
   point.Y = Convert.ToDouble(r[3]);
   point.X = Convert.ToDouble(r[4]);

   env.Union(point.Envelope);
 }

 return env;
            } 

See Also

© 2010 All Rights Reserved.