On Aug 11, 4:23 pm, "Tuu T." <[email protected]> wrote: > I need just need the values from the var point, is wrong to do > > var geocoder = new GClientGeocoder(); > var point = geocoder.getLatLng(address); > > to get these value?
Yes it is wrong. See the documentation: http://code.google.com/apis/maps/documentation/reference.html#GClientGeocoder.getLatLng getLatLng() returns nothing, and requires two arguments: the address and a callback function. You need the callback function to handle the results because the geocoding itself can take a long time, and the callback function is called when it's ready. > If it is, how do i do this? Because i just need the > value of the point. function geocallback(point) { // everything you want to use point for // has to go here } var geocoder = new GClientGeocoder(); geocoder.getLatLng(address,geocallback); You can put the entire function definition inside the brackets with getLatLng(), but it's often easier to separate it out as here. It's certainly easier for the Groups interface, which mangles code. Because it's a function, it has to be declared before you actually need it. Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
