void QgsConfigParser::appendCRSElementsToLayer( QDomElement& layerElement, QDomDocument& doc, const QStringList &crsList ) const { if ( layerElement.isNull() ) { return; } //insert the CRS elements after the title element to be in accordance with the WMS 1.3 specification QDomElement titleElement = layerElement.firstChildElement( "Title" ); //In case the number of advertised CRS is constrained QSet<QString> crsSet = supportedOutputCrsSet(); QStringList::const_iterator crsIt = crsList.constBegin(); for ( ; crsIt != crsList.constEnd(); ++crsIt ) { if ( !crsSet.isEmpty() && !crsSet.contains( *crsIt ) ) //consider epsg output constraint { continue; } QDomElement crsElement = doc.createElement( "CRS" ); QDomText crsText = doc.createTextNode( *crsIt ); crsElement.appendChild( crsText ); layerElement.insertAfter( crsElement, titleElement ); } }
void QgsConfigParser::appendCRSElementsToLayer( QDomElement& layerElement, QDomDocument& doc, const QList<int>& crsList ) const { if ( layerElement.isNull() ) { return; } //In case the number of advertised CRS is constrained QSet<int> epsgSet = supportedOutputCrsSet(); QList<int>::const_iterator crsIt = crsList.constBegin(); for ( ; crsIt != crsList.constEnd(); ++crsIt ) { if ( !epsgSet.isEmpty() && !epsgSet.contains( *crsIt ) ) //consider epsg output constraint { continue; } QDomElement crsElement = doc.createElement( "CRS" ); QDomText epsgText = doc.createTextNode( "EPSG:" + QString::number( *crsIt ) ); crsElement.appendChild( epsgText ); layerElement.appendChild( crsElement ); } }