Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature][vectortiles] Add option to create connections for ArcGIS Ve…
…ctor Tile Services to easily load vector tile layers from these servers Adds new options in the Vector Tiles browser tree context menu and Data Source Manager to create a connection to an ESRI VectorTileServer. When loading the layer from the connection, the tile server parameters will be automatically setup to suit the layer source.
- Loading branch information
1 parent
b0dd568
commit 9114e91
Showing
14 changed files
with
499 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/gui/vectortile/qgsarcgisvectortileconnectiondialog.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/*************************************************************************** | ||
qgsarcgisvectortileconnectiondialog.cpp | ||
--------------------- | ||
begin : September 2020 | ||
copyright : (C) 2020 by Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsarcgisvectortileconnectiondialog.h" | ||
#include "qgsvectortileconnection.h" | ||
#include "qgsgui.h" | ||
|
||
#include <QMessageBox> | ||
#include <QPushButton> | ||
|
||
///@cond PRIVATE | ||
|
||
QgsArcgisVectorTileConnectionDialog::QgsArcgisVectorTileConnectionDialog( QWidget *parent ) | ||
: QDialog( parent ) | ||
{ | ||
setupUi( this ); | ||
QgsGui::enableAutoGeometryRestore( this ); | ||
|
||
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true ); | ||
connect( mEditName, &QLineEdit::textChanged, this, &QgsArcgisVectorTileConnectionDialog::updateOkButtonState ); | ||
connect( mEditUrl, &QLineEdit::textChanged, this, &QgsArcgisVectorTileConnectionDialog::updateOkButtonState ); | ||
} | ||
|
||
void QgsArcgisVectorTileConnectionDialog::setConnection( const QString &name, const QString &uri ) | ||
{ | ||
mEditName->setText( name ); | ||
|
||
QgsVectorTileProviderConnection::Data conn = QgsVectorTileProviderConnection::decodedUri( uri ); | ||
mEditUrl->setText( conn.url ); | ||
} | ||
|
||
QString QgsArcgisVectorTileConnectionDialog::connectionUri() const | ||
{ | ||
QgsVectorTileProviderConnection::Data conn; | ||
conn.url = mEditUrl->text(); | ||
conn.serviceType = QgsVectorTileProviderConnection::ArcgisVectorTileService; | ||
return QgsVectorTileProviderConnection::encodedUri( conn ); | ||
} | ||
|
||
QString QgsArcgisVectorTileConnectionDialog::connectionName() const | ||
{ | ||
return mEditName->text(); | ||
} | ||
|
||
void QgsArcgisVectorTileConnectionDialog::updateOkButtonState() | ||
{ | ||
bool enabled = !mEditName->text().isEmpty() && !mEditUrl->text().isEmpty(); | ||
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled ); | ||
} | ||
|
||
///@endcond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*************************************************************************** | ||
qgsarcgisvectortileconnectiondialog.h | ||
--------------------- | ||
begin : September 2020 | ||
copyright : (C) 2020 by Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSARCGISVECTORTILECONNECTIONDIALOG_H | ||
#define QGSARCGISVECTORTILECONNECTIONDIALOG_H | ||
|
||
///@cond PRIVATE | ||
#define SIP_NO_FILE | ||
|
||
#include <QDialog> | ||
|
||
#include "ui_qgsarcgisvectortileconnectiondialog.h" | ||
|
||
|
||
class QgsArcgisVectorTileConnectionDialog : public QDialog, public Ui::QgsArcgisVectorTileConnectionDialog | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit QgsArcgisVectorTileConnectionDialog( QWidget *parent = nullptr ); | ||
|
||
void setConnection( const QString &name, const QString &uri ); | ||
|
||
QString connectionUri() const; | ||
QString connectionName() const; | ||
|
||
private slots: | ||
void updateOkButtonState(); | ||
|
||
private: | ||
QString mBaseKey; | ||
QString mCredentialsBaseKey; | ||
}; | ||
|
||
///@endcond | ||
|
||
#endif // QGSVECTORTILECONNECTIONDIALOG_H |
Oops, something went wrong.