[core] Make TransformState LatLngBounds optional

This commit is contained in:
Bruno de Oliveira Abinader
2017-06-01 00:58:03 +03:00
parent 8935845171
commit 99cfbacdfb
7 changed files with 31 additions and 20 deletions

View File

@@ -406,10 +406,11 @@ double Transform::getZoom() const {
#pragma mark - Bounds
void Transform::setLatLngBounds(const LatLngBounds& bounds) {
if (bounds.valid()) {
state.setLatLngBounds(bounds);
void Transform::setLatLngBounds(optional<LatLngBounds> bounds) {
if (bounds && !bounds->valid()) {
throw std::runtime_error("failed to set bounds: bounds are invalid");
}
state.setLatLngBounds(bounds);
}
void Transform::setMinZoom(const double minZoom) {