mapbox / mapbox-gl-leaflet

binding from Mapbox GL JS to the Leaflet API
ISC License
522 stars 155 forks source link

Canvas image is blank #148

Closed marshallino16 closed 2 years ago

marshallino16 commented 2 years ago

Hi,

How can we generate an image from the canvas? Everytime we try something we only get a blank white image.

Also reported here: https://github.com/mapbox/mapbox-gl-leaflet/issues/79

Thanks

marshallino16 commented 2 years ago

Find out.

There's a preserveDrawingBuffer option that needs to be set to true.

e.g https://docs.mapbox.com/mapbox-gl-js/api/map/