Skip to content
Permalink
Browse files

Fix crash and missing closest vertex in WMS identify

  • Loading branch information
github-actions authored and nyalldawson committed Jun 15, 2020
1 parent b586a6f commit e0fb3fb1371e24b782be7e9a7a915a124ad9b752
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/gui/qgsmaptoolidentify.cpp
@@ -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 );

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

0 comments on commit e0fb3fb

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