REQUEST THE USER’S CURRENT LOCATION

To access the user’s current location, the browser needs to support the Geolocation API or an equivalent fallback, and the user needs to allow access to your website.

One of the fallbacks, Google Gears, was designed by Google to provide a multitude of features prior to when the HTML5 specification took hold. In today’s HTML5 web browsers, Google Gears is obsolete, but it does provide a useful fallback for pre-HTML5 web browsers, especially those that do not understand the Geolocation API.

The Geolocation JavaScript Library is a useful tool that bridges the interface discrepancies between the W3C’s Geolocation API, Google Gears, and some mobile web browsers’ JavaScript GPS interfaces. Once implemented, you can ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.