geometry.base.Circle

Extends IBaseCircleGeometry.

The "Circle" base geometry.

Constructor | Fields | Events | Methods

Constructor

geometry.base.Circle([coordinates[, radius]])

Parameters:

Parameter

Default value

Description

coordinates

null

Type: Number[]|null

Coordinates of the center of the circle.

radius

0

Type: Number

Radius of the circle.

Example:

var myCircle = new ymaps.geometry.base.Circle([0, 0], 10);
myCircle.events.add('change', function () {
    alert('Geometry changed');
});
myCircle.freeze();
myCircle.setCoordinates([10, 10]);
myCircle.setRadius(20);
// At this moment, a single event will be generated, and a message will be output.
myCircle.unfreeze();

Fields

Name

Type

Description

events

event.Manager

Geometry event manager.

Events

Name

Description

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.

Inherited from ICircleGeometryAccess.

Methods

Name

Returns

Description

contains(position)

Boolean

Checks whether the passed point is located inside the circle.

Inherited from ICircleGeometryAccess.

freeze()

IFreezable

Switches the object to "frozen" mode.

Inherited from IFreezable.

getBounds()

Number[][]|null

Returns coordinates of the two opposite corners of the area that surrounds the geometry. The first item in the array is the corner with the smallest coordinate values relative to the rest of the points in the area; the second item is the corner with the largest coordinate values.

Inherited from IBaseGeometry.

getClosest(anchorPosition)

Object

Searches for a point on the circle closest to the anchorPosition.

Inherited from ICircleGeometryAccess.

getCoordinates()

Number[]|null

Returns coordinates of the center of the circle.

Inherited from ICircleGeometryAccess.

getRadius()

Number

Returns radius of the circle.

Inherited from ICircleGeometryAccess.

getType()

String

Returns the "Circle" string.

Inherited from IBaseCircleGeometry.

isFrozen()

Boolean

Returns true if the object is in "frozen" mode, otherwise false.

Inherited from IFreezable.

setCoordinates(coordinates)

ICircleGeometryAccess

Sets the coordinates of the center of the circle.

Inherited from ICircleGeometryAccess.

setRadius(radius)

ICircleGeometryAccess

Sets the radius of the circle.

Inherited from ICircleGeometryAccess.

unfreeze()

IFreezable

Switches the object to active mode.

Inherited from IFreezable.

Fields details

events

{event.Manager} events

Geometry event manager.