使用Google place API从拉特地区长时间获取附近地区 [英] Getting nearby localities from lat long using Google place API
问题描述
我使用的是Google place API,即
https://maps.googleapis.com/maps/api/place /search/json?location=33.7167,73.0667&radius=500&type=funeral_home&sensor=false&key=AIzaSyDN1QX-gWUR-mIYo_D21PNFLHHpNQkIkGU
以上链接为我提供了特定类型的所有附近位置。即类型=食物。现在我会把他们各自的地址附近的所有咖啡馆和餐馆。无论如何,只能在我的坐标(拉特,长)附近给我区域或地点吗?提前致谢。
我也有类似的用例。我没有办法使用谷歌地图API来做到这一点。但是,您可以尝试从Autocomplete getPlaces()中获取几何图形(lat,lng),并使用geonames.org API获取附近的sublocalities,以获得纬度,半径和半径。
这对我有用: - )
I'm using google place API i.e
https://maps.googleapis.com/maps/api/place/search/json?location=33.7167,73.0667&radius=500&type=funeral_home&sensor=false&key=AIzaSyDN1QX-gWUR-mIYo_D21PNFLHHpNQkIkGU
Above link gives me all the nearby locations of particular type. i.e types=food. now i will get all the cafes and restaurants nearby with their respective addresses. Is there anyway that can give me only areas or localities nearby my coordinates (lat, long)? Thanks in advance.
I had a similar usecase too. I did not have a way to do it using google maps api. But, you can try getting geometry (lat, lng) from Autocomplete getPlaces() and use geonames.org API to get nearby sublocalities giving lat, lng and radius
http://api.geonames.org/findNearbyPlaceNameJSON?lat=13.041703&lng=80.251943&radius=5&username=demo
This worked for me :-)
这篇关于使用Google place API从拉特地区长时间获取附近地区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!