summaryrefslogtreecommitdiff
path: root/include/mbgl/util/projection.hpp
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-01-05 06:35:31 -0800
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-02-08 12:39:30 -0800
commit64374711a09f27c41c93eb6b72d0f6a560234083 (patch)
treec96aece37da9d5a17dc6029bb89d1e6047a2eac6 /include/mbgl/util/projection.hpp
parentaeba621573d77e1ce4f72b1e9b39bde92bf174a2 (diff)
downloadqtlocation-mapboxgl-64374711a09f27c41c93eb6b72d0f6a560234083.tar.gz
Support TileJSON bounds property (#10701)
* [core] Parse TileJSON bounds property * [core] Add TileRange and LatLngBounds::contains(CanonicalTileID) Move LatLngBounds::contains impl to cpp file * [core] Skip tile creation outside of tileset bounds * [core] Fix TileRange for wrapped bounds and use for CustomTileLoader instead of LatLngBounds comparisons for tiles.
Diffstat (limited to 'include/mbgl/util/projection.hpp')
-rw-r--r--include/mbgl/util/projection.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/util/projection.hpp b/include/mbgl/util/projection.hpp
index f64502c5bc..a9c12e595b 100644
--- a/include/mbgl/util/projection.hpp
+++ b/include/mbgl/util/projection.hpp
@@ -78,6 +78,10 @@ public:
return project_(latLng, worldSize(scale));
}
+ static Point<double> project(const LatLng& latLng, uint8_t zoom) {
+ return project_(latLng, std::pow(2.0, zoom));
+ }
+
static LatLng unproject(const Point<double>& p, double scale, LatLng::WrapMode wrapMode = LatLng::Unwrapped) {
auto p2 = p * util::DEGREES_MAX / worldSize(scale);
return LatLng {