summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeng Liu <peng.liu@mapbox.com>2020-01-07 16:10:53 +0200
committerPeng Liu <peng.liu@mapbox.com>2020-01-07 16:22:15 +0200
commitc1ec9635335848900f89b2898b48f3faa9963ae3 (patch)
treeae5a1bd60d3d2dfd5525e3e11bee01b3da242da6 /src
parentadb68b52f0b6b9065fb1bcd35f09630eb50525eb (diff)
downloadqtlocation-mapboxgl-upstream/peng-get-visibile-coordinate-bounds.tar.gz
Move API breaking changes to a new method name latLngBoundsForCameraUnwrapped.upstream/peng-get-visibile-coordinate-bounds
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/map.cpp11
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});