Removed azimuthal and "auto" map projections

Removing these projections - which were never really well implemented - greatly simplifies the code. There is no ProjectionCenter anymore and MapProjection methods do not return null Locations or Points.
This commit is contained in:
ClemensFischer 2026-01-29 16:27:34 +01:00
parent f4481c31f0
commit 76b879dfac
37 changed files with 181 additions and 1076 deletions

View file

@ -249,7 +249,7 @@ namespace MapControl
{ "LAYERS", RequestLayers ?? AvailableLayers?.FirstOrDefault() ?? "" },
{ "STYLES", RequestStyles ?? "" },
{ "FORMAT", "image/png" },
{ "CRS", GetCrsValue() },
{ "CRS", ParentMap.MapProjection.CrsId },
{ "BBOX", GetBboxValue(bbox) },
{ "WIDTH", Math.Ceiling(width).ToString("F0") },
{ "HEIGHT", Math.Ceiling(height).ToString("F0") }
@ -285,7 +285,7 @@ namespace MapControl
{ "LAYERS", RequestLayers ?? AvailableLayers?.FirstOrDefault() ?? "" },
{ "STYLES", RequestStyles ?? "" },
{ "INFO_FORMAT", format },
{ "CRS", GetCrsValue() },
{ "CRS", ParentMap.MapProjection.CrsId },
{ "BBOX", GetBboxValue(bbox) },
{ "WIDTH", Math.Ceiling(width).ToString("F0") },
{ "HEIGHT", Math.Ceiling(height).ToString("F0") },
@ -322,28 +322,6 @@ namespace MapControl
return new Uri(ServiceUri.GetLeftPart(UriPartial.Path) + "?" + query);
}
protected virtual string GetCrsValue()
{
var projection = ParentMap.MapProjection;
var crs = projection.CrsId;
if (crs.StartsWith("AUTO2:") || crs.StartsWith("AUTO:"))
{
var lon = 0d;
var lat = 0d; ;
if (projection.Center != null)
{
lon = projection.Center.Longitude;
lat = projection.Center.Latitude;
}
crs = string.Format(CultureInfo.InvariantCulture, "{0},1,{1:0.########},{2:0.########}", crs, lon, lat);
}
return crs;
}
protected virtual string GetBboxValue(Rect bbox)
{
var crs = ParentMap.MapProjection.CrsId;