Skip to content
Permalink
Browse files

Fix crash with tiled WMS (fixes #15799)

(cherry picked from commit 16719b3)
  • Loading branch information
wonder-sk committed Nov 4, 2016
1 parent 9a2ca1c commit 24361c5349eb31cc70145b830d875ae43dc92786
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/providers/wms/qgswmsprovider.cpp
@@ -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;
@@ -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;

0 comments on commit 24361c5

Please sign in to comment.
You can’t perform that action at this time.