qgis / qwc2-demo-app

QWC2 demo application
Other
240 stars 149 forks source link

edithing themesconfig.json #532

Closed Mrpolit closed 3 months ago

Mrpolit commented 3 months ago

Hi,wanted to report a problem about loading a qgis project , so when i add my .qgs file url to themesConfigs.json it works without error but when i run project as development and select my added theme it shows nothing and when i was looking at network requests i found out that requested STYLE was not correct , so i just commented part of the qwc2 code that was responsible for assigning STYLE and it worked!!!!

files i have changed: qwc2-demo-app/qwc2/scripts/themesConfig.js line 209 to 212

manisandro commented 3 months ago

What GetMap request did QWC2 generate with the style? (You can inspect the network traffic in the browser via F12 -> Network)

Mrpolit commented 3 months ago

What GetMap request did QWC2 generate with the style? (You can inspect the network traffic in the browser via F12 -> Network)

hi , i did and it gave me 500 status i did try to use the get url to see if the app is broken or not but the result was same i can give you .qgs project file and my theme config so you can see my issue your self

added json code :

"themes":{ "items":[ { "title": "QGIS tutorial Map", "url": "http://45.156.184.164:3000/cgi-bin/qgis_mapserv.fcgi?MAP=/home/qgis/projects/tutorial/world.qgs", "default": true, "scales": [50000000, 25000000.0, 12500000.0, 6250000.0, 3125000.0, 1562500.0, 781250.0, 390625.0, 195312.5, 97656.25, 48828.125], "extent": [-9546172, -884033, 12504796, 12051177], "backgroundLayers": [ { "name": "mapnik" } ], "mapCrs": "EPSG:3857", "searchProviders": ["coordinates"], "config": { "preserveExtentOnThemeSwitch": false }

qgs files: tutorial.zip

manisandro commented 3 months ago

Can you copy the URL of the request that produces the 500 response?

Mrpolit commented 3 months ago

i know following question is not relevant to this issue but i wanted to know if i make a Persian json language can i give it to you so you can add it to the supported languages? currently i am working on it you can visit my modified version in 45.156.184.164:3000/prod

Mrpolit commented 3 months ago

Can you copy the URL of the request that produces the 500 response?

this is one of the in correct requests http://45.156.184.164:3000/cgi-bin/qgis_mapserv.fcgi?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=name%2Cname%2C&TRANSPARENT=true&MAP=%2Fhome%2Fqgis%2Fprojects%2Ftutorial%2Fworld.qgs&LAYERS=countries_shapeburst%2Ccountries%2Cairports&SRS=EPSG%3A3857&CRS=EPSG%3A3857&TILED=false&OPACITIES=255%2C255%2C255&__t=1710253758965&FILTER=&WIDTH=817&HEIGHT=775&BBOX=-1616313%2C3592582.4166666674%2C3787801.583333333%2C8718884.5

this time it gave me this error: Style 'name' does not exist for layer 'countries'

manisandro commented 3 months ago

Thanks, this is fixed in https://github.com/qgis/qwc2/commit/22bd8fe97a942110b44b4d1a5f4570bdf1c823ff.

Regarding Persian, sure feel free to submit a PR with the translation file. Thanks!