IP2Location Programming Contest

Your Current Location

We have estimated you are located at Geolocation Ashburn, Virginia, United States Of America by using IP Geolocation technique.

What is GeoLocation?

GeoLocation is the technique of finding the geographical location of a person from his or her IP address. This is normally used in a web page to detect the web visitor's location for the purpose of sales analysis, marketing, etc.

What is HTML 5 GeoLocation technology?

HTML 5 is the newest standard set by the World Wide Web Consortium (W3C). Prior to HTML 5, GeoLocation is done normally on the server-side where a web visitor's IP address is captured and then matched against a IP2Location database like those available from IP2Location.com which will return more detailed information about that visitor's Country, State, City and a whole lot more.

With the announcement of the HTML 5 standard, it will now become easier to get those GeoLocation information on the client-side. This is due to the fact that included inside the HTML 5 standard is a specification for a new JavaScript-based GeoLocation API. Some of the newer browsers available today already support this new GeoLocation lookup which leverages data collected from Global Positioning System (GPS) and location inferred from network signals such as RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs, as well as user input.

You can check out the difference between a traditional IP GeoLocation versus the newer HTML 5 GeoLocation API method at IP2Location resources.

How do I use this GeoLocation API?

This API offers both a one-time position request and also a constantly updated position request. Below are the sample codes for both cases.

For one-time position request, you just need the JavaScript code below:

One-time Position Request
function showMap(position) {
// Show a map centered at (position.coords.latitude, position.coords.longitude).
// One-shot position request.

For a constantly updated position request, you can use the JavaScript code below:

Constantly Updated Position Request
function scrollMap(position) {
// Scrolls the map so that it is centered at (position.coords.latitude, position.coords.longitude).
// Request repeated updates.
var watchId = navigator.geolocation.watchPosition(scrollMap);
function buttonClickHandler() {
	// Cancel the updates when the user clicks a button.

Privacy Issues

This API will retrieve the geographic location of the hosting device which will usually pinpoint the location of the user of the device. To prevent a breach of the user's privacy, it is recommended that any browsers that implement this API supply a method of acquiring permission explicitly from users before revealing their locations.

IP2Location IP Geolocation
IP2Location Widgets
IP2Location Programming Contest
IP Geolocation API
IP Address Map