Merge pull request #13363 from mike-000/floor-round-ceil

Add floor, round and ceil to style expressions
This commit is contained in:
Tim Schaub
2022-02-10 11:46:28 -07:00
committed by GitHub
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)');