adds graceful fallback to clientWidth & clinetHeight in getSize (#5209)

This commit is contained in:
Aaron Petcoff 2016-12-21 18:36:58 -05:00 committed by Vladimir Agafonkin
parent b8b7281ee8
commit 9e5903db40

View File

@ -803,8 +803,8 @@ L.Map = L.Evented.extend({
getSize: function () {
if (!this._size || this._sizeChanged) {
this._size = new L.Point(
this._container.clientWidth,
this._container.clientHeight);
this._container.clientWidth || 0,
this._container.clientHeight || 0);
this._sizeChanged = false;
}