HTML and CSS Reference
In-Depth Information
Geolocation API; the IndexedDB API; the File Reader, File Writer, and File System APIs;
and SVG and WebGL.
In this section, you'll learn
• The Geolocation API and how you can use it to determine a user's geographic loc-
ation
• The IndexedDB API and how it allows you to store an entire database on the client
side
• File-oriented specifications and how you can use them to work with and store files
locally on the user's filesystem
• SVG and WebGL and how they're enabling developers to produce impressive
high-quality vector graphics and 3D animations on the web
We'll talk about each ancillary yet important specification, starting with Geolocation.
1.4.1. Geolocation API
As mobile device usage has surged in recent years, so has the use of location-aware applic-
ations. The Global Positioning System (GPS) sensors found on modern smartphones en-
able applications to locate users to a high degree of accuracy. If GPS isn't available (if the
device doesn't have a sensor, or if the user is out of satellite line of sight), devices can fall
back to other means of tracking location, using information such as your cellular network,
Wi-Fi network, or IP address.
The Geolocation API defines methods that allow web applications to find a user's location.
When these methods are called, the browser will notify the user that the application is re-
questing access to their location. The user can then choose to accept or reject this request,
ensuring that applications don't track user location without their express prior permission.
If the user accepts the request, the API then provides the application with a series of data
about the user's location including coordinates (latitude and longitude), altitude, heading,
and speed, as well as the level of accuracy of the result.
You'll learn how to use geolocation in chapter3 , where you'll use it to get the user's current
location and include a map of that location in an HTML document ( figure 1.15 ) .
Search WWH ::




Custom Search