From b2e345c407a4708444bb6e2003768378dc599b34 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 23 Jul 2014 16:53:56 +0200 Subject: [PATCH] Reuse event pixel to compute the coordinate --- src/ol/mapbrowserevent.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ol/mapbrowserevent.js b/src/ol/mapbrowserevent.js index 448d14ccd0..0e1cf914bd 100644 --- a/src/ol/mapbrowserevent.js +++ b/src/ol/mapbrowserevent.js @@ -45,18 +45,18 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_frameState) { */ this.originalEvent = browserEvent.getBrowserEvent(); - /** - * @type {ol.Coordinate} - * @api - */ - this.coordinate = map.getEventCoordinate(this.originalEvent); - /** * @type {ol.Pixel} * @api */ this.pixel = map.getEventPixel(this.originalEvent); + /** + * @type {ol.Coordinate} + * @api + */ + this.coordinate = map.getCoordinateFromPixel(this.pixel); + }; goog.inherits(ol.MapBrowserEvent, ol.MapEvent);