ICircleGeometryAccess
Extends IFreezable.
Interface for access to the "Circle" geometry.
Constructor | Fields | Events | Methods
Constructor
ICircleGeometryAccess()
Fields
Name |
Type |
Description |
Event manager for the object. Inherited from IFreezable. |
Events
Name |
Description |
Changed coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:
|
Methods
Name |
Returns |
Description |
Boolean |
Checks whether the passed point is located inside the circle. |
|
freeze() |
Switches the object to "frozen" mode. Inherited from IFreezable. |
|
Object |
Searches for a point on the circle closest to the anchorPosition. |
|
Number[]|null |
Returns coordinates of the center of the circle. |
|
Number |
Returns radius of the circle. |
|
isFrozen() |
Boolean |
Returns true if the object is in "frozen" mode, otherwise false. Inherited from IFreezable. |
Sets the coordinates of the center of the circle. |
||
Sets the radius of the circle. |
||
unfreeze() |
Switches the object to active mode. Inherited from IFreezable. |
Events details
change
Changed coordinates. Instance of the Event class. Names of fields that are available via the Event.get method:
- oldCoordinates - Old coordinates of the center.
- newCoordinates - New coordinates of the center.
- oldRadius - Old radius.
- newRadius - New radius.
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:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point. |
* 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.
Returns an object with the following fields:
- position - Point on the circle closest to "anchorPosition".
- distance - Distance from "anchorPosition" to "position".
Parameters:
Parameter |
Default value |
Description |
— |
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 |
— |
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:
Parameter |
Default value |
Description |
— |
Type: Number Radius of the circle. |
* Mandatory parameter/option.
Mandatory parameter/option.