Class IWBounds

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));

Author: BRE

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

IWBounds(first, second)

Method Detail

contains

boolean contains(other)

containsCoordinate

boolean containsCoordinate(coord)

equals

boolean equals(other)

extendBy

void extendBy(coord)

getCenter

IWAbstractPosition getCenter()

getMax

IWAbstractPosition getMax()

getMin

IWAbstractPosition getMin()

getNorthWest

IWAbstractPosition getNorthWest()

getSize

IWSize getSize()

getSouthEast

IWAbstractPosition getSouthEast()

intersects

boolean intersects(other)

isEmpty

boolean isEmpty()

toString

String toString()

Source-Code Copyright 2007-2009 infoware GmbH - Documentation generated by JsDoc Toolkit 1.4.1 on Tue Nov 28 2017 09:51:51 GMT+0100 (MEZ)