1
votes

I am using the Google Places Api Web Service documented here. I am returning the JSON version. The values I want are in the json object in geometry > location > lat/lng.

This is what the documentation shows:

"geometry" : {
     "location" : {
       "lat" : -33.8669710,
       "lng" : 151.1958750
     }

And this is what I get when I run the request:

"geometry": {
  "location": {
    "lat": {
      "s": 1,
      "e": 1,
      "c": [
        5,
        9,
        9,
        2,
        1,
        9,
        0,
        6,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1
      ]
    },
    "lng": 10.759083
  }

What is this? Is it possible to convert it somehow? Or is this a Google-LatLng-object that Google maps will understand?

This is the request I send, without my API key: https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJhSA4MWZuQUYRcr6KDHnWwgU&key=MY_API_KEY

1
I get "geometry" : { "location" : { "lat" : 59.92190600000001, "lng" : 10.759083 }, from that request. Not sure where what you are seeing is coming from. Perhaps you can try it again.geocodezip
Oh, it seems my Postman extension that I use to run requests are getting this strange result in lat, but when I run it in normal Chrome, I get the correct one.. I wasn't aware they could even be different.. What a bummer :( Thanks for testing it and making me try again :)mathkid91

1 Answers

1
votes

Not sure why, but it turns out Postman (Chrome extension) is returning this strange value. Everywhere else I try its working :)