Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty map with PySide6 6.3.0 #38

Open
danielhrisca opened this issue Sep 8, 2022 · 22 comments
Open

empty map with PySide6 6.3.0 #38

danielhrisca opened this issue Sep 8, 2022 · 22 comments

Comments

@danielhrisca
Copy link

I'm using pyqtlet2 to display information from automotive measurement files (MDF).

This error (danielhrisca/asammdf#751) was raised and I don't know what could be the cause. Can you spare some time and have a look?

@MatinF
Copy link

MatinF commented Sep 8, 2022

We would be very interested in any inputs on this as well

@MatinF
Copy link

MatinF commented Sep 14, 2022

This also happens with PySide6 6.3.2 - it would be great to hear any thoughts on how to resolve this.

The map seems to be grayed out - see also below the console output:

image

@JaWeilBaum
Copy link
Owner

This looks like leaflet is unable to load the map... Do you use a custom map layer/url? @MatinF

@MatinF
Copy link

MatinF commented Sep 14, 2022

I believe @danielhrisca can probably best answer as to the layer, but to my knowledge it is not non-standard.

It is also worth noting that with below dependencies, the GPS map works without issues:

PySide6==6.2.3


shiboken6==6.2.3

However, when we (for other reasons) need to update the dependencies, the GPS no longer shows as expected, but just plots the route with a grayed out map.

PySide6==6.3.2
PySide6-Addons==6.3.2
PySide6-Essentials==6.3.2
shiboken6==6.3.2

Do you have any thoughts as to why those changes to the dependencies might cause the map to gray out? No other changes to dependencies are made between the tests.

@JaWeilBaum
Copy link
Owner

Sounds odd - maybe one of the new packages blocks/restricts network traffic and therefore the map can't be loaded.

Could you try this with the default map layer?
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(self.map)

If you want to use local map files you could also do this in the following way:

custom_local_layer = os.path.join(os.getcwd(), "clip", "merged", "512", "latest", "{z}", "{x}", "{y}.png")
L.tileLayer(custom_local_layer.replace("\\", "/")).addTo(self._map)

You may need to look into the way paths are made on your system.

@danielhrisca
Copy link
Author

Using L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(self.map) does not work

@JaWeilBaum
Copy link
Owner

This seems strange - The only reason I can think of, might be that with the version bump of PySide 6, they introducded a network restriction for components. During a quick search I didn't find a thing...

@psa95
Copy link

psa95 commented Oct 7, 2022

The default map (osm) shows when using folium 0.12.1.post1 with PySide6 6.3.2

However, the issue persists with pyqtlet.

@JaWeilBaum
Copy link
Owner

@psa95 What do you mean by using folium instead of pyqtlet ?

@psa95
Copy link

psa95 commented Oct 8, 2022

@psa95 What do you mean by using folium instead of pyqtlet ?

If you install folium with pip install folium and use that to generate the osm map, it successfully renders it in PySide6. Folium is also based off of leaflet.

However, if we uninstall folium and use pyqtlet instead, the map shows a grayed out screen.

@MatinF
Copy link

MatinF commented Oct 9, 2022

@danielhrisca Perhaps this could be a solution in asammdf?

@danielhrisca
Copy link
Author

Last time I checked there was no way to have a movable cursor

@Omega-Networks
Copy link

Has anyone had success running this in Qt6?

@Omega-Networks
Copy link

It appears we are unable to reference the map. JS console suggests we are trying to read 'mapObject' which is returning null.

If anyone is available to assist with troubleshooting we can arrange a teams session. Currently working on reverse engineering this but so far unsuccessful.

We have been able to get Leaflet running inside PySide6 6.4.1 using a custom wrapper; however, best to build one as a community.

Error message: javaScriptConsoleMessage: message: Uncaught TypeError: Cannot read properties of null (reading 'mapObject'), level: JavaScriptConsoleMessageLevel.ErrorMessageLevel, lineNumber: 1


Occurs:

After or during initiation of the map.

self.map = L.map(self.mapWidget)
self.map.setView([12.97, 77.59], 10)

  1. Map is initiated
  2. On setting view the error occurs

Affected Versions (Tested PySide6 Only):

PySide6 >6.2.3

While testing PySide6.2.4 we ran into an additional error.

UNSUPPORTED (log once): POSSIBLE ISSUE: unit 0 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
js: Uncaught TypeError: Cannot read property 'mapObject' of null

@JaWeilBaum
Copy link
Owner

Hi @Omega-Networks thanks for looking into this. I tried to setup a local test environment for pyside6 but ran into issues while setting it up. I'll have a look into this probably tomorrow and will check what I can see.

What did you do in your custom wrapper, what was the workaround there?

@MarkusDanielsson91
Copy link

Any progress on this? Same problem with PySide6.4.2

@JaWeilBaum
Copy link
Owner

No sadly not. I guess during the installation something with the bindings to PySide goes wrong. I never used PySide 6 on my end therefore I don't have much experience with this.

@danielhrisca
Copy link
Author

For our use case the maps stopped working starting with PySide6 6.2.4

@danielhrisca
Copy link
Author

How can I enable debug logs/prints for the JS library? At the moment there is nothing printed when the maps widget fails to display correctly, and I have the feeling that I'm missing some important debug information

@lqucool
Copy link

lqucool commented Sep 3, 2023

PySide6 6.2.2 work fine

@danielhrisca
Copy link
Author

Thanks to @zariiii9003, I think that the fix is to set this attribute on the map widget (tested on PySide6)

from PySide6.QtWebEngineCore import QWebEngineSettings
mapWidget = MapWidget()
mapWidget.settings().setAttribute(QWebEngineSettings.WebAttribute.LocalContentCanAccessRemoteUrls, True)

@Leo-Aqua
Copy link

refer to #67 for a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants