Use getEventPixel in ol.MapBrowserEvent

This commit is contained in:
Éric Lemoine
2013-10-14 15:36:37 +02:00
parent 3aeb4d1584
commit 49e0af5abb
+1 -4
View File
@@ -7,7 +7,6 @@ goog.require('goog.events');
goog.require('goog.events.BrowserEvent'); goog.require('goog.events.BrowserEvent');
goog.require('goog.events.EventTarget'); goog.require('goog.events.EventTarget');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
goog.require('goog.style');
goog.require('ol.BrowserFeature'); goog.require('ol.BrowserFeature');
goog.require('ol.Coordinate'); goog.require('ol.Coordinate');
goog.require('ol.FrameState'); goog.require('ol.FrameState');
@@ -66,9 +65,7 @@ ol.MapBrowserEvent.prototype.getCoordinate = function() {
*/ */
ol.MapBrowserEvent.prototype.getPixel = function() { ol.MapBrowserEvent.prototype.getPixel = function() {
if (goog.isNull(this.pixel_)) { if (goog.isNull(this.pixel_)) {
var eventPosition = goog.style.getRelativePosition( this.pixel_ = this.map.getEventPixel(this.browserEvent.getBrowserEvent());
this.browserEvent, this.map.getViewport());
this.pixel_ = [eventPosition.x, eventPosition.y];
} }
return this.pixel_; return this.pixel_;
}; };