QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Types | Public Member Functions | List of all members
QgsWms::QgsRenderer Class Reference

Map renderer for WMS requests. More...

#include <qgswmsrenderer.h>

Public Types

typedef QHash< QgsVectorLayer *, SymbolSetHitTest
 
typedef QSet< QString > SymbolSet
 

Public Member Functions

 QgsRenderer (const QgsWmsRenderContext &context)
 Constructor for QgsRenderer. More...
 
 ~QgsRenderer ()
 Destructor for QgsRenderer. More...
 
void configureLayers (QList< QgsMapLayer * > &layers, QgsMapSettings *settings=nullptr)
 Configures layers for rendering optionally considering the map settings. More...
 
std::unique_ptr< QgsDxfExportgetDxf ()
 Returns the map as DXF data. More...
 
QByteArray getFeatureInfo (const QString &version="1.3.0")
 Creates an xml document that describes the result of the getFeatureInfo request. More...
 
QImage * getLegendGraphics (QgsLayerTreeModel &model)
 Returns the map legend as an image (or nullptr in case of error). More...
 
QImage * getLegendGraphics (QgsLayerTreeModelLegendNode &nodeModel)
 Returns the map legend as an image (or nullptr in case of error). More...
 
QJsonObject getLegendGraphicsAsJson (QgsLayerTreeModel &model)
 Returns the map legend as a JSON object. More...
 
QImage * getMap ()
 Returns the map as an image (or nullptr in case of error). More...
 
QByteArray getPrint ()
 Returns printed page as binary. More...
 
HitTest symbols ()
 Returns the hit test according to the current context. More...
 

Detailed Description

Map renderer for WMS requests.

Since
QGIS 3.0

Definition at line 66 of file qgswmsrenderer.h.

Member Typedef Documentation

◆ HitTest

Definition at line 110 of file qgswmsrenderer.h.

◆ SymbolSet

typedef QSet<QString> QgsWms::QgsRenderer::SymbolSet

Definition at line 109 of file qgswmsrenderer.h.

Constructor & Destructor Documentation

◆ QgsRenderer()

QgsWms::QgsRenderer::QgsRenderer ( const QgsWmsRenderContext context)

Constructor for QgsRenderer.

Parameters
contextThe rendering context.
Since
QGIS 3.8

Definition at line 107 of file qgswmsrenderer.cpp.

◆ ~QgsRenderer()

QgsWms::QgsRenderer::~QgsRenderer ( )

Destructor for QgsRenderer.

Definition at line 116 of file qgswmsrenderer.cpp.

Member Function Documentation

◆ configureLayers()

void QgsWms::QgsRenderer::configureLayers ( QList< QgsMapLayer * > &  layers,
QgsMapSettings settings = nullptr 
)

Configures layers for rendering optionally considering the map settings.

Definition at line 3551 of file qgswmsrenderer.cpp.

◆ getDxf()

std::unique_ptr< QgsDxfExport > QgsWms::QgsRenderer::getDxf ( )

Returns the map as DXF data.

Returns
the map as DXF data
Since
QGIS 3.0

Definition at line 981 of file qgswmsrenderer.cpp.

◆ getFeatureInfo()

QByteArray QgsWms::QgsRenderer::getFeatureInfo ( const QString &  version = "1.3.0")

Creates an xml document that describes the result of the getFeatureInfo request.

May throw an exception

Definition at line 1105 of file qgswmsrenderer.cpp.

◆ getLegendGraphics() [1/2]

QImage * QgsWms::QgsRenderer::getLegendGraphics ( QgsLayerTreeModel model)

Returns the map legend as an image (or nullptr in case of error).

The caller takes ownership of the image object.

Parameters
modelThe layer tree model to use for building the legend
Returns
the legend as an image
Since
QGIS 3.8

Definition at line 121 of file qgswmsrenderer.cpp.

◆ getLegendGraphics() [2/2]

QImage * QgsWms::QgsRenderer::getLegendGraphics ( QgsLayerTreeModelLegendNode nodeModel)

Returns the map legend as an image (or nullptr in case of error).

The caller takes ownership of the image object.

Parameters
nodeModelThe node model to use for building the legend
Returns
the legend as an image
Since
QGIS 3.8

Definition at line 164 of file qgswmsrenderer.cpp.

◆ getLegendGraphicsAsJson()

QJsonObject QgsWms::QgsRenderer::getLegendGraphicsAsJson ( QgsLayerTreeModel model)

Returns the map legend as a JSON object.

The caller takes the ownership of the JSON object.

Parameters
modelThe layer tree model to use for building the legend
Returns
the legend as a JSON object
Since
QGIS 3.12

Definition at line 200 of file qgswmsrenderer.cpp.

◆ getMap()

QImage * QgsWms::QgsRenderer::getMap ( )

Returns the map as an image (or nullptr in case of error).

The caller takes ownership of the image object).

Since
QGIS 3.8

Definition at line 933 of file qgswmsrenderer.cpp.

◆ getPrint()

QByteArray QgsWms::QgsRenderer::getPrint ( )

Returns printed page as binary.

Returns
printed page as binary or 0 in case of error

Definition at line 303 of file qgswmsrenderer.cpp.

◆ symbols()

QgsRenderer::HitTest QgsWms::QgsRenderer::symbols ( )

Returns the hit test according to the current context.

Since
QGIS 3.8

Definition at line 267 of file qgswmsrenderer.cpp.


The documentation for this class was generated from the following files: