Skip to content

Commit afcd5b6

Browse files
committed
Smaller treshold for GetFeatureInfo for polygons
1 parent 45474ac commit afcd5b6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/mapserver/qgswmsserver.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,16 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
12621262
//info point could be 0 in case there is only an attribute filter
12631263
if ( infoPoint )
12641264
{
1265-
double searchRadius = ( layerRect.xMaximum() - layerRect.xMinimum() ) / 100;
1265+
double searchRadius = 0;
1266+
if ( layer->geometryType() == QGis::Polygon )
1267+
{
1268+
searchRadius = layerRect.width() / 400;
1269+
}
1270+
else
1271+
{
1272+
searchRadius = layerRect.width() / 200;
1273+
}
1274+
12661275
searchRect.set( infoPoint->x() - searchRadius, infoPoint->y() - searchRadius,
12671276
infoPoint->x() + searchRadius, infoPoint->y() + searchRadius );
12681277
}

0 commit comments

Comments
 (0)