mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
restore export functionality in RoadGraph (fix #8695)
This commit is contained in:
parent
85b8e1075b
commit
d616bf4558
@ -83,7 +83,7 @@ QgsVectorLayer* RgExportDlg::mapLayer() const
|
||||
return NULL;
|
||||
|
||||
QList<QgsField> attrList;
|
||||
attrList.append( QgsField( "one", QVariant::Int ) );
|
||||
attrList.append( QgsField( "id", QVariant::Int ) );
|
||||
prov->addAttributes( attrList );
|
||||
QList<QgsMapLayer *> myList;
|
||||
myList << myLayer;
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <qgsfeature.h>
|
||||
#include <qgsapplication.h>
|
||||
#include <qgsvectorlayer.h>
|
||||
#include <qgsvectordataprovider.h>
|
||||
#include <qgsmessagebar.h>
|
||||
|
||||
#include <qgsgraphdirector.h>
|
||||
@ -400,10 +401,11 @@ void RgShortestPathWidget::exportPath()
|
||||
}
|
||||
p.push_front( ct.transform( p1 ) );
|
||||
|
||||
vl->startEditing();
|
||||
QgsFeature f;
|
||||
QgsFeatureList features;
|
||||
f.setGeometry( QgsGeometry::fromPolyline( p ) );
|
||||
vl->addFeature( f );
|
||||
features << f;
|
||||
vl->dataProvider()->addFeatures( features );
|
||||
vl->updateExtents();
|
||||
|
||||
mPlugin->iface()->mapCanvas()->update();
|
||||
|
Loading…
x
Reference in New Issue
Block a user