mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Version 4.10.0: Simplified MapProjection.
This commit is contained in:
parent
bbd952b955
commit
b06c9065af
|
|
@ -13,20 +13,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfApplication", "SampleApp
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalApp", "SampleApps\UniversalApp\UniversalApp.csproj", "{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MBTiles", "MBTiles", "{CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MBTiles.WPF", "MBTiles\WPF\MBTiles.WPF.csproj", "{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FileDbCache", "FileDbCache", "{261905DE-9653-4567-B498-1F46BEA2A4F3}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FileDbCache", "FileDbCache", "{58F5E8E7-81E8-41E5-B0A1-C17E5157DEC2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDbCache.WPF", "FileDbCache\WPF\FileDbCache.WPF.csproj", "{AD1CB53E-7AA4-4EC0-B901-B4E0E2665133}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileDbCache.UWP", "FileDbCache\UWP\FileDbCache.UWP.csproj", "{BEEB142A-5FA3-468D-810A-32A4A5BD6D5D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MBTiles.UWP", "MBTiles\UWP\MBTiles.UWP.csproj", "{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -95,22 +89,22 @@ Global
|
|||
{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|x86.ActiveCfg = Release|x86
|
||||
{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|x86.Build.0 = Release|x86
|
||||
{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|x86.Deploy.0 = Release|x86
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|x86.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.Build.0 = Release|Any CPU
|
||||
{AD1CB53E-7AA4-4EC0-B901-B4E0E2665133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AD1CB53E-7AA4-4EC0-B901-B4E0E2665133}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AD1CB53E-7AA4-4EC0-B901-B4E0E2665133}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
|
|
@ -143,38 +137,6 @@ Global
|
|||
{BEEB142A-5FA3-468D-810A-32A4A5BD6D5D}.Release|x64.Build.0 = Release|Any CPU
|
||||
{BEEB142A-5FA3-468D-810A-32A4A5BD6D5D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{BEEB142A-5FA3-468D-810A-32A4A5BD6D5D}.Release|x86.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|x86.Build.0 = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|x64.Build.0 = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -183,11 +145,9 @@ Global
|
|||
{A204A102-C745-4D65-AEC8-7B96FAEDEF2D} = {52AECE49-F314-4F76-98F2-FA800F07824B}
|
||||
{F92DA93D-75DB-4308-A5F9-6B4C3908A675} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC}
|
||||
{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC}
|
||||
{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C} = {CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737}
|
||||
{AD1CB53E-7AA4-4EC0-B901-B4E0E2665133} = {261905DE-9653-4567-B498-1F46BEA2A4F3}
|
||||
{BEEB142A-5FA3-468D-810A-32A4A5BD6D5D} = {261905DE-9653-4567-B498-1F46BEA2A4F3}
|
||||
{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344} = {52AECE49-F314-4F76-98F2-FA800F07824B}
|
||||
{DCC111E9-EC8B-492A-A09D-DF390D83AE8D} = {CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737}
|
||||
{AD1CB53E-7AA4-4EC0-B901-B4E0E2665133} = {58F5E8E7-81E8-41E5-B0A1-C17E5157DEC2}
|
||||
{BEEB142A-5FA3-468D-810A-32A4A5BD6D5D} = {58F5E8E7-81E8-41E5-B0A1-C17E5157DEC2}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {458346DD-B23F-4FDC-8F9D-A10F1882A4DB}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,6 @@ namespace MapControl
|
|||
{
|
||||
public Location ProjectionCenter { get; private set; } = new Location();
|
||||
|
||||
public AzimuthalProjection()
|
||||
{
|
||||
IsContinuous = false;
|
||||
IsAzimuthal = true;
|
||||
}
|
||||
|
||||
public override Vector GetMapScale(Location location)
|
||||
{
|
||||
return new Vector(ViewportScale, ViewportScale);
|
||||
|
|
|
|||
|
|
@ -18,12 +18,13 @@ namespace MapControl
|
|||
public EquirectangularProjection()
|
||||
: this("EPSG:4326")
|
||||
{
|
||||
TrueScale = 1;
|
||||
}
|
||||
|
||||
public EquirectangularProjection(string crsId)
|
||||
{
|
||||
CrsId = crsId;
|
||||
IsCylindrical = true;
|
||||
TrueScale = 1;
|
||||
}
|
||||
|
||||
public override Vector GetMapScale(Location location)
|
||||
|
|
|
|||
|
|
@ -338,16 +338,7 @@ namespace MapControl
|
|||
if (TargetZoomLevel != zoomLevel)
|
||||
{
|
||||
SetTransformCenter(center);
|
||||
|
||||
if (MapProjection.IsAzimuthal)
|
||||
{
|
||||
ZoomLevel = zoomLevel;
|
||||
ResetTransformCenter();
|
||||
}
|
||||
else
|
||||
{
|
||||
TargetZoomLevel = zoomLevel;
|
||||
}
|
||||
TargetZoomLevel = zoomLevel;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -417,11 +408,8 @@ namespace MapControl
|
|||
|
||||
private void ProjectionCenterPropertyChanged()
|
||||
{
|
||||
if (MapProjection.IsAzimuthal)
|
||||
{
|
||||
ResetTransformCenter();
|
||||
UpdateTransform();
|
||||
}
|
||||
ResetTransformCenter();
|
||||
UpdateTransform();
|
||||
}
|
||||
|
||||
private void AdjustCenterProperty(DependencyProperty property, ref Location center)
|
||||
|
|
@ -463,7 +451,7 @@ namespace MapControl
|
|||
|
||||
if (!targetCenter.Equals(Center))
|
||||
{
|
||||
var targetCenterLongitude = MapProjection.IsContinuous
|
||||
var targetCenterLongitude = MapProjection.IsCylindrical
|
||||
? Location.NearestLongitude(targetCenter.Longitude, Center.Longitude)
|
||||
: targetCenter.Longitude;
|
||||
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ namespace MapControl
|
|||
{
|
||||
pos = parentMap.MapProjection.LocationToViewportPoint(location);
|
||||
|
||||
if (parentMap.MapProjection.IsContinuous &&
|
||||
if (parentMap.MapProjection.IsCylindrical &&
|
||||
(pos.X < 0d || pos.X > parentMap.RenderSize.Width ||
|
||||
pos.Y < 0d || pos.Y > parentMap.RenderSize.Height))
|
||||
{
|
||||
|
|
@ -310,7 +310,7 @@ namespace MapControl
|
|||
var center = new Point(rect.X + rect.Width / 2d, rect.Y + rect.Height / 2d);
|
||||
var pos = projection.ViewportTransform.Transform(center);
|
||||
|
||||
if (parentMap.MapProjection.IsContinuous &&
|
||||
if (parentMap.MapProjection.IsCylindrical &&
|
||||
(pos.X < 0d || pos.X > parentMap.RenderSize.Width ||
|
||||
pos.Y < 0d || pos.Y > parentMap.RenderSize.Height))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,19 +28,14 @@ namespace MapControl
|
|||
private Matrix inverseViewportTransformMatrix;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the WMS 1.3.0 CRS Identifier.
|
||||
/// Gets the WMS 1.3.0 CRS Identifier.
|
||||
/// </summary>
|
||||
public string CrsId { get; set; }
|
||||
public string CrsId { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the map can be moved infinitely in longitudinal direction.
|
||||
/// Indicates if this is a normal cylindrical projection.
|
||||
/// </summary>
|
||||
public bool IsContinuous { get; protected set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this is an azimuthal projection.
|
||||
/// </summary>
|
||||
public bool IsAzimuthal { get; protected set; } = false;
|
||||
public bool IsCylindrical { get; protected set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this is a web mercator projection, i.e. compatible with MapTileLayer.
|
||||
|
|
@ -48,8 +43,8 @@ namespace MapControl
|
|||
public bool IsWebMercator { get; protected set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scale factor from geographic to cartesian coordinates, on the line of true scale
|
||||
/// of a cylindrical projection, or at the projection center of an azimuthal projection.
|
||||
/// Gets the scale factor from geographic to cartesian coordinates, on the line of true scale of a
|
||||
/// cylindrical projection (usually the equator), or at the projection center of an azimuthal projection.
|
||||
/// </summary>
|
||||
public double TrueScale { get; protected set; } = MetersPerDegree;
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ namespace MapControl
|
|||
{
|
||||
var longitudeOffset = 0d;
|
||||
|
||||
if (parentMap.MapProjection.IsContinuous && Location != null)
|
||||
if (parentMap.MapProjection.IsCylindrical && Location != null)
|
||||
{
|
||||
var viewportPosition = LocationToViewportPoint(Location);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ namespace MapControl
|
|||
public WebMercatorProjection(string crsId)
|
||||
{
|
||||
CrsId = crsId;
|
||||
IsCylindrical = true;
|
||||
IsWebMercator = true;
|
||||
MaxLatitude = YToLatitude(180d);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ namespace MapControl
|
|||
public WorldMercatorProjection(string crsId)
|
||||
{
|
||||
CrsId = crsId;
|
||||
IsCylindrical = true;
|
||||
MaxLatitude = YToLatitude(180d);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace MapControl
|
|||
{
|
||||
var projection = ParentMap.MapProjection;
|
||||
|
||||
if (!projection.IsAzimuthal)
|
||||
if (projection.IsCylindrical)
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ namespace MapControl
|
|||
var lineDistance = GetLineDistance();
|
||||
var labelFormat = GetLabelFormat(lineDistance);
|
||||
|
||||
if (projection.IsAzimuthal)
|
||||
if (projection.IsCylindrical)
|
||||
{
|
||||
|
||||
DrawCylindricalGraticule(drawingContext, projection, lineDistance, labelFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawCylindricalGraticule(drawingContext, projection, lineDistance, labelFormat);
|
||||
// todo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue