Update MapPath.cs

This commit is contained in:
ClemensF 2020-07-14 17:03:40 +02:00
parent 3edafd6228
commit 8df5625382

View file

@ -91,10 +91,10 @@ namespace MapControl
if (location != null && parentMap.MapProjection.IsNormalCylindrical) if (location != null && parentMap.MapProjection.IsNormalCylindrical)
{ {
var viewPos = parentMap.LocationToView(location); var pos = parentMap.LocationToView(location);
if (viewPos.X < 0d || viewPos.X > parentMap.RenderSize.Width || if (pos.X < 0d || pos.X > parentMap.RenderSize.Width ||
viewPos.Y < 0d || viewPos.Y > parentMap.RenderSize.Height) pos.Y < 0d || pos.Y > parentMap.RenderSize.Height)
{ {
longitudeOffset = parentMap.ConstrainedLongitude(location.Longitude) - location.Longitude; longitudeOffset = parentMap.ConstrainedLongitude(location.Longitude) - location.Longitude;
} }