Add ol.geom.Geometry#translate

This commit is contained in:
Éric Lemoine
2014-12-15 17:31:10 +01:00
parent 374f916b3a
commit 14ea2bf413
3 changed files with 44 additions and 0 deletions

View File

@@ -277,6 +277,22 @@ ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) {
};
/**
* Translate the geometry.
* @param {number} deltaX Delta X.
* @param {number} deltaY Delta Y.
* @api
*/
ol.geom.GeometryCollection.prototype.translate = function(deltaX, deltaY) {
var geometries = this.geometries_;
var i, ii;
for (i = 0, ii = geometries.length; i < ii; ++i) {
geometries[i].translate(deltaX, deltaY);
}
this.changed();
};
/**
* @inheritDoc
*/