JaWeilBaum / pyqtlet2

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

pyqtlet2 v0.4.8 not working at all #6

Closed mcondarelli closed 2 years ago

mcondarelli commented 2 years ago

It seems the new version 0.4.8 is unable to run the standard test script. The unadulterated script taken from README.md dies with:

/workspace/tools/prove/venv/bin/python /workspace/tools/prove/t1.py
Traceback (most recent call last):
  File "/workspace/tools/prove/t1.py", line 31, in <module>
    widget = MapWindow()
  File "/workspace/tools/prove/t1.py", line 19, in __init__
    self.marker = L.marker([12.934056, 77.610029])
  File "/workspace/tools/prove/venv/lib/python3.8/site-packages/pyqtlet2/leaflet/layer/marker/marker.py", line 14, in __init__
    self.opacity = options.get('opacity', 0)
AttributeError: 'NoneType' object has no attribute 'get'

Process finished with exit code 1

FYI: I was trying to produce a minimal example of another (possible) bug: apparently trying to use "polygon with hole" syntax does not work because passing LatLon as [lat, lon] gets translated in [(lat, lon)]. I can go into gory detail, but I think we should understand what went wrong with v0.4.8. ... especially so because it turns out the "other bug" is actually mine. V0.4.7 seems to work ok.

Thanks for your patience Mauro

JaWeilBaum commented 2 years ago

I found the mistake, is was connected to an other minor change inside the marker. The issue was fixed and should work now with version 0.4.9 - I'm also looking into a way of building unit tests #7 to avoid errors like this.

In regards to the other problem with polygon, can you provide more detail? Of do you know where the issue is, so you may just provide code?

mcondarelli commented 2 years ago

Thanks Leon. there is no "other problem" in pyqtlet2. That was a mistake in my code. Trying to debug it I fetched latest version (I prepared a a completely different venv) and thus triggered finding this bug. Nothing else to do, for the time being. Many thanks,

mcondarelli commented 2 years ago

I can confirm v0.4.9 works as expected. I also see an error trace in the standard test:

/workspace/tools/prove/venv/bin/python /workspace/tools/prove/t1.py
js: Uncaught TypeError: Cannot read property 'mapObject' of null

Process finished with exit code 0

Is this considered normal? I see similar "apparently harmless" errors when running my code, should I worry?

JaWeilBaum commented 2 years ago

Yes, as you mentioned this error can be seen as normal and not really avoidable as far as I know.