Add approximatelyEquals function for comparing extents

This commit is contained in:
Andreas Hocevar
2020-03-31 14:52:02 +02:00
parent 2c7f58dbed
commit cdafc4fa05
3 changed files with 27 additions and 8 deletions

View File

@@ -851,4 +851,13 @@ describe('ol.extent', function() {
});
describe('approximatelyEquals', function() {
it('returns true when within tolerance', function() {
expect(_ol_extent_.approximatelyEquals([16, 48, 17, 49], [16.09, 48, 17, 49], 0.1)).to.be(true);
});
it('returns false when not within tolerance', function() {
expect(_ol_extent_.approximatelyEquals([16, 48, 17, 49], [16.11, 48, 17, 49], 0.1)).to.be(false);
});
});
});