Following are the few categories of services/tools related to the Geo Information I got to know·
- IP Locator – For locating the place from where the request came from. Like country, city, region etc. Useful to track user location to customize applications and suggest them the nearby services around their area such as shopping offers, generate site statistic reports based on the visitors to the sites from different countries etc·
- Proxy Detector - For detecting users who bypass Geo location controls by using proxies to spoof their IP address and location
- Spam Locator - For locating the geographical location that an email originated from·
- Trace Route Locator – For locating the geographical location of IP Addresses·
- Dynamic Redirection of internet surfers – For redirecting the user to the localized sites/geographic content etc·
- Distance between two cities – To determine the distance between two cities/places
Just a sample to try out!! Following simple JavaScript code will enable us to find the basic Geographic location information’s based on the users current IP address and with the help of third party JavaScript API.
<html>HTML Response:Information from your IP
<head><title>Geo Location - User</title></head>
<script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>
<script>
function GetGeoInfo()
{
var info = document.getElementById('GeoInfo');
var lat = geoip_latitude();
var lon = geoip_longitude();
var city = geoip_city();
var out = '<h3>Information from your IP</h3>'+
'<ul>'+
'<li>Latitude: ' + lat + '</li>'+
'<li>Longitude: ' + lon + '</li>'+
'<li>City: ' + city + '</li>'+
'<li>Region: ' + geoip_region() + '</li>'+
'<li>Region Name: ' + geoip_region_name() + '</li>'+
'<li>Postal Code: ' + geoip_postal_code() + '</li>'+
'<li>Country Code: ' + geoip_country_code() + '</li>'+
'<li>Country Name: ' + geoip_country_name() + '</li>'+
'</ul>'
info.innerHTML = out;
}
</script>
<form name="GeoForm">
<body>
<div id="GeoInfo">Getting the User Geo Information</div>
<script>GetGeoInfo();</script>
</body>
</form>
</html>
- Latitude: 13.0833
- Longitude: 80.2833
- City: Madras
- Region: 25
- Region Name: Tamil Nadu
- Postal Code:
- Country Code: IN
- Country Name: India
Reference Links:
No comments:
Post a Comment