{"id":2850,"date":"2018-12-10T10:02:00","date_gmt":"2018-12-10T10:02:00","guid":{"rendered":"https:\/\/www.htmlgoodies.com\/uncategorized\/navigating-html5-geolocation\/"},"modified":"2021-04-27T23:11:23","modified_gmt":"2021-04-27T23:11:23","slug":"html-geolocation","status":"publish","type":"post","link":"https:\/\/www.htmlgoodies.com\/mobile\/html-geolocation\/","title":{"rendered":"HTML Geolocation: How to Find Someone’s Location"},"content":{"rendered":"

Since using GPS navigation is very common nowadays, it has completely changed the way people use maps. Everything is digitalized, and paper version of maps are now outdated. However, with the ability to know exactly where you are, you must agree that you allow the application to do so, because gathering your data without your permission endangers your privacy. That is why applications that use HTML Geolocation will always ask for your permission. So, the user will be prompted with a popup or dialog requesting the user’s permission to share the location information. The user can accept or deny the request. The Geolocation API of HTML5 helps in identifying the user’s location, which can be used to provide location-specific information or route navigation details to the user.<\/p>\n

There are many techniques used to identify the location of the user. A desktop browser generally uses WIFI- or IP-based positioning techniques, whereas a mobile browser uses cell triangulation, GPS, A-GPS, WIFI-based positioning techniques, etc. The Geolocation API uses any one of these techniques to identify the user’s location. At the base of every location-based application is positioning and Geolocation which is similar to the use of positioning systems but is more focused on determining a meaningful location (such as a street address) rather than just a set of geographic coordinates.<\/p>\n

In this article, you will learn the Geolocation capabilities of HTML5. The API provides a method to locate the user’s, more or less exact, position. This is useful in a number of ways that range from providing a user with location-specific information to providing route navigation. There is more than one way to figure out where you are — your IP address, your wireless network connection, which cell tower your phone is talking to, or dedicated GPS hardware that calculates latitude and longitude from information sent by satellites.<\/p>\n

In HTML5, we have a set of APIs to effectively allow the client-side device (i.e. your iPhone 3G+, Android 2.0+ phones, or even your conventional desktop browsers) to retrieve geographic positioning information with JavaScript. The Geolocation API is supported by the following browsers and smartphones. Minimum version requirements are mentioned as well.<\/p>\n