Fwd: [Qgis-developer] Adding multiple layer

Germán Carrillo carrillo.german at gmail.com
Tue Mar 3 10:30:40 EST 2009


Hi bonar,

*1.* I did this in Python: I create a layers variable in __init__ method:


     self.layers = []  # Layer list

In addLayer method I insert the loaded layer to the list:

     self.layers.insert(0, QgsMapCanvasLayer(layer))

And finally set the layer list to canvas:

     self.canvas.setLayerSet(self.layers)

Hope this helps.

2009/3/3 bonar <bonar_reddevil at yahoo.com>

>
> Hi guys,
>
> I'm new to QGis and really hope to learn something from you guys. I had a
> questions about Mr.Tim Sutton's Tutorial on QGis. Based on Tutorial 3:
> Labelling map canvas features,
> 1. can you guys guide me about how i can load multiple layer because from
> that tutorial its just contain 1 layer only. I already tried to play around
> with the code but it still load 1 layer only.
> 2. what is layerBasedName do because i try to put a different layer in
> folder data and specify a different layer name on the code but it still can
> display the layer inside the folder.
>
>
> Really aprreciate your help in this matter.
>
> Thanks in advance,
> bonar
> --
> View this message in context:
> http://n2.nabble.com/Adding-multiple-layer-tp2414005p2414005.html
> Sent from the qgis-developer mailing list archive at Nabble.com.
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>

-- 
-----------
  |\__
(:>__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090303/8f3949ba/attachment.html


More information about the Qgis-developer mailing list