Pulled out map functionality into separate JS file, added marker click listener to populate hidden location_id field in form.