-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
Update base_tile_provider.dart to use retinaMode option #1666
Conversation
It seems if a urlTemplate contained a {r} it was always populated with a '@2x', instead of optionally setting that if the `TileLayer` `retina` argument was set to true.
This is actually a common misconception, although the docs could be cleared up a bit (did I do this on the online docs?).
However, I do think this is non-standard behaviour, and potentially needs changing - what's the point of '{r}' if '@2x' can be used instead. But as it stands, this is actually the correct behaviour. More discussion is needed to find whether this should be changed, and if it should, documentation also needs changing, amongst potentially other things. See this extract of the somewhat self-contradictory with the rest of the message and unclear documentation (I would imagine caused by this exact confusion) on
|
Thanks for the detailed response. Confusing for sure. I just sent over #1668 to add an Example page with a retina toggle (before reading your response). To help me understand (and I'm happy to propose doc fixes), here are some examples
So Flutter Map needs to fill a 256x256 square on the screen, and it'll fetch either of these, and whatever the returned image size, it will put it into the 256x256 square.
Next, I don't know how to think about the fact mapBox let's you ask for 512 tiles (e.g this), but to use them correctly, TileLayer's tileSize should be set to 512? so #3 seems wasteful. Should the correct behaviour be, if the TileProvider supports Retina, then @2x is added, if it does not it should be simulated, but in either case retina should not be used unless retinaMode is set to true? The recommendation could continue to be to set retinaMode true for devices dpi > 1. |
Also see #1668 (comment). Your point 3 is correct from my understanding. My suggestion would be that
I have no idea how this should interact with different tile sizes, I can only think of tiles as 256px :D |
Ok, so your proposal seems good. I'm happy to send the PR your way (unless you are half way to finishing it). I can also file a bug, with all these details and proposal, instead of designing this on a closed PR :)? As for tileSize, from your testing in #1668 it seems clearly broken. Perhaps deprecate/big red warning? Either way I'm happy to file a bug to address that. |
I haven't started the PR (in fact, it's gone 10pm here), so I'm happy for you to do that if you're up for it. Then a bug report is needed for the tile size issue. (You seem to be quite involved suddenly, and we're actually looking for more maintainers! If you have the spare time for a while, please consider applying (see the v6 docs > Contributing), but no worries at all if not, your contributions are hugely appreciated!) |
Bug for the tileSize issue: #1669 Bug/FR for resolving retina issues: #1670 As for being a maintainer, I'll respectfully decline for now, as I honestly don't think I'll be active enough. But I'm using flutter_maps in a project, and as I progress I'd be happy to continue to contribute to the project. |
Thanks :) No worries at all about not wanting to be a maintainer, your contributions are always greatly appreciated! |
It seems if a
urlTemplate
contained a{r}
it was always populated with a '@2x', instead of optionally setting that if theTileLayer
retina
argument was set to true.