Use ol.Pixel to represent pixels

This commit is contained in:
Tom Payne
2012-07-29 12:13:10 +02:00
parent 10c85f3d07
commit faa37490ea
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ goog.provide('ol.MapBrowserEvent');
goog.require('goog.events.BrowserEvent');
goog.require('ol.Coordinate');
goog.require('ol.MapEvent');
goog.require('ol.Pixel');
@@ -41,7 +42,7 @@ ol.MapBrowserEvent.prototype.getCoordinate = function() {
return this.coordinate_;
} else {
var browserEvent = this.browserEvent;
var pixel = new ol.Coordinate(browserEvent.offsetX, browserEvent.offsetY);
var pixel = new ol.Pixel(browserEvent.offsetX, browserEvent.offsetY);
var coordinate = this.map.getCoordinateFromPixel(pixel);
this.coordinate_ = coordinate;
return coordinate;