Skip to content
Permalink
Browse files
WMS identify format preference order: Html,Feature,Text
  • Loading branch information
blazek committed Feb 17, 2013
1 parent db95b46 commit 4aaed2a5ccbd258c67226884f77290c8a2d34204
Showing with 15 additions and 15 deletions.
  1. +6 −7 src/app/qgsidentifyresultsdialog.cpp
  2. +9 −8 src/core/raster/qgsrasterlayer.cpp
@@ -440,15 +440,14 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,

QComboBox *formatCombo = new QComboBox();

// Add all supported formats, best first. Note that all providers should support
// IdentifyFormatHtml and IdentifyFormatText because other formats may be
// converted to them
// Add all supported formats, best first. HTML is considered the best because
// it usually holds most informations.
int capabilities = layer->dataProvider()->capabilities();
QList<QgsRasterDataProvider::IdentifyFormat> formats;
formats << QgsRasterDataProvider::IdentifyFormatFeature
<< QgsRasterDataProvider::IdentifyFormatValue
<< QgsRasterDataProvider::IdentifyFormatHtml
<< QgsRasterDataProvider::IdentifyFormatText;
formats << QgsRasterDataProvider::IdentifyFormatHtml
<< QgsRasterDataProvider::IdentifyFormatFeature
<< QgsRasterDataProvider::IdentifyFormatText
<< QgsRasterDataProvider::IdentifyFormatValue;
foreach ( QgsRasterDataProvider::IdentifyFormat f, formats )
{
if ( !( QgsRasterDataProvider::identifyFormatToCapability( f ) & capabilities ) ) continue;
@@ -1709,22 +1709,23 @@ void QgsRasterLayer::setDataProvider( QString const & provider )
// Set default identify format - use the richest format available
int capabilities = mDataProvider->capabilities();
QgsRasterDataProvider::IdentifyFormat identifyFormat = QgsRasterDataProvider::IdentifyFormatUndefined;
if ( capabilities & QgsRasterInterface::IdentifyFeature )
if ( capabilities & QgsRasterInterface::IdentifyHtml )
{
identifyFormat = QgsRasterDataProvider::IdentifyFormatFeature;
}
else if ( capabilities & QgsRasterInterface::IdentifyValue )
{
identifyFormat = QgsRasterDataProvider::IdentifyFormatValue;
// HTML is usually richest
identifyFormat = QgsRasterDataProvider::IdentifyFormatHtml;
}
else if ( capabilities & QgsRasterInterface::IdentifyHtml )
else if ( capabilities & QgsRasterInterface::IdentifyFeature )
{
identifyFormat = QgsRasterDataProvider::IdentifyFormatHtml;
identifyFormat = QgsRasterDataProvider::IdentifyFormatFeature;
}
else if ( capabilities & QgsRasterInterface::IdentifyText )
{
identifyFormat = QgsRasterDataProvider::IdentifyFormatText;
}
else if ( capabilities & QgsRasterInterface::IdentifyValue )
{
identifyFormat = QgsRasterDataProvider::IdentifyFormatValue;
}
setCustomProperty( "identify/format", QgsRasterDataProvider::identifyFormatName( identifyFormat ) );

// Store timestamp

0 comments on commit 4aaed2a

Please sign in to comment.