Arg order for extent function in expressions

This commit is contained in:
Tim Schaub
2013-09-03 17:42:33 -06:00
parent 6955499534
commit 208d86b5bf
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -129,22 +129,22 @@ ol.expr.lib[ol.expr.functions.CONCAT] = function(var_args) {
/** /**
* Determine if a feature's extent intersects the provided extent. * Determine if a feature's extent intersects the provided extent.
* @param {number} minX Minimum x-coordinate value. * @param {number} minX Minimum x-coordinate value.
* @param {number} maxX Maximum x-coordinate value.
* @param {number} minY Minimum y-coordinate value. * @param {number} minY Minimum y-coordinate value.
* @param {number} maxX Maximum x-coordinate value.
* @param {number} maxY Maximum y-coordinate value. * @param {number} maxY Maximum y-coordinate value.
* @param {string=} opt_projection Projection of the extent. * @param {string=} opt_projection Projection of the extent.
* @param {string=} opt_attribute Name of the geometry attribute to use. * @param {string=} opt_attribute Name of the geometry attribute to use.
* @return {boolean} The provided extent intersects the feature's extent. * @return {boolean} The provided extent intersects the feature's extent.
* @this {ol.Feature} * @this {ol.Feature}
*/ */
ol.expr.lib[ol.expr.functions.EXTENT] = function(minX, maxX, minY, maxY, ol.expr.lib[ol.expr.functions.EXTENT] = function(minX, minY, maxX, maxY,
opt_projection, opt_attribute) { opt_projection, opt_attribute) {
var intersects = false; var intersects = false;
var geometry = goog.isDef(opt_attribute) ? var geometry = goog.isDef(opt_attribute) ?
this.get(opt_attribute) : this.getGeometry(); this.get(opt_attribute) : this.getGeometry();
if (geometry) { if (geometry) {
intersects = ol.extent.intersects(geometry.getBounds(), intersects = ol.extent.intersects(geometry.getBounds(),
[minX, maxX, minY, maxY]); [[minX, minY], [maxX, maxY]]);
} }
return intersects; return intersects;
}; };
+4 -4
View File
@@ -688,10 +688,10 @@ describe('ol.expr.lib', function() {
]]) ]])
}); });
var north = parse('extent(-100, 100, 40, 60)'); var north = parse('extent(-100, 40, 100, 60)');
var south = parse('extent(-100, 100, -60, -40)'); var south = parse('extent(-100, -60, 100, -40)');
var east = parse('extent(80, 100, -50, 50)'); var east = parse('extent(80, -50, 100, 50)');
var west = parse('extent(-100, -80, -50, 50)'); var west = parse('extent(-100, -50, -80, 50)');
it('evaluates to true for features within given extent', function() { it('evaluates to true for features within given extent', function() {