setFromCenterAndRadii method

void setFromCenterAndRadii({
  1. required Coordinates coords,
  2. required double horizRadius,
  3. required double vertRadius,
})

Sets the rectangle using a center coordinate and horizontal/vertical radii (in meters).

Parameters

  • IN coords Center coordinate of the rectangle.
  • IN horizRadius Horizontal radius in meters.
  • IN vertRadius Vertical radius in meters.

Implementation

void setFromCenterAndRadii({
  required Coordinates coords,
  required double horizRadius,
  required double vertRadius,
}) {
  topLeft = coords.copyWithMetersOffset(
    metersLatitude: vertRadius.toInt(),
    metersLongitude: -horizRadius.toInt(),
  );
  bottomRight = coords.copyWithMetersOffset(
    metersLatitude: -vertRadius.toInt(),
    metersLongitude: horizRadius.toInt(),
  );
}