ArcObjects Library Reference

Get BasicMap from Map Snippet

Get BasicMap from Map.

[C#]

///<summary>Get BasicMap from Map.</summary>
///  
///<param name="map">An IMap interface.</param>
///   
///<returns>An IBasicMap interface.</returns>
///   
///<remarks>IBasicMap is a subset of IMap that provides support for ArcScene and ArcGlobe. The Map (2D), Scene (3D), and Globe (3D) coclasses implement this interface. Components used by ArcMap, ArcScene, and ArcGlobe, (such as the IdentifyDialog) utilize IBasicMap rather than IMap.</remarks>
public ESRI.ArcGIS.Carto.IBasicMap GetBasicMapFromMap(ESRI.ArcGIS.Carto.IMap map)
{
  ESRI.ArcGIS.Carto.IBasicMap basicMap = map as ESRI.ArcGIS.Carto.IBasicMap; // Dynamic Cast

  return basicMap;
}
[Visual Basic .NET]

'''<summary>Get BasicMap from Map.</summary>
'''  
'''<param name="map">An IMap interface.</param>
'''   
'''<returns>An IBasicMap interface.</returns>
'''   
'''<remarks>IBasicMap is a subset of IMap that provides support for ArcScene and ArcGlobe. The Map (2D), Scene (3D), and Globe (3D) coclasses implement this interface. Components used by ArcMap, ArcScene, and ArcGlobe, (such as the IdentifyDialog) utilize IBasicMap rather than IMap.</remarks>
Public Function GetBasicMapFromMap(ByVal map As ESRI.ArcGIS.Carto.IMap) As ESRI.ArcGIS.Carto.IBasicMap

  Dim basicMap As ESRI.ArcGIS.Carto.IBasicMap = TryCast(map, ESRI.ArcGIS.Carto.IBasicMap) ' Dynamic Cast

  Return basicMap

End Function


Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Carto
  • ESRI.ArcGIS.System