MapProjection Class
Definition
Provides equirectangular (plate carree) coordinate projection utilities for converting between geographic coordinates (latitude/longitude) and screen viewport positions. Note: this is NOT a Mercator projection — high-latitude regions will appear compressed compared to web map standards. All layers must use this to ensure consistent positioning.
public class MapProjection
Methods
| Name | Description |
|---|---|
| LatLonToScreen | No summary available. |
| LatLonToViewport | Converts latitude/longitude to the intermediate viewport coordinates (0-200 x 0-100) using an equirectangular (plate carree) projection where longitude maps linearly to X and latitude maps linearly to Y. Unlike Mercator, spacing between parallels is uniform. |
| RadiusToScreen | No summary available. |
LatLonToScreen Method
public Avalonia.Point LatLonToScreen(double latitude, double longitude, Avalonia.Rect chartArea, Nullable<Avalonia.Rect> mapBounds)
Parameters
latitude double
longitude double
chartArea Avalonia.Rect
mapBounds Nullable<Avalonia.Rect>
Returns
LatLonToViewport Method
Converts latitude/longitude to the intermediate viewport coordinates (0-200 x 0-100) using an equirectangular (plate carree) projection where longitude maps linearly to X and latitude maps linearly to Y. Unlike Mercator, spacing between parallels is uniform.
public Avalonia.Point LatLonToViewport(double latitude, double longitude)
Parameters
latitude double
Latitude in degrees (-90 to 90).
longitude double
Longitude in degrees (-180 to 180).
Returns
Point in viewport coordinates.
RadiusToScreen Method
public double RadiusToScreen(double radiusDegrees, Avalonia.Rect chartArea, Nullable<Avalonia.Rect> mapBounds)
Parameters
radiusDegrees double
chartArea Avalonia.Rect
mapBounds Nullable<Avalonia.Rect>
Returns
double
Fields
| Name | Description |
|---|---|
| ViewportHeight | Standard intermediate viewport height used by GeoJSON parser. |
| ViewportWidth | Standard intermediate viewport width used by GeoJSON parser. |
ViewportHeight Field
Standard intermediate viewport height used by GeoJSON parser.
public double ViewportHeight
ViewportWidth Field
Standard intermediate viewport width used by GeoJSON parser.
public double ViewportWidth