Get rid of MapBrowserPointerEvent
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import DragRotateAndZoom from '../../../../src/ol/interaction/DragRotateAndZoom.js';
|
||||
import Event from '../../../../src/ol/events/Event.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
|
||||
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
@@ -58,12 +58,7 @@ describe('ol.interaction.DragRotateAndZoom', function () {
|
||||
pointerEvent.clientX = 20;
|
||||
pointerEvent.clientY = 10;
|
||||
pointerEvent.pointerType = 'mouse';
|
||||
let event = new MapBrowserPointerEvent(
|
||||
'pointermove',
|
||||
map,
|
||||
pointerEvent,
|
||||
true
|
||||
);
|
||||
let event = new MapBrowserEvent('pointermove', map, pointerEvent, true);
|
||||
interaction.lastAngle_ = Math.PI;
|
||||
|
||||
let callCount = 0;
|
||||
@@ -93,12 +88,7 @@ describe('ol.interaction.DragRotateAndZoom', function () {
|
||||
pointerEvent.clientX = 24;
|
||||
pointerEvent.clientY = 16;
|
||||
pointerEvent.pointerType = 'mouse';
|
||||
event = new MapBrowserPointerEvent(
|
||||
'pointermove',
|
||||
map,
|
||||
pointerEvent,
|
||||
true
|
||||
);
|
||||
event = new MapBrowserEvent('pointermove', map, pointerEvent, true);
|
||||
|
||||
interaction.handleDragEvent(event);
|
||||
expect(callCount).to.be(0);
|
||||
|
||||
@@ -7,7 +7,7 @@ import Feature from '../../../../src/ol/Feature.js';
|
||||
import Interaction from '../../../../src/ol/interaction/Interaction.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
|
||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||
@@ -75,7 +75,7 @@ describe('ol.interaction.Draw', function () {
|
||||
* @param {number} x Horizontal offset from map center.
|
||||
* @param {number} y Vertical offset from map center.
|
||||
* @param {boolean=} opt_shiftKey Shift key is pressed.
|
||||
* @return {module:ol/MapBrowserPointerEvent} The simulated event.
|
||||
* @return {module:ol/MapBrowserEvent} The simulated event.
|
||||
*/
|
||||
function simulateEvent(type, x, y, opt_shiftKey) {
|
||||
const viewport = map.getViewport();
|
||||
@@ -91,7 +91,7 @@ describe('ol.interaction.Draw', function () {
|
||||
event.preventDefault = function () {};
|
||||
event.pointerType = 'mouse';
|
||||
event.pointerId = 0;
|
||||
const simulatedEvent = new MapBrowserPointerEvent(type, map, event);
|
||||
const simulatedEvent = new MapBrowserEvent(type, map, event);
|
||||
map.handleMapBrowserEvent(simulatedEvent);
|
||||
return simulatedEvent;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ExtentInteraction from '../../../../src/ol/interaction/Extent.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
|
||||
describe('ol.interaction.Extent', function () {
|
||||
@@ -58,8 +58,8 @@ describe('ol.interaction.Extent', function () {
|
||||
pointerEvent.shiftKey = shiftKey;
|
||||
pointerEvent.pointerId = 0;
|
||||
pointerEvent.preventDefault = function () {};
|
||||
const event = new MapBrowserPointerEvent(type, map, pointerEvent);
|
||||
event.pointerEvent.pointerId = 1;
|
||||
const event = new MapBrowserEvent(type, map, pointerEvent);
|
||||
event.originalEvent.pointerId = 1;
|
||||
map.handleMapBrowserEvent(event);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import Event from '../../../../src/ol/events/Event.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
|
||||
import Modify, {ModifyEvent} from '../../../../src/ol/interaction/Modify.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||
@@ -102,7 +102,7 @@ describe('ol.interaction.Modify', function () {
|
||||
pointerEvent.preventDefault = function () {};
|
||||
pointerEvent.button = button;
|
||||
pointerEvent.isPrimary = true;
|
||||
const event = new MapBrowserPointerEvent(type, map, pointerEvent);
|
||||
const event = new MapBrowserEvent(type, map, pointerEvent);
|
||||
map.handleMapBrowserEvent(event);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Event from '../../../../src/ol/events/Event.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
|
||||
import PointerInteraction from '../../../../src/ol/interaction/Pointer.js';
|
||||
|
||||
describe('ol.interaction.Pointer', function () {
|
||||
@@ -16,7 +16,7 @@ describe('ol.interaction.Pointer', function () {
|
||||
pointerEvent.preventDefault = function () {
|
||||
defaultPrevented = true;
|
||||
};
|
||||
event = new MapBrowserPointerEvent(type, new Map(), pointerEvent);
|
||||
event = new MapBrowserEvent(type, new Map(), pointerEvent);
|
||||
defaultPrevented = false;
|
||||
});
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import Collection from '../../../../src/ol/Collection.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Interaction from '../../../../src/ol/interaction/Interaction.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
|
||||
import MapBrowserEventType from '../../../../src/ol/MapBrowserEventType.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||
import Select from '../../../../src/ol/interaction/Select.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
@@ -106,7 +106,7 @@ describe('ol.interaction.Select', function () {
|
||||
clientY: position.top + y + height / 2,
|
||||
shiftKey: shiftKey,
|
||||
};
|
||||
map.handleMapBrowserEvent(new MapBrowserPointerEvent(type, map, event));
|
||||
map.handleMapBrowserEvent(new MapBrowserEvent(type, map, event));
|
||||
}
|
||||
|
||||
describe('constructor', function () {
|
||||
|
||||
@@ -2,7 +2,7 @@ import Collection from '../../../../src/ol/Collection.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Interaction from '../../../../src/ol/interaction/Interaction.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
|
||||
import MapBrowserEvent from '../../../../src/ol/MapBrowserEvent.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import Translate, {
|
||||
TranslateEvent,
|
||||
@@ -69,7 +69,7 @@ describe('ol.interaction.Translate', 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 MapBrowserPointerEvent(type, map, {
|
||||
const event = new MapBrowserEvent(type, map, {
|
||||
type: type,
|
||||
target: viewport.firstChild,
|
||||
pointerId: 0,
|
||||
|
||||
Reference in New Issue
Block a user