org.gwtopenmaps.openlayers.client
Class Bounds
java.lang.Object
org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper
org.gwtopenmaps.openlayers.client.Bounds
public class Bounds
- extends OpenLayersObjectWrapper
Represents a bounding box (or bounding rectangle).
|
Constructor Summary |
|
Bounds(double lowerLeftX,
double lowerLeftY,
double upperRightX,
double upperRightY)
Create a bounding box by specifying its lower left coordinates,
and its upper right coordinates. |
protected |
Bounds(JSObject element)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Bounds
protected Bounds(JSObject element)
Bounds
public Bounds(double lowerLeftX,
double lowerLeftY,
double upperRightX,
double upperRightY)
- Create a bounding box by specifying its lower left coordinates,
and its upper right coordinates.
The units of the bounding box will depend on the CRS and or projection used.
For example, a bounds object that represents the world-wide bounds
in EPSG:4392 is specified as:
new Bounds(-180,-90,180,90);
- Parameters:
lowerLeftX - = west = minxlowerLeftY - = south = minyupperRightX - = east = maxxupperRightY - = north = maxy
narrowToBounds
public static Bounds narrowToBounds(JSObject element)
toArray
public double[] toArray()
getLowerLeftX
public double getLowerLeftX()
- Returns:
- double - lower left x-coordinate of bounds
getLowerLeftY
public double getLowerLeftY()
- Returns:
- double - lower left y-coordinate of bounds
getUpperRightX
public double getUpperRightX()
- Returns:
- double - upper right x-coordinate of bounds
getUpperRightY
public double getUpperRightY()
- Returns:
- double - upper right y-coordinate of bounds
getWidth
public float getWidth()
getHeight
public float getHeight()
toBBox
public java.lang.String toBBox(java.lang.Integer significantDigits)
- Parameters:
significantDigits - - Number of significant digits in the bbox coordinates,
pass null to use the default of 6.
- Returns:
- String - simple string representation of a Bounds object. For example:
"5,42,10,45"
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
getCenterLonLat
public LonLat getCenterLonLat()
toGeometry
public Geometry toGeometry()
containsBounds
public boolean containsBounds(Bounds bounds,
boolean partial,
boolean contains)