Igor-Vladyka / leaflet.browser.print

A leaflet plugin which allows users to print the map directly from the browser
https://igor-vladyka.github.io/leaflet.browser.print/
MIT License
155 stars 76 forks source link

Print map with selected overlapping layer #14

Closed TharaCJ closed 6 years ago

TharaCJ commented 6 years ago

If the map has overlapping layers , is there any way to print map with selected layer as the printLayer ?

Igor-Vladyka commented 6 years ago

Hi there,

Not yet. I will add this possibility to the next version.

mgurjanov commented 6 years ago

Hi, Thank you for the nice plugin. I did connect it to a Drupal site using Leaflet, and it prints data generated by Drupal (points, polygons etc.) it prints the last layer that I enable through Leaflet layer control, but nothing else. Base layer (which is tile layer), or any other previously enabled transparent layers (that are overlays) are not printed. Base layer is printed only if no other overlays are enabled. Does, for this to work, I need to do something, or you should add support for it? Thank you for answering.

Igor-Vladyka commented 6 years ago

Hi,

Looks like there is some wrong configuration of the map or plugin itself. Please create a jsbin to show the problem and I will try to help.

Regards Igor

mgurjanov commented 6 years ago

Hi, The website is setup here: website example . On the frontpage there is a map. I'm afraid if I make jsbin that it won't show us the right results. Can you learn something directly from the website? I know that in Leaflet implementation in Drupal there is distinction between base layers and overlay layers. But anyhow your plugin prints only the last one one enables. Drupal generated content like points, shapes etc. are always printed. I see that in your examples you add tile layer to your plugin when initiating script, and I cannot do that in my case. I just enabled your plugin through custom Drupal module by getting Leaflet map object on the page and attaching your plugin to it.

(function($) { var myMap = {}; // Get leaflet map object for later usage $(document).bind('leaflet.map', function(e, map, lMap){ myMap = lMap; });

and than latter I add this:

L.browserPrint().addTo(myMap);

Thank you for your help.

Igor-Vladyka commented 6 years ago

Hi,

I see ... I think I know where the problem is. Will try to fix it soon.

mgurjanov commented 6 years ago

Hi, Glad you found out what it was. Will be waiting for your update. Thanks again.

mgurjanov commented 6 years ago

Hi Igor, Did you maybe have time to work on this matter? May I be of some assistance? Thank you.

Igor-Vladyka commented 6 years ago

Hi,

I'm still finding a way to get the active layer from leaflet map itself. So, no solution for now.

2017-12-27 17:17 GMT+08:00 mgurjanov notifications@github.com:

Hi Igor, Did you maybe have time to work on this matter? May I be of some assistance? Thank you.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Igor-Vladyka/leaflet.browser.print/issues/14#issuecomment-354081972, or mute the thread https://github.com/notifications/unsubscribe-auth/AFJl_qYa0WMUxB13wqDqMeBTSK_JK8Okks5tEgs3gaJpZM4Q7x9r .

--

Regards, Igor Vladyka

Igor-Vladyka commented 6 years ago

Seems like a can't reproduce your issue anymore. Please check it one more time on your side and if the problem still exists, please reopen this issue.