Event
Extends IEvent.
Event. Provides methods for accessing the originalObject object's fields and methods, with the possibility for redefining them.
Constructor
Event(originalEvent[, sourceEvent])
Creates an event.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object Source data. |
|
— |
Type: IEvent Source event. |
* Mandatory parameter/option.
Methods
Name |
Returns |
Description |
Allows the propagation of the event to the map. Inherited from IEvent. |
||
Object |
Calls the specified method. The operation is equivalent to searching fields via "get" and making a call that passes originalEvent as context. All arguments after the first one are passed as parameters to the method being called. |
|
Object |
Returns the field value from originalEvent. originalEvent always has the following fields:
|
|
IEvent|null |
Returns source event. Inherited from IEvent. |
|
Boolean |
Checks whether the default reaction to the event is canceled in the Yandex Maps API event system. |
|
Boolean |
Checks whether event propagation is stopped in the Yandex Maps API event system. |
|
Boolean |
Returns true if the map event is enabled. Inherited from IEvent. |
|
Boolean |
Checks whether event propagation up the hierarchy of objects and collections is stopped in the Yandex Maps API event system. |
|
Cancels the default reaction to an event within the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. |
||
Stops event propagation in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. |
||
Stops event propagation up the hierarchy of objects and collections in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree. |
Methods details
callMethod
{Object} callMethod(name)
Calls the specified method. The operation is equivalent to searching fields via "get" and making a call that passes originalEvent as context. All arguments after the first one are passed as parameters to the method being called.
Returns value.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: String Method name. |
* Mandatory parameter/option.
get
{Object} get(name)
Returns the field value from originalEvent. originalEvent always has the following fields:
- type - String event type.
- target - Reference to the object that generated the event.
Parameters:
Parameter |
Default value |
Description |
|
— |
Type: String Property name. |
* Mandatory parameter/option.
Example:
// Synchronizing two objects with each other.
object1.events.add(["add", "remove"], function (event) {
object2[event.get("type")](event.get("child"));
});
isDefaultPrevented
{Boolean} isDefaultPrevented()
Checks whether the default reaction to the event is canceled in the Yandex Maps API event system.
Returns true if the default reaction to the event is canceled, otherwise false.
isImmediatePropagationStopped
{Boolean} isImmediatePropagationStopped()
Checks whether event propagation is stopped in the Yandex Maps API event system.
Returns true if propagation was stopped, or false if not.
isPropagationStopped
{Boolean} isPropagationStopped()
Checks whether event propagation up the hierarchy of objects and collections is stopped in the Yandex Maps API event system.
Returns true if propagation up the hierarchy is canceled; otherwise, false.
preventDefault
{} preventDefault()
Cancels the default reaction to an event within the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree.
stopImmediatePropagation
{} stopImmediatePropagation()
Stops event propagation in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree.
stopPropagation
{} stopPropagation()
Stops event propagation up the hierarchy of objects and collections in the Yandex Maps API event system. Calling this method does not affect propagation of the DOM source event (if there is one) through the DOM tree.
Mandatory parameter/option.