JaWeilBaum / pyqtlet2

pyqtlet2 extends pyqtlet which initially brought Leaflet maps to PyQt5 and PySide6.
Other
37 stars 19 forks source link

Fix popup and tooltip binding #50

Closed Baljak closed 1 year ago

Baljak commented 1 year ago

Starting with 0.9.0, adding a popup or tooltip to a layer before it is added to a map no longer works. Thus, the README.md example no longer works too.

This PR fixes this issue by storing the popup, tooltip and their respective options in dedicated attributes and by adding a method to execute the Javascript code once the layer has been added to a map.

JaWeilBaum commented 1 year ago

Hi @Baljak, thanks for reaching out. Really good catch. I adapted all my code to use .addTo(self.map) after reating a marker but I didnt put this into the README.md. I guess there could be more spots where this could lead to an issue.

Thanks for the contribution!