【发布时间】:2016-06-03 06:44:50
【问题描述】:
我使用 Places API 来获取给定位置附近的餐馆和酒店等地点,并且运行良好。我也想获得给定位置附近的兴趣点或地标。我尝试的内容如下:
var service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: latlng,
radius: 1500,
}, function (results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
var type1 = results[i].types[0];
var type2 = results[i].types[1];
if (type1 == 'point_of_interest' || type2 == 'point_of_interest') {
//process place details
}
}
});
例如:对于巴黎 Champ de Mars 附近的地标搜索,它应该返回相当近的地方,例如埃菲尔铁塔。但是,它只返回酒店和住宿等场所。
如何让它返回给定位置附近的兴趣点?任何有关解决此问题的帮助将不胜感激。
【问题讨论】:
标签: google-maps geolocation google-places-api