Feature Request: static map rotation
I have a use case for static map rotation and have hacked a quick experiment which seems to work so far as a proof of concept:
https://neilvv.github.io/protomaps.js/rotate.html https://github.com/neilvv/protomaps.js
I know from a previous issue that this is something you were planning so if it's anywhere close to how you'd want it done I could try to get it into a decent state for a PR (remove dependency on gl-matrix, optimize bounding box, tests, missed considerations etc.). ...or if not go for a complete rewrite :-)
The only really ugly hack which suggests an api change might be needed is in passing rotation context to a label Symbolizer, there's no obvious way to do this that I could see and ended up adding an attribute to DrawExtra which seems wrong. Or should the (counter)rotation be done earlier/elsewhere? Maybe I'm thinking about it wrong. UPDATE - I am thinking about it wrong, label collisions not working for obvious reasons. I'll have another try.
Anyway, thanks for a great project, I've learnt a lot.
Nice job! This is something I'm definitely interested in adding in the long term; the tricky part would be rotation with Leaflet, which I believe is the frontend most people are using, and figuring out how tile windowing / panning + zoom would work with rotation.
I wonder if a cleaner way to do this without having to add more stuff to the label symbolizer API is to express the rotation as a property of the Labeler, so that all the layout and bounding boxes are axis-aligned at the final angle already. This would probably be how I'd implement it for both the Static map and Leaflet case in a unified way, but I haven't thought through the consequences fully.
I'm going to close this - my recommendation now is that most greenfield projects, especially those that require fractional zooming and rotation, should use MapLibre GL JS. I'm currently doing some housekeeping to establish that as the renderer of first choice, though ~protomaps.js~ protomaps-leaflet has a specific niche, which is lightweight compatibility with existing Leaflet apps.