mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
[FEATURE][QGIS Server] Add short name to layers, groups and project
A number of elements have both a <Name> and a <Title>. The Name is a text string used for machine-to-machine communication while the Title is for the benefit of humans. For example, a dataset might have the descriptive Title “Maximum Atmospheric Temperature” and be requested using the abbreviated Name “ATMAX”. User can already set title for layers, groups and project. OWS name is based on the name used in layer tree. This name is more a label for humans than a name for machine-to-machine communication. To add the capability to users to define Name as a text string for machine-to-machine communication, this pull-request adds: * short name line edits to layers properties * WMS data dialog to layer tree group (short name, title, abstract) * short name line edits to project properties * add a regexp validator "^[A-Za-z][A-Za-z0-9\._-]*" to short name line edit accessible through a static method * add a TreeName element in the fullProjectSettings If a short name has been set for layers, groups and project it is used by QGIS Sever as the layer name.
This commit is contained in:
parent
e6a265c103
commit
a32587bcd1
@ -228,6 +228,9 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
|
||||
//! Returns the path to user's style.
|
||||
static QString userStyleV2Path();
|
||||
|
||||
//! Returns the short name regular exprecience for line edit validator
|
||||
static QRegExp shortNameRegExp();
|
||||
|
||||
//! Returns the path to user's themes folder
|
||||
static QString userThemesFolder();
|
||||
|
||||
|
||||
@ -76,6 +76,17 @@ class QgsMapLayer : QObject
|
||||
*/
|
||||
QString originalName() const;
|
||||
|
||||
/** Set the short name of the layer
|
||||
* used by QGIS Server to identify the layer
|
||||
* @return the layer short name
|
||||
*/
|
||||
void setShortName( const QString& shortName );
|
||||
/** Get the short name of the layer
|
||||
* used by QGIS Server to identify the layer
|
||||
* @return the layer short name
|
||||
*/
|
||||
QString shortName() const;
|
||||
|
||||
/** Set the title of the layer
|
||||
* used by QGIS Server in GetCapabilities request
|
||||
* @return the layer title
|
||||
|
||||
@ -205,6 +205,7 @@
|
||||
#include "qgsrectangle.h"
|
||||
#include "qgsscalecombobox.h"
|
||||
#include "qgsscalevisibilitydialog.h"
|
||||
#include "qgsgroupwmsdatadialog.h"
|
||||
#include "qgsshortcutsmanager.h"
|
||||
#include "qgssinglebandgrayrenderer.h"
|
||||
#include "qgssnappingdialog.h"
|
||||
@ -7832,6 +7833,24 @@ void QgisApp::legendGroupSetCRS()
|
||||
}
|
||||
}
|
||||
|
||||
void QgisApp::legendGroupSetWMSData()
|
||||
{
|
||||
QgsLayerTreeGroup* currentGroup = mLayerTreeView->currentGroupNode();
|
||||
if ( !currentGroup )
|
||||
return;
|
||||
QgsGroupWMSDataDialog* dlg = new QgsGroupWMSDataDialog( this );
|
||||
dlg->setGroupShortName( currentGroup->customProperty( "wmsShortName" ).toString() );
|
||||
dlg->setGroupTitle( currentGroup->customProperty( "wmsTitle" ).toString() );
|
||||
dlg->setGroupTitle( currentGroup->customProperty( "wmsAbstract" ).toString() );
|
||||
if ( dlg->exec() )
|
||||
{
|
||||
currentGroup->setCustomProperty( "wmsShortName", dlg->groupShortName() );
|
||||
currentGroup->setCustomProperty( "wmsTitle", dlg->groupTitle() );
|
||||
currentGroup->setCustomProperty( "wmsAbstract", dlg->groupAbstract() );
|
||||
}
|
||||
delete dlg;
|
||||
}
|
||||
|
||||
void QgisApp::zoomToLayerExtent()
|
||||
{
|
||||
mLayerTreeView->defaultActions()->zoomToLayer( mMapCanvas );
|
||||
|
||||
@ -753,6 +753,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
|
||||
|
||||
/** Set the CRS of the current legend group*/
|
||||
void legendGroupSetCRS();
|
||||
/** Set the WMS data of the current legend group*/
|
||||
void legendGroupSetWMSData();
|
||||
|
||||
//! zoom to extent of layer
|
||||
void zoomToLayerExtent();
|
||||
|
||||
@ -61,6 +61,8 @@ QMenu* QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
||||
|
||||
menu->addAction( actions->actionRenameGroupOrLayer( menu ) );
|
||||
|
||||
menu->addAction( tr( "&Set Group WMS data" ), QgisApp::instance(), SLOT( legendGroupSetWMSData() ) );
|
||||
|
||||
menu->addAction( actions->actionMutuallyExclusiveGroup( menu ) );
|
||||
|
||||
if ( mView->selectedNodes( true ).count() >= 2 )
|
||||
|
||||
@ -262,6 +262,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
|
||||
|
||||
grpOWSServiceCapabilities->setChecked( QgsProject::instance()->readBoolEntry( "WMSServiceCapabilities", "/", false ) );
|
||||
mWMSTitle->setText( QgsProject::instance()->readEntry( "WMSServiceTitle", "/" ) );
|
||||
mWMSName->setText( QgsProject::instance()->readEntry( "WMSRootName", "/" ) );
|
||||
mWMSContactOrganization->setText( QgsProject::instance()->readEntry( "WMSContactOrganization", "/", "" ) );
|
||||
mWMSContactPerson->setText( QgsProject::instance()->readEntry( "WMSContactPerson", "/", "" ) );
|
||||
mWMSContactMail->setText( QgsProject::instance()->readEntry( "WMSContactMail", "/", "" ) );
|
||||
@ -271,6 +272,10 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
|
||||
mWMSUrlLineEdit->setText( QgsProject::instance()->readEntry( "WMSUrl", "/", "" ) );
|
||||
mWMSKeywordList->setText( QgsProject::instance()->readListEntry( "WMSKeywordList", "/" ).join( ", " ) );
|
||||
|
||||
// WMS Name validator
|
||||
QValidator *shortNameValidator = new QRegExpValidator( QgsApplication::shortNameRegExp(), this );
|
||||
mWMSName->setValidator( shortNameValidator );
|
||||
|
||||
// WMS Contact Position
|
||||
QString contactPositionText = QgsProject::instance()->readEntry( "WMSContactPosition", "/", "" );
|
||||
mWMSContactPositionCb->addItem( "" );
|
||||
@ -785,6 +790,7 @@ void QgsProjectProperties::apply()
|
||||
|
||||
QgsProject::instance()->writeEntry( "WMSServiceCapabilities", "/", grpOWSServiceCapabilities->isChecked() );
|
||||
QgsProject::instance()->writeEntry( "WMSServiceTitle", "/", mWMSTitle->text() );
|
||||
QgsProject::instance()->writeEntry( "WMSRootName", "/", mWMSName->text() );
|
||||
QgsProject::instance()->writeEntry( "WMSContactOrganization", "/", mWMSContactOrganization->text() );
|
||||
QgsProject::instance()->writeEntry( "WMSContactPerson", "/", mWMSContactPerson->text() );
|
||||
QgsProject::instance()->writeEntry( "WMSContactMail", "/", mWMSContactMail->text() );
|
||||
|
||||
@ -750,6 +750,13 @@ void QgsRasterLayerProperties::sync()
|
||||
txtbMetadata->document()->setDefaultStyleSheet( myStyle );
|
||||
txtbMetadata->setHtml( mRasterLayer->metadata() );
|
||||
|
||||
// WMS Name as layer short name
|
||||
mLayerShortNameLineEdit->setText( mRasterLayer->shortName() );
|
||||
// WMS Name validator
|
||||
QValidator *shortNameValidator = new QRegExpValidator( QgsApplication::shortNameRegExp(), this );
|
||||
mLayerShortNameLineEdit->setValidator( shortNameValidator );
|
||||
|
||||
//layer title and abstract
|
||||
mLayerTitleLineEdit->setText( mRasterLayer->title() );
|
||||
mLayerAbstractTextEdit->setPlainText( mRasterLayer->abstract() );
|
||||
mLayerKeywordListLineEdit->setText( mRasterLayer->keywordList() );
|
||||
@ -934,6 +941,7 @@ void QgsRasterLayerProperties::apply()
|
||||
QPixmap thumbnail = QPixmap::fromImage( mRasterLayer->previewAsImage( pixmapThumbnail->size() ) );
|
||||
pixmapThumbnail->setPixmap( thumbnail );
|
||||
|
||||
mRasterLayer->setShortName( mLayerShortNameLineEdit->text() );
|
||||
mRasterLayer->setTitle( mLayerTitleLineEdit->text() );
|
||||
mRasterLayer->setAbstract( mLayerAbstractTextEdit->toPlainText() );
|
||||
mRasterLayer->setKeywordList( mLayerKeywordListLineEdit->text() );
|
||||
|
||||
@ -249,6 +249,11 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
|
||||
diagLayout->addWidget( diagramPropertiesDialog );
|
||||
mDiagramFrame->setLayout( diagLayout );
|
||||
|
||||
// WMS Name as layer short name
|
||||
mLayerShortNameLineEdit->setText( layer->shortName() );
|
||||
// WMS Name validator
|
||||
QValidator *shortNameValidator = new QRegExpValidator( QgsApplication::shortNameRegExp(), this );
|
||||
mLayerShortNameLineEdit->setValidator( shortNameValidator );
|
||||
|
||||
//layer title and abstract
|
||||
mLayerTitleLineEdit->setText( layer->title() );
|
||||
@ -588,6 +593,7 @@ void QgsVectorLayerProperties::apply()
|
||||
diagramPropertiesDialog->apply();
|
||||
|
||||
//layer title and abstract
|
||||
layer->setShortName( mLayerShortNameLineEdit->text() );
|
||||
layer->setTitle( mLayerTitleLineEdit->text() );
|
||||
layer->setAbstract( mLayerAbstractTextEdit->toPlainText() );
|
||||
layer->setKeywordList( mLayerKeywordListLineEdit->text() );
|
||||
|
||||
@ -717,6 +717,11 @@ QString QgsApplication::userStyleV2Path()
|
||||
return qgisSettingsDirPath() + QLatin1String( "symbology-ng-style.db" );
|
||||
}
|
||||
|
||||
QRegExp QgsApplication::shortNameRegExp()
|
||||
{
|
||||
return QRegExp( "^[A-Za-z][A-Za-z0-9\\._-]*" );
|
||||
}
|
||||
|
||||
QString QgsApplication::userThemesFolder()
|
||||
{
|
||||
return qgisSettingsDirPath() + QLatin1String( "/themes" );
|
||||
|
||||
@ -190,6 +190,9 @@ class CORE_EXPORT QgsApplication : public QApplication
|
||||
//! Returns the path to user's style.
|
||||
static QString userStyleV2Path();
|
||||
|
||||
//! Returns the short name regular exprecience for line edit validator
|
||||
static QRegExp shortNameRegExp();
|
||||
|
||||
//! Returns the path to user's themes folder
|
||||
static QString userThemesFolder();
|
||||
|
||||
|
||||
@ -67,6 +67,9 @@ QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
|
||||
mLayerName = capitaliseLayerName( mLayerOrigName );
|
||||
QgsDebugMsg( "display name: '" + mLayerName + '\'' );
|
||||
|
||||
// Set short name = the first original name
|
||||
mShortName = lyrname;
|
||||
|
||||
// Generate the unique ID of this layer
|
||||
QDateTime dt = QDateTime::currentDateTime();
|
||||
mID = lyrname + dt.toString( "yyyyMMddhhmmsszzz" );
|
||||
@ -425,6 +428,13 @@ bool QgsMapLayer::readLayerXML( const QDomElement& layerElement )
|
||||
mne = mnl.toElement();
|
||||
setLayerName( mne.text() );
|
||||
|
||||
//short name
|
||||
QDomElement shortNameElem = layerElement.firstChildElement( "shortname" );
|
||||
if ( !shortNameElem.isNull() )
|
||||
{
|
||||
mShortName = shortNameElem.text();
|
||||
}
|
||||
|
||||
//title
|
||||
QDomElement titleElem = layerElement.firstChildElement( "title" );
|
||||
if ( !titleElem.isNull() )
|
||||
@ -640,6 +650,11 @@ bool QgsMapLayer::writeLayerXML( QDomElement& layerElement, QDomDocument& docume
|
||||
QDomText layerNameText = document.createTextNode( originalName() );
|
||||
layerName.appendChild( layerNameText );
|
||||
|
||||
// layer short name
|
||||
QDomElement layerShortName = document.createElement( "shortname" );
|
||||
QDomText layerShortNameText = document.createTextNode( shortName() );
|
||||
layerShortName.appendChild( layerShortNameText );
|
||||
|
||||
// layer title
|
||||
QDomElement layerTitle = document.createElement( "title" );
|
||||
QDomText layerTitleText = document.createTextNode( title() );
|
||||
@ -651,6 +666,7 @@ bool QgsMapLayer::writeLayerXML( QDomElement& layerElement, QDomDocument& docume
|
||||
layerAbstract.appendChild( layerAbstractText );
|
||||
|
||||
layerElement.appendChild( layerName );
|
||||
layerElement.appendChild( layerShortName );
|
||||
layerElement.appendChild( layerTitle );
|
||||
layerElement.appendChild( layerAbstract );
|
||||
|
||||
|
||||
@ -92,6 +92,17 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
*/
|
||||
QString originalName() const { return mLayerOrigName; }
|
||||
|
||||
/** Set the short name of the layer
|
||||
* used by QGIS Server to identify the layer
|
||||
* @return the layer short name
|
||||
*/
|
||||
void setShortName( const QString& shortName ) { mShortName = shortName; }
|
||||
/** Get the short name of the layer
|
||||
* used by QGIS Server to identify the layer
|
||||
* @return the layer short name
|
||||
*/
|
||||
QString shortName() const { return mShortName; }
|
||||
|
||||
/** Set the title of the layer
|
||||
* used by QGIS Server in GetCapabilities request
|
||||
* @return the layer title
|
||||
@ -677,6 +688,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
|
||||
*/
|
||||
QString mLayerOrigName;
|
||||
|
||||
QString mShortName;
|
||||
QString mTitle;
|
||||
|
||||
/** Description of the layer*/
|
||||
|
||||
@ -265,6 +265,7 @@ SET(QGIS_GUI_SRCS
|
||||
qgsvertexmarker.cpp
|
||||
qgsunitselectionwidget.cpp
|
||||
qgslegendfilterbutton.cpp
|
||||
qgsgroupwmsdatadialog.cpp
|
||||
)
|
||||
|
||||
IF (WITH_QTWEBKIT)
|
||||
@ -392,6 +393,7 @@ SET(QGIS_GUI_MOC_HDRS
|
||||
qgsunitselectionwidget.h
|
||||
qgsuserinputdockwidget.h
|
||||
qgslegendfilterbutton.h
|
||||
qgsgroupwmsdatadialog.h
|
||||
|
||||
raster/qgsrasterminmaxwidget.h
|
||||
raster/qgspalettedrendererwidget.h
|
||||
|
||||
57
src/gui/qgsgroupwmsdatadialog.cpp
Normal file
57
src/gui/qgsgroupwmsdatadialog.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
/***************************************************************************
|
||||
qgsscalevisibilitydialog.cpp
|
||||
--------------------------------------
|
||||
Date : 20.05.2014
|
||||
Copyright : (C) 2014 Denis Rouzaud
|
||||
Email : denis.rouzaud@gmail.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 "qgsapplication.h"
|
||||
#include "qgsgroupwmsdatadialog.h"
|
||||
|
||||
|
||||
QgsGroupWMSDataDialog::QgsGroupWMSDataDialog( QWidget *parent, const Qt::WindowFlags& fl ) :
|
||||
QDialog( parent, fl )
|
||||
{
|
||||
setupUi( this );
|
||||
// WMS Name validator
|
||||
QValidator *shortNameValidator = new QRegExpValidator( QgsApplication::shortNameRegExp(), this );
|
||||
mShortNameLineEdit->setValidator( shortNameValidator );
|
||||
}
|
||||
|
||||
QString QgsGroupWMSDataDialog::groupShortName()
|
||||
{
|
||||
return mShortNameLineEdit->text();
|
||||
}
|
||||
|
||||
void QgsGroupWMSDataDialog::setGroupShortName( QString shortName )
|
||||
{
|
||||
mShortNameLineEdit->setText( shortName );
|
||||
}
|
||||
|
||||
QString QgsGroupWMSDataDialog::groupTitle()
|
||||
{
|
||||
return mTitleLineEdit->text();
|
||||
}
|
||||
|
||||
void QgsGroupWMSDataDialog::setGroupTitle( QString title )
|
||||
{
|
||||
mTitleLineEdit->setText( title );
|
||||
}
|
||||
|
||||
QString QgsGroupWMSDataDialog::groupAbstract()
|
||||
{
|
||||
return mAbstractTextEdit->toPlainText();
|
||||
}
|
||||
|
||||
void QgsGroupWMSDataDialog::setGroupAbstract( QString abstract )
|
||||
{
|
||||
mAbstractTextEdit->setPlainText( abstract );
|
||||
}
|
||||
62
src/gui/qgsgroupwmsdatadialog.h
Normal file
62
src/gui/qgsgroupwmsdatadialog.h
Normal file
@ -0,0 +1,62 @@
|
||||
/***************************************************************************
|
||||
qgsscalevisibilitydialog.cpp
|
||||
--------------------------------------
|
||||
Date : 20.05.2014
|
||||
Copyright : (C) 2014 Denis Rouzaud
|
||||
Email : denis.rouzaud@gmail.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 QGSGROUPWMSDATADIALOG_H
|
||||
#define QGSGROUPWMSDATADIALOG_H
|
||||
|
||||
#include "ui_qgsgroupwmsdatadialogbase.h"
|
||||
#include "qgisgui.h"
|
||||
#include "qgscontexthelp.h"
|
||||
|
||||
#include "qgis.h"
|
||||
|
||||
class GUI_EXPORT QgsGroupWMSDataDialog: public QDialog, private Ui::QgsGroupWMSDataDialogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
QgsGroupWMSDataDialog( QWidget *parent = 0, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );
|
||||
//~QgsGroupWMSDataDialog();
|
||||
|
||||
//! return group WMS title
|
||||
QString groupTitle();
|
||||
|
||||
//! return group WMS short name
|
||||
QString groupShortName();
|
||||
|
||||
//! return group WMS abstract
|
||||
QString groupAbstract();
|
||||
|
||||
|
||||
public slots:
|
||||
//! set group WMS title
|
||||
void setGroupTitle( QString title );
|
||||
|
||||
//! set group WMS short name
|
||||
void setGroupShortName( QString shortName );
|
||||
|
||||
//! set group WMS abstract
|
||||
void setGroupAbstract( QString abstract );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
QString mGroupTitle;
|
||||
QString mGroupShortName;
|
||||
|
||||
};
|
||||
|
||||
#endif // QGSGROUPWMSDATADIALOG_H
|
||||
@ -26,6 +26,7 @@
|
||||
#include "qgsmslayercache.h"
|
||||
#include "qgsrasterlayer.h"
|
||||
#include "qgseditorwidgetregistry.h"
|
||||
#include "qgslayertreegroup.h"
|
||||
|
||||
#include <QDomDocument>
|
||||
#include <QFileInfo>
|
||||
@ -48,19 +49,14 @@ QgsServerProjectParser::QgsServerProjectParser( QDomDocument* xmlDoc, const QStr
|
||||
{
|
||||
currentElement = layerNodeList.at( i ).toElement();
|
||||
mProjectLayerElements.push_back( currentElement );
|
||||
mProjectLayerElementsByName.insert( layerName( currentElement ), currentElement );
|
||||
QString lName = layerShortName( currentElement );
|
||||
if ( lName.isNull() )
|
||||
lName = layerName( currentElement );
|
||||
mProjectLayerElementsByName.insert( lName, currentElement );
|
||||
mProjectLayerElementsById.insert( layerId( currentElement ), currentElement );
|
||||
}
|
||||
|
||||
QDomElement legendElement = mXMLDoc->documentElement().firstChildElement( "legend" );
|
||||
if ( !legendElement.isNull() )
|
||||
{
|
||||
QDomNodeList groupNodeList = legendElement.elementsByTagName( "legendgroup" );
|
||||
for ( int i = 0; i < groupNodeList.size(); ++i )
|
||||
{
|
||||
mLegendGroupElements.push_back( groupNodeList.at( i ).toElement() );
|
||||
}
|
||||
}
|
||||
mLegendGroupElements = findLegendGroupElements();
|
||||
|
||||
mUseLayerIDs = findUseLayerIDs();
|
||||
mRestrictedLayers = findRestrictedLayers();
|
||||
@ -272,7 +268,7 @@ QgsMapLayer* QgsServerProjectParser::createLayerFromElement( const QDomElement&
|
||||
}
|
||||
|
||||
layer->readLayerXML( const_cast<QDomElement&>( elem ) ); //should be changed to const in QgsMapLayer
|
||||
layer->setLayerName( layerName( elem ) );
|
||||
//layer->setLayerName( layerName( elem ) );
|
||||
|
||||
if ( layer->type() == QgsMapLayer::VectorLayer )
|
||||
{
|
||||
@ -333,6 +329,21 @@ QString QgsServerProjectParser::layerId( const QDomElement& layerElem ) const
|
||||
return idElem.text();
|
||||
}
|
||||
|
||||
QString QgsServerProjectParser::layerShortName( const QDomElement& layerElem ) const
|
||||
{
|
||||
if ( layerElem.isNull() )
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QDomElement nameElem = layerElem.firstChildElement( "shortname" );
|
||||
if ( nameElem.isNull() )
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
return nameElem.text().replace( ",", "%60" );
|
||||
}
|
||||
|
||||
QgsRectangle QgsServerProjectParser::projectExtent() const
|
||||
{
|
||||
QgsRectangle extent;
|
||||
@ -397,6 +408,7 @@ void QgsServerProjectParser::serviceCapabilities( QDomElement& parentElement, QD
|
||||
serviceElem.appendChild( wmsNameElem );
|
||||
|
||||
//WMS title
|
||||
//why not use project title ?
|
||||
QDomElement titleElem = propertiesElement.firstChildElement( "WMSServiceTitle" );
|
||||
if ( !titleElem.isNull() )
|
||||
{
|
||||
@ -741,6 +753,11 @@ void QgsServerProjectParser::addLayerProjectSettings( QDomElement& layerElem, QD
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Layer tree name
|
||||
QDomElement treeNameElem = doc.createElement( "TreeName" );
|
||||
QDomText treeNameText = doc.createTextNode( currentLayer->name() );
|
||||
treeNameElem.appendChild( treeNameText );
|
||||
layerElem.appendChild( treeNameElem );
|
||||
|
||||
if ( currentLayer->type() == QgsMapLayer::VectorLayer )
|
||||
{
|
||||
@ -1169,6 +1186,72 @@ void QgsServerProjectParser::layerFromLegendLayer( const QDomElement& legendLaye
|
||||
}
|
||||
}
|
||||
|
||||
QList<QDomElement> QgsServerProjectParser::findLegendGroupElements() const
|
||||
{
|
||||
QList<QDomElement> LegendGroupElemList;
|
||||
QgsLayerTreeGroup* rootLayerTreeGroup = new QgsLayerTreeGroup;;
|
||||
|
||||
QDomElement layerTreeElem = mXMLDoc->documentElement().firstChildElement( "layer-tree-group" );
|
||||
if ( !layerTreeElem.isNull() )
|
||||
{
|
||||
rootLayerTreeGroup = QgsLayerTreeGroup::readXML( layerTreeElem );
|
||||
}
|
||||
|
||||
QDomElement legendElement = mXMLDoc->documentElement().firstChildElement( "legend" );
|
||||
if ( !legendElement.isNull() && rootLayerTreeGroup )
|
||||
{
|
||||
LegendGroupElemList.append( setLegendGroupElementsWithLayerTree( rootLayerTreeGroup, legendElement ) );
|
||||
}
|
||||
|
||||
if ( !legendElement.isNull() )
|
||||
{
|
||||
QDomNodeList groupNodeList = legendElement.elementsByTagName( "legendgroup" );
|
||||
for ( int i = 0; i < groupNodeList.size(); ++i )
|
||||
{
|
||||
LegendGroupElemList.push_back( groupNodeList.at( i ).toElement() );
|
||||
}
|
||||
return LegendGroupElemList;
|
||||
}
|
||||
return LegendGroupElemList;
|
||||
}
|
||||
|
||||
QList<QDomElement> QgsServerProjectParser::setLegendGroupElementsWithLayerTree( QgsLayerTreeGroup* layerTreeGroup, QDomElement legendElement ) const
|
||||
{
|
||||
QList<QDomElement> LegendGroupElemList;
|
||||
QList< QgsLayerTreeNode * > layerTreeGroupChildren = layerTreeGroup->children();
|
||||
QDomNodeList legendElementChildNodes = legendElement.childNodes();
|
||||
int g = 0; // index of the last child layer tree group
|
||||
for ( int i = 0; i < legendElementChildNodes.size(); ++i )
|
||||
{
|
||||
QDomNode legendElementNode = legendElementChildNodes.at( i );
|
||||
if ( !legendElementNode.isElement() )
|
||||
continue;
|
||||
QDomElement legendElement = legendElementNode.toElement();
|
||||
if ( legendElement.tagName() != "legendgroup" )
|
||||
continue;
|
||||
for ( int j = g; j < i + 1; ++j )
|
||||
{
|
||||
QgsLayerTreeNode* layerTreeNode = layerTreeGroupChildren.at( j );
|
||||
if ( layerTreeNode->nodeType() != QgsLayerTreeNode::NodeGroup )
|
||||
continue;
|
||||
QgsLayerTreeGroup* layerTreeGroup = dynamic_cast<QgsLayerTreeGroup *>( layerTreeNode );
|
||||
if ( layerTreeGroup->name() == legendElement.attribute( "name" ) )
|
||||
{
|
||||
g = j;
|
||||
QString shortName = layerTreeGroup->customProperty( "wmsShortName" ).toString();
|
||||
if ( !shortName.isEmpty() )
|
||||
legendElement.setAttribute( "shortName", shortName );
|
||||
QString title = layerTreeGroup->customProperty( "wmsTitle" ).toString();
|
||||
if ( !title.isEmpty() )
|
||||
legendElement.setAttribute( "title", title );
|
||||
LegendGroupElemList.append( setLegendGroupElementsWithLayerTree( layerTreeGroup, legendElement ) );
|
||||
}
|
||||
}
|
||||
LegendGroupElemList.push_back( legendElement );
|
||||
}
|
||||
return LegendGroupElemList;
|
||||
}
|
||||
|
||||
void QgsServerProjectParser::sublayersOfEmbeddedGroup( const QString& projectFilePath, const QString& groupName, QSet<QString>& layerSet )
|
||||
{
|
||||
QFile projectFile( projectFilePath );
|
||||
|
||||
@ -30,6 +30,7 @@ class QgsCoordinateReferenceSystem;
|
||||
class QgsMapLayer;
|
||||
class QgsRectangle;
|
||||
class QDomDocument;
|
||||
class QgsLayerTreeGroup;
|
||||
|
||||
class SERVER_EXPORT QgsServerProjectParser
|
||||
{
|
||||
@ -100,7 +101,7 @@ class SERVER_EXPORT QgsServerProjectParser
|
||||
QList< QPair< QString, QgsLayerCoordinateTransform > > layerCoordinateTransforms() const;
|
||||
|
||||
/** Returns the text of the <layername> element for a layer element
|
||||
@return id or a null string in case of error*/
|
||||
@return name or a null string in case of error*/
|
||||
QString layerName( const QDomElement& layerElem ) const;
|
||||
|
||||
QString serviceUrl() const;
|
||||
@ -120,6 +121,10 @@ class SERVER_EXPORT QgsServerProjectParser
|
||||
@return id or a null string in case of error*/
|
||||
QString layerId( const QDomElement& layerElem ) const;
|
||||
|
||||
/** Returns the text of the <id> element for a layer element
|
||||
@return id or a null string in case of error*/
|
||||
QString layerShortName( const QDomElement& layerElem ) const;
|
||||
|
||||
QgsRectangle projectExtent() const;
|
||||
|
||||
int numberOfLayers() const;
|
||||
@ -164,6 +169,9 @@ class SERVER_EXPORT QgsServerProjectParser
|
||||
|
||||
bool findUseLayerIDs() const;
|
||||
|
||||
QList<QDomElement> findLegendGroupElements() const;
|
||||
QList<QDomElement> setLegendGroupElementsWithLayerTree( QgsLayerTreeGroup* layerTreeGroup, QDomElement legendElement ) const;
|
||||
|
||||
/** Adds sublayers of an embedded group to layer set*/
|
||||
static void sublayersOfEmbeddedGroup( const QString& projectFilePath, const QString& groupName, QSet<QString>& layerSet );
|
||||
};
|
||||
|
||||
@ -110,6 +110,8 @@ void QgsWCSProjectParser::wcsContentMetadata( QDomElement& parentElement, QDomDo
|
||||
//We use the layer name even though it might not be unique.
|
||||
//Because the id sometimes contains user/pw information and the name is more descriptive
|
||||
QString typeName = layer->name();
|
||||
if ( !layer->shortName().isEmpty() )
|
||||
typeName = layer->shortName();
|
||||
typeName = typeName.replace( " ", "_" );
|
||||
QDomText nameText = doc.createTextNode( typeName );
|
||||
nameElem.appendChild( nameText );
|
||||
@ -231,6 +233,8 @@ void QgsWCSProjectParser::describeCoverage( const QString& aCoveName, QDomElemen
|
||||
#endif
|
||||
|
||||
QString coveName = rLayer->name();
|
||||
if ( !rLayer->shortName().isEmpty() )
|
||||
coveName = rLayer->shortName();
|
||||
coveName = coveName.replace( " ", "_" );
|
||||
if ( wcsLayersId.contains( rLayer->id() ) && ( aCoveName == "" || coveNameList.contains( coveName ) ) )
|
||||
{
|
||||
@ -242,6 +246,8 @@ void QgsWCSProjectParser::describeCoverage( const QString& aCoveName, QDomElemen
|
||||
//We use the layer name even though it might not be unique.
|
||||
//Because the id sometimes contains user/pw information and the name is more descriptive
|
||||
QString typeName = rLayer->name();
|
||||
if ( !rLayer->shortName().isEmpty() )
|
||||
typeName = rLayer->shortName();
|
||||
typeName = typeName.replace( " ", "_" );
|
||||
QDomText nameText = doc.createTextNode( typeName );
|
||||
nameElem.appendChild( nameText );
|
||||
@ -435,6 +441,8 @@ QList<QgsMapLayer*> QgsWCSProjectParser::mapLayerFromCoverage( const QString& cN
|
||||
return layerList;
|
||||
|
||||
QString coveName = layer->name();
|
||||
if ( !layer->shortName().isEmpty() )
|
||||
coveName = layer->shortName();
|
||||
coveName = coveName.replace( " ", "_" );
|
||||
if ( cName == coveName )
|
||||
{
|
||||
|
||||
@ -101,6 +101,8 @@ void QgsWFSProjectParser::featureTypeList( QDomElement& parentElement, QDomDocum
|
||||
//We use the layer name even though it might not be unique.
|
||||
//Because the id sometimes contains user/pw information and the name is more descriptive
|
||||
QString typeName = layer->name();
|
||||
if ( !layer->shortName().isEmpty() )
|
||||
typeName = layer->shortName();
|
||||
typeName = typeName.replace( " ", "_" );
|
||||
QDomText nameText = doc.createTextNode( typeName );
|
||||
nameElem.appendChild( nameText );
|
||||
@ -356,6 +358,8 @@ void QgsWFSProjectParser::describeFeatureType( const QString& aTypeName, QDomEle
|
||||
#endif
|
||||
|
||||
QString typeName = layer->name();
|
||||
if ( !layer->shortName().isEmpty() )
|
||||
typeName = layer->shortName();
|
||||
typeName = typeName.replace( " ", "_" );
|
||||
|
||||
if ( wfsLayersId.contains( layer->id() ) && ( aTypeName == "" || typeNameList.contains( typeName ) ) )
|
||||
@ -546,6 +550,8 @@ QList<QgsMapLayer*> QgsWFSProjectParser::mapLayerFromTypeName( const QString& aT
|
||||
continue;
|
||||
|
||||
QString typeName = layer->name();
|
||||
if ( !layer->shortName().isEmpty() )
|
||||
typeName = layer->shortName();
|
||||
typeName = typeName.replace( " ", "_" );
|
||||
|
||||
if ( wfsLayersId.contains( layer->id() ) && ( aTypeName == "" || typeNameList.contains( typeName ) ) )
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "qgscomposerpicture.h"
|
||||
#include "qgscomposerscalebar.h"
|
||||
#include "qgscomposershape.h"
|
||||
#include "qgslayertreeutils.h"
|
||||
#include "qgslayertreegroup.h"
|
||||
#include "qgslayertreelayer.h"
|
||||
#include "qgsaccesscontrol.h"
|
||||
@ -91,21 +92,42 @@ void QgsWMSProjectParser::layersAndStylesCapabilities( QDomElement& parentElemen
|
||||
QString projTitle = mProjectParser->projectTitle();
|
||||
QDomElement layerParentElem = doc.createElement( "Layer" );
|
||||
layerParentElem.setAttribute( "queryable", "1" );
|
||||
|
||||
QDomElement layerParentNameElem = doc.createElement( "Name" );
|
||||
QDomText layerParentNameText = doc.createTextNode( projTitle );
|
||||
layerParentNameElem.appendChild( layerParentNameText );
|
||||
//WMS Name
|
||||
QDomElement nameElem = mProjectParser->propertiesElem().firstChildElement( "WMSRootName" );
|
||||
if ( !nameElem.isNull() )
|
||||
{
|
||||
QDomText layerParentNameText = doc.createTextNode( nameElem.text() );
|
||||
layerParentNameElem.appendChild( layerParentNameText );
|
||||
}
|
||||
else
|
||||
{
|
||||
QDomText layerParentNameText = doc.createTextNode( projTitle );
|
||||
layerParentNameElem.appendChild( layerParentNameText );
|
||||
}
|
||||
layerParentElem.appendChild( layerParentNameElem );
|
||||
// Why not use WMSServiceTitle ?
|
||||
QDomElement layerParentTitleElem = doc.createElement( "Title" );
|
||||
QDomText layerParentTitleText = doc.createTextNode( projTitle );
|
||||
layerParentTitleElem.appendChild( layerParentTitleText );
|
||||
layerParentElem.appendChild( layerParentTitleElem );
|
||||
|
||||
if ( fullProjectSettings )
|
||||
{
|
||||
// Layer tree name
|
||||
QDomElement treeNameElem = doc.createElement( "TreeName" );
|
||||
QDomText treeNameText = doc.createTextNode( projTitle );
|
||||
treeNameElem.appendChild( treeNameText );
|
||||
layerParentElem.appendChild( treeNameElem );
|
||||
}
|
||||
|
||||
QDomElement legendElem = mProjectParser->legendElem();
|
||||
|
||||
QHash<QString, QString> idNameMap;
|
||||
QStringList layerIDList;
|
||||
|
||||
addLayers( doc, layerParentElem, legendElem, layerMap, nonIdentifiableLayers, version, fullProjectSettings, idNameMap, layerIDList );
|
||||
addLayers( doc, layerParentElem, legendElem, projectLayerTreeGroup(), layerMap, nonIdentifiableLayers, version, fullProjectSettings, idNameMap, layerIDList );
|
||||
|
||||
parentElement.appendChild( layerParentElem );
|
||||
mProjectParser->combineExtentAndCrsOfGroupChildren( layerParentElem, doc, true );
|
||||
@ -153,14 +175,27 @@ QList<QgsMapLayer*> QgsWMSProjectParser::mapLayerFromStyle( const QString& lName
|
||||
}
|
||||
else
|
||||
{
|
||||
const QList<QDomElement>& legendGroupElements = mProjectParser->legendGroupElements();
|
||||
QList<QDomElement>::const_iterator groupIt = legendGroupElements.constBegin();
|
||||
for ( ; groupIt != legendGroupElements.constEnd(); ++groupIt )
|
||||
QDomElement nameElem = mProjectParser->propertiesElem().firstChildElement( "WMSRootName" );
|
||||
if ( !nameElem.isNull() && lName == nameElem.text() )
|
||||
{
|
||||
if ( groupIt->attribute( "name" ) == lName )
|
||||
groupElement = mProjectParser->legendElem();
|
||||
}
|
||||
else
|
||||
{
|
||||
const QList<QDomElement>& legendGroupElements = mProjectParser->legendGroupElements();
|
||||
QList<QDomElement>::const_iterator groupIt = legendGroupElements.constBegin();
|
||||
for ( ; groupIt != legendGroupElements.constEnd(); ++groupIt )
|
||||
{
|
||||
groupElement = *groupIt;
|
||||
break;
|
||||
if ( groupIt->attribute( "name" ) == lName )
|
||||
{
|
||||
groupElement = *groupIt;
|
||||
break;
|
||||
}
|
||||
else if ( groupIt->attribute( "shortName" ) == lName )
|
||||
{
|
||||
groupElement = *groupIt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -667,6 +702,7 @@ void QgsWMSProjectParser::owsGeneralAndResourceList( QDomElement& parentElement,
|
||||
generalElem.appendChild( windowElem );
|
||||
|
||||
//WMS title
|
||||
//why not use project title ?
|
||||
QDomElement titleElem = propertiesElem.firstChildElement( "WMSServiceTitle" );
|
||||
if ( !titleElem.isNull() )
|
||||
{
|
||||
@ -893,11 +929,16 @@ void QgsWMSProjectParser::addLayerStyles( QgsMapLayer* currentLayer, QDomDocumen
|
||||
// no parameters on custom hrefUrl, because should link directly to graphic
|
||||
if ( !customHrefString )
|
||||
{
|
||||
QString layerName = currentLayer->name();
|
||||
if ( mProjectParser && mProjectParser->useLayerIDs() )
|
||||
layerName = currentLayer->id();
|
||||
else if ( !currentLayer->shortName().isEmpty() )
|
||||
layerName = currentLayer->shortName();
|
||||
QUrl mapUrl( hrefString );
|
||||
mapUrl.addQueryItem( "SERVICE", "WMS" );
|
||||
mapUrl.addQueryItem( "VERSION", version );
|
||||
mapUrl.addQueryItem( "REQUEST", "GetLegendGraphic" );
|
||||
mapUrl.addQueryItem( "LAYER", mProjectParser->useLayerIDs() ? currentLayer->id() : currentLayer->name() );
|
||||
mapUrl.addQueryItem( "LAYER", layerName );
|
||||
mapUrl.addQueryItem( "FORMAT", "image/png" );
|
||||
mapUrl.addQueryItem( "STYLE", styleNameText.data() );
|
||||
if ( version == "1.3.0" )
|
||||
@ -922,6 +963,7 @@ void QgsWMSProjectParser::addLayerStyles( QgsMapLayer* currentLayer, QDomDocumen
|
||||
void QgsWMSProjectParser::addLayers( QDomDocument &doc,
|
||||
QDomElement &parentLayer,
|
||||
const QDomElement &legendElem,
|
||||
QgsLayerTreeGroup *layerTreeGroup,
|
||||
const QMap<QString, QgsMapLayer *> &layerMap,
|
||||
const QStringList &nonIdentifiableLayers,
|
||||
QString version, //1.1.1 or 1.3.0
|
||||
@ -930,6 +972,8 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
|
||||
QStringList &layerIDList ) const
|
||||
{
|
||||
QDomNodeList legendChildren = legendElem.childNodes();
|
||||
QList< QgsLayerTreeNode * > layerTreeGroupChildren = layerTreeGroup->children();
|
||||
int g = 0; // index of the last child layer tree group
|
||||
for ( int i = 0; i < legendChildren.size(); ++i )
|
||||
{
|
||||
QDomElement currentChildElem = legendChildren.at( i ).toElement();
|
||||
@ -947,17 +991,63 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// find layer tree group
|
||||
QgsLayerTreeGroup* ltGroup = layerTreeGroup->findGroup( name );
|
||||
if ( layerTreeGroupChildren.length() >= g && layerTreeGroupChildren.length() <= i )
|
||||
{
|
||||
for ( int j = g; j < i + 1; ++j )
|
||||
{
|
||||
QgsLayerTreeNode* layerTreeChildNode = layerTreeGroupChildren.at( j );
|
||||
if ( layerTreeChildNode->nodeType() != QgsLayerTreeNode::NodeGroup )
|
||||
continue;
|
||||
QgsLayerTreeGroup* layerTreeChildGroup = dynamic_cast<QgsLayerTreeGroup *>( layerTreeChildNode );
|
||||
if ( layerTreeChildGroup->name() != currentChildElem.attribute( "name" ) )
|
||||
continue;
|
||||
ltGroup = layerTreeChildGroup;
|
||||
g = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString shortName = ltGroup->customProperty( "wmsShortName" ).toString();
|
||||
QString title = ltGroup->customProperty( "wmsTitle" ).toString();
|
||||
|
||||
QDomElement nameElem = doc.createElement( "Name" );
|
||||
QDomText nameText = doc.createTextNode( name );
|
||||
QDomText nameText;
|
||||
if ( !shortName.isEmpty() )
|
||||
nameText = doc.createTextNode( shortName );
|
||||
else
|
||||
nameText = doc.createTextNode( name );
|
||||
nameElem.appendChild( nameText );
|
||||
layerElem.appendChild( nameElem );
|
||||
|
||||
QDomElement titleElem = doc.createElement( "Title" );
|
||||
QDomText titleText = doc.createTextNode( name );
|
||||
QDomText titleText;
|
||||
if ( !title.isEmpty() )
|
||||
titleText = doc.createTextNode( title );
|
||||
else
|
||||
titleText = doc.createTextNode( name );
|
||||
titleElem.appendChild( titleText );
|
||||
layerElem.appendChild( titleElem );
|
||||
|
||||
QString abstract = ltGroup->customProperty( "wmsAbstract" ).toString();
|
||||
if ( !abstract.isEmpty() )
|
||||
{
|
||||
QDomElement abstractElem = doc.createElement( "Abstract" );
|
||||
QDomText abstractText = doc.createTextNode( abstract );
|
||||
abstractElem.appendChild( abstractText );
|
||||
layerElem.appendChild( abstractElem );
|
||||
}
|
||||
|
||||
if ( fullProjectSettings )
|
||||
{
|
||||
// Layer tree name
|
||||
QDomElement treeNameElem = doc.createElement( "TreeName" );
|
||||
QDomText treeNameText = doc.createTextNode( name );
|
||||
treeNameElem.appendChild( treeNameText );
|
||||
layerElem.appendChild( treeNameElem );
|
||||
}
|
||||
|
||||
if ( currentChildElem.attribute( "embedded" ) == "1" )
|
||||
{
|
||||
//add layers from other project files and embed into this group
|
||||
@ -974,6 +1064,7 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
|
||||
{
|
||||
QgsServerProjectParser* pp = p->mProjectParser;
|
||||
const QList<QDomElement>& embeddedGroupElements = pp->legendGroupElements();
|
||||
QgsLayerTreeGroup *embeddedLayerTreeGroup = p->projectLayerTreeGroup();
|
||||
QStringList pIdDisabled = p->identifyDisabledLayers();
|
||||
|
||||
QDomElement embeddedGroupElem;
|
||||
@ -993,12 +1084,12 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
|
||||
pLayerMap.insert( pp->layerId( elem ), pp->createLayerFromElement( elem ) );
|
||||
}
|
||||
|
||||
p->addLayers( doc, layerElem, embeddedGroupElem, pLayerMap, pIdDisabled, version, fullProjectSettings, idNameMap, layerIDList );
|
||||
p->addLayers( doc, layerElem, embeddedGroupElem, embeddedLayerTreeGroup->findGroup( name ), pLayerMap, pIdDisabled, version, fullProjectSettings, idNameMap, layerIDList );
|
||||
}
|
||||
}
|
||||
else //normal (not embedded) legend group
|
||||
{
|
||||
addLayers( doc, layerElem, currentChildElem, layerMap, nonIdentifiableLayers, version, fullProjectSettings, idNameMap, layerIDList );
|
||||
addLayers( doc, layerElem, currentChildElem, ltGroup, layerMap, nonIdentifiableLayers, version, fullProjectSettings, idNameMap, layerIDList );
|
||||
}
|
||||
|
||||
// combine bounding boxes of children (groups/layers)
|
||||
@ -1021,7 +1112,12 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( mProjectParser->restrictedLayers().contains( mProjectParser->useLayerIDs() ? currentLayer->id() : currentLayer->name() ) ) //unpublished layer
|
||||
QString layerName = currentLayer->name();
|
||||
if ( mProjectParser && mProjectParser->useLayerIDs() )
|
||||
layerName = currentLayer->id();
|
||||
else if ( !currentLayer->shortName().isEmpty() )
|
||||
layerName = currentLayer->shortName();
|
||||
if ( mProjectParser->restrictedLayers().contains( layerName ) ) //unpublished layer
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -1043,9 +1139,7 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
|
||||
}
|
||||
|
||||
QDomElement nameElem = doc.createElement( "Name" );
|
||||
//We use the layer name even though it might not be unique.
|
||||
//Because the id sometimes contains user/pw information and the name is more descriptive
|
||||
QDomText nameText = doc.createTextNode( mProjectParser->useLayerIDs() ? currentLayer->id() : currentLayer->name() );
|
||||
QDomText nameText = doc.createTextNode( layerName );
|
||||
nameElem.appendChild( nameText );
|
||||
layerElem.appendChild( nameElem );
|
||||
|
||||
@ -1362,7 +1456,12 @@ void QgsWMSProjectParser::addOWSLayers( QDomDocument &doc,
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( mProjectParser->restrictedLayers().contains( mProjectParser->useLayerIDs() ? currentLayer->id() : currentLayer->name() ) ) //unpublished layer
|
||||
QString layerName = currentLayer->name();
|
||||
if ( mProjectParser && mProjectParser->useLayerIDs() )
|
||||
layerName = currentLayer->id();
|
||||
else if ( !currentLayer->shortName().isEmpty() )
|
||||
layerName = currentLayer->shortName();
|
||||
if ( mProjectParser->restrictedLayers().contains( layerName ) ) //unpublished layer
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -1393,7 +1492,11 @@ void QgsWMSProjectParser::addOWSLayers( QDomDocument &doc,
|
||||
// OWSContext Layer opacity is set to 1
|
||||
layerElem.setAttribute( "opacity", 1 );
|
||||
|
||||
QString lyrname = mProjectParser->useLayerIDs() ? currentLayer->id() : currentLayer->name();
|
||||
QString lyrname = currentLayer->name();
|
||||
if ( mProjectParser && mProjectParser->useLayerIDs() )
|
||||
lyrname = currentLayer->id();
|
||||
else if ( !currentLayer->shortName().isEmpty() )
|
||||
lyrname = currentLayer->shortName();
|
||||
layerElem.setAttribute( "name", lyrname );
|
||||
|
||||
// define an id based on layer name
|
||||
@ -1546,8 +1649,10 @@ int QgsWMSProjectParser::layersAndStyles( QStringList& layers, QStringList& styl
|
||||
|
||||
for ( ; elemIt != projectLayerElements.constEnd(); ++elemIt )
|
||||
{
|
||||
currentLayerName = mProjectParser->layerName( *elemIt );
|
||||
if ( !currentLayerName.isNull() )
|
||||
currentLayerName = mProjectParser->layerShortName( *elemIt );
|
||||
if ( currentLayerName.isEmpty() )
|
||||
currentLayerName = mProjectParser->layerName( *elemIt );
|
||||
if ( !currentLayerName.isEmpty() )
|
||||
{
|
||||
layers << currentLayerName;
|
||||
styles << QString();
|
||||
@ -1684,7 +1789,11 @@ QDomDocument QgsWMSProjectParser::describeLayer( QStringList& layerList, const Q
|
||||
}
|
||||
#endif
|
||||
|
||||
QString layerTypeName = mProjectParser->useLayerIDs() ? currentLayer->id() : currentLayer->name();
|
||||
QString layerTypeName = currentLayer->name();
|
||||
if ( mProjectParser && mProjectParser->useLayerIDs() )
|
||||
layerTypeName = currentLayer->id();
|
||||
else if ( !currentLayer->shortName().isEmpty() )
|
||||
layerTypeName = currentLayer->shortName();
|
||||
|
||||
// Create the NamedLayer element
|
||||
QDomElement layerNode = myDocument.createElement( "LayerDescription" );
|
||||
@ -2062,21 +2171,23 @@ QDomElement QgsWMSProjectParser::composerByName( const QString& composerName ) c
|
||||
|
||||
QgsLayerTreeGroup* QgsWMSProjectParser::projectLayerTreeGroup() const
|
||||
{
|
||||
QgsLayerTreeGroup* rootGroup = new QgsLayerTreeGroup;
|
||||
const QDomDocument* projectDoc = mProjectParser->xmlDocument();
|
||||
if ( !projectDoc )
|
||||
{
|
||||
return nullptr;
|
||||
return rootGroup;
|
||||
}
|
||||
|
||||
QDomElement qgisElem = projectDoc->documentElement();
|
||||
if ( qgisElem.isNull() )
|
||||
{
|
||||
return nullptr;
|
||||
return rootGroup;
|
||||
}
|
||||
QDomElement layerTreeElem = qgisElem.firstChildElement( "layer-tree-group" );
|
||||
if ( layerTreeElem.isNull() )
|
||||
{
|
||||
return nullptr;
|
||||
QgsLayerTreeUtils::readOldLegend( rootGroup, mProjectParser->legendElem() );
|
||||
return rootGroup;
|
||||
}
|
||||
return QgsLayerTreeGroup::readXML( layerTreeElem );
|
||||
}
|
||||
|
||||
@ -146,6 +146,7 @@ class SERVER_EXPORT QgsWMSProjectParser : public QgsWMSConfigParser
|
||||
void addLayers( QDomDocument &doc,
|
||||
QDomElement &parentLayer,
|
||||
const QDomElement &legendElem,
|
||||
QgsLayerTreeGroup *layerTreeGroup,
|
||||
const QMap<QString, QgsMapLayer *> &layerMap,
|
||||
const QStringList &nonIdentifiableLayers,
|
||||
QString version, //1.1.1 or 1.3.0
|
||||
|
||||
@ -1712,7 +1712,11 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, const QString& version )
|
||||
else
|
||||
{
|
||||
layerElement = result.createElement( "Layer" );
|
||||
QString layerName = mConfigParser && mConfigParser->useLayerIDs() ? currentLayer->id() : currentLayer->name();
|
||||
QString layerName = currentLayer->name();
|
||||
if ( mConfigParser && mConfigParser->useLayerIDs() )
|
||||
layerName = currentLayer->id();
|
||||
else if ( !currentLayer->shortName().isEmpty() )
|
||||
layerName = currentLayer->shortName();
|
||||
|
||||
//check if the layer is given a different name for GetFeatureInfo output
|
||||
QHash<QString, QString>::const_iterator layerAliasIt = layerAliasMap.find( layerName );
|
||||
@ -2241,7 +2245,11 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
|
||||
{
|
||||
bool withGeom = layer->wkbType() != QGis::WKBNoGeometry && addWktGeometry;
|
||||
int version = infoFormat.startsWith( "application/vnd.ogc.gml/3" ) ? 3 : 2;
|
||||
QString typeName = mConfigParser && mConfigParser->useLayerIDs() ? layer->id() : layer->name();
|
||||
QString typeName = layer->name();
|
||||
if ( mConfigParser && mConfigParser->useLayerIDs() )
|
||||
typeName = layer->id();
|
||||
else if ( !layer->shortName().isEmpty() )
|
||||
typeName = layer->shortName();
|
||||
QDomElement elem = createFeatureGML(
|
||||
&feature, layer, infoDocument, outputCrs, typeName, withGeom, version
|
||||
#ifdef HAVE_SERVER_PYTHON_PLUGINS
|
||||
@ -2388,7 +2396,11 @@ int QgsWMSServer::featureInfoFromRasterLayer( QgsRasterLayer* layer,
|
||||
|
||||
QgsCoordinateReferenceSystem layerCrs = layer->crs();
|
||||
int version = infoFormat.startsWith( "application/vnd.ogc.gml/3" ) ? 3 : 2;
|
||||
QString typeName = mConfigParser && mConfigParser->useLayerIDs() ? layer->id() : layer->name();
|
||||
QString typeName = layer->name();
|
||||
if ( mConfigParser && mConfigParser->useLayerIDs() )
|
||||
typeName = layer->id();
|
||||
else if ( !layer->shortName().isEmpty() )
|
||||
typeName = layer->shortName();
|
||||
QDomElement elem = createFeatureGML(
|
||||
&feature, nullptr, infoDocument, layerCrs, typeName, false, version, nullptr );
|
||||
layerElement.appendChild( elem );
|
||||
@ -2442,7 +2454,12 @@ QStringList QgsWMSServer::layerSet( const QStringList &layersList,
|
||||
theMapLayer = layerList.at( listIndex );
|
||||
if ( theMapLayer )
|
||||
{
|
||||
QgsMessageLog::logMessage( QString( "Checking layer: %1" ).arg( mConfigParser && mConfigParser->useLayerIDs() ? theMapLayer->id() : theMapLayer->name() ) );
|
||||
QString lName = theMapLayer->name();
|
||||
if ( mConfigParser && mConfigParser->useLayerIDs() )
|
||||
lName = theMapLayer->id();
|
||||
else if ( !theMapLayer->shortName().isEmpty() )
|
||||
lName = theMapLayer->shortName();
|
||||
QgsMessageLog::logMessage( QString( "Checking layer: %1" ).arg( lName ) );
|
||||
//test if layer is visible in requested scale
|
||||
bool useScaleConstraint = ( scaleDenominator > 0 && theMapLayer->hasScaleBasedVisibility() );
|
||||
if ( !useScaleConstraint ||
|
||||
@ -2505,9 +2522,15 @@ QMap<QString, QString> QgsWMSServer::applyRequestedLayerFilters( const QStringLi
|
||||
|
||||
Q_FOREACH ( QgsMapLayer *layer, QgsMapLayerRegistry::instance()->mapLayers() )
|
||||
{
|
||||
if ( layer && ( mConfigParser && mConfigParser->useLayerIDs() ? layer->id() : layer->name() ) == eqSplit.at( 0 ) )
|
||||
if ( layer )
|
||||
{
|
||||
layersToFilter.push_back( layer );
|
||||
QString lName = layer->name();
|
||||
if ( mConfigParser && mConfigParser->useLayerIDs() )
|
||||
lName = layer->id();
|
||||
else if ( !layer->shortName().isEmpty() )
|
||||
lName = layer->shortName();
|
||||
if ( lName == eqSplit.at( 0 ) )
|
||||
layersToFilter.push_back( layer );
|
||||
}
|
||||
}
|
||||
|
||||
@ -2727,11 +2750,19 @@ QStringList QgsWMSServer::applyFeatureSelections( const QStringList& layerList )
|
||||
|
||||
Q_FOREACH ( QgsMapLayer *layer, QgsMapLayerRegistry::instance()->mapLayers() )
|
||||
{
|
||||
if ( layer && ( mConfigParser && mConfigParser->useLayerIDs() ? layer->id() : layer->name() ) == layerName )
|
||||
if ( layer )
|
||||
{
|
||||
vLayer = qobject_cast<QgsVectorLayer*>( layer );
|
||||
layersWithSelections.push_back( vLayer->id() );
|
||||
break;
|
||||
QString lName = layer->name();
|
||||
if ( mConfigParser && mConfigParser->useLayerIDs() )
|
||||
lName = layer->id();
|
||||
else if ( !layer->shortName().isEmpty() )
|
||||
lName = layer->shortName();
|
||||
if ( lName == layerName )
|
||||
{
|
||||
vLayer = qobject_cast<QgsVectorLayer*>( layer );
|
||||
layersWithSelections.push_back( vLayer->id() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
127
src/ui/qgsgroupwmsdatadialogbase.ui
Normal file
127
src/ui/qgsgroupwmsdatadialogbase.ui
Normal file
@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsGroupWMSDataDialogBase</class>
|
||||
<widget class="QDialog" name="QgsGroupWMSDataDialogBase">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::WindowModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>206</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Set group WMS data</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="mShortNameLabel">
|
||||
<property name="text">
|
||||
<string>Short name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="mShortNameLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>The short name is a text string used for machine-to-machine communication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="mTitleLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>The title is a text string for the benefit of humans</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="mTitleLabel">
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="mAbstractLabel">
|
||||
<property name="text">
|
||||
<string>Abstract</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QTextEdit" name="mAbstractTextEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<tabstops>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>QgsGroupWMSDataDialogBase</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>451</x>
|
||||
<y>699</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>481</x>
|
||||
<y>297</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>QgsGroupWMSDataDialogBase</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>392</x>
|
||||
<y>699</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>281</x>
|
||||
<y>339</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -1449,7 +1449,7 @@
|
||||
<string notr="true">projowsserver</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
@ -1459,17 +1459,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="mWMSOnlineResourceLineEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="mWMSOnlineResourceLabel">
|
||||
<property name="text">
|
||||
<string>Online resource</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Person</string>
|
||||
@ -1479,23 +1479,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="mWMSContactMail"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="mWMSContactPerson"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>E-Mail</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="mWMSContactOrganization"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Phone</string>
|
||||
@ -1505,10 +1505,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="mWMSTitle"/>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="mWMSTitle">
|
||||
<property name="placeholderText">
|
||||
<string>The title is a text string for the benefit of humans</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Abstract</string>
|
||||
@ -1518,23 +1522,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="mWMSContactPhone"/>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QTextEdit" name="mWMSAbstract"/>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="mWMSKeywordListLabel">
|
||||
<property name="text">
|
||||
<string>Keyword list</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="QLineEdit" name="mWMSKeywordList"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Organization</string>
|
||||
@ -1544,48 +1548,62 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="mWMSAccessConstraintsLabel">
|
||||
<property name="text">
|
||||
<string>Access constraints</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="mWMSFeesLabel">
|
||||
<property name="text">
|
||||
<string>Fees</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="mWMSFeesCb">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="10" column="1">
|
||||
<widget class="QComboBox" name="mWMSAccessConstraintsCb">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>Position</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="mWMSContactPositionCb">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="mWMSName">
|
||||
<property name="placeholderText">
|
||||
<string>The short name is a text string used for machine-to-machine communication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Short name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -1752,7 +1752,11 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="mLayerTitleLineEdit"/>
|
||||
<widget class="QLineEdit" name="mLayerTitleLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>The title is a text string for the benefit of humans</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="mLayerAbstractLabel">
|
||||
@ -1827,6 +1831,20 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="mLayerShortNameLabel">
|
||||
<property name="text">
|
||||
<string>Short name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="mLayerShortNameLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>The short name is a text string used for machine-to-machine communication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -1438,7 +1438,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="mLayerTitleLineEdit"/>
|
||||
<widget class="QLineEdit" name="mLayerTitleLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>The title is a text string for the benefit of humans</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="mLayerAbstractLabel">
|
||||
@ -1513,6 +1517,26 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="mLayerShortNameLabel">
|
||||
<property name="text">
|
||||
<string>Short name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="mLayerShortNameLineEdit">
|
||||
<property name="inputMask">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>The short name is a text string used for machine-to-machine communication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -125,6 +125,7 @@ Content-Type: text/xml; charset=utf-8
|
||||
</EX_GeographicBoundingBox>
|
||||
<BoundingBox CRS="EPSG:3857" maxx="913283" minx="913171" maxy="5.60604e+06" miny="5.60599e+06"/>
|
||||
<BoundingBox CRS="EPSG:4326" maxx="44.9016" minx="44.9012" maxy="8.20416" miny="8.20315"/>
|
||||
<TreeName>QGIS Test Project</TreeName>
|
||||
<Layer displayField="name" geometryType="WKBPoint" queryable="1" visible="1">
|
||||
<Name>testlayer èé</Name>
|
||||
<Title>A test vector layer</Title>
|
||||
@ -147,6 +148,7 @@ Content-Type: text/xml; charset=utf-8
|
||||
<OnlineResource xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http:?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test%2Bproject.qgs&&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=testlayer èé&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0"/>
|
||||
</LegendURL>
|
||||
</Style>
|
||||
<TreeName>testlayer èé</TreeName>
|
||||
<Attributes>
|
||||
<Attribute typeName="Integer" precision="0" length="10" editType="TextEdit" type="int" comment="" name="id"/>
|
||||
<Attribute typeName="String" precision="0" length="10" editType="TextEdit" type="QString" comment="" name="name"/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user