Remove use of goog.style.getClientPosition

Use Element.getBoundingClientRect() instead.
This commit is contained in:
Frederic Junod
2016-02-24 10:30:57 +01:00
parent 68088341d6
commit edf2096b1b
6 changed files with 20 additions and 28 deletions

View File

@@ -53,12 +53,12 @@ describe('ol.interaction.Translate', function() {
function simulateEvent(type, x, y, opt_shiftKey) {
var viewport = map.getViewport();
// calculated in case body has top < 0 (test runner with small window)
var position = goog.style.getClientPosition(viewport);
var position = viewport.getBoundingClientRect();
var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
var event = new ol.MapBrowserPointerEvent(type, map,
new ol.pointer.PointerEvent(type, {
clientX: position.x + x + width / 2,
clientY: position.y + y + height / 2,
clientX: position.left + x + width / 2,
clientY: position.top + y + height / 2,
shiftKey: shiftKey
}));
map.handleMapBrowserEvent(event);
@@ -109,7 +109,6 @@ describe('ol.interaction.Translate', function() {
});
goog.require('goog.dispose');
goog.require('goog.style');
goog.require('ol.Collection');
goog.require('ol.Feature');
goog.require('ol.Map');