Skip to content
Permalink
Browse files

[Server][Feature][needs-docs] Add ability to define min. scale for WMTS

  • Loading branch information
rldhont committed Aug 23, 2018
1 parent df03b63 commit 355a3871fc753cafc90cb08996cbc46314a09e09
@@ -663,6 +663,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
}

mWMTSUrlLineEdit->setText( QgsProject::instance()->readEntry( QStringLiteral( "WMTSUrl" ), QStringLiteral( "/" ), QLatin1String( "" ) ) );
mWMTSMinScaleLineEdit->setValue( QgsProject::instance()->readNumEntry( QStringLiteral( "WMTSMinScale" ), QStringLiteral( "/" ), 5000 ) );

bool wmtsProject = QgsProject::instance()->readBoolEntry( QStringLiteral( "WMTSLayers" ), QStringLiteral( "Project" ) );
bool wmtsPngProject = QgsProject::instance()->readBoolEntry( QStringLiteral( "WMTSPngLayers" ), QStringLiteral( "Project" ) );
@@ -1265,6 +1266,7 @@ void QgsProjectProperties::apply()
}

QgsProject::instance()->writeEntry( QStringLiteral( "WMTSUrl" ), QStringLiteral( "/" ), mWMTSUrlLineEdit->text() );
QgsProject::instance()->writeEntry( QStringLiteral( "WMTSMinScale" ), QStringLiteral( "/" ), mWMTSMinScaleLineEdit->value() );
bool wmtsProject = false;
bool wmtsPngProject = false;
bool wmtsJpegProject = false;
@@ -192,7 +192,11 @@ namespace QgsWmts
{
QList< tileMatrixSetDef > tmsList;

double minScale = getProjectMinScale( project );
double minScale = project->readNumEntry( QStringLiteral( "WMTSMinScale" ), QStringLiteral( "/" ), -1.0 );
if ( minScale == -1.0 )
{
minScale = getProjectMinScale( project );
}

QStringList crsList = QgsServerProjectUtils::wmsOutputCrsList( *project );
for ( const QString &crsStr : crsList )
@@ -2503,6 +2503,30 @@
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QLabel" name="mWMTSMinScaleLabel">
<property name="text">
<string>Minimum scale</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="mWMTSMinScaleLineEdit">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
<property name="value">
<number>5000</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="mWMTSUrlLabel">
@@ -2968,6 +2992,9 @@
<tabstop>mMaxWidthLineEdit</tabstop>
<tabstop>mMaxHeightLineEdit</tabstop>
<tabstop>mWMSImageQualitySpinBox</tabstop>
<tabstop>twWmtsLayers</tabstop>
<tabstop>mWMTSMinScaleLineEdit</tabstop>
<tabstop>mWMTSUrlLineEdit</tabstop>
<tabstop>twWFSLayers</tabstop>
<tabstop>pbnWFSLayersSelectAll</tabstop>
<tabstop>pbnWFSLayersDeselectAll</tabstop>

0 comments on commit 355a387

Please sign in to comment.
You can’t perform that action at this time.