Skip to content

Commit

Permalink
Add feature bounding box to GetFeatureInfo response if invoked with f…
Browse files Browse the repository at this point in the history
…ilter and without x/y coordinates
  • Loading branch information
mhugent committed Sep 28, 2011
1 parent cc59d93 commit 869224d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mapserver/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,15 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
{
featureBBox->combineExtentWith( &box );
}

//append feature bounding box to feature info xml
QDomElement bBoxElem = infoDocument.createElement( "BoundingBox" );
bBoxElem.setAttribute( "CRS", mapRender->destinationCrs().authid() );
bBoxElem.setAttribute( "minx", box.xMinimum() );
bBoxElem.setAttribute( "maxx", box.xMaximum() );
bBoxElem.setAttribute( "miny", box.yMinimum() );
bBoxElem.setAttribute( "maxy", box.yMaximum() );
featureElement.appendChild( bBoxElem );
}
}

Expand Down

0 comments on commit 869224d

Please sign in to comment.