API issue with linking to MapDocks

Issue #593 resolved
Andreas Janz created an issue
from enmapbox import EnMAPBox
from enmapbox.gui.mapcanvas import MapDock, LINK_ON_CENTER
from enmapbox.testing import start_app

qgsApp = start_app()
enmapBox = EnMAPBox(None)

map1: MapDock = enmapBox.createDock('MAP')
map2: MapDock = enmapBox.createDock('MAP')
map1.linkWithMapDock(mapDock=map2, linkType=LINK_ON_CENTER)

qgsApp.exec_()

Code above gives me an error. Is that a bug or did I use the linking methode in a wrong way?

C:\miniconda\envs\qgis\lib\site-packages\osgeo\gdal.py:111: DeprecationWarning: gdal.py was placed in a namespace, it is now available as osgeo.gdal
warn('%s.py was placed in a namespace, it is now available as osgeo.%s' % (module,module),
<frozen importlib._bootstrap>:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
Traceback (most recent call last):
File "C:/source/arcoop/andreas_rabe/debug.py", line 14, in <module>
map1.linkWithMapDock(mapDock=map2, linkType=LINK_ON_CENTER)
File "C:\source\QGISPlugIns\enmap-box\enmapbox\gui\mapcanvas.py", line 1489, in linkWithMapDock
self.linkWithCanvas(mapDock.mCanvas, linkType)
File "C:\source\QGISPlugIns\enmap-box\enmapbox\gui\mapcanvas.py", line 1493, in linkWithCanvas
canvas.createCanvasLink(canvas, linkType)
File "C:\source\QGISPlugIns\enmap-box\enmapbox\gui\mapcanvas.py", line 1332, in createCanvasLink
return self.addCanvasLink(CanvasLink(self, otherCanvas, linkType))
File "C:\source\QGISPlugIns\enmap-box\enmapbox\gui\mapcanvas.py", line 571, in init
assert canvas1 != canvas2
AssertionError

Comments (1)

  1. Log in to comment