square property

BoundingBox get square

Get the BoundingBox in a square.

Example:

BoundingBox(1, 2, 3, 4).square; // BoundingBox(1, 2, 3, 4)

Implementation

BoundingBox get square {
  double length = math.max(maxLong - minLong, maxLat - minLat) / 2;

  return BoundingBox(center.longitude - length, center.latitude - length,
      center.longitude + length, center.latitude + length);
}