Re: [Google Maps API v2] Re: Google Maps Geo giving JSONP error Unexpected token : or invalid label
Same problem as the OP. You're using an undocumented and unsupported URL. Just change your code to use the documented google.maps.Geocoder methods and it will work fine (subject to other conditions such as rate limits of course):
https://developers.google.com/maps/documentation/javascript/geocoding
-- On Fri, Apr 27, 2012 at 3:59 PM, rymalia <ryanmalia@gmail.com> wrote:
I'm getting the same error, it worked fine until a few weeks ago.
Something must have changed on the Google side. It's their old API
version though, says it's deprecated since 2010 I think, not sure why
my developer used that version and not the new one V3. Ugh!
> https://developers.google.com/maps/documentation/javascript/geocoding...
On Apr 24, 11:24 pm, for gmaps <fayaz.m...@gmail.com> wrote:
> We're trying to get information of a user based on the lat longitude.
>
> Our code has been working fine until a couple weeks ago when we
> started getting this error.
>
> Here is our code:
>
> var reverse_geo_url = "http://maps.google.com/maps/geo?q=" + lat + ","
> + lng + "&key=[key]&sensor=false"
> console.log("Calling " + reverse_geo_url);
> new $.ajax(reverse_geo_url, {
> dataType: "jsonp",
> timeout: 5000,
> success: function (data) {
> // yay
> }});
>
> Problem is that we all of a sudden are getting
>
> Uncaught SyntaxError: Unexpected token :
> Here is an example response from Google's servers (when I go directly
> to the url)
>
> {
> "name": "33.0024912,-88.4218782",
> "Status": {
> "code": 200,
> "request": "geocode"
> },
> "Placemark": [ {
> "id": "p1",
> "address": "Paulette Rd, Macon, MS 39341, USA",
> "AddressDetails": {
> "Accuracy" : 6,
> "Country" : {
> "AdministrativeArea" : {
> "AdministrativeAreaName" : "MS",
> "Locality" : {
> "LocalityName" : "Macon",
> "PostalCode" : {
> "PostalCodeNumber" : "39341"
> },
> "Thoroughfare" : {
> "ThoroughfareName" : "Paulette Rd"
> }
> }
> },
> "CountryName" : "USA",
> "CountryNameCode" : "US"
> }},
>
> "ExtendedData": {
> "LatLonBox": {
> "north": 32.9994289,
> "south": 32.9891822,
> "east": -88.4094885,
> "west": -88.4393238
> }
> },
> "Point": {
> "coordinates": [ -88.4238788, 32.9952338, 0 ]
> }
> } ]}
>
>> *Edit: For reference, the url that my app tries to call ishttp://maps.google.com/maps/geo?q=33.8024912,-84.4218782&key=[my key
> Accessing the Geocoding service is asynchronous, since the Google Maps
> API needs to make a call to an external server. For that reason, you
> need to pass a callback method to execute upon completion of the
> request. This callback method processes the result(s). Note that the
> geocoder may return more than one result.
>
> According to the documentation callback is supposed to be supported.
> JQuery adds that callback header so I don't get why Google isn't
> honoring it.
>
> here]&sensor=false&callback=jQuery16409036452900618315_1335293866369&_=1335293866469
> Is this something on Google's side? Or is something on our side?
> Again, this code used to work perfectly.
>
> Other posts that I've seen on StackOverFlow, people are saying that
> when this error shows up in means that the server doesn't support
> JSONP... What's confusing to me is that this used to work... Did
> google change their API?
--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home