diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/map/map.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index d74f6e0651..a994af305f 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -250,6 +250,17 @@ LatLngBounds Map::latLngBoundsForCamera(const CameraOptions& camera) const { Size size = shallow.getState().getSize(); shallow.jumpTo(camera); + return LatLngBounds::hull( + shallow.screenCoordinateToLatLng({}), + shallow.screenCoordinateToLatLng({ double(size.width), double(size.height) }) + ); +} + +LatLngBounds Map::latLngBoundsForCameraUnwrapped(const CameraOptions& camera) const { + Transform shallow{impl->transform.getState()}; + Size size = shallow.getState().getSize(); + + shallow.jumpTo(camera); LatLng nw = shallow.screenCoordinateToLatLng({}); LatLng se = shallow.screenCoordinateToLatLng({double(size.width), double(size.height)}); LatLng ne = shallow.screenCoordinateToLatLng({double(size.width), 0.0}); |