Skip to content

Commit abdaccc

Browse files
committed
Fixes addFeature map tool when snapped layer has ZM support
1 parent a0c3844 commit abdaccc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/gui/qgsmaptoolcapture.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,20 @@ int QgsMapToolCapture::fetchLayerPoint( const QgsPointLocator::Match &match, Qgs
399399
QgsVertexId vId;
400400
if ( !f.geometry().vertexIdFromVertexNr( match.vertexIndex(), vId ) )
401401
return 2;
402+
402403
layerPoint = f.geometry().constGet()->vertexAt( vId );
404+
405+
// ZM support depends on the target layer
406+
if ( layerPoint.is3D() && !QgsWkbTypes::hasZ( vlayer->wkbType() ) )
407+
{
408+
layerPoint.dropZValue();
409+
}
410+
411+
if ( layerPoint.isMeasure() && !QgsWkbTypes::hasM( vlayer->wkbType() ) )
412+
{
413+
layerPoint.dropMValue();
414+
}
415+
403416
return 0;
404417
}
405418
else

0 commit comments

Comments
 (0)