-
-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle {r} in tile urls for hidpi raster tiles (fix #141) #637
Conversation
This feature is compatible with leafletjs and useful to fetch hidpi tiles for layers that support it.
There are no tests for pixelratio specific behaviour and this patch is rather trivial, so I don't think tests are necessary, but I can add them if requested. I'm also not sure about documentation and changelog entries. So far the documentation only mentions https://github.com/mapbox/tilejson-spec but the code already supports other undocumented variables. So I think its ok to not document it for now. Its probably also not important enough for a changelog entry. |
Bundle size report: Size Change: +20 B
ℹ️ View Details
|
I did test the patch with a raster layer from https://www.thunderforest.com and it works as intended. |
fixes #141 |
I think it's worth a change log entry. I also think there's a unit test that can be enhanced to covert this too. |
Should be ready for merging now. |
👍 Thanks for implementing this. The |
I don't think we should fork the tilejson spec just for documenting but rather document this and other differences of maplibre to the spec in our documentation. Feel free to tackle this yourself if you want as I will not have the time. There seems to be some more documentation in maplibre-gl-native (https://github.com/maplibre/maplibre-gl-native/blob/master/platform/ios/platform/ios/docs/guides/Tile%20URL%20Templates.md) and also already the same feature just with {ratio}. Of course compatiblity to maplibre-gl-native is more important than with leafletjs so I will make a follow up pull request to use ratio instead. |
Replace {r} in tile urls with @2x for devices with a pixelratio > 1.
This feature is compatible with leafletjs and useful to fetch hidpi tiles for
layers that support it.
Launch Checklist