MapTiler map for Cesium

I'm trying to use a tileset generated with MapTiler. Everything looks honky-dory, but the console error shows Cesium looking for map tiles named differently from how the ones MapTiler generates are named. For example, while I may have a level 11 with a folder called 501 in it, none of the .pngs inside are named the same as what Cesium is looking for.

I've tried EPSG:900913 and EPSG:4326 settings in MapTiler. I've tried converting meters to degrees (from 900913) in tilemapresource.xml. I'm using the following code to load the tileset.

    layers = viewer.scene.imageryLayers
    offlineLayer = layers.addImageryProvider(new Cesium.TileMapServiceImageryProvider({
        url: Cesium.buildModuleUrl('maps/test5'),
    }));

I don't know much about GIS, so any help would be appreciated.

Ciao

I use the following settings in MapTiler for a “normal” image:

  • EPSG:4326
  • Set bounding box manually (this results in a small shift in the final product, not that big but still visible, I don’t know why but can’t change it)).
  • Set an enough big zoom range (as far as I understand the zoom level depends not only on the height over ground at nadir but also on the tilt-angle, i.e. the distance you are looking -> smaller zoom lever than at nadir); so make sure that you have enough data -> render enough levels.
  • Click on “Advanced options” and set Tiling Scheme to “OSGEO TMS (bottom-left origin)”. But as you say that you have an tilemapresource.xml file I guess you have this option set.

I can’t test it right now (and do not know if it has any effect at all), but maybe you can try to complete the code a bit with more options: fileExtension; minimumLevel; maximumLevel; tileWidth; tileHeight.

Regards
Martin

Thanks Martin. I looked at the Cesium code a bit more as per your suggestions, and it turns out the issue was simply that I used Cesium.buildModuleURL() instead of just putting a string. I don't recall what tutorial/demo I got that line from, but that was the culprit, not my map. Thanks for getting me in the right direction.

Danny