[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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user