Skip to content

Commit 869224d

Browse files
committedSep 28, 2011
Add feature bounding box to GetFeatureInfo response if invoked with filter and without x/y coordinates
1 parent cc59d93 commit 869224d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/mapserver/qgswmsserver.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,15 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
12661266
{
12671267
featureBBox->combineExtentWith( &box );
12681268
}
1269+
1270+
//append feature bounding box to feature info xml
1271+
QDomElement bBoxElem = infoDocument.createElement( "BoundingBox" );
1272+
bBoxElem.setAttribute( "CRS", mapRender->destinationCrs().authid() );
1273+
bBoxElem.setAttribute( "minx", box.xMinimum() );
1274+
bBoxElem.setAttribute( "maxx", box.xMaximum() );
1275+
bBoxElem.setAttribute( "miny", box.yMinimum() );
1276+
bBoxElem.setAttribute( "maxy", box.yMaximum() );
1277+
featureElement.appendChild( bBoxElem );
12691278
}
12701279
}
12711280

0 commit comments

Comments
 (0)
Please sign in to comment.