SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class representing a rectangle defined by two coordinates in opposite corners.
To calculate the zoom level to show this rectangle in a map use IWMap.getBoundsZoomlevel().
Example:
var berlin = new IWCoordinate(13.376469, 52.516186, IWCoordinate.WGS84).toMercator();
var dortmund = new IWCoordinate(7.457671, 51.517039, IWCoordinate.WGS84).toMercator();
var bonn = new IWCoordinate(7.101044, 50.732725, IWCoordinate.WGS84).toMercator();
var bounds = new IWBounds(berlin, dortmund);
bounds.extendBy(bonn);
// Alternative: var bounds = new IWBounds( [berlin, dortmund, bonn] );
map.setCenter(bounds.getCenter(), map.getBoundsZoomlevel(bounds));
Constructor Summary | |
IWBounds(first, second)
Creates a new rectangle defined by the specified coordinates. |
Method Summary | |
boolean
|
contains(other)
Checks whether the specified rectangle is contained in this one. |
boolean
|
containsCoordinate(coord)
Checks whether the specified coordinate is contained in this rectangle. |
boolean
|
equals(other)
Checks whether the specified rectangle and this one are the same. |
void
|
extendBy(coord)
Extends this rectangle by the specified coordinate or bounds. |
IWAbstractPosition
|
getCenter()
Returns the center of this rectangle as a coordinate. |
IWAbstractPosition
|
getMax()
Returns the maximum coordinate of this rectangle (larger values for x and y). |
IWAbstractPosition
|
getMin()
Returns the minimum coordinate of this rectangle (smaller values for x and y). |
IWAbstractPosition
|
getNorthWest()
Returns the coordinate in the north west corner of this rectangle. |
IWSize
|
getSize()
Returns the size of this rectangle. |
IWAbstractPosition
|
getSouthEast()
Returns the coordinate in the south east corner of this rectangle. |
boolean
|
intersects(other)
Checks whether this rectangle intersects another one. |
boolean
|
isEmpty()
Checks whether this rectangle is empty, i.e. |
String
|
toString()
Returns a string representation of this rectangle. |
Constructor Detail |
IWBounds(first, second)
IWCoordinate first
- the first corner of the rectangle, or an array of coordinates
IWCoordinate second
- the second corner of the rectangle (optional, only if first parameter is a coordinate)
Method Detail |
boolean contains(other)
IWBounds other
- another rectangle
boolean
boolean containsCoordinate(coord)
IWAbstractPosition coord
- a coordinate
boolean
boolean equals(other)
IWBounds other
- another rectangle
boolean
void extendBy(coord)
IWAbstractPosition coord
- a coordinate or IWBounds object
void
IWAbstractPosition getCenter()
IWAbstractPosition
IWAbstractPosition getMax()
IWAbstractPosition
IWAbstractPosition getMin()
IWAbstractPosition
IWAbstractPosition getNorthWest()
IWAbstractPosition
IWSize getSize()
IWSize
IWAbstractPosition getSouthEast()
IWAbstractPosition
boolean intersects(other)
IWBounds other
- another rectangle
boolean
boolean isEmpty()
boolean
String toString()
String