Class: PointExtent

PointExtent

Represent a bounding box on 2d surface , a rectangular area with minimum and maximum points.
There are serveral ways to create a PointExtent:

new PointExtent(x1, y1, x2, y2) [source]

//with 4 numbers
var extent = new PointExtent(100, 10, 120, 20);
//with 2 points
var extent = new PointExtent(new Point(100, 10), new Point(120, 20));
//with a json object containing xmin, ymin, xmax and ymax
var extent = new PointExtent({xmin : 100, ymin: 10, xmax: 120, ymax:20});
var extent1 = new PointExtent(100, 10, 120, 20);
//with another extent
var extent2 = new PointExtent(extent1);
Parameter Type Description
x1 Number x of point 1
y1 Number y of point 1
x2 Number x of point 2
y2 Number y of point 2
Extends:

Members

  • xmin

  • Inherited From:
    Properties:
    Name Type Description
    xmin Number minimum x
    Inherited From:
    Source:

  • xmax

  • Inherited From:
    Properties:
    Name Type Description
    xmax Number maximum x
    Inherited From:
    Source:

  • ymin

  • Inherited From:
    Properties:
    Name Type Description
    ymin Number minimum y
    Inherited From:
    Source:

  • ymax

  • Inherited From:
    Properties:
    Name Type Description
    ymax Number maximum y
    Inherited From:
    Source:

    Methods

  • (inherited) add(p) [source]

  • Add the extent with a coordinate or a point.
    Parameter Type Description
    p Coordinate | Point point or coordinate to add
    Inherited From:
    Returns:
    Extent: a new extent
  • (inherited) sub(p) [source]

  • Substract the extent with a coordinate or a point.
    Parameter Type Description
    p Coordinate | Point point or coordinate to substract
    Inherited From:
    Returns:
    Extent: a new extent
  • (inherited) substract(p) [source]

  • Alias for sub
    Parameter Type Description
    p Coordinate | Point point or coordinate to substract
    Inherited From:
    Returns:
    Extent: a new extent
  • (inherited) round() [source]

  • Round the extent
    Inherited From:
    Returns:
    Extent: rounded extent
  • (inherited) getMin() [source]

  • Get the minimum point
    Inherited From:
    Returns:
    Coordinate:
  • (inherited) getMax() [source]

  • Get the maximum point
    Inherited From:
    Returns:
    Coordinate:
  • (inherited) getCenter() [source]

  • Get center of the extent.
    Inherited From:
    Returns:
    Coordinate:
  • (protected) (inherited) isValid() [source]

  • Whether the extent is valid
    Inherited From:
    Returns:
    Boolean:
  • (inherited) equals(ext2) [source]

  • Compare with another extent to see whether they are equal.
    Parameter Type Description
    ext2 Extent extent to compare
    Inherited From:
    Returns:
    Boolean:
  • (inherited) intersects(ext2) [source]

  • Whether it intersects with another extent
    Parameter Type Description
    ext2 Extent another extent
    Inherited From:
    Returns:
    Boolean:
  • (inherited) within(ext2) [source]

  • Whether the extent is within another extent
    Parameter Type Description
    ext2 Extent another extent
    Inherited From:
    Returns:
    Boolean:
  • (inherited) contains(coordinate) [source]

  • Whether the extent contains the input point.
    Parameter Type Description
    coordinate Coordinate | Array.<Number> input point
    Inherited From:
    Returns:
    Boolean:
  • (inherited) getWidth() [source]

  • Get the width of the Extent
    Inherited From:
    Returns:
    Number:
  • (inherited) getHeight() [source]

  • Get the height of the Extent
    Inherited From:
    Returns:
    Number:
  • (inherited) getSize() [source]

  • Get size of the Extent
    Inherited From:
    Returns:
    Size:
  • (inherited) combine(extent) [source]

  • Combine it with another extent to a larger extent.
    Parameter Type Description
    extent Extent another extent
    Inherited From:
    Returns:
    Extent: extent combined
  • (inherited) intersection(extent) [source]

  • Gets the intersection extent of this and another extent.
    Parameter Type Description
    extent Extent another extent
    Inherited From:
    Returns:
    Extent: intersection extent
  • (inherited) expand(distance) [source]

  • Expand the extent by distance
    Parameter Type Description
    distance Size | Number distance to expand
    Inherited From:
    Returns:
    Extent: a new extent expanded from
  • (inherited) toJSON() [source]

  • Get extent's JSON object.
    // {xmin : 100, ymin: 10, xmax: 120, ymax:20}
    var json = extent.toJSON();
    Inherited From:
    Returns:
    Object: jsonObject
  • (inherited) toArray() [source]

  • Get a coordinate array of extent's rectangle area, containing 5 coordinates in which the first equals with the last.
    Inherited From:
    Returns:
    Array.<Coordinate>: coordinates array
  • (inherited) copy() [source]

  • Get a copy of the extent.
    Inherited From:
    Returns:
    Extent: copy
  • (inherited) convertTo(fn) [source]

  • Convert to a new extent
    Parameter Type Description
    fn function convert function on each point
    Inherited From:
    Returns:
    Extent: