Add new ol.geom.Geometry#rotate function
This commit is contained in:
@@ -260,6 +260,22 @@ ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
ol.geom.SimpleGeometry.prototype.rotate = function(angle, anchor) {
|
||||
var flatCoordinates = this.getFlatCoordinates();
|
||||
if (flatCoordinates) {
|
||||
var stride = this.getStride();
|
||||
ol.geom.flat.transform.rotate(
|
||||
flatCoordinates, 0, flatCoordinates.length,
|
||||
stride, angle, anchor, flatCoordinates);
|
||||
this.changed();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api stable
|
||||
|
||||
Reference in New Issue
Block a user