BoundingBox class

A BoundingBox represents an immutable set of two latitude and two longitude coordinates.

Constructors

BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude)
@param minLatitude the minimum latitude coordinate in degrees. @param minLongitude the minimum longitude coordinate in degrees. @param maxLatitude the maximum latitude coordinate in degrees. @param maxLongitude the maximum longitude coordinate in degrees. @throws IllegalArgumentException if a coordinate is invalid.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
maxLatitude double
The maximum latitude coordinate of this BoundingBox in degrees.
final
maxLongitude double
The maximum longitude coordinate of this BoundingBox in degrees.
final
minLatitude double
The minimum latitude coordinate of this BoundingBox in degrees.
final
minLongitude double
The minimum longitude coordinate of this BoundingBox in degrees.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

contains(double latitude, double? longitude) bool
@param latitude the latitude coordinate in degrees. @param longitude the longitude coordinate in degrees. @return true if this BoundingBox contains the given coordinates, false otherwise.
containsBoundingBox(BoundingBox box) bool
containsLatLong(ILatLong latLong) bool
@param latLong the LatLong whose coordinates should be checked. @return true if this BoundingBox contains the given LatLong, false otherwise.
extendBoundingBox(BoundingBox boundingBox) BoundingBox
@param boundingBox the BoundingBox which this BoundingBox should be extended if it is larger @return a BoundingBox that covers this BoundingBox and the given BoundingBox.
extendMeters(int meters) BoundingBox
Creates a BoundingBox that is a fixed meter amount larger on all sides (but does not cross date line/poles).
getCenterPoint() LatLong
@return a new LatLong at the horizontal and vertical center of this BoundingBox.
getLatitudeSpan() double
@return the latitude span of this BoundingBox in degrees.
getLongitudeSpan() double
@return the longitude span of this BoundingBox in degrees.
intersects(BoundingBox boundingBox) bool
@param boundingBox the BoundingBox which should be checked for intersection with this BoundingBox. @return true if this BoundingBox intersects with the given BoundingBox, false otherwise.
intersectsArea(List<List<ILatLong>> latLongs) bool
Returns if an area built from the latLongs intersects with a bias towards returning true. The method returns fast if any of the points lie within the bbox. If none of the points lie inside the box, it constructs the outer bbox for all the points and tests for intersection (so it is possible that the area defined by the points does not actually intersect)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromLatLongs(List<ILatLong> latLongs) BoundingBox
@param latLongs the coordinates list.