Skip to content
Permalink
Browse files

[Server][Feature][needs-docs] Add ability to define ResourceURL for WMTS

  • Loading branch information
rldhont committed Aug 23, 2018
1 parent d9095e0 commit df03b63bc4d6dd8a3fe9b51952718e0a1ef1d309
@@ -413,6 +413,15 @@ Returns the Layer ids list defined in a QGIS project as published in WCS.
:param project: the QGIS project

:return: the Layer ids list.
%End

QString wmtsServiceUrl( const QgsProject &project );
%Docstring
Returns the WMTS service url defined in a QGIS project.

:param project: the QGIS project

:return: url if defined in project, an empty string otherwise.
%End
};

@@ -662,6 +662,8 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
mWMSImageQualitySpinBox->setValue( imageQuality );
}

mWMTSUrlLineEdit->setText( QgsProject::instance()->readEntry( QStringLiteral( "WMTSUrl" ), QStringLiteral( "/" ), QLatin1String( "" ) ) );

bool wmtsProject = QgsProject::instance()->readBoolEntry( QStringLiteral( "WMTSLayers" ), QStringLiteral( "Project" ) );
bool wmtsPngProject = QgsProject::instance()->readBoolEntry( QStringLiteral( "WMTSPngLayers" ), QStringLiteral( "Project" ) );
bool wmtsJpegProject = QgsProject::instance()->readBoolEntry( QStringLiteral( "WMTSJpegLayers" ), QStringLiteral( "Project" ) );
@@ -1262,6 +1264,7 @@ void QgsProjectProperties::apply()
QgsProject::instance()->writeEntry( QStringLiteral( "WMSImageQuality" ), QStringLiteral( "/" ), imageQualityValue );
}

QgsProject::instance()->writeEntry( QStringLiteral( "WMTSUrl" ), QStringLiteral( "/" ), mWMTSUrlLineEdit->text() );
bool wmtsProject = false;
bool wmtsPngProject = false;
bool wmtsJpegProject = false;
@@ -331,3 +331,8 @@ QStringList QgsServerProjectUtils::wcsLayerIds( const QgsProject &project )
{
return project.readListEntry( QStringLiteral( "WCSLayers" ), QStringLiteral( "/" ) );
}

QString QgsServerProjectUtils::wmtsServiceUrl( const QgsProject &project )
{
return project.readEntry( QStringLiteral( "WMTSSUrl" ), QStringLiteral( "/" ), "" );
}
@@ -347,6 +347,13 @@ namespace QgsServerProjectUtils
* \returns the Layer ids list.
*/
SERVER_EXPORT QStringList wcsLayerIds( const QgsProject &project );

/**
* Returns the WMTS service url defined in a QGIS project.
* \param project the QGIS project
* \returns url if defined in project, an empty string otherwise.
*/
SERVER_EXPORT QString wmtsServiceUrl( const QgsProject &project );
};

#endif
@@ -59,7 +59,7 @@ namespace QgsWmts
QString href;
if ( project )
{
href = QgsServerProjectUtils::wmsServiceUrl( *project );
href = QgsServerProjectUtils::wmtsServiceUrl( *project );
}

// Build default url
@@ -2502,6 +2502,20 @@
</column>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="mWMTSUrlLabel">
<property name="text">
<string>Advertised URL</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mWMTSUrlLineEdit"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>

0 comments on commit df03b63

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