ym.modules.provider.Bounds
Overview
Creates a bounds object from two pixel coordinates or from the contained points.
All leaflet methods that accept bounds objects also accept them in a simple array form (unless otherwise specified), so that the above bounds example can be rewritten that way:
Initialization
Factory: ym.bounds(Point topLeft, Point bottomRight)
Creates a bounds object from two pixel coordinates (top-left and bottom-right).
Factory: ym.bounds(Point[] points)
Creates a Bounds object that is defined by the points it contains.
Features
- min
- Description: The upper left corner of the rectangle.
-
Data type: Point
-
max
- Description: The lower right corner of the rectangle.
- Data type: Point
Methods
extend(point)
Extends the limits by the specified point.
- Parameter
- point
- Data type: Point
getCenter()
Returns the center of the boundaries.
- Return: Point
contains(bounds)
Returns true if the rectangle contains the specified rectangle.
- Parameter
-
bounds
- Data type: Bounds
-
Return: Bool
contains(point)
Returns true if the rectangle contains the specified point.
- Parameter
-
point
- Data type: Point
-
Return: Bool
intersects(bounds)
Returns true if the rectangle intersects the specified boundaries.
- Parameter
-
bounds
- Data type: Bounds
-
Return: Bool
isValid()
Returns true if the limits are correctly initialized.
- Return: Bool
getSize()
Returns the size of the specified limits.
- Return: Point