192 Chapter 7—Geolocation
Figure 7.2 Geographic position output in Mozilla Firefox
In addition to latitude, longitude, and altitude, pos.coords also includes in-
formation about the accuracy of the position (accuracy, altitudeAccuracy) plus
possible speed and direction (heading). Whereas Google Chrome is limited to the
attributes required in the specification, Firefox (here, version 3.6) outputs quite a
lot of additional information—even address details (see Listing 7.4), showing an
extract of the result of JSON.stringify(pos):
Listing 7.4 Extract from the result of JSON.stringify(pos) for Firefox 3.6
{"coords":
..// ...
"address":
{"streetNumber":"6","street":"Postgasse",
"premises":null,"city":"Murnau am Staffelsee",
"county":"Garmisch-Partenkirchen","region":"Bavaria",
"country":"Germany","countryCode":"DE",
"postalCode":"82418","contractID":"",
"classDescription":"wifi geo position address object",
// ...
},
// ...
}
The browser offers a remarkable amount of information! Where it all comes from
will be explained in the following section.