summaryrefslogtreecommitdiff
path: root/src/mbgl/util/geo.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-05-04 17:37:45 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-05-05 11:16:57 -0700
commitf89cfacab2457602c5bd81ab9da35cede23584e2 (patch)
tree28371d29e0bca52419303c60c71bcdd1b5361dff /src/mbgl/util/geo.cpp
parentce2a06e6773dfb656c7bf6fdbb7e8bc463710685 (diff)
downloadqtlocation-mapboxgl-f89cfacab2457602c5bd81ab9da35cede23584e2.tar.gz
[core] Inline LatLng::project definition the one place it's used
Diffstat (limited to 'src/mbgl/util/geo.cpp')
-rw-r--r--src/mbgl/util/geo.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/mbgl/util/geo.cpp b/src/mbgl/util/geo.cpp
index 2cb5d09806..eb697f0b02 100644
--- a/src/mbgl/util/geo.cpp
+++ b/src/mbgl/util/geo.cpp
@@ -1,4 +1,3 @@
-#include <mbgl/math/clamp.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/map/tile_id.hpp>
@@ -13,17 +12,6 @@ LatLng::LatLng(const TileID& id) {
latitude = util::RAD2DEG * std::atan(0.5 * (std::exp(n) - std::exp(-n)));
}
-ScreenCoordinate LatLng::project() const {
- // Clamp to the latitude limits of Web Mercator.
- const double constrainedLatitude = util::clamp(latitude, -util::LATITUDE_MAX, util::LATITUDE_MAX);
-
- // Project a coordinate into unit space in a square map.
- const double sine = std::sin(constrainedLatitude * util::DEG2RAD);
- const double x = longitude / util::DEGREES_MAX + 0.5;
- const double y = 0.5 - 0.25 * std::log((1.0 + sine) / (1.0 - sine)) / M_PI;
- return { x, y };
-}
-
LatLngBounds::LatLngBounds(const TileID& id)
: sw(TileID{ id.z, id.x, id.y + 1, id.sourceZ }),
ne(TileID{ id.z, id.x + 1, id.y, id.sourceZ }) {