Add ol.View2D#rotate

This commit is contained in:
Éric Lemoine
2014-02-27 10:15:59 +01:00
committed by Frederic Junod
parent 00bc424098
commit e03054f17f

View File

@@ -534,6 +534,18 @@ ol.View2D.prototype.isDef = function() {
};
/**
* Rotate the view around a given coordinate.
* @param {number} rotation New rotation value for the view.
* @param {ol.Coordinate} anchor The rotation center.
*/
ol.View2D.prototype.rotate = function(rotation, anchor) {
var center = this.calculateCenterRotate(rotation, anchor);
this.setRotation(rotation);
this.setCenter(center);
};
/**
* Set the center of the current view.
* @param {ol.Coordinate|undefined} center Center.