WebCAD-Lib-TS API 文档 - v1.0.0
    Preparing search index...

    Class GeoBounds

    GeoBounds 地理范围.

    Index

    Constructors

    Properties

    Methods

    • 根据数组创建 GeoBounds.

      Example:

      const b = GeoBounds.fromArray([left, bottom, right, top]);
      

      Parameters

      • input: [number, number, number, number]

      Returns GeoBounds

    • 根据数组创建 GeoBounds.

      Example:

      const b = GeoBounds.fromString("[1,2,3,4]");
      

      Parameters

      • input: string

      Returns GeoBounds

    • 根据中心点和长,宽生成bounds

      Parameters

      • center: GeoPointLike

        中心点

      • width: number

      • Optionalheight: number

        高,不输入时与宽一样

      Returns GeoBounds

    • 设置包围盒范围

      Parameters

      Returns void

    • 得到中心点

      Returns GeoPoint

    • 得到左上角

      Returns GeoPoint

    • 得到左下角

      Returns GeoPoint

    • 得到右上角

      Returns GeoPoint

    • 得到右下角

      Returns GeoPoint

    • 生成一个随机点

      Parameters

      • xRatio: number = 0.6

        x轴范围比例 缺省 0.6

      • yRatio: number = 0.6

        y轴范围比例 缺省 0.6

      Returns GeoPoint

    • 生成一个随机点序列

      Parameters

      • minPointCount: number

        最少的点数

      • maxPointCount: number

        最多的点数

      • xRatio: number = 0.6

        x轴范围比例 缺省 0.6

      • yRatio: number = 0.6

        y轴范围比例 缺省 0.6

      Returns GeoPoint[]

    • 生成一个随机geojson点集合

      Parameters

      • count: number

        点的数目

      • xRatio: number = 0.6

        x轴范围比例 缺省 0.6

      • yRatio: number = 0.6

        y轴范围比例 缺省 0.6

      • OptionalpropertiesCb: (index: number) => Object

        属性回调函数

      Returns GeoJsonGeomertry

    • 生成一个随机geojson线集合

      Parameters

      • maxLineCount: number

        最多线的数目

      • maxPointCount: number

        每条线最多的点的数目

      • xRatio: number = 0.6

        x轴范围比例 缺省 0.6

      • yRatio: number = 0.6

        y轴范围比例 缺省 0.6

      • OptionalpropertiesCb: (index: number) => Object

        属性回调函数

      • OptionalminLineCount: number

        最少线的数目(缺省为1)

      • OptionalminPointCount: number

        每条线最少的点的数目(缺省为2)

      Returns GeoJsonGeomertry

    • 生成一个随机geojson多边形集合

      Parameters

      • maxPolygonCount: number

        最多多边形的数目

      • maxPointCount: number

        每条线最多的点的数目

      • xRatio: number = 0.6

        x轴范围比例 缺省 0.6

      • yRatio: number = 0.6

        y轴范围比例 缺省 0.6

      • OptionalpropertiesCb: (index: number) => Object

        属性回调函数

      • OptionalminPolygonCount: number

        最少多边形的数目(缺省为1)

      • OptionalminPointCount: number

        每条线最少的点的数目(缺省为3)

      Returns GeoJsonGeomertry

    • 返回数组

      Returns number[]

      The coordinates represented as a array of the format [minx, miny, maxx, maxy]'.

    • 返回点数组,包括四个顶点

      Returns [number, number][]

      The coordinates represented as a array of the format [[minx,maxy], [maxx,maxy], [maxx,miny], [minx,miny]]'.

    • 返回字符串.

      Parameters

      • fixed: number = 6

      Returns string

      The coordinates represented as a string of the format minx, miny, maxx, maxy'.

    • 变成正方形,使宽高相等

      Parameters

      • OptionalisMinValue: boolean

        是否取宽高的最小值或最大值,默认最大值 @return{GeoBounds}

      Returns GeoBounds

    • 获取宽度

      Returns number

    • 获取高度

      Returns number

    • 按照比例扩大/缩小出一个新的 GeoBounds。

      Parameters

      • ratio: number

        比例

      • Optionalorigin: GeoPoint

        扩大时的基准点,默认为当前 bounds 的中心点

      Returns GeoBounds

    • 按照XY比例扩大/缩小出一个新的 GeoBounds。

      Parameters

      • ratioX: number

        X比例

      • ratioY: number

        Y比例

      • Optionalorigin: GeoPoint

        扩大时的基准点,默认为当前 bounds 的中心点

      Returns GeoBounds

    • 位移包围盒

      Parameters

      • dx: number
      • dy: number

      Returns void

    • 更新包围盒

      Parameters

      Returns void

    • 判断与另一个包围盒是否相交

      Parameters

      Returns boolean

    • 求一个包围盒是否包含另一个包围盒

      Parameters

      Returns boolean

    • 查看点是否在包围盒中

      Parameters

      Returns boolean

    • 查找边界框上最近的点并返回该点.

      Parameters

      • testPoint: GeoPoint

        点.

      • includeInterior: boolean = true

        如果为true,则最近的点可以位于边界框内。如果为false,则最近的点只能位于边界框的外边缘上.

      Returns GeoPoint