I am developing a Pure Java program that takes an Address in the form of text and the passes it to Google Map API for further breaking in Country,State and Zip.
But I got stuck somewhere where my Java Program is throwing an exception resulting in awkward results.
Now I decided to use the java integrating it with Rhino. This is because I successfully developed a Web Page that takes a string and parses it in Country,State and Zip. So now my thinking is that I will integrate this JavaScript file in my Java file using Rhino.
function showLocation(address) {
var geocoder;
if(!geocoder){
alert("GC is initialised");
geocoder = new GClientGeocoder();
}
geocoder.getLocations(address , function(response)
{
if (!response || response.Status.code != 200) {alert("Sorry, unable to locate that address");}
else {
place = response.Placemark[0];
}
}//END OF CALLBACK METHOD
);//END OF GETLOCATIONS
}//end of showLocation
Now my question is that how can I return the object of place when I call showLocations()