Add ol.geom.Polygon#getInteriorPoint

This commit is contained in:
Tom Payne
2014-02-28 16:10:01 +01:00
parent b47e6a6cf4
commit 0f884b5d03
2 changed files with 10 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ goog.provide('ol.geom.Polygon');
goog.require('ol.extent');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.LinearRing');
goog.require('ol.geom.Point');
goog.require('ol.geom.SimpleGeometry');
goog.require('ol.geom.closest');
goog.require('ol.geom.flat');
@@ -152,6 +153,14 @@ ol.geom.Polygon.prototype.getFlatInteriorPoint = function() {
};
/**
* @return {ol.geom.Point} Interior point.
*/
ol.geom.Polygon.prototype.getInteriorPoint = function() {
return new ol.geom.Point(this.getFlatInteriorPoint());
};
/**
* @return {Array.<ol.geom.LinearRing>} Linear rings.
* @todo stability experimental