Professional Documents
Culture Documents
The Geolocation API
The Geolocation API
The Geolocation API
The geolocation API lets you share your location with trusted web sites. The latitude and
longitude are available to JavaScript on the page, which in turn can send it back to the remote
web server and do fancy location-aware things like finding local businesses or showing your
location on a map.
As you can see from the following table, the geolocation API is supported by most browsers on
the desktop and mobile devices. Additionally, some older browsers and devices can be supported
by wrapper libraries, as we’ll see later in this chapter.