In my Rails app, I'm making client-side JavaScript calls to
google.maps.Geocoder().geocode(). If geocode() returns multiple
addresses, I let the user choose one and pass that one back to the
server as a JSON encoded string for additional processing. It all works
fine.


But recently, I noticed that fields previously labeled 'lat' and 'lng'
are now appear to be labeled 'ra' and 'sa':


{"types"=>["street_address"],
"formatted_address"=>"1600 Amphitheatre Pkwy, Mountain View, CA 94043,
USA",
"address_components"=>[...],
"geometry"=>{"location"=>{"ra"=>37.422782, "sa"=>-122.085099}, 
"location_type"=>"ROOFTOP", "viewport"=>...}}



My hunch is that the corresponding javascript lat and lng accessors
still work properly, and that a self-respecting Google engineer would
tell me that I should be using the supplied JavaScript accessors
instead of reading the data structure directly.


But: I need to access these fields in my server app. Being somewhat new
to all this, I don't know how to call JavaScript accessors from within
Rails code.


So the questions:


- am i simply nuts? have the lat and lng fields been named "ra"
and "sa" all along?


- is my hunch correct that Google developers can make any changes they
want to the JSON data structure, as long as the published accessors
function as advertised?


- I saw no mention in the changelog about the renaming of the fields.
can I count on these field names staying constant for a while?


This is all pretty academic: If I cannot rely on the JSON structure
being constant, I always have the option of extracting only the fields
I need on the client side using published JavaScript accessors and
sending them to my server. But until I know what fields I really need,
it would be nice to send over the entire JSON structure.


Thoughts?


- ff

-- 
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.

Reply via email to