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).
- Author:
- Erdem Gunay, Curtis Jensen, Edwin Commandeur
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)
|
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 String toBBox(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 String toString()
- Overrides:
toString
in class Object
getCenterLonLat
public LonLat getCenterLonLat()
toGeometry
public Geometry toGeometry()
containsBounds
public boolean containsBounds(Bounds bounds,
boolean partial,
boolean contains)
extend
public void extend(LonLat lonLat)
extend
public void extend(Point point)
extend
public void extend(Bounds bounds)
transform
public Bounds transform(Projection source,
Projection dest)
containsLonLat
public boolean containsLonLat(LonLat ll,
boolean inclusive)
- APIMethod: containsLonLat
Parameters: ll - {} inclusive - {Boolean} Whether or
not to include the border. Default is true.
Returns: {Boolean} The passed-in lonlat is within this bounds.
Copyright © 2011 sourceforge. All Rights Reserved.