44 const int defaultWidth = 800;
45 size.setWidth( defaultWidth );
46 size.setHeight( defaultWidth * bbox.
height() / bbox.
width() );
62 const QString infoFormat = request.
parameters().value( QStringLiteral(
"INFO_FORMAT" ), QStringLiteral(
"text/plain" ) );
63 response.
setHeader( QStringLiteral(
"Content-Type" ), infoFormat + QStringLiteral(
"; charset=utf-8" ) );
static Q_INVOKABLE QgsGeometry fromWkt(const QString &wkt)
Creates a new geometry from a WKT string.
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
A rectangle specified with double values.
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
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 void write(const QString &data)
Write string This is a convenient method that will write directly to the underlying I/O device.
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 QgsFeedback * feedback() const
Returns the socket feedback if any.
Map renderer for WMS requests.
QByteArray getFeatureInfo(const QString &version="1.3.0")
Creates an xml document that describes the result of the getFeatureInfo request.
Provides an interface to retrieve and manipulate WMS parameters received from the client.
void set(QgsWmsParameter::Name name, const QVariant &value)
Sets a parameter value thanks to its name.
QString filterGeom() const
Returns the filter geometry found in FILTER_GEOM parameter.
int heightAsInt() const
Returns HEIGHT parameter as an int or its default value if not defined.
int widthAsInt() const
Returns WIDTH parameter as an int or its default value if not defined.
QString version() const override
Returns VERSION parameter as a string or an empty string if not defined.
bool infoFormatIsImage() const
Checks if INFO_FORMAT parameter is one of the image formats (PNG, JPG).
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.
Class defining request interface passed to WMS service.
const QgsWmsParameters & wmsParameters() const
Returns the parameters interpreted for the WMS service.
Median cut implementation.
void writeGetFeatureInfo(QgsServerInterface *serverIface, const QgsProject *project, const QgsWmsRequest &request, QgsServerResponse &response)
Output GetFeatureInfo response.