Add ol.geom.MultiPoint#getPoints
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user