Closed habib-farhan closed 6 years ago
Please provide jsbin to debug your code, so I could help you.
Looks like some sort of event handling issue, or just something internally missing for appropriate plugin working functionality.
Or, you can just access everything from your own code. You can find active plugin object here:
map.printControl So you can call internal methods from it directly: Examples: map.printControl._printLandscape(); map.printControl._printPortrait(); map.printControl._printAutoI(); map.printControl._printCustom();
and it will start printing functionality from you click event handler.
Regards, Igor
Zombie issue, but how do you stop the icon appearing on the map?
.leaflet-control-browser-print { display: none; }
Excellent! thanks.
Actually, that sadly doesnt work. A style sheet specifying .leaflet-control-browser-print is created in the code and that always overrides what is put in the css.
I can "fix" by finding on DOM after adding control to map and either deleting or hiding it but that does feel clumsy. A config parameter to control whether icon added to leaflet control container would be cleaner.
Added a pull request for doing it.
You can just write it with !important, and that is it.
.leaflet-control-browser-print { display: none!important; }
Anyway - in your PR you hide applying of default styles that needed for tool to work properly.
Whoops! tested wrongly (didnt clear cache). Anyway, not needed as the !important did the trick. Sorry for inconvenience, I have closed pull request. Just as side note, The pull didnt include dist because I couldnt figure out your build tool. I am extreme newbie at Github, but some guidance on that might help others submitting pull requests.
I want the print method to trigger after i pass page and orientation to it. how do i go about? what should i call in my printMyMap function given below?
var printMyMap = function (layout, orientation) { // my code here }
the above function will be called on click of a button. ANY help that i can get?
I want to have the print button outside the map, so i appended that button on a div outside the map, but nothing happend when i click on the options. Any advice?