objectManager.Hint
Extends IHintManager.
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 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
Constructor | Fields | Events | Methods
Constructor
objectManager.Hint(collection)
Parameters:
Parameter |
Default value |
Description |
— |
Type: IReadOnlyCollection Object layer. |
* Mandatory parameter/option.
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
Events
Name |
Description |
Closing the info object. Names of fields available via Event.get:
Inherited from IPopupManager. |
|
Opening the info object. Names of fields available via Event.get:
Inherited from IPopupManager. |
Methods
Name |
Returns |
Description |
Hides the popup hint. |
||
destroy() |
Disables the info object manager. Inherited from IPopupManager. |
|
getData() |
Object|null |
Returns hash describing the object the hint is shown on, or null if the hint was not shown. |
IOptionManager|null |
Returns the options manager or 'null'. Inherited from IPopupManager. |
|
Returns the promise object to return the overlay. Inherited from IPopupManager. |
||
IOverlay|null |
Returns the overlay, if one exists. Inherited from IPopupManager. |
|
Number[]|null |
Returns the coordinates of the info object or 'null'. Inherited from IPopupManager. |
|
Boolean |
A method that determines whether the popup hint was shown on the object with the passed ID. |
|
Displays the popup hint on the object with the passed ID. |
||
Sets new data for displaying the popup hint. |
||
Defines new options for the info object. Inherited from IPopupManager. |
||
Specifies a new position for the info object. Inherited from IPopupManager. |
Methods details
close
{vow.Promise} close([force])
Hides the popup hint.
Returns Promise object.
Parameters:
Parameter |
Default value |
Description |
false |
Type: Boolean Instant closure. |
Example:
// Closing all hints on a layer.
objectManager.objects.hint.close();
objectManager.clusters.hint.close();
getData
{Object|null} getData()
Returns hash describing the object the hint is shown on, or null if the hint was not shown.
Example:
var cluster = objectManager.clusters.hint.getData();
if (cluster) {
alert('Cluster displays a hint.');
}
isOpen
{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 |
|
— |
Type: Object Object ID. |
* Mandatory parameter/option.
Example:
// 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
{vow.Promise} open(objectId[, position])
Displays the popup hint on the object with the passed ID.
Returns Promise object.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object ID of the object to open the hint on. |
|
— |
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:
objectManager.clusters.hint.open(objectId);
setData
{vow.Promise} setData(objectData)
Sets new data for displaying the popup hint.
Returns Promise object.
Parameters:
Parameter |
Default value |
Description |
— |
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:
objectManager.objects.hint.setData(objectManager.objects.getById(objectId));
Mandatory parameter/option.