qgis / qwc2-demo-app

QWC2 demo application
Other
240 stars 149 forks source link

Calling by URL: where is 'style' located? #551

Closed mhaelsig closed 2 months ago

mhaelsig commented 2 months ago

I am calling from an external application with <hostname>/?l=layername with success.

Now I want to use different styles. This should work with <hostname/?l=layername{style}.

The layer is a geojson table in a Postgresql database, the style is stored in the table _layerstyles in this database. It seems to be that this style is not found, because the layer is always shown with the default style in my QGIS project.

Where is qwc2/the server searching for the style information?

Calling with debug=true gave no insight for me.

BTW: even when I call <hostname>/?l=layername[20] (for reduced transparency), nothing seems to change. Do I use the wrong syntax?

Thank you.

manisandro commented 2 months ago

The syntax is the correct one. To verify, you can chose the style in the QWC2 layer tree and modify the transparency, then look at the url what param is generated.

mhaelsig commented 2 months ago

Thank you for your quick response! But when I want to use another style for a layer - not the default style from the QGIS project - where has this style definition to be located? Inside the URL I can only define the name of the alternative style inside curly brackets. As described above, in my enviroment the layer is defined as a geojson in a Postgresql DB, and styles are stored in the table _layerstyles.

mhaelsig commented 2 months ago

Alternative styles are stored inside the QGIS-Project. They can be identified with .../?SERVICE=WMS&REQUEST=GetStyles&LAYERS=layername In my environment, alternative styles had suddenly disappeared in the QGIS-Project - therefore I could not use them calling from an external application. Now it works :-))