mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Version 4.16.0. Improved MapProjection.
This commit is contained in:
parent
60e0093785
commit
12566506f8
14 changed files with 136 additions and 121 deletions
|
|
@ -3,6 +3,7 @@
|
|||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
#if !WINDOWS_UWP
|
||||
using System.Windows;
|
||||
#endif
|
||||
|
|
@ -16,16 +17,13 @@ namespace MapControl
|
|||
public class EquirectangularProjection : MapProjection
|
||||
{
|
||||
public EquirectangularProjection()
|
||||
: this("EPSG:4326")
|
||||
{
|
||||
CrsId = "EPSG:4326";
|
||||
}
|
||||
|
||||
public EquirectangularProjection(string crsId)
|
||||
public override double TrueScale
|
||||
{
|
||||
CrsId = crsId;
|
||||
HasLatLonBoundingBox = CrsId != "CRS:84";
|
||||
IsNormalCylindrical = true;
|
||||
TrueScale = 1d;
|
||||
get { return 1d; }
|
||||
}
|
||||
|
||||
public override Vector GetMapScale(Location location)
|
||||
|
|
@ -44,5 +42,12 @@ namespace MapControl
|
|||
{
|
||||
return new Location(point.Y, point.X);
|
||||
}
|
||||
|
||||
public override string GetBboxValue(Rect rect)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture,
|
||||
CrsId != "CRS:84" ? "{1},{0},{3},{2}" : "{0},{1},{2},{3}",
|
||||
rect.X, rect.Y, (rect.X + rect.Width), (rect.Y + rect.Height));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue