mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Improved MapProjection.Center handling
This commit is contained in:
parent
f52281ba85
commit
123a9916eb
5 changed files with 32 additions and 11 deletions
|
|
@ -734,7 +734,10 @@ namespace MapControl
|
|||
var viewScale = ViewTransform.ZoomLevelToScale(ZoomLevel);
|
||||
var projection = MapProjection;
|
||||
|
||||
projection.Center = ProjectionCenter ?? Center;
|
||||
if (projection.Type == MapProjectionType.Azimuthal)
|
||||
{
|
||||
projection.Center = ProjectionCenter ?? Center;
|
||||
}
|
||||
|
||||
var mapCenter = projection.LocationToMap(transformCenter ?? Center);
|
||||
|
||||
|
|
@ -767,7 +770,11 @@ namespace MapControl
|
|||
{
|
||||
ResetTransformCenter();
|
||||
|
||||
projection.Center = ProjectionCenter ?? center;
|
||||
if (projection.Type == MapProjectionType.Azimuthal)
|
||||
{
|
||||
projection.Center = ProjectionCenter ?? Center;
|
||||
}
|
||||
|
||||
mapCenter = projection.LocationToMap(center);
|
||||
|
||||
if (MapProjection.IsValid(mapCenter))
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace MapControl
|
|||
public string CrsId { get; protected set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the projection center.
|
||||
/// Gets or sets an optional projection center.
|
||||
/// </summary>
|
||||
public Location Center { get; set; } = new Location();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue