Google Maps Variables Replaced Feb 2013

One of the projects I have going right now requires using the Google Maps API. One of the features of this API allows for sending a street address to Google and receiving a response that includes GPS coordinates at that location. Today, when I needed to use my map, it was broken! Looking in my console I found that the variables I was getting my Latitude and Longitude values from were missing, and replaced with new variables. Google has probably suggested that developers not use the variables, instead using some functions to get the desired values, but I must have skipped that part of the documentation.

// Do not use the variables Xa, Ya, Za, hb, or ib 
var lat = responses[0].geometry.location.Ya;
var lng = responses[0].geometry.location.Za;

// Instead, use functions
var lat = responses[0].geometry.location.lat();
var lng = responses[0].geometry.location.lng();

I found evidence online that Google has changed these variables in the past. So that you don’t have a Google Maps emergency like I had today, make sure to use the lat() and lng() functions instead of the variables.