Interface: AnnotationsPressEvent


This event is emitted whenever an annotation is either clicked or touched (on devices with touch capabilities) as well as when an already selected annotation receives a click or touch event.

Use this event to add custom behavior or prevent default ones from happening on press.

Please note that this event will not be fired for annotations which are not editable. If you still want to detect clicks for such annotations, for example, to show a focus ring when clicked, you can use custom renderers to made a clickable area above each annotation. This method is described fully in our Knowledge Base.


Prevent click and touch events on selected annotations

instance.addEventListener("", (event) => {
  if (event.selected) {



annotation: AnnotationsUnion

The annotation that was pressed. Remember that annotations are


nativeEvent: Event

The browser event which caused the press event to dispatch. This is either a MouseEvent, TouchEvent, or a PointerEvent.

  • Event

preventDefault: function

When invoked, the preventDefault method prevents the default press actions associated with the annotation to occur.

  • function

selected: boolean

Tells whether the pressed annotation is selected or not.

  • boolean