I've been using the Static frontend for protomaps as a way to render a not-really-interactive map without incurring a lot of extra page weight. It's great! I accidentally discovered recently that it's possible to pass in fractional display zoom levels to map instance methods like drawContext or drawCanvas — e.g. await map.drawCanvas(canvas, { x, y }, 15.5) and the canvas rendering basically just works. This can be handy when working with small canvas dimensions, where the whole number zoom levels can force you into too-big or too-small rendering.
The one caveat with fractional display zooms is that the project method returned from these calls doesn't work — something about the coordinate math doesn't appear to sit well with fractional zooms, and the canvas coordinates returned by project are much larger and rendered off screen.
I'm wondering: should fractional zooms theoretically be supported here? I'd be happy to help with a patch if they should work (but don't); but if it's non-standard or not part of the API design to support fractional zooms, I'd be equally happy to close this issue!
I've been using the
Static
frontend for protomaps as a way to render a not-really-interactive map without incurring a lot of extra page weight. It's great! I accidentally discovered recently that it's possible to pass in fractional display zoom levels to map instance methods likedrawContext
ordrawCanvas
— e.g.await map.drawCanvas(canvas, { x, y }, 15.5)
and the canvas rendering basically just works. This can be handy when working with small canvas dimensions, where the whole number zoom levels can force you into too-big or too-small rendering.The one caveat with fractional display zooms is that the
project
method returned from these calls doesn't work — something about the coordinate math doesn't appear to sit well with fractional zooms, and the canvas coordinates returned byproject
are much larger and rendered off screen.I'm wondering: should fractional zooms theoretically be supported here? I'd be happy to help with a patch if they should work (but don't); but if it's non-standard or not part of the API design to support fractional zooms, I'd be equally happy to close this issue!