mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Removed azimuthal and "auto" map projections
Removing these projections - which were never really well implemented - greatly simplifies the code. There is no ProjectionCenter anymore and MapProjection methods do not return null Locations or Points.
This commit is contained in:
parent
f4481c31f0
commit
76b879dfac
37 changed files with 181 additions and 1076 deletions
|
|
@ -76,22 +76,16 @@ namespace MapControl.Projections
|
|||
return new Matrix(1d, 0d, 0d, 1d, 0d, 0d);
|
||||
}
|
||||
|
||||
public override Point? LocationToMap(double latitude, double longitude)
|
||||
public override Point LocationToMap(double latitude, double longitude)
|
||||
{
|
||||
if (LocationToMapTransform == null)
|
||||
{
|
||||
throw new InvalidOperationException("The CoordinateSystem property is not set.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var coordinate = LocationToMapTransform.Transform([longitude, latitude]);
|
||||
return new Point(coordinate[0], coordinate[1]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var coordinate = LocationToMapTransform.Transform([longitude, latitude]);
|
||||
|
||||
return new Point(coordinate[0], coordinate[1]);
|
||||
}
|
||||
|
||||
public override Location MapToLocation(double x, double y)
|
||||
|
|
@ -101,15 +95,9 @@ namespace MapControl.Projections
|
|||
throw new InvalidOperationException("The CoordinateSystem property is not set.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var coordinate = MapToLocationTransform.Transform([x, y]);
|
||||
return new Location(coordinate[1], coordinate[0]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var coordinate = MapToLocationTransform.Transform([x, y]);
|
||||
|
||||
return new Location(coordinate[1], coordinate[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue