Merge pull request #10587 from jeremy-smith-maco/larger-resolution-constraint
Adds option to View for using larger resolution value when clamping #10586
This commit is contained in:
@@ -380,6 +380,32 @@ describe('ol.View', function() {
|
||||
expect(constraint(1, 0, size)).to.be(5);
|
||||
});
|
||||
|
||||
it('accepts extent and uses the smallest value', function() {
|
||||
const constraint = getConstraint({
|
||||
extent: [0, 0, 4000, 6000]
|
||||
});
|
||||
|
||||
expect(constraint(1000, 0, size)).to.be(20);
|
||||
expect(constraint(500, 0, size)).to.be(20);
|
||||
expect(constraint(100, 0, size)).to.be(20);
|
||||
expect(constraint(50, 0, size)).to.be(20);
|
||||
expect(constraint(10, 0, size)).to.be(10);
|
||||
expect(constraint(1, 0, size)).to.be(1);
|
||||
});
|
||||
|
||||
it('accepts extent and showFullExtent and uses the larger value', function() {
|
||||
const constraint = getConstraint({
|
||||
extent: [0, 0, 4000, 6000],
|
||||
showFullExtent: true
|
||||
});
|
||||
|
||||
expect(constraint(1000, 0, size)).to.be(30);
|
||||
expect(constraint(500, 0, size)).to.be(30);
|
||||
expect(constraint(100, 0, size)).to.be(30);
|
||||
expect(constraint(50, 0, size)).to.be(30);
|
||||
expect(constraint(10, 0, size)).to.be(10);
|
||||
expect(constraint(1, 0, size)).to.be(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('overspecified options (prefers resolution)', function() {
|
||||
|
||||
Reference in New Issue
Block a user