---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md
  - https://yandex.com/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/objectManager.Hint.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/jsapi-v2-1/doc/en/llms.txt

# objectManager.Hint

Extends [IHintManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IHintManager.md).

Manager of the hint on an object layer. Allows to manage the hint on an object layer by opening it and hiding it. It uses the map hint manager [map.Hint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Hint.md) inside itself. Object layers contains instances of this class, accessible as myObjectManager.objects.hint and myObjectManager.clusters.hint. Don't create new instances of this class unless necessary.

**See** [Hint](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Hint.md)

[Constructor](#constructor-summary) | [Fields](#properties-summary) | [Events](#events-summary) | [Methods](#methods-summary)

## Constructor {#constructor-summary}

```javascript
objectManager.Hint(collection)
```

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`collection`](#param-collection)[*](*star) | — | Type: IReadOnlyCollection

Object layer. ||
|#

\* Mandatory parameter/option.

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [events](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events) | [IEventManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md) | Event manager.

Inherited from [IEventEmitter](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events). ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [close](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#event-close) | Closing the info object. Names of fields available via [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get): 
- target - Reference to the object where the closing occurred.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#event-close). ||
|| [open](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#event-open) | Opening the info object. Names of fields available via [Event.get](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get): 
- target - Reference to the object where the opening occurred.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#event-open). ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [close](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#close)(\[[force](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#close-param-force)]) | [vow.Promise](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Hides the popup hint. ||
|| [destroy](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#destroy)() | | Disables the info object manager.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#destroy). ||
|| [getData](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#getData)() | Object\|null | Returns hash describing the object the hint is shown on, or null if the hint was not shown. ||
|| [getOptions](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getOptions)() | [IOptionManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOptionManager.md)\|null | Returns the options manager or 'null'.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getOptions). ||
|| [getOverlay](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getOverlay)() | [vow.Promise](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Returns the promise object to return the overlay.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getOverlay). ||
|| [getOverlaySync](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getOverlaySync)() | [IOverlay](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOverlay.md)\|null | Returns the overlay, if one exists.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getOverlaySync). ||
|| [getPosition](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getPosition)() | Number[]\|null | Returns the coordinates of the info object or 'null'.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#getPosition). ||
|| [isOpen](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#isOpen)([id](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#isOpen-param-id)) | Boolean | A method that determines whether the popup hint was shown on the object with the passed ID. ||
|| [open](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#open)([objectId](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#open-param-objectId)[, [position](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#open-param-position)]) | [vow.Promise](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Displays the popup hint on the object with the passed ID. ||
|| [setData](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#setData)([objectData](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Hint.md#setData-param-objectData)) | [vow.Promise](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Sets new data for displaying the popup hint. ||
|| [setOptions](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#setOptions)([options](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#setOptions-param-options)) | [vow.Promise](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Defines new options for the info object.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#setOptions). ||
|| [setPosition](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#setPosition)([position](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#setPosition-param-position)) | [vow.Promise](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/vow.Promise.md) | Specifies a new position for the info object.

Inherited from [IPopupManager](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPopupManager.md#setPosition).||
|#

## Methods details {#method_detail}

### close {#close}

```javascript
{vow.Promise} close([force])
```

Hides the popup hint.

**Returns** Promise object.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`force`](#close-param-force) | false | Type: Boolean

Instant closure. ||
|#


**Example:**

```javascript
// Closing all hints on a layer.
objectManager.objects.hint.close();
objectManager.clusters.hint.close();
```

### getData {#getData}

```javascript
{Object|null} getData()
```

**Returns** hash describing the object the hint is shown on, or null if the hint was not shown.

**Example:**

```javascript
var cluster = objectManager.clusters.hint.getData();
if (cluster) {
    alert('Cluster displays a hint.');
}
```

### isOpen {#isOpen}

```javascript
{Boolean} isOpen(id)
```

A method that determines whether the popup hint was shown on the object with the passed ID.

**Returns** hint state: shown/hidden.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`id`](#isOpen-param-id)[*](*star) | — | Type: Object

Object ID. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// Closing the hint when the object is clicked.
objectManager.objects.add('click', function (e) {
    var objectId = e.get('objectId');
    if (objectManager.objects.hint.isOpen(objectId)) {
        objectManager.objects.hint.close();
    }
});
```

### open {#open}

```javascript
{vow.Promise} open(objectId[, position])
```

Displays the popup hint on the object with the passed ID.

**Returns** Promise object.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`objectId`](#open-param-objectId)[*](*star) | — | Type: Object

ID of the object to open the hint on. ||
|| [`position`](#open-param-position) | — | Type: Number[]

The position for showing the popup hint, in global pixel coordinates. If the value is not specified, the hint will appear at the geometric center of the object. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
objectManager.clusters.hint.open(objectId);
```

### setData {#setData}

```javascript
{vow.Promise} setData(objectData)
```

Sets new data for displaying the popup hint.

**Returns** Promise object.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`objectData`](#setData-param-objectData)[*](*star) | — | Type: Object

Hash with a description of the object to open the hint on. Corresponds to the object description that is input to ObjectManager.add. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
objectManager.objects.hint.setData(objectManager.objects.getById(objectId));
```

[*star]: Mandatory parameter/option.