diff options
Diffstat (limited to 'include/mbgl/util/geo.hpp')
-rw-r--r-- | include/mbgl/util/geo.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp index 6ece6d4de9..ff13726803 100644 --- a/include/mbgl/util/geo.hpp +++ b/include/mbgl/util/geo.hpp @@ -3,12 +3,17 @@ namespace mbgl { +class TileID; + struct LatLng { double latitude = 0; double longitude = 0; inline LatLng(double lat = 0, double lon = 0) : latitude(lat), longitude(lon) {} + + // Constructs a LatLng object with the top left position of the specified tile. + LatLng(const TileID& id); }; struct ProjectedMeters { @@ -26,6 +31,9 @@ struct LatLngBounds { inline LatLngBounds(LatLng sw_ = {90, 180}, LatLng ne_ = {-90, -180}) : sw(sw_), ne(ne_) {} + // Constructs a LatLngBounds object with the tile's exact boundaries. + LatLngBounds(const TileID& id); + inline void extend(const LatLng& point) { if (point.latitude < sw.latitude) sw.latitude = point.latitude; if (point.latitude > ne.latitude) ne.latitude = point.latitude; |