Skip to content

Commit 16719b3

Browse files
committed
Fix crash with tiled WMS (fixes #15799)
1 parent b23e29f commit 16719b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/providers/wms/qgswmsprovider.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@ static bool _fuzzyContainsRect( const QRectF& r1, const QRectF& r2 )
511511

512512
void QgsWmsProvider::fetchOtherResTiles( QgsTileMode tileMode, const QgsRectangle& viewExtent, int imageWidth, QList<QRectF>& missingRects, double tres, int resOffset, QList<TileImage>& otherResTiles )
513513
{
514+
if ( !mTileMatrixSet )
515+
return; // there is no tile matrix set defined for ordinary WMS (with user-specified tile size)
516+
514517
const QgsWmtsTileMatrix* tmOther = mTileMatrixSet->findOtherResolution( tres, resOffset );
515518
if ( !tmOther )
516519
return;
@@ -654,6 +657,8 @@ QImage *QgsWmsProvider::draw( QgsRectangle const & viewExtent, int pixelWidth, i
654657
}
655658
else if ( mSettings.mMaxWidth != 0 && mSettings.mMaxHeight != 0 )
656659
{
660+
// this is an ordinary WMS server, but the user requested tiled approach
661+
// so we will pretend it is a WMS-C server with just one tile matrix
657662
tempTm.reset( new QgsWmtsTileMatrix );
658663
tempTm->topLeft = QgsPoint( mLayerExtent.xMinimum(), mLayerExtent.yMaximum() );
659664
tempTm->tileWidth = mSettings.mMaxWidth;

0 commit comments

Comments
 (0)