@@ -162,7 +162,7 @@ void QgsWmsProvider::parseUri( QString uriString )
162
162
if ( uri.hasParam ( " tileDimensions" ) )
163
163
{
164
164
mTiled = true ;
165
- foreach ( QString param, uri.params ( " tileDimensions" ) )
165
+ foreach ( QString param, uri.params ( " tileDimensions" ) )
166
166
{
167
167
QStringList kv = param.split ( " =" );
168
168
if ( kv.size () == 1 )
@@ -344,7 +344,7 @@ void QgsWmsProvider::addLayers( QStringList const &layers,
344
344
mActiveSubStyles += styles;
345
345
346
346
// Set the visibility of these new layers on by default
347
- foreach ( const QString &layer, layers )
347
+ foreach ( const QString &layer, layers )
348
348
{
349
349
mActiveSubLayerVisibility [ layer ] = true ;
350
350
QgsDebugMsg ( " set visibility of layer '" + layer + " ' to true." );
@@ -465,7 +465,7 @@ void QgsWmsProvider::setImageCrs( QString const & crs )
465
465
mTileMatrixSet = &mTileMatrixSets [ mTileMatrixSetId ];
466
466
QList<double > keys = mTileMatrixSet ->tileMatrices .keys ();
467
467
qSort ( keys );
468
- foreach ( double key, keys )
468
+ foreach ( double key, keys )
469
469
{
470
470
resolutions << key;
471
471
}
@@ -597,9 +597,14 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
597
597
setQueryItem ( url, " FORMAT" , mImageMimeType );
598
598
599
599
// DPI parameter is accepted by QGIS mapserver (and ignored by the other WMS servers)
600
+ // map_resolution parameter works for UMN mapserver
601
+
602
+ // Different WMS servers have DPI parameters:
600
603
if ( mDpi != -1 )
601
604
{
602
- setQueryItem ( url, " DPI" , QString::number ( mDpi ) );
605
+ setQueryItem ( url, " DPI" , QString::number ( mDpi ) ); // QGIS server
606
+ setQueryItem ( url, " MAP_RESOLUTION" , QString::number ( mDpi ) ); // UMN mapserver
607
+ setQueryItem ( url, " FORMAT_OPTIONS" , QString ( " dpi:%1" ).arg ( mDpi ) ); // geoserver
603
608
}
604
609
605
610
// MH: jpeg does not support transparency and some servers complain if jpg and transparent=true
@@ -948,7 +953,7 @@ void QgsWmsProvider::tileReplyFinished()
948
953
#endif
949
954
#if defined(QGISDEBUG) && (QT_VERSION >= 0x40700)
950
955
QgsDebugMsgLevel ( " raw headers:" , 3 );
951
- foreach ( const QNetworkReply::RawHeaderPair &pair, reply->rawHeaderPairs () )
956
+ foreach ( const QNetworkReply::RawHeaderPair &pair, reply->rawHeaderPairs () )
952
957
{
953
958
QgsDebugMsgLevel ( QString ( " %1:%2" )
954
959
.arg ( QString::fromUtf8 ( pair.first ) )
@@ -959,7 +964,7 @@ void QgsWmsProvider::tileReplyFinished()
959
964
QNetworkCacheMetaData cmd = QgsNetworkAccessManager::instance ()->cache ()->metaData ( reply->request ().url () );
960
965
961
966
QNetworkCacheMetaData::RawHeaderList hl;
962
- foreach ( const QNetworkCacheMetaData::RawHeader &h, cmd.rawHeaders () )
967
+ foreach ( const QNetworkCacheMetaData::RawHeader &h, cmd.rawHeaders () )
963
968
{
964
969
if ( h.first != " Cache-Control" )
965
970
hl.append ( h );
@@ -2127,7 +2132,7 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay
2127
2132
{
2128
2133
// CRS can contain several definitions separated by whitespace
2129
2134
// though this was deprecated in WMS 1.1.1
2130
- foreach ( QString srs, e1 .text ().split ( QRegExp ( " \\ s+" ) ) )
2135
+ foreach ( QString srs, e1 .text ().split ( QRegExp ( " \\ s+" ) ) )
2131
2136
{
2132
2137
layerProperty.crs .push_back ( srs );
2133
2138
}
@@ -2418,7 +2423,7 @@ void QgsWmsProvider::parseTileSetProfile( QDomElement const &e )
2418
2423
m.topLeft = QgsPoint ( l.boundingBox .box .xMinimum (), l.boundingBox .box .yMaximum () );
2419
2424
2420
2425
int i = 0 ;
2421
- foreach ( QString rS, resolutions )
2426
+ foreach ( QString rS, resolutions )
2422
2427
{
2423
2428
double r = rS.toDouble ();
2424
2429
m.identifier = QString::number ( i );
@@ -2707,7 +2712,7 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
2707
2712
2708
2713
bool isValid = false ;
2709
2714
int matrixWidth = -1 , matrixHeight = -1 ;
2710
- foreach ( const QgsWmtsTileMatrix &m, tms.tileMatrices )
2715
+ foreach ( const QgsWmtsTileMatrix &m, tms.tileMatrices )
2711
2716
{
2712
2717
isValid = m.identifier == id;
2713
2718
if ( isValid )
@@ -3140,7 +3145,7 @@ int QgsWmsProvider::capabilities() const
3140
3145
3141
3146
if ( canIdentify )
3142
3147
{
3143
- foreach ( QString f, mCapabilities .capability .request .getFeatureInfo .format )
3148
+ foreach ( QString f, mCapabilities .capability .request .getFeatureInfo .format )
3144
3149
{
3145
3150
if ( mSupportedGetFeatureFormats .contains ( f ) )
3146
3151
{
@@ -3581,7 +3586,7 @@ QString QgsWmsProvider::metadata()
3581
3586
metadata += " <tr><td>" ;
3582
3587
metadata += " <table width=\" 100%\" >" ;
3583
3588
3584
- foreach ( const QgsWmtsTileLayer &l, mTileLayersSupported )
3589
+ foreach ( const QgsWmtsTileLayer &l, mTileLayersSupported )
3585
3590
{
3586
3591
metadata += " <tr><td colspan=\" 2\" >" ;
3587
3592
metadata += l.identifier ;
@@ -3624,7 +3629,7 @@ QString QgsWmsProvider::metadata()
3624
3629
metadata += " </td>" ;
3625
3630
metadata += " <td class=\" glossy\" >" ;
3626
3631
QStringList styles;
3627
- foreach ( const QgsWmtsStyle &style, l.styles )
3632
+ foreach ( const QgsWmtsStyle &style, l.styles )
3628
3633
{
3629
3634
styles << style.identifier ;
3630
3635
}
@@ -3650,7 +3655,7 @@ QString QgsWmsProvider::metadata()
3650
3655
metadata += tr ( " Available Tilesets" );
3651
3656
metadata += " </td><td class=\" glossy\" >" ;
3652
3657
3653
- foreach ( const QgsWmtsTileMatrixSetLink &setLink, l.setLinks )
3658
+ foreach ( const QgsWmtsTileMatrixSetLink &setLink, l.setLinks )
3654
3659
{
3655
3660
metadata += setLink.tileMatrixSet + " <br>" ;
3656
3661
}
@@ -3833,7 +3838,7 @@ QString QgsWmsProvider::identifyAsHtml( const QgsPoint &point )
3833
3838
{
3834
3839
QString format;
3835
3840
3836
- foreach ( QString f, mSupportedGetFeatureFormats )
3841
+ foreach ( QString f, mSupportedGetFeatureFormats )
3837
3842
{
3838
3843
if ( mCapabilities .capability .request .getFeatureInfo .format .contains ( f ) )
3839
3844
{
0 commit comments