Use pepjs instead of our own pointerevent polyfill
This commit is contained in:
@@ -2,7 +2,7 @@ import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import ExtentInteraction from '../../../../src/ol/interaction/Extent.js';
|
||||
import PointerEvent from '../../../../src/ol/pointer/PointerEvent.js';
|
||||
import Event from '../../../../src/ol/events/Event.js';
|
||||
|
||||
describe('ol.interaction.Extent', function() {
|
||||
let map, interaction;
|
||||
@@ -50,14 +50,14 @@ describe('ol.interaction.Extent', function() {
|
||||
// calculated in case body has top < 0 (test runner with small window)
|
||||
const position = viewport.getBoundingClientRect();
|
||||
const shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
|
||||
const pointerEvent = new PointerEvent(type, {
|
||||
type: type,
|
||||
button: button,
|
||||
clientX: position.left + x + width / 2,
|
||||
clientY: position.top - y + height / 2,
|
||||
shiftKey: shiftKey,
|
||||
preventDefault: function() {}
|
||||
});
|
||||
const pointerEvent = new Event();
|
||||
pointerEvent.type = type;
|
||||
pointerEvent.button = button;
|
||||
pointerEvent.clientX = position.left + x + width / 2;
|
||||
pointerEvent.clientY = position.top - y + height / 2;
|
||||
pointerEvent.shiftKey = shiftKey;
|
||||
pointerEvent.pointerId = 0;
|
||||
pointerEvent.preventDefault = function() {};
|
||||
const event = new MapBrowserPointerEvent(type, map, pointerEvent);
|
||||
event.pointerEvent.pointerId = 1;
|
||||
map.handleMapBrowserEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user