53 std::unique_ptr<QImage> result( renderer.
getMap() );
57 const QString format = request.
parameters().value( QStringLiteral(
"FORMAT" ), QStringLiteral(
"PNG" ) );
62 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...
virtual QgsFeedback * feedback() const
Returns the socket feedback if any.
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.
void setSocketFeedback(QgsFeedback *feedback)
Sets the response feedback.
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.