From a2b3756595d4900bbdb5d8c42f1b9b780031cd6f Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Thu, 8 Dec 2022 18:53:59 +0100 Subject: [PATCH] Update MapPanel.cs --- MapControl/Shared/MapPanel.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MapControl/Shared/MapPanel.cs b/MapControl/Shared/MapPanel.cs index 1e942e3b..9ba52b1c 100644 --- a/MapControl/Shared/MapPanel.cs +++ b/MapControl/Shared/MapPanel.cs @@ -220,7 +220,9 @@ namespace MapControl protected ViewRect GetViewRect(BoundingBox boundingBox) { - return GetViewRect(parentMap.MapProjection.BoundingBoxToMapRect(boundingBox)); + var mapRect = parentMap.MapProjection.BoundingBoxToMapRect(boundingBox); + + return mapRect != null ? GetViewRect(mapRect) : null; } protected ViewRect GetViewRect(MapRect mapRect)