New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server external wms several layers #38161
Server external wms several layers #38161
Conversation
…erwise the WMS client won't work
QString paramName = paramIt.key().toLower(); | ||
if ( paramName == QLatin1String( "layers" ) || paramName == QLatin1String( "styles" ) ) | ||
{ | ||
QStringList values = paramIt.value().split( "," ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QStringList values = paramIt.value().split( "," ); | |
QStringList values = paramIt.value().split( ',' ); |
{ | ||
QStringList values = paramIt.value().split( "," ); | ||
QStringList::const_iterator valuesIt = values.constBegin(); | ||
for ( ; valuesIt != values.constEnd(); ++valuesIt ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const QStringList values = paramIt.value().split( ',' );
for ( const QString &value : values )
wmsUri.setParam( paramName, value );
should be much easier to read
{ | ||
wmsUri.setParam( paramName, *valuesIt ); | ||
} | ||
QStringList values = paramIt.value().split( ',' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QStringList values = paramIt.value().split( ',' ); | |
const QStringList values = paramIt.value().split( ',' ); |
An external WMS layer can sometimes request several WMS layers and styles. Up to know, the server passed this as parameter to the WMS client uri. However it seems that it only works if the layers and styles are set one-by-one with wmsUri.setParam. It needs several layers-Parameter with one layer instead one with all the layers (e.g. layers=A&layers=B instead of layers=A,B).