Distance can be calculated using lattitude and longitude obtained from google maps api, using the following code: