Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Smaller treshold for GetFeatureInfo for polygons
  • Loading branch information
mhugent committed May 25, 2012
1 parent 45474ac commit afcd5b6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/mapserver/qgswmsserver.cpp
Expand Up @@ -1262,7 +1262,16 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
//info point could be 0 in case there is only an attribute filter
if ( infoPoint )
{
double searchRadius = ( layerRect.xMaximum() - layerRect.xMinimum() ) / 100;
double searchRadius = 0;
if ( layer->geometryType() == QGis::Polygon )
{
searchRadius = layerRect.width() / 400;
}
else
{
searchRadius = layerRect.width() / 200;
}

searchRect.set( infoPoint->x() - searchRadius, infoPoint->y() - searchRadius,
infoPoint->x() + searchRadius, infoPoint->y() + searchRadius );
}
Expand Down

0 comments on commit afcd5b6

Please sign in to comment.