mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-23 19:25:55 +01:00
Added support for overzoom
This commit is contained in:
parent
38b6e2320b
commit
39ffdaf616
@ -79,16 +79,17 @@ bool PBFHandler::read(QImage *image)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ok;
|
QList<QByteArray> list(format().split(';'));
|
||||||
int zoom = format().toInt(&ok);
|
int zoom = list.size() ? list.first().toInt() : 0;
|
||||||
|
int overzoom = (list.size() > 1) ? list.at(1).toInt() : 0;
|
||||||
|
|
||||||
QSize size = _scaledSize.isValid()
|
QSize size = _scaledSize.isValid()
|
||||||
? _scaledSize : QSize(TILE_SIZE, TILE_SIZE);
|
? _scaledSize : QSize(TILE_SIZE, TILE_SIZE);
|
||||||
QPointF scale = _scaledSize.isValid()
|
QPointF scale((qreal)size.width() / (TILE_SIZE << overzoom),
|
||||||
? QPointF((qreal)_scaledSize.width() / TILE_SIZE,
|
(qreal)size.height() / (TILE_SIZE << overzoom));
|
||||||
(qreal)_scaledSize.height() / TILE_SIZE) : QPointF(1.0, 1.0);
|
|
||||||
*image = QImage(size, QImage::Format_ARGB32_Premultiplied);
|
*image = QImage(size, QImage::Format_ARGB32_Premultiplied);
|
||||||
Tile tile(image, ok ? zoom : -1, scale);
|
Tile tile(image, zoom, scale);
|
||||||
|
|
||||||
_style->render(data, tile);
|
_style->render(data, tile);
|
||||||
|
|
||||||
|
@ -2265,7 +2265,6 @@
|
|||||||
"source": "openmaptiles",
|
"source": "openmaptiles",
|
||||||
"source-layer": "building",
|
"source-layer": "building",
|
||||||
"minzoom": 13,
|
"minzoom": 13,
|
||||||
"maxzoom": 14,
|
|
||||||
"layout": {
|
"layout": {
|
||||||
"visibility": "visible"
|
"visibility": "visible"
|
||||||
},
|
},
|
||||||
@ -4059,4 +4058,4 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": "osm-liberty"
|
"id": "osm-liberty"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user