centerFromLatLngBounds static method

Point<double> centerFromLatLngBounds(
  1. GMULatLngBounds gmuLatLngBounds
)

Calculate the center of the boundaries to a Point in latitude and longitude

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

Returns the Point representing the center of the gmuLatLngBounds

Implementation

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

  final centerLatitudeBound = (northEast.x + southWest.x) / 2;
  final centerLongitudeBound = (northEast.y + southWest.y) / 2;

  final center = Point<double>(centerLatitudeBound, centerLongitudeBound);

  return center;
}