xcaeag / MenuFromProject-Qgis-Plugin

Build layers shortcuts menus based on QGis projects
8 stars 8 forks source link

Vectortiles get corrupted if added to a map #77

Closed bru500 closed 1 year ago

bru500 commented 1 year ago

When adding a vectortile to a menu, it gets corrupted when added via plugin. It seems to be added as a wrong type: the added layer has the icon of a vectorlayer instead of vectortile, and an unavailable datasource.

Example:

  1. Add the following vectortile service to a map: https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.leichte-basiskarte.vt/v2.0.0/{z}/{x}/{y}.pbf
  2. Put it in a Menu
  3. Add it to a map -> The Layer has an unavailable record source and the wrong icon.
xcaeag commented 1 year ago

In which version of the plugin and of QGis are you working? In QGis 3.28, plugin 2.0.6, the layer is well interpreted, like a vector tile layer...

image

bru500 commented 1 year ago

Sorry for the delay and thanks for checking. I'm on QGIS 3.28.4 with Layers menu from project 2.0.6 on windows 10. In the Menu, the vectortile has the correct item as in your screenshot: 2023-04-22 12_33_26-QGIS3 But when it, it apperas in the Layers panel, it gets the wrong icon and an unavailable datasource: 2023-04-22 12_34_37-_2_Schweiz — QGIS

Different datasource

Interesting, that the original layer and the one created by the plugin have different datasources: original: styleUrl=https://vectortiles.geo.admin.ch/styles/ch.swisstopo.leichte-basiskarte-imagery.vt/style.json&type=xyz&url=https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.leichte-basiskarte.vt/v2.0.0/%7Bz%7D/%7Bx%7D/%7By%7D.pbf&zmax=14&zmin=0&http-header:referer= created by plugin: styleUrl=https://vectortiles.geo.admin.ch/styles/ch.swisstopo.leichte-basiskarte.vt/style.json&type=xyz&url=https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.leichte-basiskarte.vt/v2.0.0/%7Bz%7D/%7Bx%7D/%7By%7D.pbf&zmax=14&zmin=0&http-header:referer= In the styleURL the part "-imagery.vt" is missing.

Demo project

I created a simple demo project. The qgz-FIle was used to create a menu from itself. One layer was created manualy and the other by the plugin: menu.zip I hope this helps to clarify. Thank's for the great plugin! Bruno

xcaeag commented 1 year ago

good news, the problem is reproduced, but it is not solved yet !

It occurs when the 'create a group' checkbox is checked, it works better otherwise.

I will try to understand the phenomenon.

xcaeag commented 1 year ago

v2.0.7 to be tested thank you for reporting this bug

bru500 commented 1 year ago

Thank you! I can confirm, that the bug is fixed.