Add ol.geom.LinearRing#getArea
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
@exportSymbol ol.geom.LinearRing
|
@exportSymbol ol.geom.LinearRing
|
||||||
|
@exportProperty ol.geom.LinearRing.prototype.getArea
|
||||||
@exportProperty ol.geom.LinearRing.prototype.getCoordinates
|
@exportProperty ol.geom.LinearRing.prototype.getCoordinates
|
||||||
@exportProperty ol.geom.LinearRing.prototype.getType
|
@exportProperty ol.geom.LinearRing.prototype.getType
|
||||||
@exportProperty ol.geom.LinearRing.prototype.setCoordinates
|
@exportProperty ol.geom.LinearRing.prototype.setCoordinates
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ ol.geom.LinearRing = function(coordinates, opt_layout) {
|
|||||||
goog.inherits(ol.geom.LinearRing, ol.geom.Geometry);
|
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.
|
* @return {ol.geom.RawLinearRing} Coordinates.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user