PointExtent
PointExtent is the point version of Extent, extending Extent. It is created in exactly the same way as Extent, but its getMin(), getMax(), getCenter() and other methods return Point objects instead of Coordinate objects, making it suitable for pixel/screen-coordinate areas.
js
import { PointExtent } from "maptalks";
// Usage example
const extent = new PointExtent(100, 10, 120, 20);
console.log(extent.getMin()); // Point(100, 10)Constructor
js
new PointExtent(xmin, ymin, xmax, ymax)
new PointExtent(c1, c2)
new PointExtent(json, projection?)
new PointExtent(extent)Parameters:
- The same as
Extent: four numbersxmin,ymin,xmax,ymax, or twoPointcorner points, or an object containingxmin,ymin,xmax,ymax, or another Extent, plus an optionalprojection.
Methods
PointExtent has no unique methods of its own; it reuses all methods of Extent. The differences are:
getMin(),getMax(),getCenter(),toArray()etc. returnPointinstead ofCoordinate.- The rest of the methods (
getWidth,getHeight,contains,intersects,within,combine,expand,copy,toJSON,toBBOX, etc.) behave the same asExtent. See Extent.
Static Methods
PointExtent has no static methods.
Events
PointExtent has no events.