- Release plans recap for the road to QGIS 1.0
- New version of eVis
- Contour Lines in Qgis
- QGIS and Google Summer of Code
- Quantum GIS Graduates OSGeo Incubation
- Paolo Cavallini Named to QGIS Project Steering Committee
- Nominations for QGIS PSC Open
- Capturing map coordinates in a stand alone app...
- Tutorial 7 - Creating spatial datasets with the QGIS API
- Html Image Plugin 0.2
Re: Disaplying a vector layer
Submitted by Tim Sutton on Tue, 2007-12-04 10:33.
Hi
Indeed the API has changed a little and I probably need to go through and update all my tutorials. For now I can point you to a working example in my openModeller Desktop code:
If you look at around line 1479 in that file you will see I start by creating a vector layer, set some symbolisation properties for it and then at around lines
1565 QgsMapLayerRegistry::instance()->addMapLayer(mypVectorLayer, TRUE); 1566 myList.append(QgsMapCanvasLayer(mypVectorLayer, TRUE)); //bool visibility
The layer is added to the registry and also appended to a QList
Finally this line adds my layers list to the canvas:
1673 mpMapCanvas->setLayerSet(myList);
Hope that helps!
Regards
Tim
»

Recent comments
3 days 13 hours ago
1 week 23 hours ago
1 week 1 day ago
5 weeks 21 hours ago
5 weeks 2 days ago
5 weeks 5 days ago
6 weeks 16 hours ago
8 weeks 3 days ago
10 weeks 1 day ago
11 weeks 1 day ago