Search code examples
jquerygoogle-geocoder

get the lat,lng from the geocoder json result


if (status == google.maps.GeocoderStatus.OK) {
   hangout = results[0].geometry.location;
   console.log(hangout);
   console.log(hangout.lat);
}

I know I'm doing something wrong here but what is it? hangout alerts the lat lng but how do i get the lat by itself.


Solution

  • According to the documentation: http://code.google.com/apis/maps/documentation/javascript/reference.html#LatLng

    You would use:

    hangout.lat()