java.lang.Object | |
↳ | com.neomades.maps.LocationBounds |
An immutable class representing a latitude/longitude aligned rectangle.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LocationBounds(Location northEast, Location southWest)
Creates new bounds based on a southwest and a northeast corner.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Location |
getCenter()
Returns the center of this LocationBounds.
| ||||||||||
Location |
getNorthEast()
Northeast corner of the bounds.
| ||||||||||
Location |
getSouthWest()
Southwest corner of the bounds.
| ||||||||||
LocationBounds |
include(Location point)
Returns a new LocationBounds that extends this LocationBounds to include the
given Location point.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates new bounds based on a southwest and a northeast corner.
The bounds conceptually include all points where:
northEast | Northeast corner of the bounds. |
---|---|
southWest | Southwest corner of the bounds. |
Returns the center of this LocationBounds.
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.
Northeast corner of the bounds.
Southwest corner of the bounds.
Returns a new LocationBounds that extends this LocationBounds to include the given Location point. This will return the smallest LocationBounds 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 LocationBounds of the same size, this will extend it in the eastward direction.
point | a Location point to be included in the new bounds |
---|