mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MapPanel.cs
This commit is contained in:
parent
a7ff9fe97a
commit
94c3faf805
|
|
@ -216,14 +216,14 @@ namespace MapControl
|
||||||
|
|
||||||
protected ViewRect GetViewRect(Rect mapRect)
|
protected ViewRect GetViewRect(Rect mapRect)
|
||||||
{
|
{
|
||||||
var rectCenter = new Point(mapRect.X + mapRect.Width / 2d, mapRect.Y + mapRect.Height / 2d);
|
var center = new Point(mapRect.X + mapRect.Width / 2d, mapRect.Y + mapRect.Height / 2d);
|
||||||
var position = parentMap.ViewTransform.MapToView(rectCenter);
|
var position = parentMap.ViewTransform.MapToView(center);
|
||||||
var projection = parentMap.MapProjection;
|
var projection = parentMap.MapProjection;
|
||||||
|
|
||||||
if (projection.Type <= MapProjectionType.NormalCylindrical &&
|
if (projection.Type <= MapProjectionType.NormalCylindrical &&
|
||||||
!InsideViewport(position))
|
!InsideViewport(position))
|
||||||
{
|
{
|
||||||
var location = projection.MapToLocation(rectCenter);
|
var location = projection.MapToLocation(center);
|
||||||
|
|
||||||
if (location != null)
|
if (location != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue