Hint
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 |
|
— |
Type: Map Reference to a map object. |
— |
Type: Object Options. |
|
700 |
Type: Number Delay before closing (in ms). |
|
— |
Type: Function|String Layout for hint content. (Type: constructor for an object with the ILayout interface). |
|
true |
Type: Boolean Flag that forces the info object to move its position so that it doesn't extend beyond the container boundaries. |
|
true |
Type: Boolean Flag that cancels closing a hint that is located under the cursor. |
|
— |
Type: String Key for the interactivity model. Available keys and their values are listed in the description of interactivityModel.storage. |
|
islands#hint |
Type: Function|String External layout for the hint. (Type: constructor for an object with the ILayout interface). |
|
— |
Type: Number[] Additional position offset relative to the anchor point. |
|
150 |
Type: Number Delay before opening (in ms). |
|
'outerHint' |
Type: String Key of the pane that the hint overlay is placed in. |
|
— |
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 |
Event manager. Inherited from IEventEmitter. |
||
Options manager. Inherited from ICustomizable. |
Events
Name |
Description |
Closing the info object. Inherited from IPopup. |
|
Opening the info object. Inherited from IPopup. |
|
Change to the object options. Inherited from ICustomizable. |
Methods
Name |
Returns |
Description |
Closes the info object. Inherited from IPopup. |
||
getData() |
Returns info object data. Inherited from IPopup. |
|
Returns the promise object to return the overlay. Inherited from IPopup. |
||
Returns the overlay, if one exists. Inherited from IPopup. |
||
Returns the coordinates of the info object. Inherited from IPopup. |
||
isOpen() |
Boolean |
Returns the info object state: open/closed. Inherited from IPopup. |
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. |
||
Defines new data for the info object. Inherited from IPopup. |
||
Specifies a new position for the info object. Inherited from IPopup. |
Mandatory parameter/option.