Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete preview in google chrome #96

Open
velocat opened this issue Oct 1, 2020 · 5 comments
Open

Incomplete preview in google chrome #96

velocat opened this issue Oct 1, 2020 · 5 comments

Comments

@velocat
Copy link

velocat commented Oct 1, 2020

Can you please tell me what could be the problem?
The Google Chrome (vers 85.0.4183.121, 64bit) print preview does not display most of the images, such as tiles, markers, etc.
In other browsers, everything is ok.
Perhaps this is a problem with the configuration of the browser itself?
I would very much like to somehow solve this problem, thanks in advance

print

@Igor-Vladyka
Copy link
Owner

Hello.

Looks like underlayers is not loaded. What are you using as underlayer? Right now plugin supports only raster layers.

Also, please show how do you configure map and plugin itself.

Regards,
Igor

@velocat
Copy link
Author

velocat commented Oct 1, 2020

I'm use https://github.com/coryasilva/Leaflet.ExtraMarkers for markers
And https://github.com/leaflet-extras/leaflet-providers for tiles

var mymap = L.map('mapid', opts.map); 
	
var baseLayers = {
	'OpenStreetMap': L.tileLayer.provider('OpenStreetMap.Mapnik'),
	'OpenStreetMap H.O.T.': L.tileLayer.provider('OpenStreetMap.HOT'),
	'OpenTopoMap':  L.tileLayer.provider('OpenTopoMap'),
	'CyclOSM': L.tileLayer.provider('OpenStreetMap.CyclOSM'),
        //other
};
	
baseLayers['OpenStreetMap'].addTo(mymap);

.....

L.control.browserPrint({
        printModes: [
		L.control.browserPrint.mode.landscape(L._("Landscape")), 
		L.control.browserPrint.mode.portrait(L._("Portrait")), 
		L.control.browserPrint.mode.auto(L._("Auto")), 
		L.control.browserPrint.mode.custom(L._("Select area"))
	],
}).addTo(mymap);

Markers is a class for leaflet-markers-icon. They use png as a background.

If one would think that the problem is in the marker plugin, then it is not clear why the map tiles are also not displayed?

@Igor-Vladyka
Copy link
Owner

Hello.

No idea what is going you. Debugging needed. If you can make a simple demo that reproduce the issue, I will take a look. Thanks!

Regards,
Igor

@velocat
Copy link
Author

velocat commented Feb 3, 2022

The problem with displaying some images is due to the fact that bootstrap is being used.
He has styles for @media print that redefine images with a white background and black color.
The only way to influence this is to make changes to the css bootstrap file.
For example, as you can see above in the picture, the marker icons were not displayed when using the Leaflet Easy button plugin.

In this example, in file bootstrap.css, I simply forbade the application of these rules for markers with a class .extra-marker

@media print{
  *:not(.extra-marker),
  :after:not(.extra-marker),
  :before:not(.extra-marker) {
    color:#000 !important;
    text-shadow:none !important;
    background:0 0 !important;
   -webkit-box-shadow:none !important;
    box-shadow:none!important
}

print

I hope this helps someone :)

PS I found the way to solve the issue here:
https://progi.pro/bootstrap-print-css-udalyaet-cvet-fona-11590430#

@Igor-Vladyka
Copy link
Owner

@velocat thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants