LatLngBounds class
Represents a rectangular geographical area on a map.
- Annotations
-
- @JS('L.latLngBounds')
Constructors
- LatLngBounds(LatLng corner1, LatLng corner2)
- Creates a LatLngBounds object by defining two diagonally opposite corners of the rectangle.
- LatLngBounds.fromArray(List latlngs)
- Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
contains(
dynamic latlngOrBounds) → bool - Returns true if the rectangle contains the given point or another bounds.
-
equals(
LatLngBounds otherBounds, [double? maxMargin]) → bool - Returns true if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting max Margin to a small number.
-
extend(
dynamic latlngOrBounds) → LatLngBounds - Extend the bounds to contain the given point or bounds.
-
getCenter(
) → LatLng - Returns the center point of the bounds.
-
getEast(
) → double - Returns the east longitude of the bounds
-
getNorth(
) → double - Returns the east longitude of the bounds
-
getNorthEast(
) → LatLng - Returns the north-east point of the bounds.
-
getNorthWest(
) → LatLng - Returns the north-west point of the bounds.
-
getSouth(
) → double - Returns the south latitude of the bounds
-
getSouthEast(
) → LatLng - Returns the south-east point of the bounds.
-
getSouthWest(
) → LatLng - Returns the south-west point of the bounds.
-
getWest(
) → double - Returns the west longitude of the bounds
-
intersects(
LatLngBounds otherBounds) → bool - Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
-
isValid(
) → bool - Returns true if the bounds are properly initialized.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overlaps(
Bounds otherBounds) → bool - Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
-
pad(
double bufferRatio) → LatLngBounds - Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. For example, a ratio of 0.5 extends the bounds by 50% in each direction. Negative values will retract the bounds.
-
toBBoxString(
) → String - Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited