Use pepjs instead of our own pointerevent polyfill
This commit is contained in:
@@ -15,7 +15,7 @@ import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||
import Draw, {createRegularPolygon, createBox} from '../../../../src/ol/interaction/Draw.js';
|
||||
import Interaction from '../../../../src/ol/interaction/Interaction.js';
|
||||
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
import PointerEvent from '../../../../src/ol/pointer/PointerEvent.js';
|
||||
import Event from '../../../../src/ol/events/Event.js';
|
||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
|
||||
|
||||
@@ -69,14 +69,14 @@ describe('ol.interaction.Draw', 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 event = new PointerEvent(type, {
|
||||
clientX: position.left + x + width / 2,
|
||||
clientY: position.top + y + height / 2,
|
||||
shiftKey: shiftKey,
|
||||
preventDefault: function() {}
|
||||
}, {
|
||||
pointerType: 'mouse'
|
||||
});
|
||||
const event = new Event();
|
||||
event.type = type;
|
||||
event.clientX = position.left + x + width / 2;
|
||||
event.clientY = position.top + y + height / 2;
|
||||
event.shiftKey = shiftKey;
|
||||
event.preventDefault = function() {};
|
||||
event.pointerType = 'mouse';
|
||||
event.pointerId = 0;
|
||||
const simulatedEvent = new MapBrowserPointerEvent(type, map, event);
|
||||
map.handleMapBrowserEvent(simulatedEvent);
|
||||
return simulatedEvent;
|
||||
|
||||
Reference in New Issue
Block a user