public final class LatLngBounds extends Object
Constructor and Description |
---|
LatLngBounds(LatLng[] latLngs)
Creates a LatLngBounds object defined by the geographical points it
contains.
|
LatLngBounds(LatLng southWest,
LatLng northEast)
Creates a latLngBounds object by defining south-west and north-east
corners of the rectangle.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(LatLng latLng)
Returns
true if the rectangle contains the given point. |
boolean |
contains(LatLngBounds other)
Returns
true if the rectangle contains the given one. |
boolean |
equals(Object other)
Returns
true if the rectangle is equivalent (within a small
margin of error) to the given bounds. |
void |
extend(LatLng latLng)
Extends the bounds to contain the given point.
|
void |
extend(LatLngBounds latLngBounds)
Extends the bounds to contain the given bound.
|
LatLng |
getCenter()
Returns the center point of the bounds.
|
double |
getEast()
Returns the east longitude of the bounds.
|
double |
getNorth()
Returns the north latitude of the bounds.
|
LatLng |
getNorthEast()
Returns the north-east point of the bounds.
|
LatLng |
getNorthWest()
Returns the north-west point of the bounds.
|
double |
getSouth()
Returns the south latitude of the bounds.
|
LatLng |
getSouthEast()
Returns the south-east point of the bounds.
|
LatLng |
getSouthWest()
Returns the south-west point of the bounds.
|
double |
getWest()
Returns the west longitude of the bounds.
|
boolean |
intersects(LatLngBounds other)
Returns
true if the rectangle intersects the given bounds. |
boolean |
isValid()
Returns
true if the bounds are properly initialized. |
LatLngBounds |
pad(double bufferRatio)
Returns bigger bounds created by extending the current bounds by a given
percentage in each direction.
|
String |
toBBoxString()
Returns a string with bounding box coordinates in a
'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format.
|
public LatLngBounds(LatLng southWest, LatLng northEast)
southWest
- The south-west corner.northEast
- The north-east corner.public LatLngBounds(LatLng[] latLngs)
latLngs
- The geographical points.public void extend(LatLng latLng)
latLng
- The point.public void extend(LatLngBounds latLngBounds)
latLngBounds
- The bounds.public LatLng getSouthWest()
public LatLng getNorthEast()
public LatLng getNorthWest()
public LatLng getSouthEast()
public double getWest()
public double getSouth()
public double getEast()
public double getNorth()
public LatLng getCenter()
public boolean contains(LatLngBounds other)
true
if the rectangle contains the given one.other
- The rectangle.true
if the rectangle contains the given
one.public boolean contains(LatLng latLng)
true
if the rectangle contains the given point.latLng
- The point.true
if the rectangle contains the given
point.public boolean intersects(LatLngBounds other)
true
if the rectangle intersects the given bounds.other
- The bounds.true
if the rectangle intersects the given
bounds.public boolean equals(Object other)
true
if the rectangle is equivalent (within a small
margin of error) to the given bounds.public String toBBoxString()
public LatLngBounds pad(double bufferRatio)
bufferRatio
- The buffer ration.public boolean isValid()
true
if the bounds are properly initialized.true
if the bounds are properly initialized.Copyright © 2017. All rights reserved.