Add ol.geom.LineString#getLength

This commit is contained in:
Tom Payne
2013-11-26 18:58:19 +01:00
parent 321837f157
commit 3f49a4ce73

View File

@@ -27,6 +27,15 @@ ol.geom.LineString.prototype.getCoordinates = function() {
};
/**
* @return {number} Length.
*/
ol.geom.LineString.prototype.getLength = function() {
return ol.geom.flat.lineStringLength(
this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
};
/**
* @inheritDoc
*/