fix ol.geom.geometry api tests

This commit is contained in:
Éric Lemoine
2012-06-22 13:11:29 +02:00
parent 8d36dfe475
commit e78b990f52
3 changed files with 27 additions and 18 deletions

View File

@@ -10,3 +10,17 @@ ol.geom.geometry = function(){
var g = new ol.geom.Geometry(); var g = new ol.geom.Geometry();
return g; return g;
}; };
/**
* @export
* @param {ol.Bounds=} opt_arg new Bounds.
* @return {ol.geom.Geometry|ol.Bounds|undefined} either a Geometry (when used as
* setter) or a Bounds/undefined (if used as getter).
*/
ol.geom.Geometry.prototype.bounds = function(opt_arg) {
if (arguments.length == 1 && goog.isDef(opt_arg)) {
return this.setBounds(opt_arg);
} else {
return this.getBounds();
}
};

View File

@@ -47,6 +47,19 @@ goog.exportProperty(ol.Feature.prototype, 'set', ol.Feature.prototype.set);
goog.exportProperty(ol.Feature.prototype, 'get', ol.Feature.prototype.get); goog.exportProperty(ol.Feature.prototype, 'get', ol.Feature.prototype.get);
goog.exportProperty(ol.Feature.prototype, 'geometry', ol.Feature.prototype.geometry); goog.exportProperty(ol.Feature.prototype, 'geometry', ol.Feature.prototype.geometry);
// ol.geometry
goog.exportSymbol('ol.geom.geometry', ol.geom.geometry);
goog.exportSymbol('ol.geom.Geometry', ol.geom.Geometry);
goog.exportProperty(ol.geom.Geometry.prototype, 'bounds', ol.geom.Geometry.prototype.bounds);
// ol.geom.collection
goog.exportSymbol('ol.geom.collection', ol.geom.collection);
goog.exportSymbol('ol.geom.Collection', ol.geom.Collection);
goog.exportProperty(ol.geom.Collection.prototype, 'components', ol.geom.Collection.prototype.components);
goog.exportProperty(ol.geom.Collection.prototype, 'add', ol.geom.Collection.prototype.add);
goog.exportProperty(ol.geom.Collection.prototype, 'addAll', ol.geom.Collection.prototype.addAll);
goog.exportProperty(ol.geom.Collection.prototype, 'remove', ol.geom.Collection.prototype.remove);
// ol.geom.point // ol.geom.point
goog.exportSymbol('ol.geom.point', ol.geom.point); goog.exportSymbol('ol.geom.point', ol.geom.point);
goog.exportSymbol('ol.geom.Point', ol.geom.Point); goog.exportSymbol('ol.geom.Point', ol.geom.Point);

View File

@@ -17,10 +17,6 @@ ol.geom.Geometry = function() {
this.bounds_ = undefined; this.bounds_ = undefined;
}; };
/** /**
* @return {ol.Bounds|undefined} The ol.Bounds. * @return {ol.Bounds|undefined} The ol.Bounds.
*/ */
@@ -36,17 +32,3 @@ ol.geom.Geometry.prototype.setBounds = function(bounds) {
this.bounds_ = bounds; this.bounds_ = bounds;
return this; return this;
}; };
/**
* @export
* @param {ol.Bounds=} opt_arg new Bounds.
* @return {ol.geom.Geometry|ol.Bounds|undefined} either a Geometry (when used as
* setter) or a Bounds/undefined (if used as getter).
*/
ol.geom.Geometry.prototype.bounds = function(opt_arg){
if (arguments.length == 1 && goog.isDef(opt_arg)) {
return this.setBounds(opt_arg);
} else {
return this.getBounds();
}
};