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 )
46 contentType =
"image/png";
48 else if ( format.compare( QLatin1String(
"image/svg" ), Qt::CaseInsensitive ) == 0 ||
49 format.compare( QLatin1String(
"image/svg+xml" ), Qt::CaseInsensitive ) == 0 ||
50 format.compare( QLatin1String(
"svg" ), Qt::CaseInsensitive ) == 0 )
53 contentType =
"image/svg+xml";
55 else if ( format.compare( QLatin1String(
"application/pdf" ), Qt::CaseInsensitive ) == 0 ||
56 format.compare( QLatin1String(
"pdf" ), Qt::CaseInsensitive ) == 0 )
59 contentType =
"application/pdf";
64 QString(
"Output format %1 is not supported by the GetPrint request" ).arg( format ) );
67 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.
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
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...
QMap< QString, QString > Parameters