only warn of zero size when map should be visible

This commit is contained in:
mike-000
2021-08-16 23:43:43 +01:00
committed by GitHub
parent b41abcb08e
commit 0f56eed272

View File

@@ -1524,7 +1524,14 @@ class PluggableMap extends BaseObject {
parseFloat(computedStyle['borderBottomWidth']);
if (!isNaN(width) && !isNaN(height)) {
size = [width, height];
if (!hasArea(size)) {
if (
!hasArea(size) &&
!!(
targetElement.offsetWidth ||
targetElement.offsetHeight ||
targetElement.getClientRects().length
)
) {
// eslint-disable-next-line
console.warn(
"No map visible because the map container's width or height are 0."