"location" is a LatLng. http://code.google.com/intl/en/apis/maps/documentation/javascript/reference.html#GeocoderResult The methods of a LatLng include lat() and lng(). So you just set mylat = results[0].geometry.location.lat() .
Sometimes, people try to use undocumented parts of Google Maps, because they might be able to something really interesting. (Your's isn't that case; it's actually easier for you to follow the documentation). But those that do try to use undocumented features know they are just asking to get their legs knocked out from under them. Undocumented means it can change whenever someone inside Google needs to change it, and Google has no need to give you a reason. - Jeff On Dec 20, 9:12 am, Willans <[email protected]> wrote: > Hi > > I'm encoding a postcode (user-entered) using the Geocoder. > > I set the map center to results[0].geometry.location > > I then need to pass the latitude and longitude in to another function > to calculate distances to various locations. > > At the time of writing, the latitude and longitude are stored in > 'results[0].geometry.location.va' and > 'results[0].geometry.location.wa' respectively. > > The problem is, every few days, the key (might not be the correct > term) changes. So it might be .xa and .za, or .wa and .xa > > So, is there a way to get these values even if the key changes? Or > what's the reason for these continually changing? > > Cheers > > Simon -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
