The 'point' in the callback is a GLatLng object. You can extract the lat/long from that.
http://code.google.com/apis/maps/documentation/reference.html#GLatLng They way the geocoder works it can't just 'return' the value, you need to use a callback. http://econym.org.uk/gmap/async.htm 2009/1/17 yinDojo <[email protected]>: > > Hello, the below code shows how to get lat and lng and pins the > address on the map. Is there a function that just return lat and lng > only? Is getLatLng and overload function where it can just take an > address? > > Thanks, > -T > > var map = new GMap2(document.getElementById("map_canvas")); > var geocoder = new GClientGeocoder(); > > function showAddress(address) { > geocoder.getLatLng( > address, > function(point) { > if (!point) { > alert(address + " not found"); > } else { > map.setCenter(point, 13); > var marker = new GMarker(point); > map.addOverlay(marker); > marker.openInfoWindowHtml(address); > } > } > ); > } > > > > -- Barry - www.nearby.org.uk - www.geograph.org.uk - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
