centerFromLatLngBounds static method

Point<double> centerFromLatLngBounds(
  1. GoogleMapsUtilsLatLngBounds gmuLatLngBounds
)

Returns the center point of the given gmuLatLngBounds.

See: https://stackoverflow.com/a/30859321/3182210

Implementation

static Point<double> centerFromLatLngBounds(
    GoogleMapsUtilsLatLngBounds gmuLatLngBounds) {
  final northEast = gmuLatLngBounds.northEast;
  final southWest = gmuLatLngBounds.southWest;

  final centerLat = (northEast.x + southWest.x) / 2;
  final centerLng = (northEast.y + southWest.y) / 2;

  return Point<double>(centerLat, centerLng);
}