Skip to content
Permalink
Browse files

Fixes addFeature map tool when snapped layer has ZM support

  • Loading branch information
pblottiere committed Apr 24, 2018
1 parent a0c3844 commit abdaccc2d12335fe5c419ac5caf9d4c61e0ae391
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/gui/qgsmaptoolcapture.cpp
@@ -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

0 comments on commit abdaccc

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