From aa63ec813c3c8663e6114d6d108ba4bf8b1d2eb1 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Tue, 6 Dec 2022 18:07:43 +0100 Subject: [PATCH] Update MapPath.cs --- MapControl/Shared/MapPath.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/MapControl/Shared/MapPath.cs b/MapControl/Shared/MapPath.cs index 5e7f898e..4737aa03 100644 --- a/MapControl/Shared/MapPath.cs +++ b/MapControl/Shared/MapPath.cs @@ -117,9 +117,16 @@ namespace MapControl var point = parentMap.MapProjection.LocationToMap(location); - if (point.HasValue && double.IsInfinity(point.Value.Y)) + if (point.HasValue) { - point = null; + if (point.Value.Y == double.PositiveInfinity) + { + point = new Point(point.Value.X, 1e9); + } + else if (point.Value.Y == double.NegativeInfinity) + { + point = new Point(point.Value.X, -1e9); + } } return point;