Gary Tan
unread,Jun 10, 2010, 12:17:47 PM6/10/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
Hi,
I am trying to create a generic function as below. no error reported,
but no mag shows up either. can somebody help?
Thanks a lot
function codeAddress(address) {
geocoder = new google.maps.Geocoder();
if (geocoder) {
geocoder.geocode({ 'address': address }, function(results,
status) {
if (status == google.maps.GeocoderStatus.OK) {
return results[0].geometry.location
}
else {
alert("Geocode was not successful for the
following reason: " + status);
};
})
}
};
var latlng = codeAddress('150 Springfield Blvd,Richmond,95037');
// if i change to below, everything look fine.
var latlng = new google.maps.LatLng(-34.397, 150.644);