为什么同样的写法会报错,: Cannot read property 'Hk' of undefined,这个是百度地图出错。
lt: function(a, b) {
var c = {
center: this.wc(),
zoom: this.ga()
};
if (!a || !a instanceof gb && 0 === a.length || a instanceof gb && a.Cj())
return c;
var d = [];
a instanceof gb ? (d.push(Ya(a.pf(), this)),
d.push(Ya(a.xe(), this))) : d = a.slice(0);
for (var b = b || {}, e = [], f = 0, g = d.length; f < g; f++)
e.push(this.Ld.Hk(Ya(d[f], this), this.Sb));
d = new gb;
for (f = e.length - 1; 0 <= f; f--)
d.extend(e[f]);
if (d.Cj())
return c;
c = d.pc();
e = this.eS(d, b);
b.margins && (d = b.margins,
f = (d[1] - d[3]) / 2,
d = (d[0] - d[2]) / 2,
g = this.oa().yc(e),
b.offset && (f = b.offset.width,
d = b.offset.height),
c.lng += g * f,
c.lat += g * d);
c = this.Ld.th(c, this.Sb);
return {
center: eb(c, this),
zoom: e
}
},
vue-baidu-map根据标注点坐标范围计算显示缩放级别zoom自适应显示地根据标注点坐标范围计算显示缩放级别zoom自适应显示地 vue-baidu-map使用如下;