code: function (event, type) {
          if (!this.getMap()) {
              return;
          }
          const eventType = type || this._getEventTypeToFire(event);
          if (eventType === 'contextmenu' && this.listens('contextmenu')) {
              stopPropagation(event);
              preventDefault(event);
          }
          const params = this._getEventParams(event);
          this._fireEvent(eventType, params);
      }
docs: The event handler for all the events.
  @param  {Event} event - dom event
  @private