Removed GeoApiProjection.GetBboxValue

This commit is contained in:
ClemensFischer 2024-04-17 20:10:45 +02:00
parent b8f4af969d
commit a741877e80
4 changed files with 9 additions and 17 deletions

View file

@ -794,7 +794,7 @@ namespace MapControl
if (resetTransformCenter)
{
// Check if transform center moved across the dateline.
// Check if transform center has moved across 180° longitude.
//
transformCenterChanged = Math.Abs(center.Longitude - transformCenter.Longitude) > 180d;
@ -814,7 +814,7 @@ namespace MapControl
SetViewScale(ViewTransform.Scale);
// Check if view center moved across the dateline.
// Check if view center has moved across 180° longitude.
//
transformCenterChanged = transformCenterChanged || Math.Abs(Center.Longitude - centerLongitude) > 180d;
centerLongitude = Center.Longitude;

View file

@ -130,15 +130,14 @@ namespace MapControl
/// </summary>
public virtual string GetBboxValue(MapRect mapRect)
{
// Truncate bounding box to 1 cm precision.
// Truncate values for seamless stitching of two WMS images at 180° longitude,
// as done in WmsImageLayer.GetImageAsync.
//
const double p = 0.01;
return string.Format(CultureInfo.InvariantCulture, "{0:F2},{1:F2},{2:F2},{3:F2}",
p * Math.Ceiling(mapRect.XMin / p),
p * Math.Ceiling(mapRect.YMin / p),
p * Math.Floor(mapRect.XMax / p),
p * Math.Floor(mapRect.YMax / p));
0.01 * Math.Ceiling(100d * mapRect.XMin),
0.01 * Math.Ceiling(100d * mapRect.YMin),
0.01 * Math.Floor(100d * mapRect.XMax),
0.01 * Math.Floor(100d * mapRect.YMax));
}
}
}

View file

@ -22,7 +22,7 @@ namespace MapControl
public bool ProjectionChanged { get; }
/// <summary>
/// Indicates that the view transform center has moved across the dateline.
/// Indicates that the view transform center has moved across 180° longitude.
/// Used to control when a MapTileLayer should be updated immediately.
/// </summary>
public bool TransformCenterChanged { get; }

View file

@ -8,7 +8,6 @@ using GeoAPI.Geometries;
using ProjNet.CoordinateSystems;
using ProjNet.CoordinateSystems.Transformations;
using System;
using System.Globalization;
#if !WINUI && !UWP
using System.Windows;
#endif
@ -127,11 +126,5 @@ namespace MapControl.Projections
return new Location(coordinate.Y, coordinate.X);
}
public override string GetBboxValue(MapRect rect)
{
return string.Format(CultureInfo.InvariantCulture,
"{0},{1},{2},{3}", rect.XMin, rect.YMin, rect.XMax, rect.YMax);
}
}
}