function simulateEvent(type, x, y, modifiers, button) {
    modifiers = modifiers || {};
    const viewport = map.getViewport();
    // calculated in case body has top < 0 (test runner with small window)
    const position = viewport.getBoundingClientRect();
    const pointerEvent = new Event();
    pointerEvent.type = type;
    pointerEvent.target = viewport.firstChild;
    pointerEvent.clientX = position.left + x + width / 2;
    pointerEvent.clientY = position.top + y + height / 2;
    pointerEvent.shiftKey = modifiers.shift || false;
    pointerEvent.altKey = modifiers.alt || false;
    pointerEvent.pointerId = 1;
    pointerEvent.preventDefault = function () {};
    pointerEvent.button = button;
    pointerEvent.isPrimary = true;
    const event = new MapBrowserEvent(type, map, pointerEvent);
    map.handleMapBrowserEvent(event);
  }
/**
   * Simulates a browser event on the map viewport.  The client x/y location
   * will be adjusted as if the map were centered at 0,0.
   * @param {string} type Event type.
   * @param {number} x Horizontal offset from map center.
   * @param {number} y Vertical offset from map center.
   * @param {Object} modifiers Lookup of modifier keys.
   * @param {number} button The mouse button.
   */
Simulates a browser event on the map viewport.  The client x/y location
will be adjusted as if the map were centered at 0,0.
@param {string} type Event type.
@param {number} x Horizontal offset from map center.
@param {number} y Vertical offset from map center.
@param {Object} modifiers Lookup of modifier keys.
@param {number} button The mouse button.
Simulates a browser event on the map viewport . The client x / y location will be adjusted as if the map were centered at 0 0 . @param { string } type Event type . @param { number } x Horizontal offset from map center . @param { number } y Vertical offset from map center . @param { Object } modifiers Lookup of modifier keys . @param { number } button The mouse button .
function simulateEvent(type, x, y, modifiers, button) {
    modifiers = modifiers || {};
    const viewport = map.getViewport();
    const position = viewport.getBoundingClientRect();
    const pointerEvent = new Event();
    pointerEvent.type = type;
    pointerEvent.target = viewport.firstChild;
    pointerEvent.clientX = position.left + x + width / 2;
    pointerEvent.clientY = position.top + y + height / 2;
    pointerEvent.shiftKey = modifiers.shift || false;
    pointerEvent.altKey = modifiers.alt || false;
    pointerEvent.pointerId = 1;
    pointerEvent.preventDefault = function () {};
    pointerEvent.button = button;
    pointerEvent.isPrimary = true;
    const event = new MapBrowserEvent(type, map, pointerEvent);
    map.handleMapBrowserEvent(event);
  }
function simulateEvent ( type , x , y , modifiers , button ) { modifiers = modifiers || { } ; const viewport = map . getViewport ( ) ; const position = viewport . getBoundingClientRect ( ) ; const pointerEvent = new Event ( ) ; pointerEvent . type = type ; pointerEvent . target = viewport . firstChild ; pointerEvent . clientX = position . left + x + width / 2 ; pointerEvent . clientY = position . top + y + height / 2 ; pointerEvent . shiftKey = modifiers . shift || false ; pointerEvent . altKey = modifiers . alt || false ; pointerEvent . pointerId = 1 ; pointerEvent . preventDefault = function ( ) { } ; pointerEvent . button = button ; pointerEvent . isPrimary = true ; const event = new MapBrowserEvent ( type , map , pointerEvent ) ; map . handleMapBrowserEvent ( event ) ; }
Simulates a browser event on the map viewport.
Simulates a browser event on the map viewport .
// calculated in case body has top < 0 (test runner with small window)