Skip to content

Commit

Permalink
Fix crash with tiled WMS (fixes #15799)
Browse files Browse the repository at this point in the history
(cherry picked from commit 16719b3)
  • Loading branch information
wonder-sk committed Nov 4, 2016
1 parent 9a2ca1c commit 24361c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ static bool _fuzzyContainsRect( const QRectF& r1, const QRectF& r2 )

void QgsWmsProvider::fetchOtherResTiles( QgsTileMode tileMode, const QgsRectangle& viewExtent, int imageWidth, QList<QRectF>& missingRects, double tres, int resOffset, QList<TileImage>& otherResTiles )
{
if ( !mTileMatrixSet )
return; // there is no tile matrix set defined for ordinary WMS (with user-specified tile size)

const QgsWmtsTileMatrix* tmOther = mTileMatrixSet->findOtherResolution( tres, resOffset );
if ( !tmOther )
return;
Expand Down Expand Up @@ -655,6 +658,8 @@ QImage *QgsWmsProvider::draw( QgsRectangle const & viewExtent, int pixelWidth, i
}
else if ( mSettings.mMaxWidth != 0 && mSettings.mMaxHeight != 0 )
{
// this is an ordinary WMS server, but the user requested tiled approach
// so we will pretend it is a WMS-C server with just one tile matrix
tempTm.reset( new QgsWmtsTileMatrix );
tempTm->topLeft = QgsPoint( mLayerExtent.xMinimum(), mLayerExtent.yMaximum() );
tempTm->tileWidth = mSettings.mMaxWidth;
Expand Down

0 comments on commit 24361c5

Please sign in to comment.