I would prefer a variable defined at the top of the file containing the TileStream url instead of repeating multiple times an hardcoded value (see also lines 463, 473, 507 and so on...)

like:
var TILESTREAM_URL = 'http://tilestream.openquake.org/v2/'
var tileLayer = L.tileLayer(TILESTREAM_URL
+ selectedLayer
...