Skip to content

Commit

Permalink
from PyQGIS2 to PyQGIS3 - cleaning map canvas
Browse files Browse the repository at this point in the history
#191
replacing QgsMapLayerRegistry with QgsProject
  • Loading branch information
SimonSAMPERE committed Jun 18, 2019
1 parent be4ad7c commit 26e0d16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/metadata_display.py
Expand Up @@ -75,10 +75,10 @@ def show_complete_md(self, md):
isogeo_tr = IsogeoTranslator(qsettings.value('locale/userLocale')[0:2])

# clean map canvas
vec_lyr = [i for i in self.complete_md.wid_bbox.layers() if i.type() == 0]
QgsMapLayerRegistry.instance().removeMapLayers(vec_lyr)
vec_lyr = [i.id() for i in self.complete_md.wid_bbox.layers() if i.type() == 0]
QgsProject.instance().removeMapLayers(vec_lyr)
self.complete_md.wid_bbox.refresh()

# -- GENERAL ---------------------------------------------------------
title = md.get("title", "NR")
self.complete_md.lbl_title.setText(md.get("title", "NR"))
Expand Down

0 comments on commit 26e0d16

Please sign in to comment.