org.gwtopenmaps.openlayers.client
Class Bounds

java.lang.Object
  extended by org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
      extended by org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper
          extended by 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)
           
 
Method Summary
 boolean containsBounds(Bounds bounds, boolean partial, boolean contains)
           
 boolean containsLonLat(LonLat ll, boolean inclusive)
          APIMethod: containsLonLat Parameters: ll - {} inclusive - {Boolean} Whether or not to include the border.
 void extend(Bounds bounds)
           
 void extend(LonLat lonLat)
           
 void extend(Point point)
           
 LonLat getCenterLonLat()
           
 float getHeight()
           
 double getLowerLeftX()
           
 double getLowerLeftY()
           
 double getUpperRightX()
           
 double getUpperRightY()
           
 float getWidth()
           
static Bounds narrowToBounds(JSObject element)
           
 double[] toArray()
           
 String toBBox(Integer significantDigits)
           
 Geometry toGeometry()
           
 String toString()
           
 Bounds transform(Projection source, Projection dest)
           
 
Methods inherited from class org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper
getClassName, getEvents, narrowToOpenLayersObjectWrapper
 
Methods inherited from class org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
getJSObject, setJSObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 = minx
lowerLeftY - = south = miny
upperRightX - = east = maxx
upperRightY - = north = maxy
Method Detail

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.