Reference Source
public class | source

Bounds

Extends:

leaflet~L.Bounds → Bounds

以像素为单位表示一个矩形区域

Constructor Summary

Public Constructor
public

constructor(topLeft: Point, bottomRight: Point)

构造函数

Method Summary

Public Methods
public

如果矩形区域包含给定对象则返回true

public

extend(point: Point): Bounds

扩展矩形区域,使之能容纳点

public

返回矩形区域的左下角点

public

getCenter(isRound: Boolean): Point

返回矩形区域的中心点

public

返回矩形区域的大小

public

返回矩形区域的右上角点

public

intersects(otherBounds: Bounds): Boolean

如果矩形区域与给定的矩形区域相交则返回true。如果它们有一个点相交就会被判定为相交。

public

overlaps(otherBounds: Bounds): Boolean

如果矩形区域与给定的矩形区域重叠则返回true。两块区域如果相交的是一块区域则被判定为重叠。

Public Constructors

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

构造函数

Params:

NameTypeAttributeDescription
topLeft Point

左上点坐标

bottomRight Point

右下点坐标

Public Methods

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

如果矩形区域包含给定对象则返回true

Params:

NameTypeAttributeDescription
point Point | Bounds

点或矩形框

Return:

Boolean

public extend(point: Point): Bounds source

扩展矩形区域,使之能容纳点

Params:

NameTypeAttributeDescription
point Point

扩展区域

Return:

Bounds

public getBottomLeft(): Point source

返回矩形区域的左下角点

Return:

Point

public getCenter(isRound: Boolean): Point source

返回矩形区域的中心点

Params:

NameTypeAttributeDescription
isRound Boolean
  • optional
  • default: false

如果是true,则进行四舍五入

Return:

Point

public getSize(): Point source

返回矩形区域的大小

Return:

Point

public getTopRight(): Point source

返回矩形区域的右上角点

Return:

Point

public intersects(otherBounds: Bounds): Boolean source

如果矩形区域与给定的矩形区域相交则返回true。如果它们有一个点相交就会被判定为相交。

Params:

NameTypeAttributeDescription
otherBounds Bounds

另一个矩形框

Return:

Boolean

public overlaps(otherBounds: Bounds): Boolean source

如果矩形区域与给定的矩形区域重叠则返回true。两块区域如果相交的是一块区域则被判定为重叠。

Params:

NameTypeAttributeDescription
otherBounds Bounds

另一个矩形框

Return:

Boolean