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

  • Properties:
    Name Type Description
    xmin Number minimum x
    Overrides:
    Source:

  • xmax

  • Properties:
    Name Type Description
    xmax Number maximum x
    Overrides:
    Source:

  • ymin

  • Properties:
    Name Type Description
    ymin Number minimum y
    Overrides:
    Source:

  • ymax

  • Properties:
    Name Type Description
    ymax Number maximum y
    Overrides:
    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
    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
    Returns:
    Extent: a new extent
  • (inherited) substract(p) [source]

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Combine it with another extent to a larger extent.
    Parameter Type Description
    extent Extent | Coordinate | Point extent/coordinate/point to combine into
    Returns:
    Extent: extent combined
  • (inherited) intersection(extent) [source]

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

  • Expand the extent by distance
    Parameter Type Description
    distance Size | Number distance to expand
    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();
    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.
    Returns:
    Array.<Coordinate>: coordinates array
  • (inherited) copy() [source]

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

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