Add floor, round and ceil

This commit is contained in:
mike-000
2022-02-10 14:24:49 +00:00
parent 96de98bfbb
commit 57db9a6a12
2 changed files with 41 additions and 0 deletions

View File

@@ -243,6 +243,11 @@ describe('ol/style/expressions', function () {
['-', ['get', 'attr3'], ['get', 'attr2']],
])
).to.eql('abs((a_attr3 - a_attr2))');
expect(expressionToGlsl(context, ['floor', 1])).to.eql('floor(1.0)');
expect(expressionToGlsl(context, ['round', 1])).to.eql(
'floor(1.0 + 0.5)'
);
expect(expressionToGlsl(context, ['ceil', 1])).to.eql('ceil(1.0)');
expect(expressionToGlsl(context, ['sin', 1])).to.eql('sin(1.0)');
expect(expressionToGlsl(context, ['cos', 1])).to.eql('cos(1.0)');
expect(expressionToGlsl(context, ['atan', 1])).to.eql('atan(1.0)');