mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
GeoApiProjection protected properties
This commit is contained in:
parent
544ac32ee3
commit
be0e06f581
3 changed files with 13 additions and 24 deletions
|
|
@ -30,12 +30,13 @@ namespace MapControl.Projections
|
|||
private double scaleFactor;
|
||||
private string bboxFormat;
|
||||
|
||||
public GeoApiProjection(string wkt = null)
|
||||
protected GeoApiProjection()
|
||||
{
|
||||
if (wkt != null)
|
||||
{
|
||||
WKT = wkt;
|
||||
}
|
||||
}
|
||||
|
||||
public GeoApiProjection(string wkt)
|
||||
{
|
||||
WKT = wkt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -46,7 +47,7 @@ namespace MapControl.Projections
|
|||
public string WKT
|
||||
{
|
||||
get { return CoordinateSystem?.WKT; }
|
||||
set { CoordinateSystem = new CoordinateSystemFactory().CreateFromWkt(value); }
|
||||
protected set { CoordinateSystem = new CoordinateSystemFactory().CreateFromWkt(value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -55,7 +56,7 @@ namespace MapControl.Projections
|
|||
public ICoordinateSystem CoordinateSystem
|
||||
{
|
||||
get { return coordinateSystem; }
|
||||
set
|
||||
protected set
|
||||
{
|
||||
coordinateSystem = value ?? throw new ArgumentNullException(nameof(value));
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@ namespace MapControl.Projections
|
|||
{
|
||||
public class UtmProjection : GeoApiProjection
|
||||
{
|
||||
public UtmProjection()
|
||||
{
|
||||
}
|
||||
|
||||
public UtmProjection(int zone, bool north)
|
||||
{
|
||||
SetZone(zone, north);
|
||||
|
|
@ -20,17 +16,12 @@ namespace MapControl.Projections
|
|||
|
||||
public UtmProjection(Location location)
|
||||
{
|
||||
SetZone(location);
|
||||
var zone = Math.Min((int)Math.Floor(Location.NormalizeLongitude(location.Longitude) + 180d) / 6 + 1, 60);
|
||||
|
||||
SetZone(zone, location.Latitude >= 0d);
|
||||
}
|
||||
|
||||
public void SetZone(Location location)
|
||||
{
|
||||
var zoneNumber = Math.Min((int)(Location.NormalizeLongitude(location.Longitude) + 180d) / 6 + 1, 60);
|
||||
|
||||
SetZone(zoneNumber, location.Latitude >= 0d);
|
||||
}
|
||||
|
||||
public void SetZone(int zone, bool north)
|
||||
protected void SetZone(int zone, bool north)
|
||||
{
|
||||
if (zone < 1 || zone > 60)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue