Add ol.geom.LinearRing#getArea

This commit is contained in:
Tom Payne
2013-12-02 14:47:32 +01:00
parent 01c185ef57
commit 2c40daea22
2 changed files with 10 additions and 0 deletions

View File

@@ -18,6 +18,15 @@ ol.geom.LinearRing = function(coordinates, opt_layout) {
goog.inherits(ol.geom.LinearRing, ol.geom.Geometry);
/**
* @return {number} Area.
*/
ol.geom.LinearRing.prototype.getArea = function() {
return ol.geom.flat.linearRingArea(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
};
/**
* @return {ol.geom.RawLinearRing} Coordinates.
*/