google-maps-api-3 – Google Maps PlacesService,PlaceResult只返回照片属性数组的一(1)张照片

对Google Maps PlacesService的结果有疑问.生成的PlaceResult对象现在只返回photos属性数组中的一张照片.在过去,情况并非如此,最多返回10张照片.这是改变吗?

示例代码:

var request = {
    reference: place.reference
}
var callback = function(details, status) {
    if (status == google.maps.places.PlacesServiceStatus.OK) {
        alert("Number of photos: " + details.photos.length);
    }
}
var service = new google.maps.places.PlacesService(map);
service.getDetails(request, callback);

fiddle showing an example

最佳答案 在之前已被删除的答案中,我说它一定是谷歌方面的一个错误.

我刚发现这个问题:

https://code.google.com/p/gmaps-api-issues/issues/detail?id=6825&sort=-id&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal

如果我是对的,Google Maps PlacesService是Google Places API的Javascript版本,因此后端代码可能是相同的:这可以解释为什么我们有相同的结果(相同的错误(?)).

希望这可以帮助.

点赞