mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Update MapProjections
This commit is contained in:
parent
218a85316c
commit
1ccfbb28a4
5 changed files with 17 additions and 11 deletions
|
|
@ -116,7 +116,7 @@ namespace MapControl.Projections
|
|||
|
||||
public IMathTransform MapToLocationTransform { get; private set; }
|
||||
|
||||
public override Point LocationToMap(Location location)
|
||||
public override Point? LocationToMap(Location location)
|
||||
{
|
||||
if (LocationToMapTransform == null)
|
||||
{
|
||||
|
|
@ -126,6 +126,11 @@ namespace MapControl.Projections
|
|||
var coordinate = LocationToMapTransform.Transform(
|
||||
new Coordinate(location.Longitude, location.Latitude));
|
||||
|
||||
if (coordinate == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Point(coordinate.X * scaleFactor, coordinate.Y * scaleFactor);
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +147,7 @@ namespace MapControl.Projections
|
|||
return new Location(coordinate.Y, coordinate.X);
|
||||
}
|
||||
|
||||
public override string GetBboxValue(Rect rect)
|
||||
public override string GetBboxValue(MapRect rect)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, bboxFormat,
|
||||
rect.X / scaleFactor, rect.Y / scaleFactor,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue