www.patwalsh.co.uk

HTML5 Geolocation

In HTML5 there's a new property on the global navigator object called navigator.geolocation.

This enables the browser to find your location.

This page attempts to use the getCurrentPosition() method. If it fails it tries to use Google gears instead.

It uses an alertbox to display your geolocation co-ordinates.

The browser will ask if its ok to find your location the first time it tries to.

Example:-