Change the inhertance of MultiPoint/multipoint.

This commit is contained in:
Marc Jansen
2012-06-21 15:55:37 +02:00
parent 0374d1abc7
commit 745ae25b6b
2 changed files with 16 additions and 28 deletions

View File

@@ -1,27 +1,21 @@
goog.provide('ol.geom.MultiPoint');
goog.require('goog.array');
goog.require('ol.geom.Geometry');
goog.require('ol.Projection');
goog.require('ol.geom.Collection');
/**
* Creates ol.geom.MultiPoint objects.
*
* @extends {ol.geom.Geometry}
* @extends {ol.geom.Collection}
* @param {Array.<ol.geom.Point>} points An array of points.
*
* @constructor
*/
ol.geom.MultiPoint = function(points) {
/**
* @private
* @type {Array.<ol.geom.Point>}
*/
this.points_ = points;
this.setComponents(points);
};
goog.inherits(ol.geom.MultiPoint, ol.geom.Geometry);
goog.inherits(ol.geom.MultiPoint, ol.geom.Collection);
/**
* Sets the MultiPoint's points.
@@ -29,7 +23,7 @@ goog.inherits(ol.geom.MultiPoint, ol.geom.Geometry);
* @return {Array.<ol.geom.Point>} An array of points.
*/
ol.geom.MultiPoint.prototype.getPoints = function() {
return this.points_;
return this.getComponents();
};
/**
@@ -38,7 +32,7 @@ ol.geom.MultiPoint.prototype.getPoints = function() {
* @param {Array.<ol.geom.Point>} points An array of points.
*/
ol.geom.MultiPoint.prototype.setPoints = function(points) {
this.points_ = points;
this.setComponents(points);
};
/**
@@ -48,7 +42,7 @@ ol.geom.MultiPoint.prototype.setPoints = function(points) {
* @param {number} index The index where to add.
*/
ol.geom.MultiPoint.prototype.addPoint = function(point, index) {
goog.array.insertAt(this.points_,point,index);
this.addComponent(point, index);
};
/**
@@ -57,5 +51,5 @@ ol.geom.MultiPoint.prototype.addPoint = function(point, index) {
* @param {ol.geom.Point} point A point to be removed.
*/
ol.geom.MultiPoint.prototype.removePoint = function(point) {
goog.array.remove(this.points_, point);
this.removeComponent(point);
};