Skip to content
Permalink
Browse files

Insert user defined OWS extent for project into top layer of WMS capa…

…bilities
  • Loading branch information
mhugent committed May 15, 2013
1 parent dbb0730 commit aa0c754f4592b9e6a52162abe997c0831b46eb30
Showing with 13 additions and 4 deletions.
  1. +11 −3 src/mapserver/qgsprojectparser.cpp
  2. +2 −1 src/mapserver/qgsprojectparser.h
@@ -131,7 +131,7 @@ void QgsProjectParser::layersAndStylesCapabilities( QDomElement& parentElement,
addLayers( doc, layerParentElem, legendElem, layerMap, nonIdentifiableLayers, version, fullProjectSettings );

parentElement.appendChild( layerParentElem );
combineExtentAndCrsOfGroupChildren( layerParentElem, doc );
combineExtentAndCrsOfGroupChildren( layerParentElem, doc, true );
}

void QgsProjectParser::featureTypeList( QDomElement& parentElement, QDomDocument& doc ) const
@@ -696,7 +696,7 @@ QString QgsProjectParser::editTypeString( QgsVectorLayer::EditType type )
}
}

void QgsProjectParser::combineExtentAndCrsOfGroupChildren( QDomElement& groupElem, QDomDocument& doc ) const
void QgsProjectParser::combineExtentAndCrsOfGroupChildren( QDomElement& groupElem, QDomDocument& doc, bool considerMapExtent ) const
{
QgsRectangle combinedBBox;
QSet<QString> combinedCRSSet;
@@ -744,6 +744,14 @@ void QgsProjectParser::combineExtentAndCrsOfGroupChildren( QDomElement& groupEle
appendCRSElementsToLayer( groupElem, doc, combinedCRSSet.toList() );

const QgsCoordinateReferenceSystem& groupCRS = projectCRS();
if ( considerMapExtent )
{
QgsRectangle mapRect = mapRectangle();
if ( !mapRect.isEmpty() )
{
combinedBBox = mapRect;
}
}
appendLayerBoundingBoxes( groupElem, doc, combinedBBox, groupCRS );
}

@@ -953,7 +961,7 @@ int QgsProjectParser::layersAndStyles( QStringList& layers, QStringList& styles
}

QDomDocument QgsProjectParser::getStyle( const QString& styleName, const QString& layerName ) const
{
{
QDomDocument myDocument = QDomDocument();

QDomNode header = myDocument.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" );
@@ -186,7 +186,8 @@ class QgsProjectParser: public QgsConfigParser

static void addLayerProjectSettings( QDomElement& layerElem, QDomDocument& doc, QgsMapLayer* currentLayer );

void combineExtentAndCrsOfGroupChildren( QDomElement& groupElement, QDomDocument& doc ) const;
/**@param considerMapExtent Take user-defined map extent instead of data-calculated extent if present in project file*/
void combineExtentAndCrsOfGroupChildren( QDomElement& groupElement, QDomDocument& doc, bool considerMapExtent = false ) const;

/**Returns dom element of composer (identified by composer title) or a null element in case of error*/
QDomElement composerByName( const QString& composerName ) const;

0 comments on commit aa0c754

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