QgsQuickMapCanvasMap class

This class implements a visual Qt Quick Item that does map rendering according to the current map settings.

Client code is expected to use MapCanvas item rather than using this class directly.

QgsQuickMapCanvasMap instance internally creates QgsQuickMapSettings in constructor. The QgsProject should be attached to the QgsQuickMapSettings. The map settings for other QgsQuick components should be initialized from QgsQuickMapCanvasMap's mapSettings

Constructors, destructors, conversion operators

QgsQuickMapCanvasMap(QQuickItem* parent = nullptr)
Create map canvas map.

Public functions

auto freeze() const -> bool
When freeze property is set to true, the map canvas does not refresh.
auto incrementalRendering() const -> bool
When the incrementalRendering property is set to true, the automatic refresh of map canvas during rendering is allowed.
auto isRendering() const -> bool
The isRendering property is set to true while a rendering job is pending for this map canvas map.
auto mapSettings() const -> QgsQuickMapSettings*
The mapSettings property contains configuration for rendering of the map.
auto mapUpdateInterval() const -> int
Interval in milliseconds after which the map canvas will be updated while a rendering job is ongoing.
void setFreeze(bool freeze)
When freeze property is set to true, the map canvas does not refresh.
void setIncrementalRendering(bool incrementalRendering)
When the incrementalRendering property is set to true, the automatic refresh of map canvas during rendering is allowed.
void setMapUpdateInterval(int mapUpdateInterval)
Interval in milliseconds after which the map canvas will be updated while a rendering job is ongoing.

Signals

void freezeChanged()
When freeze property is set to true, the map canvas does not refresh.
void incrementalRenderingChanged()
When the incrementalRendering property is set to true, the automatic refresh of map canvas during rendering is allowed.
void isRenderingChanged()
The isRendering property is set to true while a rendering job is pending for this map canvas map.
void mapCanvasRefreshed()
Signal is emitted when a canvas is refreshed.
void mapUpdateIntervalChanged()
Interval in milliseconds after which the map canvas will be updated while a rendering job is ongoing.
void renderStarting()
Signal is emitted when a rendering is starting.

Public slots

void pan(QPointF oldPos, QPointF newPos)
Set map setting's extent (pan the map) based on the difference of positions.
void refresh()
Refresh the map canvas.
void stopRendering()
Stop map rendering.
void zoom(QPointF center, qreal scale)
Set map setting's extent (zoom the map) on the center by given scale.

Function documentation

bool QgsQuickMapCanvasMap::freeze() const

When freeze property is set to true, the map canvas does not refresh.

The value temporary changes during the rendering process.

bool QgsQuickMapCanvasMap::isRendering() const

The isRendering property is set to true while a rendering job is pending for this map canvas map.

It can be used to show a notification icon about an ongoing rendering job. This is a readonly property.

QgsQuickMapSettings* QgsQuickMapCanvasMap::mapSettings() const

The mapSettings property contains configuration for rendering of the map.

It should be used as a primary source of map settings (and project) for all other components in the application.

This is a readonly property.

int QgsQuickMapCanvasMap::mapUpdateInterval() const

Interval in milliseconds after which the map canvas will be updated while a rendering job is ongoing.

This only has an effect if incrementalRendering is activated. Default is 250 [ms].

void QgsQuickMapCanvasMap::setFreeze(bool freeze)

When freeze property is set to true, the map canvas does not refresh.

The value temporary changes during the rendering process.

void QgsQuickMapCanvasMap::setMapUpdateInterval(int mapUpdateInterval)

Interval in milliseconds after which the map canvas will be updated while a rendering job is ongoing.

This only has an effect if incrementalRendering is activated. Default is 250 [ms].

void QgsQuickMapCanvasMap::freezeChanged() signal

When freeze property is set to true, the map canvas does not refresh.

The value temporary changes during the rendering process.

void QgsQuickMapCanvasMap::isRenderingChanged() signal

The isRendering property is set to true while a rendering job is pending for this map canvas map.

It can be used to show a notification icon about an ongoing rendering job. This is a readonly property.

void QgsQuickMapCanvasMap::mapUpdateIntervalChanged() signal

Interval in milliseconds after which the map canvas will be updated while a rendering job is ongoing.

This only has an effect if incrementalRendering is activated. Default is 250 [ms].

void QgsQuickMapCanvasMap::refresh() public slot

Refresh the map canvas.

Does nothing when output size of map settings is not set