
print的js地址:https://github.com/happyport/Mapbox_Print
调用方法:
map._preserveDrawingBuffer=true;
map._render();
const data = map.getCanvas().toDataURL('image/png');
const img=document.createElement('img');
img.src=data;
print(img)
.then(()=>{
map._preserveDrawingBuffer=false;
map._render();
}).catch(err=>{
})
网友评论