diff --git a/include/mapboxgl/leaflet-mapbox-gl.js b/include/mapboxgl/leaflet-mapbox-gl.js index 55e1fe80..29b0755e 100644 --- a/include/mapboxgl/leaflet-mapbox-gl.js +++ b/include/mapboxgl/leaflet-mapbox-gl.js @@ -172,10 +172,12 @@ L.DomUtil.setPosition(container, topLeft); this._transformGL(gl); + + var x_round = Math.round(size.x), y_round = Math.round(size.y); - if (gl.transform.width !== size.x || gl.transform.height !== size.y) { - container.style.width = size.x + 'px'; - container.style.height = size.y + 'px'; + if (Math.round(gl.transform.width) !== x_round || Math.round(gl.transform.height) !== y_round) { + container.style.width = x_round + 'px'; + container.style.height = y_round + 'px'; if (gl._resize !== null && gl._resize !== undefined){ gl._resize(); } else {