From 8730fc8824c74e5e5bdfbf79b4e923e92b788dd6 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 13 Aug 2015 09:14:53 +0200 Subject: [PATCH] Remove goog.style.getRelativePosition workaround Fixed upstream with https://github.com/google/closure-library/pull/424 --- src/ol/map.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/ol/map.js b/src/ol/map.js index baaec878db..bdad825bcc 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -692,22 +692,8 @@ ol.Map.prototype.getEventCoordinate = function(event) { * @api stable */ ol.Map.prototype.getEventPixel = function(event) { - // goog.style.getRelativePosition is based on event.targetTouches, - // but touchend and touchcancel events have no targetTouches when - // the last finger is removed from the screen. - // So we ourselves compute the position of touch events. - // See https://github.com/google/closure-library/pull/323 - if (goog.isDef(event.changedTouches)) { - var touch = event.changedTouches[0]; - var viewportPosition = goog.style.getClientPosition(this.viewport_); - return [ - touch.clientX - viewportPosition.x, - touch.clientY - viewportPosition.y - ]; - } else { - var eventPosition = goog.style.getRelativePosition(event, this.viewport_); - return [eventPosition.x, eventPosition.y]; - } + var eventPosition = goog.style.getRelativePosition(event, this.viewport_); + return [eventPosition.x, eventPosition.y]; };