Add ol.View2D#rotate
This commit is contained in:
committed by
Frederic Junod
parent
00bc424098
commit
e03054f17f
@@ -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.
|
* Set the center of the current view.
|
||||||
* @param {ol.Coordinate|undefined} center Center.
|
* @param {ol.Coordinate|undefined} center Center.
|
||||||
|
|||||||
Reference in New Issue
Block a user