Skip to content

Commit

Permalink
Mapserver: enhancements of searching with GetFeatureInfo request
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Dancak committed Aug 15, 2014
1 parent 76c1bb5 commit 8888c5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mapserver/qgswmsserver.cpp
Expand Up @@ -1207,7 +1207,8 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
}

//skip layer if not visible at current map scale
if ( currentLayer->hasScaleBasedVisibility() && ( currentLayer->minimumScale() > scaleDenominator || currentLayer->maximumScale() < scaleDenominator ) )
bool useScaleConstraint = ( scaleDenominator > 0 && currentLayer->hasScaleBasedVisibility() );
if ( useScaleConstraint && ( currentLayer->minimumScale() > scaleDenominator || currentLayer->maximumScale() < scaleDenominator ) )
{
continue;
}
Expand Down Expand Up @@ -1706,6 +1707,10 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
searchRect.set( infoPoint->x() - searchRadius, infoPoint->y() - searchRadius,
infoPoint->x() + searchRadius, infoPoint->y() + searchRadius );
}
else
{
searchRect = layerRect;
}

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

Expand Down Expand Up @@ -2237,7 +2242,7 @@ QMap<QString, QString> QgsWMSServer::applyRequestedLayerFilters( const QStringLi
continue;
}

QgsRectangle layerExtent = mapLayer->extent();
QgsRectangle layerExtent = mMapRenderer->layerToMapCoordinates(mapLayer, mapLayer->extent());
if ( filterExtent.isEmpty() )
{
filterExtent = layerExtent;
Expand Down

0 comments on commit 8888c5f

Please sign in to comment.