1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-20 13:54:24 +02:00

Fixed bounds computation

This commit is contained in:
2019-01-14 23:47:24 +01:00
parent 9d5725f732
commit b8a2b76d7c
3 changed files with 8 additions and 11 deletions

View File

@ -103,10 +103,8 @@ QRectF WMTSMap::bounds()
int WMTSMap::zoomFit(const QSize &size, const RectC &rect)
{
if (rect.isValid()) {
PointD tl(_projection.ll2xy(rect.topLeft()));
PointD br(_projection.ll2xy(rect.bottomRight()));
PointD sc((br.x() - tl.x()) / size.width(), (tl.y() - br.y())
/ size.height());
RectD prect(rect, _projection);
PointD sc(prect.width() / size.width(), prect.height() / size.height());
double resolution = qMax(qAbs(sc.x()), qAbs(sc.y()));
if (_projection.isGeographic())
resolution *= deg2rad(WGS84_RADIUS);