How to use GPS in HTML5

Using HTML5 it has become fairly easy to make use of a GPS on your website in order to determine the exact location of your visitors. The custom made HTML5 functionality to meet this request is the so-called HTML5 Geolocation API. Keep in mind though, this functionality needs some JavaScript to work is not supported by older browsers (luckily enough most smartphones do support the HTML5 Geolocation functionality).

Please find below a live example the HTML5 geolocation functionality which can be used on your website. Because of privacy reasons you should always take into account users have to grant their permission before Geolocation can be performed. Therefor we’ve chosen to let you first click a button before the browser asks you if you agree to share your location.