Is it possible to remove a layer from the layers panel and the map canvas without removing it from memory. e.g if i have a vector layer named vlayer, and add it to the map with QgsMapLayerRegistry.instance().addMapLayer(vlayer), and then later remove it from the map, but still want to operate on vlayer. I have tryed QgsMapLayerRegistry.instance().removeMapLayer(vlayer.id()), but then it seems that the layer is removed from vlayer as well
Asked
Active
Viewed 214 times
2
-
1I asked a somewhat related question where it is possible to make the selected layer invisible (i.e. it is removed from canvas but can still be accessed). – Joseph Nov 09 '17 at 14:00
-
1@Joseph Thank you, that was usefull. By combining it with iface.legendInterface().setLayerVisible(vlayer, False) I was able to achive what i wanted – Kasper Skjeggestad Nov 09 '17 at 15:15