HTML5 Geolocation: Problems and Solutions
Join the DZone community and get the full member experience.Join For Free
The concept of geolocation is simple ('where are you?'); but the W3C spec explicitly specifies that the API be 'agnostic to the underlying sources of location information' because the methods required to gather that information can become quite complex (GPS, cell triangulation, IP address, whatever), and can vary with device and circumstance
So browser manufacturers need to think hard about how to implement the Geolocation API. But, fortunately for web developers, the W3C's agnosticism requirement means that web apps are thoroughly abstracted from the actual geodata. This is particularly important because plenty of location-specific web apps might be used on multiple devices, from many places (think Foursquare, or Yelp), depending on whether the user is currently in place p or deciding whether (and how) to go there.
Recently .net magazine posted an extensive set of problems and solutions using the Geolocation API, excerpted from Chapter 8 of the HTML5 Cookbook by Christopher Schmitt and Kyle Simpson. If you're thinking about using the Geolocation API, this is an excellent place to start.
Extremely useful collection of libraries, APIs, snippets, and suggestions for anyone writing geolocation into a web app. Check it out here.
Opinions expressed by DZone contributors are their own.