-
Notifications
You must be signed in to change notification settings - Fork 52
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
high-DPI support #16
Comments
srcset may be a good example to follow here. |
IMHO, the first approach is a bit limiting, and the second one a bit cumbersome. The srcset approach would lead to something like:
On the plus side, it's backwardly compatible. On the downside, now you have a commafied list inside an array of strings and extra parsing to do. Something like this maybe?
shrug |
This is backward-compatible. For
Is it needed? In that specific case we could say:
|
Thanks for everyone’s thoughts here. This proposed change will be considered as part of the v4 push #35 |
TileJSON should have a means of:
@2x
,@4x
, etc)Without such a specification, consumers must have hard-coded knowledge of a source's support for high-DPI tiles and typically resort to string munging to generate the appropriate URLs. These are exactly the sort of deficiencies that TileJSON is designed to eliminate.
One approach would be to have an array-valued property that lists supported DPI multipliers and a new interpolation key for tile URL templates. E.g.:
Where it is specified that
{r}
is replaced with the pixel ratio ⇢ string mapping of 1 ⇢ "", 2 ⇢ "@2x", 4 ⇢ "@4x", and consumers may decide which of the pixel ratio options to use based on device characteristics. Alternatively this mapping could be explicitly supplied:These approaches introduce a backward compatibility issue however, in that existing TileJSON consumers will not be prepared to interpolate a new template value and thus cannot consume TileJSON that uses it.
cc @yhahn @mourner @tmcw
The text was updated successfully, but these errors were encountered: