Skip to content
Permalink
Browse files
Fix feature info in mapserver
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14171 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 31, 2010
1 parent 748fefb commit a8b107b0ce0c910e1af1ce2883b39a3710e7b4e3
Showing with 8 additions and 4 deletions.
  1. +7 −3 src/mapserver/qgsgetrequesthandler.cpp
  2. +1 −1 src/mapserver/qgswmsserver.cpp
@@ -204,7 +204,7 @@ void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoD
}

//feature loop (for vector layers)
QDomNodeList featureNodeList = infoDoc.elementsByTagName( "Feature" );
QDomNodeList featureNodeList = layerElem.elementsByTagName( "Feature" );
QDomElement currentFeatureElement;

if ( featureNodeList.size() < 1 ) //raster layer?
@@ -229,14 +229,14 @@ void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoD
{
for ( int j = 0; j < featureNodeList.size(); ++j )
{
featureInfoString.append( "<TABLE border=1 width=100%>\n" );
QDomElement featureElement = featureNodeList.at( j ).toElement();
if ( infoFormat == "text/plain" )
{
featureInfoString.append( "Feature " + featureElement.attribute( "id" ) + "\n" );
}
else if ( infoFormat == "text/html" )
{
featureInfoString.append( "<TABLE border=1 width=100%>\n" );
featureInfoString.append( "<TR><TH>Feature</TH><TD>" + featureElement.attribute( "id" ) + "</TD></TR>\n" );
}
//attribute loop
@@ -254,7 +254,11 @@ void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoD
featureInfoString.append( "<TR><TH>" + attributeElement.attribute( "name" ) + "</TH><TD>" + attributeElement.attribute( "value" ) + "</TD></TR>\n" );
}
}
featureInfoString.append( "</TABLE>\n</BR>\n" );

if ( infoFormat == "text/html" )
{
featureInfoString.append( "</TABLE>\n</BR>\n" );
}
}
}
if ( infoFormat == "text/plain" )
@@ -899,7 +899,7 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer, const QgsPo
//we need a selection rect (0.01 of map width)
QgsRectangle mapRect = mapRender->extent();
QgsRectangle layerRect = mapRender->mapToLayerCoordinates( layer, mapRect );
double searchRadius = ( layerRect.xMaximum() - layerRect.xMinimum() ) / 100;
double searchRadius = ( layerRect.xMaximum() - layerRect.xMinimum() ) / 200;
QgsRectangle searchRect( infoPoint.x() - searchRadius, infoPoint.y() - searchRadius, \
infoPoint.x() + searchRadius, infoPoint.y() + searchRadius );

0 comments on commit a8b107b

Please sign in to comment.