View.Crs Property
Gets or sets the coordinate reference system of the View.
Syntax
public Crs Crs { get; set; }
Property Value
Default: Differs depending on type. See the table below.
The coordinate reference system used by the view.
Default values
Class | Default value |
---|---|
GlobeView | Not used. |
View | Crs.Wgs84MercatorWeb |
Remarks
If the coordinate reference system is based on a cylindrical map projection in normal aspect, then non-normalized easting values may occur. For example, if the view uses an ordinary Mercator projection in meters, centered on Greenwich, then the easting values would usually be in the range -20037508 m to +20037508 m, but if you pan the view to show the international date line, you will encounter easting values outside this range.
An application can normalize such eastings in code, using the Crs.NormalizeCyclicEasting method.
Example
// Switch the Crs of the 2D View to Wgs84LongLat
public static void SwitchViewCrsToWgs84LongLat(View view)
{
// Switch the Crs of the View to Wgs84LongLat
view.Crs = Crs.Wgs84LongLat;
// Update the View
view.Update();
}
Platforms
Windows, Linux, Android