QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
Map renderer for WMS requests. More...
#include <qgswmsrenderer.h>
Public Types | |
typedef QHash< QgsVectorLayer *, SymbolSet > | HitTest |
typedef QSet< QString > | SymbolSet |
Public Member Functions | |
QgsRenderer (const QgsWmsRenderContext &context) | |
Constructor for QgsRenderer. | |
~QgsRenderer () | |
void | configureLayers (QList< QgsMapLayer * > &layers, QgsMapSettings *settings=nullptr) |
Configures layers for rendering optionally considering the map settings. | |
std::unique_ptr< QgsDxfExport > | getDxf () |
Returns the map as DXF data. | |
QByteArray | getFeatureInfo (const QString &version="1.3.0") |
Creates an xml document that describes the result of the getFeatureInfo request. | |
QImage * | getLegendGraphics (QgsLayerTreeModel &model) |
Returns the map legend as an image (or nullptr in case of error). | |
QImage * | getLegendGraphics (QgsLayerTreeModelLegendNode &nodeModel) |
Returns the map legend as an image (or nullptr in case of error). | |
QJsonObject | getLegendGraphicsAsJson (QgsLayerTreeModel &model, const Qgis::LegendJsonRenderFlags &jsonRenderFlags=Qgis::LegendJsonRenderFlags()) |
Returns the map legend as a JSON object. | |
QJsonObject | getLegendGraphicsAsJson (QgsLayerTreeModelLegendNode &legendNode, const Qgis::LegendJsonRenderFlags &jsonRenderFlags=Qgis::LegendJsonRenderFlags()) |
Returns the map legend as a JSON object (or nullptr in case of error). | |
QImage * | getMap () |
Returns the map as an image (or nullptr in case of error). | |
std::unique_ptr< QgsMapRendererTask > | getPdf (const QString &tmpFileName) |
Returns a configured pdf export task. | |
QByteArray | getPrint () |
Returns printed page as binary. | |
HitTest | symbols () |
Returns the hit test according to the current context. | |
Map renderer for WMS requests.
Definition at line 67 of file qgswmsrenderer.h.
typedef QHash<QgsVectorLayer *, SymbolSet> QgsWms::QgsRenderer::HitTest |
Definition at line 119 of file qgswmsrenderer.h.
typedef QSet<QString> QgsWms::QgsRenderer::SymbolSet |
Definition at line 118 of file qgswmsrenderer.h.
QgsWms::QgsRenderer::QgsRenderer | ( | const QgsWmsRenderContext & | context | ) |
Constructor for QgsRenderer.
context | The rendering context. |
Definition at line 103 of file qgswmsrenderer.cpp.
QgsWms::QgsRenderer::~QgsRenderer | ( | ) |
Definition at line 112 of file qgswmsrenderer.cpp.
void QgsWms::QgsRenderer::configureLayers | ( | QList< QgsMapLayer * > & | layers, |
QgsMapSettings * | settings = nullptr |
||
) |
Configures layers for rendering optionally considering the map settings.
Definition at line 3827 of file qgswmsrenderer.cpp.
std::unique_ptr< QgsDxfExport > QgsWms::QgsRenderer::getDxf | ( | ) |
Returns the map as DXF data.
Definition at line 1100 of file qgswmsrenderer.cpp.
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 1254 of file qgswmsrenderer.cpp.
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.
model | The layer tree model to use for building the legend |
Definition at line 117 of file qgswmsrenderer.cpp.
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.
nodeModel | The node model to use for building the legend |
Definition at line 204 of file qgswmsrenderer.cpp.
QJsonObject QgsWms::QgsRenderer::getLegendGraphicsAsJson | ( | QgsLayerTreeModel & | model, |
const Qgis::LegendJsonRenderFlags & | jsonRenderFlags = Qgis::LegendJsonRenderFlags() |
||
) |
Returns the map legend as a JSON object.
The caller takes the ownership of the JSON object.
model | The layer tree model to use for building the legend |
jsonRenderFlags | The JSON export flags |
Definition at line 245 of file qgswmsrenderer.cpp.
QJsonObject QgsWms::QgsRenderer::getLegendGraphicsAsJson | ( | QgsLayerTreeModelLegendNode & | legendNode, |
const Qgis::LegendJsonRenderFlags & | jsonRenderFlags = Qgis::LegendJsonRenderFlags() |
||
) |
Returns the map legend as a JSON object (or nullptr
in case of error).
The caller takes ownership of the image object.
legendNode | The legend node to use for building the legend |
jsonRenderFlags | The JSON export flags |
Definition at line 265 of file qgswmsrenderer.cpp.
QImage * QgsWms::QgsRenderer::getMap | ( | ) |
Returns the map as an image (or nullptr
in case of error).
The caller takes ownership of the image object).
Definition at line 1047 of file qgswmsrenderer.cpp.
std::unique_ptr< QgsMapRendererTask > QgsWms::QgsRenderer::getPdf | ( | const QString & | tmpFileName | ) |
Returns a configured pdf export task.
tmpFileName | the name of the temporary file to store the pdf |
Definition at line 1200 of file qgswmsrenderer.cpp.
QByteArray QgsWms::QgsRenderer::getPrint | ( | ) |
Returns printed page as binary.
Definition at line 387 of file qgswmsrenderer.cpp.
QgsRenderer::HitTest QgsWms::QgsRenderer::symbols | ( | ) |
Returns the hit test according to the current context.
Definition at line 352 of file qgswmsrenderer.cpp.