QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Public Member Functions | List of all members
QgsTileMatrixSet Class Reference

Defines a set of tile matrices for multiple zoom levels. More...

#include <qgstiles.h>

Inheritance diagram for QgsTileMatrixSet:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsTileMatrixSet ()=default
 
void addGoogleCrs84QuadTiles (int minimumZoom=0, int maximumZoom=14)
 Adds tile matrices corresponding to the standard web mercator/GoogleCRS84Quad setup. More...
 
void addMatrix (const QgsTileMatrix &matrix)
 Adds a matrix to the set. More...
 
double calculateTileScaleForMap (double actualMapScale, const QgsCoordinateReferenceSystem &mapCrs, const QgsRectangle &mapExtent, const QSize mapSize, const double mapDpi) const
 Calculates the correct scale to use for the tiles when rendered using the specified map properties. More...
 
QgsCoordinateReferenceSystem crs () const
 Returns the coordinate reference system associated with the tiles. More...
 
void dropMatricesOutsideZoomRange (int minimumZoom, int maximumZoom)
 Deletes any existing matrices which fall outside the zoom range specified by minimumZoom to maximumZoom, inclusive. More...
 
int maximumZoom () const
 Returns the maximum zoom level for tiles present in the set. More...
 
int minimumZoom () const
 Returns the minimum zoom level for tiles present in the set. More...
 
virtual bool readXml (const QDomElement &element, QgsReadWriteContext &context)
 Reads the set from an XML element. More...
 
double scaleForRenderContext (const QgsRenderContext &context) const
 Calculates the correct scale to use for the tiles when rendered using the specified render context. More...
 
Qgis::ScaleToTileZoomLevelMethod scaleToTileZoomMethod () const
 Returns the scale to tile zoom method. More...
 
double scaleToZoom (double scale) const
 Calculates a fractional zoom level given a map scale denominator. More...
 
int scaleToZoomLevel (double scale) const
 Finds the best fitting (integer) zoom level given a map scale denominator. More...
 
void setScaleToTileZoomMethod (Qgis::ScaleToTileZoomLevelMethod method)
 Sets the scale to tile zoom method. More...
 
QgsTileMatrix tileMatrix (int zoom) const
 Returns the tile matrix corresponding to the specified zoom. More...
 
virtual QDomElement writeXml (QDomDocument &document, const QgsReadWriteContext &context) const
 Writes the set to an XML element. More...
 

Detailed Description

Defines a set of tile matrices for multiple zoom levels.

Since
QGIS 3.22.6

Definition at line 223 of file qgstiles.h.

Constructor & Destructor Documentation

◆ ~QgsTileMatrixSet()

virtual QgsTileMatrixSet::~QgsTileMatrixSet ( )
virtualdefault

Member Function Documentation

◆ addGoogleCrs84QuadTiles()

void QgsTileMatrixSet::addGoogleCrs84QuadTiles ( int  minimumZoom = 0,
int  maximumZoom = 14 
)

Adds tile matrices corresponding to the standard web mercator/GoogleCRS84Quad setup.

Definition at line 132 of file qgstiles.cpp.

◆ addMatrix()

void QgsTileMatrixSet::addMatrix ( const QgsTileMatrix matrix)

Adds a matrix to the set.

Any existing matrix with the same QgsTileMatrix::zoomLevel() will be replaced.

Definition at line 148 of file qgstiles.cpp.

◆ calculateTileScaleForMap()

double QgsTileMatrixSet::calculateTileScaleForMap ( double  actualMapScale,
const QgsCoordinateReferenceSystem mapCrs,
const QgsRectangle mapExtent,
const QSize  mapSize,
const double  mapDpi 
) const

Calculates the correct scale to use for the tiles when rendered using the specified map properties.

Since
QGIS 3.26

Definition at line 265 of file qgstiles.cpp.

◆ crs()

QgsCoordinateReferenceSystem QgsTileMatrixSet::crs ( ) const

Returns the coordinate reference system associated with the tiles.

In the case of a tile set containing mixed CRS at different zoom levels this method will return the crs of the minimum zoom tile matrix.

Definition at line 190 of file qgstiles.cpp.

◆ dropMatricesOutsideZoomRange()

void QgsTileMatrixSet::dropMatricesOutsideZoomRange ( int  minimumZoom,
int  maximumZoom 
)

Deletes any existing matrices which fall outside the zoom range specified by minimumZoom to maximumZoom, inclusive.

Definition at line 175 of file qgstiles.cpp.

◆ maximumZoom()

int QgsTileMatrixSet::maximumZoom ( ) const

Returns the maximum zoom level for tiles present in the set.

See also
minimumZoom()

Definition at line 164 of file qgstiles.cpp.

◆ minimumZoom()

int QgsTileMatrixSet::minimumZoom ( ) const

Returns the minimum zoom level for tiles present in the set.

See also
maximumZoom()

Definition at line 153 of file qgstiles.cpp.

◆ readXml()

bool QgsTileMatrixSet::readXml ( const QDomElement &  element,
QgsReadWriteContext context 
)
virtual

Reads the set from an XML element.

See also
writeXml()

Definition at line 298 of file qgstiles.cpp.

◆ scaleForRenderContext()

double QgsTileMatrixSet::scaleForRenderContext ( const QgsRenderContext context) const

Calculates the correct scale to use for the tiles when rendered using the specified render context.

Since
QGIS 3.26

Definition at line 256 of file qgstiles.cpp.

◆ scaleToTileZoomMethod()

Qgis::ScaleToTileZoomLevelMethod QgsTileMatrixSet::scaleToTileZoomMethod ( ) const
inline

Returns the scale to tile zoom method.

See also
setScaleToTileZoomMethod()

Definition at line 325 of file qgstiles.h.

◆ scaleToZoom()

double QgsTileMatrixSet::scaleToZoom ( double  scale) const

Calculates a fractional zoom level given a map scale denominator.

The zoom level will be linearly interpolated between zoom levels present in the set.

Definition at line 198 of file qgstiles.cpp.

◆ scaleToZoomLevel()

int QgsTileMatrixSet::scaleToZoomLevel ( double  scale) const

Finds the best fitting (integer) zoom level given a map scale denominator.

Values are constrained to the zoom levels between minimumZoom() and maximumZoom().

Definition at line 240 of file qgstiles.cpp.

◆ setScaleToTileZoomMethod()

void QgsTileMatrixSet::setScaleToTileZoomMethod ( Qgis::ScaleToTileZoomLevelMethod  method)
inline

Sets the scale to tile zoom method.

See also
scaleToTileZoomMethod()

Definition at line 332 of file qgstiles.h.

◆ tileMatrix()

QgsTileMatrix QgsTileMatrixSet::tileMatrix ( int  zoom) const

Returns the tile matrix corresponding to the specified zoom.

Definition at line 143 of file qgstiles.cpp.

◆ writeXml()

QDomElement QgsTileMatrixSet::writeXml ( QDomDocument &  document,
const QgsReadWriteContext context 
) const
virtual

Writes the set to an XML element.

Definition at line 329 of file qgstiles.cpp.


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