Maps html2canvas谷歌地图市场标签消失-z指数问题?

Maps html2canvas谷歌地图市场标签消失-z指数问题?,maps,html2canvas,Maps,Html2canvas,我在从谷歌地图获取html2canvas生成的图像标签时遇到问题。我尝试使用最新的html2canvas库,因为图像质量要好得多,但标签会出现问题。我的搜索导致了我的z索引问题,但我自己无法处理它。请告知 这是一个工作代码: 形象与问题 html代码: <script src="https://maps.googleapis.com/maps/api/js?callback=initMap" async defer></script> <script s

我在从谷歌地图获取html2canvas生成的图像标签时遇到问题。我尝试使用最新的html2canvas库,因为图像质量要好得多,但标签会出现问题。我的搜索导致了我的z索引问题,但我自己无法处理它。请告知

这是一个工作代码:

形象与问题

html代码:

<script src="https://maps.googleapis.com/maps/api/js?callback=initMap"
    async defer></script>

 <script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js">
</script>
<div id="map" ></div>

<br/>
<input type="button" id="btnSave" value="Save PNG"/>

  <div id="img-out"></div>

将“zIndex:0”添加到标记解决了此问题

let marker = new google.maps.Marker({
          position: pos,
          map: map,
          optimized: false,
          draggable:true,
          label:'1',
          zIndex: 0
        });

将“zIndex:0”添加到标记解决了此问题
#map {
    width: 300px;
    height: 200px;
}
let marker = new google.maps.Marker({
          position: pos,
          map: map,
          optimized: false,
          draggable:true,
          label:'1',
          zIndex: 0
        });