qwc-services / qwc-docker

Docker containers for qwc-services
MIT License
48 stars 36 forks source link

WMTS backgroudLayer with api key #86

Closed ZedeN1 closed 1 month ago

ZedeN1 commented 1 month ago

I would like to add UK OS Maps WMTS layer as a background map. However, I could not find a way to add the key to the url as it seems to strip all parts after the ? from the specified url. Is there a workaround?

My themesConfig.json backgroundLayers entry:

      {
        "type": "wmts",
        "url": "https://api.os.uk/maps/raster/v1/wmts?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=Light_3857&STYLE=default&FORMAT=image/png&TILEMATRIXSET={TileMatrixSet}&TILEMATRIX=EPSG:3857:{TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}",
        "name": "WMTS",
        "format": "image/png",
        "requestEncoding": "KVP",
        "tileMatrixPrefix": "EPSG:3857",
        "tileMatrixSet": "EPSG:3857",
        "originX": -20037508.342787,
        "originY": 20037508.342787,
        "projection": "EPSG:3857",
        "tileSize": [
          256,
          256
        ],
        "style": "default",
        "bbox": {
          "crs": "EPSG:4326",
          "bounds": [
            -10.764179999999964,
            49.52842300000003,
            1.9134115552,
            61.3311510086
          ]
        },
        "resolutions": [
          1222.9924523698928,
          611.4962261850814,
          305.7481130924087,
          152.87405654633633,
          76.43702827303586,
          38.21851413651793,
          19.109257068258966,
          9.554628534129483,
          4.777314267197037,
          2.3886571335985134,
          1.1943285666669667,
          0.5971642834657753,
          0.2985821416005962,
          0.1492910708002979
        ],
        "thumbnail": "Light_3857.jpg"
      }

Looking at the GET request, it does not contain the key:

https://api.os.uk/maps/raster/v1/wmts?layer=WMTS&style=default&tilematrixset=EPSG%3A3857&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=EPSG%3A38577&TileCol=8184&TileRow=5446

ZedeN1 commented 1 month ago

Realised this is the wrong place to post this issue. https://github.com/qgis/qwc2-demo-app/issues/586