toBounds static method

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

Implementation

static GMULatLngBounds 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 GMULatLngBounds(
    northEast: northeastCorner,
    southWest: southwestCorner,
  );
}