Follow us on GitHub

com.google.gwt.maps.client.base
Class LatLngBounds

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.base.LatLngBounds

public class LatLngBounds
extends JavaScriptObject

A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian.

See LatLngBounds API Doc


Constructor Summary
protected LatLngBounds()
          A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian.
 
Method Summary
 boolean contains(LatLng latlng)
          Returns true if the given lat/lng is in this bounds.
 boolean equals(LatLngBounds other)
          Returns true if this bounds approximately equals the given bounds.
 LatLngBounds extend(LatLng point)
          Extends this bounds to contain the given point.
 LatLng getCenter()
          Computes the center of this LatLngBounds
 LatLng getNorthEast()
          Returns the north-east corner of this bounds.
 LatLng getSouthWest()
          Returns the south-west corner of this bounds.
 String getToString()
          Converts to string.
 boolean intersects(LatLngBounds other)
          Returns true if this bounds shares any points with this bounds.
 boolean isEmpty()
          Returns if the bounds are empty.
static LatLngBounds newInstance(LatLng sw, LatLng ne)
          creates A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian.
 LatLng toSpan()
          Converts the given map bounds to a lat/lng span.
 String toUrlValue(int precision)
          Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box.
 LatLngBounds union(LatLngBounds other)
          Extends this bounds to contain the union of this and the given bounds.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatLngBounds

protected LatLngBounds()
A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian. use newInstance(...);

Method Detail

newInstance

public static final LatLngBounds newInstance(LatLng sw,
                                             LatLng ne)
creates A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian.

Parameters:
sw - LatLng
ne - LatLng

contains

public final boolean contains(LatLng latlng)
Returns true if the given lat/lng is in this bounds.

Parameters:
latlng - LatLng

equals

public final boolean equals(LatLngBounds other)
Returns true if this bounds approximately equals the given bounds.

Parameters:
other - LatLngBounds

extend

public final LatLngBounds extend(LatLng point)
Extends this bounds to contain the given point.

Parameters:
point - LatLng
Returns:
LatLngBounds

getCenter

public final LatLng getCenter()
Computes the center of this LatLngBounds

Returns:
LatLng

getNorthEast

public final LatLng getNorthEast()
Returns the north-east corner of this bounds.

Returns:
LatLng

getSouthWest

public final LatLng getSouthWest()
Returns the south-west corner of this bounds.

Returns:
LatLng

intersects

public final boolean intersects(LatLngBounds other)
Returns true if this bounds shares any points with this bounds.

Parameters:
other - LatLngBounds
Returns:
boolean

isEmpty

public final boolean isEmpty()
Returns if the bounds are empty.

Returns:
boolean

toSpan

public final LatLng toSpan()
Converts the given map bounds to a lat/lng span.

Returns:
LatLng

getToString

public final String getToString()
Converts to string.

Returns:
boolean

toUrlValue

public final String toUrlValue(int precision)
Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box.

Parameters:
precision -
Returns:
String

union

public final LatLngBounds union(LatLngBounds other)
Extends this bounds to contain the union of this and the given bounds.

Parameters:
other - LatLngBounds
Returns:
LatLngBounds


Follow us on GitHub

Copyright © 2011-2012 Gone Vertical LLC. All Rights Reserved.