-
Notifications
You must be signed in to change notification settings - Fork 34
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
Mobile devices (@2x image) problem #15
Comments
Ok, I will look into this. Do you by chance have a map that I can test this with? |
Yes, check here: http://test.bradypus.net/mb/client/ |
Hmm, interesting. I seem to have the same problem on Chrome on my MacBook. The map is just blank and I see a bunch of 404s. It turns out that Mapbox.js has changed something; they now automatically detect Retina displays and try to serve up @2x images if a Retina screen is detected. That's a good thing, but so far it works on MapBox's own servers, but not with mine. I think you can also switch off the detection (in MapBox.js) and force it to use regular sized tiles. Anyway, there is a slight issue if we want to support this - after looking at the (ridiculously sparse) MBTiles specifications I don't think it is possible to include both regular (256x256 pixels) and retina images (512x512 pixels) in your mbtiles file. A quick glance at TileMill seems to confirm this (unless I overlooked). That leaves three options to address this issue:
I think I like the second approach best, but I'm not sure if the end result would be satisfactory. Hmm. Any thoughts on this? (This is MapBox's section on Retina maps, by the way: https://www.mapbox.com/tilemill/docs/guides/high-resolution-tiles/ - They seem to suggest two different tilesets, as in option 3) |
The second approach seems the best, maybe some test can be done in a separate branch. Anyway the third also can be implemented and documented: if a |
Exactly, that was what I was thinking too. For Retina requests I think I'll first check for a *@2x.mbtiles file, and use that if it exists, and if it doesn't - I think I'll actually serve regular sized images (option 1). I'm a bit afraid that combining smaller images into one will mean that the text will end up looking really tiny, which would make the map unusable. This is at least what the MapBox page from above seems to hint at. I might include it in the code anyway, though - and maybe include a configuration option to switch it on or off. |
That would be great! I'm looking forward to test it! |
Hi jbogdani! In the precious free time I have I managed to actually sit down and implement this. The latest version should now properly support Retina maps. Can you please test it? Basically, what it does is look for a Retina version of the map (named "@2x.mbtiles"), and serve tiles from that file if the user accesses the map from a Retina device. If that file does not exist, it will serve tiles from the regular/normal .mbtiles file as usual. Does it work for you? |
Hello, |
Great! Awesome. |
Hello,
first of al thank you for this piece of software. It works wonderfully. I noticed today that the server does not support
@2x
images. I created a map and it worked perfectly on desktop, but when I tried to load it in tablets and smartphones no tiles were visible. Remore debugging showed a list of 404 errors about missing*@2x.png
tiles.Any help would be much appreciated
The text was updated successfully, but these errors were encountered: