Skip to content
Permalink
Browse files

Mapserver: enhancements of searching with GetFeatureInfo request

  • Loading branch information...
Marcel Dancak
Marcel Dancak committed Aug 15, 2014
1 parent 76c1bb5 commit 8888c5f0c0e0ffdf23453a20addf6abaf125845d
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/mapserver/qgswmsserver.cpp
@@ -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;
}
@@ -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

@@ -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;

0 comments on commit 8888c5f

Please sign in to comment.
You can’t perform that action at this time.