打印地图框/传单地图 [英] Print Mapbox/Leaflet Map

查看:84
本文介绍了打印地图框/传单地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打印一个Mapbox地图,上面有自定义的Pins. 在Chrome或Safari上,没有问题,因为我只能使用window.print命令.

I want to print a Mapbox Map, that has custom Pins on it. On Chrome or Safari, there is no problem, because I can just use the window.print command.

在尝试打印时Firefox和IE出现的问题:

The problems I have with Firefox and IE when trying to print:

  • 别针显示在错误的位置
  • 针脚完全消失

我也尝试过:

  • Html2Canvas:没用,我想是因为图块具有固定的布局.您返回的画布仅在地图后面"显示典型的灰色/白色网格
  • 静态MapBox API:我需要编号大于9的引脚,并且Mapbox API仅提供0到9之间的引脚.

您是否有解决此问题的好主意? 有机会将静态Mapbox API与自定义引脚一起使用吗?

Do you have any good idea how to solve this problem? Is there a chance to use the static Mapbox API with custom pins?

推荐答案

该CSS代码段已做到:

That CSS snippet did it:

.leaflet-container img { max-width:none!important; }

这篇关于打印地图框/传单地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆