IDomEvent

Extends IEvent.

The DOM event object in the Yandex Maps API system. Wraps the browser's source DOM event in order to normalize the data field names. This means you can use the "get" and "callMethod" methods to access the fields and methods of the source DOM event. In addition, standardization occurs automatically for those fields and methods that are implemented differently in different browsers. So event.callMethod('stopPropagation') stops propagation of the DOM event in all browsers, including Internet Explorer.

Constructor | Methods

Constructor

IDomEvent(originalEvent)

Parameters:

Parameter

Default value

Description

originalEvent*

—

Type: Object

Source DOM event.

* Mandatory parameter/option.

Methods

Name

Returns

Description

allowMapEvent()

Allows the propagation of the event to the map.

Inherited from IEvent.

callMethod(name)

Calls the specified method from the source event. The second and following arguments are passed to the method with the call.

Inherited from IEvent.

get(name)

Object

Returns the specified event property. Using this method, you can get access both to the properties of the source event and to additional properties provided by the Yandex Maps API.

getSourceEvent()

IDomEvent

Returns source DOM event.

isDefaultPrevented()

Boolean

Returns true if the default reaction to the event has been canceled.

Inherited from IEvent.

isImmediatePropagationStopped()

Boolean

Returns true if the event processing has been interrupted.

Inherited from IEvent.

isMapEventAllowed()

Boolean

Returns true if the map event is enabled.

Inherited from IEvent.

isPropagationStopped()

Boolean

Returns true if event propagation has been interrupted.

Inherited from IEvent.

preventDefault()

Cancels the default reaction to an event within the Yandex Maps API event system. Calling this method does not affect how the browser processes the default action for the source DOM event.

stopImmediatePropagation()

Stops event processing in the Yandex Maps API event system. I.e. after calling this method, no handler for this event will be called. Calling this method does not affect the processing of the original DOM-event at the browser level.

stopPropagation()

Stops propagation of the DOM event in the Yandex Maps API event system. Calling this method does not affect propagation of the source DOM event through the DOM tree.

Methods details

get

{Object} get(name)

Returns the specified event property. Using this method, you can get access both to the properties of the source event and to additional properties provided by the Yandex Maps API.

Returns property value.

Parameters:

Parameter

Default value

Description

name*

—

Type: String

Property name. Additional properties are supported:

  • 'propagatedData' - Event data that is saved during event propagation through the DOM tree.
  • 'position' - An optional field that contains the coordinates of the event, relative to the document.

* Mandatory parameter/option.

getSourceEvent

{IDomEvent} getSourceEvent()

Returns source DOM event.

preventDefault

{} preventDefault()

Cancels the default reaction to an event within the Yandex Maps API event system. Calling this method does not affect how the browser processes the default action for the source DOM event.

stopImmediatePropagation

{} stopImmediatePropagation()

Stops event processing in the Yandex Maps API event system. I.e. after calling this method, no handler for this event will be called. Calling this method does not affect the processing of the original DOM-event at the browser level.

stopPropagation

{} stopPropagation()

Stops propagation of the DOM event in the Yandex Maps API event system. Calling this method does not affect propagation of the source DOM event through the DOM tree.