Renaming the 'evaluate' method to 'applies'
This commit is contained in:
@@ -32,6 +32,6 @@ ol.filter.Extent.prototype.getExtent = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.filter.Extent.prototype.evaluate = function(feature) {
|
||||
ol.filter.Extent.prototype.applies = function(feature) {
|
||||
return feature.getGeometry().getBounds().intersects(this.extent_);
|
||||
};
|
||||
|
||||
@@ -14,4 +14,4 @@ ol.filter.Filter = function() {};
|
||||
* @param {ol.Feature} feature Feature to evaluate.
|
||||
* @return {boolean} The provided feature passes this filter.
|
||||
*/
|
||||
ol.filter.Filter.prototype.evaluate = function(feature) {};
|
||||
ol.filter.Filter.prototype.applies = function(feature) {};
|
||||
|
||||
@@ -25,7 +25,7 @@ ol.filter.Geometry = function(type) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.filter.Geometry.prototype.evaluate = function(feature) {
|
||||
ol.filter.Geometry.prototype.applies = function(feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
return goog.isNull(geometry) ? false : geometry.getType() === this.type_;
|
||||
};
|
||||
|
||||
@@ -30,14 +30,14 @@ ol.filter.Logical = function(filters, operator) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.filter.Logical.prototype.evaluate = function(feature) {
|
||||
ol.filter.Logical.prototype.applies = function(feature) {
|
||||
var filters = this.filters_,
|
||||
i = 0, ii = filters.length,
|
||||
operator = this.operator,
|
||||
start = operator(true, false),
|
||||
result = start;
|
||||
while (result === start && i < ii) {
|
||||
result = operator(result, filters[i].evaluate(feature));
|
||||
result = operator(result, filters[i].applies(feature));
|
||||
++i;
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -128,7 +128,7 @@ ol.source.FeatureCache.prototype.getFeaturesObject_ = function(opt_filter) {
|
||||
features = {};
|
||||
for (i in candidates) {
|
||||
feature = candidates[i];
|
||||
if (opt_filter.evaluate(feature) === true) {
|
||||
if (opt_filter.applies(feature) === true) {
|
||||
features[i] = feature;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user