Geolocation ideas that can do wonders when combined with HTML5

By | February 15, 2016
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest

Having access to the exact location of your user’s can help websites deliver services with speed, which ultimately plays a crucial role in improving the quality and recognition of those sites.

Previously, most sites required users to input their location details either by filling the details manually, by selecting fields from a drop-down list, or by clicking on a map. This approach to accessing the user location caused some frustrating experiences.

However, with the introduction of HTML5 Geolocation API, finding your site’s users place has become pretty easy than ever before. For example, here’s a screenshot of a site using HTML5 Geolocation API to determine a user location, which is presented in latitude and longitude:HTML5 GeoLocation API

In essence, adding geolocation ideas combined with HTML5 technology can do wonders in helping your site fetch data about your customer’s location. So, if you run a site that requires accessing the location of customers, then you must consider incorporating the HTML5 Geolocation API into your site. Through this post, you’ll get to know more about how adding geolocation service proves beneficial for a website. Additionally, you will learn about how the Geolocation API can be added to your site.

Benefits of Using Geolocation Service

Just imagine how useful your website might become if it provides a public transport timetable online. It will help people quickly plan a trip by merely looking at the timetable to know about service times, i.e. when some transport service will arrive at and depart from their preferred locations.

For instance, mobile users could search for the nearest bus stop through a site using the HTML5 Geolocation API. Furthermore, a real estate website can let customers know about average house prices in their specified area which reduces a user headache when they’re driving around to find a house in a neighborhood and so on.

In short, with the help of geolocation a website could help people fetch details concerning best travel routes in just a few clicks.

Understanding How Geolocation API Works

Based on which browser you use, the Geolocation API roughly determines a location on the basis of several factors like mobile phone tower IDs, Wifi access points, IP address, etc. Let’s look at a few ways using which the HTML5 Geolocation API helps a site in finding the geographic location of a user.

  • You can use GPS for determining the position of a person, but it turns out to be less energy efficient compared to other options. Another alternative to GPS called assistive GPS (or A-GPS) also helps provide information about a location by making use of triangulation between cellular phone towers and a user mobile phone. Though A-GPS does not provide as accurate information about a place as GPS, but it serves a handy tool in plenty of scenarios.
  • Furthermore, users location can be figured out via mobile phones that contain Wi-Fi access points which make use of hotspot to retrieve the desired information. In contrary, PC’s can obtain a fair idea of location information with the help of the user IP address ranges.
  • But, as you’ll know sharing a person’s physical location must be handled with utmost care to safeguard its privacy. The Geolocation API is aimed at protecting the privacy of a user’s location, and thus ensures that a site cannot access location information without the user consent. In other words, a user must always opt in to share location information with a site. Below is an image of a site using the Geolocation API message – that will get displayed asking users if they would like to share their physical location information or not:Geolocation API in HTML5

How to Add HTML5 Geolocation API into Your Site?

Would you like to incorporate the HTML5 Geolocation API into your site? Well, then you just need to become familiar with three simple functions.

1. getCurrentPosition()

The geCurrentPosition() function just as the name implies help in obtaining a user’s current location. This function takes three parameters, namely: showLocation, ErrorHandler and Options. While the first two arguments are callback methods that help in obtaining the location information, the result (i.e. geographic location) is returned in the third parameter – the PositionOptions object.

2. watchPosition()

This method helps get updates about a user’s device current geographic location at fixed intervals. The watchPosition() function also takes the same parameters just like the getCurrentPosition() function, which serves the same purpose like showLocation, ErrorHandler and Options arguments.

3. clearPosition()

Lastly, the clearPosition() function cancels a call made to the watchPosition() function. This method doesn’t return any value.
Let’s now seen an example that demonstrates how HTML5 Geolocation API help retrieve a user’s geographic location using the getCurrentPosition() function:HTML5 Geographical APIHTML5 Geographical API Code

 

Summing Up

Do you wish to include a functionality in your site that helps you implement fancy location-aware things in the website? In that case, you should consider using the HTML5 Geolocation API. It helps get information about a user’s physical location.

Author Bio
Ella Cooper works for Xicom Technologies, one among the best web development companies as a programmer. Apart from programming she has a penchant for writing and thus she shares her development experience through blogging.

If you want to integrate Google Maps in a Website or Mobile application like Android, iOS and don’t know how to integrate and create programs in Google Maps by using Google Maps JavaScript APIs? you can find this complete Video Course really helpful:

Using HTML5 and JavaScript, you will be:

  • able to setup Google Maps APIs
  • able to create Google Maps for devices
  • able to create Google Maps in a website
  • able to control the Maps UI events

For detailed course outline, follow here.


Are you looking for a Web & Mobile Development Jobs in Gulf Region? Please follow below:
Top Gulf Jobs

Top 10 Interview Questions and Answers Series:

HTML5 Web/Mobile Developer Jobs [Updated Daily]

Recents HTML5 Jobs

Front End Web Developer - Angular NINJA
Source: Indeed
Details: HTML5, JavaScript, CSS3, RESTful API web services, Bootstrap, Angular.js. Over and above anything else, here's the kind of person we want:....  More
24 days ago

Kirkland, WA 98033 28-February-2017

Front End Developer (Sharepoint and MWF)
Source: Indeed
Details: Proven track record of developing and implementing responsive web experiences using jQuery, Backbone.js, node.js, WinJS, JSON, HTML5 and CSS....  More
17 days ago

Redmond, WA 07-March-2017

Front End Web Developer
Source: Indeed
Details: Gulp, NPM, Bower)• Experience with RESTful web services, AJAX, JSON, AngularJS $resource• Advanced knowledge of HTML5, Bootstrap, CSS3• Experience with Sass CSS...  More
7 hours ago

Shelton, CT 24-March-2017

Web Design Front End Developer
Source: Indeed
Details: Strong knowledge of code (PHP, HTML5, CSS3, JavaScript, jQuery, etc.), and browser compatibility. Is looking for a passionate, experienced *Web Designer*....  More
2 days ago

Menomonee Falls, WI 53051 22-March-2017

Front End Web Developer
Source: Indeed
Details: Minimum 6+ years hands on front-end programming experience using HTML5, CSS3, JavaScript, JQuery, Angular JS, React JS, or similar frameworks....  More
2 days ago

Morrisville, NC 22-March-2017

PHP Web Developer w/Front-End Skills
Source: Indeed
Details: You're someone with 2+ years of experience in web development who lives and breathes - PHP/MySQL - HTML5 - CSS3 - Javascript/JQuery....  More
3 days ago

Atlanta, GA 21-March-2017

Front End Web Developer
Source: Indeed
Details: Javascript, jQuery, Angular, Graphing Libraries such Highcharts, D3.js), HTML5, CSS3, Bootstrap3, Responsive design, Cross browser compatibility,....  More
3 days ago

Troy, MI 48084 21-March-2017

Web Developer (Front End Web Dev/UI Dev)
Source: Nutrabolt
Details: Possesses strong technical and design skills including HTML5, CSS3, Javascript. Reporting to the SVP, Global Consumer Direct, the Front End Developer is...  More
5 days ago

Austin, TX 19-March-2017

Front End Developer
Source: Indeed
Details: *Front End Developer* We are currently looking to hire a Front End Developer The Front End Developer needs to be someone who can utilize HTML, CSS, and  More
1 hour ago

Roswell, GA 24-March-2017

UI Front End Developer
Source: Indeed
Details: Knowledge of HTML / HTML5 / CSS3 and frameworks such as Bootstrap or Foundation. We have a fast growing client that needs to add 3 Front-End developers!...  More
4 hours ago

Dallas, TX 24-March-2017

Front End Web Developer
Source: Indeed
Details: Experience with HTML5, CSS3, and common CSS preprocessors and frameworks. There is this magical recent invention called the "video game."....  More
6 days ago

Washington, DC 20001 18-March-2017

Front End Developer-REACT- NYC
Source: Indeed
Details: You should have experience working with REACT, Node, JavaScript, Mongo, HTML5, CSS3, Bootstrap, and Angular JS....  More
6 hours ago

New York, NY 10018 24-March-2017

FullStack Front End JavaScript Developer
Source: BlueLight Technologie
Details: JavaScript, HTML5, JQuery, CSS, ReactJS). Exciting Contract to Perm Role with American Express, this role is located in NYC, lower manhattan headquarters BS...  More
6 hours ago

Orlando, FL 24-March-2017

FullStack Front End JavaScript Developer
Source: BlueLight Technologie
Details: JavaScript, HTML5, JQuery, CSS, ReactJS). Exciting Contract to Perm Role with American Express, this role is located in NYC, lower manhattan headquarters BS...  More
6 hours ago

Pittsburgh, PA 24-March-2017

FullStack Front End JavaScript Developer
Source: BlueLight Technologie
Details: JavaScript, HTML5, JQuery, CSS, ReactJS). Exciting Contract to Perm Role with American Express, this role is located in NYC, lower manhattan headquarters BS...  More
6 hours ago

Jersey City, NJ 24-March-2017

FullStack Front End JavaScript Developer
Source: Indeed
Details: JavaScript, HTML5, JQuery, CSS, ReactJS). Exciting Contract to Perm Role with American Express, this role is located in NYC, lower manhattan headquarters BS...  More
11 hours ago

Orlando, FL 24-March-2017

FullStack Front End JavaScript Developer
Source: Indeed
Details: JavaScript, HTML5, JQuery, CSS, ReactJS). Exciting Contract to Perm Role with American Express, this role is located in NYC, lower manhattan headquarters BS...  More
11 hours ago

Pittsburgh, PA 24-March-2017

FullStack Front End JavaScript Developer
Source: Indeed
Details: JavaScript, HTML5, JQuery, CSS, ReactJS). Exciting Contract to Perm Role with American Express, this role is located in NYC, lower manhattan headquarters BS...  More
12 hours ago

Jersey City, NJ 24-March-2017

UI/Back-End Developer
Source: Indeed
Details: Experience developing rich applications with HTML5, CSS and JS. 2+ year of professional frontend web software development with HTML5, CSS, Javascript, DOM, JSON...  More
21 days ago

Bellevue, WA 03-March-2017

Front End Developer
Source: Indeed
Details: Experience with ES6, JavaScript, HTML5, SASS or LESS, and CSS. Kimetrica is a social enterprise on a mission to increase the effectiveness of spending in the...  More
1 day ago

Washington, DC 23-March-2017

Front End Developer
Source: Indeed
Details: Strong skills in HTML5. RSG Media Systems develops advanced analytics solutions for major media and entertainment industry clients and other intellectual...  More
1 day ago

New York, NY 23-March-2017

Front End Web Applications Developer
Source: Knowledge Anywhere
Details: Proficient in technologies such as HTML5, CSS3, XML, JSON, AngularJS, Bootstrap, and JQuery. Knowledge Anywhere is an industry leading developer of corporate...  More
30 days ago

Bellevue, WA 98004 22-February-2017

Front-End Web Developer
Source: DNTG Software
Details: Working at the corporate office, the developer will be responsible for all front-end development for our client's new e-commerce website launching this year.  More
7 days ago

Buena Park, CA 17-March-2017

Front End Developer
Source: LogMeIn, Inc.
Details: Knowledge of HTML5, CSS3 and other state-of-the-art web technologies. Front End Developer, Identity Platform....  More
1 day ago

Santa Barbara, CA 93101 23-March-2017

Front End Developer
Source: Indeed
Details: Excellent JavaScript and HTML5 coding skills• Strong understanding of the AngularJS framework• Strong knowledge of how to build and work with RESTful APIs•...  More
2 days ago

Dumbarton, NY 22-March-2017
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest