ArcObjects Library Reference (Controls)  

IMapControl2.SpatialReference Property

Spatial reference of the Map.

[Visual Basic .NET]
Public Property SpatialReference As ISpatialReference
[C#]
public ISpatialReference SpatialReference {get; set;}
[C++]
HRESULT get_SpatialReference(
  ISpatialReference** spRef
);
[C++]
HRESULT putref_SpatialReference(
  ISpatialReference* spRef
);
[C++]

Parameters

spRef [out, retval]

  spRef is a parameter of type ISpatialReference

spRef [in]

  spRef is a parameter of type ISpatialReference

Product Availability

Available with ArcGIS Engine.

Description

This property is a shortcut to IMap::SpatialReference. The Map's SpatialReference will be set automatically to match the SpatialReference of the first  Layer added to its layer collection. If the first Layer added has no SpatialReference defined, the coordinates in the Layer will be analyzed. If the coordinates range from 0 - 180, the MapControl assumes the layers data is geographic (i.e. contains unprojected coordinates in latitude and longitude) and the SpatialReference will appear as "GCS_Assumed_Geographic_1". If the MapControl cannot determine that the data source is geographic, the current SpatialReference will be "Unknown". The SpatialReference is also "Unknown" if the MapControl contains no data.

See Also

IMapControl2 Interface | IMapControl3.Map Property | IMapControl2.Map Property | IMapControl4.Map Property | IMapControl2.MapScale Property | IMapControl3.MapScale Property | IMapControl4.MapScale Property | IMapControl4.MapUnits Property | IMapControl3.MapUnits Property | IMapControl2.MapUnits Property | IMapControl4.ReferenceScale Property | IMapControl3.ReferenceScale Property | IMapControl2.ReferenceScale Property

.NET Samples

Geoevents in a MapControl (Code Files: GeoEvents) |