[core] Remove optional from Map::setLatLngBounds()

This is a first step into grouping together bounds related Map methods
into one that takes a "BoundOptions" object. LatLngBounds::unbounded()
replaces an undefined optional<LatLngBounds>.

v2: Document LatLngBounds::unbounded()
This commit is contained in:
Ander Conselvan de Oliveira
2019-03-08 15:53:25 +02:00
parent a73cc9d8e3
commit 11de777628
10 changed files with 56 additions and 42 deletions

View File

@@ -583,7 +583,7 @@ TEST(Transform, LatLngBounds) {
transform.jumpTo(CameraOptions().withCenter(LatLng()).withZoom(transform.getState().getMaxZoom()));
// Default bounds.
ASSERT_EQ(transform.getState().getLatLngBounds(), optional<LatLngBounds> {});
ASSERT_EQ(transform.getState().getLatLngBounds(), LatLngBounds::unbounded());
ASSERT_EQ(transform.getLatLng(), nullIsland);
// Invalid bounds.
@@ -591,7 +591,7 @@ TEST(Transform, LatLngBounds) {
transform.setLatLngBounds(LatLngBounds::empty());
ASSERT_TRUE(false) << "Should throw";
} catch (...) {
ASSERT_EQ(transform.getState().getLatLngBounds(), optional<LatLngBounds> {});
ASSERT_EQ(transform.getState().getLatLngBounds(), LatLngBounds::unbounded());
}
transform.jumpTo(CameraOptions().withCenter(sanFrancisco));