An immutable class representing a latitude/longitude aligned rectangle.
| class | LatLngBounds.Builder | This is a builder that is able to create a minimum bound based on a set of LatLng points. | |
| public final LatLng | northeast | Northeast corner of the bound. |
| public final LatLng | southwest | Southwest corner of the bound. |
|
LatLngBounds(LatLng
southwest, LatLng
northeast)
Creates a new bounds based on a southwest and a northeast corner.
|
| static LatLngBounds.Builder |
builder()
Creates a new builder.
|
| boolean | |
| static LatLngBounds |
createFromAttributes(Context
context, AttributeSet
attrs)
Creates a LatLngBounds from the
AttributeSet.
|
| boolean | |
| LatLng |
getCenter()
Returns the center of this LatLngBounds.
|
| int |
hashCode()
|
| LatLngBounds |
including(LatLng
point)
Returns a new
LatLngBounds
that extends this LatLngBounds to include the given LatLng.
|
| String |
toString()
|
| void |
writeToParcel(Parcel out, int
flags)
|
Northeast corner of the bound.
Southwest corner of the bound.
Creates a new bounds based on a southwest and a northeast corner.
The bounds conceptually includes all points where:
| southwest | southwest corner |
|---|---|
| northeast | northeast corner |
| IllegalArgumentException | if the latitude of the northeast corner is below the latitude of the southwest corner. |
|---|
Creates a new builder.
Creates a LatLngBounds from the AttributeSet.
null if either context or attrs is
null.Returns the center of this LatLngBounds. The center is simply the average of the coordinates (taking into account if it crosses the antimeridian). This is approximately the geographical center (it would be exact if the Earth were a perfect sphere). It will not necessarily be the center of the rectangle as drawn on the map due to the Mercator projection.
LatLng
that is the center of the LatLngBounds.Returns a new LatLngBounds
that extends this LatLngBounds to include the given LatLng.
This will return the smallest LatLngBounds that contains both this and the extra
point.
In particular, it will consider extending the bounds both in the eastward and westward directions (one of which may cross the antimeridian) and choose the smaller of the two. In the case that both directions result in a LatLngBounds of the same size, this will extend it in the eastward direction.
| point | a LatLng
to be included in the new bounds. Must not be null. |
|---|
LatLngBounds
that contains this and the extra point.