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

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.
* @param {number} minX Minimum x-coordinate value.
* @param {number} maxX Maximum x-coordinate value.
* @param {number} minY Minimum y-coordinate value.
* @param {number} maxX Maximum x-coordinate value.
* @param {number} maxY Maximum y-coordinate value.
* @param {string=} opt_projection Projection of the extent.
* @param {string=} opt_attribute Name of the geometry attribute to use.
* @return {boolean} The provided extent intersects the feature's extent.
* @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) {
var intersects = false;
var geometry = goog.isDef(opt_attribute) ?
this.get(opt_attribute) : this.getGeometry();
if (geometry) {
intersects = ol.extent.intersects(geometry.getBounds(),
[minX, maxX, minY, maxY]);
[[minX, minY], [maxX, maxY]]);
}
return intersects;
};

View File

@@ -688,10 +688,10 @@ describe('ol.expr.lib', function() {
]])
});
var north = parse('extent(-100, 100, 40, 60)');
var south = parse('extent(-100, 100, -60, -40)');
var east = parse('extent(80, 100, -50, 50)');
var west = parse('extent(-100, -80, -50, 50)');
var north = parse('extent(-100, 40, 100, 60)');
var south = parse('extent(-100, -60, 100, -40)');
var east = parse('extent(80, -50, 100, 50)');
var west = parse('extent(-100, -50, -80, 50)');
it('evaluates to true for features within given extent', function() {