Documentation
Reference
2.1.56 (current version)
collection
interactivityModel
Interfaces

geometry.Circle

Extends ICircleGeometry.

The "Circle" geometry.

See Circle

Constructor | Fields | Events | Methods

Constructor

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

Parameters:

ParameterDefault valueDescription
coordinates null

Type: Number[]|null

Coordinates of the center of the circle.

radius 0

Type: Number

Radius of the circle in meters.

options

Type: Object

Geometry options.

options.geodesic false

Type: Boolean

Enables display using geodesic lines.

options.pixelRendering "jumpy"

Type: String

Method for calculating pixel coordinates of the shape in cycled projections. This option accepts one of the following values:

  • jumpy - The shape is placed as close as possible to the center of the map viewport, and can "jump" when the map is being moved.
  • static - The shape is always located in the initial world and does not move when the map is moved.

options.projection

Type: IProjection

Projection.

Example:

// Creating an instance of the circle geometry class (specifying the coordinates and radius in meters). var circleGeometry = new ymaps.geometry.Circle([30, 50], 10),
// Creating an instance of the geo object class and passing our geometry to the constructor.
    circleGeoObject = new ymaps.GeoObject({ geometry: circleGeometry });

// Changing the geometry's radius via the geo object's "geometry" property.
circleGeoObject.geometry.setRadius(5)
// Or directly.
circleGeometry.setRadius(5);
// You can also access circleGeometry via circleGeoObject.geometry.

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

optionsIOptionManager

Options manager.

Inherited from ICustomizable.

Events

NameDescription
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.

mapchange

Map reference changed. Instance of the Event class. Names of fields that are available via the Event#get method:

  • oldMap - Old map.
  • newMap - New map.

Inherited from IGeometry.

optionschange

Change to the object options.

Inherited from ICustomizable.

pixelgeometrychange

The pixel geometry changed. Instance of the Event class. Names of fields that are available via the Event#get method:

Inherited from IGeometry.

Methods

NameReturnsDescription
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 southwest corner of the area; the second item is the northeast corner.

Inherited from IGeometry.

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.

getMap()

Map|null

Returns the current map.

Inherited from IGeometry.

getPixelGeometry([options])

IPixelGeometry

Returns the pixel geometry corresponding to the given geometry, its options, and the map state.

Inherited from IGeometry.

getRadius()

Number

Returns radius of the circle.

Inherited from ICircleGeometryAccess.

getType()

String

Returns the "Circle" string.

Inherited from ICircleGeometry.

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.

setMap(map)

Sets the map.

Inherited from IGeometry.

setRadius(radius)

ICircleGeometryAccess

Sets the radius of the circle.

Inherited from ICircleGeometryAccess.

unfreeze()

IFreezable

Switches the object to active mode.

Inherited from IFreezable.