Merge pull request #2429 from fredj/reuse-pixel-for-coord
Reuse event pixel to compute the coordinate
This commit is contained in:
@@ -45,18 +45,18 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_frameState) {
|
|||||||
*/
|
*/
|
||||||
this.originalEvent = browserEvent.getBrowserEvent();
|
this.originalEvent = browserEvent.getBrowserEvent();
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {ol.Coordinate}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
this.coordinate = map.getEventCoordinate(this.originalEvent);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.Pixel}
|
* @type {ol.Pixel}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.pixel = map.getEventPixel(this.originalEvent);
|
this.pixel = map.getEventPixel(this.originalEvent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {ol.Coordinate}
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
this.coordinate = map.getCoordinateFromPixel(this.pixel);
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.MapBrowserEvent, ol.MapEvent);
|
goog.inherits(ol.MapBrowserEvent, ol.MapEvent);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user