Geolocation is a widely requested feature in today's applications, giving accurate location-specific information to the user. In this chapter, we'll review the Geolocation API in the HTML5 specification. With this knowledge, we'll go ahead and build a wrapper that allows us to easily tap into this feature. Once we have a thorough understanding of how we can retrieve the user's location, we put our newly found knowledge to use with a simple application that uses the Google Maps API. At the end of this chapter you should have a thorough understanding of the Geolocation specification, have a simple example of its implementation, and as a bonus you should have gained some experience in using the Google Maps API. So let's start out by exploring the specification.
In this chapter we will cover:
Geolocation specification
Retrieving the user's current location
Watching the user's location
Handling geolocation errors
Google Maps API
Tying Google Maps with geolocation...