Wrong Tile Coordinates from Custome Tile Provider

Hi folks,

I have a custom tile server (http servlet) that responds to queries from a UrlTemplateImageryProvider with a z / x / y scheme:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
baseLayerPicker: false,
imageryProvider: new Cesium.UrlTemplateImageryProvider({
url: ‘http://localhost:8081/{z}/{x}/{y}’,
credit : ‘Credit’,
minimumLevel:0, // tried 1 here as well without success
maximumLevel:5,
}),
geocoder: false // no default bing maps
});

``

When the viewer is displayed its contents are garbled somehow:

I’ve added a TileCoordinatesImageryProvider to help debug this.

I’m trying to figure out what’s going wrong by using my web browser to request the same tileCoordinatesImageryProvider boundaries:

(Hopefully the image attachment gets rendered alright) You can tell that L1X0Y1 on Cesium is a western view of North America whereas what my mbtiles servlet when accessed by a browser (image on the right side) shows an image of North America and Greenland. Both Cesium and the browser are using the same tile server. I’ve tried various combinations of reversX/Y/Z without success. I’m at a loss. Anyone have any thoughts?

Thanks in advance.

Ian

SOLUTION:
Since my tile data originated from OSM, the tilingScheme required for the debug helper TileCoordinatesImageryProvider **should have been WebMercatorTilingScheme.
** AND
I needed to change my request template to use {reverseY} instead of {y}…

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
baseLayerPicker: false,
imageryProvider: new Cesium.UrlTemplateImageryProvider({
url: ‘http://localhost:8081/{z}/{x}/{reverseY}’,
credit : ‘Credit’,
minimumLevel:0,
maximumLevel:5,
}),
geocoder: false // no default bing maps
});

``

``

**POTENTIAL ISSUE:
** I found that the default minimumLevel for the imagery providers was a bit misleading. They are documented as "al

            The minimum level-of-detail supported by the imagery provider."  BUT when the viewer starts, its 1st tile request will issue minimumLevel+1.

In my case my mbtiles zoom levels were from 1-5, I was setting the minimumLevel to 1 but the 1st GET was for level 2!