Print Mapbox/Leaflet Map

爱⌒轻易说出口 提交于 2019-12-09 22:48:17

问题


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.

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

  • Pins show up in the wrong position
  • Pins completely disappear

What I also tried:

  • Html2Canvas: That did not work, I guess because the tiles have fixed layouts. The canvas you get back only shows the typical grey/white grid "behind" the map
  • Static MapBox API: I need the pins numbered higher than 9, and the Mapbox API only offers Pins from 0 to 9.

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


回答1:


That CSS snippet did it:

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


来源:https://stackoverflow.com/questions/23220676/print-mapbox-leaflet-map

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!