Error in callback for watcher "center": "TypeError: Cannot read property "centerAndZoom" of undefined"
Cannot read property" centerAndZoom" of undefined
Why do you keep reporting undefined
<div id="map">
<baidu-map class="bm-view" ak="fKU9vX6h1mmAiuiopj7aLSx14VK4ZELq" id="allmap" :center="center" :zoom="zoom" @ready="handler">
</baidu-map>
</div>
handler ({ BMap, map }) {
setTimeout(() => {
map = new BMap.Map("allmap")
// var point = new BMap.Point(116.331398, 39.897445)
// map.centerAndZoom(point, 12);
var local = new BMap.LocalSearch(map, {
renderOptions: { map: map }
});
local.search(this.infoDetails.city);
}, 260);
},