Pixels increase right and down.

This commit is contained in:
Tim Schaub
2012-06-23 02:00:28 +02:00
parent b6cfeecdfb
commit ef0fd8da60

View File

@@ -409,10 +409,10 @@ ol.Map.prototype.getEvents = function() {
* @param {number} dy pixels to move in x direction
*/
ol.Map.prototype.moveByPx = function(dx, dy) {
if (goog.isDef(this.zoom_)) {
if (!goog.isNull(this.center_) && goog.isDef(this.zoom_)) {
var resolution = this.getResolutionForZoom(this.zoom_),
center = new ol.Loc(
this.center_.getX() + dx * resolution,
this.center_.getX() - dx * resolution,
this.center_.getY() + dy * resolution
);
this.setCenter(center);