36 QgsRenderer renderer( serverIface, project, wmsParameters );
38 QString format = params.value(
"FORMAT" );
42 if ( format.compare( QLatin1String(
"image/png" ), Qt::CaseInsensitive ) == 0 ||
43 format.compare( QLatin1String(
"png" ), Qt::CaseInsensitive ) == 0 )
45 format = QStringLiteral(
"png" );
46 contentType = QStringLiteral(
"image/png" );
48 else if ( format.compare( QLatin1String(
"image/jpg" ), Qt::CaseInsensitive ) == 0 ||
49 format.compare( QLatin1String(
"image/jpeg" ), Qt::CaseInsensitive ) == 0 ||
50 format.compare( QLatin1String(
"jpg" ), Qt::CaseInsensitive ) == 0 ||
51 format.compare( QLatin1String(
"jpeg" ), Qt::CaseInsensitive ) == 0 )
53 format = QStringLiteral(
"jpg" );
54 contentType = QStringLiteral(
"image/jpeg" );
56 else if ( format.compare( QLatin1String(
"image/svg" ), Qt::CaseInsensitive ) == 0 ||
57 format.compare( QLatin1String(
"image/svg+xml" ), Qt::CaseInsensitive ) == 0 ||
58 format.compare( QLatin1String(
"svg" ), Qt::CaseInsensitive ) == 0 )
60 format = QStringLiteral(
"svg" );
61 contentType = QStringLiteral(
"image/svg+xml" );
63 else if ( format.compare( QLatin1String(
"application/pdf" ), Qt::CaseInsensitive ) == 0 ||
64 format.compare( QLatin1String(
"pdf" ), Qt::CaseInsensitive ) == 0 )
66 format = QStringLiteral(
"pdf" );
67 contentType = QStringLiteral(
"application/pdf" );
72 QString(
"Output format %1 is not supported by the GetPrint request" ).arg( format ) );
75 response.
setHeader( QStringLiteral(
"Content-Type" ), contentType );
virtual void setHeader(const QString &key, const QString &value)=0
Set Header entry Add Header entry to the response Note that it is usually an error to set Header afte...
virtual void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device...
Exception class for WMS service exceptions.
QByteArray getPrint(const QString &formatString)
Returns printed page as binary.
Provides an interface to retrieve and manipulate WMS parameters received from the client...
Reads and writes project states.
void writeGetPrint(QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response)
Output GetPrint response.
Median cut implementation.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
Map renderer for WMS requests.
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
QMap< QString, QString > Parameters