Added HiDPI and Overzoom sections

This commit is contained in:
2023-12-10 15:53:19 +01:00
committed by GitHub
parent 6e1bc09d62
commit 98933deb0e

View File

@ -25,6 +25,11 @@ to the functions:
QPixmap pm; QPixmap pm;
pm.loadFromData(tileData, QByteArray::number(zoom)); pm.loadFromData(tileData, QByteArray::number(zoom));
``` ```
For a complete code sample see the [pbf2png](https://github.com/tumic0/pbf2png)
conversion utility.
### HiDPI
The plugin supports vector scaling using QImageReader's setScaledSize() method, The plugin supports vector scaling using QImageReader's setScaledSize() method,
so when used like in the following example: so when used like in the following example:
```cpp ```cpp
@ -34,6 +39,7 @@ reader.read(&image);
``` ```
you will get 1024x1024px tiles with a pixel ratio of 2 (= HiDPI tiles). you will get 1024x1024px tiles with a pixel ratio of 2 (= HiDPI tiles).
### Overzoom
Since version 2.7 tile overzoom is supported. If you set *format* to Since version 2.7 tile overzoom is supported. If you set *format* to
`$zoom;$overzoom`: `$zoom;$overzoom`:
```cpp ```cpp
@ -45,9 +51,6 @@ you will get (512<<overzoom)x(512<<overzoom)px tiles with a pixel ratio of 1.
When overzoom is combined with setScaledSize(), the base size is the overzoomed When overzoom is combined with setScaledSize(), the base size is the overzoomed
tile size. tile size.
For a sample code see the [pbf2png](https://github.com/tumic0/pbf2png)
conversion utility.
## Styles ## Styles
The map style is loaded from the The map style is loaded from the
[$AppDataLocation](http://doc.qt.io/qt-5/qstandardpaths.html)/style/style.json [$AppDataLocation](http://doc.qt.io/qt-5/qstandardpaths.html)/style/style.json