Add ol.geom.MultiPolygon#getInteriorPoints

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

View File

@@ -2,6 +2,7 @@
@exportProperty ol.geom.MultiPolygon.prototype.clone
@exportProperty ol.geom.MultiPolygon.prototype.getArea
@exportProperty ol.geom.MultiPolygon.prototype.getCoordinates
@exportProperty ol.geom.MultiPolygon.prototype.getInteriorPoints
@exportProperty ol.geom.MultiPolygon.prototype.getPolygons
@exportProperty ol.geom.MultiPolygon.prototype.getType
@exportProperty ol.geom.MultiPolygon.prototype.setCoordinates

View File

@@ -4,6 +4,7 @@ goog.require('goog.array');
goog.require('goog.asserts');
goog.require('ol.extent');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.Polygon');
goog.require('ol.geom.SimpleGeometry');
goog.require('ol.geom.closest');
@@ -155,6 +156,17 @@ ol.geom.MultiPolygon.prototype.getFlatInteriorPoints = function() {
};
/**
* @return {ol.geom.MultiPoint} Interior points.
*/
ol.geom.MultiPolygon.prototype.getInteriorPoints = function() {
var interiorPoints = new ol.geom.MultiPoint(null);
interiorPoints.setFlatCoordinates(ol.geom.GeometryLayout.XY,
this.getFlatInteriorPoints().slice());
return interiorPoints;
};
/**
* @return {Array.<number>} Oriented flat coordinates.
*/