This post is an example for yahoo placefinder.Using which latitude and longitude of the places can be obtained.This could be useful when your application needs to keep track of the places in a database and later display it in the map.Most popularly used google maps,yahoo maps requires latitude and longitude of places.These codes should be helpful to get the latitude and longitude.
WHY YAHOO?
There is no reason for it because google’s geocoder api is also simple but when comes to usage limits per day yahoo gives little more than google.
Technologies Used:
- Jquery
- yahoo api
Whats special?
Code is so simple ! Requires only a simple ajax call to geocode.
GEOCODE.PHP:
This code echo’s the content as a xml format to the front end.
<?php $search= "http://where.yahooapis.com/geocode?location=".$_POST['location'].""; $xml = simplexml_load_file($search,'SimpleXMLElement', LIBXML_NOCDATA); echo $xml->asXML(); ?>
INDEX.HTML( Ajax call ):
$.post('geocode.php',{location:location_value},
function(output)
{
$(lat).html($(output).find('latitude').text());
$(lon).html($(output).find('longitude').text());
$(result).fadeIn();
$(loader).fadeOut();
});
Webtuts going to make tutorial on google maps API in the upcoming weeks where these latitudes and longitudes will be used in the map.Subscribe us and stay connected.
Thats it ! Any queries leave a comment below.



