Skip to content

Commit

Permalink
Fix crash and missing closest vertex in WMS identify
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Jun 15, 2020
1 parent b586a6f commit e0fb3fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/gui/qgsmaptoolidentify.cpp
Expand Up @@ -447,6 +447,13 @@ bool QgsMapToolIdentify::identifyVectorLayer( QList<QgsMapToolIdentify::Identify

void QgsMapToolIdentify::closestVertexAttributes( const QgsAbstractGeometry &geometry, QgsVertexId vId, QgsMapLayer *layer, QMap< QString, QString > &derivedAttributes )
{
if ( ! vId.isValid( ) )
{
// We should not get here ...
QgsDebugMsg( "Invalid vertex id!" );
return;
}

QString str = QLocale().toString( vId.vertex + 1 );
derivedAttributes.insert( tr( "Closest vertex number" ), str );

Expand Down Expand Up @@ -542,6 +549,8 @@ QMap< QString, QString > QgsMapToolIdentify::featureDerivedAttributes( const Qgs
closestPoint = QgsGeometryUtils::closestVertex( *feature.geometry().constGet(), QgsPoint( layerPoint ), vId );
}



if ( QgsWkbTypes::isMultiType( wkbType ) )
{
QString str = QLocale().toString( static_cast<const QgsGeometryCollection *>( feature.geometry().constGet() )->numGeometries() );
Expand Down Expand Up @@ -851,7 +860,7 @@ bool QgsMapToolIdentify::identifyRasterLayer( QList<IdentifyResult> *results, Qg
}

QMap< QString, QString > derAttributes = derivedAttributes;
derAttributes.unite( featureDerivedAttributes( feature, layer ) );
derAttributes.unite( featureDerivedAttributes( feature, layer, toLayerCoordinates( layer, point ) ) );

IdentifyResult identifyResult( qobject_cast<QgsMapLayer *>( layer ), labels.join( QStringLiteral( " / " ) ), featureStore.fields(), feature, derAttributes );

Expand Down

0 comments on commit e0fb3fb

Please sign in to comment.