ICircleGeometryAccess
Extends IFreezable.
Interface for access to the "Circle" geometry.
Constructor | Fields | Events | Methods
Constructor
ICircleGeometryAccess()
Fields
Name | Type | Description |
---|---|---|
events | IEventManager | Event manager for the object. Inherited from IFreezable. |
Name | Type | Description |
---|---|---|
events | IEventManager | Event manager for the object. Inherited from IFreezable. |
Events
Name | Description |
---|---|
change |
Methods
Name | Returns | Description |
---|---|---|
contains(position) | Boolean | Checks whether the passed point is located inside the circle. |
freeze() | Switches the object to "frozen" mode. Inherited from IFreezable. | |
getClosest(anchorPosition) | Object | Searches for a point on the circle closest to the anchorPosition. |
getCoordinates() | Number[]|null | Returns coordinates of the center of the circle. |
getRadius() | Number | Returns radius of the circle. |
isFrozen() | Boolean | Returns true if the object is in "frozen" mode, otherwise false. Inherited from IFreezable. |
setCoordinates(coordinates) | Sets the coordinates of the center of the circle. | |
setRadius(radius) | Sets the radius of the circle. | |
unfreeze() | Switches the object to active mode. Inherited from IFreezable. |
Name | Returns | Description |
---|---|---|
contains(position) | Boolean | Checks whether the passed point is located inside the circle. |
freeze() | Switches the object to "frozen" mode. Inherited from IFreezable. | |
getClosest(anchorPosition) | Object | Searches for a point on the circle closest to the anchorPosition. |
getCoordinates() | Number[]|null | Returns coordinates of the center of the circle. |
getRadius() | Number | Returns radius of the circle. |
isFrozen() | Boolean | Returns true if the object is in "frozen" mode, otherwise false. Inherited from IFreezable. |
setCoordinates(coordinates) | Sets the coordinates of the center of the circle. | |
setRadius(radius) | Sets the radius of the circle. | |
unfreeze() | Switches the object to active mode. Inherited from IFreezable. |
Events details
Methods details
contains
{Boolean} contains(position)
Checks whether the passed point is located inside the circle.
Returns an indicator for whether the point belongs to the circle.
Parameters:
* Mandatory parameter/option.
Example:
var myCircle = new ymaps.geometry.base.Circle([0, 0], 10);
myCircle.contains([0, 10]); // => true
getClosest
{Object} getClosest(anchorPosition)
Searches for a point on the circle closest to the anchorPosition.
- position - Point on the circle closest to "anchorPosition".
- distance - Distance from "anchorPosition" to "position".
Parameters:
Parameter | Default value | Description |
---|---|---|
anchorPosition * | — | Type: Number[] Coordinates of a point for which the nearest point on the circle is calculated. |
Parameter | Default value | Description |
---|---|---|
anchorPosition * | — | Type: Number[] Coordinates of a point for which the nearest point on the circle is calculated. |
* Mandatory parameter/option.
Example:
var myCircle = new ymaps.geometry.base.Circle([0, 0], 10);
myCircle.getClosest([0, 15]).position; // => [0, 10]
getCoordinates
{Number[]|null} getCoordinates()
Returns coordinates of the center of the circle.
getRadius
{Number} getRadius()
Returns radius of the circle.
setCoordinates
{ICircleGeometryAccess} setCoordinates(coordinates)
Sets the coordinates of the center of the circle.
Returns self-reference.
Parameters:
Parameter | Default value | Description |
---|---|---|
coordinates * | — | Type: Number[]|null Coordinates of the center of the circle. |
Parameter | Default value | Description |
---|---|---|
coordinates * | — | Type: Number[]|null Coordinates of the center of the circle. |
* Mandatory parameter/option.
setRadius
{ICircleGeometryAccess} setRadius(radius)
Sets the radius of the circle.
Returns self-reference.
Parameters:
* Mandatory parameter/option.