Вопрос

Добавление ожидаемых типов параметров изменяет результат реагирования в результате неожиданного способа.

Запрос 1: https://maps.googleapis.com/maps/api/place/search/json?location=38.4551,122.672045&radius=100&sensor=false&key=

Запрос 2: https://maps.googleapis.com/maps/api/plach/search/json?location=38.4551,122.672045&radius=100&sensor=false&types=park&key=

Оба запроса должны вернуть место с помощью имени : «Park Howarth» , поскольку он имеет парк типа.И забавная вещь заключается в том, что увеличение радиуса = 500 вернет ожидаемый результат.Но тогда как это возвращает его в первую очередь без типов параметра и тот же радиус?

Это было полезно?

Решение

This is due to the way the Google Places API processes Search Requests.

The Places API will return up to 20 establishment results within the specified radius. Additionally, area identity results may be returned to to help identify the area the establishments are located.

If no type has been specified in the Places API Search Request, these area identity results are not strictly limited to the radius specified in the request, however when a type has been specified, additional area identity results are strictly limited to the radius specified in the request.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top