LatLngBounds class

Data structure representing rectangular bounding box constrained by its northwest and southeast corners

Constructors

LatLngBounds(LatLng corner1, LatLng corner2)
Create new LatLngBounds by providing two corners. Both corners have to be on opposite sites but it doesn't matter which opposite corners or in what order the corners are provided.
factory
LatLngBounds.fromPoints(List<LatLng> points)
Create a new LatLngBounds from a list of LatLng points. This calculates the bounding box of the provided points.
factory
LatLngBounds.unsafe({required double north, required double south, required double east, required double west})
Create a LatLngBounds instance from raw edge values.

Properties

center → LatLng
Obtain coordinates of the bounds center
no setter
east double
The longitude east edge of the bounds
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
north double
The latitude north edge of the bounds
getter/setter pair
northEast → LatLng
Obtain coordinates of northeast corner of the bounds.
no setter
northWest → LatLng
Obtain coordinates of northwest corner of the bounds.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
simpleCenter → LatLng
Obtain simple coordinates of the bounds center
no setter
south double
The latitude south edge of the bounds
getter/setter pair
southEast → LatLng
Obtain coordinates of southeast corner of the bounds.
no setter
southWest → LatLng
Obtain coordinates of southwest corner of the bounds.
no setter
west double
The longitude west edge of the bounds
getter/setter pair

Methods

contains(LatLng point) bool
Checks whether point is inside bounds
containsBounds(LatLngBounds other) bool
Checks whether the other bounding box is contained inside bounds.
extend(LatLng latLng) → void
Expands bounding box by latLng coordinate point. This method mutates the bounds object on which it is called.
extendBounds(LatLngBounds bounds) → void
Expands bounding box by other bounds object. If provided bounds object is smaller than current one, it is not shrunk. This method mutates the bounds object on which it is called.
isOverlapping(LatLngBounds other) bool
Checks whether at least one edge of the other bounding box is overlapping with this bounding box.
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

Constants

maxLatitude → const double
maximum latitude value, north
maxLongitude → const double
maximum longitude value, east
minLatitude → const double
minimum latitude value, south
minLongitude → const double
minimum longitude value, west