mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Cleanup
This commit is contained in:
parent
b0b4e0ea89
commit
d916278845
4 changed files with 22 additions and 29 deletions
|
|
@ -244,13 +244,14 @@ namespace MapControl
|
|||
|
||||
if (parentMap != null)
|
||||
{
|
||||
pos = parentMap.MapProjection.LocationToViewportPoint(location);
|
||||
var projection = parentMap.MapProjection;
|
||||
pos = projection.LocationToViewportPoint(location);
|
||||
|
||||
if (parentMap.MapProjection.IsCylindrical &&
|
||||
if (projection.IsCylindrical &&
|
||||
(pos.X < 0d || pos.X > parentMap.RenderSize.Width ||
|
||||
pos.Y < 0d || pos.Y > parentMap.RenderSize.Height))
|
||||
{
|
||||
pos = parentMap.MapProjection.LocationToViewportPoint(new Location(
|
||||
pos = projection.LocationToViewportPoint(new Location(
|
||||
location.Latitude,
|
||||
Location.NearestLongitude(location.Longitude, parentMap.Center.Longitude)));
|
||||
}
|
||||
|
|
@ -310,7 +311,7 @@ namespace MapControl
|
|||
var center = new Point(rect.X + rect.Width / 2d, rect.Y + rect.Height / 2d);
|
||||
var pos = projection.ViewportTransform.Transform(center);
|
||||
|
||||
if (parentMap.MapProjection.IsCylindrical &&
|
||||
if (projection.IsCylindrical &&
|
||||
(pos.X < 0d || pos.X > parentMap.RenderSize.Width ||
|
||||
pos.Y < 0d || pos.Y > parentMap.RenderSize.Height))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue