这是保存的leaflet地图
上代码:
html
<div id="map" class="map"></div>
ts代码:
var mapid = document.querySelector('#map');const scale = window.devicePixelRatio;// // 传入节点原始宽高const _width = mapid["offsetWidth"];const _height = mapid["offsetHeight"];var options = { width: _width, height: _height };// html2canvas配置项const ops = {scale: 1,width: _width,height: _height,useCORS: true,allowTaint: false,...options,};html2canvas(mapid, ops).then(canvas => {//获取年月日作为文件名var timers = new Date();var fullYear = timers.getFullYear();var month = timers.getMonth() + 1;var date = timers.getDate();