Update main.js

Added geolocation functions