Something had changed a little from the version of the API you use in your example, and a couple of things were not quite working so I tried updating to newer version
<!-- Mabpox GL -->
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.46.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.46.0/mapbox-gl.css' rel='stylesheet' />
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/geo-viewport/v0.1.1/geo-viewport.js'></script>
map.addControl(new mapboxgl.NavigationControl(), 'top-right');
I forget if I changed anything else, here' a link to the code I copied and tweaked