[core] Added Map::latLngBoundsForCamera
This commit is contained in:
@@ -644,6 +644,17 @@ CameraOptions Map::cameraForLatLngs(const std::vector<LatLng>& latLngs, optional
|
||||
return options;
|
||||
}
|
||||
|
||||
LatLngBounds Map::latLngBoundsForCamera(const CameraOptions& camera) const {
|
||||
Transform shallow { impl->transform.getState() };
|
||||
Size size = shallow.getState().getSize();
|
||||
|
||||
shallow.jumpTo(camera);
|
||||
return LatLngBounds::hull(
|
||||
shallow.screenCoordinateToLatLng({}),
|
||||
shallow.screenCoordinateToLatLng({ double(size.width), double(size.height) })
|
||||
);
|
||||
}
|
||||
|
||||
void Map::resetZoom() {
|
||||
impl->cameraMutated = true;
|
||||
setZoom(0);
|
||||
|
||||
Reference in New Issue
Block a user