Class: Bounds

cercalia.Bounds

Class for boundingbox. It's a rectangle with geographical coordinates (WGS84):
[left, bottom, right, top]

new cercalia.Bounds(arrCoord)

Name Type Description
arrCoord Array.<number>

Coordinates [left, bottom, right, top]

Methods

Move the limits horizontally and vertically

Name Type Description
x number

Displacement X axis

y number

Displacement Y axis

Cleans the object bounds. It reinitializes.

Object clonation.

Returns:
Object clone.

cloneIncreasingPercentage(p_percentage){cercalia.Bounds}

Name Type Description
p_percentage number

to increase for every limit (top, bottom, left, right)

Returns:
Returns the object 'cercalia.Bounds' increased

contains(x, y, inclusive){boolean}

Returns Devuelve si una coordenada se encuentra dentro de los límites del objeto

Name Type Description
x number

Latitude.

y number

Longitude.

inclusive boolean

Inclusive, with the bounds.

Returns:
Returns if it's inside the object bounds.

containsBounds(bounds, partial, inclusive){boolean}

Name Type Description
bounds cercalia.Bounds

Bounds.

partial boolean

If one destination corner is inside the bounds consider contains the bounds. The default value is false. If false, all the destination bounds must be inside this bounds.

inclusive boolean

Include edges. Default value: true

Returns:
Returns if contains bounds inside object

containsLonLat(lonLat){boolean}

Returns true if a coordinate (cercalia.LonLat object) is inside the bounds

Name Type Description
lonLat cercalia.LonLat

Coordinate.

Returns:
true or false.
Name Type Description
bounds cercalia.Bounds
Returns:
Returns if bounds have the same limits

Expand the limits for including coordinates {ol.Coord} or more limits {cercalia.Bounds}.

Name Type Description
object cercalia.LonLat | cercalia.Bounds

Expand the limits for including the coordinate XY {ol.Coord}

Name Type Description
x number

Longitud

y number

Latitud

Returns the lower limit for Y axis.

Returns:
bottom

Returns the bounds center

Returns:
Map center

Returns the object type.

Returns an object increasing (x0.5) all the limits (top, bottom, left, right)

Returns:
bounds

Height - limits.

Returns:
Height bounds
Returns:
distance Bounds height distance in meters.

Returns the left limit for X axis.

Returns:
left

getNorthEast(){Array.<number>}

Returns the NorthEast coordinate

Returns:
array NorthEast coordinate

Returns the NorthWest coordinate

Returns:
Northwest coordinate

Returns the right limit for X axis.

Returns:
right

Array with size limits [width,height]

Returns:
Size bounds [width, height]

Returns the SouthEast coordinate

Returns:
SouthEast coordinate

Returns the Southwest coordinate

Returns:
Southwest coordinate

Returns the top limit for Y axis.

Returns:
top

Width - limits.

Returns:
Bounds width
Returns:
distance Bounds width distance in meters.

intersectsBounds(bounds, options){boolean}

Determina si unos limites intersecta con los limites del objeto actual. Se considera que intersectan si uno de sus aristas se encuentran dentro de los limites del otro

Name Type Description
bounds cercalia.Bounds
options Object
Returns:
Returns if bounds are empty. (Have not been initialized)
Returns:
Returns an array with the bounds. Format: [left, bottom, right, top]
Returns:
Returns BoundingBox-String "0.41,41.24,0.541,40.51"

Returns the object in string [left, bottom, right, top]

Returns:
Returns a string with the bounds. Format: "left,bottom,right,top"
Name Type Description
maxExtent cercalia.Bounds
options Object

options.leftTolerance|options.rightTolerance