Trigger on map.div instead of map.viewportDiv, which only exists later in the page build.
Trigger on map.div instead of map.viewportDiv, which only exists later in the page build.

CartoDB/wax,mapbox/wax,CartoDB/wax