How to get visitor's location (i.e. country) using geolocation?

I'm trying to extend the native geolocation function if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var latitude = position.coords.latitude; ...