diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-08-03 15:01:35 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-08-04 14:08:19 +0200 |
commit | 78ec33320ff5837f23e85e336716692f63fd0254 (patch) | |
tree | de48fe425d31e2378cc02544d97e981600c4dc61 /include/mbgl | |
parent | ab7456075c7744c8528c2b86cfa77f80d6a04ef1 (diff) | |
download | qtlocation-mapboxgl-78ec33320ff5837f23e85e336716692f63fd0254.tar.gz |
don't use certain STL functions
some functions defined in <cmath>, as well as std::to_string aren't available on GNU's STL for some platforms, e.g. Android
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/util/projection.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/mbgl/util/projection.hpp b/include/mbgl/util/projection.hpp index f301d93005..9563900851 100644 --- a/include/mbgl/util/projection.hpp +++ b/include/mbgl/util/projection.hpp @@ -33,16 +33,16 @@ public: static inline double getMetersPerPixelAtLatitude(const double lat, const double zoom) { const double mapPixelWidthAtZoom = std::pow(2.0, zoom) * util::tileSize; - const double constrainedLatitude = std::fmin(std::fmax(lat, -util::LATITUDE_MAX), util::LATITUDE_MAX); + const double constrainedLatitude = ::fmin(::fmax(lat, -util::LATITUDE_MAX), util::LATITUDE_MAX); return std::cos(constrainedLatitude * util::DEG2RAD) * util::M2PI * util::EARTH_RADIUS_M / mapPixelWidthAtZoom; } static inline const ProjectedMeters projectedMetersForLatLng(const LatLng latLng) { - const double constrainedLatitude = std::fmin(std::fmax(latLng.latitude, -util::LATITUDE_MAX), util::LATITUDE_MAX); + const double constrainedLatitude = ::fmin(::fmax(latLng.latitude, -util::LATITUDE_MAX), util::LATITUDE_MAX); const double m = 1 - 1e-15; - const double f = std::fmin(std::fmax(std::sin(util::DEG2RAD * constrainedLatitude), -m), m); + const double f = ::fmin(::fmax(std::sin(util::DEG2RAD * constrainedLatitude), -m), m); const double easting = util::EARTH_RADIUS_M * latLng.longitude * util::DEG2RAD; const double northing = 0.5 * util::EARTH_RADIUS_M * std::log((1 + f) / (1 - f)); @@ -54,7 +54,7 @@ public: double latitude = (2 * std::atan(std::exp(projectedMeters.northing / util::EARTH_RADIUS_M)) - (M_PI / 2)) * util::RAD2DEG; double longitude = projectedMeters.easting * util::RAD2DEG / util::EARTH_RADIUS_M; - latitude = std::fmin(std::fmax(latitude, -util::LATITUDE_MAX), util::LATITUDE_MAX); + latitude = ::fmin(::fmax(latitude, -util::LATITUDE_MAX), util::LATITUDE_MAX); return LatLng(latitude, longitude); } |