Index: src/app/qgswmssourceselect.cpp =================================================================== --- src/app/qgswmssourceselect.cpp (revision 15800) +++ src/app/qgswmssourceselect.cpp (working copy) @@ -511,11 +511,18 @@ QString crs; QString connInfo = connectionInfo(); + QString connArgs; + if ( lstTilesets->selectedItems().isEmpty() ) { collectSelectedLayers( layers, styles ); crs = mCRS; format = mFormats[ mImageFormatGroup->checkedId()]; + + if ( mTileWidth->text().toInt() > 0 && mTileHeight->text().toInt() > 0 ) + { + connArgs = QString( "tiled=%1;%2" ).arg( mTileWidth->text().toInt() ).arg( mTileHeight->text().toInt() ); + } } else { @@ -525,11 +532,14 @@ format = item->data( Qt::UserRole + 2 ).toString(); crs = item->data( Qt::UserRole + 3 ).toString(); - QString connArgs = QString( "tiled=%1;%2;%3" ) - .arg( item->data( Qt::UserRole + 4 ).toInt() ) - .arg( item->data( Qt::UserRole + 5 ).toInt() ) - .arg( item->data( Qt::UserRole + 6 ).toStringList().join( ";" ) ); + connArgs = QString( "tiled=%1;%2;%3" ) + .arg( item->data( Qt::UserRole + 4 ).toInt() ) + .arg( item->data( Qt::UserRole + 5 ).toInt() ) + .arg( item->data( Qt::UserRole + 6 ).toStringList().join( ";" ) ); + } + if ( !connArgs.isEmpty() ) + { if ( connInfo.startsWith( "username=" ) || connInfo.startsWith( "ignoreUrl=" ) ) { connInfo.prepend( connArgs + "," ); Index: src/providers/wms/qgswmsprovider.cpp =================================================================== --- src/providers/wms/qgswmsprovider.cpp (revision 15800) +++ src/providers/wms/qgswmsprovider.cpp (working copy) @@ -545,22 +545,28 @@ else { mTileReqNo++; + double vres = viewExtent.width() / pixelWidth; - // find nearest resolution + double tres = vres; int i; - for ( i = 0; i < mResolutions.size() && mResolutions[i] < vres; i++ ) - QgsDebugMsg( QString( "skipped res: %1:%2" ).arg( i ).arg( mResolutions[i] ) ); + if ( mResolutions.size() > 0 ) + { - if ( i == mResolutions.size() || - ( i > 0 && vres - mResolutions[i-1] < mResolutions[i] - vres ) ) - { - QgsDebugMsg( "back to previous res" ); - i--; + // find nearest resolution + for ( i = 0; i < mResolutions.size() && mResolutions[i] < vres; i++ ) + QgsDebugMsg( QString( "skipped res: %1:%2" ).arg( i ).arg( mResolutions[i] ) ); + + if ( i == mResolutions.size() || + ( i > 0 && vres - mResolutions[i-1] < mResolutions[i] - vres ) ) + { + QgsDebugMsg( "back to previous res" ); + i--; + } + + tres = mResolutions[i]; } - double tres = mResolutions[i]; - // clip view extent to layer extent double xmin = qMax( viewExtent.xMinimum(), layerExtent.xMinimum() ); double ymin = qMax( viewExtent.yMinimum(), layerExtent.yMinimum() ); @@ -2136,7 +2142,7 @@ return false; } - if ( mTiled ) + if ( mTiled && mResolutions.size() > 0 ) { QString layers = activeSubLayers.join( "," ); QString styles = activeSubStyles.join( "," ); Index: src/ui/qgswmssourceselectbase.ui =================================================================== --- src/ui/qgswmssourceselectbase.ui (revision 15800) +++ src/ui/qgswmssourceselectbase.ui (working copy) @@ -182,8 +182,26 @@ Image encoding + gbCRS + + + + Save + + + + + + + Load connections from file + + + Load + + + @@ -203,7 +221,7 @@ - + Coordinate Reference System @@ -213,7 +231,7 @@ - + false @@ -223,26 +241,30 @@ + + + + 9999; + + + + + + + Tile size + + + + + + + 9999; + + + - - - - Save - - - - - - - Load connections from file - - - Load - - -