android - Google Places API returning zero-results with specified keyword -
i doing android app returns closest places user's location fits specified preferences (pizza, coffee, bar, etc). in order that, using nearby search requests in google places api. how build http request:
public string createrequesturl() { string requesturl = ""; if ((googleapikey != "") && (lat <= max_google_lat) && (lat >= min_google_lat) && (lng <= max_google_lng) && (lng >= min_google_lng)) { requesturl += "https://maps.googleapis.com/maps/api/place/nearbysearch/json?"; requesturl += "location=" + lat + "," + lng; requesturl += "&rankby=distance"; requesturl += "&keyword=" + keyword; requesturl += "&opennow"; requesturl += "&key=" + googleapikey; } return requesturl; }
the test query trying execute lat = 45.5017, lng = 73.5673, keyword = "pizza", find pizza places open near montreal.
when execute query api, zero_results
status time. using radius
field before, have since read question , answer on stackoverflow , seems using rankby
in query , removing query responses further x meters in app better want app do.
why getting zero_results
status instead of actual pizza, coffee, bar, etc places nearby location?
edit:
i have tried following request well:
public string createrequesturl() { string requesturl = ""; if ((googleapikey != "") && (lat <= max_google_lat) && (lat >= min_google_lat) && (lng <= max_google_lng) && (lng >= min_google_lng)) { requesturl += "https://maps.googleapis.com/maps/api/place/nearbysearch/json?"; requesturl += "location=" + lat + "," + lng; requesturl += "&rankby=distance"; requesturl += "&types=food"; requesturl += "&key=" + googleapikey; } return requesturl; }
and simple request still returning status zero_results
.
change lng = -73.5673 montreal.
Comments
Post a Comment