# Class: EventHandler

## vcs.vcm.interaction.EventHandler

### Members

#### eventEmitter{vcs.vcm.interaction.EventEmitter}

#### featureInteraction{vcs.vcm.interaction.FeatureAtPixelInteraction}

#### interactions{Array.<vcs.vcm.interaction.AbstractInteraction>}

  A copy of all the EventHandler interactions

#### positionInteraction{vcs.vcm.interaction.CoordinateAtPixel}

### Methods

#### vcs.vcm.interaction.EventHandler.getInstance(){vcs.vcm.interaction.EventHandler}

#### addExclusiveInteraction(interaction, removed, index, id){function}

  Add a dynamic interaction to the interaction chain. This is the default methodology for user map interactions, such as drawing or measuring. If another exclusive interaction is added, this interaction is removed and a provided callback is called. Use the id parameter to add multiple interactions from the same source (if you don't wish to provide an `vcs.vcm.interaction.InteractionChain`

  Name | Type | Default | Description
  --- | --- | --- | ---
  `interaction` | vcs.vcm.interaction.AbstractInteraction |  |
  `removed` | function |  | the callback for when the interaction is forcefully removed.
  `index` | number | 2 | the position at which to push the interaction
  `id` | string |  | an id to allow for multiple interactions to belong to the same exclusive registerer

  ##### Returns:

  function to remove the interaction with. returns number of removed interactions (0|1)

#### addPersistentInteraction(interaction, index){function}

  Adds an interaction permanently to the interaction chain. Only add non-interferring interactions in such a fashion (for instance for displaying the cursor position)

  Name | Type | Default | Description
  --- | --- | --- | ---
  `interaction` | vcs.vcm.interaction.AbstractInteraction |  |
  `index` | number | 2 | at what position this interaction should be added. By default, it is added after the featureInteraction

  ##### Returns:

  function to remove the interaction with. returns number of removed interactions (0|1)