QGIS API Documentation
3.24.2-Tisler (13c1a02865)
|
Defines a set of tile matrices for multiple zoom levels. More...
#include <qgstiles.h>
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... | |
Defines a set of tile matrices for multiple zoom levels.
Definition at line 223 of file qgstiles.h.
|
virtualdefault |
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.
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.
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.
Definition at line 265 of file qgstiles.cpp.
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.
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.
int QgsTileMatrixSet::maximumZoom | ( | ) | const |
Returns the maximum zoom level for tiles present in the set.
Definition at line 164 of file qgstiles.cpp.
int QgsTileMatrixSet::minimumZoom | ( | ) | const |
Returns the minimum zoom level for tiles present in the set.
Definition at line 153 of file qgstiles.cpp.
|
virtual |
double QgsTileMatrixSet::scaleForRenderContext | ( | const QgsRenderContext & | context | ) | const |
Calculates the correct scale to use for the tiles when rendered using the specified render context.
Definition at line 256 of file qgstiles.cpp.
|
inline |
Returns the scale to tile zoom method.
Definition at line 325 of file qgstiles.h.
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.
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.
|
inline |
Sets the scale to tile zoom method.
Definition at line 332 of file qgstiles.h.
QgsTileMatrix QgsTileMatrixSet::tileMatrix | ( | int | zoom | ) | const |
Returns the tile matrix corresponding to the specified zoom.
Definition at line 143 of file qgstiles.cpp.
|
virtual |
Writes the set to an XML element.
Definition at line 329 of file qgstiles.cpp.