Skip to content

Commit 3facbab

Browse files
author
mhugent
committed
Fix feature info in mapserver
git-svn-id: http://svn.osgeo.org/qgis/trunk@14171 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d4c7500 commit 3facbab

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/mapserver/qgsgetrequesthandler.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoD
204204
}
205205

206206
//feature loop (for vector layers)
207-
QDomNodeList featureNodeList = infoDoc.elementsByTagName( "Feature" );
207+
QDomNodeList featureNodeList = layerElem.elementsByTagName( "Feature" );
208208
QDomElement currentFeatureElement;
209209

210210
if ( featureNodeList.size() < 1 ) //raster layer?
@@ -229,14 +229,14 @@ void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoD
229229
{
230230
for ( int j = 0; j < featureNodeList.size(); ++j )
231231
{
232-
featureInfoString.append( "<TABLE border=1 width=100%>\n" );
233232
QDomElement featureElement = featureNodeList.at( j ).toElement();
234233
if ( infoFormat == "text/plain" )
235234
{
236235
featureInfoString.append( "Feature " + featureElement.attribute( "id" ) + "\n" );
237236
}
238237
else if ( infoFormat == "text/html" )
239238
{
239+
featureInfoString.append( "<TABLE border=1 width=100%>\n" );
240240
featureInfoString.append( "<TR><TH>Feature</TH><TD>" + featureElement.attribute( "id" ) + "</TD></TR>\n" );
241241
}
242242
//attribute loop
@@ -254,7 +254,11 @@ void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoD
254254
featureInfoString.append( "<TR><TH>" + attributeElement.attribute( "name" ) + "</TH><TD>" + attributeElement.attribute( "value" ) + "</TD></TR>\n" );
255255
}
256256
}
257-
featureInfoString.append( "</TABLE>\n</BR>\n" );
257+
258+
if ( infoFormat == "text/html" )
259+
{
260+
featureInfoString.append( "</TABLE>\n</BR>\n" );
261+
}
258262
}
259263
}
260264
if ( infoFormat == "text/plain" )

src/mapserver/qgswmsserver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer, const QgsPo
899899
//we need a selection rect (0.01 of map width)
900900
QgsRectangle mapRect = mapRender->extent();
901901
QgsRectangle layerRect = mapRender->mapToLayerCoordinates( layer, mapRect );
902-
double searchRadius = ( layerRect.xMaximum() - layerRect.xMinimum() ) / 100;
902+
double searchRadius = ( layerRect.xMaximum() - layerRect.xMinimum() ) / 200;
903903
QgsRectangle searchRect( infoPoint.x() - searchRadius, infoPoint.y() - searchRadius, \
904904
infoPoint.x() + searchRadius, infoPoint.y() + searchRadius );
905905

0 commit comments

Comments
 (0)