Manual class transform
This commit is contained in:
@@ -13,10 +13,14 @@ import LogicalNary from '../filter/LogicalNary.js';
|
||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
||||
* @extends {module:ol/format/filter/LogicalNary}
|
||||
*/
|
||||
const And = function(conditions) {
|
||||
const params = ['And'].concat(Array.prototype.slice.call(arguments));
|
||||
LogicalNary.apply(this, params);
|
||||
};
|
||||
class And {
|
||||
|
||||
constructor(conditions) {
|
||||
const params = ['And'].concat(Array.prototype.slice.call(arguments));
|
||||
LogicalNary.apply(this, params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(And, LogicalNary);
|
||||
|
||||
|
||||
@@ -17,25 +17,29 @@ import Filter from '../filter/Filter.js';
|
||||
* @extends {module:ol/format/filter/Filter}
|
||||
* @api
|
||||
*/
|
||||
const Bbox = function(geometryName, extent, opt_srsName) {
|
||||
class Bbox {
|
||||
|
||||
Filter.call(this, 'BBOX');
|
||||
constructor(geometryName, extent, opt_srsName) {
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.geometryName = geometryName;
|
||||
Filter.call(this, 'BBOX');
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
*/
|
||||
this.extent = extent;
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.geometryName = geometryName;
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.srsName = opt_srsName;
|
||||
};
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
*/
|
||||
this.extent = extent;
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.srsName = opt_srsName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(Bbox, Filter);
|
||||
|
||||
|
||||
@@ -15,15 +15,19 @@ import Filter from '../filter/Filter.js';
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @extends {module:ol/format/filter/Filter}
|
||||
*/
|
||||
const Comparison = function(tagName, propertyName) {
|
||||
class Comparison {
|
||||
|
||||
Filter.call(this, tagName);
|
||||
constructor(tagName, propertyName) {
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.propertyName = propertyName;
|
||||
};
|
||||
Filter.call(this, tagName);
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.propertyName = propertyName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(Comparison, Filter);
|
||||
|
||||
|
||||
@@ -17,20 +17,25 @@ import Comparison from '../filter/Comparison.js';
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @extends {module:ol/format/filter/Comparison}
|
||||
*/
|
||||
const ComparisonBinary = function(tagName, propertyName, expression, opt_matchCase) {
|
||||
class ComparisonBinary {
|
||||
|
||||
Comparison.call(this, tagName, propertyName);
|
||||
constructor(tagName, propertyName, expression, opt_matchCase) {
|
||||
|
||||
/**
|
||||
* @type {!(string|number)}
|
||||
*/
|
||||
this.expression = expression;
|
||||
Comparison.call(this, tagName, propertyName);
|
||||
|
||||
/**
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
};
|
||||
/**
|
||||
* @type {!(string|number)}
|
||||
*/
|
||||
this.expression = expression;
|
||||
|
||||
/**
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(ComparisonBinary, Comparison);
|
||||
|
||||
export default ComparisonBinary;
|
||||
|
||||
@@ -17,11 +17,16 @@ import Spatial from '../filter/Spatial.js';
|
||||
* @extends {module:ol/format/filter/Spatial}
|
||||
* @api
|
||||
*/
|
||||
const Contains = function(geometryName, geometry, opt_srsName) {
|
||||
class Contains {
|
||||
|
||||
Spatial.call(this, 'Contains', geometryName, geometry, opt_srsName);
|
||||
constructor(geometryName, geometry, opt_srsName) {
|
||||
|
||||
};
|
||||
Spatial.call(this, 'Contains', geometryName, geometry, opt_srsName);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(Contains, Spatial);
|
||||
|
||||
export default Contains;
|
||||
|
||||
@@ -15,19 +15,24 @@ import Comparison from '../filter/Comparison.js';
|
||||
* @extends {module:ol/format/filter/Comparison}
|
||||
* @api
|
||||
*/
|
||||
const During = function(propertyName, begin, end) {
|
||||
Comparison.call(this, 'During', propertyName);
|
||||
class During {
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.begin = begin;
|
||||
constructor(propertyName, begin, end) {
|
||||
Comparison.call(this, 'During', propertyName);
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.end = end;
|
||||
};
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.begin = begin;
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(During, Comparison);
|
||||
|
||||
export default During;
|
||||
|
||||
@@ -15,9 +15,14 @@ import ComparisonBinary from '../filter/ComparisonBinary.js';
|
||||
* @extends {module:ol/format/filter/ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
const EqualTo = function(propertyName, expression, opt_matchCase) {
|
||||
ComparisonBinary.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase);
|
||||
};
|
||||
class EqualTo {
|
||||
|
||||
constructor(propertyName, expression, opt_matchCase) {
|
||||
ComparisonBinary.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(EqualTo, ComparisonBinary);
|
||||
|
||||
export default EqualTo;
|
||||
|
||||
@@ -14,9 +14,14 @@ import ComparisonBinary from '../filter/ComparisonBinary.js';
|
||||
* @extends {module:ol/format/filter/ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
const GreaterThan = function(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsGreaterThan', propertyName, expression);
|
||||
};
|
||||
class GreaterThan {
|
||||
|
||||
constructor(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsGreaterThan', propertyName, expression);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(GreaterThan, ComparisonBinary);
|
||||
|
||||
export default GreaterThan;
|
||||
|
||||
@@ -14,9 +14,14 @@ import ComparisonBinary from '../filter/ComparisonBinary.js';
|
||||
* @extends {module:ol/format/filter/ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
const GreaterThanOrEqualTo = function(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression);
|
||||
};
|
||||
class GreaterThanOrEqualTo {
|
||||
|
||||
constructor(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(GreaterThanOrEqualTo, ComparisonBinary);
|
||||
|
||||
export default GreaterThanOrEqualTo;
|
||||
|
||||
@@ -17,11 +17,15 @@ import Spatial from '../filter/Spatial.js';
|
||||
* @extends {module:ol/format/filter/Spatial}
|
||||
* @api
|
||||
*/
|
||||
const Intersects = function(geometryName, geometry, opt_srsName) {
|
||||
class Intersects {
|
||||
|
||||
Spatial.call(this, 'Intersects', geometryName, geometry, opt_srsName);
|
||||
constructor(geometryName, geometry, opt_srsName) {
|
||||
|
||||
};
|
||||
Spatial.call(this, 'Intersects', geometryName, geometry, opt_srsName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(Intersects, Spatial);
|
||||
|
||||
export default Intersects;
|
||||
|
||||
@@ -15,19 +15,24 @@ import Comparison from '../filter/Comparison.js';
|
||||
* @extends {module:ol/format/filter/Comparison}
|
||||
* @api
|
||||
*/
|
||||
const IsBetween = function(propertyName, lowerBoundary, upperBoundary) {
|
||||
Comparison.call(this, 'PropertyIsBetween', propertyName);
|
||||
class IsBetween {
|
||||
|
||||
/**
|
||||
* @type {!number}
|
||||
*/
|
||||
this.lowerBoundary = lowerBoundary;
|
||||
constructor(propertyName, lowerBoundary, upperBoundary) {
|
||||
Comparison.call(this, 'PropertyIsBetween', propertyName);
|
||||
|
||||
/**
|
||||
* @type {!number}
|
||||
*/
|
||||
this.upperBoundary = upperBoundary;
|
||||
};
|
||||
/**
|
||||
* @type {!number}
|
||||
*/
|
||||
this.lowerBoundary = lowerBoundary;
|
||||
|
||||
/**
|
||||
* @type {!number}
|
||||
*/
|
||||
this.upperBoundary = upperBoundary;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
inherits(IsBetween, Comparison);
|
||||
|
||||
export default IsBetween;
|
||||
|
||||
@@ -21,34 +21,39 @@ import Comparison from '../filter/Comparison.js';
|
||||
* @extends {module:ol/format/filter/Comparison}
|
||||
* @api
|
||||
*/
|
||||
const IsLike = function(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
|
||||
Comparison.call(this, 'PropertyIsLike', propertyName);
|
||||
class IsLike {
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.pattern = pattern;
|
||||
constructor(propertyName, pattern, opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
|
||||
Comparison.call(this, 'PropertyIsLike', propertyName);
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.wildCard = (opt_wildCard !== undefined) ? opt_wildCard : '*';
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.pattern = pattern;
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.singleChar = (opt_singleChar !== undefined) ? opt_singleChar : '.';
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.wildCard = (opt_wildCard !== undefined) ? opt_wildCard : '*';
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.escapeChar = (opt_escapeChar !== undefined) ? opt_escapeChar : '!';
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.singleChar = (opt_singleChar !== undefined) ? opt_singleChar : '.';
|
||||
|
||||
/**
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
};
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.escapeChar = (opt_escapeChar !== undefined) ? opt_escapeChar : '!';
|
||||
|
||||
/**
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
inherits(IsLike, Comparison);
|
||||
|
||||
export default IsLike;
|
||||
|
||||
@@ -13,9 +13,15 @@ import Comparison from '../filter/Comparison.js';
|
||||
* @extends {module:ol/format/filter/Comparison}
|
||||
* @api
|
||||
*/
|
||||
const IsNull = function(propertyName) {
|
||||
Comparison.call(this, 'PropertyIsNull', propertyName);
|
||||
};
|
||||
class IsNull {
|
||||
|
||||
constructor(propertyName) {
|
||||
Comparison.call(this, 'PropertyIsNull', propertyName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
inherits(IsNull, Comparison);
|
||||
|
||||
export default IsNull;
|
||||
|
||||
@@ -14,9 +14,14 @@ import ComparisonBinary from '../filter/ComparisonBinary.js';
|
||||
* @extends {module:ol/format/filter/ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
const LessThan = function(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsLessThan', propertyName, expression);
|
||||
};
|
||||
class LessThan {
|
||||
|
||||
constructor(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsLessThan', propertyName, expression);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(LessThan, ComparisonBinary);
|
||||
|
||||
export default LessThan;
|
||||
|
||||
@@ -14,9 +14,14 @@ import ComparisonBinary from '../filter/ComparisonBinary.js';
|
||||
* @extends {module:ol/format/filter/ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
const LessThanOrEqualTo = function(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression);
|
||||
};
|
||||
class LessThanOrEqualTo {
|
||||
|
||||
constructor(propertyName, expression) {
|
||||
ComparisonBinary.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(LessThanOrEqualTo, ComparisonBinary);
|
||||
|
||||
export default LessThanOrEqualTo;
|
||||
|
||||
@@ -16,16 +16,21 @@ import Filter from '../filter/Filter.js';
|
||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
||||
* @extends {module:ol/format/filter/Filter}
|
||||
*/
|
||||
const LogicalNary = function(tagName, conditions) {
|
||||
class LogicalNary {
|
||||
|
||||
Filter.call(this, tagName);
|
||||
constructor(tagName, conditions) {
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/format/filter/Filter>}
|
||||
*/
|
||||
this.conditions = Array.prototype.slice.call(arguments, 1);
|
||||
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
||||
};
|
||||
Filter.call(this, tagName);
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/format/filter/Filter>}
|
||||
*/
|
||||
this.conditions = Array.prototype.slice.call(arguments, 1);
|
||||
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(LogicalNary, Filter);
|
||||
|
||||
export default LogicalNary;
|
||||
|
||||
@@ -13,15 +13,20 @@ import Filter from '../filter/Filter.js';
|
||||
* @extends {module:ol/format/filter/Filter}
|
||||
* @api
|
||||
*/
|
||||
const Not = function(condition) {
|
||||
class Not {
|
||||
|
||||
Filter.call(this, 'Not');
|
||||
constructor(condition) {
|
||||
|
||||
/**
|
||||
* @type {!module:ol/format/filter/Filter}
|
||||
*/
|
||||
this.condition = condition;
|
||||
};
|
||||
Filter.call(this, 'Not');
|
||||
|
||||
/**
|
||||
* @type {!module:ol/format/filter/Filter}
|
||||
*/
|
||||
this.condition = condition;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(Not, Filter);
|
||||
export default Not;
|
||||
|
||||
@@ -15,9 +15,14 @@ import ComparisonBinary from '../filter/ComparisonBinary.js';
|
||||
* @extends {module:ol/format/filter/ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
const NotEqualTo = function(propertyName, expression, opt_matchCase) {
|
||||
ComparisonBinary.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
|
||||
};
|
||||
class NotEqualTo {
|
||||
|
||||
constructor(propertyName, expression, opt_matchCase) {
|
||||
ComparisonBinary.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(NotEqualTo, ComparisonBinary);
|
||||
|
||||
export default NotEqualTo;
|
||||
|
||||
@@ -13,10 +13,15 @@ import LogicalNary from '../filter/LogicalNary.js';
|
||||
* @extends {module:ol/format/filter/LogicalNary}
|
||||
* @api
|
||||
*/
|
||||
const Or = function(conditions) {
|
||||
const params = ['Or'].concat(Array.prototype.slice.call(arguments));
|
||||
LogicalNary.apply(this, params);
|
||||
};
|
||||
class Or {
|
||||
|
||||
constructor(conditions) {
|
||||
const params = ['Or'].concat(Array.prototype.slice.call(arguments));
|
||||
LogicalNary.apply(this, params);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(Or, LogicalNary);
|
||||
|
||||
export default Or;
|
||||
|
||||
@@ -19,25 +19,29 @@ import Filter from '../filter/Filter.js';
|
||||
* set on geometries when this is not provided.
|
||||
* @extends {module:ol/format/filter/Filter}
|
||||
*/
|
||||
const Spatial = function(tagName, geometryName, geometry, opt_srsName) {
|
||||
class Spatial {
|
||||
|
||||
Filter.call(this, tagName);
|
||||
constructor(tagName, geometryName, geometry, opt_srsName) {
|
||||
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.geometryName = geometryName || 'the_geom';
|
||||
Filter.call(this, tagName);
|
||||
|
||||
/**
|
||||
* @type {module:ol/geom/Geometry}
|
||||
*/
|
||||
this.geometry = geometry;
|
||||
/**
|
||||
* @type {!string}
|
||||
*/
|
||||
this.geometryName = geometryName || 'the_geom';
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.srsName = opt_srsName;
|
||||
};
|
||||
/**
|
||||
* @type {module:ol/geom/Geometry}
|
||||
*/
|
||||
this.geometry = geometry;
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.srsName = opt_srsName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inherits(Spatial, Filter);
|
||||
|
||||
|
||||
@@ -17,11 +17,14 @@ import Spatial from '../filter/Spatial.js';
|
||||
* @extends {module:ol/format/filter/Spatial}
|
||||
* @api
|
||||
*/
|
||||
const Within = function(geometryName, geometry, opt_srsName) {
|
||||
class Within {
|
||||
|
||||
Spatial.call(this, 'Within', geometryName, geometry, opt_srsName);
|
||||
constructor(geometryName, geometry, opt_srsName) {
|
||||
Spatial.call(this, 'Within', geometryName, geometry, opt_srsName);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
inherits(Within, Spatial);
|
||||
|
||||
export default Within;
|
||||
|
||||
Reference in New Issue
Block a user