-
Notifications
You must be signed in to change notification settings - Fork 1.3k
tileSize needs to be a function of device density/contentScaleRatio and not a constant 512. #907
Comments
Yeah I have noticed loafing tiles in high density areas like SF is a bit slow down compared to desktop and the number of tiles could be the problem. /cc @ansis |
|
@1ec5 keep in mind that Android can go beyond 2x to 3x and 4x (so far). |
This is not the right fix. The value of mbgl::util::tileSize should be a function of device density. dpi=1, 256 This way, if two devices have same physical size but different device densites, they would still render the same physical area on earth. This is the value that vector maps provide. Tilesize can be changed dynamically on the client depending on device density. |
The units of tileSize are in 1dpi pixels. So, if the tileSize here is 256 it actually covers 512 pixels on a 2dpi screen. This means that the same tiles are loaded no matter the dpi, which is what you want for vector tiles. For raster layers you probably do want more pixels for higher dpi screens. This will be implemented by loading higher resolution tiles, not by loading more tiles of the same resolution from higher zoom level. See #919. |
Thanks for the explanation. |
No need to load higher-resolution vector tiles for HiDPI displays. Fixes #907.
This is a low hanging fruit to improve tile load/parsing performance by 4x on retina/higher resolution devices.
Currently for the same zoom level, on retina devices number of tiles loaded is 4x the number of tiles loaded on non-retina devices. For Vector sources, there is no need to put this limitation esp. given each vector tile has 4096x4096 resolution.
The text was updated successfully, but these errors were encountered: