Skip to content

Commit

Permalink
Revert "Issue an error when map canvas is larger than allowed by gl.M…
Browse files Browse the repository at this point in the history
…AX_RENDERBUFFER_SIZE #2893 (#3841)"

This reverts commit b2d40e3.
  • Loading branch information
1ec5 committed Jan 17, 2017
1 parent ac70fa7 commit 630d98c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
7 changes: 0 additions & 7 deletions js/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1060,13 +1060,6 @@ class Map extends Camera {
return;
}

const MAX_RENDERBUFFER_SIZE = gl.getParameter(gl.MAX_RENDERBUFFER_SIZE) / 2;
if (this._canvas.width > MAX_RENDERBUFFER_SIZE ||
this._canvas.height > MAX_RENDERBUFFER_SIZE) {
throw new Error(`Map canvas (${this._canvas.width}x${this._canvas.height}) ` +
`is larger than half of gl.MAX_RENDERBUFFER_SIZE (${MAX_RENDERBUFFER_SIZE})`);
}

this.painter = new Painter(gl, this.transform);
}

Expand Down
11 changes: 0 additions & 11 deletions test/js/ui/map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@ test('Map', (t) => {
container: 'anElementIdWhichDoesNotExistInTheDocument'
});
}, new Error("Container 'anElementIdWhichDoesNotExistInTheDocument' not found"), 'throws on invalid map container id');

const largeContainer = window.document.createElement('div');
largeContainer.offsetWidth = 10000;
largeContainer.offsetHeight = 10000;
t.throws(() => {
new Map({
container: largeContainer
});
}, /Map canvas \(\d+x\d+\) is larger than half of gl.MAX_RENDERBUFFER_SIZE \(\d+\)/,
'throws on then map canvas is larger than allowed by gl.MAX_RENDERBUFFER_SIZE');

t.end();
});

Expand Down

0 comments on commit 630d98c

Please sign in to comment.