AnsweredAssumed Answered

How to solve "too many root tiles" error?

Question asked by aslaken on Jan 20, 2020
Latest reply on Jan 26, 2020 by aslaken

Hi, 

 

I have an application where I would like to use a WebTileLayer as the basemap. The layer has a spatialreference with wkid 25833 (utm33). I have managed to get the layer to work in the MapView, but it does not work in the SceneView, due to it breaking the rule that the layer cannot have more than 30 tiles on the root level (level 0). 

 

Here is my definition of the layer from by source code: 

 

let mapBaseLayer = new WebTileLayer({
          urlTemplate: "https://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=matrikkel_bakgrunn2&style=default&tilematrixset=EPSG:25833&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix=EPSG:25833:{level}&TILEROW={row}&TILECOL={col}",
          subDomains: ["opencache", "opencache2", "opencache3"],
          spatialReference: { wkid: 25833 },
          tileInfo: {
            size: 256,
            dpi: 96,
            format: "PNG",
            origin: {
              x: -2500000,
              y: 9045984
            },
            spatialReference: {
              wkid: 25833,
              latestWkid: 25833
            },
            lods: [
              {
                level: 0,
                resolution: 21664,
                scale: 81920000
              },
              {
                level: 1,
                resolution: 10832,
                scale: 40960000
              },
              {
                level: 2,
                resolution: 5416,
                scale: 20480000
              },
              {
                level: 3,
                resolution: 2708,
                scale: 10240000
              },
              {
                level: 4,
                resolution: 1354,
                scale: 5120000
              },
              {
                level: 5,
                resolution: 677,
                scale: 2560000
              },
              {
                level: 6,
                resolution: 338.5,
                scale: 1280000
              },
              {
                level: 7,
                resolution: 169.25,
                scale: 640000
              },
              {
                level: 8,
                resolution: 84.625,
                scale: 320000
              },
              {
                level: 9,
                resolution: 42.3125,
                scale: 160000
              },
              {
                level: 10,
                resolution: 21.15625,
                scale: 80000
              },
              {
                level: 11,
                resolution: 10.578125,
                scale: 40000
              },
              {
                level: 12,
                resolution: 5.2890625,
                scale: 20000
              },
              {
                level: 13,
                resolution: 2.64453125,
                scale: 10000
              },
              {
                level: 14,
                resolution: 1.322265625,
                scale: 5000
              },
              {
                level: 15,
                resolution: 0.6611328125,
                scale: 2500
              },
              {
                level: 16,
                resolution: 0.33056640625,
                scale: 1250
              },
              {
                level: 17,
                resolution: 0.165283203125,
                scale: 625
              }
            ]
          }
        });

 

 

I'm wondering: Is there anything I can do on the client side to make this work, or is this simply a problem of the service that I'm using, making it impossible to use this layer in a sceneview?

 

Also, I'm thinking that maybe my tileInfo settings are incorrect. I've set it up according to the documentation of the service but maybe I've misunderstood some aspects. Does my tileInfo look correct? 

Outcomes