Remove "margin" at the bottom of the canvas
This commit is contained in:
@@ -41,6 +41,7 @@ ol.renderer.canvas.Map = function(container, map) {
|
||||
|
||||
this.canvas_.style.width = '100%';
|
||||
this.canvas_.style.height = '100%';
|
||||
this.canvas_.style.display = 'block';
|
||||
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
||||
container.insertBefore(this.canvas_, container.childNodes[0] || null);
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ if (ol.ENABLE_WEBGL) {
|
||||
(document.createElement('CANVAS'));
|
||||
this.canvas_.style.width = '100%';
|
||||
this.canvas_.style.height = '100%';
|
||||
this.canvas_.style.display = 'block';
|
||||
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
||||
container.insertBefore(this.canvas_, container.childNodes[0] || null);
|
||||
|
||||
|
||||
@@ -355,6 +355,38 @@ describe('ol.Map', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#updateSize', function() {
|
||||
var map, target;
|
||||
|
||||
beforeEach(function(done) {
|
||||
target = document.createElement('div');
|
||||
document.body.appendChild(target);
|
||||
map = new ol.Map({
|
||||
controls: [],
|
||||
target: target,
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
map.once('postrender', function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
map.setTarget(null);
|
||||
document.body.removeChild(target);
|
||||
});
|
||||
|
||||
it('should always generate the same size', function() {
|
||||
var initialSize = map.getSize();
|
||||
map.updateSize();
|
||||
expect(map.getSize()).to.eql(initialSize);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('create interactions', function() {
|
||||
|
||||
var options;
|
||||
|
||||
Reference in New Issue
Block a user