Skip to content
Permalink
Browse files

Merge pull request #1541 from marcel-dancak/master

Mapserver: enhancements of searching with GetFeatureInfo request
  • Loading branch information
mhugent committed Aug 18, 2014
2 parents 621edef + ff172b2 commit 8d822c42aec38b67c8923572c1eac502a9b81987
Showing with 12 additions and 2 deletions.
  1. +7 −2 src/mapserver/qgswmsserver.cpp
  2. +5 −0 src/providers/wms/qgswmsprovider.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;
@@ -404,6 +404,11 @@ bool QgsWmsProvider::setImageCrs( QString const & crs )
{
resolutions << key;
}
if ( !mTileMatrixSet->tileMatrices.empty() )
{
setProperty( "tileWidth", mTileMatrixSet->tileMatrices.values().first().tileWidth );
setProperty( "tileHeight", mTileMatrixSet->tileMatrices.values().first().tileHeight );
}
}
else
{

0 comments on commit 8d822c4

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