Skip to content

Instantly share code, notes, and snippets.

@shortcircuit3
Created August 6, 2012 19:23
Show Gist options
  • Save shortcircuit3/3277760 to your computer and use it in GitHub Desktop.
Save shortcircuit3/3277760 to your computer and use it in GitHub Desktop.
Accessing the Lat Lng in the results object - Google Maps Geocoder
// Problem - The variables in the location object change frequently
var lat = results[0].geometry.location.Xx;
var lng = results[0].geometry.location.Xx;
// Solution - Use the lat() and lng() methods instead
var lat = results[0].geometry.location.lat();
var lng = results[0].geometry.location.lng();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment