Search Google Place API for places within LatLngBounds on Android

本小妞迷上赌 提交于 2019-12-11 08:18:58

问题


I am building an Android application that lets users find restaurants in a specific area (LatLngBounds). I want to do a Google Place search for restaurants that are located inside this LatLngBounds and not outside of it.

I understand that there is a way to do this with the Google Maps JavaScript API V3, however, is there a way to do a Google Place search using LatLngBounds as the location parameter on Android? Thank you


回答1:


After some thorough researching, I've realized that there is no easy way to search the Google Place API withing a bounds area (LatLngBounds) unless I use the Google Maps JavaScript API V3.

However, there is an alternative solution, which is to use the Yelp API. The Yelp API lets developers specify a "bounding box...defined by a southwest latitude/longitude and a northeast latitude/longitude geographic coordinate."

Here is a link for more information:

http://www.yelp.com/developers/documentation/v2/search_api




回答2:


This is late to the party but it seems like with the newer Google Services you can set LatLngBounds for your Places search:

Here is the API

Here is the Example



来源:https://stackoverflow.com/questions/24317339/search-google-place-api-for-places-within-latlngbounds-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!