I'm trying to work with the google maps API and am having some trouble. I've created a function called getPoint which accepts an address. It uses the google api to turn that address into a GPoint object using the GClientGeocoder.getLatLng(address,callback) function. The getLatLng() is passed the address and a callback function as you can see below. I want the getPoint() function I've written to return the "point" variable passed to the callback function from the getLatLng() call. I am struggling to figure out how to do this or even if it can be done?
function getPoint(address) {
var geocoder = new GClientGeocoder();
return geocoder.getLatLng(
address,
function(point){
return point;
}
);
}
Thanks in advance for the help!