ESRI.ArcGIS.ADF.Local | |
Extent Property | |
See Also Send Feedback |
ESRI.ArcGIS.ADF.BaseClasses Namespace > BaseCustomGlobeLayer Class : Extent Property |
Visual Basic (Declaration) | |
---|---|
Public Overridable ReadOnly Property Extent As IEnvelope |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public virtual IEnvelope Extent {get;} |
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;
}