Skip to content

Commit

Permalink
[BUGFIX][QGIS Server] WFS Service Capability OnlineResource
Browse files Browse the repository at this point in the history
WFS Service Capability OnlineResource is not the same as in WMS.
  • Loading branch information
rldhont committed Feb 9, 2016
1 parent 746af79 commit cdd4aed
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/server/qgsserverprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,23 @@ void QgsServerProjectParser::serviceCapabilities( QDomElement& parentElement, QD

//OnlineResource element is mandatory according to the WMS specification
QDomElement wmsOnlineResourceElem = propertiesElement.firstChildElement( "WMSOnlineResource" );
QDomElement onlineResourceElem = doc.createElement( "OnlineResource" );
onlineResourceElem.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" );
onlineResourceElem.setAttribute( "xlink:type", "simple" );
if ( !wmsOnlineResourceElem.isNull() )
{
onlineResourceElem.setAttribute( "xlink:href", wmsOnlineResourceElem.text() );
QDomElement onlineResourceElem = doc.createElement( "OnlineResource" );
if ( service.compare( "WFS", Qt::CaseInsensitive ) == 0 )
{
QDomText onlineResourceText = doc.createTextNode( wmsOnlineResourceElem.text() );
onlineResourceElem.appendChild( onlineResourceText );
}
else
{
onlineResourceElem.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" );
onlineResourceElem.setAttribute( "xlink:type", "simple" );
onlineResourceElem.setAttribute( "xlink:href", wmsOnlineResourceElem.text() );
}
serviceElem.appendChild( onlineResourceElem );
}

serviceElem.appendChild( onlineResourceElem );

if ( service.compare( "WMS", Qt::CaseInsensitive ) == 0 ) //no contact information in WFS 1.0 and WCS 1.0
{
//Contact information
Expand Down

0 comments on commit cdd4aed

Please sign in to comment.