MapRegion

A rectangular map extent, a center coordinate plus its span in degrees.
public readonly record struct MapRegion(Coordinate Center, double LatitudeSpan, double LongitudeSpan)

Constructors

Initializes a new instance of the MapRegion struct.

public MapRegion(
  Coordinate Center,
  double LatitudeSpan,
  double LongitudeSpan)
ParameterSummary
Coordinate CenterThe coordinate at the middle of the extent.
double LatitudeSpanThe north-south height in degrees.
double LongitudeSpanThe east-west width in degrees.

Properties

Center

The coordinate at the middle of the extent.

Type: Coordinate

public Coordinate Center { get; init; }

LatitudeSpan

The north-south height in degrees.

Type: double

public double LatitudeSpan { get; init; }

LongitudeSpan

The east-west width in degrees.

Type: double

public double LongitudeSpan { get; init; }

Methods

FromRadius

Builds a region spanning roughly the given radius in meters around a center.

public static MapRegion FromRadius(
  Coordinate center,
  double radiusMeters)
ParameterSummary
Coordinate centerThe coordinate at the middle of the region.
double radiusMetersThe distance from the center to each edge, in meters.

Returns

  • MapRegion: A region whose span covers the radius on both axes.