Version 4.17.0: Added support for WMTS

This commit is contained in:
ClemensF 2020-03-24 16:13:25 +01:00
parent 31a58c3510
commit e3332e44d4
2 changed files with 5 additions and 4 deletions

View file

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

View file

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