Add ol.geom.Polygon#getArea
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
@exportSymbol ol.geom.Polygon
|
@exportSymbol ol.geom.Polygon
|
||||||
|
@exportProperty ol.geom.Polygon.prototype.getArea
|
||||||
@exportProperty ol.geom.Polygon.prototype.getCoordinates
|
@exportProperty ol.geom.Polygon.prototype.getCoordinates
|
||||||
@exportProperty ol.geom.Polygon.prototype.getLinearRings
|
@exportProperty ol.geom.Polygon.prototype.getLinearRings
|
||||||
@exportProperty ol.geom.Polygon.prototype.getType
|
@exportProperty ol.geom.Polygon.prototype.getType
|
||||||
|
|||||||
@@ -49,6 +49,15 @@ ol.geom.Polygon.prototype.containsXY = function(x, y) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {number} Area.
|
||||||
|
*/
|
||||||
|
ol.geom.Polygon.prototype.getArea = function() {
|
||||||
|
return ol.geom.flat.linearRingsArea(
|
||||||
|
this.flatCoordinates, 0, this.ends_, this.stride);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {ol.geom.RawPolygon} Coordinates.
|
* @return {ol.geom.RawPolygon} Coordinates.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user