MapCache
MapCache copied to clipboard
Skewed downloads if the map used for selecting the area does not use maximum lat range (-85.0511, 85.0511)
To reproduce:
-
Create a controller with a MapView that uses Apple Maps. Use this map to select a region.
-
Download a region with a MapCache that uses Open Street Maps (OSM) as tile Server.
-
Create a second controller that displays another MapView but this time using MapCache with OSM as tile server. Use the same MapCache used for downloading the region (ie: same name).
You´ll see that the second map does not display the area selected in the controller of (1), the tiles downloaded were in a different location.
The problem is that whereas Apple Maps uses -90 to 90 as range in the latitude, OSM only uses -85.0511 to 85.0511, so the conversion coordinates to tiles does not work.
In the code, this conversion is done in TileCoords
Related with #5