[core] Improve LatLngBounds API

* Use "named constructors": empty, world, hull
* Make the two-argument constructor lenient (i.e., it is a hull operation)
* Add various accessors
* Enforce a single empty representation
This commit is contained in:
John Firebaugh
2016-02-02 15:04:21 -08:00
parent 032c8fba3c
commit 37c27f3a8f
10 changed files with 190 additions and 82 deletions

View File

@@ -242,10 +242,10 @@ void Map::setLatLngZoom(const LatLng& latLng, double zoom, const EdgeInsets& pad
CameraOptions Map::cameraForLatLngBounds(const LatLngBounds& bounds, const EdgeInsets& padding) {
AnnotationSegment segment = {
{bounds.ne.latitude, bounds.sw.longitude},
bounds.sw,
{bounds.sw.latitude, bounds.ne.longitude},
bounds.ne,
bounds.northwest(),
bounds.southwest(),
bounds.southeast(),
bounds.northeast(),
};
return cameraForLatLngs(segment, padding);
}