Class Bounds

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(left: number, bottom: number, right: number, top: number): Bounds

Construct a new bounds object. Coordinates can either be passed as four arguments, or as a single argument.

Parameters

  • left: number
  • bottom: number
  • right: number
  • top: number

Returns

Bounds

constructor(bounds: Array<number>): Bounds

Construct a new bounds object. Coordinates can either be passed as four arguments, or as a single argument.

Parameters

  • bounds: Array<number>

Returns

Bounds

Properties

public static CLASS_NAME: string

public bottom: number

Minimum vertical coordinate.

public left: number

Minimum horizontal coordinate.

public right: number

Maximum horizontal coordinate.

public top: number

Maximum vertical coordinate.

Methods

public add(x: number, y: number): Bounds

Shifts the coordinates of the bound by the given horizontal and vertical deltas.

Parameters

  • x: number
  • y: number

Returns

Bounds

public clone(): Bounds

Create a cloned instance of this bounds.

Returns

Bounds

public contains(x: number, y: number, inclusive?: boolean): boolean

Returns whether the bounds object contains the given x and y.

Parameters

  • x: number
  • y: number
  • inclusive?: boolean optional

Returns

boolean

public containsBounds(bounds: Bounds, partial: boolean, inclusive: boolean): boolean

Returns whether the bounds object contains the given .

Parameters

  • bounds: Bounds
  • partial: boolean
  • inclusive: boolean

Returns

boolean

public containsLonLat(ll: LonLat, options: BoundsOptions): boolean

Returns whether the bounds object contains the given .

Parameters

Returns

boolean

public containsLonLat(ll: Object, options: BoundsOptions): boolean

Returns whether the bounds object contains the given .

Parameters

Returns

boolean

public containsPixel(px: Pixel, inclusive: boolean): boolean

Returns whether the bounds object contains the given .

Parameters

  • px: Pixel
  • inclusive: boolean

Returns

boolean

public determineQuadrant(lonlat: LonLat): string

Returns the the quadrant ("br", "tr", "tl", "bl") in which the given

lies.

Parameters

Returns

string

public equals(bounds: Bounds): boolean

Test a two bounds for equivalence.

Parameters

Returns

boolean

public extend(object: LonLat)

Extend the bounds.

Parameters

public extend(object: Point)

Extend the bounds.

Parameters

public extend(object: Bounds)

Extend the bounds.

Parameters

public extendXY(x: number, y: number)

Parameters

  • x: number
  • y: number

public static fromArray(bbox: Array<number>, reverseAxisOrder: boolean): Bounds

Alternative constructor that builds a new OpenLayers.Bounds from an array.

Parameters

  • bbox: Array<number>
  • reverseAxisOrder: boolean

Returns

Bounds

public static fromSize(size: Size): Bounds

Alternative constructor that builds a new OpenLayers.Bounds from a size.

Parameters

Returns

Bounds

public static fromString(str: string, reverseAxisOrder: boolean): Bounds

Alternative constructor that builds a new OpenLayers.Bounds from a parameter string.

Parameters

  • str: string
  • reverseAxisOrder: boolean

Returns

Bounds

public getCenterLonLat(): LonLat

Returns the LonLat object which represents the center of the bounds.

Returns

LonLat

public getCenterPixel(): Pixel

Returns the Pixel object which represents the center of the bounds.

Returns

Pixel

public getHeight(): number

Returns the height of the bounds.

Returns

number

public getSize(): Size

Returns

Size

public getWidth(): number

Returns the width of the bounds.

Returns

number

public intersectsBounds(bounds: Bounds, options: BoundsOptions): boolean

Determine whether the target bounds intersects this bounds. Bounds are considered intersecting if any of their edges intersect or if one bounds contains the other.

Parameters

Returns

boolean

public static oppositeQuadrant(quadrant: string): string

Get the opposite quadrant for a given quadrant string.

Parameters

  • quadrant: string

Returns

string

public scale(ratio: number, origin?: Pixel)

Scales the bounds around a pixel or lonlat. Note that the new bounds may return non-integer properties, even if a pixel is passed.

Parameters

  • ratio: number
  • origin?: Pixel optional

public scale(ratio: number, origin?: LonLat)

Scales the bounds around a pixel or lonlat. Note that the new bounds may return non-integer properties, even if a pixel is passed.

Parameters

  • ratio: number
  • origin?: LonLat optional

public toArray(reverseAxisOrder?: boolean): Array<number>

Returns an array representation of the bounds object.

Parameters

  • reverseAxisOrder?: boolean optional

Returns

Array<number>

public toBBOX(decimal?: number, reverseAxisOrder?: boolean): string

Returns a boundingbox-string representation of the bounds object.

Parameters

  • decimal?: number optional
  • reverseAxisOrder?: boolean optional

Returns

string

public toGeometry(): Polygon

Create a new polygon geometry based on this bounds.

Returns

Polygon

public toString(): string

Returns a string representation of the bounds object.

Returns

string

public transform(source: Projection, dest: Projection): Bounds

Transform the Bounds object from source to dest.

Parameters

Returns

Bounds

public wrapDateLine(maxExtent: Bounds, options: WrapDateLineOptions): Bounds

Wraps the bounds object around the dateline.

Parameters

Returns

Bounds