public class RectangularWindow extends LatLngWindow<RectangularWindow>
A "pseudo-rectangular" window bounded by a minimum and maximum latitude and a minimum and maximum longitude. (The larger the window, the less rectangular this window actually is.) Naturally a window cannot span more than 180 degrees latitude or 360 degrees longitude.
Note: the latitude span provided when creating this window is not a guarantee. If you create a latitude whose center is (90, 0) (the geographic North Pole) and whose latitude span is 10 degrees, the resulting window has a maximum latitude of 90 and a minimum latitude of 85. Thus, windows are "squashed" if they hit the poles.
| Constructor and Description |
|---|
RectangularWindow(LatLng center,
double deltaLat,
double deltaLng)
Creates a pseudo-rectangular window.
|
RectangularWindow(LatLng center,
double width,
double height,
LengthUnit unit)
Creates a psuedo-rectangular window.
|
RectangularWindow(LatLng center,
double widthHeight,
LengthUnit unit)
Creates a psuedo-square window.
|
RectangularWindow(LatLng northeast,
LatLng southwest)
Creates a pseudo-rectangular window.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(LatLng point)
Tests to see if the given point falls within this window.
|
boolean |
crosses180thMeridian()
If this window spans the 180 degree longitude meridian, this method
returns true.
|
LatLng |
getCenter()
Returns the center point of the window.
|
double |
getHeight(LengthUnit unit)
Returns the height of the window.
|
double |
getLatitudeDelta() |
double |
getLeftLongitude() |
double |
getLongitudeDelta() |
double |
getMaxLatitude() |
double |
getMinLatitude() |
double |
getRightLongitude() |
double |
getWidth(LengthUnit unit)
Returns the width at the mid-line of the window.
|
boolean |
overlaps(RectangularWindow window)
Test if this window overlaps the given window.
|
void |
setWindow(LatLng center,
double deltaLat,
double deltaLng)
Sets the bounds of this window.
|
String |
toString() |
filter, filterCopy, latitudeDeltaToLength, lengthToLatitudeDelta, lengthToLongitudeDelta, longitudeDeltaToLengthpublic RectangularWindow(LatLng center, double deltaLat, double deltaLng)
center - the center point.deltaLat - the span of the window in latitude in degrees.deltaLng - the span of the window in longitude in degrees.public RectangularWindow(LatLng northeast, LatLng southwest)
northeast - the northeastern corner of this window.southwest - the southwestern corner of this window.IllegalArgumentException - if either northeast or southwest are polar
coordinates, also if the northeast point is south of the southwest point.public RectangularWindow(LatLng center, double width, double height, LengthUnit unit)
height/2 North and South, while the width will include all
longitudes within width/2 East and West of the center point. This
is an approximation that will work fine for small window away from the poles, but
keep in mind that, for example in the northern hemisphere, the top of the rectangle
is narrower than the bottom of the rectangle, with the middle of the rectangle's width
being somewhere in between.center - the center point of the window.width - the approximate width of the window in LengthUnits.height - the height of the window in LenghtUnits.unit - the units for width and height.public RectangularWindow(LatLng center, double widthHeight, LengthUnit unit)
RectangularWindow(LatLng, double, double, LengthUnit).center - the center point of the window.widthHeight - the approximate height and width of the window in LengthUnits.unit - the units for widthHeight.public void setWindow(LatLng center, double deltaLat, double deltaLng)
center - the center point.deltaLat - the span of the window in latitude in degrees.deltaLng - the span of the window in longitude in degrees.public boolean contains(LatLng point)
LatLngWindowcontains in class LatLngWindow<RectangularWindow>point - the point to test.public boolean overlaps(RectangularWindow window)
LatLngWindowoverlaps in class LatLngWindow<RectangularWindow>window - the window to test against this one.public double getHeight(LengthUnit unit)
unit - the length units to return.public double getWidth(LengthUnit unit)
unit - the length units to return.public LatLng getCenter()
LatLngWindowgetCenter in class LatLngWindow<RectangularWindow>public boolean crosses180thMeridian()
public double getLatitudeDelta()
public double getLongitudeDelta()
public double getMinLatitude()
public double getMaxLatitude()
public double getLeftLongitude()
public double getRightLongitude()
Copyright © 2010-2015. All Rights Reserved.