added map.js function