Bounds

概述

用坐标表示矩形区域

用法示例

var p1 = FMap.point(10, 10),
    p2 = FMap.point(40, 60),
    bounds = FMap.bounds(p1, p2);
//所有支持Bounds 对象的方法或options也支持简单的数组形式,所以上述用例也可以如下:            
otherBounds.intersects([[10, 10], [40, 60]]);

创建(Creation)

创建:

创建 描述
FMap.bounds( <Point> topLeft, <Point> bottomRight ) 可以通过两个坐标(通常是左上角和右下角)创建一个边界对象
FMap.bounds( <Point[]> points ) 创建由它包含的点定义的边界对象

属性(Properties)

属性:

属性 类型 描述
min Point 矩形的左上角
max Point 矩形的右下角

方法(Methods)

方法:

方法 参数 返回值 描述
extend() <Point> point - 扩展的范围包含给定的点
getCenter() Point 返回当前范围的中心坐标点
contains() <Bounds> otherBounds Boolean 如果当前矩形包含指定范围,返回true
contains() <Point> point Boolean 如果当前矩形包含指定坐标点,返回true
intersects() <Bounds> otherBounds Boolean 如果当前矩形和指定范围相交,返回true
isValid() Boolean 如果边界正确初始化,返回true
getSize() Point 返回给定界限的大小

results matching ""

    No results matching ""