The Google Gears (actually now just called Gears) API has a call (getCurrentPosition) that returns a users latitude and longitude. The users location is determined by a number of factors. If present on-board GPS is used(if the user is using a Android based phone for instance). If GPS is not availiable a users IP Address is used (they determine where you are generally by your ip address and network provider....it's not always accurate).
The API is very approachable and anyone who has used the Google Maps API will find it easy to use. I was able to quickly add the users current geo-location to a geography based RSS view. I also added the ability for users to automatically geo-stamp blog entries. It took less than an hour.
If Gears is present the end user still must give the site or application permission to access the users location (for privacy reasons obviously).