Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added zmin/zmax parameters to limit usable zoom levels
  • Loading branch information
wonder-sk committed Mar 27, 2020
1 parent b590aae commit 8d24e17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsmaplayer.sip.in
Expand Up @@ -1423,7 +1423,7 @@ Sets the coordinate transform context to ``transformContext``

SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QString() );
QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayer.h
Expand Up @@ -1277,7 +1277,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
% MethodCode
QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QString() );
QString str = QStringLiteral( "<QgsMapLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
% End
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/core/vectortile/qgsvectortilelayer.cpp
Expand Up @@ -38,6 +38,11 @@ QgsVectorTileLayer::QgsVectorTileLayer( const QString &uri, const QString &baseN
mSourceMinZoom = 0;
mSourceMaxZoom = 14;

if ( dsUri.hasParam( QStringLiteral( "zmin" ) ) )
mSourceMinZoom = dsUri.param( QStringLiteral( "zmin" ) ).toInt();
if ( dsUri.hasParam( QStringLiteral( "zmax" ) ) )
mSourceMaxZoom = dsUri.param( QStringLiteral( "zmax" ) ).toInt();

setExtent( QgsRectangle( -20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892 ) );
}
else if ( mSourceType == "mbtiles" )
Expand Down

0 comments on commit 8d24e17

Please sign in to comment.