Skip to content

Commit 5cfed12

Browse files
committedJul 26, 2017
Ading all other labelling options supported by SLD. fixes #8925
1 parent 59d8b18 commit 5cfed12

File tree

11 files changed

+2295
-74
lines changed

11 files changed

+2295
-74
lines changed
 

‎python/core/qgsvectorlayerlabeling.sip

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ Try to create instance of an implementation based on the XML data
7676
:rtype: QgsAbstractVectorLayerLabeling
7777
%End
7878

79+
virtual void toSld( QDomNode &parent, const QgsStringMap &props ) const;
80+
%Docstring
81+
Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings
82+
%End
83+
7984
private:
8085
QgsAbstractVectorLayerLabeling( const QgsAbstractVectorLayerLabeling &rhs );
8186
};
@@ -105,6 +110,7 @@ Constructs simple labeling configuration with given initial settings
105110
virtual QgsPalLayerSettings settings( const QString &providerId = QString() ) const;
106111
virtual bool requiresAdvancedEffects() const;
107112

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

109115
static QgsVectorLayerSimpleLabeling *create( const QDomElement &element, const QgsReadWriteContext &context );
110116
%Docstring

‎python/core/symbology-ng/qgssymbollayerutils.sip

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,14 @@ Create ogr feature style string for pen
481481
:rtype: bool
482482
%End
483483

484+
static void createAnchorPointElement( QDomDocument &doc, QDomElement &element, QPointF anchor );
485+
%Docstring
486+
Creates a SE 1.1 anchor point element as a child of the specified element
487+
\param doc The document
488+
\param element The parent element
489+
\param anchor An anchor specification, with values between 0 and 1
490+
%End
491+
484492
static void createOnlineResourceElement( QDomDocument &doc, QDomElement &element, const QString &path, const QString &format );
485493
static bool onlineResourceFromSldElement( QDomElement &element, QString &path, QString &format );
486494
%Docstring

‎src/core/qgsvectorlayer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,8 @@ bool QgsVectorLayer::writeSld( QDomNode &node, QDomDocument &doc, QString &error
22112211
QgsSymbolLayerUtils::mergeScaleDependencies( maximumScale(), minimumScale(), localProps );
22122212
}
22132213

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

22312232
mRenderer->toSld( doc, featureTypeStyleElem, localProps );
2232-
if ( mLabeling != nullptr )
2233+
if ( labelsEnabled() )
22332234
{
22342235
mLabeling->toSld( featureTypeStyleElem, localProps );
22352236
}

0 commit comments

Comments
 (0)
Please sign in to comment.