Reference Source
public class | source

Bounds

Extends:

leaflet~L.Bounds → Bounds

Represents a rectangular area in pixel coordinates

Constructor Summary

Public Constructor
public

constructor(topLeft: Point, bottomRight: Point)

Constructor

Method Summary

Public Methods
public

Returns true if the rectangle contains the given one

public

extend(point: Point): Bounds

Extends the bounds to contain the given point

public

Returns the bottom-left point of the bounds

public

getCenter(isRound: Boolean): Point

Returns the center point of the bounds

public

Returns the size of the given bounds

public

Returns the top-right point of the bounds

public

intersects(otherBounds: Bounds): Boolean

Returns true if the rectangle intersects the given bounds.

public

overlaps(otherBounds: Bounds): Boolean

Returns true if the rectangle overlaps the given bounds.

Public Constructors

public constructor(topLeft: Point, bottomRight: Point) source

Constructor

Params:

NameTypeAttributeDescription
topLeft Point

top left point

bottomRight Point

bottom right point

Public Methods

public contains(point: Point | Bounds): Boolean source

Returns true if the rectangle contains the given one

Params:

NameTypeAttributeDescription
point Point | Bounds

point or bounds

Return:

Boolean

public extend(point: Point): Bounds source

Extends the bounds to contain the given point

Params:

NameTypeAttributeDescription
point Point

extends area

Return:

Bounds

public getBottomLeft(): Point source

Returns the bottom-left point of the bounds

Return:

Point

public getCenter(isRound: Boolean): Point source

Returns the center point of the bounds

Params:

NameTypeAttributeDescription
isRound Boolean
  • optional
  • default: false

if isRound is true, round the point

Return:

Point

public getSize(): Point source

Returns the size of the given bounds

Return:

Point

public getTopRight(): Point source

Returns the top-right point of the bounds

Return:

Point

public intersects(otherBounds: Bounds): Boolean source

Returns true if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common

Params:

NameTypeAttributeDescription
otherBounds Bounds

other bounds

Return:

Boolean

public overlaps(otherBounds: Bounds): Boolean source

Returns true if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area

Params:

NameTypeAttributeDescription
otherBounds Bounds

other bounds

Return:

Boolean