mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix feature info in mapserver
git-svn-id: http://svn.osgeo.org/qgis/trunk@14171 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
d4c7500844
commit
3facbab9a8
@ -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,7 +229,6 @@ 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" )
|
||||
{
|
||||
@ -237,6 +236,7 @@ void QgsGetRequestHandler::sendGetFeatureInfoResponse( const QDomDocument& infoD
|
||||
}
|
||||
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 );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user