Skip to content
Permalink
Browse files

Fix crash with tiled WMS (fixes #15799)

  • Loading branch information
wonder-sk committed Nov 4, 2016
1 parent b23e29f commit 16719b3f0f166667fdead8731a9ffe7227ab39f8
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/providers/wms/qgswmsprovider.cpp
@@ -511,6 +511,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;
@@ -654,6 +657,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 16719b3

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