placeId不作为Places Details搜索的请求参数

时间:2014-08-20 23:59:20

标签: javascript google-maps-api-3 google-places-api

我知道他们只是弃用了ID和引用,并且我在初始搜索时获得了有效的placeIds,但出于某种原因,当我去搜索这样的详细信息时:

function(place_id){

    var request = {
        placeId: place_id
    }

    this.service.getDetails(request, function(data){
        //Da callback
    });
}

我收到一个错误,询问已弃用的字段'引用':

Uncaught Error: Missing parameter. You must specify reference.

感谢您的帮助!

1 个答案:

答案 0 :(得分:3)

这取决于使用的API版本。

当前的发布版本是3.16,您必须使用reference那里

从3.17开始,您可以(并且应该)使用placeId

相关问题