Obtaining more than 20 results with Google Places API

前端 未结 6 1715
Happy的楠姐
Happy的楠姐 2020-12-23 20:16

I want to develop a map application which will display the banks near a given place.

I use the Places library to search and everytime it just return 20 results. What

6条回答
  •  执笔经年
    2020-12-23 20:43

    UPDATE: Since I originally wrote this answer, the API was enhanced, making this answer out of date (or, at least, incomplete). See How to get 20+ result from Google Places API? for more information.

    ORIGINAL ANSWER:

    The documentation says that the Places API returns up to 20 results. It does not indicate that there is any way to change that limit. So, the short answer seems to be: You can't.

    Of course, you might be able to sort of fake it by doing queries for several locations, and then merging/de-duplicating the results. It's kind of a cheap hack, though, and might not work very well. And I'd check first to make sure it doesn't violate the terms of service.

提交回复
热议问题