maps javascript function in progress