Give geometrues a centroid method.
This commit is contained in:
@@ -128,6 +128,6 @@ ol.geom.Collection.prototype.remove = function(components){
|
|||||||
this.removeComponent(c);
|
this.removeComponent(c);
|
||||||
return true;
|
return true;
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,3 +24,12 @@ ol.geom.Geometry.prototype.bounds = function(opt_arg) {
|
|||||||
return this.getBounds();
|
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