Getter for literal expression value
This commit is contained in:
@@ -308,6 +308,15 @@ ol.expression.Literal.prototype.evaluate = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the literal value.
|
||||
* @return {string|number|boolean|null} The literal value.
|
||||
*/
|
||||
ol.expression.Literal.prototype.getValue = function() {
|
||||
return this.value_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
|
||||
@@ -312,6 +312,12 @@ describe('ol.expression.Literal', function() {
|
||||
expect(expr.evaluate()).to.be(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getValue()', function() {
|
||||
var expr = new ol.expression.Literal('asdf');
|
||||
expect(expr.getValue()).to.be('asdf');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user