Version 4.10.0: Added MapProjections library project.

This commit is contained in:
ClemensF 2018-08-29 20:54:42 +02:00
parent 30498bf593
commit 8c2cd92fe4
13 changed files with 635 additions and 7 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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.