【问题标题】:Loading map marker issue in take print在打印中加载地图标记问题
【发布时间】:2017-06-06 09:42:36
【问题描述】:

我可以在地图上指向标记,并且它在浏览器上可见。但是当我打印相同的内容时,标记在地图上不可见。请帮忙。

<button class="map-print" ng-click="mapprint();">print</button>
[enter image description here][1]<script>
function mapprint(){
    var content = document.getElementById('map_div'); //has to be first. 
    content.style.position = "relative"; 
    content.style.height = contents.firstChild.offsetHeight + "px"; 
    content.style.width = contents.firstChild.offsetWidth + "px"; 
    var win = window.open(); 
    win.document.write(content.innerHTML);
    win.print();
    win.close();    
}

我得到了地图的印刷品。但无法加载地图标记

这是我的网页视图

这是我的地图打印视图

【问题讨论】:

标签: javascript angularjs node.js google-maps google-maps-api-3


【解决方案1】:

Google Maps JavaScript API 不支持打印。看看官方FAQ中的以下回答

https://developers.google.com/maps/faq#print

不支持从 JavaScript API 打印。这是因为常用浏览器的打印支持不一致。我们建议使用静态地图 API 进行打印。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多