1

I posted about it an issue https://code.google.com/p/gmaps-api-issues/issues/detail?id=8387&thanks=8387&ts=1437921771 But still I want to know if anybody faced this and know the solution for this...

First I'm using nearBySearch http web service to get places around me via: https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters https://developers.google.com/places/webservice/search

Second step I use GeoDataApi.getPlaceById API for Android to get more details about the places from step 1 above. https://developers.google.com/places/android/place-details

I assume that PlaceId is 'Global reference' across all Google maps platforms. The bug is: Sometimes (and even not so rarely) PlaceID's from nearBySearch does't exist in GeoDataApi.getPlaceById, and instead I get result of this form:

{
    "html_attributions" : [],
    "status" : "INVALID_REQUEST"
}

PlaceID for example: ChIJJcoXzj8oAxURY8ZGJx4crNo

Edit: This is the android code:

Places.GeoDataApi.getPlaceById(mGoogleApiClient, stringIDSArray).setResultCallback(new ResultCallback<PlaceBuffer>() {
    @Override
    public void onResult(PlaceBuffer places) {
        if (places.getStatus().isSuccess()) {
            //Actually for the specified PlaceID (ain't here real "Array") we expect loop iteration
            for (int i=0; i<places.getCount(); i++) {
                //str is NULL for the problematic PlaceID
                String str = places.get(i).getName().toString();
            }                               
        }
        places.release();
    }
}); 

Thanks,

michael
  • 3,835
  • 14
  • 53
  • 90
  • Hi Michael. Are you sure you're using the Android GeoDataAPI.getPlaceById() call? The response you posted looks like the response of the Place Details HTTP endpoint (https://developers.google.com/places/webservice/details?hl=en). Can you post some of your code? – plexer Jul 29 '15 at 01:47
  • I have also confirmed that I am able to access the details of this ID using both the HTTP API and the Android API. When you hit this issue, is it consistent (always fails for a given ID) or inconsistent? – plexer Jul 29 '15 at 01:51
  • @plexer Thanks! First I obtain the given PlaceID via http web service call (nearbysearch). then I take the result (Same PlaceID) and try to get more details about him via android API (GeoDataAPI.getPlaceById()). What you say if I understood, is that you take PlaceID from 1 http web service call (nearbysearch) and make with the resulted PlaceID 2 http web service call (place details)? I'm trying to make "cross platform" calls. I think the code is fine (it works for most of the places & in generally same as in the official guides) the bug is consistent - For those PlaceID's always get the error. – michael Jul 29 '15 at 05:13
  • @plexer Do you have code that makes this cross platform calls and verifies that mentioned PlaceID is valid Google unique place identifier across places API both http web service & Android API? – michael Jul 29 '15 at 05:15
  • Where is the error response you included coming from? It looks like JSON, which the Android API does not return. Can you also confirm that GeoDataAPI.getPlaceById() always returns that error for the ID you included in your post? For me, getPlaceById() on Android returns the place without any errors, so I wonder if you are perhaps hitting rate limiting or quota issues? – plexer Jul 30 '15 at 09:38
  • @plexer Well this is starnge... I'm 100% sure there is no API credentials/limit issue. See my Edit with the code – michael Jul 30 '15 at 09:54
  • What is your `stringIDSArray`? I think the API gives this error when it does not recognize the given place ID, including, empty strings. Why don't you double check what you are passing in? – kaho Jul 31 '15 at 22:53

0 Answers0