我正在使用“google Places autocomplete API”来使用 JavaScript 获取有关不同城市的数据,如下所示:
var service = new google.maps.places.Autocomplete(document.getElementById('search-btn'));
service.addListener('place_changed', function () {
var place = service.getPlace();
console.log(place.geometry.location);
});
Run Code Online (Sandbox Code Playgroud)
问题:该对象没有 (lat,lng) 但有此消息
类型错误:“调用者”和“参数”是受限制的函数属性,无法在此上下文中访问。
在 Function.remoteFunction (:3:14)
在 Object.InjectedScript.callFunctionOn (:750:66)