toBounds static method

GMULatLngBounds toBounds(
  1. double x,
  2. double y,
  3. double radiusInMeters
)

Implementation

static GMULatLngBounds toBounds(double x, double y, double radiusInMeters) {
  Point center = Point(x, y);
  double distanceFromCenterToCorner = radiusInMeters * sqrt(2.0);
  Point southwestCorner =
      SphericalUtils.computeOffset(center, distanceFromCenterToCorner, 225.0);
  Point northeastCorner =
      SphericalUtils.computeOffset(center, distanceFromCenterToCorner, 45.0);
  return GMULatLngBounds(northeastCorner, southwestCorner);
}