Add ol.geom.MultiPoint#getPoints
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
@exportSymbol ol.geom.MultiPoint
|
@exportSymbol ol.geom.MultiPoint
|
||||||
@exportProperty ol.geom.MultiPoint.prototype.getCoordinates
|
@exportProperty ol.geom.MultiPoint.prototype.getCoordinates
|
||||||
|
@exportProperty ol.geom.MultiPoint.prototype.getPoints
|
||||||
@exportProperty ol.geom.MultiPoint.prototype.getType
|
@exportProperty ol.geom.MultiPoint.prototype.getType
|
||||||
@exportProperty ol.geom.MultiPoint.prototype.setCoordinates
|
@exportProperty ol.geom.MultiPoint.prototype.setCoordinates
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
goog.provide('ol.geom.MultiPoint');
|
goog.provide('ol.geom.MultiPoint');
|
||||||
|
|
||||||
goog.require('ol.geom.Geometry');
|
goog.require('ol.geom.Geometry');
|
||||||
|
goog.require('ol.geom.Point');
|
||||||
goog.require('ol.geom.flat');
|
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
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user