Pixels increase right and down.
This commit is contained in:
+2
-2
@@ -409,10 +409,10 @@ ol.Map.prototype.getEvents = function() {
|
|||||||
* @param {number} dy pixels to move in x direction
|
* @param {number} dy pixels to move in x direction
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.moveByPx = function(dx, dy) {
|
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_),
|
var resolution = this.getResolutionForZoom(this.zoom_),
|
||||||
center = new ol.Loc(
|
center = new ol.Loc(
|
||||||
this.center_.getX() + dx * resolution,
|
this.center_.getX() - dx * resolution,
|
||||||
this.center_.getY() + dy * resolution
|
this.center_.getY() + dy * resolution
|
||||||
);
|
);
|
||||||
this.setCenter(center);
|
this.setCenter(center);
|
||||||
|
|||||||
Reference in New Issue
Block a user