Hint

Extends IHint, Popup.

A hint is a popup text that can display any HTML content. There is usually just one hint instance on the map and it is managed via special managers (maps, geo objects, hotspot layers and so on). Don't create them yourself, unless truly necessary.

Constructor | Fields | Events | Methods

Constructor

Hint(map[, options])

Parameters:

Parameter

Default value

Description

map*

Type: Map

Reference to a map object.

options

Type: Object

Options.

options.closeTimeout

700

Type: Number

Delay before closing (in ms).

options.contentLayout

Type: Function|String

Layout for hint content. (Type: constructor for an object with the ILayout interface).

options.fitPane

true

Type: Boolean

Flag that forces the info object to move its position so that it doesn't extend beyond the container boundaries.

options.holdByMouse

true

Type: Boolean

Flag that cancels closing a hint that is located under the cursor.

options.interactivityModel

Type: String

Key for the interactivity model. Available keys and their values are listed in the description of interactivityModel.storage.

options.layout

islands#hint

Type: Function|String

External layout for the hint. (Type: constructor for an object with the ILayout interface).

options.offset

Type: Number[]

Additional position offset relative to the anchor point.

options.openTimeout

150

Type: Number

Delay before opening (in ms).

options.pane

'outerHint'

Type: String

Key of the pane that the hint overlay is placed in.

options.zIndex

Type: String

The z-index of the hint.

* Mandatory parameter/option.

Example:

// Creating an independent hint instance and showing it with a custom layout in the center of the map by setting the geo coordinates.
(new ymaps.Hint(myMap, {
    projection: ymaps.projection.wgs84Mercator,
    layout: ymaps.templateLayoutFactory.createClass('{{} content }}')
})).open(myMap.getCenter(), 'Hello');

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IEventEmitter.

options

IOptionManager

Options manager.

Inherited from ICustomizable.

Events

Name

Description

close

Closing the info object.

Inherited from IPopup.

open

Opening the info object.

Inherited from IPopup.

optionschange

Change to the object options.

Inherited from ICustomizable.

Methods

Name

Returns

Description

close([force])

vow.Promise

Closes the info object.

Inherited from IPopup.

getData()

Returns info object data.

Inherited from IPopup.

getOverlay()

vow.Promise

Returns the promise object to return the overlay.

Inherited from IPopup.

getOverlaySync()

IOverlay

Returns the overlay, if one exists.

Inherited from IPopup.

getPosition()

Returns the coordinates of the info object.

Inherited from IPopup.

isOpen()

Boolean

Returns the info object state: open/closed.

Inherited from IPopup.

open([position[, data]])

vow.Promise

Opens the info object at the specified position. If the info object is already open, it moves it to the specified point. The format and content of the coordinates is determined by the IProjection that is in the options.

Inherited from IPopup.

setData(data)

vow.Promise

Defines new data for the info object.

Inherited from IPopup.

setPosition(position)

vow.Promise

Specifies a new position for the info object.

Inherited from IPopup.