diff --git a/src/api/geom/collection.js b/src/api/geom/collection.js index e8269676a9..9a93ead0c4 100644 --- a/src/api/geom/collection.js +++ b/src/api/geom/collection.js @@ -128,6 +128,6 @@ ol.geom.Collection.prototype.remove = function(components){ this.removeComponent(c); return true; }, this); - + return this; }; diff --git a/src/api/geom/geometry.js b/src/api/geom/geometry.js index 3e12f9f0e7..5d8b9d09b9 100644 --- a/src/api/geom/geometry.js +++ b/src/api/geom/geometry.js @@ -24,3 +24,12 @@ ol.geom.Geometry.prototype.bounds = function(opt_arg) { return this.getBounds(); } }; + +/** + * Returns the centroid of the geometry. + * + * @returns {ol.geom.Point} The centroid of the geometry. + */ +ol.geom.Geometry.prototype.centroid = function() { + return this.getCentroid(); +}; \ No newline at end of file