Export ol.View2D#rotate

This commit is contained in:
Éric Lemoine
2014-02-27 10:16:18 +01:00
committed by Frederic Junod
parent e03054f17f
commit 00917b7262
2 changed files with 7 additions and 4 deletions

View File

@@ -537,12 +537,14 @@ 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.
* @param {ol.Coordinate=} opt_anchor The rotation center.
*/
ol.View2D.prototype.rotate = function(rotation, anchor) {
var center = this.calculateCenterRotate(rotation, anchor);
ol.View2D.prototype.rotate = function(rotation, opt_anchor) {
if (goog.isDef(opt_anchor)) {
var center = this.calculateCenterRotate(rotation, opt_anchor);
this.setCenter(center);
}
this.setRotation(rotation);
this.setCenter(center);
};