diff --git a/MapControl/Shared/MapBase.cs b/MapControl/Shared/MapBase.cs index 2e378b6e..8dbeb50c 100644 --- a/MapControl/Shared/MapBase.cs +++ b/MapControl/Shared/MapBase.cs @@ -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; diff --git a/MapControl/Shared/MapProjection.cs b/MapControl/Shared/MapProjection.cs index 07c24f3f..840c070e 100644 --- a/MapControl/Shared/MapProjection.cs +++ b/MapControl/Shared/MapProjection.cs @@ -130,15 +130,14 @@ namespace MapControl /// 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)); } } } diff --git a/MapControl/Shared/ViewportChangedEventArgs.cs b/MapControl/Shared/ViewportChangedEventArgs.cs index 9af182d3..354b656b 100644 --- a/MapControl/Shared/ViewportChangedEventArgs.cs +++ b/MapControl/Shared/ViewportChangedEventArgs.cs @@ -22,7 +22,7 @@ namespace MapControl public bool ProjectionChanged { get; } /// - /// 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. /// public bool TransformCenterChanged { get; } diff --git a/MapProjections/Shared/GeoApiProjection.cs b/MapProjections/Shared/GeoApiProjection.cs index 8ad7d922..6550cc21 100644 --- a/MapProjections/Shared/GeoApiProjection.cs +++ b/MapProjections/Shared/GeoApiProjection.cs @@ -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); - } } }