[core] Fix swapped lat/lon in geo.cpp

This commit is contained in:
John Firebaugh
2015-10-19 11:47:26 -07:00
parent 342475efb7
commit 8baa804a44
2 changed files with 23 additions and 23 deletions

View File

@@ -6,9 +6,9 @@
namespace mbgl {
LatLng::LatLng(const TileID& id) {
latitude = id.x / std::pow(2.0, id.z) * 360.0 - 180;
longitude = id.x / std::pow(2.0, id.z) * 360.0 - 180;
const double n = M_PI - 2.0 * M_PI * id.y / std::pow(2.0, id.z);
longitude = 180.0 / M_PI * std::atan(0.5 * (std::exp(n) - std::exp(-n)));
latitude = 180.0 / M_PI * std::atan(0.5 * (std::exp(n) - std::exp(-n)));
}
LatLngBounds::LatLngBounds(const TileID& id)