---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.2
alternate:
  - https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/event.Mapper.md
  - https://yandex.ru/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/event.Mapper.md
  - href: https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/event.Mapper.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.ru/dev/jsapi-v2-1/doc/en/llms.txt?revision=r21950234
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/jsapi-v2-1/doc/en/llms.txt?revision=r21950234

# event.Mapper

Extends [IEventTrigger](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventTrigger.md).

Event mapper. Allows managing propagation of events along the hierarchy of event managers.

[Constructor](#constructor-summary) | [Methods](#methods-summary)

## Constructor {#constructor-summary}

```javascript
event.Mapper(targetEventManager, mappingTable)
```

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`targetEventManager`](#param-targetEventManager)[*](*star) | — | Type: [IEventManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md)

The event manger that the mapper propagates initiated events to. ||
|| [`mappingTable`](#param-mappingTable)[*](*star) | — | Type: Object

Table of mapping rules. A hash where the keys are types of events and the values are the corresponding mapping functions, or Boolean values. A mapping function for a specific type of event receives an event instance that was initiated on the mapper, and must return the event instance for propagating further along the hierarchy, or null if propagation must be prohibited. The boolean values are interpreted as follows: 
- true - Events of this type are propagated through the hierarchy unchanged.
- false - Events of this type are not propagated through the hierarchy.
The "*" key is also available in the table for the default processing rule. ||
|#

\* Mandatory parameter/option.

**Example:**

```javascript
// Creating and setting up the event mapper that will transform the "click" event in the root
// geo object collection into a "geoobjectclick" event on the map itself.
var mapper = new ymaps.event.Mapper(myMap.events, {
    "*": false,
    "click": function (event) {
        return new ymaps.Event({
             type: "geoobjectclick",
             target: map,
             originalTarget: event.get("target")
        }, event);
    }
});

myMap.geoObjects.events.setParent(mapper);
```
## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [fire](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventTrigger.md#fire)([type](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventTrigger.md#fire-param-type)[, [eventObject](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventTrigger.md#fire-param-eventObject)]) | [IEventTrigger](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventTrigger.md)
| Triggers an event.

Inherited from [IEventTrigger](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventTrigger.md#fire). ||
|#

[*star]: Mandatory parameter/option.