C H A P T E R  38

Using Geolocation

The Geolocation API allows us to obtain information about the current geographic position of the user (or at least the position of the system on which the browser is running). This isn't part of the HTML5 specification, but it is usually grouped up as part of the new features associated with HTML5. Table 38-1 provides the summary for this chapter.

Image

Using Geolocation

We access the geolocation feature through the global navigator.geolocation property, which returns a Geolocation object – the methods of this object are described in Table 38-2.

Getting the Current Position

As its name suggests the getCurrentPosition ...

Get The Definitive Guide to HTML5 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.