toBounds static method
Creates a bounding box centered at (x, y) with a given
radiusInMeters.
Implementation
static GoogleMapsUtilsLatLngBounds toBounds(
double x, double y, double radiusInMeters) {
final center = Point<double>(x, y);
final distanceFromCenterToCorner = radiusInMeters * sqrt(2.0);
final southwestCorner =
SphericalUtils.computeOffset(center, distanceFromCenterToCorner, 225.0);
final northeastCorner =
SphericalUtils.computeOffset(center, distanceFromCenterToCorner, 45.0);
return GoogleMapsUtilsLatLngBounds(
northEast: northeastCorner,
southWest: southwestCorner,
);
}