make filterMap_ static as proposed by @tschaub
This commit is contained in:
@@ -379,33 +379,38 @@ ol.parser.ogc.Filter_v1 = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.filterMap_ = {
|
|
||||||
'&&': 'And',
|
|
||||||
'||': 'Or',
|
|
||||||
'!': 'Not',
|
|
||||||
'==': 'PropertyIsEqualTo',
|
|
||||||
'!=': 'PropertyIsNotEqualTo',
|
|
||||||
'<': 'PropertyIsLessThan',
|
|
||||||
'>': 'PropertyIsGreaterThan',
|
|
||||||
'<=': 'PropertyIsLessThanOrEqualTo',
|
|
||||||
'>=': 'PropertyIsGreaterThanOrEqualTo',
|
|
||||||
'..': 'PropertyIsBetween',
|
|
||||||
'like': 'PropertyIsLike',
|
|
||||||
'null': 'PropertyIsNull',
|
|
||||||
'extent': 'BBOX',
|
|
||||||
'dwithin': 'DWITHIN',
|
|
||||||
'within': 'WITHIN',
|
|
||||||
'contains': 'CONTAINS',
|
|
||||||
'intersects': 'INTERSECTS',
|
|
||||||
'fid': '_featureIds',
|
|
||||||
'ieq': 'PropertyIsEqualTo',
|
|
||||||
'ineq': 'PropertyIsNotEqualTo'
|
|
||||||
};
|
|
||||||
goog.base(this);
|
goog.base(this);
|
||||||
};
|
};
|
||||||
goog.inherits(ol.parser.ogc.Filter_v1, ol.parser.XML);
|
goog.inherits(ol.parser.ogc.Filter_v1, ol.parser.XML);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
ol.parser.ogc.Filter_v1.filterMap_ = {
|
||||||
|
'&&': 'And',
|
||||||
|
'||': 'Or',
|
||||||
|
'!': 'Not',
|
||||||
|
'==': 'PropertyIsEqualTo',
|
||||||
|
'!=': 'PropertyIsNotEqualTo',
|
||||||
|
'<': 'PropertyIsLessThan',
|
||||||
|
'>': 'PropertyIsGreaterThan',
|
||||||
|
'<=': 'PropertyIsLessThanOrEqualTo',
|
||||||
|
'>=': 'PropertyIsGreaterThanOrEqualTo',
|
||||||
|
'..': 'PropertyIsBetween',
|
||||||
|
'like': 'PropertyIsLike',
|
||||||
|
'null': 'PropertyIsNull',
|
||||||
|
'extent': 'BBOX',
|
||||||
|
'dwithin': 'DWITHIN',
|
||||||
|
'within': 'WITHIN',
|
||||||
|
'contains': 'CONTAINS',
|
||||||
|
'intersects': 'INTERSECTS',
|
||||||
|
'fid': '_featureIds',
|
||||||
|
'ieq': 'PropertyIsEqualTo',
|
||||||
|
'ineq': 'PropertyIsNotEqualTo'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.expr.Expression} filter The filter to determine the type of.
|
* @param {ol.expr.Expression} filter The filter to determine the type of.
|
||||||
* @return {string} The type of filter.
|
* @return {string} The type of filter.
|
||||||
@@ -443,7 +448,7 @@ ol.parser.ogc.Filter_v1.prototype.getFilterType_ = function(filter) {
|
|||||||
} else if (filter instanceof ol.expr.Not) {
|
} else if (filter instanceof ol.expr.Not) {
|
||||||
type = '!';
|
type = '!';
|
||||||
}
|
}
|
||||||
var filterType = this.filterMap_[type];
|
var filterType = ol.parser.ogc.Filter_v1.filterMap_[type];
|
||||||
if (!filterType) {
|
if (!filterType) {
|
||||||
throw new Error('Filter writing not supported for rule type: ' + type);
|
throw new Error('Filter writing not supported for rule type: ' + type);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user