Cesium.js and WMTS

hello i can’t view my wmts layer that i propagate through geoserver on cesium.js. where am i doing wrong

   <script >
        var viewer = new Cesium.Viewer("cesiumContainer",{
                         Geocoder: false,
                         Animation: true,
                         CreditsDisplay: false,
                         Timeline: false,
                         FullscreenButton: false
        });
       viewer.scene.primitives.add(Cesium.createOsmBuildings());
      
var wmtsImageryProvider = new Cesium.WebMapTileServiceImageryProvider({
    url : 'http://localhost:8084/geoserver/gwc/service/wmts',
    layer : 'osm_water',
    style : 'default',
    format : 'image/png',
    tileMatrixSetID : 'EPSG:4326',
    
    //maximumLevel:5
});

viewer.imageryLayers.addImageryProvider(wmtsImageryProvider);

</script>

Hi there,

This example may help by incorporating the current viewer time into your WMTS requests.

hi i keep getting error like this on cesium.wiever

It looks like CesiumJS is running into errors while requesting imagery tiles from the WMTS server. This is troubleshoot since we don’t have access to the locally running WMTS server, so I can’t be sure if the problem is with CesiumJS or the server configuration. I would recommend starting by checking the network tab and checking why the requests are failing. For instance, if you are seeing 404 errors I would check to make sure you have the correct URL and that the server is actually serving the tiles to the correct location.

Hi @T.T,

maybe your Geoserver needs a “RESTful” request, so you could try the following url:

"http://localhost:8084/geoserver/gwc/service/wmts/osm_water/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png"

Best, Lennart