【发布时间】:2015-07-10 02:30:45
【问题描述】:
我在取笑 Google Places API,但我在 Autocomplete 中遇到了我不理解的奇怪行为。
这就是我的使用方式:
const AUTOCOMPLETE_OPTIONS = {
types: ['address'],
componentRestrictions: {
country: 'cz'
}
};
this.inputPlaceElement = $('#search-around-input')
this.inputPlaceSearchBox = new google.maps.places.Autocomplete(this.inputPlaceElement[0], AUTOCOMPLETE_OPTIONS);
google.maps.event.addListener(this.inputPlaceSearchBox,'places_changed', () => {
console.log('place change')
})
自动完成输入正常工作,但 place_changed 没有被触发,我尝试了一些东西,从构造函数返回的对象很奇怪。 当我调用方法 getBounds() 或 getPlace() 时,有未定义的
这是对象:我不确定出了什么问题
【问题讨论】:
标签: google-maps autocomplete google-places-api