init() {
// 解决地图导出图片出现空白
this.$nextTick(() => {
HTMLCanvasElement.prototype.getContext = (function (origFn) {
return function (type, attributes) {
if (type === ‘webgl’) {
attributes = Object.assign({}, attributes, {
preserveDrawingBuffer: true,
})
}
return origFn.call(this, type, attributes)
}
})(HTMLCanvasElement.prototype.getContext)
})
},