Add ol.geom.MultiPoint#getPoints

This commit is contained in:
Tom Payne
2013-12-01 17:15:12 +01:00
parent 3f49a4ce73
commit 984cac3832
2 changed files with 17 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
goog.provide('ol.geom.MultiPoint');
goog.require('ol.geom.Geometry');
goog.require('ol.geom.Point');
goog.require('ol.geom.flat');
@@ -27,6 +28,21 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() {
};
/**
* @return {Array.<ol.geom.Point>} Points.
*/
ol.geom.MultiPoint.prototype.getPoints = function() {
// FIXME we should construct the points from the flat coordinates
var coordinates = this.getCoordinates();
var points = [];
var i, ii;
for (i = 0, ii = coordinates.length; i < ii; ++i) {
points.push(new ol.geom.Point(coordinates[i]));
}
return points;
};
/**
* @inheritDoc
*/