qgis / qwc2-demo-app

QWC2 demo application
Other
243 stars 155 forks source link

Some Vector Tile style sheets don't work with custom viewer. #587

Open ZedeN1 opened 1 week ago

ZedeN1 commented 1 week ago

I compiled a custom viewer as per #586. For the Vector Tile Grayscale backgroundLayer below, the custom viewer does not GET the tiles if the Greyscale style is used. The same vector tile with the colour styles works OK.

I can see that Firefox manages to GET the greyscale style json. I don't see any logs that would explain or point at the issue.

The default qwc-docker viewer manages to display the same Vector Tile without problem.

{
        "name": "Vector Tile Grayscale",
        "type": "mvt",
        "url": "https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key=xxxxxx",
        "style": "https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/master/OS_VTS_3857_Greyscale.json",
        "declutter": false,
        "projection": "EPSG:3857",
        "thumbnail": "vt_grayscale.png"
      },
      {
        "name": "Vector Tile Colour",
        "type": "mvt",
        "url": "https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key=xxxxxx",
        "style": "https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key=xxxxxx",
        "declutter": false,
        "projection": "EPSG:3857",
        "thumbnail": "vt_colour.png"
      },
ZedeN1 commented 1 week ago

Reverting components/map/layers/MVTLayer.js to https://github.com/qgis/qwc2/blob/c3159281e9021cd504783f7d3873e192c8fe8aee/components/map/layers/MVTLayer.js fixes the issue.

Commit https://github.com/qgis/qwc2/commit/f310a2e815f62ea2ea524b592a1b95cb302c85ee seems to be the cause

manisandro commented 1 week ago

I'll need to look into this. How can one obtain a key for this service?

ZedeN1 commented 1 week ago

https://osdatahub.os.uk/

It's free under fair use.

manisandro commented 6 days ago

Does [1] help along with

                    {
                "name": "os_uk_vt_colour",
                "type": "mvt",
                "url": "https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key=xxx",
                "style": "https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key=xxx",
                "declutter": false,
                "projection": "EPSG:3857",
                "thumbnail": "vt_colour.png",
                "styleOptions": {
                    "accessTokenParam": "key",
                    "accessToken": "xxx"
                }
              }

? For me, it renders the colour style correctly. It also renders the gray style, but completely off-place.

[1] https://github.com/qgis/qwc2/commit/e2e49d04a6cf4a3f128aa7fb1966aa58f2b661e3