ESRI.ArcGIS.ADF.Local | |
Extent Property | |
See Also Send Feedback |
ESRI.ArcGIS.ADF.BaseClasses Namespace > BaseDynamicLayer Class : Extent Property |
Visual Basic (Declaration) | |
---|---|
Public Overridable ReadOnly Property Extent As ESRI.ArcGIS.Geometry.IEnvelope |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As BaseDynamicLayer Dim value As ESRI.ArcGIS.Geometry.IEnvelope value = instance.Extent |
C# | |
---|---|
public virtual ESRI.ArcGIS.Geometry.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; if(null != m_layerSpatialRef) env.Project(m_mapSpatialRef); 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["Y"]); point.X = Convert.ToDouble(r["X"]); env.Union(point.Envelope); } return env; }
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