Cant get WebMapTileServiceImageryProvider to work with WebMercatorTilingScheme

var test = new Cesium.WebMapTileServiceImageryProvider({
url: “http://kortforsyningen.kms.dk/orto_foraar?service=WMTS&request=GetTile&version=1.0.0&layer=orto_foraar&style={Style}&tilematrixset={TileMatrixSet}&tilematrix={TileMatrix}&tilerow={TileRow}&tilecol={TileCol}&login=&password=&format=image/jpeg”,
layer: “orto_foraar”,
style: “default”,
tileMatrixSetID: “View1”,
tileMatrixLabels: [“L00”, “L01”, “L02”, “L03”, “L04”, “L05”, “L06”, “L07”, “L08”, “L09”, “L10”, “L11”, “L12”, “L13”],
format: “image/jpg”,
rectangle: Cesium.Rectangle.fromDegrees(3.32016, 53.113655, 17.55777, 58.35397),
tilingScheme: new Cesium.WebMercatorTilingScheme({
rectangleSouthwestInMeters: new Cesium.Cartesian2(120000, 5900000),
rectangleNortheastInMeters: new Cesium.Cartesian2(1000000, 6500000),
numberOfLevelZeroTilesX: 3,
numberOfLevelZeroTilesY:2,
})
});
this.viewer.imageryLayers.addImageryProvider(test);

``

i removed the credentials for the url, but cesium fails before it start loading tiles.

Cesium.js?bust=v267115-594:460

Uncaught TypeError: Cannot read property ‘x’ of undefined

the 1.12 minified file.

Is the configuration correct above or am i missing something. If its correct I can try debug some more.

I got this when using the unminifized version,

Uncaught DeveloperError: The imagery provider’s rectangle and minimumLevel indicate that there are 6 tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.
Error

I got those from the http://kortforsyningen.kms.dk/orto_foraar?request=GetCapabilities&service=WMTS&version=1.0.0 document, but I guess I can recalculate some bounds to make it fit the tiling schema and make it work. will give it a try

doh, nvm, i am mixing up the documents and reading from the wrong projection file.

Coordinates are wrong.

So, back with a reprojected layer in the right projection. http://ascend-xyz-maps-odin-weu.cloudapp.net/mapproxy/ascend-kortforsyningen/wmts/1.0.0/WMTSCapabilities.xml

I am unsure how I get past the https://github.com/AnalyticalGraphicsInc/cesium/blob/1.12/Source/Scene/WebMapTileServiceImageryProvider.js#L135 requirement when the first layer in my wtms is actually of 7 by 14 tiles as seen in the gapabilities document:

ows:Identifier00</ows:Identifier>

5851428.57143

-1878007.03 9436480.79

256

256

7

14

I found another of our wmts that has been configured more appropriated and got it working :

The configuration trick was to make sure that the WMTS has layers all the way to its lvl 0 of the tiling schema.
and use rectangle to limit where it should request tiles.

var test = new Cesium.WebMapTileServiceImageryProvider({

url:“http://ascend-xyz-maps-odin-weu.cloudapp.net/mapproxy/vd-ortho-april-2014-v2/wmts/VDOrtho2014AprilWebMercator/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.jpeg”,// url: “http://kortforsyningen.kms.dk/orto_foraar?service=WMTS&request=GetTile&version=1.0.0&layer=orto_foraar&style={Style}&tilematrixset={TileMatrixSet}&tilematrix={TileMatrix}&tilerow={TileRow}&tilecol={TileCol}&login=pks-ascend-xyz&password=3erQRJAd&format=image/jpeg”,

layer: “VDOrtho2014AprilWebMercator”,

style: “default”,

tileMatrixSetID: “GLOBAL_WEBMERCATOR”,

tileMatrixLabels: [“00”, “01”, “02”, “03”, “04”, “05”, “06”, “07”, “08”, “09”, “10”, “11”, “12”, “13”, “14”, “15”, “16”, “17”, “18”, “19”],

format: “image/jpg”,

rectangle: Cesium.Rectangle.fromDegrees(11.25, 55.5791209568, 12.0327758789, 56.0310189643), //Cesium.Rectangle.fromDegrees(3.32016, 53.113655, 17.55777, 58.35397),

});