Skip to content

Commit 8888c5f

Browse files
author
Marcel Dancak
committed
Mapserver: enhancements of searching with GetFeatureInfo request
1 parent 76c1bb5 commit 8888c5f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/mapserver/qgswmsserver.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,8 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
12071207
}
12081208

12091209
//skip layer if not visible at current map scale
1210-
if ( currentLayer->hasScaleBasedVisibility() && ( currentLayer->minimumScale() > scaleDenominator || currentLayer->maximumScale() < scaleDenominator ) )
1210+
bool useScaleConstraint = ( scaleDenominator > 0 && currentLayer->hasScaleBasedVisibility() );
1211+
if ( useScaleConstraint && ( currentLayer->minimumScale() > scaleDenominator || currentLayer->maximumScale() < scaleDenominator ) )
12111212
{
12121213
continue;
12131214
}
@@ -1706,6 +1707,10 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
17061707
searchRect.set( infoPoint->x() - searchRadius, infoPoint->y() - searchRadius,
17071708
infoPoint->x() + searchRadius, infoPoint->y() + searchRadius );
17081709
}
1710+
else
1711+
{
1712+
searchRect = layerRect;
1713+
}
17091714

17101715
//do a select with searchRect and go through all the features
17111716

@@ -2237,7 +2242,7 @@ QMap<QString, QString> QgsWMSServer::applyRequestedLayerFilters( const QStringLi
22372242
continue;
22382243
}
22392244

2240-
QgsRectangle layerExtent = mapLayer->extent();
2245+
QgsRectangle layerExtent = mMapRenderer->layerToMapCoordinates(mapLayer, mapLayer->extent());
22412246
if ( filterExtent.isEmpty() )
22422247
{
22432248
filterExtent = layerExtent;

0 commit comments

Comments
 (0)