java.lang.Object | |
↳ | com.amazon.geo.mapsv2.model.LatLngBounds |
Immutable class representing a rectangle defined by LatLng
objects at
its northeast and southwest points.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LatLngBounds.Builder | Class for building LatLngBounds objects. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
northeast | Northeast corner of the rectangle. | ||||||||||
southwest | Southwest corner of the rectangle. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
LatLngBounds object with the specified southwest
and northeast corners. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a new
LatLngBounds.Builder object. | |||||||||||
Retrieves a boolean value indicating whether the specified geographic
point (
LatLng ) is within the rectangle defined by the
LatLngBounds . | |||||||||||
Returns a
LatLng representing the approximate geographical center
of the LatLngBounds . | |||||||||||
Adds a specified geographic point (
LatLng ) to the
LatLngBounds and returns a new LatLngBounds instance. | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a new LatLngBounds
object with the specified southwest
and northeast corners.
The rectangle returned by the constructor encloses all points where:
southwest | southwest corner of the bound. |
---|---|
northeast | northeast corner of the bound. |
Retrieves a boolean value indicating whether the specified geographic
point (LatLng
) is within the rectangle defined by the
LatLngBounds
.
point | A LatLng representing the geographic point to
verify. |
---|
true
if the specified point is enclosed by the Bounds,
false
otherwise.
Returns a LatLng
representing the approximate geographical center
of the LatLngBounds
.
Note that the center is the average of the coordinates. The calculation takes into account whether the bounds crosses the anti-meridian or not. Due to the Mercator projection, this is not necessarily the center of a rectangle as drawn on the map.
LatLng
representing the approximate center of the
bounds.
Adds a specified geographic point (LatLng
) to the
LatLngBounds
and returns a new LatLngBounds
instance.
This method attempts to increase the bounds in a minimal way. That is, the method tries to increase the bounds both in eastward and westward directions and chooses the smaller of the two. If both directions result in bounds of same size, the bound is increased in the eastward direction. The bounds may cross the anti-meridian in the process.
point | A LatLng representing the geographic point to add to
the bounds. |
---|
LatLngBounds
object incorporating the
specified point.