Closed sheeley820 closed 1 year ago
Hi, thank you for logging this issue.
I did a bit of research to try and see what types of layers will print OK on Firefox and which do not:
L.esri.FeatureLayer
prints OK: https://developers.arcgis.com/esri-leaflet/layers/add-a-feature-layer/
L.esri.tiledMapLayer
prints OK: https://developers.arcgis.com/esri-leaflet/samples/tile-layer-1/
L.esri.basemapLayer
(deprecated) prints fine: https://codepen.io/gavinr/full/VwqbJej
L.esri.Vector.vectorBasemapLayer
does NOT print OK (your original report). : https://developers.arcgis.com/esri-leaflet/maps/display-a-map/
Given all this, it seems like the issue is isolated to L.esri.Vector.vectorBasemapLayer
which is in the esri-leaflet-vector repository. I will move this issue there and we can work on it there.
This package (Esri Leaflet Vector) uses Maplibre GL JS to display the vector tile layers. Checking this behavior on that project's demo page, I see the same issue where Firefox printing is not working:
https://maplibre.org/maplibre-gl-js/docs/examples/add-a-marker/
I suspect that the issue is there, and if we fix the Firefox printing issue within Maplibre GL JS, it will also be fixed within Esri Leaflet Vector. Therefore I think we should log an issue with that project for this issue.
@gavinr-maps Thank you for identifying the underlying issue. I will go ahead and close this issue and open an issue with the maplibre-gl-js
project. I'll let you know if this gets resolved.
Describe the bug
With Chrome / Safari / Edge I am able to print a map that appears in the HTML just fine. However, this is not the case with Firefox.
If you use this page as an example you can see this behavior. Printing this page in a compatible browser will also print the present view of the map element. This is not the case in Firefox. The map will simply appear as a grey box.
The issue does not appear to be solely related to the use of the
canvas
element, as I am able to print various other canvas elements, including those with animations or other complexities to them. Also the issue does not appear with other Leaflet maps which do not use theesri-leaflet
library.So in all likelihood there is something that could be done on the Firefox side, but also something about the way in which the map is being rendered which makes it incompatible with printing in Firefox.
Reproduction
Attempt to print any Leaflet map which utilizes the
esri-leaflet
library.Logs
System Info
Additional Information
We are attempting to use the following Leaflet plugin (https://github.com/Igor-Vladyka/leaflet.browser.print), which works on all browsers except Firefox. For the life of me I cannot get Firefox to print Esri Leaflet maps, even with every imaginable security feature turned off.