38 QStringLiteral(
"Please add the value of the VERSION parameter" ), 501 );
55 std::unique_ptr<QImage> result( renderer.
getMap() );
59 const QString format = request.
parameters().value( QStringLiteral(
"FORMAT" ), QStringLiteral(
"PNG" ) );
64 throw QgsException( QStringLiteral(
"Failed to compute GetMap image" ) );
Defines a QGIS exception class.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
virtual QString version() const
Returns VERSION parameter as a string or an empty string if not defined.
QgsServerParameters serverParameters() const
Returns parameters.
QgsServerRequest::Parameters parameters() const
Returns a map of query parameters with keys converted to uppercase.
QgsServerResponse Class defining response interface passed to services QgsService::executeRequest() m...
Map renderer for WMS requests.
QImage * getMap()
Returns the map as an image (or nullptr in case of error).
Exception class for WMS service exceptions.
@ OGC_OperationNotSupported
Rendering context for the WMS renderer.
void setParameters(const QgsWmsParameters ¶meters)
Sets WMS parameters.
void setFlag(Flag flag, bool on=true)
Sets or unsets a rendering flag according to the on value.
int imageQuality() const
Returns the image quality to use for rendering according to the current configuration.
Class defining request interface passed to WMS service.
const QgsWmsParameters & wmsParameters() const
Returns the parameters interpreted for the WMS service.
Median cut implementation.
void writeImage(QgsServerResponse &response, QImage &img, const QString &formatStr, int imageQuality)
Write image response.
void writeGetMap(QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
Output GetMap response in DXF format.