pyqtlet2 icon indicating copy to clipboard operation
pyqtlet2 copied to clipboard

Two map widgets cannot work at the same time

Open xukegithub opened this issue 2 years ago • 0 comments

hello! I use the following code to create the map ''' self.map = L.map(self.mapWidget) self.map.setView([50.1364092, 8.5991296], zoom) L.tileLayer("https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png").addTo( self.map) ''' But I wanted to create two maps, so I called the above code twice. But the map created by the second is gray and shows nothing. Then I read ”evented.py“ this file。 I found that there was a problem with this " if Evented.mapWidget: return" because Evented.mapWidget is not None,so it return.

Then before "self.map = L.map(self.mapWidget)", add this line "pyqtlet2.leaflet.core.Evented.mapWidget = None" Now both maps show ok. But the first created map can't be right-clicked to add markers

xukegithub avatar Sep 30 '22 14:09 xukegithub