makeUnion method
Creates a new RectangleGeographicArea as the union of this rectangle and another rectangle.
Parameters
- IN area The RectangleGeographicArea to unite with.
Returns
- A new RectangleGeographicArea object representing the union.
Implementation
RectangleGeographicArea makeUnion(final RectangleGeographicArea area) {
return RectangleGeographicArea(
topLeft: Coordinates(
longitude: min(topLeft.longitude, area.topLeft.longitude),
latitude: max(topLeft.latitude, area.topLeft.latitude),
),
bottomRight: Coordinates(
longitude: max(bottomRight.longitude, area.bottomRight.longitude),
latitude: min(bottomRight.latitude, area.bottomRight.latitude),
),
);
}