High resolution tiles?
Is there a setting or option for increasing the map resolution (e.g., retina tiles)?
I know tileSize can be used to increase the map resolution with Leaflet, but I don't see this as an option to protomapsL.leafletLayer. Is there a way to do this?
The tile resolution should match your devicePixelRatio and be the ideal resolution automatically, so there isn't a way to set it:
https://github.com/protomaps/protomaps-leaflet/blob/main/src/frontends/leaflet.ts#L107
Thanks, I see that now. I was using it in a headless environment, and was able to apply it by setting the deviceScaleFactor.
It would be great if this could be made into an optional parameter (defaulting to devicePixelRatio) for such cases. I'd be happy to submit a pull request.
In the case you described shouldn't setting deviceScaleFactor in Puppeteer be sufficient for control over this?
I suppose my concern is introducing side effects in my application by changing deviceScaleFactor. However, it does seem to work. I just prefer more explicit parameters to clearly define behaviour, rather than depending on a global that's set in a completely different area of my application. A parameter would make it clear.
I agree, do you want to try a PR where devicePixelRatio is an option to leafletLayer?
Sure, I'd be happy to. However, I see window.devicePixelRatio is also used in a few other locations. I could extend these interfaces in a similar way.
Should the parameter be named scale or something, which defaults to window.devicePixelRatio? Naming the parameter devicePixelRatio might be confusing since you're not actually changing the device pixel ratio. :)
scale can mean something different and I think devicePixelRatio used like
this.devicePixelRatio || window.devicePixelRatio
is the most straightforward...
since you're not actually changing the device pixel ratio
It seems fine to me if the main use case is for headless "devices", right?