Give geometrues a centroid method.

This commit is contained in:
Marc Jansen
2012-06-22 16:24:01 +02:00
parent e23b119059
commit 73e07df544
2 changed files with 10 additions and 1 deletions

View File

@@ -128,6 +128,6 @@ ol.geom.Collection.prototype.remove = function(components){
this.removeComponent(c);
return true;
}, this);
return this;
};

View File

@@ -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();
};