Skip to content

Commit

Permalink
Fixes addFeature map tool when snapped layer has ZM support
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Apr 24, 2018
1 parent a0c3844 commit abdaccc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -399,7 +399,20 @@ int QgsMapToolCapture::fetchLayerPoint( const QgsPointLocator::Match &match, Qgs
QgsVertexId vId;
if ( !f.geometry().vertexIdFromVertexNr( match.vertexIndex(), vId ) )
return 2;

layerPoint = f.geometry().constGet()->vertexAt( vId );

// ZM support depends on the target layer
if ( layerPoint.is3D() && !QgsWkbTypes::hasZ( vlayer->wkbType() ) )
{
layerPoint.dropZValue();
}

if ( layerPoint.isMeasure() && !QgsWkbTypes::hasM( vlayer->wkbType() ) )
{
layerPoint.dropMValue();
}

return 0;
}
else
Expand Down

0 comments on commit abdaccc

Please sign in to comment.