Use getEventPixel in ol.MapBrowserEvent
This commit is contained in:
@@ -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_;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user