Give geometrues a centroid method.
This commit is contained in:
1 parent
e23b119059
commit
73e07df544
2 files changed
+10
-1
No files matched your search
@@ -128,6 +128,6 @@ ol.geom.Collection.prototype.remove = function(components){
|
||||
this.removeComponent(c);
|
||||
return true;
|
||||
}, this);
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -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();
|
||||
};
|
||||
Reference in new issue
Block a user