From a0a0752769c31929fc6c136bbe830b8e44c329a5 Mon Sep 17 00:00:00 2001 From: Aleksandar Stojiljkovic Date: Sun, 1 Dec 2019 12:19:53 +0200 Subject: [PATCH] Fix map size in benchmarks display: none on Chrome (Chrome 78.0.3904.108 (Official Build) (64-bit) on macos), results with container clientWidth and clientHeight equal to 0. This led to and container dimension [400 x 300](https://github.com/mapbox/mapbox-gl-js/blob/3c36a67716d7c8ad8d69b15f7e5fd19b72e7a7ff/src/ui/map.js#L1922) instead of using specified size in e.g. bench/benchmark/layers.js (1024x768) --- bench/lib/create_map.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bench/lib/create_map.js b/bench/lib/create_map.js index 318c95daa70..e4b8ab4fd13 100644 --- a/bench/lib/create_map.js +++ b/bench/lib/create_map.js @@ -6,9 +6,10 @@ export default function (options: any): Promise { return new Promise((resolve, reject) => { const container = document.createElement('div'); container.style.width = `${options.width || 512}px`; - container.style.height = `${options.width || 512}px`; + container.style.height = `${options.height || 512}px`; container.style.margin = '0 auto'; - container.style.display = 'none'; + container.style.display = 'block'; + container.style.visibility = 'hidden'; (document.body: any).appendChild(container); const map = new Map(Object.assign({