Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
wms: add support for svg getmap requests (implements #10060)
  • Loading branch information
jef-n committed Apr 13, 2014
1 parent 4aafc88 commit b118213
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -509,7 +509,14 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
setQueryItem( url, "HEIGHT", QString::number( pixelHeight ) );
setQueryItem( url, "LAYERS", layers );
setQueryItem( url, "STYLES", styles );
setQueryItem( url, "FORMAT", mSettings.mImageMimeType );
if( mSettings.mImageMimeType.contains( "+" ) )
{
QString format( mSettings.mImageMimeType );
format.replace( "+", "%2b" );
url.addEncodedQueryItem( "FORMAT", format.toUtf8() );
}
else
setQueryItem( url, "FORMAT", mSettings.mImageMimeType );

if ( mDpi != -1 )
{
Expand Down Expand Up @@ -2897,6 +2904,14 @@ QVector<QgsWmsSupportedFormat> QgsWmsProvider::supportedFormats()
formats << t1;
}

if ( supportedFormats.contains( "svg" ) )
{
QgsWmsSupportedFormat s1 = { "image/svg", "SVG" };
QgsWmsSupportedFormat s2 = { "image/svgz", "SVG" };
QgsWmsSupportedFormat s3 = { "image/svg+xml", "SVG" };
formats << s1 << s2 << s3;
}

return formats;
}

Expand Down

0 comments on commit b118213

Please sign in to comment.