Update MapPath.cs

This commit is contained in:
ClemensFischer 2022-12-06 18:07:43 +01:00
parent 421f323116
commit aa63ec813c

View file

@ -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;