Eddie-Larsson / mapbox-print-pdf

A library for saving high resolution versions of mapbox-gl maps to a pdf with an optional header and/or footer that scales with the size of the format.
https://eddie-larsson.github.io/mapbox-print-pdf/
MIT License
51 stars 17 forks source link

Non full width header #8

Open reyemtm opened 4 years ago

reyemtm commented 4 years ago

I cant seem to wrap my head around the header and footer scaling, and where the size of the map gets determined. What I am trying to do is have another element on the side of the page (for a legend), instead of on the top or bottom (due to an unknown number of items in the legend). So, is it possible to either create a new html element for this sidebar, or push the header to the side of the document and not be 100% width, or maybe push the map x pixels to the left or right?

Thanks

reyemtm commented 4 years ago

In case anyone stumbles across this, I figured out a workaround to add different div elements. I created another addHTMLObect function in html-container.js that adds a div with a fixed position and z-index of 1, forcing this div to overlap the map. I just pass the header to this function instead of the normal function and voila, we now have a legend. Thanks so much for this awesome plugin!

img