Re: [QGIS-Developer] Python QGIS 3 and the list of all visible layer in the map

2018-09-18 Thread enrico chiaradia
Thanks Tom! for those who need, this is a working snippet for processing alghorithm:         layermap = iface.mapCanvas().layers()         layers = []         # add only visible layers         layTreeRoot = QgsProject.instance().layerTreeRoot()         for layer in layermap:             if

Re: [QGIS-Developer] Python QGIS 3 and the list of all visible layer in the map

2018-09-18 Thread Tom Chadwin
Hi Enrico You can use the Layer Tree API. Something like: project.layerTreeRoot().findLayer(layer.id()).isVisible() Tom - Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon -- Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html

[QGIS-Developer] Python QGIS 3 and the list of all visible layer in the map

2018-09-18 Thread enrico chiaradia
Hi list, I'm working on my plugin (IOGeopaparazzi) in order to make it available also for QGIS 3. I have troubles converting this function "iface.legendInterface().isLayerVisible(layer)" that checks the layer visibility in a loop of all loaded layers in the map. What I want to do is to