hi there.. Help me use Geonames API,
iam newbie, i run the script with HTML5 Geolocation, i already got latitude and longitude, how to convert that two into city name here is my code
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Geolocation</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta charset="utf-8"/>
<script type="text/javascript">
var options =
{
enableHighAccuracy: true,
maximumAge:1000,
timeout: 45000
};
if (window.navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(succesCallback, errorCallback, options);
} else
{
alert('The browser is not supported');
}
function succesCallback(position)
{
var output = '';
output += "Found YOU.\n\n";
output += 'Latitude: ' + position.coords.latitude + "\n";
output += 'Longitude: ' + position.coords.longitude + "\n";
output += 'Accuracy: ' + position.coords.accuracy + " meters\n";
alert(output);
}
function errorCallback(error)
{
switch (error.code)
{
case error.PERMISSION_DENIED:
alert('You didn't grant us PERMISSION);
break;
case error.POSITION_UNAVAILABLE:
alert('Where the hell are you');
break;
case error.TIMEOUT:
alert('Time is over');
break;
}
};
</script>
</head>
<body>
<h1>Reverse Geolocation</h1>
</body>
</html>
where i put geonames api
how to alert the user's city, just like lat and long
simply iam super newbie, i hope someone could help me