mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Version 4.17.0: Added support for WMTS
This commit is contained in:
parent
31a58c3510
commit
e3332e44d4
|
|
@ -187,7 +187,7 @@ namespace MapControl
|
|||
public void SetViewportTransform(Location projectionCenter, Location mapCenter, Point viewportCenter, double zoomLevel, double rotation)
|
||||
{
|
||||
ProjectionCenter = projectionCenter;
|
||||
ViewportScale = Math.Pow(2d, zoomLevel) * 256d / (360d * TrueScale);
|
||||
ViewportScale = 256d * Math.Pow(2d, zoomLevel) / (360d * TrueScale);
|
||||
ViewportRotation = rotation;
|
||||
|
||||
var center = LocationToPoint(mapCenter);
|
||||
|
|
|
|||
|
|
@ -22,12 +22,13 @@ namespace MapControl
|
|||
public class MapTileLayer : MapTileLayerBase
|
||||
{
|
||||
public const int TileSize = 256;
|
||||
public const double MapSize = 2 * Math.PI * MapProjection.Wgs84EquatorialRadius;
|
||||
public static readonly Point TileGridTopLeft = new Point(-MapSize / 2, MapSize / 2);
|
||||
|
||||
public static readonly Point TileGridTopLeft = new Point(
|
||||
-180d * MapProjection.Wgs84MetersPerDegree, 180d * MapProjection.Wgs84MetersPerDegree);
|
||||
|
||||
public static double TileGridScale(int zoomLevel)
|
||||
{
|
||||
return (TileSize << zoomLevel) / MapSize;
|
||||
return (TileSize << zoomLevel) / (360d * MapProjection.Wgs84MetersPerDegree);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue