Remove "margin" at the bottom of the canvas

This commit is contained in:
Thomas Chandelle
2017-01-12 10:58:01 +01:00
parent 3c751cad69
commit ade0b7898b
3 changed files with 34 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;