BoundingBox class

A rectangular geographic region for area-based location filtering.

Defined by northeast and southwest corners. Used for rectangular area queries such as map viewports or city boundaries.

final bbox = BoundingBox(
  northEast: LocationCoordinate(latitude: 37.8324, longitude: -122.3482),
  southWest: LocationCoordinate(latitude: 37.7079, longitude: -122.5161),
);

final isInside = bbox.contains(point);
Annotations
  • @JsonSerializable.new(createFactory: false)

Constructors

BoundingBox({required LocationCoordinate northEast, required LocationCoordinate southWest})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
neLat → double
The latitude of the northeast corner.
no setter
neLng → double
The longitude of the northeast corner.
no setter
northEast → LocationCoordinate
The northeast corner of this bounding box.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
southWest → LocationCoordinate
The southwest corner of this bounding box.
final
swLat → double
The latitude of the southwest corner.
no setter
swLng → double
The longitude of the southwest corner.
no setter

Methods

contains(LocationCoordinate point) → bool
Whether point is within this bounding box.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this bounding box to JSON.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited