Add new ol.geom.Geometry#rotate function

This commit is contained in:
Frederic Junod
2016-03-07 15:27:55 +01:00
parent 6c74e90c5d
commit d5564a04db
5 changed files with 117 additions and 0 deletions

View File

@@ -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