Skip to content
Permalink
Browse files

wms: add support for svg getmap requests (implements #10060)

  • Loading branch information
jef-n committed Apr 13, 2014
1 parent 4aafc88 commit b118213d7bf86465f782d6fdb39b3b50f4bc78b1
Showing with 16 additions and 1 deletion.
  1. +16 −1 src/providers/wms/qgswmsprovider.cpp
@@ -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 )
{
@@ -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;
}

0 comments on commit b118213

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