map script sourced out from index to map.js