2016-05-04 105 views
0


我目前正在尝试开发一个Android应用程序,寻找您的位置附近的兴趣点。
我知道,谷歌广场API只返回每个请求的20个结果,但事实证明我的请求不返回他们应该...
此请求(有很多的类型)返回5个结果:谷歌地方请求没有返回足够的结果

https://maps.googleapis.com/maps/api/place/nearbysearch/json?rankby=distance&location=43.2290074,5.4384756&sensor=true&key=<my_key>&types=museum|art_gallery|restaurant|bakery|bar|cafe|food|amusement_park|casino|aquarium|movie_theater|zoo|bowling_alley|night_club|store|shoe_store|electronics_store|convenience_store|grocery_or_supermarket|home_goods_store|clothing_store|gym|stadium|health|dentist|doctor|hospital|pharmacy|veterinary_care|spa|hair_care|beauty_salon|cemetery|church|funeral_home|hindu_temple|synagogue 

虽然这一个(只餐馆/食物种类)返回20个结果:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?rankby=distance&location=43.2290016,5.4385233&sensor=true&key=<my_key>&types=restaurant|bakery|bar|cafe|food 

第一个有很多缺失的结果,我不明白为什么...

回答

0

尝试设置radius参数:

https://developers.google.com/places/web-service/search?hl=fr#PlaceSearchRequests

编辑:闯闯:

next_page_token包含可用于返回最多20个 其他结果的令牌。如果 没有附加结果要显示,则不会返回next_page_token。可返回的结果 的最大数量为60.从发出 next_page_token到它的有效时间之间有一个短暂延迟。

https://developers.google.com/places/web-service/search?hl=com#PlaceSearchResponses

+0

_rankby = distance_和_radius_是在谷歌的地方请求未对应,我已经尝试过:/ –

+0

编辑我的答案;) –

+0

是的,我知道,next_page_token可以让我看到了20个下一结果。但是,如果第一个请求中没有超过5个结果,它又能如何提供帮助? –

相关问题