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


IMapControlDefault.SpatialReference Property (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Controls)  

IMapControlDefault.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

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

.NET Samples

Geoevents in a MapControl (Code Files: GeoEvents)