O'Reilly logo

Pro HTML5 Programming: Powerful APIs for Richer Internet Application Development by Frank Salim, Brian Albers, Peter Lubbers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Using the HTML5 Geolocation API

Let's say you want to create a web application that offers discounts and special deals on running shoes in stores that your application's users are within walking (or running) distance away from. Using the HTML5 Geolocation API, you can request users to share their location and, if they agree, you can provide them with instructions on how to get to a nearby store to pick up a new pair of shoes at a discounted rate.

Another example of the use of HTML5 Geolocation could be an application that tracks how far you have run (or walked). You can picture using an application in a browser on a mobile phone that you turn on when you start a run. While you're on the move, the application tracks how far you have run. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required