Closed sheeley820 closed 1 year ago
Thank you for the PR.
If we Expose the MaplibreGLJSLayer Variable (#197), this PR #199 is not needed, correct? Because you could modify the preserveDrawingBuffer
property on the exposed MaplibreGLJSLayer Variable.
@gavinr-maps So technically it is possible to do the following even without MaplibreGLJSLayer
being exposed:
const vector = L.esri.Vector.vectorBasemapLayer(basemapEnum, {
apiKey: apiKey
})
vector.options.preserveDrawingBuffer = true
vector.addTo(map)
And this resolves the printing error, but for me it seems like since we already allow MapLibre
options to be passed directly into the VectorTileLayer
initialization (pane
, opacity
) it would make sense to allow perserveDrawingBuffer
to be passed in through the VectorBasemapLayer
and VectorTileLayer
constructors as well.
Looks good. In the future if people need access to more options, we should introduce a mapLibreMapOptions
property. But we can avoid prematurely optimizing by just going with this for now.
This was released in v4.2.0.
It was discovered that printing maps rendered with
esri-leaflet-vector
does not work in Firefox.An issue was created here.
This PR fixes that issue by allowing the user to set
preserveDrawingBuffer
totrue
, which resolves the issue. It is set tofalse
by default in themaplibre-gl-js
project in thescr/ui/map.ts
file for performance optimizations. Adding the ability for a user to toggle this value throughesri-leaflet-vector
, but maintaining a default offalse
will help users who want to provide printing capabilities, while maintaining the performance optimization for those who do not have this need.