Skip to content
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

OpenLayers Integration: Larger tile sizes for higher resolution monitors #16

Open
andreasneumann opened this issue Nov 14, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@andreasneumann
Copy link
Member

andreasneumann commented Nov 14, 2023

It would be useful to render larger tiles for high-dpi monitors.

One could have a switch depending on the screen size. E.g. when a browser window is larger than 2000 px on either width or height, then the tile size could switch from 256 px tiles to 512 px tiles.

of course, this is also low priority.

@boardend
Copy link
Collaborator

If your concern is about using all the physical pixels available on a high dpi device, then this is already in place (see the QgisXYZDataSource). The pixelRatio is detected/managed by OpenLayers, multiplied with the default tile size (which is 265px in a xyz source) and also passed to the qgis-js renderXYZTile-function to be taken into account for symbols and fonts. So on a HighDPI device (window.devicePixelRatio = 2) one will get 512px (physical pixels) tiles which will be rendered to 256 CSS pixels (the same principle as demonstrated in the High DPI WMTS example)

If your concern is about the amount of parallel renderXYZTile-function calls, we could also go for a custom and dynamic TileGrid with an increased tile size on large maps. But this would mean that we're not in the commonly used XYZ scheme anymore and that the layer has to be recreated when the map size changes (demonstrated in the WMS 512x256 Tiles example)

We could also try to make the QgisCanvasDataSource cache the rendered tiles, as demonstrated in the Tiled WMS example.

@boardend boardend added the enhancement New feature or request label Nov 15, 2023
@boardend boardend self-assigned this Jun 2, 2024
@boardend
Copy link
Collaborator

boardend commented Jun 2, 2024

We should definitely switch to 512x512px tiles (based on the feedback of Andreas Hocevar)

@boardend boardend changed the title Larger tile sizes for higher resolution monitors OpenLayers Integration: Larger tile sizes for higher resolution monitors Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants