summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2015-11-11 17:23:10 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2015-11-11 17:23:10 +0200
commite31c96d885f07fc70dbbc10322c1cdc9d678e992 (patch)
tree90e9ab0e2411b43a52b6b4dcafdd8db93fb201b4 /include/mbgl
parentaa8857643d404a5512b1bc3cec380e56f88b6f75 (diff)
downloadqtlocation-mapboxgl-e31c96d885f07fc70dbbc10322c1cdc9d678e992.tar.gz
[core] Fix mbgl::projection function signatures
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/util/projection.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/mbgl/util/projection.hpp b/include/mbgl/util/projection.hpp
index 391e37dd34..aff223826a 100644
--- a/include/mbgl/util/projection.hpp
+++ b/include/mbgl/util/projection.hpp
@@ -21,14 +21,14 @@ public:
return { latLngForProjectedMeters(bounds.sw), latLngForProjectedMeters(bounds.ne) };
}
- static inline double getMetersPerPixelAtLatitude(const double lat, const double zoom) {
+ static inline double getMetersPerPixelAtLatitude(double lat, double zoom) {
const double mapPixelWidthAtZoom = std::pow(2.0, zoom) * util::tileSize;
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) {
+ static inline ProjectedMeters projectedMetersForLatLng(const LatLng& latLng) {
const double constrainedLatitude = ::fmin(::fmax(latLng.latitude, -util::LATITUDE_MAX), util::LATITUDE_MAX);
const double m = 1 - 1e-15;
@@ -40,12 +40,12 @@ public:
return ProjectedMeters(northing, easting);
}
- static inline const LatLng latLngForProjectedMeters(const ProjectedMeters projectedMeters) {
+ static inline LatLng latLngForProjectedMeters(const ProjectedMeters& projectedMeters) {
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 = ::fmin(::fmax(latitude, -util::LATITUDE_MAX), util::LATITUDE_MAX);
-
+
return LatLng(latitude, longitude);
}
};