Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try: #QGis 3.x
- QgsProject.instance().addMapLayer(vlayer, group is None)
- except: #QGis 2.x
- QgsMapLayerRegistry.instance().addMapLayer(vlayer, group is None)
- try: #QGis 3.x
- QgsProject.instance().removeMapLayer(layer.id())
- except: #QGis 2.x
- QgsMapLayerRegistry.instance().removeMapLayers([layer.id()])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement