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


Constructor Summary
IWBounds(first, second)
            Creates a new rectangle defined by the specified coordinates.
 
Method Summary
 boolean clone(other)
           Returns a copy of the bounds object with the same values
 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.
 IWCoordinates getCenter()
           Returns the center of this rectangle as a coordinate.
 IWCoordinates getMax()
           Returns the maximum coordinate of this rectangle (larger values for x and y).
 IWCoordinates getMin()
           Returns the minimum coordinate of this rectangle (smaller values for x and y).
 IWCoordinates getNorthWest()
           Returns the coordinate in the north west corner of this rectangle.
 IWSize getSize()
           Returns the size of this rectangle.
 IWCoordinates 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

clone

boolean clone(other)

contains

boolean contains(other)

containsCoordinate

boolean containsCoordinate(coord)

equals

boolean equals(other)

extendBy

void extendBy(coord)

getCenter

IWCoordinates getCenter()

getMax

IWCoordinates getMax()

getMin

IWCoordinates getMin()

getNorthWest

IWCoordinates getNorthWest()

getSize

IWSize getSize()

getSouthEast

IWCoordinates getSouthEast()

intersects

boolean intersects(other)

isEmpty

boolean isEmpty()

toString

String toString()

Source-Code Copyright 2007-2016 infoware GmbH - Documentation generated on Tue Nov 29 2022 14:20:15 GMT+0100 (MEZ)