Move out of map.js into a top level object