diff --git a/MapControl/Avalonia/MapPolypoint.Avalonia.cs b/MapControl/Avalonia/MapPolypoint.Avalonia.cs
index 05779d43..29ac6b94 100644
--- a/MapControl/Avalonia/MapPolypoint.Avalonia.cs
+++ b/MapControl/Avalonia/MapPolypoint.Avalonia.cs
@@ -103,8 +103,8 @@ namespace MapControl
maxY = Math.Max(maxY, point.Y);
}
- if (maxX >= 0 && minX <= ParentMap.ActualWidth &&
- maxY >= 0 && minY <= ParentMap.ActualHeight)
+ if (maxX >= 0d && minX <= ParentMap.ActualWidth &&
+ maxY >= 0d && minY <= ParentMap.ActualHeight)
{
var figure = new PathFigure
{
diff --git a/MapControl/Shared/MapBase.cs b/MapControl/Shared/MapBase.cs
index 9c8a381f..c7766b8d 100644
--- a/MapControl/Shared/MapBase.cs
+++ b/MapControl/Shared/MapBase.cs
@@ -49,8 +49,6 @@ namespace MapControl
private Location transformCenter;
private Point viewCenter;
- private Rect? mapBounds;
- private BoundingBox geoBounds;
private double centerLongitude;
private double maxLatitude = 85.05112878; // default WebMercatorProjection
private bool internalPropertyChange;
@@ -172,27 +170,6 @@ namespace MapControl
set => SetValue(TargetHeadingProperty, value);
}
- ///
- /// Gets the map viewport bounds in projected map coordinates.
- ///
- public Rect MapBounds
- {
- get
- {
- if (!mapBounds.HasValue)
- {
- mapBounds = ViewRectToMap(0d, 0d, ActualWidth, ActualHeight);
- }
-
- return mapBounds.Value;
- }
- }
-
- ///
- /// Gets the map viewport bounds in geographic coordinates.
- ///
- public BoundingBox GeoBounds => geoBounds ??= MapProjection.MapToBoundingBox(MapBounds);
-
///
/// Gets the ViewTransform instance that is used to transform between projected
/// map coordinates and view coordinates.
@@ -575,10 +552,6 @@ namespace MapControl
protected override void OnViewportChanged(ViewportChangedEventArgs e)
{
base.OnViewportChanged(e);
-
- mapBounds = null;
- geoBounds = null;
-
ViewportChanged?.Invoke(this, e);
}
}
diff --git a/MapControl/Shared/MapGraticule.cs b/MapControl/Shared/MapGraticule.cs
index ed4b7073..458c5407 100644
--- a/MapControl/Shared/MapGraticule.cs
+++ b/MapControl/Shared/MapGraticule.cs
@@ -171,14 +171,14 @@ namespace MapControl
private void DrawCylindricalGraticule(PathFigureCollection figures, List