I am using getCurrentPosition to get local latitude and longitude. I know this function is asynchronous, just wondering how to return latitude and longitude value that can be accessed by other functions?
function getGeo() {
navigator.geolocation.getCurrentPosition(getCurrentLoc)
}
function getCurrentLoc(data) {
var lat,lon;
lat=data.coords.latitude;
lon=data.coords.longitude;
getLocalWeather(lat,lon)
initMap(lat,lon)
}