2

If I go to the google maps homepage, there's a button there with my location. If I press it, the browser asks me if I want to share my location with google. I know of the V3 API's google.loader.ClientLocation, but this isn't asking me anything related to location sharing.

Geo
  • 93,257
  • 117
  • 344
  • 520

1 Answers1

3

Check the documentation at http://code.google.com/apis/maps/documentation/javascript/basics.html#Geolocation.

The key piece of code you need to use is:

navigator.geolocation.getCurrentPosition(successCallback);

It can take an errorCallback as an optional second parameter.

Trott
  • 66,479
  • 23
  • 173
  • 212