mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Version 4.10.0: Added MapProjections library project.
This commit is contained in:
parent
30498bf593
commit
8c2cd92fe4
13 changed files with 635 additions and 7 deletions
|
|
@ -19,11 +19,6 @@ namespace MapControl
|
|||
{
|
||||
public Location ProjectionCenter { get; private set; } = new Location();
|
||||
|
||||
public override Vector GetMapScale(Location location)
|
||||
{
|
||||
return new Vector(ViewportScale, ViewportScale);
|
||||
}
|
||||
|
||||
public override Rect BoundingBoxToRect(BoundingBox boundingBox)
|
||||
{
|
||||
var cbbox = boundingBox as CenteredBoundingBox;
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ namespace MapControl
|
|||
var rect = MapProjection.BoundingBoxToRect(boundingBox);
|
||||
var center = new Point(rect.X + rect.Width / 2d, rect.Y + rect.Height / 2d);
|
||||
var scale = Math.Min(RenderSize.Width / rect.Width, RenderSize.Height / rect.Height)
|
||||
* MapProjection.TrueScale / MapProjection.PixelPerDegree;
|
||||
* MapProjection.TrueScale / MapProjection.PixelPerDegree;
|
||||
|
||||
TargetZoomLevel = Math.Log(scale, 2d);
|
||||
TargetCenter = MapProjection.PointToLocation(center);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,10 @@ namespace MapControl
|
|||
/// <summary>
|
||||
/// Gets the map scale at the specified Location as viewport coordinate units per meter (px/m).
|
||||
/// </summary>
|
||||
public abstract Vector GetMapScale(Location location);
|
||||
public virtual Vector GetMapScale(Location location)
|
||||
{
|
||||
return new Vector(ViewportScale, ViewportScale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transforms a Location in geographic coordinates to a Point in cartesian map coordinates.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue