This document is archived and information here might be outdated.  Recommended version.

IMap.DistanceUnits Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IM > IMap Interface > IMap.DistanceUnits Property
ArcGIS Developer Help

IMap.DistanceUnits Property

The distance units for the map.

[Visual Basic .NET]
Public Property DistanceUnits As esriUnits
public esriUnits DistanceUnits {get; set;}
HRESULT get_DistanceUnits(
  esriUnits* unitsCode
HRESULT put_DistanceUnits(
  esriUnits unitsCode
unitsCode [out, retval]

unitsCode is a parameter of type esriUnits* unitsCode [in]
unitsCode is a parameter of type esriUnits

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


The units - for example, feet, miles, meters, kilometers - ArcMap uses to report measurements, dimensions of shapes, and distance tolerances and offsets.


DistanceUnits is the predefined enumeration (esriUnits) data type currently associated with the Map object.
AddLayer automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties  are set as well.
When multiple layers are added simultaneously with AddLayers, the first spatial reference found is used.
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters.

See Also

IMap Interface