added update map function to location
reorganized js functions