鍍金池/ 問(wèn)答/HTML/ vue調(diào)用百度地圖問(wèn)題

vue調(diào)用百度地圖問(wèn)題

clipboard.png

clipboard.png

如果local.search('北京');為什么search事件onSearchComplete沒(méi)反應(yīng)

回答
編輯回答
選擇

你在onSearchComplete里面打印日志看看是不是真的執(zhí)行。我覺(jué)得是你代碼寫(xiě)錯(cuò)了。this.map 的 this不對(duì)。

search () {
    var vm = this;
    ....
         vm.map.centerAndZoom(point, 18);
    ....
}
2017年3月21日 15:13