Dear Magnus.

you can iterate through the layers:

for lay in QgsMapLayerRegistry.instance().mapLayers().values():
    if lay.name() == your_layer_name:
        your layer is loaded


Regards,
Zoltan

On Sun, 4 Jun 2017, Magnus Homann wrote:

I'm writing a plugin that adds feature to a SHP-layer, specified as a filename. If the layer already is loaded in Qgis, I want to check for and use the loaded
layer instead of creating a new from the same SHP-file.

Is this even possible?
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to