resizer()

in src/js/modules/choropleth.js [522:539]


    resizer() {

        var self = this

        var to = null
        var lastWidth = document.querySelector(".interactive-container").getBoundingClientRect()
        window.addEventListener('resize', () => {
            var thisWidth = document.querySelector(".interactive-container").getBoundingClientRect()
            if (lastWidth != thisWidth) {
                window.clearTimeout(to);
                to = window.setTimeout(function() {
                    self.zoomLevel = 1
                    self.createMap()
                    self.updateMap()
                }, 500)
            }
        })
    }