Skip to content
Permalink
Browse files
SLD support: export local svg paths to URI (fix #6792)
  • Loading branch information
brushtyler committed Dec 2, 2012
1 parent dffae79 commit b45e2154578605bc8c7762c281308d1b6f8d2962
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/core/symbology-ng/qgssymbollayerv2utils.cpp
@@ -2176,9 +2176,18 @@ bool QgsSymbolLayerV2Utils::functionFromSldElement( QDomElement &element, QStrin
void QgsSymbolLayerV2Utils::createOnlineResourceElement( QDomDocument &doc, QDomElement &element,
QString path, QString format )
{
QString relpath = symbolPathToName( path );

// convert image path to url
QUrl url( relpath );
if ( !url.isValid() || url.scheme().isEmpty() )
{
url.setUrl( QUrl::fromLocalFile( relpath ).toString() );
}

QDomElement onlineResourceElem = doc.createElement( "se:OnlineResource" );
onlineResourceElem.setAttribute( "xlink:type", "simple" );
onlineResourceElem.setAttribute( "xlink:href", path );
onlineResourceElem.setAttribute( "xlink:href", url.toString() );
element.appendChild( onlineResourceElem );

QDomElement formatElem = doc.createElement( "se:Format" );

0 comments on commit b45e215

Please sign in to comment.