Python error: View -> Set Map Linking buggy

Issue #157 resolved
Fabian Thiel created an issue

This error appeared after successfully linking two map views and then trying to reopen the menu (i.e. View -> Set Map Linking, then python error, window wont open).

Tested on Ubuntu 18.04 but also experienced on windows.

2018-09-02T20:27:13     WARNING    Traceback (most recent call last):
              File "/home/thielfab/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/enmapboxgui.py", line 367, in 
              self.ui.actionMapLinking.triggered.connect(lambda : CanvasLinkDialog.showDialog(parent=self.ui, canvases=self.mapCanvases()))
              File "/home/thielfab/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/mapcanvas.py", line 150, in showDialog
              d.addCanvas(canvases)
              File "/home/thielfab/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/mapcanvas.py", line 202, in addCanvas
              for c in canvas: self.addCanvas(c)
              File "/home/thielfab/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/mapcanvas.py", line 208, in addCanvas
              self.setSourceCanvas(src)
              File "/home/thielfab/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/mapcanvas.py", line 311, in setSourceCanvas
              self.updateLinkSelection()
              File "/home/thielfab/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/mapcanvas.py", line 325, in updateLinkSelection
              link = CanvasLink.between(srcCanvas, targetCanvas)
              File "/home/thielfab/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/mapcanvas.py", line 610, in between
              links = list(set(links))
             TypeError: unhashable type: 'CanvasLink'

Comments (5)

  1. Benjamin Jakimow

    @thielfab still an issue in Linux?

    Please try this:

    • Open QGIS, Start EnMAP-Box and open 2 new map windows
    • Open the python shell and call
    • from enmapbox.gui.mapcanvas import MapCanvas, CanvasLink
    • Create the two EnMAP-Box Map Windows to be linked
    • c1,c2,c3 = MapCanvas.instances()
    • hash(CanvasLink(c2,c3, 'CENTER_SCALE')) what is the result?
  2. Log in to comment