Reputation: 11
As per the google api documentation its mentioned as:
"rank results strictly by distance. In order to rank results by distance you must use some form of query or filter on the search. This can be a name filter, a type filter, or a keyword search. When results are ranked by distance it is not necessary to provide a search radius as the Places API will try to return the 20 closest results within reasonable distance"
Reference:
https://maps-apis.googleblog.com/2012/05/google-places-api-search-refinements-as.html
My question here is, what's the maximum radius/distance the API uses internally to get the matching results?
Note: For radius, the api documentation says "The maximum allowed radius is 50 000 meters". But no information about maximum/default distance the result includes is mentioned for rankBy: google.maps.places.RankBy.DISTANCE.
Any information on this will be helpful.
Upvotes: 1
Views: 1333
Reputation: 32138
According to Google team the radius used with rank by distance option is 7000 meters.
Take a look at the following answer in the public issue tracker:
https://issuetracker.google.com/issues/35824648#comment2
Indeed, rankby=distance uses a default radius, currently 7000 m, and only results within that radius will be returned.
Upvotes: 1