我了解到,如果我使用某个关键字搜索Google地图,我会看到符合我输入的关键字的地方ID。现在我想知道是否可以将所有信息存储到某个Google Maps Place ID,例如ChIJk5rNr3KuEmsRwWgFX9zzBaQ
。最好是JSON格式。
Google Maps API v3可以实现吗?
修改:我发现可以通过此请求获取某些信息的列表
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=cruise&key=YOUR_API_KEY
但肯定没有列出所有信息。
答案 0 :(得分:2)
如果您使用的是Google Places API,则您的文档引用为here。例如:
https://maps.googleapis.com/maps/api/place/details/json?placeid=PLACE_ID&key=YOUR_API_KEY
如果您使用的是Google地图JS API的PlacesService,请检查these docs(部分"演示和示例代码",标签" PLACE DETAILS")。例如:
var service = new google.maps.places.PlacesService(map);
var request = {
placeId: PLACE_ID
};
service.getDetails(request, function (place, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
console.log(place);
}
});