O'Reilly logo

OpenLayers 3 : Beginner's Guide by Erik Hazzard, Paul Spencer, Thomas Gratier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Geolocation class

OpenLayers provides us with the ol.Geolocation class, which can be used to find the current location of the user and to track changes in location over time. This class accesses information provided by web browsers through the HTML 5 Geolocation API.

Limitations of the Geolocation class

Before we go any further, it's important to discuss the technology behind the Geolocation API a little bit to understand its limitations. The location of a device can be determined by several methods. Typically, we think of the location as being determined by a Global Positioning System (GPS), but in practice, the location of a device can be determined by several means, including the following:

  • Public IP address: Every device that can access the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required