I’m aware of the JSON output format as given by Google
However, I’m sometimes getting a slightly different format. This is from the results variable in the callback function of gecoder.geocode({'address': address}, callback)
"location": {
"Za": 37.3492097,
"$a": -122.03260190000003
},
…
"viewport": {
"aa": {
"b": 37.329901,
"f": 37.37543489999999
},
"ba": {
"b": -122.06526500000001,
"f": -121.99577999999997
}
}
Notice the keys under location, bounds and viewport – they are different from what’s standard. This is a problem for me because I need to send this JSON over an AJAX call and to my server and parse it and my parser can’t take “$a” as a valid key name.
Is this normal or am I missing something?
EDIT:
I’m on a cloud hosted platform (salesforce.com). We’re using the Javascript API v3. I was able to replicate this issue from a local HTML file.
I’m now thinking it might be because I’m behind a corporate proxy. Anyone faced this before?
As pointed out in a comment on the bug report and on the API documentation, the
responseobject in the callback is not pure JSON. In order to get a JSON object, I needed to create one myself like below: