had to change order of js file loads. map.js was loading first, but is dependent on information sent in AJAX request from main.js file, had to load main.js before map.js