Skip to main content

MapProjection Class

Definition

Assembly:Avalonia.Controls.Charts
Package:Avalonia.Controls.Charts

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

Inheritance: object -> MapProjection

Methods

NameDescription
LatLonToScreenNo summary available.
LatLonToViewportConverts 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.
RadiusToScreenNo 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

Avalonia.Point

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

Avalonia.Point

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

NameDescription
ViewportHeightStandard intermediate viewport height used by GeoJSON parser.
ViewportWidthStandard 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