Skip to content
Permalink
Browse files

Ading all other labelling options supported by SLD. fixes #8925

  • Loading branch information
aaime committed Jun 16, 2017
1 parent 59d8b18 commit 5cfed129b5a006e63af8757ad29e777e3151fd9e
@@ -76,6 +76,11 @@ Try to create instance of an implementation based on the XML data
:rtype: QgsAbstractVectorLayerLabeling
%End

virtual void toSld( QDomNode &parent, const QgsStringMap &props ) const;
%Docstring
Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings
%End

private:
QgsAbstractVectorLayerLabeling( const QgsAbstractVectorLayerLabeling &rhs );
};
@@ -105,6 +110,7 @@ Constructs simple labeling configuration with given initial settings
virtual QgsPalLayerSettings settings( const QString &providerId = QString() ) const;
virtual bool requiresAdvancedEffects() const;

virtual void toSld( QDomNode &parent, const QgsStringMap &props ) const;

static QgsVectorLayerSimpleLabeling *create( const QDomElement &element, const QgsReadWriteContext &context );
%Docstring
@@ -481,6 +481,14 @@ Create ogr feature style string for pen
:rtype: bool
%End

static void createAnchorPointElement( QDomDocument &doc, QDomElement &element, QPointF anchor );
%Docstring
Creates a SE 1.1 anchor point element as a child of the specified element
\param doc The document
\param element The parent element
\param anchor An anchor specification, with values between 0 and 1
%End

static void createOnlineResourceElement( QDomDocument &doc, QDomElement &element, const QString &path, const QString &format );
static bool onlineResourceFromSldElement( QDomElement &element, QString &path, QString &format );
%Docstring
@@ -2211,7 +2211,8 @@ bool QgsVectorLayer::writeSld( QDomNode &node, QDomDocument &doc, QString &error
QgsSymbolLayerUtils::mergeScaleDependencies( maximumScale(), minimumScale(), localProps );
}

if ( isSpatial() ) {
if ( isSpatial() )
{
// store the Name element
QDomElement nameNode = doc.createElement( "se:Name" );
nameNode.appendChild( doc.createTextNode( name() ) );
@@ -2229,7 +2230,7 @@ bool QgsVectorLayer::writeSld( QDomNode &node, QDomDocument &doc, QString &error
userStyleElem.appendChild( featureTypeStyleElem );

mRenderer->toSld( doc, featureTypeStyleElem, localProps );
if ( mLabeling != nullptr )
if ( labelsEnabled() )
{
mLabeling->toSld( featureTypeStyleElem, localProps );
}

0 comments on commit 5cfed12

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